diff --git a/.gitmodules b/.gitmodules index dbf5822a..ffccf036 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "deps/zlib"] path = deps/zlib url = https://github.com/madler/zlib +[submodule "deps/fmt"] + path = deps/fmt + url = https://github.com/fmtlib/fmt diff --git a/README.md b/README.md index 6a3fa88d..69ac6b19 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -[![build](https://ci.appveyor.com/api/projects/status/defmhg4753c1ap1o?svg=true)](https://ci.appveyor.com/project/xensik/gsc-tool) [![build](https://github.com/xensik/gsc-tool/workflows/Build/badge.svg)](https://github.com/xensik/gsc-tool/actions) ![license](https://img.shields.io/github/license/xensik/gsc-tool.svg) [![issues](https://img.shields.io/github/issues/xensik/gsc-tool)](https://github.com/xensik/gsc-tool/issues) @@ -13,7 +12,7 @@ A utility to compile & decompile IW engine game scripts. - **IW6** *(Call of Duty: Ghosts)* `PC` `PS3` `PS4` `Xbox 360` `Xbox One` - **IW7** *(Call of Duty: Infinite Warfare)* `PC` `PS4` `Xbox One` - **IW8** *(Call of Duty: Modern Warfare (2019) / Warzone)* `PC` `PS4` `PS5` `Xbox One` `Xbox Series X|S` -- **IW9** *(Call of Duty: Modern Warfare II (2022) / Warzone 2.0)* `PC` `PS4` `PS5` `Xbox One` `Xbox Series X|S` +- **IW9** *(Call of Duty: Modern Warfare II (2022) / Warzone 2)* `PC` `PS4` `PS5` `Xbox One` `Xbox Series X|S` - **S1** *(Call of Duty: Advanced Warfare)* `PC` `PS3` `PS4` `Xbox 360` `Xbox One` - **S2** *(Call of Duty: WWII)* `PC` `PS4` `Xbox One` - **S4** *(Call of Duty: Vanguard)* `PC` `PS4` `PS5` `Xbox One` `Xbox Series X|S` @@ -30,10 +29,10 @@ A utility to compile & decompile IW engine game scripts. **modes**: `asm`, `disasm`, `comp`, `decomp` - *note:* zonetool files (*.cgsc*, *.cgsc.stack*) use: `zasm`, `zdisasm`, `zcomp`, `zdecomp` modes -**games**: `iw5`, `iw6`, `iw7`, `iw8`, `s1`, `s2`, `s4`, `h1`, `h2`, `t6` -- *note:* PS3 & Xbox 360 use `iw5c`, `iw6c`, `s1c` games +**games**: `iw5`, `iw6`, `iw7`, `iw8`, `iw9`, `s1`, `s2`, `s4`, `h1`, `h2`, `t6` +- *note:* PS3 & Xbox 360 use `iw5ps`, `iw5xb`, `iw6ps`, `iw6xb`, `s1ps`, `s1xb` games -**paths**: `file`, `directory` (recursive process all files inside the directory) +**paths**: `file` or `directory` (recursive process all files inside the directory) Example: ``./gsc-tool.exe comp iw5 ./data/iw5/my_fancy_script.gsc`` diff --git a/deps/fmt b/deps/fmt new file mode 160000 index 00000000..a3370119 --- /dev/null +++ b/deps/fmt @@ -0,0 +1 @@ +Subproject commit a33701196adfad74917046096bf5a2aa0ab0bb50 diff --git a/deps/fmt.lua b/deps/fmt.lua new file mode 100644 index 00000000..ebf7c59c --- /dev/null +++ b/deps/fmt.lua @@ -0,0 +1,31 @@ +fmt = { base = path.join(dependencies.base, "fmt") } + +function fmt:include() + includedirs { path.join(fmt.base, "include") } +end + +function fmt:link() + links { "fmt" } + self:include() +end + +function fmt:project() + project "fmt" + kind "StaticLib" + language "C++" + + self:include() + + files + { + path.join(fmt.base, "include/fmt/*.h"), + path.join(fmt.base, "src/*.cc") + } + + removefiles + { + path.join(fmt.base, "src/fmt.cc") + } +end + +table.insert(dependencies, fmt) diff --git a/gen/experimental/iw5c/Makefile b/gen/experimental/iw5c/Makefile deleted file mode 100644 index d922f2b8..00000000 --- a/gen/experimental/iw5c/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -generate: iw5c - -clean: - rm -rf ./parser.hpp - rm -rf ./parser.cpp - -iw5c: parser.ypp - bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../../src/experimental/iw5c/xsk/ diff --git a/gen/experimental/iw5c/parser.ypp b/gen/experimental/iw5c/parser.ypp deleted file mode 100644 index 5fce612c..00000000 --- a/gen/experimental/iw5c/parser.ypp +++ /dev/null @@ -1,888 +0,0 @@ -/* 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 {IW5C} -%define api.namespace {xsk::gsc::iw5c} -%define api.location.type {xsk::gsc::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::gsc::iw5c::lexer& lexer } -%parse-param { xsk::gsc::iw5c::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw5c.hpp" -namespace xsk::gsc::iw5c { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw5c::parser::symbol_type IW5Clex(xsk::gsc::iw5c::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 ANIMTREE "#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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::iw5c::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/experimental/iw6c/Makefile b/gen/experimental/iw6c/Makefile deleted file mode 100644 index 2f177794..00000000 --- a/gen/experimental/iw6c/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -generate: iw6c - -clean: - rm -rf ./parser.hpp - rm -rf ./parser.cpp - -iw6c: parser.ypp - bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../../src/experimental/iw6c/xsk/ diff --git a/gen/experimental/iw6c/parser.ypp b/gen/experimental/iw6c/parser.ypp deleted file mode 100644 index 750c498c..00000000 --- a/gen/experimental/iw6c/parser.ypp +++ /dev/null @@ -1,888 +0,0 @@ -/* 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 {IW6C} -%define api.namespace {xsk::gsc::iw6c} -%define api.location.type {xsk::gsc::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::gsc::iw6c::lexer& lexer } -%parse-param { xsk::gsc::iw6c::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw6c.hpp" -namespace xsk::gsc::iw6c { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw6c::parser::symbol_type IW6Clex(xsk::gsc::iw6c::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 ANIMTREE "#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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::iw6c::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/experimental/s1c/Makefile b/gen/experimental/s1c/Makefile deleted file mode 100644 index d533caf4..00000000 --- a/gen/experimental/s1c/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -generate: s1c - -clean: - rm -rf ./parser.hpp - rm -rf ./parser.cpp - -s1c: parser.ypp - bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../../src/experimental/s1c/xsk/ diff --git a/gen/experimental/s1c/parser.ypp b/gen/experimental/s1c/parser.ypp deleted file mode 100644 index 420aa3e6..00000000 --- a/gen/experimental/s1c/parser.ypp +++ /dev/null @@ -1,898 +0,0 @@ -/* 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 {S1C} -%define api.namespace {xsk::gsc::s1c} -%define api.location.type {xsk::gsc::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::gsc::s1c::lexer& lexer } -%parse-param { xsk::gsc::s1c::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "s1c.hpp" -namespace xsk::gsc::s1c { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::s1c::parser::symbol_type S1Clex(xsk::gsc::s1c::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 ANIMTREE "#animtree" -%token ENDON "endon" -%token NOTIFY "notify" -%token WAIT "wait" -%token WAITTILL "waittill" -%token WAITTILLMATCH "waittillmatch" -%token WAITTILLFRAMEEND "waittillframeend" -%token WAITFRAME "waitframe" -%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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_waitframe -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_waitframe { $$.as_waitframe = 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_waitframe - : WAITFRAME SEMICOLON - { $$ = std::make_unique(@$); } - | WAITFRAME LPAREN RPAREN 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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::s1c::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/h2/Makefile b/gen/gsc/Makefile similarity index 54% rename from gen/h2/Makefile rename to gen/gsc/Makefile index d6c2a77d..b3776bcf 100644 --- a/gen/h2/Makefile +++ b/gen/gsc/Makefile @@ -1,9 +1,9 @@ -generate: h2 +generate: gsc clean: rm -rf ./parser.hpp rm -rf ./parser.cpp -h2: parser.ypp +gsc: parser.ypp bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../src/h2/xsk/ + mv parser.hpp parser.cpp ../../src/gsc/ diff --git a/gen/gsc/parser.ypp b/gen/gsc/parser.ypp new file mode 100644 index 00000000..cd05b8ab --- /dev/null +++ b/gen/gsc/parser.ypp @@ -0,0 +1,982 @@ +/* Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%require "3.7" +%skeleton "lalr1.cc" +%language "c++" +%output "parser.cpp" +%defines "parser.hpp" +%define api.prefix {GSC} +%define api.namespace {xsk::gsc} +%define api.location.type {xsk::gsc::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::gsc::lexer& lexer } +%parse-param { xsk::gsc::context const* ctx_ } +%parse-param { xsk::gsc::lexer& lexer } +%parse-param { xsk::gsc::program::ptr& ast } +%parse-param { std::uint32_t index } + +%code requires +{ +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif +#include "context.hpp" +namespace xsk::gsc { class lexer; } +} + +%code top +{ +#include "stdinc.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +namespace xsk::gsc +{ + auto GSClex(lexer& lexer) -> parser::symbol_type; + auto parse_switch(stmt_switch& stm) -> void; +} +} + +%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 ANIMTREE "#animtree" +%token ENDON "endon" +%token NOTIFY "notify" +%token WAIT "wait" +%token WAITTILL "waittill" +%token WAITTILLMATCH "waittillmatch" +%token WAITTILLFRAMEEND "waittillframeend" +%token WAITFRAME "waitframe" +%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 CHILDTHREAD "childthread" +%token THISTHREAD "thisthread" +%token CALL "call" +%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 ISDEFINED "isdefined" +%token ISTRUE "istrue" +%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 PATH "path" +%token IDENTIFIER "identifier" +%token STRING "string literal" +%token ISTRING "localized string" +%token FLOAT "float" +%token INTEGER "integer" + +%type program +%type include +%type declaration +%type decl_usingtree +%type decl_function +%type stmt +%type stmt_or_dev +%type stmt_list +%type stmt_or_dev_list +%type stmt_dev +%type stmt_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_waitframe +%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_negate +%type expr_not +%type expr_call +%type expr_method +%type expr_function +%type expr_pointer +%type expr_add_array +%type expr_parameters +%type expr_arguments +%type expr_arguments_no_empty +%type expr_isdefined +%type expr_istrue +%type expr_reference +%type expr_tuple +%type expr_tuple_arguments +%type expr_tuple_types +%type expr_array +%type expr_field +%type expr_size +%type expr_paren +%type expr_object +%type expr_thisthread +%type expr_empty_array +%type expr_undefined +%type expr_game +%type expr_self +%type expr_anim +%type expr_level +%type expr_animation +%type expr_animtree +%type expr_identifier_nosize +%type expr_identifier +%type expr_path +%type expr_istring +%type expr_string +%type expr_vector +%type expr_float +%type expr_integer +%type expr_false +%type expr_true + +%nonassoc SIZEOF +%nonassoc ADD_ARRAY +%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 = make_program(@$); } + ; + +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 + { $$ = make_program(@$); } + | include + { $$ = make_program(@$); $$->includes.push_back(std::move($1)); } + | declaration + { $$ = make_program(@$); $$->declarations.push_back(std::move($1)); } + ; + +inline + : INLINE expr_path SEMICOLON { lexer.push_header($2->value); } + ; + +include + : INCLUDE expr_path SEMICOLON + { $$ = make_include(@$, std::move($2)); } + ; + +declaration + : DEVBEGIN { $$.as_dev_begin = make_decl_dev_begin(@$); } + | DEVEND { $$.as_dev_end = make_decl_dev_end(@$); } + | decl_usingtree { $$.as_usingtree = std::move($1); } + | decl_function { $$.as_function = std::move($1); } + ; + +decl_usingtree + : USINGTREE LPAREN expr_string RPAREN SEMICOLON + { lexer.ban_header(@$); $$ = make_decl_usingtree(@$, std::move($3)); } + ; + +decl_function + : expr_identifier LPAREN expr_parameters RPAREN stmt_block + { lexer.ban_header(@$); $$ = make_decl_function(@$, 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_waitframe { $$.as_waitframe = 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 + { $$ = make_stmt_list(@$); $$->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 + { $$ = make_stmt_list(@$); $$->list.push_back(std::move($1)); } + ; + +stmt_dev + : DEVBEGIN stmt_list DEVEND { $$ = make_stmt_dev(@$, std::move($2)); } + | DEVBEGIN DEVEND { $$ = make_stmt_dev(@$, make_stmt_list(@$)); } + ; + +stmt_block + : LBRACE stmt_or_dev_list RBRACE { $$ = std::move($2); } + | LBRACE RBRACE { $$ = make_stmt_list(@$); } + ; + +stmt_expr + : expr_assign + { $$ = make_stmt_expr(@$, std::move($1)); } + | expr_increment + { $$ = make_stmt_expr(@$, std::move($1)); } + | expr_decrement + { $$ = make_stmt_expr(@$, std::move($1)); } + | + { $$ = make_stmt_expr(@$, make_node(@$)); } + ; + +stmt_call + : expr_call SEMICOLON + { $$ = make_stmt_call(@$, expr{ std::move($1) }); } + | expr_method SEMICOLON + { $$ = make_stmt_call(@$, expr{ std::move($1) }); } + ; + +stmt_assign + : expr_assign SEMICOLON + { $$ = make_stmt_assign(@$, std::move($1)); } + | expr_increment SEMICOLON + { $$ = make_stmt_assign(@$, std::move($1)); } + | expr_decrement SEMICOLON + { $$ = make_stmt_assign(@$, std::move($1)); } + ; + +stmt_endon + : expr_object ENDON LPAREN expr RPAREN SEMICOLON + { $$ = make_stmt_endon(@$, std::move($1), std::move($4)); } + ; + +stmt_notify + : expr_object NOTIFY LPAREN expr COMMA expr_arguments_no_empty RPAREN SEMICOLON + { $$ = make_stmt_notify(@$, std::move($1), std::move($4), std::move($6)); } + | expr_object NOTIFY LPAREN expr RPAREN SEMICOLON + { $$ = make_stmt_notify(@$, std::move($1), std::move($4), make_expr_arguments(@$)); } + ; + +stmt_wait + : WAIT expr SEMICOLON + { $$ = make_stmt_wait(@$, std::move($2)); } + ; + +stmt_waittill + : expr_object WAITTILL LPAREN expr COMMA expr_arguments_no_empty RPAREN SEMICOLON + { $$ = make_stmt_waittill(@$, std::move($1), std::move($4), std::move($6)); } + | expr_object WAITTILL LPAREN expr RPAREN SEMICOLON + { $$ = make_stmt_waittill(@$, std::move($1), std::move($4), make_expr_arguments(@$)); } + ; + +stmt_waittillmatch + : expr_object WAITTILLMATCH LPAREN expr COMMA expr_arguments_no_empty RPAREN SEMICOLON + { $$ = make_stmt_waittillmatch(@$, std::move($1), std::move($4), std::move($6)); } + | expr_object WAITTILLMATCH LPAREN expr RPAREN SEMICOLON + { $$ = make_stmt_waittillmatch(@$, std::move($1), std::move($4), make_expr_arguments(@$)); } + ; + +stmt_waittillframeend + : WAITTILLFRAMEEND SEMICOLON + { $$ = make_stmt_waittillframeend(@$); } + ; + +stmt_waitframe + : WAITFRAME SEMICOLON + { $$ = make_stmt_waitframe(@$); } + | WAITFRAME LPAREN RPAREN SEMICOLON + { $$ = make_stmt_waitframe(@$); } + ; + +stmt_if + : IF LPAREN expr RPAREN stmt %prec THEN + { $$ = make_stmt_if(@$, std::move($3), std::move($5)); } + ; + +stmt_ifelse + : IF LPAREN expr RPAREN stmt ELSE stmt + { $$ = make_stmt_ifelse(@$, std::move($3), std::move($5), std::move($7)); } + ; + +stmt_while + : WHILE LPAREN expr RPAREN stmt + { $$ = make_stmt_while(@$, std::move($3), std::move($5)); } + ; + +stmt_dowhile + : DO stmt WHILE LPAREN expr RPAREN SEMICOLON + { $$ = make_stmt_dowhile(@$, std::move($5), std::move($2)); } + ; + +stmt_for + : FOR LPAREN stmt_expr SEMICOLON expr_or_empty SEMICOLON stmt_expr RPAREN stmt + { $$ = make_stmt_for(@$, stmt{ std::move($3) }, std::move($5), stmt{ std::move($7) }, std::move($9)); } + ; + +stmt_foreach + : FOREACH LPAREN expr_identifier IN expr RPAREN stmt + { + auto array = expr{ make_expr_identifier(@$, fmt::format("_temp_{}", ++index)) }; + auto key = expr{ make_expr_identifier(@$, fmt::format("_temp_{}", ++index)) }; + $$ = make_stmt_foreach(@$, std::move($5), expr{ std::move($3) }, expr{ make_node(@$) }, std::move(array), std::move(key), std::move($7), false); } + | FOREACH LPAREN expr_identifier COMMA expr_identifier IN expr RPAREN stmt + { + auto array = expr{ make_expr_identifier(@$, fmt::format("_temp_{}", ++index)) }; + auto key = (ctx_->props() & props::foreach) ? expr{ make_expr_identifier(@$, fmt::format("_temp_{}", ++index)) } : expr{ std::move($3) }; + $$ = make_stmt_foreach(@$, std::move($7), expr{ std::move($5) }, (ctx_->props() & props::foreach) ? expr{ std::move($3) } : expr{ make_node(@$) }, std::move(array), std::move(key), std::move($9), true); + } + ; + +stmt_switch + : SWITCH LPAREN expr RPAREN stmt_block + { $$ = make_stmt_switch(@$, std::move($3), std::move($5)); + parse_switch(*$$); + } + ; + +stmt_case + : CASE expr_integer COLON + { $$ = make_stmt_case(@$, expr{ std::move($2) }, make_stmt_list(@$)); } + | CASE expr_string COLON + { $$ = make_stmt_case(@$, expr{ std::move($2) }, make_stmt_list(@$)); } + ; + +stmt_default + : DEFAULT COLON + { $$ = make_stmt_default(@$, make_stmt_list(@$)); } + ; + +stmt_break + : BREAK SEMICOLON + { $$ = make_stmt_break(@$); } + ; + +stmt_continue + : CONTINUE SEMICOLON + { $$ = make_stmt_continue(@$); } + ; + +stmt_return + : RETURN expr SEMICOLON + { $$ = make_stmt_return(@$, std::move($2)); } + | RETURN SEMICOLON + { $$ = make_stmt_return(@$, make_node(@$)); } + ; + +stmt_breakpoint + : BREAKPOINT SEMICOLON + { $$ = make_stmt_breakpoint(@$); } + ; + +stmt_prof_begin + : PROFBEGIN LPAREN expr_arguments RPAREN SEMICOLON + { $$ = make_stmt_prof_begin(@$, std::move($3)); } + ; + +stmt_prof_end + : PROFEND LPAREN expr_arguments RPAREN SEMICOLON + { $$ = make_stmt_prof_end(@$, 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 = make_node(@$); } + ; + +expr_assign + : expr_tuple ASSIGN expr + { $$.as_node = make_expr_assign_equal(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN expr + { $$.as_node = make_expr_assign_equal(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_BW_OR expr + { $$.as_node = make_expr_assign_bitwise_or(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_BW_AND expr + { $$.as_node = make_expr_assign_bitwise_and(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_BW_EXOR expr + { $$.as_node = make_expr_assign_bitwise_exor(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_LSHIFT expr + { $$.as_node = make_expr_assign_shift_left(@$, std::move($1),std::move( $3)); } + | expr_object ASSIGN_RSHIFT expr + { $$.as_node = make_expr_assign_shift_right(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_ADD expr + { $$.as_node = make_expr_assign_add(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_SUB expr + { $$.as_node = make_expr_assign_sub(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_MUL expr + { $$.as_node = make_expr_assign_mul(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_DIV expr + { $$.as_node = make_expr_assign_div(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_MOD expr + { $$.as_node = make_expr_assign_mod(@$, std::move($1), std::move($3)); } + ; + +expr_increment + : INCREMENT expr_object %prec PREINC + { $$.as_node = make_expr_increment(@$, std::move($2), true); } + | expr_object INCREMENT %prec POSTINC + { $$.as_node = make_expr_increment(@$, std::move($1), false); } + ; + +expr_decrement + : DECREMENT expr_object %prec PREDEC + { $$.as_node = make_expr_decrement(@$, std::move($2), true); } + | expr_object DECREMENT %prec POSTDEC + { $$.as_node = make_expr_decrement(@$, std::move($1), false); } + ; + +expr_ternary + : expr QMARK expr COLON expr %prec TERN + { $$.as_node = make_expr_ternary(@$, std::move($1), std::move($3), std::move($5)); } + ; + +expr_binary + : expr OR expr + { $$.as_node = make_expr_or(@$, std::move($1), std::move($3)); } + | expr AND expr + { $$.as_node = make_expr_and(@$, std::move($1), std::move($3)); } + | expr EQUALITY expr + { $$.as_node = make_expr_equality(@$, std::move($1), std::move($3)); } + | expr INEQUALITY expr + { $$.as_node = make_expr_inequality(@$, std::move($1), std::move($3)); } + | expr LESS_EQUAL expr + { $$.as_node = make_expr_less_equal(@$, std::move($1), std::move($3)); } + | expr GREATER_EQUAL expr + { $$.as_node = make_expr_greater_equal(@$, std::move($1), std::move($3)); } + | expr LESS expr + { $$.as_node = make_expr_less(@$, std::move($1), std::move($3)); } + | expr GREATER expr + { $$.as_node = make_expr_greater(@$, std::move($1), std::move($3)); } + | expr BITWISE_OR expr + { $$.as_node = make_expr_bitwise_or(@$, std::move($1), std::move($3)); } + | expr BITWISE_AND expr + { $$.as_node = make_expr_bitwise_and(@$, std::move($1), std::move($3)); } + | expr BITWISE_EXOR expr + { $$.as_node = make_expr_bitwise_exor(@$, std::move($1), std::move($3)); } + | expr LSHIFT expr + { $$.as_node = make_expr_shift_left(@$, std::move($1), std::move($3)); } + | expr RSHIFT expr + { $$.as_node = make_expr_shift_right(@$, std::move($1), std::move($3)); } + | expr ADD expr + { $$.as_node = make_expr_add(@$, std::move($1), std::move($3)); } + | expr SUB expr + { $$.as_node = make_expr_sub(@$, std::move($1), std::move($3)); } + | expr MUL expr + { $$.as_node = make_expr_mul(@$, std::move($1), std::move($3)); } + | expr DIV expr + { $$.as_node = make_expr_div(@$, std::move($1), std::move($3)); } + | expr MOD expr + { $$.as_node = make_expr_mod(@$, std::move($1), std::move($3)); } + ; + +expr_primitive + : expr_complement { $$.as_node = std::move($1); } + | expr_negate { $$.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_add_array { $$.as_node = std::move($1); } + | expr_isdefined { $$.as_node = std::move($1); } + | expr_istrue { $$.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_thisthread { $$.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_animtree { $$.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_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 + { $$ = make_expr_complement(@$, std::move($2)); } + ; + +expr_negate + : SUB expr_identifier %prec NEG + { $$ = make_expr_negate(@$, expr{ std::move($2) }); } + | SUB expr_paren %prec NEG + { $$ = make_expr_negate(@$, expr{ std::move($2) }); } + | SUB expr_array %prec NEG + { $$ = make_expr_negate(@$, expr{ std::move($2) }); } + | SUB expr_field %prec NEG + { $$ = make_expr_negate(@$, expr{ std::move($2) }); } + ; + +expr_not + : NOT expr + { $$ = make_expr_not(@$, std::move($2)); } + ; + +expr_call + : expr_function { $$ = make_expr_call(@$, std::move($1)); } + | expr_pointer { $$ = make_expr_call(@$, std::move($1)); } + ; +expr_method + : expr_object expr_function { $$ = make_expr_method(@$, std::move($1), std::move($2)); } + | expr_object expr_pointer { $$ = make_expr_method(@$, std::move($1), std::move($2)); } + ; + +expr_function + : expr_identifier LPAREN expr_arguments RPAREN + { $$.as_function = make_expr_function(@$, make_expr_path(@$), std::move($1), std::move($3), call::mode::normal); } + | expr_path DOUBLECOLON expr_identifier LPAREN expr_arguments RPAREN + { $$.as_function = make_expr_function(@$, std::move($1), std::move($3), std::move($5), call::mode::normal); } + | THREAD expr_identifier LPAREN expr_arguments RPAREN + { $$.as_function = make_expr_function(@$, make_expr_path(@$), std::move($2), std::move($4), call::mode::thread); } + | THREAD expr_path DOUBLECOLON expr_identifier LPAREN expr_arguments RPAREN + { $$.as_function = make_expr_function(@$, std::move($2), std::move($4), std::move($6), call::mode::thread); } + | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN + { $$.as_function = make_expr_function(@$, make_expr_path(@$), std::move($2), std::move($4), call::mode::childthread); } + | CHILDTHREAD expr_path DOUBLECOLON expr_identifier LPAREN expr_arguments RPAREN + { $$.as_function = make_expr_function(@$, std::move($2), std::move($4), std::move($6), call::mode::childthread); } + ; + +expr_pointer + : LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = make_expr_pointer(@$, std::move($3), std::move($7), call::mode::normal); } + | THREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = make_expr_pointer(@$, std::move($4), std::move($8), call::mode::thread); } + | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = make_expr_pointer(@$, std::move($4), std::move($8), call::mode::childthread); } + | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = make_expr_pointer(@$, std::move($4), std::move($8), call::mode::builtin); } + ; + +expr_add_array + : LBRACKET expr_arguments_no_empty RBRACKET + { $$ = make_expr_add_array(@$, std::move($2)); } + ; + +expr_parameters + : expr_parameters COMMA expr_identifier + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr_identifier + { $$ = make_expr_parameters(@$); $$->list.push_back(std::move($1)); } + | + { $$ = make_expr_parameters(@$); } + ; + +expr_arguments + : expr_arguments_no_empty + { $$ = std::move($1); } + | + { $$ = make_expr_arguments(@$); } + ; + +expr_arguments_no_empty + : expr_arguments COMMA expr + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr %prec ADD_ARRAY + { $$ = make_expr_arguments(@$); $$->list.push_back(std::move($1)); } + ; + +expr_isdefined + : ISDEFINED LPAREN expr RPAREN + { $$ = make_expr_isdefined(@$, std::move($3)); } + ; + +expr_istrue + : ISTRUE LPAREN expr RPAREN + { $$ = make_expr_istrue(@$, std::move($3)); } + ; + +expr_reference + : DOUBLECOLON expr_identifier + { $$ = make_expr_reference(@$, make_expr_path(@$), std::move($2)); } + | expr_path DOUBLECOLON expr_identifier + { $$ = make_expr_reference(@$, std::move($1), std::move($3)); } + ; + +expr_tuple + : LBRACKET expr_tuple_arguments RBRACKET + { $$.as_node = std::move($2); + $$.as_tuple->temp = expr{ std::make_unique($$.loc(), fmt::format("_temp_{}", ++index)) }; + } + ; + +expr_tuple_arguments + : expr_tuple_arguments COMMA expr_tuple_types + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr_tuple_types + { $$ = make_expr_tuple(@$); $$->list.push_back(std::move($1)); } + ; + +expr_tuple_types + : expr_array { $$.as_node = std::move($1); } + | expr_field { $$.as_node = std::move($1); } + | expr_identifier { $$.as_node = std::move($1); } + ; + +expr_array + : expr_object LBRACKET expr RBRACKET + { $$ = make_expr_array(@$, std::move($1), std::move($3)); } + ; + +expr_field + : expr_object DOT expr_identifier_nosize + { $$ = make_expr_field(@$, std::move($1), std::move($3)); } + ; + +expr_size + : expr_object DOT SIZE %prec SIZEOF + { $$ = make_expr_size(@$, std::move($1)); } + ; + +expr_paren + : LPAREN expr RPAREN + { $$ = make_expr_paren(@$, 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_thisthread + : THISTHREAD + { $$ = make_expr_thisthread(@$); }; + ; + +expr_empty_array + : LBRACKET RBRACKET + { $$ = make_expr_empty_array(@$); }; + ; + +expr_undefined + : UNDEFINED + { $$ = make_expr_undefined(@$); }; + ; + +expr_game + : GAME + { $$ = make_expr_game(@$); }; + ; + +expr_self + : SELF + { $$ = make_expr_self(@$); }; + ; + +expr_anim + : ANIM + { $$ = make_expr_anim(@$); }; + ; + +expr_level + : LEVEL + { $$ = make_expr_level(@$); }; + ; + +expr_animation + : MOD IDENTIFIER %prec ANIMREF + { $$ = make_expr_animation(@$, $2); }; + ; + +expr_animtree + : ANIMTREE + { $$ = make_expr_animtree(@$); }; + ; + +expr_identifier_nosize + : IDENTIFIER + { $$ = make_expr_identifier(@$, $1); }; + ; + +expr_identifier + : IDENTIFIER + { $$ = make_expr_identifier(@$, $1); }; + | SIZE + { $$ = make_expr_identifier(@$, "size"); }; + ; + +expr_path + : PATH DIV IDENTIFIER + { $$ = make_expr_path(@$, $1 + "/" + $3); }; + | IDENTIFIER + { $$ = make_expr_path(@$, $1); }; + | PATH + { $$ = make_expr_path(@$, $1); }; + ; + +expr_istring + : ISTRING + { $$ = make_expr_istring(@$, $1); }; + ; + +expr_string + : STRING + { $$ = make_expr_string(@$, $1); }; + ; + +expr_vector + : LPAREN expr COMMA expr COMMA expr RPAREN + { $$ = make_expr_vector(@$, std::move($2), std::move($4), std::move($6)); }; + ; + +expr_float + : SUB FLOAT %prec NEG + { $$ = make_expr_float(@$, "-" + $2); }; + | FLOAT + { $$ = make_expr_float(@$, $1); }; + ; + +expr_integer + : SUB INTEGER %prec NEG + { $$ = make_expr_integer(@$, "-" + $2); }; + | INTEGER + { $$ = make_expr_integer(@$, $1); }; + ; + +expr_false + : FALSE + { $$ = make_expr_false(@$); }; + ; + +expr_true + : TRUE + { $$ = make_expr_true(@$); }; + ; + +%% + +namespace xsk::gsc +{ + +void parser::error(location const& loc, std::string const& msg) +{ + throw comp_error(loc, msg); +} + +auto parse_switch(stmt_switch& stm) -> void +{ + auto body = make_stmt_list(stm.body->loc()); + auto current_case = stmt{ nullptr }; + + auto num = stm.body->list.size(); + + for (auto i = 0u; i < num; i++) + { + auto& entry = stm.body->list[0]; + + if (entry == node::stmt_case || entry == node::stmt_default) + { + if (current_case.as_node != nullptr) + { + body->list.push_back(std::move(current_case)); + } + + current_case = std::move(stm.body->list[0]); + stm.body->list.erase(stm.body->list.begin()); + } + else + { + if (current_case.as_node != nullptr) + { + if (current_case == node::stmt_case) + { + current_case.as_case->body->list.push_back(std::move(entry)); + stm.body->list.erase(stm.body->list.begin()); + } + else + { + current_case.as_default->body->list.push_back(std::move(entry)); + stm.body->list.erase(stm.body->list.begin()); + } + } + else + { + throw comp_error(entry.loc(), "missing case statement"); + } + } + } + + if (current_case.as_node != nullptr) + { + body->list.push_back(std::move(current_case)); + } + + stm.body = std::move(body); +} + +} // namespace xsk::gsc diff --git a/gen/h1/Makefile b/gen/h1/Makefile deleted file mode 100644 index 4d36778a..00000000 --- a/gen/h1/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -generate: h1 - -clean: - rm -rf ./parser.hpp - rm -rf ./parser.cpp - -h1: parser.ypp - bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../src/h1/xsk/ diff --git a/gen/h1/parser.ypp b/gen/h1/parser.ypp deleted file mode 100644 index eef184d7..00000000 --- a/gen/h1/parser.ypp +++ /dev/null @@ -1,898 +0,0 @@ -/* 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 {H1} -%define api.namespace {xsk::gsc::h1} -%define api.location.type {xsk::gsc::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::gsc::h1::lexer& lexer } -%parse-param { xsk::gsc::h1::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "h1.hpp" -namespace xsk::gsc::h1 { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::h1::parser::symbol_type H1lex(xsk::gsc::h1::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 ANIMTREE "#animtree" -%token ENDON "endon" -%token NOTIFY "notify" -%token WAIT "wait" -%token WAITTILL "waittill" -%token WAITTILLMATCH "waittillmatch" -%token WAITTILLFRAMEEND "waittillframeend" -%token WAITFRAME "waitframe" -%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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_waitframe -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_waitframe { $$.as_waitframe = 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_waitframe - : WAITFRAME SEMICOLON - { $$ = std::make_unique(@$); } - | WAITFRAME LPAREN RPAREN 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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::h1::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/h2/parser.ypp b/gen/h2/parser.ypp deleted file mode 100644 index 39645a2e..00000000 --- a/gen/h2/parser.ypp +++ /dev/null @@ -1,898 +0,0 @@ -/* 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 {H2} -%define api.namespace {xsk::gsc::h2} -%define api.location.type {xsk::gsc::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::gsc::h2::lexer& lexer } -%parse-param { xsk::gsc::h2::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "h2.hpp" -namespace xsk::gsc::h2 { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::h2::parser::symbol_type H2lex(xsk::gsc::h2::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 ANIMTREE "#animtree" -%token ENDON "endon" -%token NOTIFY "notify" -%token WAIT "wait" -%token WAITTILL "waittill" -%token WAITTILLMATCH "waittillmatch" -%token WAITTILLFRAMEEND "waittillframeend" -%token WAITFRAME "waitframe" -%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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_waitframe -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_waitframe { $$.as_waitframe = 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_waitframe - : WAITFRAME SEMICOLON - { $$ = std::make_unique(@$); } - | WAITFRAME LPAREN RPAREN 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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::h2::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/iw5/Makefile b/gen/iw5/Makefile deleted file mode 100644 index ea37b454..00000000 --- a/gen/iw5/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -generate: iw5 - -clean: - rm -rf ./parser.hpp - rm -rf ./parser.cpp - -iw5: parser.ypp - bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../src/iw5/xsk/ diff --git a/gen/iw5/parser.ypp b/gen/iw5/parser.ypp deleted file mode 100644 index 440050eb..00000000 --- a/gen/iw5/parser.ypp +++ /dev/null @@ -1,888 +0,0 @@ -/* 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 {IW5} -%define api.namespace {xsk::gsc::iw5} -%define api.location.type {xsk::gsc::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::gsc::iw5::lexer& lexer } -%parse-param { xsk::gsc::iw5::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw5.hpp" -namespace xsk::gsc::iw5 { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw5::parser::symbol_type IW5lex(xsk::gsc::iw5::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 ANIMTREE "#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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::iw5::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/iw6/Makefile b/gen/iw6/Makefile deleted file mode 100644 index ac97b544..00000000 --- a/gen/iw6/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -generate: iw6 - -clean: - rm -rf ./parser.hpp - rm -rf ./parser.cpp - -iw6: parser.ypp - bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../src/iw6/xsk/ diff --git a/gen/iw6/parser.ypp b/gen/iw6/parser.ypp deleted file mode 100644 index 634a684d..00000000 --- a/gen/iw6/parser.ypp +++ /dev/null @@ -1,888 +0,0 @@ -/* 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 {IW6} -%define api.namespace {xsk::gsc::iw6} -%define api.location.type {xsk::gsc::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::gsc::iw6::lexer& lexer } -%parse-param { xsk::gsc::iw6::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw6.hpp" -namespace xsk::gsc::iw6 { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw6::parser::symbol_type IW6lex(xsk::gsc::iw6::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 ANIMTREE "#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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::iw6::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/iw7/Makefile b/gen/iw7/Makefile deleted file mode 100644 index afc85cfb..00000000 --- a/gen/iw7/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -generate: iw7 - -clean: - rm -rf ./parser.hpp - rm -rf ./parser.cpp - -iw7: parser.ypp - bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../src/iw7/xsk/ diff --git a/gen/iw7/parser.ypp b/gen/iw7/parser.ypp deleted file mode 100644 index c48b346a..00000000 --- a/gen/iw7/parser.ypp +++ /dev/null @@ -1,888 +0,0 @@ -/* 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 {IW7} -%define api.namespace {xsk::gsc::iw7} -%define api.location.type {xsk::gsc::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::gsc::iw7::lexer& lexer } -%parse-param { xsk::gsc::iw7::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw7.hpp" -namespace xsk::gsc::iw7 { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw7::parser::symbol_type IW7lex(xsk::gsc::iw7::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 ANIMTREE "#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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::iw7::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/iw8/Makefile b/gen/iw8/Makefile deleted file mode 100644 index e753b35f..00000000 --- a/gen/iw8/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -generate: iw8 - -clean: - rm -rf ./parser.hpp - rm -rf ./parser.cpp - -iw8: parser.ypp - bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../src/iw8/xsk/ diff --git a/gen/iw8/parser.ypp b/gen/iw8/parser.ypp deleted file mode 100644 index f30846fc..00000000 --- a/gen/iw8/parser.ypp +++ /dev/null @@ -1,914 +0,0 @@ -/* 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 {IW8} -%define api.namespace {xsk::gsc::iw8} -%define api.location.type {xsk::gsc::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::gsc::iw8::lexer& lexer } -%parse-param { xsk::gsc::iw8::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw8.hpp" -namespace xsk::gsc::iw8 { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw8::parser::symbol_type IW8lex(xsk::gsc::iw8::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 ANIMTREE "#animtree" -%token ENDON "endon" -%token NOTIFY "notify" -%token WAIT "wait" -%token WAITTILL "waittill" -%token WAITTILLMATCH "waittillmatch" -%token WAITTILLFRAMEEND "waittillframeend" -%token WAITFRAME "waitframe" -%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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 ISDEFINED "isdefined" -%token ISTRUE "istrue" -%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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_waitframe -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_isdefined -%type expr_istrue -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_waitframe { $$.as_waitframe = 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_waitframe - : WAITFRAME SEMICOLON - { $$ = std::make_unique(@$); } - | WAITFRAME LPAREN RPAREN 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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.as_node = std::move($1); } - | expr_isdefined { $$.as_node = std::move($1); } - | expr_istrue { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_isdefined - : ISDEFINED LPAREN expr RPAREN - { $$ = std::make_unique(@$, std::move($3)); } - ; - -expr_istrue - : ISTRUE 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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::iw8::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/iw9/Makefile b/gen/iw9/Makefile deleted file mode 100644 index 1c14c2f3..00000000 --- a/gen/iw9/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -generate: iw9 - -clean: - rm -rf ./parser.hpp - rm -rf ./parser.cpp - -iw9: parser.ypp - bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../src/iw9/xsk/ diff --git a/gen/iw9/parser.ypp b/gen/iw9/parser.ypp deleted file mode 100644 index 4437b3f5..00000000 --- a/gen/iw9/parser.ypp +++ /dev/null @@ -1,914 +0,0 @@ -/* 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 {IW9} -%define api.namespace {xsk::gsc::iw9} -%define api.location.type {xsk::gsc::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::gsc::iw9::lexer& lexer } -%parse-param { xsk::gsc::iw9::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw9.hpp" -namespace xsk::gsc::iw9 { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw9::parser::symbol_type IW9lex(xsk::gsc::iw9::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 ANIMTREE "#animtree" -%token ENDON "endon" -%token NOTIFY "notify" -%token WAIT "wait" -%token WAITTILL "waittill" -%token WAITTILLMATCH "waittillmatch" -%token WAITTILLFRAMEEND "waittillframeend" -%token WAITFRAME "waitframe" -%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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 ISDEFINED "isdefined" -%token ISTRUE "istrue" -%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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_waitframe -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_isdefined -%type expr_istrue -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_waitframe { $$.as_waitframe = 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_waitframe - : WAITFRAME SEMICOLON - { $$ = std::make_unique(@$); } - | WAITFRAME LPAREN RPAREN 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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.as_node = std::move($1); } - | expr_isdefined { $$.as_node = std::move($1); } - | expr_istrue { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_isdefined - : ISDEFINED LPAREN expr RPAREN - { $$ = std::make_unique(@$, std::move($3)); } - ; - -expr_istrue - : ISTRUE 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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::iw9::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/s1/Makefile b/gen/s1/Makefile deleted file mode 100644 index a377d3d1..00000000 --- a/gen/s1/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -generate: s1 - -clean: - rm -rf ./parser.hpp - rm -rf ./parser.cpp - -s1: parser.ypp - bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../src/s1/xsk/ diff --git a/gen/s1/parser.ypp b/gen/s1/parser.ypp deleted file mode 100644 index 385a2e5f..00000000 --- a/gen/s1/parser.ypp +++ /dev/null @@ -1,898 +0,0 @@ -/* 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 {S1} -%define api.namespace {xsk::gsc::s1} -%define api.location.type {xsk::gsc::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::gsc::s1::lexer& lexer } -%parse-param { xsk::gsc::s1::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "s1.hpp" -namespace xsk::gsc::s1 { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::s1::parser::symbol_type S1lex(xsk::gsc::s1::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 ANIMTREE "#animtree" -%token ENDON "endon" -%token NOTIFY "notify" -%token WAIT "wait" -%token WAITTILL "waittill" -%token WAITTILLMATCH "waittillmatch" -%token WAITTILLFRAMEEND "waittillframeend" -%token WAITFRAME "waitframe" -%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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_waitframe -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_waitframe { $$.as_waitframe = 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_waitframe - : WAITFRAME SEMICOLON - { $$ = std::make_unique(@$); } - | WAITFRAME LPAREN RPAREN 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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::s1::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/s2/Makefile b/gen/s2/Makefile deleted file mode 100644 index 32583c0e..00000000 --- a/gen/s2/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -generate: s2 - -clean: - rm -rf ./parser.hpp - rm -rf ./parser.cpp - -s2: parser.ypp - bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../src/s2/xsk/ diff --git a/gen/s2/parser.ypp b/gen/s2/parser.ypp deleted file mode 100644 index f19166b5..00000000 --- a/gen/s2/parser.ypp +++ /dev/null @@ -1,898 +0,0 @@ -/* 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 {S2} -%define api.namespace {xsk::gsc::s2} -%define api.location.type {xsk::gsc::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::gsc::s2::lexer& lexer } -%parse-param { xsk::gsc::s2::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "s2.hpp" -namespace xsk::gsc::s2 { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::s2::parser::symbol_type S2lex(xsk::gsc::s2::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 ANIMTREE "#animtree" -%token ENDON "endon" -%token NOTIFY "notify" -%token WAIT "wait" -%token WAITTILL "waittill" -%token WAITTILLMATCH "waittillmatch" -%token WAITTILLFRAMEEND "waittillframeend" -%token WAITFRAME "waitframe" -%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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_waitframe -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_waitframe { $$.as_waitframe = 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_waitframe - : WAITFRAME SEMICOLON - { $$ = std::make_unique(@$); } - | WAITFRAME LPAREN RPAREN 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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::s2::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/s4/Makefile b/gen/s4/Makefile deleted file mode 100644 index 4d697f6b..00000000 --- a/gen/s4/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -generate: s4 - -clean: - rm -rf ./parser.hpp - rm -rf ./parser.cpp - -s4: parser.ypp - bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../src/s4/xsk/ diff --git a/gen/s4/parser.ypp b/gen/s4/parser.ypp deleted file mode 100644 index 7bd6731e..00000000 --- a/gen/s4/parser.ypp +++ /dev/null @@ -1,914 +0,0 @@ -/* 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 {S4} -%define api.namespace {xsk::gsc::s4} -%define api.location.type {xsk::gsc::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::gsc::s4::lexer& lexer } -%parse-param { xsk::gsc::s4::lexer& lexer } -%parse-param { xsk::gsc::ast::program::ptr& ast } - -%code requires -{ -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "s4.hpp" -namespace xsk::gsc::s4 { class lexer; } -} - -%code top -{ -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::s4::parser::symbol_type S4lex(xsk::gsc::s4::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 ANIMTREE "#animtree" -%token ENDON "endon" -%token NOTIFY "notify" -%token WAIT "wait" -%token WAITTILL "waittill" -%token WAITTILLMATCH "waittillmatch" -%token WAITTILLFRAMEEND "waittillframeend" -%token WAITFRAME "waitframe" -%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 CHILDTHREAD "childthread" -%token THISTHREAD "thisthread" -%token CALL "call" -%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 ISDEFINED "isdefined" -%token ISTRUE "istrue" -%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 PATH "path" -%token IDENTIFIER "identifier" -%token STRING "string literal" -%token ISTRING "localized string" -%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_waitframe -%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_negate -%type expr_not -%type expr_call -%type expr_method -%type expr_function -%type expr_pointer -%type expr_add_array -%type expr_parameters -%type expr_arguments -%type expr_arguments_no_empty -%type expr_isdefined -%type expr_istrue -%type expr_reference -%type expr_tuple -%type expr_tuple_arguments -%type expr_tuple_types -%type expr_array -%type expr_field -%type expr_size -%type expr_paren -%type expr_object -%type expr_thisthread -%type expr_empty_array -%type expr_undefined -%type expr_game -%type expr_self -%type expr_anim -%type expr_level -%type expr_animation -%type expr_animtree -%type expr_identifier_nosize -%type expr_identifier -%type expr_path -%type expr_istring -%type expr_string -%type expr_vector -%type expr_float -%type expr_integer -%type expr_false -%type expr_true - -%nonassoc SIZEOF -%nonassoc ADD_ARRAY -%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_waitframe { $$.as_waitframe = 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_waitframe - : WAITFRAME SEMICOLON - { $$ = std::make_unique(@$); } - | WAITFRAME LPAREN RPAREN 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_tuple ASSIGN expr - { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } - | 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_negate { $$.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_add_array { $$.as_node = std::move($1); } - | expr_isdefined { $$.as_node = std::move($1); } - | expr_istrue { $$.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_thisthread { $$.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_animtree { $$.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_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_negate - : SUB expr_identifier %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_paren %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_array %prec NEG - { $$ = std::make_unique(@$, ast::expr(std::move($2))); } - | SUB expr_field %prec NEG - { $$ = std::make_unique(@$, ast::expr(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); } - | CHILDTHREAD expr_identifier LPAREN expr_arguments RPAREN - { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::childthread); } - | CHILDTHREAD 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::childthread); } - ; - -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); } - | CHILDTHREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::childthread); } - | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN - { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::builtin); } - ; - -expr_add_array - : LBRACKET expr_arguments_no_empty RBRACKET - { $$ = std::make_unique(@$, std::move($2)); } - ; - -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 %prec ADD_ARRAY - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_isdefined - : ISDEFINED LPAREN expr RPAREN - { $$ = std::make_unique(@$, std::move($3)); } - ; - -expr_istrue - : ISTRUE 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_tuple - : LBRACKET expr_tuple_arguments RBRACKET - { $$.as_node = std::move($2); } - ; - -expr_tuple_arguments - : expr_tuple_arguments COMMA expr_tuple_types - { $$ = std::move($1); $$->list.push_back(std::move($3)); } - | expr_tuple_types - { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } - ; - -expr_tuple_types - : expr_array { $$.as_node = std::move($1); } - | expr_field { $$.as_node = std::move($1); } - | expr_identifier { $$.as_node = std::move($1); } - ; - -expr_array - : expr_object LBRACKET expr RBRACKET - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_field - : expr_object DOT expr_identifier_nosize - { $$ = std::make_unique(@$, std::move($1), std::move($3)); } - ; - -expr_size - : expr_object DOT SIZE %prec SIZEOF - { $$ = 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_thisthread - : THISTHREAD - { $$ = std::make_unique(@$); }; - ; - -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_animtree - : ANIMTREE - { $$ = std::make_unique(@$); }; - ; - -expr_identifier_nosize - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - ; - -expr_identifier - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | SIZE - { $$ = std::make_unique(@$, "size"); }; - ; - -expr_path - : IDENTIFIER - { $$ = std::make_unique(@$, $1); }; - | PATH - { $$ = std::make_unique(@$, $1); }; - ; - -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_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::gsc::s4::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/gen/t6/Makefile b/gen/t6/Makefile index 784dcaa7..ee6a1b12 100644 --- a/gen/t6/Makefile +++ b/gen/t6/Makefile @@ -6,4 +6,4 @@ clean: t6: parser.ypp bison parser.ypp -Wcounterexamples - mv parser.hpp parser.cpp ../../src/t6/xsk/ + mv parser.hpp parser.cpp ../../src/t6/ diff --git a/gen/t6/parser.ypp b/gen/t6/parser.ypp index d0c25577..c14a47e6 100644 --- a/gen/t6/parser.ypp +++ b/gen/t6/parser.ypp @@ -1,4 +1,4 @@ -/* Copyright 2022 xensik. All rights reserved. +/* Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. @@ -36,7 +36,7 @@ namespace xsk::arc::t6 { class lexer; } %code top { -#include "stdafx.hpp" +#include "stdinc.hpp" #include "parser.hpp" #include "lexer.hpp" using namespace xsk::arc; @@ -215,7 +215,6 @@ xsk::arc::t6::parser::symbol_type T6lex(xsk::arc::t6::lexer& lexer); %type expr_pointer %type expr_parameters %type expr_parameters_default -/* %type expr_literal */ %type expr_arguments %type expr_arguments_no_empty %type expr_getnextarraykey @@ -753,15 +752,6 @@ expr_parameters_default { $$.as_node = std::make_unique(@$, ast::expr(std::move($1)), std::move($3)); } ; -/* expr_literal - : expr_istring { $$.as_node = std::move($1); } - | expr_string { $$.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_arguments : expr_arguments_no_empty { $$ = std::move($1); } diff --git a/premake5.lua b/premake5.lua index c529d859..dc441773 100644 --- a/premake5.lua +++ b/premake5.lua @@ -13,7 +13,7 @@ end dependencies.load() ------------------------------------------------- workspace "gsc-tool" - startproject "xsk-gsc-tool" + startproject "xsk-tool" location "./build" objdir "%{wks.location}/obj/%{cfg.buildcfg}/%{prj.name}" targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}" @@ -77,29 +77,30 @@ workspace "gsc-tool" defines { "DEBUG", "_DEBUG" } filter {} -project "xsk-gsc-tool" +project "xsk-tool" kind "ConsoleApp" language "C++" targetname "gsc-tool" - dependson "xsk-gsc-utils" - dependson "xsk-gsc-h1" - dependson "xsk-gsc-h2" - dependson "xsk-gsc-iw5" - dependson "xsk-gsc-iw6" - dependson "xsk-gsc-iw7" - dependson "xsk-gsc-iw8" - dependson "xsk-gsc-iw9" - dependson "xsk-gsc-s1" - dependson "xsk-gsc-s2" - dependson "xsk-gsc-s4" - dependson "xsk-arc-t6" - dependson "xsk-gsc-iw5c" - dependson "xsk-gsc-iw6c" - dependson "xsk-gsc-s1c" - - pchheader "stdafx.hpp" - pchsource "src/tool/stdafx.cpp" + dependson "xsk-utils" + dependson "xsk-gsc" + dependson "xsk-iw5_pc" + dependson "xsk-iw5_ps" + dependson "xsk-iw5_xb" + dependson "xsk-iw6_pc" + dependson "xsk-iw6_ps" + dependson "xsk-iw6_xb" + dependson "xsk-s1_pc" + dependson "xsk-s1_ps" + dependson "xsk-s1_xb" + dependson "xsk-iw7" + dependson "xsk-iw8" + dependson "xsk-iw9" + dependson "xsk-h1" + dependson "xsk-h2" + dependson "xsk-s2" + dependson "xsk-s4" + dependson "xsk-t6" files { "./src/tool/**.h", @@ -108,21 +109,25 @@ project "xsk-gsc-tool" } links { - "xsk-gsc-utils", - "xsk-gsc-h1", - "xsk-gsc-h2", - "xsk-gsc-iw5", - "xsk-gsc-iw6", - "xsk-gsc-iw7", - "xsk-gsc-iw8", - "xsk-gsc-iw9", - "xsk-gsc-s1", - "xsk-gsc-s2", - "xsk-gsc-s4", - "xsk-arc-t6", - "xsk-gsc-iw5c", - "xsk-gsc-iw6c", - "xsk-gsc-s1c" + "xsk-utils", + "xsk-gsc", + "xsk-iw5_pc", + "xsk-iw5_ps", + "xsk-iw5_xb", + "xsk-iw6_pc", + "xsk-iw6_ps", + "xsk-iw6_xb", + "xsk-s1_pc", + "xsk-s1_ps", + "xsk-s1_xb", + "xsk-iw7", + "xsk-iw8", + "xsk-iw9", + "xsk-h1", + "xsk-h2", + "xsk-s2", + "xsk-s4", + "xsk-t6", } includedirs { @@ -130,15 +135,13 @@ project "xsk-gsc-tool" "./src" } + fmt:link() zlib:link() -project "xsk-gsc-utils" +project "xsk-utils" kind "StaticLib" language "C++" - pchheader "stdafx.hpp" - pchsource "src/utils/stdafx.cpp" - files { "./src/utils/**.h", "./src/utils/**.hpp", @@ -150,55 +153,37 @@ project "xsk-gsc-utils" "./src" } + fmt:include() zlib:include() -project "xsk-gsc-h1" -kind "StaticLib" -language "C++" - -pchheader "stdafx.hpp" -pchsource "src/h1/stdafx.cpp" - -files { - "./src/h1/**.h", - "./src/h1/**.hpp", - "./src/h1/**.cpp" -} - -includedirs { - "./src/h1", - "./src" -} - -project "xsk-gsc-h2" -kind "StaticLib" -language "C++" - -pchheader "stdafx.hpp" -pchsource "src/h2/stdafx.cpp" - -files { - "./src/h2/**.h", - "./src/h2/**.hpp", - "./src/h2/**.cpp" -} - -includedirs { - "./src/h2", - "./src" -} - -project "xsk-gsc-iw5" +project "xsk-gsc" kind "StaticLib" language "C++" - pchheader "stdafx.hpp" - pchsource "src/iw5/stdafx.cpp" + files { + "./src/gsc/**.h", + "./src/gsc/**.hpp", + "./src/gsc/**.cpp" + } + + includedirs { + "./src/gsc", + "./src" + } + + fmt:include() + +project "xsk-iw5_pc" + kind "StaticLib" + language "C++" files { - "./src/iw5/**.h", - "./src/iw5/**.hpp", - "./src/iw5/**.cpp" + "./src/iw5/iw5_pc.hpp", + "./src/iw5/iw5_pc.cpp", + "./src/iw5/iw5_pc_code.cpp", + "./src/iw5/iw5_pc_func.cpp", + "./src/iw5/iw5_pc_meth.cpp", + "./src/iw5/iw5_pc_token.cpp" } includedirs { @@ -206,17 +191,59 @@ project "xsk-gsc-iw5" "./src" } -project "xsk-gsc-iw6" + fmt:include() + +project "xsk-iw5_ps" kind "StaticLib" language "C++" - pchheader "stdafx.hpp" - pchsource "src/iw6/stdafx.cpp" + files { + "./src/iw5/iw5_ps.hpp", + "./src/iw5/iw5_ps.cpp", + "./src/iw5/iw5_ps_code.cpp", + "./src/iw5/iw5_ps_func.cpp", + "./src/iw5/iw5_ps_meth.cpp", + "./src/iw5/iw5_ps_token.cpp" + } + + includedirs { + "./src/iw5", + "./src" + } + + fmt:include() + +project "xsk-iw5_xb" + kind "StaticLib" + language "C++" files { - "./src/iw6/**.h", - "./src/iw6/**.hpp", - "./src/iw6/**.cpp" + "./src/iw5/iw5_xb.hpp", + "./src/iw5/iw5_xb.cpp", + "./src/iw5/iw5_xb_code.cpp", + "./src/iw5/iw5_xb_func.cpp", + "./src/iw5/iw5_xb_meth.cpp", + "./src/iw5/iw5_xb_token.cpp" + } + + includedirs { + "./src/iw5", + "./src" + } + + fmt:include() + +project "xsk-iw6_pc" + kind "StaticLib" + language "C++" + + files { + "./src/iw6/iw6_pc.hpp", + "./src/iw6/iw6_pc.cpp", + "./src/iw6/iw6_pc_code.cpp", + "./src/iw6/iw6_pc_func.cpp", + "./src/iw6/iw6_pc_meth.cpp", + "./src/iw6/iw6_pc_token.cpp" } includedirs { @@ -224,12 +251,111 @@ project "xsk-gsc-iw6" "./src" } -project "xsk-gsc-iw7" + fmt:include() + +project "xsk-iw6_ps" kind "StaticLib" language "C++" - pchheader "stdafx.hpp" - pchsource "src/iw7/stdafx.cpp" + files { + "./src/iw6/iw6_ps.hpp", + "./src/iw6/iw6_ps.cpp", + "./src/iw6/iw6_ps_code.cpp", + "./src/iw6/iw6_ps_func.cpp", + "./src/iw6/iw6_ps_meth.cpp", + "./src/iw6/iw6_ps_token.cpp" + } + + includedirs { + "./src/iw6", + "./src" + } + + fmt:include() + +project "xsk-iw6_xb" + kind "StaticLib" + language "C++" + + files { + "./src/iw6/iw6_xb.hpp", + "./src/iw6/iw6_xb.cpp", + "./src/iw6/iw6_xb_code.cpp", + "./src/iw6/iw6_xb_func.cpp", + "./src/iw6/iw6_xb_meth.cpp", + "./src/iw6/iw6_xb_token.cpp" + } + + includedirs { + "./src/iw6", + "./src" + } + + fmt:include() + +project "xsk-s1_pc" + kind "StaticLib" + language "C++" + + files { + "./src/s1/s1_pc.hpp", + "./src/s1/s1_pc.cpp", + "./src/s1/s1_pc_code.cpp", + "./src/s1/s1_pc_func.cpp", + "./src/s1/s1_pc_meth.cpp", + "./src/s1/s1_pc_token.cpp" + } + + includedirs { + "./src/s1", + "./src" + } + + fmt:include() + +project "xsk-s1_ps" + kind "StaticLib" + language "C++" + + files { + "./src/s1/s1_ps.hpp", + "./src/s1/s1_ps.cpp", + "./src/s1/s1_ps_code.cpp", + "./src/s1/s1_ps_func.cpp", + "./src/s1/s1_ps_meth.cpp", + "./src/s1/s1_ps_token.cpp" + } + + includedirs { + "./src/s1", + "./src" + } + + fmt:include() + +project "xsk-s1_xb" + kind "StaticLib" + language "C++" + + files { + "./src/s1/s1_xb.hpp", + "./src/s1/s1_xb.cpp", + "./src/s1/s1_xb_code.cpp", + "./src/s1/s1_xb_func.cpp", + "./src/s1/s1_xb_meth.cpp", + "./src/s1/s1_xb_token.cpp" + } + + includedirs { + "./src/s1", + "./src" + } + + fmt:include() + +project "xsk-iw7" + kind "StaticLib" + language "C++" files { "./src/iw7/**.h", @@ -242,13 +368,12 @@ project "xsk-gsc-iw7" "./src" } -project "xsk-gsc-iw8" + fmt:include() + +project "xsk-iw8" kind "StaticLib" language "C++" - pchheader "stdafx.hpp" - pchsource "src/iw8/stdafx.cpp" - files { "./src/iw8/**.h", "./src/iw8/**.hpp", @@ -260,13 +385,12 @@ project "xsk-gsc-iw8" "./src" } -project "xsk-gsc-iw9" + fmt:include() + +project "xsk-iw9" kind "StaticLib" language "C++" - pchheader "stdafx.hpp" - pchsource "src/iw9/stdafx.cpp" - files { "./src/iw9/**.h", "./src/iw9/**.hpp", @@ -278,30 +402,45 @@ project "xsk-gsc-iw9" "./src" } -project "xsk-gsc-s1" + fmt:include() + +project "xsk-h1" kind "StaticLib" language "C++" - pchheader "stdafx.hpp" - pchsource "src/s1/stdafx.cpp" - files { - "./src/s1/**.h", - "./src/s1/**.hpp", - "./src/s1/**.cpp" + "./src/h1/**.h", + "./src/h1/**.hpp", + "./src/h1/**.cpp" } includedirs { - "./src/s1", + "./src/h1", "./src" } -project "xsk-gsc-s2" + fmt:include() + +project "xsk-h2" kind "StaticLib" language "C++" - pchheader "stdafx.hpp" - pchsource "src/s2/stdafx.cpp" + files { + "./src/h2/**.h", + "./src/h2/**.hpp", + "./src/h2/**.cpp" + } + + includedirs { + "./src/h2", + "./src" + } + + fmt:include() + +project "xsk-s2" + kind "StaticLib" + language "C++" files { "./src/s2/**.h", @@ -314,13 +453,12 @@ project "xsk-gsc-s2" "./src" } -project "xsk-gsc-s4" + fmt:include() + +project "xsk-s4" kind "StaticLib" language "C++" - pchheader "stdafx.hpp" - pchsource "src/s4/stdafx.cpp" - files { "./src/s4/**.h", "./src/s4/**.hpp", @@ -332,13 +470,12 @@ project "xsk-gsc-s4" "./src" } -project "xsk-arc-t6" + fmt:include() + +project "xsk-t6" kind "StaticLib" language "C++" - pchheader "stdafx.hpp" - pchsource "src/t6/stdafx.cpp" - files { "./src/t6/**.h", "./src/t6/**.hpp", @@ -350,59 +487,8 @@ project "xsk-arc-t6" "./src" } -project "xsk-gsc-iw5c" - kind "StaticLib" - language "C++" - - pchheader "stdafx.hpp" - pchsource "src/experimental/iw5c/stdafx.cpp" - - files { - "./src/experimental/iw5c/**.h", - "./src/experimental/iw5c/**.hpp", - "./src/experimental/iw5c/**.cpp" - } - - includedirs { - "./src/experimental/iw5c", - "./src" - } - -project "xsk-gsc-iw6c" - kind "StaticLib" - language "C++" - - pchheader "stdafx.hpp" - pchsource "src/experimental/iw6c/stdafx.cpp" - - files { - "./src/experimental/iw6c/**.h", - "./src/experimental/iw6c/**.hpp", - "./src/experimental/iw6c/**.cpp" - } - - includedirs { - "./src/experimental/iw6c", - "./src" - } - -project "xsk-gsc-s1c" - kind "StaticLib" - language "C++" - - pchheader "stdafx.hpp" - pchsource "src/experimental/s1c/stdafx.cpp" - - files { - "./src/experimental/s1c/**.h", - "./src/experimental/s1c/**.hpp", - "./src/experimental/s1c/**.cpp" - } - - includedirs { - "./src/experimental/s1c", - "./src" - } + fmt:include() group "Dependencies" + fmt:project() zlib:project() diff --git a/src/experimental/iw5c/stdafx.hpp b/src/experimental/iw5c/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/experimental/iw5c/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/experimental/iw5c/xsk/assembler.cpp b/src/experimental/iw5c/xsk/assembler.cpp deleted file mode 100644 index 55a2d0cb..00000000 --- a/src/experimental/iw5c/xsk/assembler.cpp +++ /dev/null @@ -1,554 +0,0 @@ -// 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 "iw5c.hpp" - -namespace xsk::gsc::iw5c -{ - -auto assembler::output_script() -> std::vector -{ - std::vector script; - - if (script_ == nullptr) return script; - - script.resize(script_->pos()); - std::memcpy(script.data(), script_->buffer().data(), script.size()); - - return script; -} - -auto assembler::output_stack() -> std::vector -{ - std::vector stack; - - if (stack_ == nullptr) return stack; - - stack.resize(stack_->pos()); - std::memcpy(stack.data(), stack_->buffer().data(), stack.size()); - - return stack; -} - -void assembler::assemble(const std::string& file, std::vector& data) -{ - std::vector assembly = utils::string::clean_buffer_lines(data); - std::vector functions; - function::ptr func = nullptr; - std::uint32_t index = 1; - std::uint16_t switchnum = 0; - - for (auto& line : assembly) - { - if (line == "" || line.substr(0, 2) == "//") - { - continue; - } - else if (line.substr(0, 4) == "sub_") - { - func = std::make_unique(); - func->index = index; - func->name = line.substr(4); - } - else if (line.substr(0, 4) == "end_") - { - if (func != nullptr) - { - func->size = index - func->index; - functions.push_back(std::move(func)); - } - } - else if (line.substr(0, 4) == "loc_") - { - func->labels[index] = line; - } - else - { - auto opdata = utils::string::parse_code(line); - - if (switchnum) - { - if (opdata[0] == "case" || opdata[0] == "default") - { - for (auto& entry : opdata) - { - func->instructions.back()->data.push_back(entry); - } - switchnum--; - continue; - } - - throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); - } - else - { - auto inst = std::make_unique(); - inst->index = index; - inst->opcode = resolver::opcode_id(opdata[0]); - inst->size = opcode_size(inst->opcode); - opdata.erase(opdata.begin()); - inst->data = std::move(opdata); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = inst->data[0].substr(4); - break; - case opcode::OP_endswitch: - switchnum = static_cast(std::stoi(inst->data[0])); - inst->size += 7 * switchnum; - break; - default: - break; - } - - index += inst->size; - func->instructions.push_back(std::move(inst)); - } - } - } - - assemble(file, functions); -} - -void assembler::assemble(const std::string& file, std::vector& funcs) -{ - script_ = std::make_unique(0x100000); - stack_ = std::make_unique(0x100000); - filename_ = file; - functions_ = std::move(funcs); - - script_->write_endian(static_cast(opcode::OP_End)); - - for (const auto& func : functions_) - { - assemble_function(func); - } -} - -void assembler::assemble_function(const function::ptr& func) -{ - labels_ = func->labels; - - func->id = resolver::token_id(func->name); - - stack_->write_endian(func->size); - stack_->write_endian(static_cast(func->id)); - - if (func->id == 0) - { - stack_->write_c_string(func->name); - } - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write_endian(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - case opcode::OP_Return: - case opcode::OP_GetUndefined: - case opcode::OP_GetZero: - case opcode::OP_waittillFrameEnd: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_EvalArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_ClearArray: - case opcode::OP_EmptyArray: - case opcode::OP_AddArray: - case opcode::OP_PreScriptCall: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_GetLevelObject: - case opcode::OP_GetAnimObject: - case opcode::OP_GetSelf: - case opcode::OP_GetThisthread: - case opcode::OP_GetLevel: - case opcode::OP_GetGame: - case opcode::OP_GetAnim: - case opcode::OP_GetGameRef: - case opcode::OP_inc: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_bit_ex_or: - case opcode::OP_bit_and: - case opcode::OP_equality: - case opcode::OP_inequality: - case opcode::OP_less: - case opcode::OP_greater: - case opcode::OP_less_equal: - case opcode::OP_waittillmatch2: - case opcode::OP_waittill: - case opcode::OP_notify: - case opcode::OP_endon: - case opcode::OP_voidCodepos: - case opcode::OP_vector: - case opcode::OP_greater_equal: - case opcode::OP_shift_left: - case opcode::OP_shift_right: - case opcode::OP_plus: - case opcode::OP_minus: - case opcode::OP_multiply: - case opcode::OP_divide: - case opcode::OP_mod: - case opcode::OP_size: - case opcode::OP_GetSelfObject: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_clearparams: - case opcode::OP_checkclearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_SetVariableField: - case opcode::OP_ClearVariableField: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_wait: - case opcode::OP_DecTop: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_BoolNot: - case opcode::OP_BoolComplement: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->write_endian(std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->write_endian(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - inst->size += script_->align(4); - script_->write_endian(std::stof(inst->data[0])); - script_->write_endian(std::stof(inst->data[1])); - script_->write_endian(std::stof(inst->data[2])); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->write_endian(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_GetAnimation: - script_->write_endian(0); - stack_->write_c_string(inst->data[0]); - stack_->write_c_string(inst->data[1]); - break; - case opcode::OP_GetAnimTree: - script_->write_endian(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_waittillmatch: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_CreateLocalVariable: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_EvalLocalVariableObjectCached: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - assemble_field_variable(inst); - break; - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_GetLocalFunction: - assemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - case opcode::OP_GetFarFunction: - assemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - assemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - assemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - assemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - assemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - assemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - assemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - assemble_jump(inst, false, true); - break; - case opcode::OP_jump: - assemble_jump(inst, false, false); - break; - case opcode::OP_switch: - assemble_switch(inst); - break; - case opcode::OP_endswitch: - assemble_end_switch(inst); - break; - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - script_->write_endian(static_cast(std::stoi(inst->data[1]))); - } - - const auto id = method ? resolver::method_id(inst->data[0]) : resolver::function_id(inst->data[0]); - - script_->write_endian(id); -} - -void assembler::assemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto addr = resolve_function(inst->data[0]); - const auto offset = static_cast(addr - inst->index - 1); - - assemble_offset(offset); - - if (thread) - { - script_->write_endian(static_cast(std::stoi(inst->data[1]))); - } -} - -void assembler::assemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->write_endian(0); - script_->write_endian(0); - - if (thread) - { - script_->write_endian(static_cast(std::stoi(inst->data[2]))); - } - - const auto file_id = resolver::token_id(inst->data[0]); - const auto func_id = resolver::token_id(inst->data[1]); - - stack_->write_endian(file_id); - if (file_id == 0) stack_->write_c_string(inst->data[0]); - stack_->write_endian(func_id); - if (func_id == 0) stack_->write_c_string(inst->data[1]); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const auto addr = resolve_label(inst->data[0]); - - script_->write_endian(addr - inst->index - 4); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - - script_->write_endian(static_cast(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_endian((std::stoi(inst->data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); - } - else - { - script_->write_endian(i + 1); - stack_->write_c_string(inst->data[1 + (3 * i) + 1]); - } - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 2]); - - assemble_offset(addr - index); - - index += 3; - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write_endian(0); - stack_->write_c_string("\x01"); - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 1]); - - assemble_offset(addr - index); - - index += 3; - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::assemble_field_variable(const instruction::ptr& inst) -{ - auto id = resolver::token_id(inst->data[0]); - - if (id == 0) id = 0xFFFF; - - script_->write_endian(id); - - if (id > max_string_id) - { - stack_->write_endian(0); - stack_->write_c_string(inst->data[0]); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - const auto addr = resolve_label(inst->data[0]); - - if (expr) - { - script_->write_endian(static_cast(addr - inst->index - 3)); - } - else if (back) - { - script_->write_endian(static_cast((inst->index + 3) - addr)); - } - else - { - script_->write_endian(static_cast(addr - inst->index - 5)); - } -} - -void assembler::assemble_offset(std::int32_t offset) -{ - std::array bytes = {}; - - offset = (offset << 10) >> 8; - - *reinterpret_cast(bytes.data()) = offset; - - script_->write_endian(bytes[2]); - script_->write_endian(bytes[1]); - script_->write_endian(bytes[0]); -} - -auto assembler::resolve_function(const std::string& name) -> std::int32_t -{ - for (const auto& entry : functions_) - { - if (entry->name == name) - { - return entry->index; - } - } - - throw asm_error("couldn't resolve local function address of '" + name + "'!"); -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/assembler.hpp b/src/experimental/iw5c/xsk/assembler.hpp deleted file mode 100644 index a54df561..00000000 --- a/src/experimental/iw5c/xsk/assembler.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::iw5c -{ - -class assembler : public gsc::assembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output_script() -> std::vector; - auto output_stack() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, std::vector& funcs); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void assemble_local_call(const instruction::ptr& inst, bool thread); - void assemble_far_call(const instruction::ptr& inst, bool thread); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void assemble_field_variable(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst, bool expr, bool back); - void assemble_offset(std::int32_t offset); - auto resolve_function(const std::string& name) -> std::int32_t; - auto resolve_label(const std::string& name) -> std::int32_t; -}; - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/compiler.cpp b/src/experimental/iw5c/xsk/compiler.cpp deleted file mode 100644 index 26e14260..00000000 --- a/src/experimental/iw5c/xsk/compiler.cpp +++ /dev/null @@ -1,2964 +0,0 @@ -// 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 "iw5c.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -namespace xsk::gsc::iw5c -{ - -auto compiler::output() -> std::vector -{ - return std::move(assembly_); -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "an unknown error ocurred while parsing gsc file"); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_.clear(); - includes_.clear(); - animtrees_.clear(); - constants_.clear(); - local_functions_.clear(); - index_ = 1; - 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& inc : includes_) - { - if (inc.name == path) - { - throw comp_error(include->loc(), "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(), "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 developer block comment"); - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) -{ - const auto itr = constants_.find(constant->name->value); - - if (itr != constants_.end()) - throw comp_error(constant->loc(), "duplicated constant '" + constant->name->value + "'"); - - 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; - - auto blk = std::make_unique(); - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - break_blks_.clear(); - continue_blks_.clear(); - - process_thread(thread, blk); - - emit_expr_parameters(thread->params, blk); - emit_stmt_list(thread->stmt, blk, true); - emit_opcode(opcode::OP_End); - - function_->size = index_ - function_->index; - assembly_.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list, blk, last); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev, blk, last); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend, blk); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if, blk, last); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse, blk, last); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case, blk); - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default, blk); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return, blk); - break; - case ast::kind::stmt_breakpoint: - emit_stmt_breakpoint(stmt.as_breakpoint, blk); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin, blk); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end, blk); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last) -{ - for (const auto& entry : stmt->list) - { - bool last_ = (&entry == &stmt->list.back() && last) ? true : false; - emit_stmt(entry, blk, last_); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last) -{ - emit_stmt_list(stmt->list, blk, last); -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - 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, const block::ptr& blk) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, blk, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, blk, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_endon); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } - - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->time, blk); - emit_opcode(opcode::OP_wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittill); - - for (const auto& entry : stmt->args->list) - { - variable_create(entry.as_identifier, blk); - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(entry.as_identifier, blk)); - } - - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - emit_expr_arguments(stmt->args, blk); - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_waittillmatch2); - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waittillFrameEnd); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - blk->transfer(stmt->blk); - - emit_stmt(stmt->stmt, stmt->blk, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last) -{ - std::vector childs; - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - blk->transfer(stmt->blk_if); - - emit_stmt(stmt->stmt_if, stmt->blk_if, last); - - emit_remove_local_vars(stmt->blk_if); - - if (stmt->blk_if->abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - - last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - - blk->transfer(stmt->blk_else); - - emit_stmt(stmt->stmt_else, stmt->blk_else, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk_else); - - if (stmt->blk_else->abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - - insert_label(end_loc); - - blk->init_from_child(childs); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_stmt(stmt->init, blk, false); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->blk_iter); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - can_break_ = true; - can_continue_ = true; - - emit_stmt(stmt->stmt, stmt->blk, false); - - if (stmt->blk->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->blk.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->blk_iter->init_from_child(continue_blks_); - - emit_stmt(stmt->iter, stmt->blk_iter, false); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_expr(stmt->array_expr, blk); - emit_expr_variable_ref(stmt->array, blk, true); - emit_expr_variable(stmt->array, blk); - emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); - emit_expr_variable_ref(stmt->key_expr, blk, true); - - blk->transfer(stmt->ctx); - stmt->ctx->loc_break = break_loc; - stmt->ctx->loc_continue = continue_loc; - - emit_create_local_vars(stmt->ctx); - - blk->local_vars_create_count = stmt->ctx->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->ctx_post); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr, blk); - emit_opcode(opcode::OP_CallBuiltin1, "isdefined"); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr, stmt->ctx); - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->array.as_identifier, stmt->ctx)); - emit_expr_variable_ref(stmt->value_expr, stmt->ctx, true); - emit_stmt(stmt->stmt, stmt->ctx, false); - - if (stmt->ctx->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->ctx.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->ctx_post->init_from_child(continue_blks_); - - emit_expr_variable(stmt->key_expr, stmt->ctx_post); - emit_expr_variable(stmt->array, stmt->ctx_post); - emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); - emit_expr_variable_ref(stmt->key_expr, stmt->ctx_post, true); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - emit_expr_clear_local(stmt->array.as_identifier, blk); - if (!stmt->use_key) emit_expr_clear_local(stmt->key_expr.as_identifier, blk); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_break = can_break_; - break_blks_.clear(); - can_break_ = false; - - auto jmptable_loc = create_label(); - auto break_loc = create_label(); - - emit_expr(stmt->test, blk); - 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; - block* default_ctx = nullptr; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - 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"); - } - - blk->transfer(case_->blk); - case_->blk->loc_break = break_loc; - emit_stmt_list(case_->stmt, case_->blk, false); - if (case_->stmt->list.size() > 0) - emit_remove_local_vars(case_->blk); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - - has_default = true; - default_ctx = entry.as_default->blk.get(); - - blk->transfer(entry.as_default->blk); - entry.as_default->blk->loc_break = break_loc; - emit_stmt_list(entry.as_default->stmt, entry.as_default->blk, false); - if (entry.as_default->stmt->list.size() > 0) - emit_remove_local_vars(entry.as_default->blk); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - } - blk->init_from_child(break_blks_); - } - - insert_label(jmptable_loc); - - emit_opcode(opcode::OP_endswitch, data); - - auto offset = static_cast(7 * stmt->stmt->list.size()); - function_->instructions.back()->size += offset; - index_ += offset; - - insert_label(break_loc); - - can_break_ = old_break; - break_blks_ = old_breaks; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) -{ - if (!can_break_ || blk->abort != abort_t::abort_none || blk->loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - break_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_break; - emit_opcode(opcode::OP_jump, blk->loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) -{ - if (!can_continue_ || blk->abort != abort_t::abort_none || blk->loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - continue_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_continue; - emit_opcode(opcode::OP_jump, blk->loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - blk->abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr, blk); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child, blk); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate, blk); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference, blk); - break; - case ast::kind::expr_add_array: - emit_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_thisthread: - emit_opcode(opcode::OP_GetThisthread); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - 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, blk); - 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, const block::ptr& blk) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue, blk); - } - else if (expr->lvalue == ast::kind::expr_tuple) - { - emit_expr(expr->rvalue, blk); - emit_expr_tuple(expr->lvalue.as_tuple, blk); - } - else - { - emit_expr(expr->rvalue, blk); - emit_expr_variable_ref(expr->lvalue, blk, true); - } - - return; - } - - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - 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_mod); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_ex_or); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, blk, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key, blk); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, blk, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj, blk); - 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, blk, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk) -{ - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); - else - emit_opcode(opcode::OP_ClearLocalVariableFieldCached, variable_access_index(expr, blk)); -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_inc); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_dec); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr, blk); - emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr, blk); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_equality); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_inequality); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_less); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_greater); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_less_equal); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_greater_equal); - 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_ex_or); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_mod); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt && mode_ == gsc::build::prod) - { - const auto& name = expr->name->value; - if (name == "assert" || name == "assertex" || name == "assertmsg") return; - } - - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal && expr->args->list.size() > 0) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptLocalFunctionCall, expr->name->value); - else - emit_opcode(opcode::OP_ScriptLocalFunctionCall2, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptFarFunctionCall, { expr->path->value, expr->name->value }); - else - emit_opcode(opcode::OP_ScriptFarFunctionCall2, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltin0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltin1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltin2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltin3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltin4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltin5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltin, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptLocalMethodCall, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFarMethodCall, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltinMethod0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltinMethod1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltinMethod2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltinMethod3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltinMethod4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltinMethod5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltinMethod, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_EmptyArray); - - for (const auto& arg : expr->args->list) - { - emit_expr(arg, blk); - emit_opcode(opcode::OP_AddArray); - } -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) -{ - for (const auto& entry : expr->list) - { - variable_initialize(entry, blk); - emit_opcode(opcode::OP_SafeCreateVariableFieldCached, variable_create_index(entry, blk)); - } - - emit_opcode(opcode::OP_checkclearparams); -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry, blk); - } -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) -{ - bool method = false; - auto type = resolve_reference_type(expr, method); - - switch (type) - { - case ast::call::type::local: - emit_opcode(opcode::OP_GetLocalFunction, expr->name->value); - break; - case ast::call::type::far: - emit_opcode(opcode::OP_GetFarFunction, { expr->path->value, expr->name->value }); - break; - case ast::call::type::builtin: - if (method) - emit_opcode(opcode::OP_GetBuiltinMethod, expr->name->value); - else - emit_opcode(opcode::OP_GetBuiltinFunction, expr->name->value); - break; - } -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_size); -} - -void compiler::emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - emit_expr_variable_ref(expr->temp, blk, true); - - auto index = 0; - - for (const auto& entry : expr->list) - { - if (index == 0) - emit_opcode(opcode::OP_GetZero); - else - emit_opcode(opcode::OP_GetByte, utils::string::va("%d", index)); - - index++; - - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->temp.as_identifier, blk)); - - emit_expr_variable_ref(entry, blk, true); - } - - emit_expr_clear_local(expr->temp.as_identifier, blk); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, blk, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, blk, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, blk, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set) -{ - emit_expr(expr->key, blk); - - 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, blk, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - { - if (!variable_initialized(expr->obj.as_identifier, blk)) - { - variable_initialize(expr->obj.as_identifier, blk); - emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(expr->obj.as_identifier, blk)); - - if (!set) throw comp_error(expr->loc(), "INTERNAL: VAR CREATED BUT NOT SET!"); - } - else if (variable_stack_index(expr->obj.as_identifier, blk) == 0) - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached0); - } - else - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access_index(expr->obj.as_identifier, blk)); - } - - 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, const block::ptr& blk, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); - break; - case ast::kind::expr_anim: - set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); - break; - case ast::kind::expr_self: - set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - 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, blk); - 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_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, 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 + "'"); - } - - if (set) - { - if (!variable_initialized(expr, blk)) - { - variable_initialize(expr, blk); - emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(expr, blk)); - } - else if (variable_stack_index(expr, blk) == 0) - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached0); - } - else - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached, variable_access_index(expr, blk)); - } - } - else - { - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_EvalLocalVariableRefCached0); - else - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access_index(expr, blk)); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->key, blk); - - if (expr->obj == ast::kind::expr_identifier) - { - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->obj.as_identifier, blk)); - } - else - { - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_EvalArray); - } -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_EvalLevelFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_EvalAnimFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_EvalSelfFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, const block::ptr& blk) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - emit_expr(itr->second, blk); - return; - } - - // is local var - auto index = variable_stack_index(expr, blk); - - switch (index) - { - case 0: - emit_opcode(opcode::OP_EvalLocalVariableCached0); - break; - case 1: - emit_opcode(opcode::OP_EvalLocalVariableCached1); - break; - case 2: - emit_opcode(opcode::OP_EvalLocalVariableCached2); - break; - case 3: - emit_opcode(opcode::OP_EvalLocalVariableCached3); - break; - case 4: - emit_opcode(opcode::OP_EvalLocalVariableCached4); - break; - case 5: - emit_opcode(opcode::OP_EvalLocalVariableCached5); - break; - default: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access_index(expr, blk)); - break; - } -} - -void compiler::emit_expr_object(const ast::expr& expr, const block::ptr& blk) -{ - 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, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr.as_identifier, blk)); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk) -{ - std::vector data; - - bool isexpr = false; - - 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) - { - auto base = index_ + 1; - auto algn = (base + (4 - 1)) & ~(4 - 1); - emit_opcode(opcode::OP_GetVector, data); - index_ += (algn - base); - } - else - { - emit_expr(expr->z, blk); - emit_expr(expr->y, blk); - emit_expr(expr->x, blk); - 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(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimation, { "", expr->value }); - } - else - { - emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); - tree.loaded = true; - } -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error(expr->loc(), "trying to use animtree without specified using animtree"); - } - - auto& tree = animtrees_.back(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimTree, ""); - } - else - { - emit_opcode(opcode::OP_GetAnimTree, tree.name); - tree.loaded = true; - } -} - -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_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_create_local_vars(const block::ptr& blk) -{ - if ( blk->local_vars_create_count != blk->local_vars_public_count ) - { - for (auto i = blk->local_vars_create_count; i < blk->local_vars_public_count; i++) - { - auto data = utils::string::va("%d", blk->local_vars.at(i).create); - emit_opcode(opcode::OP_CreateLocalVariable, data); - blk->local_vars.at(i).init = true; - } - blk->local_vars_create_count = blk->local_vars_public_count; - } -} - -void compiler::emit_remove_local_vars(const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - auto count = blk->local_vars_create_count - blk->local_vars_public_count; - - if (count > 0) - { - auto data = utils::string::va("%d", count); - emit_opcode(opcode::OP_RemoveLocalVariables, data); - } - } -} - -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, const block::ptr& blk) -{ - process_expr_parameters(decl->params, blk); - process_stmt_list(decl->stmt, blk); -} - -void compiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - 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_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, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk) -{ - process_stmt_list(stmt->list, blk); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - 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, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - blk->merge(childs); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - stmt->blk_if = std::make_unique(); - stmt->blk_else = std::make_unique(); - - blk->copy(stmt->blk_if); - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - blk->copy(stmt->blk_else); - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - blk->merge(childs); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - stmt->blk = std::make_unique(); - stmt->blk_iter = std::make_unique(); - - process_stmt(stmt->init, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->blk); - blk->copy(stmt->blk_iter); - - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_stmt(stmt->iter, stmt->blk_iter); - - blk->append({ stmt->blk_iter.get() }); - blk->merge({ stmt->blk_iter.get() }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto array_name = utils::string::va("_temp_%d", ++label_idx_); - auto key_name = utils::string::va("_temp_%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; - - // calculate variables - - stmt->ctx = std::make_unique(); - stmt->ctx_post = std::make_unique(); - - // calculate pre_expr variables - process_expr(stmt->array, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->ctx); - blk->copy(stmt->ctx_post); - - // calculate stmt variables & add missing array access as first stmt - process_expr(stmt->value_expr, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - continue_blks_.push_back(stmt->ctx.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_expr(stmt->key_expr, stmt->ctx_post); - - blk->append({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - // calculate variables - stmt->ctx = std::make_unique(); - std::vector childs; - auto abort = abort_t::abort_return; - bool has_default = false; - block* default_ctx = nullptr; - auto old_breaks = break_blks_; - break_blks_.clear(); - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->copy(entry.as_case->blk); - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort != abort_t::abort_none) - { - if (entry.as_case->blk->abort == abort_t::abort_break ) - { - entry.as_case->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_case->blk.get()); - } - else if (entry.as_case->blk->abort <= abort ) - { - abort = entry.as_case->blk->abort; - } - } - } - else if (entry == ast::kind::stmt_default) - { - entry.as_default->blk = std::make_unique(); - blk->copy(entry.as_default->blk); - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - has_default = true; - default_ctx = entry.as_default->blk.get(); - - if (entry.as_default->blk->abort != abort_t::abort_none) - { - if (entry.as_default->blk->abort == abort_t::abort_break ) - { - entry.as_default->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_default->blk.get()); - } - else if (entry.as_default->blk->abort <= abort ) - { - abort = entry.as_default->blk->abort; - } - } - } - } - - stmt->stmt =std::move(stmt_list); - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - } - - blk->append(break_blks_); - blk->merge(childs); - } - - break_blks_ = old_breaks; -} - -void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - break_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_break; - } -} - -void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - continue_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_continue; - } -} - -void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } -} - -void compiler::process_expr(const ast::expr& expr, const block::ptr& blk) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value, blk); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj, blk); - } - else if (expr == ast::kind::expr_tuple) - { - process_expr_tuple(expr.as_tuple, blk); - } -} - -void compiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - auto array = utils::string::va("_temp_%d", ++label_idx_); - expr->temp = ast::expr(std::make_unique(expr->loc(), array)); - - process_expr(expr->temp, blk); - - for (const auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk) -{ - for (const auto& entry : decl->list) - { - variable_register(entry->value, blk); - } -} - -void compiler::variable_register(const std::string& name, const block::ptr& blk) -{ - auto it = std::find_if (blk->local_vars.begin(), blk->local_vars.end(), - [&](const gsc::local_var& v) { return v.name == name; }); - - if (it == blk->local_vars.end()) - { - auto found = false; - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - blk->local_vars.push_back({ name, static_cast(i), false }); - found = true; - break; - } - } - - if (!found) - { - blk->local_vars.push_back({ name, stack_idx_, false }); - local_stack_.push_back(name); - stack_idx_++; - } - } -} - -void compiler::variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::uint32_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (!blk->local_vars[i].init) - { - for (std::uint32_t j = 0; j < i; j++) - { - if (!blk->local_vars[j].init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", blk->local_vars[j].create)); - blk->local_vars[j].init = true; - } - } - blk->local_vars[i].init = true; - blk->local_vars_create_count = i + 1; - return; - } - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -void compiler::variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - auto& var = blk->local_vars.at(i); - if (var.name == name->value) - { - if (!var.init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); - var.init = true; - blk->local_vars_create_count++; - } - return; - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return static_cast(blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - return utils::string::va("%d", blk->local_vars[i].create); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return utils::string::va("%d", blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - return blk->local_vars.at(i).init; - } - } - - 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_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jump: - case opcode::OP_jumpback: - case opcode::OP_switch: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_endswitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - -auto compiler::map_known_includes(const std::string&) -> bool -{ - return false; -} - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/compiler.hpp b/src/experimental/iw5c/xsk/compiler.hpp deleted file mode 100644 index 279e1fc2..00000000 --- a/src/experimental/iw5c/xsk/compiler.hpp +++ /dev/null @@ -1,159 +0,0 @@ -// 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::gsc::iw5c -{ - -enum class opcode : std::uint8_t; - -class compiler : public gsc::compiler -{ - build mode_; - std::string filename_; - std::vector assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector break_blks_; - std::vector continue_blks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - -public: - auto output() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_constant(const ast::decl_constant::ptr& constant); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last); - void emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void emit_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt, const block::ptr& blk); - void emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk); - void emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk); - void emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk); - void emit_expr(const ast::expr& expr, const block::ptr& blk); - void emit_expr_assign(const ast::expr_assign::ptr& expr, const block::ptr& blk); - void emit_expr_clear(const ast::expr& expr, const block::ptr& blk); - void emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk); - void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk); - void emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_variable(const ast::expr& expr, const block::ptr& blk); - void emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void emit_expr_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_object(const ast::expr& expr, const block::ptr& blk); - void emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_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_create_local_vars(const block::ptr& blk); - void emit_remove_local_vars(const block::ptr& blk); - 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, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(const ast::expr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk); - void variable_register(const std::string& name, const block::ptr& blk); - void variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk); - void variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk); - auto variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t; - auto variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool; - 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; -}; - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/context.cpp b/src/experimental/iw5c/xsk/context.cpp deleted file mode 100644 index 73ebc739..00000000 --- a/src/experimental/iw5c/xsk/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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 "iw5c.hpp" - -namespace xsk::gsc::iw5c -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/context.hpp b/src/experimental/iw5c/xsk/context.hpp deleted file mode 100644 index 6db907c6..00000000 --- a/src/experimental/iw5c/xsk/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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::gsc::iw5c -{ - -class context : public gsc::context -{ - iw5c::assembler assembler_; - iw5c::disassembler disassembler_; - iw5c::compiler compiler_; - iw5c::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { return assembler_; } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { return compiler_; } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/decompiler.cpp b/src/experimental/iw5c/xsk/decompiler.cpp deleted file mode 100644 index ffb3ce12..00000000 --- a/src/experimental/iw5c/xsk/decompiler.cpp +++ /dev/null @@ -1,3436 +0,0 @@ -// 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 "iw5c.hpp" - -namespace xsk::gsc::iw5c -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// IW5 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetLocalFunction: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalFunctionCall2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - 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_ScriptLocalFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalMethodCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodChildThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall2: - { - 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 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_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin1: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin3: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin4: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin5: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod1: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod2: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod3: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod4: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod5: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_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 node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // jump is referenced, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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 - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - auto use_key = true; - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - use_key = false; - } - - 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)), use_key)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(std::stoi(entry->value.substr(4))), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - auto var = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - auto var1 = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); - blk->local_vars_create_count++; - } - - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/decompiler.hpp b/src/experimental/iw5c/xsk/decompiler.hpp deleted file mode 100644 index 5c652eaa..00000000 --- a/src/experimental/iw5c/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::iw5c -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/disassembler.cpp b/src/experimental/iw5c/xsk/disassembler.cpp deleted file mode 100644 index 04a8b31a..00000000 --- a/src/experimental/iw5c/xsk/disassembler.cpp +++ /dev/null @@ -1,573 +0,0 @@ -// 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 "iw5c.hpp" - -namespace xsk::gsc::iw5c -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// IW5 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read_endian(); - func->id = stack_->read_endian(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read_endian(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - case opcode::OP_Return: - case opcode::OP_GetUndefined: - case opcode::OP_GetZero: - case opcode::OP_waittillFrameEnd: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_EvalArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_ClearArray: - case opcode::OP_EmptyArray: - case opcode::OP_AddArray: - case opcode::OP_PreScriptCall: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_GetLevelObject: - case opcode::OP_GetAnimObject: - case opcode::OP_GetSelf: - case opcode::OP_GetThisthread: - case opcode::OP_GetLevel: - case opcode::OP_GetGame: - case opcode::OP_GetAnim: - case opcode::OP_GetGameRef: - case opcode::OP_inc: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_bit_ex_or: - case opcode::OP_bit_and: - case opcode::OP_equality: - case opcode::OP_inequality: - case opcode::OP_less: - case opcode::OP_greater: - case opcode::OP_less_equal: - case opcode::OP_waittillmatch2: - case opcode::OP_waittill: - case opcode::OP_notify: - case opcode::OP_endon: - case opcode::OP_voidCodepos: - case opcode::OP_vector: - case opcode::OP_greater_equal: - case opcode::OP_shift_left: - case opcode::OP_shift_right: - case opcode::OP_plus: - case opcode::OP_minus: - case opcode::OP_multiply: - case opcode::OP_divide: - case opcode::OP_mod: - case opcode::OP_size: - case opcode::OP_GetSelfObject: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_clearparams: - case opcode::OP_checkclearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_SetVariableField: - case opcode::OP_ClearVariableField: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_wait: - case opcode::OP_DecTop: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_BoolNot: - case opcode::OP_BoolComplement: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read_endian())); - break; - case opcode::OP_GetVector: - inst->size += script_->align(4); - inst->data.push_back(utils::string::float_string(script_->read_endian())); - inst->data.push_back(utils::string::float_string(script_->read_endian())); - inst->data.push_back(utils::string::float_string(script_->read_endian())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(2); - inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); - break; - case opcode::OP_GetAnimation: - script_->seek(4); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_CreateLocalVariable: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_EvalLocalVariableObjectCached: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - disassemble_field_variable(inst); - break; - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - } - - const auto id = script_->read_endian(); - const auto name = method ? resolver::method_name(id) : resolver::function_name(id); - inst->data.emplace(inst->data.begin(), name); -} - -void disassembler::disassemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto offset = disassemble_offset(); - - inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - } -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(3); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - } - - const auto file_id = stack_->read_endian(); - const auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::token_name(file_id); - const auto func_id = stack_->read_endian(); - const auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); - - inst->data.emplace(inst->data.begin(), func_name); - inst->data.emplace(inst->data.begin(), file_name); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read_endian(); - 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) -{ - const auto count = script_->read_endian(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read_endian(); - - if (value < 0x40000) - { - const auto data = stack_->read_c_string(); - - if (data.data()[0] != 0x01) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(data, false)); - } - else - inst->data.push_back("default"); - } - else - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - index += 4; - - const auto addr = disassemble_offset() + index; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 3; - inst->size += 7; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - const auto id = script_->read_endian(); - std::string name; - - if (id > max_string_id) - { - auto temp = stack_->read_endian(); - name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); - } - else - { - name = resolver::token_name(id); - } - - inst->data.push_back(name); -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read_endian(); - } - else if (back) - { - addr = inst->index + 3 - script_->read_endian(); - } - else - { - addr = inst->index + 5 + script_->read_endian(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -auto disassembler::disassemble_offset() -> std::int32_t -{ - std::array bytes = {}; - - for (auto i = 0; i < 3; i++) - { - bytes[2 - i] = script_->read_endian(); - } - - auto offset = *reinterpret_cast(bytes.data()); - - offset = (offset << 8) >> 10; - - return offset; -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = resolve_function(inst->data[0]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s\n", func->name.data())); - - 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())); - } - - print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s\n", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - - output_->write_string("\n"); - break; - } -} - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/disassembler.hpp b/src/experimental/iw5c/xsk/disassembler.hpp deleted file mode 100644 index 6e360fd7..00000000 --- a/src/experimental/iw5c/xsk/disassembler.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc::iw5c -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_local_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - auto disassemble_offset() -> std::int32_t; - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/iw5c.cpp b/src/experimental/iw5c/xsk/iw5c.cpp deleted file mode 100644 index 5f6ff468..00000000 --- a/src/experimental/iw5c/xsk/iw5c.cpp +++ /dev/null @@ -1,179 +0,0 @@ -// 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 "iw5c.hpp" - -namespace xsk::gsc::iw5c -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_End: - case opcode::OP_Return: - case opcode::OP_GetUndefined: - case opcode::OP_GetZero: - case opcode::OP_waittillFrameEnd: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_EvalArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_ClearArray: - case opcode::OP_EmptyArray: - case opcode::OP_AddArray: - case opcode::OP_PreScriptCall: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_GetLevelObject: - case opcode::OP_GetAnimObject: - case opcode::OP_GetSelf: - case opcode::OP_GetThisthread: - case opcode::OP_GetLevel: - case opcode::OP_GetGame: - case opcode::OP_GetAnim: - case opcode::OP_GetGameRef: - case opcode::OP_inc: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_bit_ex_or: - case opcode::OP_bit_and: - case opcode::OP_equality: - case opcode::OP_inequality: - case opcode::OP_less: - case opcode::OP_greater: - case opcode::OP_less_equal: - case opcode::OP_waittillmatch2: - case opcode::OP_waittill: - case opcode::OP_notify: - case opcode::OP_endon: - case opcode::OP_voidCodepos: - case opcode::OP_vector: - case opcode::OP_greater_equal: - case opcode::OP_shift_left: - case opcode::OP_shift_right: - case opcode::OP_plus: - case opcode::OP_minus: - case opcode::OP_multiply: - case opcode::OP_divide: - case opcode::OP_mod: - case opcode::OP_size: - case opcode::OP_GetSelfObject: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_clearparams: - case opcode::OP_checkclearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_SetVariableField: - case opcode::OP_ClearVariableField: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_wait: - case opcode::OP_DecTop: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_BoolNot: - case opcode::OP_BoolComplement: - return 1; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - case opcode::OP_CreateLocalVariable: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_waittillmatch: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_GetAnimTree: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_EvalLocalVariableObjectCached: - return 2; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_GetString: - case opcode::OP_GetIString: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jumpback: - case opcode::OP_endswitch: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - return 3; - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_GetLocalFunction: - case opcode::OP_CallBuiltin: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - case opcode::OP_GetFarFunction: - return 4; - case opcode::OP_GetInteger: - case opcode::OP_GetFloat: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_GetAnimation: - case opcode::OP_switch: - case opcode::OP_jump: - return 5; - case opcode::OP_GetVector: - return 13; - default: - throw std::runtime_error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/iw5c.hpp b/src/experimental/iw5c/xsk/iw5c.hpp deleted file mode 100644 index 1c480b27..00000000 --- a/src/experimental/iw5c/xsk/iw5c.hpp +++ /dev/null @@ -1,182 +0,0 @@ -// 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 "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::iw5c -{ - -constexpr std::uint16_t max_string_id = 0x8250; - -enum class opcode : std::uint8_t -{ - OP_End = 0, - OP_Return = 1, - OP_GetUndefined = 2, - OP_GetZero = 3, - OP_GetByte = 4, - OP_GetAnimTree = 5, - OP_GetNegByte = 6, - OP_GetUnsignedShort = 7, - OP_GetNegUnsignedShort = 8, - OP_GetInteger = 9, - OP_GetBuiltinFunction = 0xA, - OP_GetBuiltinMethod = 0xB, - OP_GetFloat = 0xC, - OP_GetString = 0xD, - OP_GetIString = 0xE, - OP_GetVector = 0xF, - OP_GetLevelObject = 0x10, - OP_GetAnimObject = 0x11, - OP_GetSelf = 0x12, - OP_GetThisthread = 0x13, - OP_GetLevel = 0x14, - OP_GetGame = 0x15, - OP_GetAnim = 0x16, - OP_GetAnimation = 0x17, - OP_GetGameRef = 0x18, - OP_GetLocalFunction = 0x19, - OP_GetFarFunction = 0x1A, - OP_CreateLocalVariable = 0x1B, - OP_RemoveLocalVariables = 0x1C, - OP_EvalLocalVariableCached0 = 0x1D, - OP_EvalLocalVariableCached1 = 0x1E, - OP_EvalLocalVariableCached2 = 0x1F, - OP_EvalLocalVariableCached3 = 0x20, - OP_EvalLocalVariableCached4 = 0x21, - OP_EvalLocalVariableCached5 = 0x22, - OP_EvalLocalVariableCached = 0x23, - OP_EvalLocalArrayCached = 0x24, - OP_EvalArray = 0x25, - OP_EvalLocalArrayRefCached0 = 0x26, - OP_EvalNewLocalArrayRefCached0 = 0x27, - OP_EvalLocalArrayRefCached = 0x28, - OP_EvalArrayRef = 0x29, - OP_ClearArray = 0x2A, - OP_EmptyArray = 0x2B, - OP_AddArray = 0x2C, - OP_GetSelfObject = 0x2D, - OP_EvalLevelFieldVariable = 0x2E, - OP_EvalAnimFieldVariable = 0x2F, - OP_EvalSelfFieldVariable = 0x30, - OP_EvalFieldVariable = 0x31, - OP_EvalLevelFieldVariableRef = 0x32, - OP_EvalAnimFieldVariableRef = 0x33, - OP_EvalSelfFieldVariableRef = 0x34, - OP_EvalFieldVariableRef = 0x35, - OP_ClearFieldVariable = 0x36, - OP_SafeCreateVariableFieldCached = 0x37, - OP_SafeSetVariableFieldCached0 = 0x38, - OP_SafeSetVariableFieldCached = 0x39, - OP_SafeSetWaittillVariableFieldCached = 0x3A, - OP_clearparams = 0x3B, - OP_checkclearparams = 0x3C, - OP_EvalLocalVariableRefCached0 = 0x3D, - OP_EvalNewLocalVariableRefCached0 = 0x3E, - OP_EvalLocalVariableRefCached = 0x3F, - OP_SetLevelFieldVariableField = 0x40, - OP_SetVariableField = 0x41, - OP_ClearVariableField = 0x42, - OP_SetAnimFieldVariableField = 0x43, - OP_SetSelfFieldVariableField = 0x44, - OP_SetLocalVariableFieldCached0 = 0x45, - OP_SetNewLocalVariableFieldCached0 = 0x46, - OP_SetLocalVariableFieldCached = 0x47, - OP_ClearLocalVariableFieldCached = 0x48, - OP_ClearLocalVariableFieldCached0 = 0x49, - OP_CallBuiltin0 = 0x4A, - OP_CallBuiltin1 = 0x4B, - OP_CallBuiltin2 = 0x4C, - OP_CallBuiltin3 = 0x4D, - OP_CallBuiltin4 = 0x4E, - OP_CallBuiltin5 = 0x4F, - OP_CallBuiltin = 0x50, - OP_CallBuiltinMethod0 = 0x51, - OP_CallBuiltinMethod1 = 0x52, - OP_CallBuiltinMethod2 = 0x53, - OP_CallBuiltinMethod3 = 0x54, - OP_CallBuiltinMethod4 = 0x55, - OP_CallBuiltinMethod5 = 0x56, - OP_CallBuiltinMethod = 0x57, - OP_wait = 0x58, - OP_waittillFrameEnd = 0x59, - OP_PreScriptCall = 0x5A, - OP_ScriptLocalFunctionCall2 = 0x5B, - OP_ScriptLocalFunctionCall = 0x5C, - OP_ScriptLocalMethodCall = 0x5D, - OP_ScriptLocalThreadCall = 0x5E, - OP_ScriptLocalChildThreadCall = 0x5F, - OP_ScriptLocalMethodThreadCall = 0x60, - OP_ScriptLocalMethodChildThreadCall = 0x61, - OP_ScriptFarFunctionCall2 = 0x62, - OP_ScriptFarFunctionCall = 0x63, - OP_ScriptFarMethodCall = 0x64, - OP_ScriptFarThreadCall = 0x65, - OP_ScriptFarChildThreadCall = 0x66, - OP_ScriptFarMethodThreadCall = 0x67, - OP_ScriptFarMethodChildThreadCall = 0x68, - OP_ScriptFunctionCallPointer = 0x69, - OP_ScriptMethodCallPointer = 0x6A, - OP_ScriptThreadCallPointer = 0x6B, - OP_ScriptChildThreadCallPointer = 0x6C, - OP_ScriptMethodThreadCallPointer = 0x6D, - OP_ScriptMethodChildThreadCallPointer = 0x6E, - OP_CallBuiltinPointer = 0x6F, - OP_CallBuiltinMethodPointer = 0x70, - OP_DecTop = 0x71, - OP_CastFieldObject = 0x72, - OP_EvalLocalVariableObjectCached = 0x73, - OP_CastBool = 0x74, - OP_BoolNot = 0x75, - OP_BoolComplement = 0x76, - OP_JumpOnFalse = 0x77, - OP_JumpOnTrue = 0x78, - OP_JumpOnFalseExpr = 0x79, - OP_JumpOnTrueExpr = 0x7A, - OP_jump = 0x7B, - OP_jumpback = 0x7C, - OP_inc = 0x7D, - OP_dec = 0x7E, - OP_bit_or = 0x7F, - OP_bit_ex_or = 0x80, - OP_bit_and = 0x81, - OP_equality = 0x82, - OP_inequality = 0x83, - OP_less = 0x84, - OP_greater = 0x85, - OP_less_equal = 0x86, - OP_greater_equal = 0x87, - OP_shift_left = 0x88, - OP_shift_right = 0x89, - OP_plus = 0x8A, - OP_minus = 0x8B, - OP_multiply = 0x8C, - OP_divide = 0x8D, - OP_mod = 0x8E, - OP_size = 0x8F, - OP_waittillmatch = 0x90, - OP_waittillmatch2 = 0x91, - OP_waittill = 0x92, - OP_notify = 0x93, - OP_endon = 0x94, - OP_voidCodepos = 0x95, - OP_switch = 0x96, - OP_endswitch = 0x97, - OP_vector = 0x98, - OP_Count = 0x99, -}; - -auto opcode_size(std::uint8_t id) -> std::uint32_t; - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/lexer.cpp b/src/experimental/iw5c/xsk/lexer.cpp deleted file mode 100644 index c30f9e20..00000000 --- a/src/experimental/iw5c/xsk/lexer.cpp +++ /dev/null @@ -1,848 +0,0 @@ -// 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 "iw5c.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -xsk::gsc::iw5c::parser::symbol_type IW5Clex(xsk::gsc::iw5c::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::gsc::iw5c -{ - -const std::unordered_map keyword_map -{{ - { "#define", parser::token::SH_DEFINE }, - { "#undef", parser::token::SH_UNDEF }, - { "#ifdef", parser::token::SH_IFDEF }, - { "#ifndef", parser::token::SH_IFNDEF }, - { "#if", parser::token::SH_IF }, - { "#elif", parser::token::SH_ELIF }, - { "#else", parser::token::SH_ELSE }, - { "#endif", parser::token::SH_ENDIF }, - { "#inline", parser::token::INLINE }, - { "#include", parser::token::INCLUDE }, - { "#using_animtree", parser::token::USINGTREE }, - { "#animtree", parser::token::ANIMTREE }, - { "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 }, - { "childthread", parser::token::CHILDTHREAD }, - { "thisthread", parser::token::THISTHREAD }, - { "call", parser::token::CALL }, - { "true", parser::token::TRUE }, - { "false", parser::token::FALSE }, - { "undefined", parser::token::UNDEFINED }, - { "size", parser::token::SIZE }, - { "game", parser::token::GAME }, - { "self", parser::token::SELF }, - { "anim", parser::token::ANIM }, - { "level", parser::token::LEVEL }, -}}; - -buffer::buffer() : length(0) -{ - data = static_cast(std::malloc(max_buf_size)); -} - -buffer::~buffer() -{ - if (data) std::free(data); -} - -bool buffer::push(char c) -{ - if (length >= max_buf_size) - return false; - - data[length++] = c; - return true; -} - -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) -{ - -} - -void reader::init(const char* data, size_t size) -{ - if (data && size) - { - state = reader::ok; - buffer_pos = data; - bytes_remaining = static_cast(size); - last_byte = 0; - current_byte = *data; - } - else - { - state = reader::end; - buffer_pos = 0; - bytes_remaining = 0; - last_byte = 0; - current_byte = 0; - } -} - -void reader::advance() -{ - ++buffer_pos; - - if (bytes_remaining-- == 1) - { - state = reader::end; - bytes_remaining = 0; - last_byte = current_byte; - current_byte = 0; - } - else - { - last_byte = current_byte; - current_byte = *buffer_pos; - } -} - -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) -{ - reader_.init(data, size); -} - -void lexer::push_header(const std::string& file) -{ - try - { - if (header_top_++ >= 10) - throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - - auto data = resolver::file_data(file + ".gsh"); - - readers_.push(reader_); - locs_.push(loc_); - loc_.initialize(std::get<0>(data)); - reader_.init(std::get<1>(data), std::get<2>(data)); - clean_ = true; - } - catch (const std::exception& e) - { - throw error("parsing header file '" + file + "': " + e.what()); - } -} - -void lexer::pop_header() -{ - header_top_--; - loc_ = locs_.top(); - locs_.pop(); - reader_ = readers_.top(); - readers_.pop(); -} - -void lexer::ban_header(const location& loc) -{ - if (header_top_ > 0) - { - throw comp_error(loc, "not allowed inside a gsh file"); - } -} - -auto lexer::lex() -> parser::symbol_type -{ - buffer_.length = 0; - state_ = state::start; - - while (true) - { - const auto& state = reader_.state; - auto& last = reader_.last_byte; - auto& curr = reader_.current_byte; - auto path = false; - loc_.step(); - - if (state == reader::end) - { - if (indev_) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (header_top_ > 0) - pop_header(); - else - return parser::make_IW5CEOF(loc_); - } - - if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') - clean_ = false; - - advance(); - - switch (last) - { - case ' ': - case '\t': - case '\r': - loc_.step(); - continue; - case '\n': - loc_.lines(); - loc_.step(); - clean_ = true; - continue; - case '\\': - throw comp_error(loc_, "invalid token ('\\')"); - case '/': - if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') - return parser::make_DIV(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_DIV(loc_); - - if (last == '#') - { - if (indev_) - throw comp_error(loc_, "cannot recurse devblock ('/#')"); - - if (mode_ == build::dev) - { - indev_ = true; - return parser::make_DEVBEGIN(loc_); - } - else - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '#' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - } - else if (last == '@') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched script doc comment start ('/@')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '@' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '*') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched multiline comment start ('/*')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '*' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '/') - { - while (true) - { - if (state == reader::end) - break; - - if (curr == '\n') - break; - - advance(); - } - } - continue; - case '#': - if (curr == '/') - { - if (!indev_) - throw comp_error(loc_, "unmatched devblock end ('#/')"); - - advance(); - indev_ = false; - return parser::make_DEVEND(loc_); - } - - buffer_.push(last); - advance(); - - while (state == reader::ok) - { - if (last != ' ' || last != '\t') - break; - - advance(); - } - - if (state == reader::end || !((last > 64 && last < 91) || (last > 96 && last < 123))) - throw comp_error(loc_, "invalid preprocessor directive ('#')"); - - state_ = state::preprocessor; - goto lex_name; - case '*': - if (curr != '=' && curr != '/') - return parser::make_MUL(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_MUL(loc_); - - throw comp_error(loc_, "unmatched multiline comment end ('*/')"); - case '"': - state_ = state::string; - goto lex_string; - case '.': - if (curr < '0' || curr > '9') - return parser::make_DOT(loc_); - goto lex_number; - case '(': - return parser::make_LPAREN(loc_); - case ')': - return parser::make_RPAREN(loc_); - case '{': - return parser::make_LBRACE(loc_); - case '}': - return parser::make_RBRACE(loc_); - case '[': - return parser::make_LBRACKET(loc_); - case ']': - return parser::make_RBRACKET(loc_); - case ',': - return parser::make_COMMA(loc_); - case ';': - return parser::make_SEMICOLON(loc_); - case ':': - if (curr != ':') - return parser::make_COLON(loc_); - - advance(); - return parser::make_DOUBLECOLON(loc_); - case '?': - return parser::make_QMARK(loc_); - case '=': - if (curr != '=') - return parser::make_ASSIGN(loc_); - - advance(); - return parser::make_EQUALITY(loc_); - case '+': - if (curr != '+' && curr != '=') - return parser::make_ADD(loc_); - - advance(); - - if (last == '+') - return parser::make_INCREMENT(loc_); - - return parser::make_ASSIGN_ADD(loc_); - case '-': - if (curr != '-' && curr != '=') - return parser::make_SUB(loc_); - - advance(); - - if (last == '-') - return parser::make_DECREMENT(loc_); - - return parser::make_ASSIGN_SUB(loc_); - case '%': - if (curr != '=') - return parser::make_MOD(loc_); - - advance(); - - return parser::make_ASSIGN_MOD(loc_); - case '|': - if (curr != '|' && curr != '=') - return parser::make_BITWISE_OR(loc_); - - advance(); - - if (last == '|') - return parser::make_OR(loc_); - - return parser::make_ASSIGN_BW_OR(loc_); - case '&': - if (curr != '&' && curr != '=' && curr != '"') - return parser::make_BITWISE_AND(loc_); - - advance(); - - if (last == '&') - return parser::make_AND(loc_); - - if (last == '=') - return parser::make_ASSIGN_BW_AND(loc_); - - state_ = state::localize; - goto lex_string; - case '^': - if (curr != '=') - return parser::make_BITWISE_EXOR(loc_); - - advance(); - return parser::make_ASSIGN_BW_EXOR(loc_); - case '!': - if (curr != '=') - return parser::make_NOT(loc_); - - advance(); - return parser::make_INEQUALITY(loc_); - case '~': - return parser::make_COMPLEMENT(loc_); - case '<': - if (curr != '<' && curr != '=') - return parser::make_LESS(loc_); - - advance(); - if (last == '=') - return parser::make_LESS_EQUAL(loc_); - - if (curr != '=') - return parser::make_LSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_LSHIFT(loc_); - case '>': - if (curr != '>' && curr != '=') - return parser::make_GREATER(loc_); - - advance(); - - if (last == '=') - return parser::make_GREATER_EQUAL(loc_); - - if (curr != '=') - return parser::make_RSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_RSHIFT(loc_); - default: - if (last >= '0' && last <= '9') - goto lex_number; - else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) - goto lex_name; - - throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); - } - -lex_string: - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched string start ('\"')"); - - if (curr == '"') - { - advance(); - break; - } - - if (curr == '\n') - throw comp_error(loc_, "unterminated string literal"); - - if (curr == '\\') - { - advance(); - - if (state == reader::end) - throw comp_error(loc_, "invalid token ('\')"); - - char c = curr; - switch (curr) - { - case 't': c = '\t'; break; - case 'r': c = '\r'; break; - case 'n': c = '\n'; break; - case '"': c = '\"'; break; - case '\\': c = '\\'; break; - default: break; - } - - if (!buffer_.push(c)) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); - -lex_name: - buffer_.push(last); - - while (true) - { - if (state == reader::end) - break; - - if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) - break; - - if (curr == '\\') - { - if (last == '\\') - throw comp_error(loc_, "invalid path '\\\\'"); - - path = true; - if (!buffer_.push('/')) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::preprocessor) - { - auto token = parser::token::IW5CUNDEF; - - if (buffer_.length < 16) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - { - if (itr->second > parser::token::SH_ENDIF) - return parser::symbol_type(itr->second, loc_); - - token = itr->second; - } - } - - preprocessor_run(token); - - state_ = state::start; - continue; - } - else - { - 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_); - } - - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - -lex_number: - if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) - { - buffer_.push(last); - - auto dot = last == '.' ? 1 : 0; - auto flt = 0; - - while (true) - { - if (state == reader::end) - break; - - if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) - throw comp_error(loc_, "invalid number literal"); - - if ((curr == '.' || curr == 'f') && last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr == 'f') - flt++; - else if (curr == '.') - dot++; - else if (!(curr > 47 && curr < 58)) - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f')) - throw comp_error(loc_, "invalid number literal"); - - if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); - } - else if (curr == 'o') - { - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) - throw comp_error(loc_, "invalid octal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!(curr > 47 && curr < 56)) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length <= 0) - throw comp_error(loc_, "invalid octal literal"); - - return parser::make_INTEGER(utils::string::oct_to_dec(buffer_.data), loc_); - } - else if (curr == 'b') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) - throw comp_error(loc_, "invalid binary literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr != '0' && curr != '1') - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid binary literal"); - - return parser::make_INTEGER(utils::string::bin_to_dec(buffer_.data), loc_); - } - else if (curr == 'x') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) - throw comp_error(loc_, "invalid hexadecimal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid hexadecimal literal"); - - return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); - } - - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); - } -} - -void lexer::advance() -{ - reader_.advance(); - loc_.end.column++; - - if (reader_.current_byte == '\\') [[unlikely]] - preprocessor_wrap(); -} - -void lexer::preprocessor_wrap() -{ - while (reader_.current_byte == '\\') - { - if (reader_.bytes_remaining == 1) - throw comp_error(loc_, "invalid token ('\\')"); - - if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') - break; - - if (reader_.buffer_pos[1] == '\r') - { - if (reader_.bytes_remaining <= 3 || reader_.buffer_pos[2] != '\n') - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 3; - reader_.bytes_remaining -= 3; - } - - if ((reader_.buffer_pos[1] == '\n')) - { - if (reader_.bytes_remaining == 2) - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 2; - reader_.bytes_remaining -= 2; - } - - if (reader_.bytes_remaining == 0) - { - reader_.state = reader::end; - reader_.current_byte = 0; - } - else - { - reader_.current_byte = *reader_.buffer_pos; - } - - loc_.lines(); - loc_.step(); - } -} - -void lexer::preprocessor_run(parser::token::token_kind_type token) -{ - if (!clean_) - throw comp_error(loc_, "invalid token ('#')"); - - switch (token) - { - case parser::token::SH_DEFINE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_UNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELSE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ENDIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - default: - throw comp_error(loc_, "unknown preprocessor directive"); - } -} - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/lexer.hpp b/src/experimental/iw5c/xsk/lexer.hpp deleted file mode 100644 index 71e6fa67..00000000 --- a/src/experimental/iw5c/xsk/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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::gsc::iw5c -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw5c/xsk/parser.cpp b/src/experimental/iw5c/xsk/parser.cpp deleted file mode 100644 index 6fce131c..00000000 --- a/src/experimental/iw5c/xsk/parser.cpp +++ /dev/null @@ -1,4668 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw5c::parser::symbol_type IW5Clex(xsk::gsc::iw5c::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex IW5Clex - - - -#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 IW5CDEBUG - -// 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 // !IW5CDEBUG - -# 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 // !IW5CDEBUG - -#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 gsc { namespace iw5c { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::gsc::iw5c::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg) -#if IW5CDEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - 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_add_array: // expr_add_array - value.YY_MOVE_OR_COPY< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.YY_MOVE_OR_COPY< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.YY_MOVE_OR_COPY< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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 IW5CDEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if IW5CDEBUG - 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 // IW5CDEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - yylhs.value.emplace< ast::expr_add_array::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - yylhs.value.emplace< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - yylhs.value.emplace< ast::expr_tuple::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_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_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_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 261 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2020 "parser.cpp" - break; - - case 3: // root: %empty -#line 262 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2026 "parser.cpp" - break; - - case 4: // program: program inline -#line 267 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2032 "parser.cpp" - break; - - case 5: // program: program include -#line 269 "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 2038 "parser.cpp" - break; - - case 6: // program: program declaration -#line 271 "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 2044 "parser.cpp" - break; - - case 7: // program: inline -#line 273 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2050 "parser.cpp" - break; - - case 8: // program: include -#line 275 "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 2056 "parser.cpp" - break; - - case 9: // program: declaration -#line 277 "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 2062 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 281 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2068 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 286 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2074 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 290 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2080 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 291 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2086 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 292 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2092 "parser.cpp" - break; - - case 15: // declaration: decl_constant -#line 293 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } -#line 2098 "parser.cpp" - break; - - case 16: // declaration: decl_thread -#line 294 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2104 "parser.cpp" - break; - - case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 299 "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 2110 "parser.cpp" - break; - - case 18: // decl_constant: expr_identifier "=" expr ";" -#line 304 "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 2116 "parser.cpp" - break; - - case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 309 "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 2122 "parser.cpp" - break; - - case 20: // stmt: stmt_block -#line 313 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2128 "parser.cpp" - break; - - case 21: // stmt: stmt_call -#line 314 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2134 "parser.cpp" - break; - - case 22: // stmt: stmt_assign -#line 315 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2140 "parser.cpp" - break; - - case 23: // stmt: stmt_endon -#line 316 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2146 "parser.cpp" - break; - - case 24: // stmt: stmt_notify -#line 317 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2152 "parser.cpp" - break; - - case 25: // stmt: stmt_wait -#line 318 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2158 "parser.cpp" - break; - - case 26: // stmt: stmt_waittill -#line 319 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2164 "parser.cpp" - break; - - case 27: // stmt: stmt_waittillmatch -#line 320 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2170 "parser.cpp" - break; - - case 28: // stmt: stmt_waittillframeend -#line 321 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2176 "parser.cpp" - break; - - case 29: // stmt: stmt_if -#line 322 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2182 "parser.cpp" - break; - - case 30: // stmt: stmt_ifelse -#line 323 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2188 "parser.cpp" - break; - - case 31: // stmt: stmt_while -#line 324 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2194 "parser.cpp" - break; - - case 32: // stmt: stmt_dowhile -#line 325 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2200 "parser.cpp" - break; - - case 33: // stmt: stmt_for -#line 326 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2206 "parser.cpp" - break; - - case 34: // stmt: stmt_foreach -#line 327 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2212 "parser.cpp" - break; - - case 35: // stmt: stmt_switch -#line 328 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2218 "parser.cpp" - break; - - case 36: // stmt: stmt_case -#line 329 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2224 "parser.cpp" - break; - - case 37: // stmt: stmt_default -#line 330 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2230 "parser.cpp" - break; - - case 38: // stmt: stmt_break -#line 331 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2236 "parser.cpp" - break; - - case 39: // stmt: stmt_continue -#line 332 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2242 "parser.cpp" - break; - - case 40: // stmt: stmt_return -#line 333 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2248 "parser.cpp" - break; - - case 41: // stmt: stmt_breakpoint -#line 334 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } -#line 2254 "parser.cpp" - break; - - case 42: // stmt: stmt_prof_begin -#line 335 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2260 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_end -#line 336 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2266 "parser.cpp" - break; - - case 44: // stmt_or_dev: stmt -#line 340 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2272 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt_dev -#line 341 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2278 "parser.cpp" - break; - - case 46: // stmt_list: stmt_list stmt -#line 346 "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 2284 "parser.cpp" - break; - - case 47: // stmt_list: stmt -#line 348 "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 2290 "parser.cpp" - break; - - case 48: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 353 "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 2296 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev -#line 355 "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 2302 "parser.cpp" - break; - - case 50: // stmt_dev: "/#" stmt_list "#/" -#line 359 "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 2308 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" "#/" -#line 360 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2314 "parser.cpp" - break; - - case 52: // stmt_block: "{" stmt_or_dev_list "}" -#line 364 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2320 "parser.cpp" - break; - - case 53: // stmt_block: "{" "}" -#line 365 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2326 "parser.cpp" - break; - - case 54: // stmt_expr: expr_assign -#line 370 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2332 "parser.cpp" - break; - - case 55: // stmt_expr: expr_increment -#line 372 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2338 "parser.cpp" - break; - - case 56: // stmt_expr: expr_decrement -#line 374 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2344 "parser.cpp" - break; - - case 57: // stmt_expr: %empty -#line 376 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2350 "parser.cpp" - break; - - case 58: // stmt_call: expr_call ";" -#line 381 "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 2356 "parser.cpp" - break; - - case 59: // stmt_call: expr_method ";" -#line 383 "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 2362 "parser.cpp" - break; - - case 60: // stmt_assign: expr_assign ";" -#line 388 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2368 "parser.cpp" - break; - - case 61: // stmt_assign: expr_increment ";" -#line 390 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2374 "parser.cpp" - break; - - case 62: // stmt_assign: expr_decrement ";" -#line 392 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2380 "parser.cpp" - break; - - case 63: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 397 "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 2386 "parser.cpp" - break; - - case 64: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 402 "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 2392 "parser.cpp" - break; - - case 65: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 404 "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 2398 "parser.cpp" - break; - - case 66: // stmt_wait: "wait" expr ";" -#line 409 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2404 "parser.cpp" - break; - - case 67: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 414 "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 2410 "parser.cpp" - break; - - case 68: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 416 "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 2416 "parser.cpp" - break; - - case 69: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 421 "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 2422 "parser.cpp" - break; - - case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 423 "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 2428 "parser.cpp" - break; - - case 71: // stmt_waittillframeend: "waittillframeend" ";" -#line 428 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2434 "parser.cpp" - break; - - case 72: // stmt_if: "if" "(" expr ")" stmt -#line 433 "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 2440 "parser.cpp" - break; - - case 73: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 438 "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 2446 "parser.cpp" - break; - - case 74: // stmt_while: "while" "(" expr ")" stmt -#line 443 "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 2452 "parser.cpp" - break; - - case 75: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 448 "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 2458 "parser.cpp" - break; - - case 76: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 453 "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 2464 "parser.cpp" - break; - - case 77: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 458 "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 2470 "parser.cpp" - break; - - case 78: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 460 "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 2476 "parser.cpp" - break; - - case 79: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 465 "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 2482 "parser.cpp" - break; - - case 80: // stmt_case: "case" expr_integer ":" -#line 470 "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 2488 "parser.cpp" - break; - - case 81: // stmt_case: "case" expr_string ":" -#line 472 "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 2494 "parser.cpp" - break; - - case 82: // stmt_default: "default" ":" -#line 477 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2500 "parser.cpp" - break; - - case 83: // stmt_break: "break" ";" -#line 482 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2506 "parser.cpp" - break; - - case 84: // stmt_continue: "continue" ";" -#line 487 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2512 "parser.cpp" - break; - - case 85: // stmt_return: "return" expr ";" -#line 492 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2518 "parser.cpp" - break; - - case 86: // stmt_return: "return" ";" -#line 494 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2524 "parser.cpp" - break; - - case 87: // stmt_breakpoint: "breakpoint" ";" -#line 499 "parser.ypp" - { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } -#line 2530 "parser.cpp" - break; - - case 88: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 504 "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 2536 "parser.cpp" - break; - - case 89: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 509 "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 2542 "parser.cpp" - break; - - case 90: // expr: expr_ternary -#line 513 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2548 "parser.cpp" - break; - - case 91: // expr: expr_binary -#line 514 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2554 "parser.cpp" - break; - - case 92: // expr: expr_primitive -#line 515 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2560 "parser.cpp" - break; - - case 93: // expr_or_empty: expr -#line 519 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2566 "parser.cpp" - break; - - case 94: // expr_or_empty: %empty -#line 520 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2572 "parser.cpp" - break; - - case 95: // expr_assign: expr_tuple "=" expr -#line 525 "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 2578 "parser.cpp" - break; - - case 96: // expr_assign: expr_object "=" expr -#line 527 "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 2584 "parser.cpp" - break; - - case 97: // expr_assign: expr_object "|=" expr -#line 529 "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 2590 "parser.cpp" - break; - - case 98: // expr_assign: expr_object "&=" expr -#line 531 "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 2596 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "^=" expr -#line 533 "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 2602 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "<<=" expr -#line 535 "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 2608 "parser.cpp" - break; - - case 101: // expr_assign: expr_object ">>=" expr -#line 537 "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 2614 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "+=" expr -#line 539 "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 2620 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "-=" expr -#line 541 "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 2626 "parser.cpp" - break; - - case 104: // expr_assign: expr_object "*=" expr -#line 543 "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 2632 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "/=" expr -#line 545 "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 2638 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "%=" expr -#line 547 "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 2644 "parser.cpp" - break; - - case 107: // expr_increment: "++" expr_object -#line 552 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2650 "parser.cpp" - break; - - case 108: // expr_increment: expr_object "++" -#line 554 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2656 "parser.cpp" - break; - - case 109: // expr_decrement: "--" expr_object -#line 559 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2662 "parser.cpp" - break; - - case 110: // expr_decrement: expr_object "--" -#line 561 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2668 "parser.cpp" - break; - - case 111: // expr_ternary: expr "?" expr ":" expr -#line 566 "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 2674 "parser.cpp" - break; - - case 112: // expr_binary: expr "||" expr -#line 571 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2680 "parser.cpp" - break; - - case 113: // expr_binary: expr "&&" expr -#line 573 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2686 "parser.cpp" - break; - - case 114: // expr_binary: expr "==" expr -#line 575 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2692 "parser.cpp" - break; - - case 115: // expr_binary: expr "!=" expr -#line 577 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2698 "parser.cpp" - break; - - case 116: // expr_binary: expr "<=" expr -#line 579 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2704 "parser.cpp" - break; - - case 117: // expr_binary: expr ">=" expr -#line 581 "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 2710 "parser.cpp" - break; - - case 118: // expr_binary: expr "<" expr -#line 583 "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 2716 "parser.cpp" - break; - - case 119: // expr_binary: expr ">" expr -#line 585 "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 2722 "parser.cpp" - break; - - case 120: // expr_binary: expr "|" expr -#line 587 "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 2728 "parser.cpp" - break; - - case 121: // expr_binary: expr "&" expr -#line 589 "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 2734 "parser.cpp" - break; - - case 122: // expr_binary: expr "^" expr -#line 591 "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 2740 "parser.cpp" - break; - - case 123: // expr_binary: expr "<<" expr -#line 593 "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 2746 "parser.cpp" - break; - - case 124: // expr_binary: expr ">>" expr -#line 595 "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 2752 "parser.cpp" - break; - - case 125: // expr_binary: expr "+" expr -#line 597 "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 2758 "parser.cpp" - break; - - case 126: // expr_binary: expr "-" expr -#line 599 "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 2764 "parser.cpp" - break; - - case 127: // expr_binary: expr "*" expr -#line 601 "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 2770 "parser.cpp" - break; - - case 128: // expr_binary: expr "/" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2776 "parser.cpp" - break; - - case 129: // expr_binary: expr "%" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2782 "parser.cpp" - break; - - case 130: // expr_primitive: expr_complement -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 2788 "parser.cpp" - break; - - case 131: // expr_primitive: expr_negate -#line 610 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 2794 "parser.cpp" - break; - - case 132: // expr_primitive: expr_not -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 2800 "parser.cpp" - break; - - case 133: // expr_primitive: expr_call -#line 612 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 2806 "parser.cpp" - break; - - case 134: // expr_primitive: expr_method -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 2812 "parser.cpp" - break; - - case 135: // expr_primitive: expr_add_array -#line 614 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } -#line 2818 "parser.cpp" - break; - - case 136: // expr_primitive: expr_reference -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 2824 "parser.cpp" - break; - - case 137: // expr_primitive: expr_array -#line 616 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 2830 "parser.cpp" - break; - - case 138: // expr_primitive: expr_field -#line 617 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 2836 "parser.cpp" - break; - - case 139: // expr_primitive: expr_size -#line 618 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 2842 "parser.cpp" - break; - - case 140: // expr_primitive: expr_paren -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 2848 "parser.cpp" - break; - - case 141: // expr_primitive: expr_thisthread -#line 620 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } -#line 2854 "parser.cpp" - break; - - case 142: // expr_primitive: expr_empty_array -#line 621 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 2860 "parser.cpp" - break; - - case 143: // expr_primitive: expr_undefined -#line 622 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 2866 "parser.cpp" - break; - - case 144: // expr_primitive: expr_game -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 2872 "parser.cpp" - break; - - case 145: // expr_primitive: expr_self -#line 624 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 2878 "parser.cpp" - break; - - case 146: // expr_primitive: expr_anim -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 2884 "parser.cpp" - break; - - case 147: // expr_primitive: expr_level -#line 626 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 2890 "parser.cpp" - break; - - case 148: // expr_primitive: expr_animation -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 2896 "parser.cpp" - break; - - case 149: // expr_primitive: expr_animtree -#line 628 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 2902 "parser.cpp" - break; - - case 150: // expr_primitive: expr_identifier -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 2908 "parser.cpp" - break; - - case 151: // expr_primitive: expr_istring -#line 630 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 2914 "parser.cpp" - break; - - case 152: // expr_primitive: expr_string -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 2920 "parser.cpp" - break; - - case 153: // expr_primitive: expr_vector -#line 632 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 2926 "parser.cpp" - break; - - case 154: // expr_primitive: expr_float -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 2932 "parser.cpp" - break; - - case 155: // expr_primitive: expr_integer -#line 634 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 2938 "parser.cpp" - break; - - case 156: // expr_primitive: expr_false -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 2944 "parser.cpp" - break; - - case 157: // expr_primitive: expr_true -#line 636 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 2950 "parser.cpp" - break; - - case 158: // expr_complement: "~" expr -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2956 "parser.cpp" - break; - - case 159: // expr_negate: "-" expr_identifier -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 2962 "parser.cpp" - break; - - case 160: // expr_negate: "-" expr_paren -#line 648 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 2968 "parser.cpp" - break; - - case 161: // expr_negate: "-" expr_array -#line 650 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 2974 "parser.cpp" - break; - - case 162: // expr_negate: "-" expr_field -#line 652 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 2980 "parser.cpp" - break; - - case 163: // expr_not: "!" expr -#line 657 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2986 "parser.cpp" - break; - - case 164: // expr_call: expr_function -#line 661 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 2992 "parser.cpp" - break; - - case 165: // expr_call: expr_pointer -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 2998 "parser.cpp" - break; - - case 166: // expr_method: expr_object expr_function -#line 665 "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 3004 "parser.cpp" - break; - - case 167: // expr_method: expr_object expr_pointer -#line 666 "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 3010 "parser.cpp" - break; - - case 168: // expr_function: expr_identifier "(" expr_arguments ")" -#line 671 "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 3016 "parser.cpp" - break; - - case 169: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 673 "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 3022 "parser.cpp" - break; - - case 170: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 675 "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 3028 "parser.cpp" - break; - - case 171: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 677 "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 3034 "parser.cpp" - break; - - case 172: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 679 "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::childthread); } -#line 3040 "parser.cpp" - break; - - case 173: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 681 "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::childthread); } -#line 3046 "parser.cpp" - break; - - case 174: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 686 "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 3052 "parser.cpp" - break; - - case 175: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 688 "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 3058 "parser.cpp" - break; - - case 176: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 690 "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::childthread); } -#line 3064 "parser.cpp" - break; - - case 177: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 692 "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::builtin); } -#line 3070 "parser.cpp" - break; - - case 178: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 697 "parser.ypp" - { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } -#line 3076 "parser.cpp" - break; - - case 179: // expr_parameters: expr_parameters "," expr_identifier -#line 702 "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 3082 "parser.cpp" - break; - - case 180: // expr_parameters: expr_identifier -#line 704 "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 3088 "parser.cpp" - break; - - case 181: // expr_parameters: %empty -#line 706 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3094 "parser.cpp" - break; - - case 182: // expr_arguments: expr_arguments_no_empty -#line 711 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3100 "parser.cpp" - break; - - case 183: // expr_arguments: %empty -#line 713 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3106 "parser.cpp" - break; - - case 184: // expr_arguments_no_empty: expr_arguments "," expr -#line 718 "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 3112 "parser.cpp" - break; - - case 185: // expr_arguments_no_empty: expr -#line 720 "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 3118 "parser.cpp" - break; - - case 186: // expr_reference: "::" expr_identifier -#line 725 "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 3124 "parser.cpp" - break; - - case 187: // expr_reference: expr_path "::" expr_identifier -#line 727 "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 3130 "parser.cpp" - break; - - case 188: // expr_tuple: "[" expr_tuple_arguments "]" -#line 732 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[1].value.as < ast::expr_tuple::ptr > ()); } -#line 3136 "parser.cpp" - break; - - case 189: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types -#line 737 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::move(yystack_[2].value.as < ast::expr_tuple::ptr > ()); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3142 "parser.cpp" - break; - - case 190: // expr_tuple_arguments: expr_tuple_types -#line 739 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3148 "parser.cpp" - break; - - case 191: // expr_tuple_types: expr_array -#line 743 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3154 "parser.cpp" - break; - - case 192: // expr_tuple_types: expr_field -#line 744 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3160 "parser.cpp" - break; - - case 193: // expr_tuple_types: expr_identifier -#line 745 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3166 "parser.cpp" - break; - - case 194: // expr_array: expr_object "[" expr "]" -#line 750 "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 3172 "parser.cpp" - break; - - case 195: // expr_field: expr_object "." expr_identifier_nosize -#line 755 "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 3178 "parser.cpp" - break; - - case 196: // expr_size: expr_object "." "size" -#line 760 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3184 "parser.cpp" - break; - - case 197: // expr_paren: "(" expr ")" -#line 765 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3190 "parser.cpp" - break; - - case 198: // expr_object: expr_call -#line 769 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3196 "parser.cpp" - break; - - case 199: // expr_object: expr_method -#line 770 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3202 "parser.cpp" - break; - - case 200: // expr_object: expr_array -#line 771 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3208 "parser.cpp" - break; - - case 201: // expr_object: expr_field -#line 772 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3214 "parser.cpp" - break; - - case 202: // expr_object: expr_game -#line 773 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3220 "parser.cpp" - break; - - case 203: // expr_object: expr_self -#line 774 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3226 "parser.cpp" - break; - - case 204: // expr_object: expr_anim -#line 775 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3232 "parser.cpp" - break; - - case 205: // expr_object: expr_level -#line 776 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3238 "parser.cpp" - break; - - case 206: // expr_object: expr_identifier -#line 777 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3244 "parser.cpp" - break; - - case 207: // expr_thisthread: "thisthread" -#line 782 "parser.ypp" - { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } -#line 3250 "parser.cpp" - break; - - case 208: // expr_empty_array: "[" "]" -#line 787 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3256 "parser.cpp" - break; - - case 209: // expr_undefined: "undefined" -#line 792 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3262 "parser.cpp" - break; - - case 210: // expr_game: "game" -#line 797 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3268 "parser.cpp" - break; - - case 211: // expr_self: "self" -#line 802 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3274 "parser.cpp" - break; - - case 212: // expr_anim: "anim" -#line 807 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3280 "parser.cpp" - break; - - case 213: // expr_level: "level" -#line 812 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3286 "parser.cpp" - break; - - case 214: // expr_animation: "%" "identifier" -#line 817 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3292 "parser.cpp" - break; - - case 215: // expr_animtree: "#animtree" -#line 822 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3298 "parser.cpp" - break; - - case 216: // expr_identifier_nosize: "identifier" -#line 827 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3304 "parser.cpp" - break; - - case 217: // expr_identifier: "identifier" -#line 832 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3310 "parser.cpp" - break; - - case 218: // expr_identifier: "size" -#line 834 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3316 "parser.cpp" - break; - - case 219: // expr_path: "identifier" -#line 839 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3322 "parser.cpp" - break; - - case 220: // expr_path: "path" -#line 841 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3328 "parser.cpp" - break; - - case 221: // expr_istring: "localized string" -#line 846 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3334 "parser.cpp" - break; - - case 222: // expr_string: "string literal" -#line 851 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3340 "parser.cpp" - break; - - case 223: // expr_vector: "(" expr "," expr "," expr ")" -#line 856 "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 3346 "parser.cpp" - break; - - case 224: // expr_float: "-" "float" -#line 861 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3352 "parser.cpp" - break; - - case 225: // expr_float: "float" -#line 863 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3358 "parser.cpp" - break; - - case 226: // expr_integer: "-" "integer" -#line 868 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3364 "parser.cpp" - break; - - case 227: // expr_integer: "integer" -#line 870 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3370 "parser.cpp" - break; - - case 228: // expr_false: "false" -#line 875 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3376 "parser.cpp" - break; - - case 229: // expr_true: "true" -#line 880 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3382 "parser.cpp" - break; - - -#line 3386 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "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", - "childthread", "thisthread", "call", "true", "false", "undefined", - "size", "game", "self", "anim", "level", "(", ")", "{", "}", "[", "]", - ",", ".", "::", ":", ";", "?", "++", "--", "<<", ">>", "||", "&&", "==", - "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", "%=", - "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", "%", - "path", "identifier", "string literal", "localized string", "float", - "integer", "SIZEOF", "ADD_ARRAY", "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_negate", "expr_not", "expr_call", "expr_method", - "expr_function", "expr_pointer", "expr_add_array", "expr_parameters", - "expr_arguments", "expr_arguments_no_empty", "expr_reference", - "expr_tuple", "expr_tuple_arguments", "expr_tuple_types", "expr_array", - "expr_field", "expr_size", "expr_paren", "expr_object", - "expr_thisthread", "expr_empty_array", "expr_undefined", "expr_game", - "expr_self", "expr_anim", "expr_level", "expr_animation", - "expr_animtree", "expr_identifier_nosize", "expr_identifier", - "expr_path", "expr_istring", "expr_string", "expr_vector", "expr_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 IW5CDEBUG - // 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 IW5CDEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if IW5CDEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -281; - - const short parser::yytable_ninf_ = -220; - - const short - parser::yypact_[] = - { - 4, -281, -281, -72, -72, -41, -281, -281, 32, 4, - -281, -281, -281, -281, -281, -281, -21, -281, -281, -28, - -1, -22, -281, -281, -281, -281, -43, 1235, -281, -281, - -281, 5, -29, -281, -281, -26, -24, -281, 8, -281, - -281, -281, -281, -281, -281, -281, 1235, 1109, -43, 1235, - 1235, 612, 1, 47, -281, -281, -281, 2111, -281, -281, - -281, -281, -281, -281, 108, 145, -281, -281, -281, -281, - 372, 438, -281, -281, 633, -281, -281, -281, 664, 818, - 982, 987, -281, -281, 39, 59, -281, -281, -281, -281, - -281, -281, -281, 61, 16, -43, 65, 78, 79, 103, - 109, 127, 133, 1443, 1109, -281, 2194, 125, 136, -281, - -281, -281, 1235, 134, -281, -281, -281, -281, 372, 438, - -281, 1132, -281, -281, -281, -281, 39, 137, -281, -281, - 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, - 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1298, - -35, -281, -281, 147, 1235, -43, -281, 951, -281, -281, - 1235, 1235, -43, 1235, 1235, -43, 1235, -281, 1235, 1231, - 1235, -281, 1609, 1235, 102, -43, 2076, -51, -51, 2225, - 865, 2276, 2276, -27, -27, -27, -27, 2235, 273, 2266, - 51, 51, -281, -281, -281, 1294, -281, -281, -281, 23, - -281, 150, 77, 1235, 148, 157, 1381, 160, 162, 163, - 166, -15, 158, 165, 167, 1172, 168, 172, 173, -281, - 409, 703, 703, -281, -281, 1027, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, 175, 184, 185, 186, 187, 142, -281, -281, 808, - 147, 1921, 30, 176, 1961, 36, 182, 2001, 2040, 195, - 2194, 1231, 150, 1235, -281, -281, 1235, -281, -281, 1080, - 2146, -281, 1235, 224, 1235, 738, -43, 1235, 151, 193, - 196, -281, -281, -281, -281, 2181, -281, 1235, 1235, 1298, - 35, -281, 112, 123, -4, 1132, 1132, -281, -281, -281, - -281, -281, -281, -281, 1235, 204, 206, 209, 210, -281, - -281, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, - 1235, 1235, 207, -281, 1235, 211, -281, 1235, 212, 1235, - 214, 2194, 76, -281, -281, -281, 1643, 215, 1677, 201, - -281, -281, -281, 1407, -8, 1711, -281, -281, -281, 82, - 85, -281, 703, 2194, 1235, 1235, 1235, 1235, 2194, 2194, - 2194, 2194, 2194, 2194, 2194, 2194, 2194, 2194, 2194, 219, - 104, 220, 107, 221, 1745, 1235, -281, 1381, 1235, 1381, - 1235, 1235, -43, 16, 216, 222, -281, 1779, 1487, 1531, - 1575, 1235, -281, 1235, -281, 1235, -281, 120, 249, 1813, - -281, 2194, 223, 1847, 246, -281, -281, -281, 227, 229, - 1235, 232, 1235, 235, 1235, 124, 126, 138, -281, 1381, - 236, 738, 1381, 1235, -281, -281, 228, -281, 230, -281, - 247, -281, -281, -281, -281, -281, 250, -281, 1881, 242, - 243, 248, 1381, 1381, -281, -281, -281, -281, -281 - }; - - const unsigned char - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 218, 217, 0, 2, - 7, 8, 9, 14, 15, 16, 0, 220, 219, 0, - 0, 0, 1, 4, 5, 6, 181, 0, 10, 11, - 222, 0, 0, 180, 215, 0, 0, 207, 0, 229, - 228, 209, 210, 211, 212, 213, 0, 183, 0, 0, - 0, 0, 0, 217, 221, 225, 227, 0, 90, 91, - 92, 130, 131, 132, 133, 134, 164, 165, 135, 136, - 137, 138, 139, 140, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 0, 151, 152, 153, 154, - 155, 156, 157, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 183, 208, 185, 0, 182, 186, - 163, 158, 0, 0, 224, 226, 198, 199, 161, 162, - 160, 0, 202, 203, 204, 205, 159, 0, 214, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 166, 167, 0, 183, 0, 17, 0, 19, 179, - 0, 183, 0, 0, 183, 0, 0, 197, 0, 185, - 0, 178, 0, 0, 0, 0, 0, 123, 124, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 125, 126, 127, 128, 129, 0, 196, 216, 195, 0, - 182, 187, 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, 198, 199, 0, 200, 201, 0, - 206, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 184, 0, 0, 0, 194, 168, 183, 51, 47, 0, - 0, 71, 0, 0, 0, 57, 0, 0, 0, 0, - 0, 82, 83, 84, 86, 0, 87, 183, 183, 0, - 0, 190, 200, 201, 206, 107, 109, 52, 48, 60, - 61, 62, 58, 59, 0, 0, 0, 0, 0, 108, - 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 170, 183, 0, 172, 183, 0, 0, - 0, 111, 0, 50, 46, 66, 0, 0, 0, 0, - 54, 55, 56, 0, 0, 0, 81, 80, 85, 0, - 0, 188, 0, 95, 0, 0, 0, 0, 96, 102, - 103, 104, 105, 106, 97, 98, 99, 101, 100, 0, - 0, 0, 0, 0, 0, 183, 169, 0, 0, 0, - 94, 0, 0, 0, 0, 0, 189, 0, 0, 0, - 0, 183, 171, 183, 173, 183, 223, 0, 72, 0, - 74, 93, 0, 0, 0, 79, 88, 89, 0, 0, - 183, 0, 183, 0, 183, 0, 0, 0, 174, 0, - 0, 57, 0, 0, 63, 65, 182, 68, 182, 70, - 182, 175, 176, 177, 73, 75, 0, 77, 0, 0, - 0, 0, 0, 0, 64, 67, 69, 76, 78 - }; - - const short - parser::yypgoto_[] = - { - -281, -281, -281, 272, 298, 299, -281, -281, -281, 194, - 86, -281, -281, -281, -92, -121, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, 188, - -281, -280, -279, -278, -281, -281, -281, -281, -281, -281, - 92, 203, -66, -62, -281, -281, -127, -46, -281, -281, - -281, -13, 213, 337, -281, 289, 385, -281, -281, -281, - 392, 480, 512, 519, -281, -281, -281, 0, 10, -281, - -17, -281, -281, 130, -281, -281 - }; - - const short - parser::yydefgoto_[] = - { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 223, - 224, 279, 225, 226, 227, 349, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 106, - 412, 251, 252, 253, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 32, 107, 200, 69, 256, - 300, 301, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 198, 84, 85, 86, - 87, 88, 89, 90, 91, 92 - }; - - const short - parser::yytable_[] = - { - 16, 108, 158, 6, 31, 350, 351, 352, 151, 16, - 21, 196, 152, 19, 20, 1, 2, 3, 4, 5, - 6, 391, 6, 94, 17, 18, 33, 199, 95, 96, - 26, 99, 22, 28, 262, 97, 100, 265, 131, 132, - 144, 145, 146, 147, 148, 98, 101, 154, 109, 392, - 6, 126, -193, -193, 7, 151, 27, 93, 108, 152, - 29, 127, 197, 102, 144, 145, 146, 147, 148, 157, - 17, 53, 17, 53, 153, 275, 30, 288, -206, -206, - 170, -206, 333, 30, 127, -206, 56, 170, 336, 277, - 154, 361, 362, 170, -206, 159, 203, -206, 128, 204, - 205, 7, 206, 207, 208, 209, -219, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 35, 36, 155, 38, - 160, 153, 156, 6, 42, 43, 44, 45, 386, 161, - 157, 127, 220, 170, 394, -206, -206, 395, 162, 170, - 221, 222, 170, 116, 146, 147, 148, -198, -198, 342, - -198, 350, 351, 352, -198, 201, 402, 260, 163, 404, - 164, 170, 263, -198, 170, 266, -198, 127, -191, -191, - 359, 360, 428, 17, 53, 272, 441, 170, 442, -192, - -192, 170, 170, 170, -199, -199, 165, -199, 166, 173, - 443, -199, 171, 151, 289, 170, 175, 152, 154, 197, - -199, 276, 260, -199, -198, -198, 260, 380, 282, 281, - 382, 284, 127, 285, 286, 57, 127, 287, 291, 314, - 304, 260, 260, 297, 298, 260, 292, 334, 293, 296, - 127, 127, 127, 337, 103, 127, 309, 110, 111, 151, - 151, -199, -199, 152, 152, 310, 311, 312, 313, 254, - 347, 340, 115, 356, 117, 364, 357, 365, 407, 153, - 366, 367, 390, 379, 118, 385, 388, 381, 383, 127, - 401, 403, 405, 429, 425, 433, 426, 416, 427, 260, - 449, 23, 450, 417, 431, 260, 354, 151, 434, 127, - 435, 152, 169, 437, 254, 127, 439, 445, 254, 451, - 172, 415, 452, 454, 455, 153, 153, 24, 25, 456, - 446, 308, 116, 116, 116, 127, 127, 254, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 131, 132, - 120, 290, 135, 136, 137, 138, 139, 140, 261, 396, - 0, 264, 0, 153, 267, 0, 268, 0, 270, 0, - 255, 271, 304, 127, 144, 145, 146, 147, 148, 0, - 257, 254, 127, 0, 436, 0, 438, 116, 440, 0, - 0, 0, 0, 0, 0, 0, 0, 260, 119, 260, - 0, 280, 414, 0, 0, 0, 278, 127, 0, 127, - 283, 0, 0, 295, 0, 255, 0, 0, 0, 255, - 0, -200, -200, 0, -200, 257, 0, 0, -200, 257, - 0, 0, 0, 117, 117, 117, 0, -200, 255, 260, - -200, 260, 260, 302, 257, 257, 121, 0, 257, 127, - 0, 127, 127, 122, 0, 0, 0, 0, 35, 36, - 0, 38, 260, 260, 116, 6, 42, 43, 44, 45, - 0, 341, 127, 127, 299, 0, 0, 0, -200, -200, - 346, 0, 348, 344, 0, 355, 0, -201, -201, 254, - -201, 254, 255, 0, -201, 0, 0, 271, 117, 0, - 0, 0, 257, -201, 258, 0, -201, 0, 257, 0, - 0, 0, 363, 0, 0, 17, 53, 0, 0, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 0, 254, 0, 116, 254, 0, 0, 384, 0, 0, - 0, 123, 0, 0, -201, -201, 0, 0, 0, 258, - 0, 0, 259, 258, 254, 254, 0, 0, 0, 122, - 0, 0, 397, 398, 399, 400, 0, 303, 258, 258, - 0, 0, 258, 124, 0, 117, 0, 0, 0, 0, - 125, 0, 0, 0, 0, 302, 409, 0, 411, 413, - 0, 408, 0, 410, 0, 0, 0, 259, 0, 0, - 255, 259, 255, 0, 122, 0, 0, 0, 122, 0, - 257, 0, 257, 0, 0, 121, 305, 306, 0, 0, - 259, 0, 122, 122, 122, 0, 258, 122, 0, 0, - 0, 448, 258, 444, 0, 0, 447, 0, 0, 0, - 0, 0, 255, 0, 117, 255, 0, 123, 0, 0, - 0, 0, 257, 0, 257, 257, 457, 458, 0, 0, - 0, 35, 36, 0, 38, 255, 255, 0, 6, 42, - 43, 44, 45, 112, 259, 257, 257, 113, 0, 124, - 353, 122, 35, 36, 0, 38, 125, 122, 0, 6, - 0, 0, 123, 0, 0, 0, 123, 0, 149, 0, - 0, 150, 0, 0, 0, 0, 0, 0, 0, 303, - 123, 123, 123, -202, -202, 123, -202, 0, 17, 53, - -202, 0, 114, 115, 124, 0, 0, 0, 124, -202, - 0, 125, -202, 0, 258, 125, 258, 0, 0, 17, - 53, 0, 124, 124, 124, 0, 0, 124, 0, 125, - 125, 125, 35, 36, 125, 38, 0, 121, 0, 6, - 42, 43, 44, 45, 122, 0, 0, 0, 113, 123, - -202, -202, 0, 0, 0, 123, 258, 0, 258, 258, - 0, 0, 259, 0, 259, 0, 0, 35, 36, 122, - 38, 122, 0, 0, 6, 42, 43, 44, 45, 258, - 258, 124, 0, 220, 0, 0, 0, 124, 125, 17, - 53, 221, 222, 0, 125, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 259, 0, 353, 259, 0, 0, - 0, 122, 0, 122, 122, 315, 316, 0, 317, 318, - 0, 0, 0, 0, 17, 53, 0, 259, 259, 0, - 0, 0, 123, 0, 122, 122, 0, 35, 36, 0, - 38, 0, 0, 0, 6, 0, 0, -203, -203, 0, - -203, 0, 0, 149, -203, 0, 174, 123, 0, 123, - 0, 319, 320, -203, 124, 0, -203, 0, 0, 0, - 0, 125, 0, 0, 0, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 0, 0, 0, 124, - 0, 124, 0, 0, 17, 53, 125, 0, 125, 123, - 0, 123, 123, 0, -203, -203, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 131, 132, 123, 123, 135, 136, 137, 138, 139, 140, - 0, 124, 0, 124, 124, 0, 0, 0, 125, 0, - 125, 125, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 0, 202, 0, 124, 124, 0, 0, 0, 0, - 203, 125, 125, 204, 205, 0, 206, 207, 208, 209, - 0, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 35, 36, 0, 38, 0, 0, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 219, 220, 0, 0, 0, - 0, 0, 0, 0, 221, 222, 0, 0, 0, 0, - 0, -204, -204, 0, -204, 0, -205, -205, -204, -205, - 0, 0, 0, -205, 0, 0, 0, -204, 202, 0, - -204, 0, -205, 0, 0, -205, 203, 17, 53, 204, - 205, 0, 206, 207, 208, 209, 0, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 35, 36, 0, 38, - 0, 0, 0, 6, 42, 43, 44, 45, -204, -204, - 157, 307, 220, -205, -205, 0, 0, 0, 0, 0, - 221, 222, 343, 0, 0, 0, 0, 0, 0, 203, - 0, 0, 204, 205, 0, 206, 207, 208, 209, 0, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 35, - 36, 0, 38, 17, 53, 34, 6, 42, 43, 44, - 45, 0, 0, 157, 0, 220, 0, 0, 0, 0, - 0, 0, 0, 221, 222, 0, 0, 0, 35, 36, - 37, 38, 39, 40, 41, 6, 42, 43, 44, 45, - 46, 0, 0, 0, 104, 105, 0, 0, 48, 0, - 0, 35, 36, 0, 38, 0, 17, 53, 6, 0, - 0, 0, 0, 0, 49, 50, 0, 149, 34, 0, - 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 51, 0, 0, 52, 17, 53, 30, 54, 55, - 56, 35, 36, 37, 38, 39, 40, 41, 6, 42, - 43, 44, 45, 46, 0, 0, 0, 47, 17, 53, - 0, 48, 0, 294, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 49, 50, 0, - 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 51, 0, 0, 52, 17, 53, - 30, 54, 55, 56, 35, 36, 37, 38, 39, 40, - 41, 6, 42, 43, 44, 45, 46, 269, 0, 0, - 47, 0, 0, 130, 48, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 49, 50, 0, 0, 34, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 51, 0, 0, - 52, 17, 53, 30, 54, 55, 56, 35, 36, 37, - 38, 39, 40, 41, 6, 42, 43, 44, 45, 46, - 274, 0, 0, 104, 0, 0, 130, 48, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 49, 50, 0, 0, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 51, 0, 0, 52, 17, 53, 30, 54, 55, 56, - 203, 0, 0, 204, 205, 0, 206, 207, 208, 209, - 0, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 35, 36, 0, 38, 0, 0, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 0, 220, 0, 0, 0, - 0, 0, 0, 0, 221, 222, 35, 36, 0, 38, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, - 0, 0, 149, 0, 0, 174, 0, 0, 0, 0, - 319, 320, 0, 0, 0, 0, 0, 17, 53, 0, - 0, 0, 0, 0, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 167, 0, 0, 0, 0, - 168, 0, 0, 17, 53, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 419, - 0, 0, 0, 0, 420, 0, 0, 0, 0, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 421, 0, 0, 0, 0, 422, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 423, 0, 0, - 0, 0, 424, 0, 0, 0, 0, 130, 0, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 167, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 130, 0, 0, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 387, 0, 141, 142, 143, - 144, 145, 146, 147, 148, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 389, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 393, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 406, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 130, 0, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 418, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 130, 0, 0, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 430, 0, 141, 142, 143, - 144, 145, 146, 147, 148, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 453, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 332, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 335, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 338, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 339, 0, 0, - 0, 0, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 273, 0, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 129, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 345, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 358, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 131, 132, 0, 134, 135, 136, 137, 138, 139, 140, - 131, 132, 0, 0, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 0, 0, 0, 142, 143, 144, 145, 146, 147, - 148, 131, 132, 0, 0, 135, 136, 137, 138, 139, - 140, 131, 132, 0, 0, 0, 0, 137, 138, 139, - 140, 0, 0, 0, 0, 142, 0, 144, 145, 146, - 147, 148, 0, 0, 0, 0, 0, 144, 145, 146, - 147, 148 - }; - - const short - parser::yycheck_[] = - { - 0, 47, 94, 46, 21, 285, 285, 285, 74, 9, - 51, 46, 74, 3, 4, 11, 12, 13, 14, 15, - 46, 29, 46, 52, 96, 97, 26, 154, 57, 55, - 51, 55, 0, 61, 161, 35, 36, 164, 65, 66, - 91, 92, 93, 94, 95, 35, 36, 51, 48, 57, - 46, 51, 56, 57, 97, 121, 77, 52, 104, 121, - 61, 51, 97, 55, 91, 92, 93, 94, 95, 53, - 96, 97, 96, 97, 74, 52, 98, 92, 39, 40, - 57, 42, 52, 98, 74, 46, 101, 57, 52, 12, - 51, 56, 57, 57, 55, 95, 19, 58, 97, 22, - 23, 97, 25, 26, 27, 28, 59, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 59, 42, - 55, 121, 61, 46, 47, 48, 49, 50, 52, 51, - 53, 121, 55, 57, 52, 96, 97, 52, 59, 57, - 63, 64, 57, 51, 93, 94, 95, 39, 40, 276, - 42, 431, 431, 431, 46, 155, 52, 157, 55, 52, - 51, 57, 162, 55, 57, 165, 58, 157, 56, 57, - 297, 298, 52, 96, 97, 175, 52, 57, 52, 56, - 57, 57, 57, 57, 39, 40, 59, 42, 55, 55, - 52, 46, 56, 259, 211, 57, 59, 259, 51, 97, - 55, 51, 202, 58, 96, 97, 206, 334, 51, 61, - 337, 51, 202, 51, 51, 27, 206, 51, 60, 77, - 220, 221, 222, 51, 51, 225, 61, 51, 61, 61, - 220, 221, 222, 51, 46, 225, 61, 49, 50, 305, - 306, 96, 97, 305, 306, 61, 61, 61, 61, 157, - 26, 56, 101, 60, 51, 51, 60, 51, 385, 259, - 51, 51, 61, 56, 51, 51, 51, 56, 56, 259, - 51, 51, 51, 24, 401, 29, 403, 61, 405, 279, - 52, 9, 52, 61, 61, 285, 286, 353, 61, 279, - 61, 353, 104, 61, 202, 285, 61, 61, 206, 52, - 112, 393, 52, 61, 61, 305, 306, 9, 9, 61, - 431, 225, 220, 221, 222, 305, 306, 225, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 65, 66, - 51, 211, 69, 70, 71, 72, 73, 74, 160, 362, - -1, 163, -1, 353, 166, -1, 168, -1, 170, -1, - 157, 173, 362, 353, 91, 92, 93, 94, 95, -1, - 157, 279, 362, -1, 420, -1, 422, 285, 424, -1, - -1, -1, -1, -1, -1, -1, -1, 387, 51, 389, - -1, 203, 392, -1, -1, -1, 202, 387, -1, 389, - 206, -1, -1, 215, -1, 202, -1, -1, -1, 206, - -1, 39, 40, -1, 42, 202, -1, -1, 46, 206, - -1, -1, -1, 220, 221, 222, -1, 55, 225, 429, - 58, 431, 432, 220, 221, 222, 51, -1, 225, 429, - -1, 431, 432, 51, -1, -1, -1, -1, 39, 40, - -1, 42, 452, 453, 362, 46, 47, 48, 49, 50, - -1, 273, 452, 453, 55, -1, -1, -1, 96, 97, - 282, -1, 284, 279, -1, 287, -1, 39, 40, 387, - 42, 389, 279, -1, 46, -1, -1, 299, 285, -1, - -1, -1, 279, 55, 157, -1, 58, -1, 285, -1, - -1, -1, 314, -1, -1, 96, 97, -1, -1, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, - -1, 429, -1, 431, 432, -1, -1, 339, -1, -1, - -1, 51, -1, -1, 96, 97, -1, -1, -1, 202, - -1, -1, 157, 206, 452, 453, -1, -1, -1, 157, - -1, -1, 364, 365, 366, 367, -1, 220, 221, 222, - -1, -1, 225, 51, -1, 362, -1, -1, -1, -1, - 51, -1, -1, -1, -1, 362, 388, -1, 390, 391, - -1, 387, -1, 389, -1, -1, -1, 202, -1, -1, - 387, 206, 389, -1, 202, -1, -1, -1, 206, -1, - 387, -1, 389, -1, -1, 220, 221, 222, -1, -1, - 225, -1, 220, 221, 222, -1, 279, 225, -1, -1, - -1, 433, 285, 429, -1, -1, 432, -1, -1, -1, - -1, -1, 429, -1, 431, 432, -1, 157, -1, -1, - -1, -1, 429, -1, 431, 432, 452, 453, -1, -1, - -1, 39, 40, -1, 42, 452, 453, -1, 46, 47, - 48, 49, 50, 51, 279, 452, 453, 55, -1, 157, - 285, 279, 39, 40, -1, 42, 157, 285, -1, 46, - -1, -1, 202, -1, -1, -1, 206, -1, 55, -1, - -1, 58, -1, -1, -1, -1, -1, -1, -1, 362, - 220, 221, 222, 39, 40, 225, 42, -1, 96, 97, - 46, -1, 100, 101, 202, -1, -1, -1, 206, 55, - -1, 202, 58, -1, 387, 206, 389, -1, -1, 96, - 97, -1, 220, 221, 222, -1, -1, 225, -1, 220, - 221, 222, 39, 40, 225, 42, -1, 362, -1, 46, - 47, 48, 49, 50, 362, -1, -1, -1, 55, 279, - 96, 97, -1, -1, -1, 285, 429, -1, 431, 432, - -1, -1, 387, -1, 389, -1, -1, 39, 40, 387, - 42, 389, -1, -1, 46, 47, 48, 49, 50, 452, - 453, 279, -1, 55, -1, -1, -1, 285, 279, 96, - 97, 63, 64, -1, 285, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 429, -1, 431, 432, -1, -1, - -1, 429, -1, 431, 432, 17, 18, -1, 20, 21, - -1, -1, -1, -1, 96, 97, -1, 452, 453, -1, - -1, -1, 362, -1, 452, 453, -1, 39, 40, -1, - 42, -1, -1, -1, 46, -1, -1, 39, 40, -1, - 42, -1, -1, 55, 46, -1, 58, 387, -1, 389, - -1, 63, 64, 55, 362, -1, 58, -1, -1, -1, - -1, 362, -1, -1, -1, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, -1, -1, -1, 387, - -1, 389, -1, -1, 96, 97, 387, -1, 389, 429, - -1, 431, 432, -1, 96, 97, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, 452, 453, 69, 70, 71, 72, 73, 74, - -1, 429, -1, 431, 432, -1, -1, -1, 429, -1, - 431, 432, -1, 88, 89, 90, 91, 92, 93, 94, - 95, -1, 11, -1, 452, 453, -1, -1, -1, -1, - 19, 452, 453, 22, 23, -1, 25, 26, 27, 28, - -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, -1, 42, -1, -1, -1, 46, 47, 48, - 49, 50, -1, -1, 53, 54, 55, -1, -1, -1, - -1, -1, -1, -1, 63, 64, -1, -1, -1, -1, - -1, 39, 40, -1, 42, -1, 39, 40, 46, 42, - -1, -1, -1, 46, -1, -1, -1, 55, 11, -1, - 58, -1, 55, -1, -1, 58, 19, 96, 97, 22, - 23, -1, 25, 26, 27, 28, -1, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, -1, 42, - -1, -1, -1, 46, 47, 48, 49, 50, 96, 97, - 53, 54, 55, 96, 97, -1, -1, -1, -1, -1, - 63, 64, 12, -1, -1, -1, -1, -1, -1, 19, - -1, -1, 22, 23, -1, 25, 26, 27, 28, -1, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, -1, 42, 96, 97, 16, 46, 47, 48, 49, - 50, -1, -1, 53, -1, 55, -1, -1, -1, -1, - -1, -1, -1, 63, 64, -1, -1, -1, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, -1, -1, -1, 55, 56, -1, -1, 59, -1, - -1, 39, 40, -1, 42, -1, 96, 97, 46, -1, - -1, -1, -1, -1, 75, 76, -1, 55, 16, -1, - 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 92, -1, -1, 95, 96, 97, 98, 99, 100, - 101, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, -1, -1, -1, 55, 96, 97, - -1, 59, -1, 61, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 75, 76, -1, - -1, 16, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 92, -1, -1, 95, 96, 97, - 98, 99, 100, 101, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 56, -1, -1, - 55, -1, -1, 62, 59, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - 75, 76, -1, -1, 16, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 92, -1, -1, - 95, 96, 97, 98, 99, 100, 101, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 56, -1, -1, 55, -1, -1, 62, 59, -1, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, -1, - -1, -1, -1, 75, 76, -1, -1, -1, -1, -1, - -1, -1, 88, 89, 90, 91, 92, 93, 94, 95, - 92, -1, -1, 95, 96, 97, 98, 99, 100, 101, - 19, -1, -1, 22, 23, -1, 25, 26, 27, 28, - -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, -1, 42, -1, -1, -1, 46, 47, 48, - 49, 50, -1, -1, 53, -1, 55, -1, -1, -1, - -1, -1, -1, -1, 63, 64, 39, 40, -1, 42, - -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, - -1, -1, 55, -1, -1, 58, -1, -1, -1, -1, - 63, 64, -1, -1, -1, -1, -1, 96, 97, -1, - -1, -1, -1, -1, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 52, -1, -1, -1, -1, - 57, -1, -1, 96, 97, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 52, - -1, -1, -1, -1, 57, -1, -1, -1, -1, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 52, -1, -1, -1, -1, 57, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 52, -1, -1, - -1, -1, 57, -1, -1, -1, -1, 62, -1, -1, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 52, -1, 88, 89, 90, 91, 92, 93, 94, - 95, 62, -1, -1, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, -1, 88, 89, 90, - 91, 92, 93, 94, 95, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 52, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 52, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 62, -1, -1, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 52, -1, 88, 89, 90, 91, 92, 93, 94, - 95, 62, -1, -1, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, -1, 88, 89, 90, - 91, 92, 93, 94, 95, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 52, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 57, -1, -1, - -1, -1, 62, -1, -1, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 88, 89, - 90, 91, 92, 93, 94, 95, 60, -1, 62, -1, - -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 88, 89, 90, 91, 92, 93, - 94, 95, 61, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 61, 62, -1, - -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 88, 89, 90, 91, 92, 93, - 94, 95, 61, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 62, -1, -1, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 88, - 89, 90, 91, 92, 93, 94, 95, -1, -1, -1, - -1, -1, 88, 89, 90, 91, 92, 93, 94, 95, - 65, 66, -1, 68, 69, 70, 71, 72, 73, 74, - 65, 66, -1, -1, 69, 70, 71, 72, 73, 74, - -1, -1, -1, 88, 89, 90, 91, 92, 93, 94, - 95, -1, -1, -1, 89, 90, 91, 92, 93, 94, - 95, 65, 66, -1, -1, 69, 70, 71, 72, 73, - 74, 65, 66, -1, -1, -1, -1, 71, 72, 73, - 74, -1, -1, -1, -1, 89, -1, 91, 92, 93, - 94, 95, -1, -1, -1, -1, -1, 91, 92, 93, - 94, 95 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 46, 97, 113, 114, - 115, 116, 117, 118, 119, 120, 189, 96, 97, 190, - 190, 51, 0, 115, 116, 117, 51, 77, 61, 61, - 98, 192, 167, 189, 16, 39, 40, 41, 42, 43, - 44, 45, 47, 48, 49, 50, 51, 55, 59, 75, - 76, 92, 95, 97, 99, 100, 101, 151, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 170, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 52, 52, 57, 55, 189, 190, 55, - 189, 190, 55, 151, 55, 56, 151, 168, 169, 189, - 151, 151, 51, 55, 100, 101, 162, 163, 174, 175, - 177, 178, 182, 183, 184, 185, 189, 190, 97, 61, - 62, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 88, 89, 90, 91, 92, 93, 94, 95, 55, - 58, 164, 165, 189, 51, 59, 61, 53, 126, 189, - 55, 51, 59, 55, 51, 59, 55, 52, 57, 151, - 57, 56, 151, 55, 58, 59, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 46, 97, 188, 168, - 169, 189, 11, 19, 22, 23, 25, 26, 27, 28, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 54, - 55, 63, 64, 121, 122, 124, 125, 126, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 153, 154, 155, 162, 163, 171, 174, 175, 178, - 189, 151, 168, 189, 151, 168, 189, 151, 151, 56, - 151, 151, 189, 60, 56, 52, 51, 12, 121, 123, - 151, 61, 51, 121, 51, 51, 51, 51, 92, 192, - 195, 60, 61, 61, 61, 151, 61, 51, 51, 55, - 172, 173, 174, 175, 189, 178, 178, 54, 122, 61, - 61, 61, 61, 61, 77, 17, 18, 20, 21, 63, - 64, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 56, 52, 51, 56, 52, 51, 56, 57, - 56, 151, 168, 12, 121, 61, 151, 26, 151, 127, - 153, 154, 155, 178, 189, 151, 60, 60, 61, 168, - 168, 56, 57, 151, 51, 51, 51, 51, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 56, - 168, 56, 168, 56, 151, 51, 52, 52, 51, 52, - 61, 29, 57, 52, 52, 52, 173, 151, 151, 151, - 151, 51, 52, 51, 52, 51, 52, 168, 121, 151, - 121, 151, 152, 151, 189, 126, 61, 61, 52, 52, - 57, 52, 57, 52, 57, 168, 168, 168, 52, 24, - 52, 61, 52, 29, 61, 61, 169, 61, 169, 61, - 169, 52, 52, 52, 121, 61, 127, 121, 151, 52, - 52, 52, 52, 52, 61, 61, 61, 121, 121 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 112, 113, 113, 114, 114, 114, 114, 114, 114, - 115, 116, 117, 117, 117, 117, 117, 118, 119, 120, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 122, 122, 123, 123, 124, 124, - 125, 125, 126, 126, 127, 127, 127, 127, 128, 128, - 129, 129, 129, 130, 131, 131, 132, 133, 133, 134, - 134, 135, 136, 137, 138, 139, 140, 141, 141, 142, - 143, 143, 144, 145, 146, 147, 147, 148, 149, 150, - 151, 151, 151, 152, 152, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 154, 154, 155, - 155, 156, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 159, 160, - 160, 160, 160, 161, 162, 162, 163, 163, 164, 164, - 164, 164, 164, 164, 165, 165, 165, 165, 166, 167, - 167, 167, 168, 168, 169, 169, 170, 170, 171, 172, - 172, 173, 173, 173, 174, 175, 176, 177, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 189, 190, - 190, 191, 192, 193, 194, 194, 195, 195, 196, 197 - }; - - 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, 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, 2, 2, - 2, 2, 2, 2, 1, 1, 2, 2, 4, 6, - 5, 7, 5, 7, 8, 9, 9, 9, 3, 3, - 1, 0, 1, 0, 3, 1, 2, 3, 3, 3, - 1, 1, 1, 1, 4, 3, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, - 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 7, 2, 1, 2, 1, 1, 1 - }; - - - - -#if IW5CDEBUG - const short - parser::yyrline_[] = - { - 0, 261, 261, 262, 266, 268, 270, 272, 274, 276, - 281, 285, 290, 291, 292, 293, 294, 298, 303, 308, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 340, 341, 345, 347, 352, 354, - 359, 360, 364, 365, 369, 371, 373, 376, 380, 382, - 387, 389, 391, 396, 401, 403, 408, 413, 415, 420, - 422, 427, 432, 437, 442, 447, 452, 457, 459, 464, - 469, 471, 476, 481, 486, 491, 493, 498, 503, 508, - 513, 514, 515, 519, 520, 524, 526, 528, 530, 532, - 534, 536, 538, 540, 542, 544, 546, 551, 553, 558, - 560, 565, 570, 572, 574, 576, 578, 580, 582, 584, - 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, - 629, 630, 631, 632, 633, 634, 635, 636, 640, 645, - 647, 649, 651, 656, 661, 662, 665, 666, 670, 672, - 674, 676, 678, 680, 685, 687, 689, 691, 696, 701, - 703, 706, 710, 713, 717, 719, 724, 726, 731, 736, - 738, 743, 744, 745, 749, 754, 759, 764, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 781, 786, 791, - 796, 801, 806, 811, 816, 821, 826, 831, 833, 838, - 840, 845, 850, 855, 860, 862, 867, 869, 874, 879 - }; - - 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 // IW5CDEBUG - - -#line 13 "parser.ypp" -} } } // xsk::gsc::iw5c -#line 4661 "parser.cpp" - -#line 883 "parser.ypp" - - -void xsk::gsc::iw5c::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/src/experimental/iw5c/xsk/parser.hpp b/src/experimental/iw5c/xsk/parser.hpp deleted file mode 100644 index dd7bb55f..00000000 --- a/src/experimental/iw5c/xsk/parser.hpp +++ /dev/null @@ -1,5550 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// 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::gsc::iw5c::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_IW5C_PARSER_HPP_INCLUDED -# define YY_IW5C_PARSER_HPP_INCLUDED -// "%code requires" blocks. -#line 28 "parser.ypp" - -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw5c.hpp" -namespace xsk::gsc::iw5c { class lexer; } - -#line 58 "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 IW5C_ASSERT -# include -# define IW5C_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 - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# 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 IW5CDEBUG -# if defined YYDEBUG -#if YYDEBUG -# define IW5CDEBUG 1 -# else -# define IW5CDEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define IW5CDEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined IW5CDEBUG */ - -#line 13 "parser.ypp" -namespace xsk { namespace gsc { namespace iw5c { -#line 207 "parser.hpp" - - - - - /// A Bison parser. - class parser - { - public: -#ifdef IW5CSTYPE -# ifdef __GNUC__ -# pragma GCC message "bison: do not #define IW5CSTYPE in C++, use %define api.value.type" -# endif - typedef IW5CSTYPE value_type; -#else - /// 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 value_type - { - public: - /// Type of *this. - typedef value_type self_type; - - /// Empty construction. - value_type () YY_NOEXCEPT - : yyraw_ () - , yytypeid_ (YY_NULLPTR) - {} - - /// Construct and fill. - template - value_type (YY_RVREF (T) t) - : yytypeid_ (&typeid (T)) - { - IW5C_ASSERT (sizeof (T) <= size); - new (yyas_ ()) T (YY_MOVE (t)); - } - -#if 201103L <= YY_CPLUSPLUS - /// Non copyable. - value_type (const self_type&) = delete; - /// Non copyable. - self_type& operator= (const self_type&) = delete; -#endif - - /// Destruction, allowed only if empty. - ~value_type () YY_NOEXCEPT - { - IW5C_ASSERT (!yytypeid_); - } - -# if 201103L <= YY_CPLUSPLUS - /// Instantiate a \a T in here from \a t. - template - T& - emplace (U&&... u) - { - IW5C_ASSERT (!yytypeid_); - IW5C_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 () - { - IW5C_ASSERT (!yytypeid_); - IW5C_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) - { - IW5C_ASSERT (!yytypeid_); - IW5C_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 - { - IW5C_ASSERT (yytypeid_); - IW5C_ASSERT (*yytypeid_ == typeid (T)); - IW5C_ASSERT (sizeof (T) <= size); - return *yyas_ (); - } - - /// Const accessor to a built \a T (for %printer). - template - const T& - as () const YY_NOEXCEPT - { - IW5C_ASSERT (yytypeid_); - IW5C_ASSERT (*yytypeid_ == typeid (T)); - IW5C_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 - { - IW5C_ASSERT (yytypeid_); - IW5C_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. - value_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 = yyraw_; - return static_cast (yyp); - } - - /// Const accessor to raw memory as \a T. - template - const T* - yyas_ () const YY_NOEXCEPT - { - const void *yyp = 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_tuple - // expr_tuple_types - // expr_object - char dummy6[sizeof (ast::expr)]; - - // expr_add_array - char dummy7[sizeof (ast::expr_add_array::ptr)]; - - // expr_anim - char dummy8[sizeof (ast::expr_anim::ptr)]; - - // expr_animation - char dummy9[sizeof (ast::expr_animation::ptr)]; - - // expr_animtree - char dummy10[sizeof (ast::expr_animtree::ptr)]; - - // expr_arguments - // expr_arguments_no_empty - char dummy11[sizeof (ast::expr_arguments::ptr)]; - - // expr_array - char dummy12[sizeof (ast::expr_array::ptr)]; - - // expr_call - char dummy13[sizeof (ast::expr_call::ptr)]; - - // expr_complement - char dummy14[sizeof (ast::expr_complement::ptr)]; - - // expr_empty_array - char dummy15[sizeof (ast::expr_empty_array::ptr)]; - - // expr_false - char dummy16[sizeof (ast::expr_false::ptr)]; - - // expr_field - char dummy17[sizeof (ast::expr_field::ptr)]; - - // expr_float - char dummy18[sizeof (ast::expr_float::ptr)]; - - // expr_game - char dummy19[sizeof (ast::expr_game::ptr)]; - - // expr_identifier_nosize - // expr_identifier - char dummy20[sizeof (ast::expr_identifier::ptr)]; - - // expr_integer - char dummy21[sizeof (ast::expr_integer::ptr)]; - - // expr_istring - char dummy22[sizeof (ast::expr_istring::ptr)]; - - // expr_level - char dummy23[sizeof (ast::expr_level::ptr)]; - - // expr_method - char dummy24[sizeof (ast::expr_method::ptr)]; - - // expr_negate - char dummy25[sizeof (ast::expr_negate::ptr)]; - - // expr_not - char dummy26[sizeof (ast::expr_not::ptr)]; - - // expr_parameters - char dummy27[sizeof (ast::expr_parameters::ptr)]; - - // expr_paren - char dummy28[sizeof (ast::expr_paren::ptr)]; - - // expr_path - char dummy29[sizeof (ast::expr_path::ptr)]; - - // expr_reference - char dummy30[sizeof (ast::expr_reference::ptr)]; - - // expr_self - char dummy31[sizeof (ast::expr_self::ptr)]; - - // expr_size - char dummy32[sizeof (ast::expr_size::ptr)]; - - // expr_string - char dummy33[sizeof (ast::expr_string::ptr)]; - - // expr_thisthread - char dummy34[sizeof (ast::expr_thisthread::ptr)]; - - // expr_true - char dummy35[sizeof (ast::expr_true::ptr)]; - - // expr_tuple_arguments - char dummy36[sizeof (ast::expr_tuple::ptr)]; - - // expr_undefined - char dummy37[sizeof (ast::expr_undefined::ptr)]; - - // expr_vector - char dummy38[sizeof (ast::expr_vector::ptr)]; - - // include - char dummy39[sizeof (ast::include::ptr)]; - - // program - char dummy40[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy41[sizeof (ast::stmt)]; - - // stmt_assign - char dummy42[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy43[sizeof (ast::stmt_break::ptr)]; - - // stmt_breakpoint - char dummy44[sizeof (ast::stmt_breakpoint::ptr)]; - - // stmt_call - char dummy45[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy46[sizeof (ast::stmt_case::ptr)]; - - // stmt_continue - char dummy47[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy48[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy49[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy50[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy51[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy52[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy53[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy54[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy55[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy56[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy57[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy58[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy59[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy60[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy61[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy62[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy63[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waittill - char dummy64[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy65[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy66[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy67[sizeof (ast::stmt_while::ptr)]; - - // "path" - // "identifier" - // "string literal" - // "localized string" - // "float" - // "integer" - char dummy68[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]; - }; - - /// Whether the content is built: if defined, the name of the stored type. - const std::type_info *yytypeid_; - }; - -#endif - /// Backward compatibility (Bison 3.8). - typedef value_type semantic_type; - - /// Symbol locations. - typedef xsk::gsc::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 - { - IW5CEMPTY = -2, - IW5CEOF = 0, // "end of file" - IW5Cerror = 1, // error - IW5CUNDEF = 2, // "invalid token" - SH_DEFINE = 3, // "#define" - SH_UNDEF = 4, // "#undef" - SH_IFDEF = 5, // "#ifdef" - SH_IFNDEF = 6, // "#ifndef" - SH_IF = 7, // "#if" - SH_ELIF = 8, // "#elif" - SH_ELSE = 9, // "#else" - SH_ENDIF = 10, // "#endif" - DEVBEGIN = 11, // "/#" - DEVEND = 12, // "#/" - INLINE = 13, // "#inline" - INCLUDE = 14, // "#include" - USINGTREE = 15, // "#using_animtree" - ANIMTREE = 16, // "#animtree" - ENDON = 17, // "endon" - NOTIFY = 18, // "notify" - WAIT = 19, // "wait" - WAITTILL = 20, // "waittill" - WAITTILLMATCH = 21, // "waittillmatch" - WAITTILLFRAMEEND = 22, // "waittillframeend" - IF = 23, // "if" - ELSE = 24, // "else" - DO = 25, // "do" - WHILE = 26, // "while" - FOR = 27, // "for" - FOREACH = 28, // "foreach" - IN = 29, // "in" - SWITCH = 30, // "switch" - CASE = 31, // "case" - DEFAULT = 32, // "default" - BREAK = 33, // "break" - CONTINUE = 34, // "continue" - RETURN = 35, // "return" - BREAKPOINT = 36, // "breakpoint" - PROFBEGIN = 37, // "prof_begin" - PROFEND = 38, // "prof_end" - THREAD = 39, // "thread" - CHILDTHREAD = 40, // "childthread" - THISTHREAD = 41, // "thisthread" - CALL = 42, // "call" - TRUE = 43, // "true" - FALSE = 44, // "false" - UNDEFINED = 45, // "undefined" - SIZE = 46, // "size" - GAME = 47, // "game" - SELF = 48, // "self" - ANIM = 49, // "anim" - LEVEL = 50, // "level" - LPAREN = 51, // "(" - RPAREN = 52, // ")" - LBRACE = 53, // "{" - RBRACE = 54, // "}" - LBRACKET = 55, // "[" - RBRACKET = 56, // "]" - COMMA = 57, // "," - DOT = 58, // "." - DOUBLECOLON = 59, // "::" - COLON = 60, // ":" - SEMICOLON = 61, // ";" - QMARK = 62, // "?" - INCREMENT = 63, // "++" - DECREMENT = 64, // "--" - LSHIFT = 65, // "<<" - RSHIFT = 66, // ">>" - OR = 67, // "||" - AND = 68, // "&&" - EQUALITY = 69, // "==" - INEQUALITY = 70, // "!=" - LESS_EQUAL = 71, // "<=" - GREATER_EQUAL = 72, // ">=" - LESS = 73, // "<" - GREATER = 74, // ">" - NOT = 75, // "!" - COMPLEMENT = 76, // "~" - ASSIGN = 77, // "=" - ASSIGN_ADD = 78, // "+=" - ASSIGN_SUB = 79, // "-=" - ASSIGN_MUL = 80, // "*=" - ASSIGN_DIV = 81, // "/=" - ASSIGN_MOD = 82, // "%=" - ASSIGN_BW_OR = 83, // "|=" - ASSIGN_BW_AND = 84, // "&=" - ASSIGN_BW_EXOR = 85, // "^=" - ASSIGN_RSHIFT = 86, // ">>=" - ASSIGN_LSHIFT = 87, // "<<=" - BITWISE_OR = 88, // "|" - BITWISE_AND = 89, // "&" - BITWISE_EXOR = 90, // "^" - ADD = 91, // "+" - SUB = 92, // "-" - MUL = 93, // "*" - DIV = 94, // "/" - MOD = 95, // "%" - PATH = 96, // "path" - IDENTIFIER = 97, // "identifier" - STRING = 98, // "string literal" - ISTRING = 99, // "localized string" - FLOAT = 100, // "float" - INTEGER = 101, // "integer" - SIZEOF = 102, // SIZEOF - ADD_ARRAY = 103, // ADD_ARRAY - THEN = 104, // THEN - TERN = 105, // TERN - NEG = 106, // NEG - ANIMREF = 107, // ANIMREF - PREINC = 108, // PREINC - PREDEC = 109, // PREDEC - POSTINC = 110, // POSTINC - POSTDEC = 111 // POSTDEC - }; - /// Backward compatibility alias (Bison 3.6). - typedef token_kind_type yytokentype; - }; - - /// Token kind, as returned by yylex. - typedef token::token_kind_type 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 = 112, ///< Number of tokens. - S_YYEMPTY = -2, - S_YYEOF = 0, // "end of file" - S_YYerror = 1, // error - S_YYUNDEF = 2, // "invalid token" - S_SH_DEFINE = 3, // "#define" - S_SH_UNDEF = 4, // "#undef" - S_SH_IFDEF = 5, // "#ifdef" - S_SH_IFNDEF = 6, // "#ifndef" - S_SH_IF = 7, // "#if" - S_SH_ELIF = 8, // "#elif" - S_SH_ELSE = 9, // "#else" - S_SH_ENDIF = 10, // "#endif" - S_DEVBEGIN = 11, // "/#" - S_DEVEND = 12, // "#/" - S_INLINE = 13, // "#inline" - S_INCLUDE = 14, // "#include" - S_USINGTREE = 15, // "#using_animtree" - S_ANIMTREE = 16, // "#animtree" - S_ENDON = 17, // "endon" - S_NOTIFY = 18, // "notify" - S_WAIT = 19, // "wait" - S_WAITTILL = 20, // "waittill" - S_WAITTILLMATCH = 21, // "waittillmatch" - S_WAITTILLFRAMEEND = 22, // "waittillframeend" - S_IF = 23, // "if" - S_ELSE = 24, // "else" - S_DO = 25, // "do" - S_WHILE = 26, // "while" - S_FOR = 27, // "for" - S_FOREACH = 28, // "foreach" - S_IN = 29, // "in" - S_SWITCH = 30, // "switch" - S_CASE = 31, // "case" - S_DEFAULT = 32, // "default" - S_BREAK = 33, // "break" - S_CONTINUE = 34, // "continue" - S_RETURN = 35, // "return" - S_BREAKPOINT = 36, // "breakpoint" - S_PROFBEGIN = 37, // "prof_begin" - S_PROFEND = 38, // "prof_end" - S_THREAD = 39, // "thread" - S_CHILDTHREAD = 40, // "childthread" - S_THISTHREAD = 41, // "thisthread" - S_CALL = 42, // "call" - S_TRUE = 43, // "true" - S_FALSE = 44, // "false" - S_UNDEFINED = 45, // "undefined" - S_SIZE = 46, // "size" - S_GAME = 47, // "game" - S_SELF = 48, // "self" - S_ANIM = 49, // "anim" - S_LEVEL = 50, // "level" - S_LPAREN = 51, // "(" - S_RPAREN = 52, // ")" - S_LBRACE = 53, // "{" - S_RBRACE = 54, // "}" - S_LBRACKET = 55, // "[" - S_RBRACKET = 56, // "]" - S_COMMA = 57, // "," - S_DOT = 58, // "." - S_DOUBLECOLON = 59, // "::" - S_COLON = 60, // ":" - S_SEMICOLON = 61, // ";" - S_QMARK = 62, // "?" - S_INCREMENT = 63, // "++" - S_DECREMENT = 64, // "--" - S_LSHIFT = 65, // "<<" - S_RSHIFT = 66, // ">>" - S_OR = 67, // "||" - S_AND = 68, // "&&" - S_EQUALITY = 69, // "==" - S_INEQUALITY = 70, // "!=" - S_LESS_EQUAL = 71, // "<=" - S_GREATER_EQUAL = 72, // ">=" - S_LESS = 73, // "<" - S_GREATER = 74, // ">" - S_NOT = 75, // "!" - S_COMPLEMENT = 76, // "~" - S_ASSIGN = 77, // "=" - S_ASSIGN_ADD = 78, // "+=" - S_ASSIGN_SUB = 79, // "-=" - S_ASSIGN_MUL = 80, // "*=" - S_ASSIGN_DIV = 81, // "/=" - S_ASSIGN_MOD = 82, // "%=" - S_ASSIGN_BW_OR = 83, // "|=" - S_ASSIGN_BW_AND = 84, // "&=" - S_ASSIGN_BW_EXOR = 85, // "^=" - S_ASSIGN_RSHIFT = 86, // ">>=" - S_ASSIGN_LSHIFT = 87, // "<<=" - S_BITWISE_OR = 88, // "|" - S_BITWISE_AND = 89, // "&" - S_BITWISE_EXOR = 90, // "^" - S_ADD = 91, // "+" - S_SUB = 92, // "-" - S_MUL = 93, // "*" - S_DIV = 94, // "/" - S_MOD = 95, // "%" - S_PATH = 96, // "path" - S_IDENTIFIER = 97, // "identifier" - S_STRING = 98, // "string literal" - S_ISTRING = 99, // "localized string" - S_FLOAT = 100, // "float" - S_INTEGER = 101, // "integer" - S_SIZEOF = 102, // SIZEOF - S_ADD_ARRAY = 103, // ADD_ARRAY - S_THEN = 104, // THEN - S_TERN = 105, // TERN - S_NEG = 106, // NEG - S_ANIMREF = 107, // ANIMREF - S_PREINC = 108, // PREINC - S_PREDEC = 109, // PREDEC - S_POSTINC = 110, // POSTINC - S_POSTDEC = 111, // POSTDEC - S_YYACCEPT = 112, // $accept - S_root = 113, // root - S_program = 114, // program - S_inline = 115, // inline - S_include = 116, // include - S_declaration = 117, // declaration - S_decl_usingtree = 118, // decl_usingtree - S_decl_constant = 119, // decl_constant - S_decl_thread = 120, // decl_thread - S_stmt = 121, // stmt - S_stmt_or_dev = 122, // stmt_or_dev - S_stmt_list = 123, // stmt_list - S_stmt_or_dev_list = 124, // stmt_or_dev_list - S_stmt_dev = 125, // stmt_dev - S_stmt_block = 126, // stmt_block - S_stmt_expr = 127, // stmt_expr - S_stmt_call = 128, // stmt_call - S_stmt_assign = 129, // stmt_assign - S_stmt_endon = 130, // stmt_endon - S_stmt_notify = 131, // stmt_notify - S_stmt_wait = 132, // stmt_wait - S_stmt_waittill = 133, // stmt_waittill - S_stmt_waittillmatch = 134, // stmt_waittillmatch - S_stmt_waittillframeend = 135, // stmt_waittillframeend - S_stmt_if = 136, // stmt_if - S_stmt_ifelse = 137, // stmt_ifelse - S_stmt_while = 138, // stmt_while - S_stmt_dowhile = 139, // stmt_dowhile - S_stmt_for = 140, // stmt_for - S_stmt_foreach = 141, // stmt_foreach - S_stmt_switch = 142, // stmt_switch - S_stmt_case = 143, // stmt_case - S_stmt_default = 144, // stmt_default - S_stmt_break = 145, // stmt_break - S_stmt_continue = 146, // stmt_continue - S_stmt_return = 147, // stmt_return - S_stmt_breakpoint = 148, // stmt_breakpoint - S_stmt_prof_begin = 149, // stmt_prof_begin - S_stmt_prof_end = 150, // stmt_prof_end - S_expr = 151, // expr - S_expr_or_empty = 152, // expr_or_empty - S_expr_assign = 153, // expr_assign - S_expr_increment = 154, // expr_increment - S_expr_decrement = 155, // expr_decrement - S_expr_ternary = 156, // expr_ternary - S_expr_binary = 157, // expr_binary - S_expr_primitive = 158, // expr_primitive - S_expr_complement = 159, // expr_complement - S_expr_negate = 160, // expr_negate - S_expr_not = 161, // expr_not - S_expr_call = 162, // expr_call - S_expr_method = 163, // expr_method - S_expr_function = 164, // expr_function - S_expr_pointer = 165, // expr_pointer - S_expr_add_array = 166, // expr_add_array - S_expr_parameters = 167, // expr_parameters - S_expr_arguments = 168, // expr_arguments - S_expr_arguments_no_empty = 169, // expr_arguments_no_empty - S_expr_reference = 170, // expr_reference - S_expr_tuple = 171, // expr_tuple - S_expr_tuple_arguments = 172, // expr_tuple_arguments - S_expr_tuple_types = 173, // expr_tuple_types - S_expr_array = 174, // expr_array - S_expr_field = 175, // expr_field - S_expr_size = 176, // expr_size - S_expr_paren = 177, // expr_paren - S_expr_object = 178, // expr_object - S_expr_thisthread = 179, // expr_thisthread - S_expr_empty_array = 180, // expr_empty_array - S_expr_undefined = 181, // expr_undefined - S_expr_game = 182, // expr_game - S_expr_self = 183, // expr_self - S_expr_anim = 184, // expr_anim - S_expr_level = 185, // expr_level - S_expr_animation = 186, // expr_animation - S_expr_animtree = 187, // expr_animtree - S_expr_identifier_nosize = 188, // expr_identifier_nosize - S_expr_identifier = 189, // expr_identifier - S_expr_path = 190, // expr_path - S_expr_istring = 191, // expr_istring - S_expr_string = 192, // expr_string - S_expr_vector = 193, // expr_vector - S_expr_float = 194, // expr_float - S_expr_integer = 195, // expr_integer - S_expr_false = 196, // expr_false - S_expr_true = 197 // 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 () YY_NOEXCEPT - : 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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_add_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_add_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_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_animtree::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_animtree::ptr& v, const location_type& l) - : 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_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_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_negate::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l) - : 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_thisthread::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_thisthread::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_tuple::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_tuple::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::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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.template destroy< ast::expr_add_array::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_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.template destroy< ast::expr_negate::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_thisthread: // expr_thisthread - value.template destroy< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.template destroy< ast::expr_tuple::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_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_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_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. - value_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 - { - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; - - /// Default constructor. - by_kind () YY_NOEXCEPT; - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that) YY_NOEXCEPT; -#endif - - /// Copy constructor. - by_kind (const by_kind& that) YY_NOEXCEPT; - - /// Constructor from (external) token numbers. - by_kind (kind_type t) YY_NOEXCEPT; - - - - /// 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 () YY_NOEXCEPT {} - - /// Constructor for valueless symbols, and symbols from each type. -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, location_type l) - : super_type (token_kind_type (tok), std::move (l)) -#else - symbol_type (int tok, const location_type& l) - : super_type (token_kind_type (tok), l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - IW5C_ASSERT (tok == token::IW5CEOF - || (token::IW5Cerror <= tok && tok <= token::MOD) - || (token::SIZEOF <= tok && tok <= token::POSTDEC)); -#endif - } -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, std::string v, location_type l) - : super_type (token_kind_type (tok), std::move (v), std::move (l)) -#else - symbol_type (int tok, const std::string& v, const location_type& l) - : super_type (token_kind_type (tok), v, l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - IW5C_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); -#endif - } - }; - - /// Build a parser object. - parser (xsk::gsc::iw5c::lexer& lexer_yyarg, xsk::gsc::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 IW5CDEBUG - /// 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 token kind. -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW5CEOF (location_type l) - { - return symbol_type (token::IW5CEOF, std::move (l)); - } -#else - static - symbol_type - make_IW5CEOF (const location_type& l) - { - return symbol_type (token::IW5CEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW5Cerror (location_type l) - { - return symbol_type (token::IW5Cerror, std::move (l)); - } -#else - static - symbol_type - make_IW5Cerror (const location_type& l) - { - return symbol_type (token::IW5Cerror, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW5CUNDEF (location_type l) - { - return symbol_type (token::IW5CUNDEF, std::move (l)); - } -#else - static - symbol_type - make_IW5CUNDEF (const location_type& l) - { - return symbol_type (token::IW5CUNDEF, 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_ANIMTREE (location_type l) - { - return symbol_type (token::ANIMTREE, std::move (l)); - } -#else - static - symbol_type - make_ANIMTREE (const location_type& l) - { - return symbol_type (token::ANIMTREE, 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_CHILDTHREAD (location_type l) - { - return symbol_type (token::CHILDTHREAD, std::move (l)); - } -#else - static - symbol_type - make_CHILDTHREAD (const location_type& l) - { - return symbol_type (token::CHILDTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_THISTHREAD (location_type l) - { - return symbol_type (token::THISTHREAD, std::move (l)); - } -#else - static - symbol_type - make_THISTHREAD (const location_type& l) - { - return symbol_type (token::THISTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_CALL (location_type l) - { - return symbol_type (token::CALL, std::move (l)); - } -#else - static - symbol_type - make_CALL (const location_type& l) - { - return symbol_type (token::CALL, 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_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_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_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_SIZEOF (location_type l) - { - return symbol_type (token::SIZEOF, std::move (l)); - } -#else - static - symbol_type - make_SIZEOF (const location_type& l) - { - return symbol_type (token::SIZEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_ADD_ARRAY (location_type l) - { - return symbol_type (token::ADD_ARRAY, std::move (l)); - } -#else - static - symbol_type - make_ADD_ARRAY (const location_type& l) - { - return symbol_type (token::ADD_ARRAY, 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) YY_NOEXCEPT; - - /// 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) YY_NOEXCEPT; - - 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_kind_type enum. - static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; - - - - // 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 symbol kind of the accessing symbol of - // state STATE-NUM. - static const unsigned char yystos_[]; - - // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. - static const unsigned char yyr1_[]; - - // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. - static const signed char yyr2_[]; - - -#if IW5CDEBUG - // 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT; - - /// Constants. - enum - { - yylast_ = 2371, ///< Last index in yytable_. - yynnts_ = 86, ///< Number of nonterminal symbols. - yyfinal_ = 22 ///< Termination state number. - }; - - - // User arguments. - xsk::gsc::iw5c::lexer& lexer; - xsk::gsc::ast::program::ptr& ast; - - }; - - inline - parser::symbol_kind_type - parser::yytranslate_ (int t) YY_NOEXCEPT - { - 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::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_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); - 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_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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 () YY_NOEXCEPT - : kind_ (symbol_kind::S_YYEMPTY) - {} - -#if 201103L <= YY_CPLUSPLUS - inline - parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT - : kind_ (that.kind_) - { - that.clear (); - } -#endif - - inline - parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT - : kind_ (that.kind_) - {} - - inline - parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT - : 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::gsc::iw5c -#line 5546 "parser.hpp" - - - - -#endif // !YY_IW5C_PARSER_HPP_INCLUDED diff --git a/src/experimental/iw5c/xsk/resolver.hpp b/src/experimental/iw5c/xsk/resolver.hpp deleted file mode 100644 index 3ae10d75..00000000 --- a/src/experimental/iw5c/xsk/resolver.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::iw5c -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint16_t; - static auto token_name(std::uint16_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::gsc::iw5c diff --git a/src/experimental/iw6c/stdafx.hpp b/src/experimental/iw6c/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/experimental/iw6c/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/experimental/iw6c/xsk/assembler.cpp b/src/experimental/iw6c/xsk/assembler.cpp deleted file mode 100644 index 2bb28afa..00000000 --- a/src/experimental/iw6c/xsk/assembler.cpp +++ /dev/null @@ -1,554 +0,0 @@ -// 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 "iw6c.hpp" - -namespace xsk::gsc::iw6c -{ - -auto assembler::output_script() -> std::vector -{ - std::vector script; - - if (script_ == nullptr) return script; - - script.resize(script_->pos()); - std::memcpy(script.data(), script_->buffer().data(), script.size()); - - return script; -} - -auto assembler::output_stack() -> std::vector -{ - std::vector stack; - - if (stack_ == nullptr) return stack; - - stack.resize(stack_->pos()); - std::memcpy(stack.data(), stack_->buffer().data(), stack.size()); - - return stack; -} - -void assembler::assemble(const std::string& file, std::vector& data) -{ - std::vector assembly = utils::string::clean_buffer_lines(data); - std::vector functions; - function::ptr func = nullptr; - std::uint32_t index = 1; - std::uint16_t switchnum = 0; - - for (auto& line : assembly) - { - if (line == "" || line.substr(0, 2) == "//") - { - continue; - } - else if (line.substr(0, 4) == "sub_") - { - func = std::make_unique(); - func->index = index; - func->name = line.substr(4); - } - else if (line.substr(0, 4) == "end_") - { - if (func != nullptr) - { - func->size = index - func->index; - functions.push_back(std::move(func)); - } - } - else if (line.substr(0, 4) == "loc_") - { - func->labels[index] = line; - } - else - { - auto opdata = utils::string::parse_code(line); - - if (switchnum) - { - if (opdata[0] == "case" || opdata[0] == "default") - { - for (auto& entry : opdata) - { - func->instructions.back()->data.push_back(entry); - } - switchnum--; - continue; - } - - throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); - } - else - { - auto inst = std::make_unique(); - inst->index = index; - inst->opcode = resolver::opcode_id(opdata[0]); - inst->size = opcode_size(inst->opcode); - opdata.erase(opdata.begin()); - inst->data = std::move(opdata); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = inst->data[0].substr(4); - break; - case opcode::OP_endswitch: - switchnum = static_cast(std::stoi(inst->data[0])); - inst->size += 7 * switchnum; - break; - default: - break; - } - - index += inst->size; - func->instructions.push_back(std::move(inst)); - } - } - } - - assemble(file, functions); -} - -void assembler::assemble(const std::string& file, std::vector& funcs) -{ - script_ = std::make_unique(0x100000); - stack_ = std::make_unique(0x100000); - filename_ = file; - functions_ = std::move(funcs); - - script_->write_endian(static_cast(opcode::OP_End)); - - for (const auto& func : functions_) - { - assemble_function(func); - } -} - -void assembler::assemble_function(const function::ptr& func) -{ - labels_ = func->labels; - - func->id = resolver::token_id(func->name); - - stack_->write_endian(func->size); - stack_->write_endian(static_cast(func->id)); - - if (func->id == 0) - { - stack_->write_c_string(func->name); - } - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write_endian(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: -// case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: -// case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->write_endian(std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->write_endian(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - inst->size += script_->align(4); - script_->write_endian(std::stof(inst->data[0])); - script_->write_endian(std::stof(inst->data[1])); - script_->write_endian(std::stof(inst->data[2])); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->write_endian(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_GetAnimation: - script_->write_endian(0); - stack_->write_c_string(inst->data[0]); - stack_->write_c_string(inst->data[1]); - break; - case opcode::OP_GetAnimTree: - script_->write_endian(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_waittillmatch: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - assemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - assemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - assemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - assemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - assemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - assemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - assemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - assemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - assemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - assemble_jump(inst, false, true); - break; - case opcode::OP_jump: - assemble_jump(inst, false, false); - break; - case opcode::OP_switch: - assemble_switch(inst); - break; - case opcode::OP_endswitch: - assemble_end_switch(inst); - break; - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - script_->write_endian(static_cast(std::stoi(inst->data[1]))); - } - - const auto id = method ? resolver::method_id(inst->data[0]) : resolver::function_id(inst->data[0]); - - script_->write_endian(id); -} - -void assembler::assemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto addr = resolve_function(inst->data[0]); - const auto offset = static_cast(addr - inst->index - 1); - - assemble_offset(offset); - - if (thread) - { - script_->write_endian(static_cast(std::stoi(inst->data[1]))); - } -} - -void assembler::assemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->write_endian(0); - script_->write_endian(0); - - if (thread) - { - script_->write_endian(static_cast(std::stoi(inst->data[2]))); - } - - const auto file_id = resolver::token_id(inst->data[0]); - const auto func_id = resolver::token_id(inst->data[1]); - - stack_->write_endian(file_id); - if (file_id == 0) stack_->write_c_string(inst->data[0]); - stack_->write_endian(func_id); - if (func_id == 0) stack_->write_c_string(inst->data[1]); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const auto addr = resolve_label(inst->data[0]); - - script_->write_endian(addr - inst->index - 4); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - - script_->write_endian(static_cast(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_endian((std::stoi(inst->data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); - } - else - { - script_->write_endian(i + 1); - stack_->write_c_string(inst->data[1 + (3 * i) + 1]); - } - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 2]); - - assemble_offset(addr - index); - - index += 3; - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write_endian(0); - stack_->write_c_string("\x01"); - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 1]); - - assemble_offset(addr - index); - - index += 3; - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::assemble_field_variable(const instruction::ptr& inst) -{ - auto id = resolver::token_id(inst->data[0]); - - if (id == 0) id = 0xFFFF; - - script_->write_endian(id); - - if (id > max_string_id) - { - stack_->write_endian(0); - stack_->write_c_string(inst->data[0]); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - const auto addr = resolve_label(inst->data[0]); - - if (expr) - { - script_->write_endian(static_cast(addr - inst->index - 3)); - } - else if (back) - { - script_->write_endian(static_cast((inst->index + 3) - addr)); - } - else - { - script_->write_endian(static_cast(addr - inst->index - 5)); - } -} - -void assembler::assemble_offset(std::int32_t offset) -{ - std::array bytes = {}; - - offset = (offset << 10) >> 8; - - *reinterpret_cast(bytes.data()) = offset; - - script_->write_endian(bytes[2]); - script_->write_endian(bytes[1]); - script_->write_endian(bytes[0]); -} - -auto assembler::resolve_function(const std::string& name) -> std::int32_t -{ - for (const auto& entry : functions_) - { - if (entry->name == name) - { - return entry->index; - } - } - - throw asm_error("couldn't resolve local function address of '" + name + "'!"); -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/assembler.hpp b/src/experimental/iw6c/xsk/assembler.hpp deleted file mode 100644 index 907a16c3..00000000 --- a/src/experimental/iw6c/xsk/assembler.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::iw6c -{ - -class assembler : public gsc::assembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output_script() -> std::vector; - auto output_stack() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, std::vector& funcs); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void assemble_local_call(const instruction::ptr& inst, bool thread); - void assemble_far_call(const instruction::ptr& inst, bool thread); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void assemble_field_variable(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst, bool expr, bool back); - void assemble_offset(std::int32_t offset); - auto resolve_function(const std::string& name) -> std::int32_t; - auto resolve_label(const std::string& name) -> std::int32_t; -}; - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/compiler.cpp b/src/experimental/iw6c/xsk/compiler.cpp deleted file mode 100644 index 48b26ea4..00000000 --- a/src/experimental/iw6c/xsk/compiler.cpp +++ /dev/null @@ -1,2964 +0,0 @@ -// 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 "iw6c.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -namespace xsk::gsc::iw6c -{ - -auto compiler::output() -> std::vector -{ - return std::move(assembly_); -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "an unknown error ocurred while parsing gsc file"); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_.clear(); - includes_.clear(); - animtrees_.clear(); - constants_.clear(); - local_functions_.clear(); - index_ = 1; - 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& inc : includes_) - { - if (inc.name == path) - { - throw comp_error(include->loc(), "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(), "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 developer block comment"); - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) -{ - const auto itr = constants_.find(constant->name->value); - - if (itr != constants_.end()) - throw comp_error(constant->loc(), "duplicated constant '" + constant->name->value + "'"); - - 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; - - auto blk = std::make_unique(); - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - break_blks_.clear(); - continue_blks_.clear(); - - process_thread(thread, blk); - - emit_expr_parameters(thread->params, blk); - emit_stmt_list(thread->stmt, blk, true); - emit_opcode(opcode::OP_End); - - function_->size = index_ - function_->index; - assembly_.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list, blk, last); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev, blk, last); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend, blk); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if, blk, last); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse, blk, last); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case, blk); - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default, blk); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return, blk); - break; - case ast::kind::stmt_breakpoint: - emit_stmt_breakpoint(stmt.as_breakpoint, blk); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin, blk); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end, blk); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last) -{ - for (const auto& entry : stmt->list) - { - bool last_ = (&entry == &stmt->list.back() && last) ? true : false; - emit_stmt(entry, blk, last_); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last) -{ - emit_stmt_list(stmt->list, blk, last); -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - 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, const block::ptr& blk) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, blk, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, blk, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_endon); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } - - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->time, blk); - emit_opcode(opcode::OP_wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittill); - - for (const auto& entry : stmt->args->list) - { - variable_create(entry.as_identifier, blk); - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(entry.as_identifier, blk)); - } - - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - emit_expr_arguments(stmt->args, blk); - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_waittillmatch2); - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waittillFrameEnd); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - blk->transfer(stmt->blk); - - emit_stmt(stmt->stmt, stmt->blk, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last) -{ - std::vector childs; - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - blk->transfer(stmt->blk_if); - - emit_stmt(stmt->stmt_if, stmt->blk_if, last); - - emit_remove_local_vars(stmt->blk_if); - - if (stmt->blk_if->abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - - last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - - blk->transfer(stmt->blk_else); - - emit_stmt(stmt->stmt_else, stmt->blk_else, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk_else); - - if (stmt->blk_else->abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - - insert_label(end_loc); - - blk->init_from_child(childs); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_stmt(stmt->init, blk, false); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->blk_iter); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - can_break_ = true; - can_continue_ = true; - - emit_stmt(stmt->stmt, stmt->blk, false); - - if (stmt->blk->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->blk.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->blk_iter->init_from_child(continue_blks_); - - emit_stmt(stmt->iter, stmt->blk_iter, false); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_expr(stmt->array_expr, blk); - emit_expr_variable_ref(stmt->array, blk, true); - emit_expr_variable(stmt->array, blk); - emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); - emit_expr_variable_ref(stmt->key_expr, blk, true); - - blk->transfer(stmt->ctx); - stmt->ctx->loc_break = break_loc; - stmt->ctx->loc_continue = continue_loc; - - emit_create_local_vars(stmt->ctx); - - blk->local_vars_create_count = stmt->ctx->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->ctx_post); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr, blk); - emit_opcode(opcode::OP_CallBuiltin1, "isdefined"); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr, stmt->ctx); - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->array.as_identifier, stmt->ctx)); - emit_expr_variable_ref(stmt->value_expr, stmt->ctx, true); - emit_stmt(stmt->stmt, stmt->ctx, false); - - if (stmt->ctx->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->ctx.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->ctx_post->init_from_child(continue_blks_); - - emit_expr_variable(stmt->key_expr, stmt->ctx_post); - emit_expr_variable(stmt->array, stmt->ctx_post); - emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); - emit_expr_variable_ref(stmt->key_expr, stmt->ctx_post, true); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - emit_expr_clear_local(stmt->array.as_identifier, blk); - if (!stmt->use_key) emit_expr_clear_local(stmt->key_expr.as_identifier, blk); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_break = can_break_; - break_blks_.clear(); - can_break_ = false; - - auto jmptable_loc = create_label(); - auto break_loc = create_label(); - - emit_expr(stmt->test, blk); - 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; - block* default_ctx = nullptr; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - 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"); - } - - blk->transfer(case_->blk); - case_->blk->loc_break = break_loc; - emit_stmt_list(case_->stmt, case_->blk, false); - if (case_->stmt->list.size() > 0) - emit_remove_local_vars(case_->blk); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - - has_default = true; - default_ctx = entry.as_default->blk.get(); - - blk->transfer(entry.as_default->blk); - entry.as_default->blk->loc_break = break_loc; - emit_stmt_list(entry.as_default->stmt, entry.as_default->blk, false); - if (entry.as_default->stmt->list.size() > 0) - emit_remove_local_vars(entry.as_default->blk); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - } - blk->init_from_child(break_blks_); - } - - insert_label(jmptable_loc); - - emit_opcode(opcode::OP_endswitch, data); - - auto offset = static_cast(7 * stmt->stmt->list.size()); - function_->instructions.back()->size += offset; - index_ += offset; - - insert_label(break_loc); - - can_break_ = old_break; - break_blks_ = old_breaks; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) -{ - if (!can_break_ || blk->abort != abort_t::abort_none || blk->loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - break_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_break; - emit_opcode(opcode::OP_jump, blk->loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) -{ - if (!can_continue_ || blk->abort != abort_t::abort_none || blk->loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - continue_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_continue; - emit_opcode(opcode::OP_jump, blk->loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - blk->abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr, blk); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child, blk); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate, blk); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference, blk); - break; - case ast::kind::expr_add_array: - emit_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_thisthread: - emit_opcode(opcode::OP_GetThisthread); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - 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, blk); - 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, const block::ptr& blk) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue, blk); - } - else if (expr->lvalue == ast::kind::expr_tuple) - { - emit_expr(expr->rvalue, blk); - emit_expr_tuple(expr->lvalue.as_tuple, blk); - } - else - { - emit_expr(expr->rvalue, blk); - emit_expr_variable_ref(expr->lvalue, blk, true); - } - - return; - } - - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - 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_mod); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_ex_or); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, blk, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key, blk); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, blk, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj, blk); - 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, blk, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk) -{ - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); - else - emit_opcode(opcode::OP_ClearLocalVariableFieldCached, variable_access_index(expr, blk)); -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_inc); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_dec); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr, blk); - emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr, blk); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_equality); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_inequality); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_less); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_greater); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_less_equal); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_greater_equal); - 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_ex_or); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_mod); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt && mode_ == gsc::build::prod) - { - const auto& name = expr->name->value; - if (name == "assert" || name == "assertex" || name == "assertmsg") return; - } - - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal && expr->args->list.size() > 0) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptLocalFunctionCall, expr->name->value); - else - emit_opcode(opcode::OP_ScriptLocalFunctionCall2, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptFarFunctionCall, { expr->path->value, expr->name->value }); - else - emit_opcode(opcode::OP_ScriptFarFunctionCall2, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltin0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltin1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltin2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltin3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltin4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltin5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltin, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptLocalMethodCall, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFarMethodCall, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltinMethod0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltinMethod1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltinMethod2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltinMethod3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltinMethod4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltinMethod5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltinMethod, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_EmptyArray); - - for (const auto& arg : expr->args->list) - { - emit_expr(arg, blk); - emit_opcode(opcode::OP_AddArray); - } -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) -{ - for (const auto& entry : expr->list) - { - variable_initialize(entry, blk); - emit_opcode(opcode::OP_SafeCreateVariableFieldCached, variable_create_index(entry, blk)); - } - - emit_opcode(opcode::OP_checkclearparams); -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry, blk); - } -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) -{ - bool method = false; - auto type = resolve_reference_type(expr, method); - - switch (type) - { - case ast::call::type::local: - emit_opcode(opcode::OP_GetLocalFunction, expr->name->value); - break; - case ast::call::type::far: - emit_opcode(opcode::OP_GetFarFunction, { expr->path->value, expr->name->value }); - break; - case ast::call::type::builtin: - if (method) - emit_opcode(opcode::OP_GetBuiltinMethod, expr->name->value); - else - emit_opcode(opcode::OP_GetBuiltinFunction, expr->name->value); - break; - } -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_size); -} - -void compiler::emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - emit_expr_variable_ref(expr->temp, blk, true); - - auto index = 0; - - for (const auto& entry : expr->list) - { - if (index == 0) - emit_opcode(opcode::OP_GetZero); - else - emit_opcode(opcode::OP_GetByte, utils::string::va("%d", index)); - - index++; - - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->temp.as_identifier, blk)); - - emit_expr_variable_ref(entry, blk, true); - } - - emit_expr_clear_local(expr->temp.as_identifier, blk); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, blk, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, blk, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, blk, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set) -{ - emit_expr(expr->key, blk); - - 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, blk, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - { - if (!variable_initialized(expr->obj.as_identifier, blk)) - { - variable_initialize(expr->obj.as_identifier, blk); - emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(expr->obj.as_identifier, blk)); - - if (!set) throw comp_error(expr->loc(), "INTERNAL: VAR CREATED BUT NOT SET!"); - } - else if (variable_stack_index(expr->obj.as_identifier, blk) == 0) - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached0); - } - else - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access_index(expr->obj.as_identifier, blk)); - } - - 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, const block::ptr& blk, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); - break; - case ast::kind::expr_anim: - set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); - break; - case ast::kind::expr_self: - set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - 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, blk); - 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_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, 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 + "'"); - } - - if (set) - { - if (!variable_initialized(expr, blk)) - { - variable_initialize(expr, blk); - emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(expr, blk)); - } - else if (variable_stack_index(expr, blk) == 0) - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached0); - } - else - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached, variable_access_index(expr, blk)); - } - } - else - { - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_EvalLocalVariableRefCached0); - else - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access_index(expr, blk)); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->key, blk); - - if (expr->obj == ast::kind::expr_identifier) - { - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->obj.as_identifier, blk)); - } - else - { - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_EvalArray); - } -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_EvalLevelFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_EvalAnimFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_EvalSelfFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, const block::ptr& blk) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - emit_expr(itr->second, blk); - return; - } - - // is local var - auto index = variable_stack_index(expr, blk); - - switch (index) - { - case 0: - emit_opcode(opcode::OP_EvalLocalVariableCached0); - break; - case 1: - emit_opcode(opcode::OP_EvalLocalVariableCached1); - break; - case 2: - emit_opcode(opcode::OP_EvalLocalVariableCached2); - break; - case 3: - emit_opcode(opcode::OP_EvalLocalVariableCached3); - break; - case 4: - emit_opcode(opcode::OP_EvalLocalVariableCached4); - break; - case 5: - emit_opcode(opcode::OP_EvalLocalVariableCached5); - break; - default: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access_index(expr, blk)); - break; - } -} - -void compiler::emit_expr_object(const ast::expr& expr, const block::ptr& blk) -{ - 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, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr.as_identifier, blk)); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk) -{ - std::vector data; - - bool isexpr = false; - - 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) - { - auto base = index_ + 1; - auto algn = (base + (4 - 1)) & ~(4 - 1); - emit_opcode(opcode::OP_GetVector, data); - index_ += (algn - base); - } - else - { - emit_expr(expr->z, blk); - emit_expr(expr->y, blk); - emit_expr(expr->x, blk); - 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(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimation, { "", expr->value }); - } - else - { - emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); - tree.loaded = true; - } -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error(expr->loc(), "trying to use animtree without specified using animtree"); - } - - auto& tree = animtrees_.back(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimTree, ""); - } - else - { - emit_opcode(opcode::OP_GetAnimTree, tree.name); - tree.loaded = true; - } -} - -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_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_create_local_vars(const block::ptr& blk) -{ - if (blk->local_vars_create_count != blk->local_vars_public_count) - { - for (auto i = blk->local_vars_create_count; i < blk->local_vars_public_count; i++) - { - auto data = utils::string::va("%d", blk->local_vars.at(i).create); - emit_opcode(opcode::OP_CreateLocalVariable, data); - blk->local_vars.at(i).init = true; - } - blk->local_vars_create_count = blk->local_vars_public_count; - } -} - -void compiler::emit_remove_local_vars(const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - auto count = blk->local_vars_create_count - blk->local_vars_public_count; - - if (count > 0) - { - auto data = utils::string::va("%d", count); - emit_opcode(opcode::OP_RemoveLocalVariables, data); - } - } -} - -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, const block::ptr& blk) -{ - process_expr_parameters(decl->params, blk); - process_stmt_list(decl->stmt, blk); -} - -void compiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - 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_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, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk) -{ - process_stmt_list(stmt->list, blk); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - 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, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - blk->merge(childs); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - stmt->blk_if = std::make_unique(); - stmt->blk_else = std::make_unique(); - - blk->copy(stmt->blk_if); - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - blk->copy(stmt->blk_else); - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - blk->merge(childs); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - stmt->blk = std::make_unique(); - stmt->blk_iter = std::make_unique(); - - process_stmt(stmt->init, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->blk); - blk->copy(stmt->blk_iter); - - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_stmt(stmt->iter, stmt->blk_iter); - - blk->append({ stmt->blk_iter.get() }); - blk->merge({ stmt->blk_iter.get() }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto array_name = utils::string::va("_temp_%d", ++label_idx_); - auto key_name = utils::string::va("_temp_%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; - - // calculate variables - - stmt->ctx = std::make_unique(); - stmt->ctx_post = std::make_unique(); - - // calculate pre_expr variables - process_expr(stmt->array, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->ctx); - blk->copy(stmt->ctx_post); - - // calculate stmt variables & add missing array access as first stmt - process_expr(stmt->value_expr, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - continue_blks_.push_back(stmt->ctx.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_expr(stmt->key_expr, stmt->ctx_post); - - blk->append({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - // calculate variables - stmt->ctx = std::make_unique(); - std::vector childs; - auto abort = abort_t::abort_return; - bool has_default = false; - block* default_ctx = nullptr; - auto old_breaks = break_blks_; - break_blks_.clear(); - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->copy(entry.as_case->blk); - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort != abort_t::abort_none) - { - if (entry.as_case->blk->abort == abort_t::abort_break ) - { - entry.as_case->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_case->blk.get()); - } - else if (entry.as_case->blk->abort <= abort ) - { - abort = entry.as_case->blk->abort; - } - } - } - else if (entry == ast::kind::stmt_default) - { - entry.as_default->blk = std::make_unique(); - blk->copy(entry.as_default->blk); - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - has_default = true; - default_ctx = entry.as_default->blk.get(); - - if (entry.as_default->blk->abort != abort_t::abort_none) - { - if (entry.as_default->blk->abort == abort_t::abort_break ) - { - entry.as_default->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_default->blk.get()); - } - else if (entry.as_default->blk->abort <= abort ) - { - abort = entry.as_default->blk->abort; - } - } - } - } - - stmt->stmt =std::move(stmt_list); - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - } - - blk->append(break_blks_); - blk->merge(childs); - } - - break_blks_ = old_breaks; -} - -void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - break_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_break; - } -} - -void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - continue_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_continue; - } -} - -void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } -} - -void compiler::process_expr(const ast::expr& expr, const block::ptr& blk) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value, blk); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj, blk); - } - else if (expr == ast::kind::expr_tuple) - { - process_expr_tuple(expr.as_tuple, blk); - } -} - -void compiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - auto array = utils::string::va("_temp_%d", ++label_idx_); - expr->temp = ast::expr(std::make_unique(expr->loc(), array)); - - process_expr(expr->temp, blk); - - for (const auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk) -{ - for (const auto& entry : decl->list) - { - variable_register(entry->value, blk); - } -} - -void compiler::variable_register(const std::string& name, const block::ptr& blk) -{ - auto it = std::find_if (blk->local_vars.begin(), blk->local_vars.end(), - [&](const gsc::local_var& v) { return v.name == name; }); - - if (it == blk->local_vars.end()) - { - auto found = false; - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - blk->local_vars.push_back({ name, static_cast(i), false }); - found = true; - break; - } - } - - if (!found) - { - blk->local_vars.push_back({ name, stack_idx_, false }); - local_stack_.push_back(name); - stack_idx_++; - } - } -} - -void compiler::variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::uint32_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (!blk->local_vars[i].init) - { - for (std::uint32_t j = 0; j < i; j++) - { - if (!blk->local_vars[j].init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", blk->local_vars[j].create)); - blk->local_vars[j].init = true; - } - } - blk->local_vars[i].init = true; - blk->local_vars_create_count = i + 1; - return; - } - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -void compiler::variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - auto& var = blk->local_vars.at(i); - if (var.name == name->value) - { - if (!var.init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); - var.init = true; - blk->local_vars_create_count++; - } - return; - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return static_cast(blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - return utils::string::va("%d", blk->local_vars[i].create); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return utils::string::va("%d", blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - return blk->local_vars.at(i).init; - } - } - - 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_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jump: - case opcode::OP_jumpback: - case opcode::OP_switch: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_endswitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - -auto compiler::map_known_includes(const std::string&) -> bool -{ - return false; -} - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/compiler.hpp b/src/experimental/iw6c/xsk/compiler.hpp deleted file mode 100644 index 05ecf0a9..00000000 --- a/src/experimental/iw6c/xsk/compiler.hpp +++ /dev/null @@ -1,159 +0,0 @@ -// 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::gsc::iw6c -{ - -enum class opcode : std::uint8_t; - -class compiler : public gsc::compiler -{ - build mode_; - std::string filename_; - std::vector assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector break_blks_; - std::vector continue_blks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - -public: - auto output() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_constant(const ast::decl_constant::ptr& constant); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last); - void emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void emit_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt, const block::ptr& blk); - void emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk); - void emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk); - void emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk); - void emit_expr(const ast::expr& expr, const block::ptr& blk); - void emit_expr_assign(const ast::expr_assign::ptr& expr, const block::ptr& blk); - void emit_expr_clear(const ast::expr& expr, const block::ptr& blk); - void emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk); - void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk); - void emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_variable(const ast::expr& expr, const block::ptr& blk); - void emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void emit_expr_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_object(const ast::expr& expr, const block::ptr& blk); - void emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_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_create_local_vars(const block::ptr& blk); - void emit_remove_local_vars(const block::ptr& blk); - 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, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(const ast::expr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk); - void variable_register(const std::string& name, const block::ptr& blk); - void variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk); - void variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk); - auto variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t; - auto variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool; - 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; -}; - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/context.cpp b/src/experimental/iw6c/xsk/context.cpp deleted file mode 100644 index ec52f856..00000000 --- a/src/experimental/iw6c/xsk/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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 "iw6c.hpp" - -namespace xsk::gsc::iw6c -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/context.hpp b/src/experimental/iw6c/xsk/context.hpp deleted file mode 100644 index 0c9e3182..00000000 --- a/src/experimental/iw6c/xsk/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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::gsc::iw6c -{ - -class context : public gsc::context -{ - iw6c::assembler assembler_; - iw6c::disassembler disassembler_; - iw6c::compiler compiler_; - iw6c::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { return assembler_; } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { return compiler_; } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/decompiler.cpp b/src/experimental/iw6c/xsk/decompiler.cpp deleted file mode 100644 index 744be181..00000000 --- a/src/experimental/iw6c/xsk/decompiler.cpp +++ /dev/null @@ -1,3436 +0,0 @@ -// 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 "iw6c.hpp" - -namespace xsk::gsc::iw6c -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// IW6 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetLocalFunction: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalFunctionCall2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - 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_ScriptLocalFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalMethodCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodChildThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall2: - { - 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 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_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin1: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin3: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin4: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin5: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod1: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod2: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod3: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod4: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod5: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_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 node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // continue is at jumpback, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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 - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - auto use_key = true; - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - use_key = false; - } - - 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)), use_key)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(std::stoi(entry->value.substr(4))), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - auto var = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - auto var1 = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); - blk->local_vars_create_count++; - } - - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/decompiler.hpp b/src/experimental/iw6c/xsk/decompiler.hpp deleted file mode 100644 index dc740bb0..00000000 --- a/src/experimental/iw6c/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::iw6c -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/disassembler.cpp b/src/experimental/iw6c/xsk/disassembler.cpp deleted file mode 100644 index 5a47c40f..00000000 --- a/src/experimental/iw6c/xsk/disassembler.cpp +++ /dev/null @@ -1,575 +0,0 @@ -// 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 "iw6c.hpp" - -namespace xsk::gsc::iw6c -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// IW6 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read_endian(); - func->id = stack_->read_endian(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: -// case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: -// case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - 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->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read_endian())); - break; - case opcode::OP_GetVector: - inst->size += script_->align(4); - inst->data.push_back(utils::string::float_string(script_->read_endian())); - inst->data.push_back(utils::string::float_string(script_->read_endian())); - inst->data.push_back(utils::string::float_string(script_->read_endian())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(2); - inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); - break; - case opcode::OP_GetAnimation: - script_->seek(4); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - disassemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto id = script_->read_endian(); - const auto name = method ? resolver::method_name(id) : resolver::function_name(id); - inst->data.emplace(inst->data.begin(), name); -} - -void disassembler::disassemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto offset = disassemble_offset(); - - inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(3); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto file_id = stack_->read_endian(); - const auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::token_name(file_id); - const auto func_id = stack_->read_endian(); - const auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); - - inst->data.emplace(inst->data.begin(), func_name); - inst->data.emplace(inst->data.begin(), file_name); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read_endian(); - 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) -{ - const auto count = script_->read_endian(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read_endian(); - - if (value < 0x40000) - { - const auto data = stack_->read_c_string(); - - if (data.data()[0] != 0x01) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(data, false)); - } - else - inst->data.push_back("default"); - } - else - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - index += 4; - - const auto addr = disassemble_offset() + index; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 3; - inst->size += 7; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - const auto id = script_->read_endian(); - std::string name; - - if (id > max_string_id) - { - auto temp = stack_->read_endian(); - name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); - } - else - { - name = resolver::token_name(id); - } - - inst->data.push_back(name); -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read_endian(); - } - else if (back) - { - addr = inst->index + 3 - script_->read_endian(); - } - else - { - addr = inst->index + 5 + script_->read_endian(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -auto disassembler::disassemble_offset() -> std::int32_t -{ - std::array bytes = {}; - - for (auto i = 0; i < 3; i++) - { - bytes[2 - i] = script_->read(); - } - - auto offset = *reinterpret_cast(bytes.data()); - - offset = (offset << 8) >> 10; - - return offset; -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = resolve_function(inst->data[0]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s\n", func->name.data())); - - 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())); - } - - print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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; - } - if (casenum != totalcase - 1) - { - output_->write_string("\n"); - } - } - } - break; - default: - for (auto& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - break; - } - - output_->write_string("\n"); -} - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/disassembler.hpp b/src/experimental/iw6c/xsk/disassembler.hpp deleted file mode 100644 index 00abe1ea..00000000 --- a/src/experimental/iw6c/xsk/disassembler.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc::iw6c -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_local_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - auto disassemble_offset() -> std::int32_t; - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/iw6c.cpp b/src/experimental/iw6c/xsk/iw6c.cpp deleted file mode 100644 index b02eb098..00000000 --- a/src/experimental/iw6c/xsk/iw6c.cpp +++ /dev/null @@ -1,180 +0,0 @@ -// 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 "iw6c.hpp" - -namespace xsk::gsc::iw6c -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_End: - case opcode::OP_Return: - case opcode::OP_GetUndefined: - case opcode::OP_GetZero: - case opcode::OP_waittillFrameEnd: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_EvalArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_ClearArray: - case opcode::OP_EmptyArray: - case opcode::OP_AddArray: - case opcode::OP_PreScriptCall: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_GetLevelObject: - case opcode::OP_GetAnimObject: - case opcode::OP_GetSelf: - case opcode::OP_GetThisthread: - case opcode::OP_GetLevel: - case opcode::OP_GetGame: - case opcode::OP_GetAnim: - case opcode::OP_GetGameRef: - case opcode::OP_inc: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_bit_ex_or: - case opcode::OP_bit_and: - case opcode::OP_equality: - case opcode::OP_inequality: - case opcode::OP_less: - case opcode::OP_greater: - case opcode::OP_less_equal: - case opcode::OP_waittillmatch2: - case opcode::OP_waittill: - case opcode::OP_notify: - case opcode::OP_endon: - case opcode::OP_voidCodepos: - case opcode::OP_vector: - case opcode::OP_greater_equal: - case opcode::OP_shift_left: - case opcode::OP_shift_right: - case opcode::OP_plus: - case opcode::OP_minus: - case opcode::OP_multiply: - case opcode::OP_divide: - case opcode::OP_mod: - case opcode::OP_size: - case opcode::OP_GetSelfObject: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_clearparams: - case opcode::OP_checkclearparams: - case opcode::OP_EvalLocalVariableRefCached0: - // case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_SetVariableField: - // case opcode::OP_ClearVariableField: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_wait: - case opcode::OP_DecTop: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_BoolNot: - case opcode::OP_BoolComplement: - return 1; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - case opcode::OP_CreateLocalVariable: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_waittillmatch: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_GetAnimTree: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_EvalLocalVariableObjectCached: - return 2; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_GetString: - case opcode::OP_GetIString: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jumpback: - case opcode::OP_endswitch: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - return 3; - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_GetLocalFunction: - case opcode::OP_CallBuiltin: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - case opcode::OP_GetFarFunction: - return 4; - case opcode::OP_GetInteger: - case opcode::OP_GetFloat: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_GetAnimation: - case opcode::OP_switch: - case opcode::OP_jump: - return 5; - case opcode::OP_GetVector: - return 13; - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/iw6c.hpp b/src/experimental/iw6c/xsk/iw6c.hpp deleted file mode 100644 index 0a9c13c2..00000000 --- a/src/experimental/iw6c/xsk/iw6c.hpp +++ /dev/null @@ -1,183 +0,0 @@ -// 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 "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::iw6c -{ - -constexpr std::uint16_t max_string_id = 0x95A1; -// ps3 0x95A1 -// 360 0x8EFA - -enum class opcode : std::uint8_t -{ - OP_CastFieldObject = 0x1D, - OP_SetLocalVariableFieldCached = 0x1E, - OP_plus = 0x1F, - OP_RemoveLocalVariables = 0x20, - OP_EvalSelfFieldVariableRef = 0x21, - OP_ScriptFarMethodChildThreadCall = 0x22, - OP_GetGameRef = 0x23, - OP_EvalAnimFieldVariable = 0x24, - OP_EvalLevelFieldVariableRef = 0x25, - OP_GetThisthread = 0x26, - OP_greater = 0x27, - OP_waittillmatch = 0x28, - OP_shift_right = 0x29, - OP_dec = 0x2A, - OP_JumpOnTrue = 0x2B, - OP_bit_or = 0x2C, - OP_equality = 0x2D, - OP_ClearLocalVariableFieldCached0 = 0x2E, - OP_notify = 0x2F, - OP_GetVector = 0x30, - OP_ScriptMethodChildThreadCallPointer = 0x31, - OP_PreScriptCall = 0x32, - OP_GetByte = 0x33, - OP_ScriptFarThreadCall = 0x34, - OP_SetSelfFieldVariableField = 0x35, - OP_JumpOnFalseExpr = 0x36, - OP_GetUndefined = 0x37, - OP_jumpback = 0x38, - OP_JumpOnTrueExpr = 0x39, - OP_CallBuiltin0 = 0x3A, - OP_CallBuiltin1 = 0x3B, - OP_CallBuiltin2 = 0x3C, - OP_CallBuiltin3 = 0x3D, - OP_CallBuiltin4 = 0x3E, - OP_CallBuiltin5 = 0x3F, - OP_CallBuiltin = 0x40, - OP_SetLocalVariableFieldCached0 = 0x41, - OP_ClearFieldVariable = 0x42, - OP_GetLevel = 0x43, - OP_size = 0x44, - OP_SafeSetWaittillVariableFieldCached = 0x45, - OP_ScriptLocalMethodThreadCall = 0x46, - OP_AddArray = 0x47, - OP_endon = 0x48, - OP_EvalFieldVariable = 0x49, - OP_shift_left = 0x4A, - OP_EvalLocalArrayRefCached0 = 0x4B, - OP_Return = 0x4C, - OP_CreateLocalVariable = 0x4D, - OP_SafeSetVariableFieldCached0 = 0x4E, - OP_GetBuiltinMethod = 0x4F, - OP_ScriptLocalMethodCall = 0x50, - OP_CallBuiltinMethodPointer = 0x51, - OP_ScriptLocalChildThreadCall = 0x52, - OP_GetSelfObject = 0x53, - OP_GetGame = 0x54, - OP_SetLevelFieldVariableField = 0x55, - OP_EvalArray = 0x56, - OP_GetSelf = 0x57, - OP_End = 0x58, - OP_EvalSelfFieldVariable = 0x59, - OP_less_equal = 0x5A, - OP_EvalLocalVariableCached0 = 0x5B, - OP_EvalLocalVariableCached1 = 0x5C, - OP_EvalLocalVariableCached2 = 0x5D, - OP_EvalLocalVariableCached3 = 0x5E, - OP_EvalLocalVariableCached4 = 0x5F, - OP_EvalLocalVariableCached5 = 0x60, - OP_EvalLocalVariableCached = 0x61, - OP_EvalNewLocalArrayRefCached0 = 0x62, - OP_ScriptChildThreadCallPointer = 0x63, - OP_EvalLocalVariableObjectCached = 0x64, - OP_ScriptLocalThreadCall = 0x65, - OP_GetInteger = 0x66, - OP_ScriptMethodCallPointer = 0x67, - OP_checkclearparams = 0x68, - OP_SetAnimFieldVariableField = 0x69, - OP_waittillmatch2 = 0x6A, - OP_minus = 0x6B, - OP_ScriptLocalFunctionCall2 = 0x6C, - OP_GetNegUnsignedShort = 0x6D, - OP_GetNegByte = 0x6E, - OP_SafeCreateVariableFieldCached = 0x6F, - OP_greater_equal = 0x70, - OP_vector = 0x71, - OP_GetBuiltinFunction = 0x72, - OP_endswitch = 0x73, - OP_ClearArray = 0x74, - OP_DecTop = 0x75, - OP_CastBool = 0x76, - OP_EvalArrayRef = 0x77, - OP_SetNewLocalVariableFieldCached0 = 0x78, - OP_GetZero = 0x79, - OP_wait = 0x7A, - OP_waittill = 0x7B, - OP_GetIString = 0x7C, - OP_ScriptFarFunctionCall = 0x7D, - OP_GetAnimObject = 0x7E, - OP_GetAnimTree = 0x7F, - OP_EvalLocalArrayCached = 0x80, - OP_mod = 0x81, - OP_ScriptFarMethodThreadCall = 0x82, - OP_GetUnsignedShort = 0x83, - OP_clearparams = 0x84, - OP_ScriptMethodThreadCallPointer = 0x85, - OP_ScriptFunctionCallPointer = 0x86, - OP_EmptyArray = 0x87, - OP_SafeSetVariableFieldCached = 0x88, - // ---- = 0x89, - OP_EvalFieldVariableRef = 0x8A, - OP_ScriptLocalMethodChildThreadCall = 0x8B, - // ---- = 0x8C, - OP_GetFloat = 0x8D, - OP_EvalLocalVariableRefCached = 0x8E, - OP_JumpOnFalse = 0x8F, - OP_BoolComplement = 0x90, - OP_ScriptThreadCallPointer = 0x91, - OP_ScriptFarFunctionCall2 = 0x92, - OP_less = 0x93, - OP_BoolNot = 0x94, - OP_waittillFrameEnd = 0x95, - OP_GetString = 0x96, - OP_EvalLevelFieldVariable = 0x97, - OP_GetLevelObject = 0x98, - OP_inc = 0x99, - OP_CallBuiltinMethod0 = 0x9A, - OP_CallBuiltinMethod1 = 0x9B, - OP_CallBuiltinMethod2 = 0x9C, - OP_CallBuiltinMethod3 = 0x9D, - OP_CallBuiltinMethod4 = 0x9E, - OP_CallBuiltinMethod5 = 0x9F, - OP_CallBuiltinMethod = 0xA0, - OP_GetAnim = 0xA1, - OP_switch = 0xA2, - OP_SetVariableField = 0xA3, - OP_divide = 0xA4, - OP_GetLocalFunction = 0xA5, - OP_ScriptFarChildThreadCall = 0xA6, - OP_multiply = 0xA7, - OP_ClearLocalVariableFieldCached = 0xA8, - OP_EvalAnimFieldVariableRef = 0xA9, - OP_EvalLocalArrayRefCached = 0xAA, - OP_EvalLocalVariableRefCached0 = 0xAB, - OP_bit_and = 0xAC, - OP_GetAnimation = 0xAD, - OP_GetFarFunction = 0xAE, - OP_CallBuiltinPointer = 0xAF, - OP_jump = 0xB0, - OP_voidCodepos = 0xB1, - OP_ScriptFarMethodCall = 0xB2, - OP_inequality = 0xB3, - OP_ScriptLocalFunctionCall = 0xB4, - OP_bit_ex_or = 0xB5, -}; - -auto opcode_size(std::uint8_t id) -> std::uint32_t; - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/lexer.cpp b/src/experimental/iw6c/xsk/lexer.cpp deleted file mode 100644 index 7f001c8f..00000000 --- a/src/experimental/iw6c/xsk/lexer.cpp +++ /dev/null @@ -1,848 +0,0 @@ -// 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 "iw6c.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -xsk::gsc::iw6c::parser::symbol_type IW6Clex(xsk::gsc::iw6c::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::gsc::iw6c -{ - -const std::unordered_map keyword_map -{{ - { "#define", parser::token::SH_DEFINE }, - { "#undef", parser::token::SH_UNDEF }, - { "#ifdef", parser::token::SH_IFDEF }, - { "#ifndef", parser::token::SH_IFNDEF }, - { "#if", parser::token::SH_IF }, - { "#elif", parser::token::SH_ELIF }, - { "#else", parser::token::SH_ELSE }, - { "#endif", parser::token::SH_ENDIF }, - { "#inline", parser::token::INLINE }, - { "#include", parser::token::INCLUDE }, - { "#using_animtree", parser::token::USINGTREE }, - { "#animtree", parser::token::ANIMTREE }, - { "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 }, - { "childthread", parser::token::CHILDTHREAD }, - { "thisthread", parser::token::THISTHREAD }, - { "call", parser::token::CALL }, - { "true", parser::token::TRUE }, - { "false", parser::token::FALSE }, - { "undefined", parser::token::UNDEFINED }, - { "size", parser::token::SIZE }, - { "game", parser::token::GAME }, - { "self", parser::token::SELF }, - { "anim", parser::token::ANIM }, - { "level", parser::token::LEVEL }, -}}; - -buffer::buffer() : length(0) -{ - data = static_cast(std::malloc(max_buf_size)); -} - -buffer::~buffer() -{ - if (data) std::free(data); -} - -bool buffer::push(char c) -{ - if (length >= max_buf_size) - return false; - - data[length++] = c; - return true; -} - -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) -{ - -} - -void reader::init(const char* data, size_t size) -{ - if (data && size) - { - state = reader::ok; - buffer_pos = data; - bytes_remaining = static_cast(size); - last_byte = 0; - current_byte = *data; - } - else - { - state = reader::end; - buffer_pos = 0; - bytes_remaining = 0; - last_byte = 0; - current_byte = 0; - } -} - -void reader::advance() -{ - ++buffer_pos; - - if (bytes_remaining-- == 1) - { - state = reader::end; - bytes_remaining = 0; - last_byte = current_byte; - current_byte = 0; - } - else - { - last_byte = current_byte; - current_byte = *buffer_pos; - } -} - -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) -{ - reader_.init(data, size); -} - -void lexer::push_header(const std::string& file) -{ - try - { - if (header_top_++ >= 10) - throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - - auto data = resolver::file_data(file + ".gsh"); - - readers_.push(reader_); - locs_.push(loc_); - loc_.initialize(std::get<0>(data)); - reader_.init(std::get<1>(data), std::get<2>(data)); - clean_ = true; - } - catch (const std::exception& e) - { - throw error("parsing header file '" + file + "': " + e.what()); - } -} - -void lexer::pop_header() -{ - header_top_--; - loc_ = locs_.top(); - locs_.pop(); - reader_ = readers_.top(); - readers_.pop(); -} - -void lexer::ban_header(const location& loc) -{ - if (header_top_ > 0) - { - throw comp_error(loc, "not allowed inside a gsh file"); - } -} - -auto lexer::lex() -> parser::symbol_type -{ - buffer_.length = 0; - state_ = state::start; - - while (true) - { - const auto& state = reader_.state; - auto& last = reader_.last_byte; - auto& curr = reader_.current_byte; - auto path = false; - loc_.step(); - - if (state == reader::end) - { - if (indev_) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (header_top_ > 0) - pop_header(); - else - return parser::make_IW6CEOF(loc_); - } - - if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') - clean_ = false; - - advance(); - - switch (last) - { - case ' ': - case '\t': - case '\r': - loc_.step(); - continue; - case '\n': - loc_.lines(); - loc_.step(); - clean_ = true; - continue; - case '\\': - throw comp_error(loc_, "invalid token ('\\')"); - case '/': - if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') - return parser::make_DIV(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_DIV(loc_); - - if (last == '#') - { - if (indev_) - throw comp_error(loc_, "cannot recurse devblock ('/#')"); - - if (mode_ == build::dev) - { - indev_ = true; - return parser::make_DEVBEGIN(loc_); - } - else - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '#' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - } - else if (last == '@') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched script doc comment start ('/@')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '@' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '*') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched multiline comment start ('/*')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '*' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '/') - { - while (true) - { - if (state == reader::end) - break; - - if (curr == '\n') - break; - - advance(); - } - } - continue; - case '#': - if (curr == '/') - { - if (!indev_) - throw comp_error(loc_, "unmatched devblock end ('#/')"); - - advance(); - indev_ = false; - return parser::make_DEVEND(loc_); - } - - buffer_.push(last); - advance(); - - while (state == reader::ok) - { - if (last != ' ' || last != '\t') - break; - - advance(); - } - - if (state == reader::end || !((last > 64 && last < 91) || (last > 96 && last < 123))) - throw comp_error(loc_, "invalid preprocessor directive ('#')"); - - state_ = state::preprocessor; - goto lex_name; - case '*': - if (curr != '=' && curr != '/') - return parser::make_MUL(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_MUL(loc_); - - throw comp_error(loc_, "unmatched multiline comment end ('*/')"); - case '"': - state_ = state::string; - goto lex_string; - case '.': - if (curr < '0' || curr > '9') - return parser::make_DOT(loc_); - goto lex_number; - case '(': - return parser::make_LPAREN(loc_); - case ')': - return parser::make_RPAREN(loc_); - case '{': - return parser::make_LBRACE(loc_); - case '}': - return parser::make_RBRACE(loc_); - case '[': - return parser::make_LBRACKET(loc_); - case ']': - return parser::make_RBRACKET(loc_); - case ',': - return parser::make_COMMA(loc_); - case ';': - return parser::make_SEMICOLON(loc_); - case ':': - if (curr != ':') - return parser::make_COLON(loc_); - - advance(); - return parser::make_DOUBLECOLON(loc_); - case '?': - return parser::make_QMARK(loc_); - case '=': - if (curr != '=') - return parser::make_ASSIGN(loc_); - - advance(); - return parser::make_EQUALITY(loc_); - case '+': - if (curr != '+' && curr != '=') - return parser::make_ADD(loc_); - - advance(); - - if (last == '+') - return parser::make_INCREMENT(loc_); - - return parser::make_ASSIGN_ADD(loc_); - case '-': - if (curr != '-' && curr != '=') - return parser::make_SUB(loc_); - - advance(); - - if (last == '-') - return parser::make_DECREMENT(loc_); - - return parser::make_ASSIGN_SUB(loc_); - case '%': - if (curr != '=') - return parser::make_MOD(loc_); - - advance(); - - return parser::make_ASSIGN_MOD(loc_); - case '|': - if (curr != '|' && curr != '=') - return parser::make_BITWISE_OR(loc_); - - advance(); - - if (last == '|') - return parser::make_OR(loc_); - - return parser::make_ASSIGN_BW_OR(loc_); - case '&': - if (curr != '&' && curr != '=' && curr != '"') - return parser::make_BITWISE_AND(loc_); - - advance(); - - if (last == '&') - return parser::make_AND(loc_); - - if (last == '=') - return parser::make_ASSIGN_BW_AND(loc_); - - state_ = state::localize; - goto lex_string; - case '^': - if (curr != '=') - return parser::make_BITWISE_EXOR(loc_); - - advance(); - return parser::make_ASSIGN_BW_EXOR(loc_); - case '!': - if (curr != '=') - return parser::make_NOT(loc_); - - advance(); - return parser::make_INEQUALITY(loc_); - case '~': - return parser::make_COMPLEMENT(loc_); - case '<': - if (curr != '<' && curr != '=') - return parser::make_LESS(loc_); - - advance(); - if (last == '=') - return parser::make_LESS_EQUAL(loc_); - - if (curr != '=') - return parser::make_LSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_LSHIFT(loc_); - case '>': - if (curr != '>' && curr != '=') - return parser::make_GREATER(loc_); - - advance(); - - if (last == '=') - return parser::make_GREATER_EQUAL(loc_); - - if (curr != '=') - return parser::make_RSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_RSHIFT(loc_); - default: - if (last >= '0' && last <= '9') - goto lex_number; - else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) - goto lex_name; - - throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); - } - -lex_string: - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched string start ('\"')"); - - if (curr == '"') - { - advance(); - break; - } - - if (curr == '\n') - throw comp_error(loc_, "unterminated string literal"); - - if (curr == '\\') - { - advance(); - - if (state == reader::end) - throw comp_error(loc_, "invalid token ('\')"); - - char c = curr; - switch (curr) - { - case 't': c = '\t'; break; - case 'r': c = '\r'; break; - case 'n': c = '\n'; break; - case '"': c = '\"'; break; - case '\\': c = '\\'; break; - default: break; - } - - if (!buffer_.push(c)) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); - -lex_name: - buffer_.push(last); - - while (true) - { - if (state == reader::end) - break; - - if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) - break; - - if (curr == '\\') - { - if (last == '\\') - throw comp_error(loc_, "invalid path '\\\\'"); - - path = true; - if (!buffer_.push('/')) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::preprocessor) - { - auto token = parser::token::IW6CUNDEF; - - if (buffer_.length < 16) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - { - if (itr->second > parser::token::SH_ENDIF) - return parser::symbol_type(itr->second, loc_); - - token = itr->second; - } - } - - preprocessor_run(token); - - state_ = state::start; - continue; - } - else - { - 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_); - } - - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - -lex_number: - if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) - { - buffer_.push(last); - - auto dot = last == '.' ? 1 : 0; - auto flt = 0; - - while (true) - { - if (state == reader::end) - break; - - if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) - throw comp_error(loc_, "invalid number literal"); - - if ((curr == '.' || curr == 'f') && last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr == 'f') - flt++; - else if (curr == '.') - dot++; - else if (!(curr > 47 && curr < 58)) - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f')) - throw comp_error(loc_, "invalid number literal"); - - if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); - } - else if (curr == 'o') - { - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) - throw comp_error(loc_, "invalid octal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!(curr > 47 && curr < 56)) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length <= 0) - throw comp_error(loc_, "invalid octal literal"); - - return parser::make_INTEGER(utils::string::oct_to_dec(buffer_.data), loc_); - } - else if (curr == 'b') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) - throw comp_error(loc_, "invalid binary literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr != '0' && curr != '1') - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid binary literal"); - - return parser::make_INTEGER(utils::string::bin_to_dec(buffer_.data), loc_); - } - else if (curr == 'x') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) - throw comp_error(loc_, "invalid hexadecimal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid hexadecimal literal"); - - return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); - } - - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); - } -} - -void lexer::advance() -{ - reader_.advance(); - loc_.end.column++; - - if (reader_.current_byte == '\\') [[unlikely]] - preprocessor_wrap(); -} - -void lexer::preprocessor_wrap() -{ - while (reader_.current_byte == '\\') - { - if (reader_.bytes_remaining == 1) - throw comp_error(loc_, "invalid token ('\\')"); - - if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') - break; - - if (reader_.buffer_pos[1] == '\r') - { - if (reader_.bytes_remaining <= 3 || reader_.buffer_pos[2] != '\n') - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 3; - reader_.bytes_remaining -= 3; - } - - if ((reader_.buffer_pos[1] == '\n')) - { - if (reader_.bytes_remaining == 2) - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 2; - reader_.bytes_remaining -= 2; - } - - if (reader_.bytes_remaining == 0) - { - reader_.state = reader::end; - reader_.current_byte = 0; - } - else - { - reader_.current_byte = *reader_.buffer_pos; - } - - loc_.lines(); - loc_.step(); - } -} - -void lexer::preprocessor_run(parser::token::token_kind_type token) -{ - if (!clean_) - throw comp_error(loc_, "invalid token ('#')"); - - switch (token) - { - case parser::token::SH_DEFINE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_UNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELSE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ENDIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - default: - throw comp_error(loc_, "unknown preprocessor directive"); - } -} - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/lexer.hpp b/src/experimental/iw6c/xsk/lexer.hpp deleted file mode 100644 index 150ff34f..00000000 --- a/src/experimental/iw6c/xsk/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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::gsc::iw6c -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/iw6c/xsk/parser.cpp b/src/experimental/iw6c/xsk/parser.cpp deleted file mode 100644 index eb786361..00000000 --- a/src/experimental/iw6c/xsk/parser.cpp +++ /dev/null @@ -1,4668 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw6c::parser::symbol_type IW6Clex(xsk::gsc::iw6c::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex IW6Clex - - - -#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 IW6CDEBUG - -// 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 // !IW6CDEBUG - -# 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 // !IW6CDEBUG - -#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 gsc { namespace iw6c { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::gsc::iw6c::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg) -#if IW6CDEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - 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_add_array: // expr_add_array - value.YY_MOVE_OR_COPY< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.YY_MOVE_OR_COPY< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.YY_MOVE_OR_COPY< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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 IW6CDEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if IW6CDEBUG - 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 // IW6CDEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - yylhs.value.emplace< ast::expr_add_array::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - yylhs.value.emplace< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - yylhs.value.emplace< ast::expr_tuple::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_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_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_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 261 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2020 "parser.cpp" - break; - - case 3: // root: %empty -#line 262 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2026 "parser.cpp" - break; - - case 4: // program: program inline -#line 267 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2032 "parser.cpp" - break; - - case 5: // program: program include -#line 269 "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 2038 "parser.cpp" - break; - - case 6: // program: program declaration -#line 271 "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 2044 "parser.cpp" - break; - - case 7: // program: inline -#line 273 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2050 "parser.cpp" - break; - - case 8: // program: include -#line 275 "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 2056 "parser.cpp" - break; - - case 9: // program: declaration -#line 277 "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 2062 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 281 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2068 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 286 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2074 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 290 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2080 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 291 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2086 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 292 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2092 "parser.cpp" - break; - - case 15: // declaration: decl_constant -#line 293 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } -#line 2098 "parser.cpp" - break; - - case 16: // declaration: decl_thread -#line 294 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2104 "parser.cpp" - break; - - case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 299 "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 2110 "parser.cpp" - break; - - case 18: // decl_constant: expr_identifier "=" expr ";" -#line 304 "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 2116 "parser.cpp" - break; - - case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 309 "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 2122 "parser.cpp" - break; - - case 20: // stmt: stmt_block -#line 313 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2128 "parser.cpp" - break; - - case 21: // stmt: stmt_call -#line 314 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2134 "parser.cpp" - break; - - case 22: // stmt: stmt_assign -#line 315 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2140 "parser.cpp" - break; - - case 23: // stmt: stmt_endon -#line 316 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2146 "parser.cpp" - break; - - case 24: // stmt: stmt_notify -#line 317 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2152 "parser.cpp" - break; - - case 25: // stmt: stmt_wait -#line 318 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2158 "parser.cpp" - break; - - case 26: // stmt: stmt_waittill -#line 319 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2164 "parser.cpp" - break; - - case 27: // stmt: stmt_waittillmatch -#line 320 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2170 "parser.cpp" - break; - - case 28: // stmt: stmt_waittillframeend -#line 321 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2176 "parser.cpp" - break; - - case 29: // stmt: stmt_if -#line 322 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2182 "parser.cpp" - break; - - case 30: // stmt: stmt_ifelse -#line 323 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2188 "parser.cpp" - break; - - case 31: // stmt: stmt_while -#line 324 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2194 "parser.cpp" - break; - - case 32: // stmt: stmt_dowhile -#line 325 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2200 "parser.cpp" - break; - - case 33: // stmt: stmt_for -#line 326 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2206 "parser.cpp" - break; - - case 34: // stmt: stmt_foreach -#line 327 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2212 "parser.cpp" - break; - - case 35: // stmt: stmt_switch -#line 328 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2218 "parser.cpp" - break; - - case 36: // stmt: stmt_case -#line 329 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2224 "parser.cpp" - break; - - case 37: // stmt: stmt_default -#line 330 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2230 "parser.cpp" - break; - - case 38: // stmt: stmt_break -#line 331 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2236 "parser.cpp" - break; - - case 39: // stmt: stmt_continue -#line 332 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2242 "parser.cpp" - break; - - case 40: // stmt: stmt_return -#line 333 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2248 "parser.cpp" - break; - - case 41: // stmt: stmt_breakpoint -#line 334 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } -#line 2254 "parser.cpp" - break; - - case 42: // stmt: stmt_prof_begin -#line 335 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2260 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_end -#line 336 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2266 "parser.cpp" - break; - - case 44: // stmt_or_dev: stmt -#line 340 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2272 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt_dev -#line 341 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2278 "parser.cpp" - break; - - case 46: // stmt_list: stmt_list stmt -#line 346 "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 2284 "parser.cpp" - break; - - case 47: // stmt_list: stmt -#line 348 "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 2290 "parser.cpp" - break; - - case 48: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 353 "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 2296 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev -#line 355 "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 2302 "parser.cpp" - break; - - case 50: // stmt_dev: "/#" stmt_list "#/" -#line 359 "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 2308 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" "#/" -#line 360 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2314 "parser.cpp" - break; - - case 52: // stmt_block: "{" stmt_or_dev_list "}" -#line 364 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2320 "parser.cpp" - break; - - case 53: // stmt_block: "{" "}" -#line 365 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2326 "parser.cpp" - break; - - case 54: // stmt_expr: expr_assign -#line 370 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2332 "parser.cpp" - break; - - case 55: // stmt_expr: expr_increment -#line 372 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2338 "parser.cpp" - break; - - case 56: // stmt_expr: expr_decrement -#line 374 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2344 "parser.cpp" - break; - - case 57: // stmt_expr: %empty -#line 376 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2350 "parser.cpp" - break; - - case 58: // stmt_call: expr_call ";" -#line 381 "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 2356 "parser.cpp" - break; - - case 59: // stmt_call: expr_method ";" -#line 383 "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 2362 "parser.cpp" - break; - - case 60: // stmt_assign: expr_assign ";" -#line 388 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2368 "parser.cpp" - break; - - case 61: // stmt_assign: expr_increment ";" -#line 390 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2374 "parser.cpp" - break; - - case 62: // stmt_assign: expr_decrement ";" -#line 392 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2380 "parser.cpp" - break; - - case 63: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 397 "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 2386 "parser.cpp" - break; - - case 64: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 402 "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 2392 "parser.cpp" - break; - - case 65: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 404 "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 2398 "parser.cpp" - break; - - case 66: // stmt_wait: "wait" expr ";" -#line 409 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2404 "parser.cpp" - break; - - case 67: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 414 "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 2410 "parser.cpp" - break; - - case 68: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 416 "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 2416 "parser.cpp" - break; - - case 69: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 421 "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 2422 "parser.cpp" - break; - - case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 423 "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 2428 "parser.cpp" - break; - - case 71: // stmt_waittillframeend: "waittillframeend" ";" -#line 428 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2434 "parser.cpp" - break; - - case 72: // stmt_if: "if" "(" expr ")" stmt -#line 433 "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 2440 "parser.cpp" - break; - - case 73: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 438 "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 2446 "parser.cpp" - break; - - case 74: // stmt_while: "while" "(" expr ")" stmt -#line 443 "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 2452 "parser.cpp" - break; - - case 75: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 448 "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 2458 "parser.cpp" - break; - - case 76: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 453 "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 2464 "parser.cpp" - break; - - case 77: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 458 "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 2470 "parser.cpp" - break; - - case 78: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 460 "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 2476 "parser.cpp" - break; - - case 79: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 465 "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 2482 "parser.cpp" - break; - - case 80: // stmt_case: "case" expr_integer ":" -#line 470 "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 2488 "parser.cpp" - break; - - case 81: // stmt_case: "case" expr_string ":" -#line 472 "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 2494 "parser.cpp" - break; - - case 82: // stmt_default: "default" ":" -#line 477 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2500 "parser.cpp" - break; - - case 83: // stmt_break: "break" ";" -#line 482 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2506 "parser.cpp" - break; - - case 84: // stmt_continue: "continue" ";" -#line 487 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2512 "parser.cpp" - break; - - case 85: // stmt_return: "return" expr ";" -#line 492 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2518 "parser.cpp" - break; - - case 86: // stmt_return: "return" ";" -#line 494 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2524 "parser.cpp" - break; - - case 87: // stmt_breakpoint: "breakpoint" ";" -#line 499 "parser.ypp" - { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } -#line 2530 "parser.cpp" - break; - - case 88: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 504 "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 2536 "parser.cpp" - break; - - case 89: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 509 "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 2542 "parser.cpp" - break; - - case 90: // expr: expr_ternary -#line 513 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2548 "parser.cpp" - break; - - case 91: // expr: expr_binary -#line 514 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2554 "parser.cpp" - break; - - case 92: // expr: expr_primitive -#line 515 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2560 "parser.cpp" - break; - - case 93: // expr_or_empty: expr -#line 519 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2566 "parser.cpp" - break; - - case 94: // expr_or_empty: %empty -#line 520 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2572 "parser.cpp" - break; - - case 95: // expr_assign: expr_tuple "=" expr -#line 525 "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 2578 "parser.cpp" - break; - - case 96: // expr_assign: expr_object "=" expr -#line 527 "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 2584 "parser.cpp" - break; - - case 97: // expr_assign: expr_object "|=" expr -#line 529 "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 2590 "parser.cpp" - break; - - case 98: // expr_assign: expr_object "&=" expr -#line 531 "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 2596 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "^=" expr -#line 533 "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 2602 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "<<=" expr -#line 535 "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 2608 "parser.cpp" - break; - - case 101: // expr_assign: expr_object ">>=" expr -#line 537 "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 2614 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "+=" expr -#line 539 "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 2620 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "-=" expr -#line 541 "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 2626 "parser.cpp" - break; - - case 104: // expr_assign: expr_object "*=" expr -#line 543 "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 2632 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "/=" expr -#line 545 "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 2638 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "%=" expr -#line 547 "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 2644 "parser.cpp" - break; - - case 107: // expr_increment: "++" expr_object -#line 552 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2650 "parser.cpp" - break; - - case 108: // expr_increment: expr_object "++" -#line 554 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2656 "parser.cpp" - break; - - case 109: // expr_decrement: "--" expr_object -#line 559 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2662 "parser.cpp" - break; - - case 110: // expr_decrement: expr_object "--" -#line 561 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2668 "parser.cpp" - break; - - case 111: // expr_ternary: expr "?" expr ":" expr -#line 566 "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 2674 "parser.cpp" - break; - - case 112: // expr_binary: expr "||" expr -#line 571 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2680 "parser.cpp" - break; - - case 113: // expr_binary: expr "&&" expr -#line 573 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2686 "parser.cpp" - break; - - case 114: // expr_binary: expr "==" expr -#line 575 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2692 "parser.cpp" - break; - - case 115: // expr_binary: expr "!=" expr -#line 577 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2698 "parser.cpp" - break; - - case 116: // expr_binary: expr "<=" expr -#line 579 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2704 "parser.cpp" - break; - - case 117: // expr_binary: expr ">=" expr -#line 581 "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 2710 "parser.cpp" - break; - - case 118: // expr_binary: expr "<" expr -#line 583 "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 2716 "parser.cpp" - break; - - case 119: // expr_binary: expr ">" expr -#line 585 "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 2722 "parser.cpp" - break; - - case 120: // expr_binary: expr "|" expr -#line 587 "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 2728 "parser.cpp" - break; - - case 121: // expr_binary: expr "&" expr -#line 589 "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 2734 "parser.cpp" - break; - - case 122: // expr_binary: expr "^" expr -#line 591 "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 2740 "parser.cpp" - break; - - case 123: // expr_binary: expr "<<" expr -#line 593 "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 2746 "parser.cpp" - break; - - case 124: // expr_binary: expr ">>" expr -#line 595 "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 2752 "parser.cpp" - break; - - case 125: // expr_binary: expr "+" expr -#line 597 "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 2758 "parser.cpp" - break; - - case 126: // expr_binary: expr "-" expr -#line 599 "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 2764 "parser.cpp" - break; - - case 127: // expr_binary: expr "*" expr -#line 601 "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 2770 "parser.cpp" - break; - - case 128: // expr_binary: expr "/" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2776 "parser.cpp" - break; - - case 129: // expr_binary: expr "%" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2782 "parser.cpp" - break; - - case 130: // expr_primitive: expr_complement -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 2788 "parser.cpp" - break; - - case 131: // expr_primitive: expr_negate -#line 610 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 2794 "parser.cpp" - break; - - case 132: // expr_primitive: expr_not -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 2800 "parser.cpp" - break; - - case 133: // expr_primitive: expr_call -#line 612 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 2806 "parser.cpp" - break; - - case 134: // expr_primitive: expr_method -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 2812 "parser.cpp" - break; - - case 135: // expr_primitive: expr_add_array -#line 614 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } -#line 2818 "parser.cpp" - break; - - case 136: // expr_primitive: expr_reference -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 2824 "parser.cpp" - break; - - case 137: // expr_primitive: expr_array -#line 616 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 2830 "parser.cpp" - break; - - case 138: // expr_primitive: expr_field -#line 617 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 2836 "parser.cpp" - break; - - case 139: // expr_primitive: expr_size -#line 618 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 2842 "parser.cpp" - break; - - case 140: // expr_primitive: expr_paren -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 2848 "parser.cpp" - break; - - case 141: // expr_primitive: expr_thisthread -#line 620 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } -#line 2854 "parser.cpp" - break; - - case 142: // expr_primitive: expr_empty_array -#line 621 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 2860 "parser.cpp" - break; - - case 143: // expr_primitive: expr_undefined -#line 622 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 2866 "parser.cpp" - break; - - case 144: // expr_primitive: expr_game -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 2872 "parser.cpp" - break; - - case 145: // expr_primitive: expr_self -#line 624 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 2878 "parser.cpp" - break; - - case 146: // expr_primitive: expr_anim -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 2884 "parser.cpp" - break; - - case 147: // expr_primitive: expr_level -#line 626 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 2890 "parser.cpp" - break; - - case 148: // expr_primitive: expr_animation -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 2896 "parser.cpp" - break; - - case 149: // expr_primitive: expr_animtree -#line 628 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 2902 "parser.cpp" - break; - - case 150: // expr_primitive: expr_identifier -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 2908 "parser.cpp" - break; - - case 151: // expr_primitive: expr_istring -#line 630 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 2914 "parser.cpp" - break; - - case 152: // expr_primitive: expr_string -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 2920 "parser.cpp" - break; - - case 153: // expr_primitive: expr_vector -#line 632 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 2926 "parser.cpp" - break; - - case 154: // expr_primitive: expr_float -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 2932 "parser.cpp" - break; - - case 155: // expr_primitive: expr_integer -#line 634 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 2938 "parser.cpp" - break; - - case 156: // expr_primitive: expr_false -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 2944 "parser.cpp" - break; - - case 157: // expr_primitive: expr_true -#line 636 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 2950 "parser.cpp" - break; - - case 158: // expr_complement: "~" expr -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2956 "parser.cpp" - break; - - case 159: // expr_negate: "-" expr_identifier -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 2962 "parser.cpp" - break; - - case 160: // expr_negate: "-" expr_paren -#line 648 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 2968 "parser.cpp" - break; - - case 161: // expr_negate: "-" expr_array -#line 650 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 2974 "parser.cpp" - break; - - case 162: // expr_negate: "-" expr_field -#line 652 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 2980 "parser.cpp" - break; - - case 163: // expr_not: "!" expr -#line 657 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2986 "parser.cpp" - break; - - case 164: // expr_call: expr_function -#line 661 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 2992 "parser.cpp" - break; - - case 165: // expr_call: expr_pointer -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 2998 "parser.cpp" - break; - - case 166: // expr_method: expr_object expr_function -#line 665 "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 3004 "parser.cpp" - break; - - case 167: // expr_method: expr_object expr_pointer -#line 666 "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 3010 "parser.cpp" - break; - - case 168: // expr_function: expr_identifier "(" expr_arguments ")" -#line 671 "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 3016 "parser.cpp" - break; - - case 169: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 673 "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 3022 "parser.cpp" - break; - - case 170: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 675 "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 3028 "parser.cpp" - break; - - case 171: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 677 "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 3034 "parser.cpp" - break; - - case 172: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 679 "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::childthread); } -#line 3040 "parser.cpp" - break; - - case 173: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 681 "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::childthread); } -#line 3046 "parser.cpp" - break; - - case 174: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 686 "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 3052 "parser.cpp" - break; - - case 175: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 688 "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 3058 "parser.cpp" - break; - - case 176: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 690 "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::childthread); } -#line 3064 "parser.cpp" - break; - - case 177: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 692 "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::builtin); } -#line 3070 "parser.cpp" - break; - - case 178: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 697 "parser.ypp" - { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } -#line 3076 "parser.cpp" - break; - - case 179: // expr_parameters: expr_parameters "," expr_identifier -#line 702 "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 3082 "parser.cpp" - break; - - case 180: // expr_parameters: expr_identifier -#line 704 "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 3088 "parser.cpp" - break; - - case 181: // expr_parameters: %empty -#line 706 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3094 "parser.cpp" - break; - - case 182: // expr_arguments: expr_arguments_no_empty -#line 711 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3100 "parser.cpp" - break; - - case 183: // expr_arguments: %empty -#line 713 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3106 "parser.cpp" - break; - - case 184: // expr_arguments_no_empty: expr_arguments "," expr -#line 718 "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 3112 "parser.cpp" - break; - - case 185: // expr_arguments_no_empty: expr -#line 720 "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 3118 "parser.cpp" - break; - - case 186: // expr_reference: "::" expr_identifier -#line 725 "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 3124 "parser.cpp" - break; - - case 187: // expr_reference: expr_path "::" expr_identifier -#line 727 "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 3130 "parser.cpp" - break; - - case 188: // expr_tuple: "[" expr_tuple_arguments "]" -#line 732 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[1].value.as < ast::expr_tuple::ptr > ()); } -#line 3136 "parser.cpp" - break; - - case 189: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types -#line 737 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::move(yystack_[2].value.as < ast::expr_tuple::ptr > ()); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3142 "parser.cpp" - break; - - case 190: // expr_tuple_arguments: expr_tuple_types -#line 739 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3148 "parser.cpp" - break; - - case 191: // expr_tuple_types: expr_array -#line 743 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3154 "parser.cpp" - break; - - case 192: // expr_tuple_types: expr_field -#line 744 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3160 "parser.cpp" - break; - - case 193: // expr_tuple_types: expr_identifier -#line 745 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3166 "parser.cpp" - break; - - case 194: // expr_array: expr_object "[" expr "]" -#line 750 "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 3172 "parser.cpp" - break; - - case 195: // expr_field: expr_object "." expr_identifier_nosize -#line 755 "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 3178 "parser.cpp" - break; - - case 196: // expr_size: expr_object "." "size" -#line 760 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3184 "parser.cpp" - break; - - case 197: // expr_paren: "(" expr ")" -#line 765 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3190 "parser.cpp" - break; - - case 198: // expr_object: expr_call -#line 769 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3196 "parser.cpp" - break; - - case 199: // expr_object: expr_method -#line 770 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3202 "parser.cpp" - break; - - case 200: // expr_object: expr_array -#line 771 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3208 "parser.cpp" - break; - - case 201: // expr_object: expr_field -#line 772 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3214 "parser.cpp" - break; - - case 202: // expr_object: expr_game -#line 773 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3220 "parser.cpp" - break; - - case 203: // expr_object: expr_self -#line 774 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3226 "parser.cpp" - break; - - case 204: // expr_object: expr_anim -#line 775 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3232 "parser.cpp" - break; - - case 205: // expr_object: expr_level -#line 776 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3238 "parser.cpp" - break; - - case 206: // expr_object: expr_identifier -#line 777 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3244 "parser.cpp" - break; - - case 207: // expr_thisthread: "thisthread" -#line 782 "parser.ypp" - { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } -#line 3250 "parser.cpp" - break; - - case 208: // expr_empty_array: "[" "]" -#line 787 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3256 "parser.cpp" - break; - - case 209: // expr_undefined: "undefined" -#line 792 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3262 "parser.cpp" - break; - - case 210: // expr_game: "game" -#line 797 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3268 "parser.cpp" - break; - - case 211: // expr_self: "self" -#line 802 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3274 "parser.cpp" - break; - - case 212: // expr_anim: "anim" -#line 807 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3280 "parser.cpp" - break; - - case 213: // expr_level: "level" -#line 812 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3286 "parser.cpp" - break; - - case 214: // expr_animation: "%" "identifier" -#line 817 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3292 "parser.cpp" - break; - - case 215: // expr_animtree: "#animtree" -#line 822 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3298 "parser.cpp" - break; - - case 216: // expr_identifier_nosize: "identifier" -#line 827 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3304 "parser.cpp" - break; - - case 217: // expr_identifier: "identifier" -#line 832 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3310 "parser.cpp" - break; - - case 218: // expr_identifier: "size" -#line 834 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3316 "parser.cpp" - break; - - case 219: // expr_path: "identifier" -#line 839 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3322 "parser.cpp" - break; - - case 220: // expr_path: "path" -#line 841 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3328 "parser.cpp" - break; - - case 221: // expr_istring: "localized string" -#line 846 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3334 "parser.cpp" - break; - - case 222: // expr_string: "string literal" -#line 851 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3340 "parser.cpp" - break; - - case 223: // expr_vector: "(" expr "," expr "," expr ")" -#line 856 "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 3346 "parser.cpp" - break; - - case 224: // expr_float: "-" "float" -#line 861 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3352 "parser.cpp" - break; - - case 225: // expr_float: "float" -#line 863 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3358 "parser.cpp" - break; - - case 226: // expr_integer: "-" "integer" -#line 868 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3364 "parser.cpp" - break; - - case 227: // expr_integer: "integer" -#line 870 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3370 "parser.cpp" - break; - - case 228: // expr_false: "false" -#line 875 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3376 "parser.cpp" - break; - - case 229: // expr_true: "true" -#line 880 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3382 "parser.cpp" - break; - - -#line 3386 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "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", - "childthread", "thisthread", "call", "true", "false", "undefined", - "size", "game", "self", "anim", "level", "(", ")", "{", "}", "[", "]", - ",", ".", "::", ":", ";", "?", "++", "--", "<<", ">>", "||", "&&", "==", - "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", "%=", - "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", "%", - "path", "identifier", "string literal", "localized string", "float", - "integer", "SIZEOF", "ADD_ARRAY", "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_negate", "expr_not", "expr_call", "expr_method", - "expr_function", "expr_pointer", "expr_add_array", "expr_parameters", - "expr_arguments", "expr_arguments_no_empty", "expr_reference", - "expr_tuple", "expr_tuple_arguments", "expr_tuple_types", "expr_array", - "expr_field", "expr_size", "expr_paren", "expr_object", - "expr_thisthread", "expr_empty_array", "expr_undefined", "expr_game", - "expr_self", "expr_anim", "expr_level", "expr_animation", - "expr_animtree", "expr_identifier_nosize", "expr_identifier", - "expr_path", "expr_istring", "expr_string", "expr_vector", "expr_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 IW6CDEBUG - // 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 IW6CDEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if IW6CDEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -281; - - const short parser::yytable_ninf_ = -220; - - const short - parser::yypact_[] = - { - 4, -281, -281, -72, -72, -41, -281, -281, 32, 4, - -281, -281, -281, -281, -281, -281, -21, -281, -281, -28, - -1, -22, -281, -281, -281, -281, -43, 1235, -281, -281, - -281, 5, -29, -281, -281, -26, -24, -281, 8, -281, - -281, -281, -281, -281, -281, -281, 1235, 1109, -43, 1235, - 1235, 612, 1, 47, -281, -281, -281, 2111, -281, -281, - -281, -281, -281, -281, 108, 145, -281, -281, -281, -281, - 372, 438, -281, -281, 633, -281, -281, -281, 664, 818, - 982, 987, -281, -281, 39, 59, -281, -281, -281, -281, - -281, -281, -281, 61, 16, -43, 65, 78, 79, 103, - 109, 127, 133, 1443, 1109, -281, 2194, 125, 136, -281, - -281, -281, 1235, 134, -281, -281, -281, -281, 372, 438, - -281, 1132, -281, -281, -281, -281, 39, 137, -281, -281, - 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, - 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1298, - -35, -281, -281, 147, 1235, -43, -281, 951, -281, -281, - 1235, 1235, -43, 1235, 1235, -43, 1235, -281, 1235, 1231, - 1235, -281, 1609, 1235, 102, -43, 2076, -51, -51, 2225, - 865, 2276, 2276, -27, -27, -27, -27, 2235, 273, 2266, - 51, 51, -281, -281, -281, 1294, -281, -281, -281, 23, - -281, 150, 77, 1235, 148, 157, 1381, 160, 162, 163, - 166, -15, 158, 165, 167, 1172, 168, 172, 173, -281, - 409, 703, 703, -281, -281, 1027, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, 175, 184, 185, 186, 187, 142, -281, -281, 808, - 147, 1921, 30, 176, 1961, 36, 182, 2001, 2040, 195, - 2194, 1231, 150, 1235, -281, -281, 1235, -281, -281, 1080, - 2146, -281, 1235, 224, 1235, 738, -43, 1235, 151, 193, - 196, -281, -281, -281, -281, 2181, -281, 1235, 1235, 1298, - 35, -281, 112, 123, -4, 1132, 1132, -281, -281, -281, - -281, -281, -281, -281, 1235, 204, 206, 209, 210, -281, - -281, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, - 1235, 1235, 207, -281, 1235, 211, -281, 1235, 212, 1235, - 214, 2194, 76, -281, -281, -281, 1643, 215, 1677, 201, - -281, -281, -281, 1407, -8, 1711, -281, -281, -281, 82, - 85, -281, 703, 2194, 1235, 1235, 1235, 1235, 2194, 2194, - 2194, 2194, 2194, 2194, 2194, 2194, 2194, 2194, 2194, 219, - 104, 220, 107, 221, 1745, 1235, -281, 1381, 1235, 1381, - 1235, 1235, -43, 16, 216, 222, -281, 1779, 1487, 1531, - 1575, 1235, -281, 1235, -281, 1235, -281, 120, 249, 1813, - -281, 2194, 223, 1847, 246, -281, -281, -281, 227, 229, - 1235, 232, 1235, 235, 1235, 124, 126, 138, -281, 1381, - 236, 738, 1381, 1235, -281, -281, 228, -281, 230, -281, - 247, -281, -281, -281, -281, -281, 250, -281, 1881, 242, - 243, 248, 1381, 1381, -281, -281, -281, -281, -281 - }; - - const unsigned char - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 218, 217, 0, 2, - 7, 8, 9, 14, 15, 16, 0, 220, 219, 0, - 0, 0, 1, 4, 5, 6, 181, 0, 10, 11, - 222, 0, 0, 180, 215, 0, 0, 207, 0, 229, - 228, 209, 210, 211, 212, 213, 0, 183, 0, 0, - 0, 0, 0, 217, 221, 225, 227, 0, 90, 91, - 92, 130, 131, 132, 133, 134, 164, 165, 135, 136, - 137, 138, 139, 140, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 0, 151, 152, 153, 154, - 155, 156, 157, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 183, 208, 185, 0, 182, 186, - 163, 158, 0, 0, 224, 226, 198, 199, 161, 162, - 160, 0, 202, 203, 204, 205, 159, 0, 214, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 166, 167, 0, 183, 0, 17, 0, 19, 179, - 0, 183, 0, 0, 183, 0, 0, 197, 0, 185, - 0, 178, 0, 0, 0, 0, 0, 123, 124, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 125, 126, 127, 128, 129, 0, 196, 216, 195, 0, - 182, 187, 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, 198, 199, 0, 200, 201, 0, - 206, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 184, 0, 0, 0, 194, 168, 183, 51, 47, 0, - 0, 71, 0, 0, 0, 57, 0, 0, 0, 0, - 0, 82, 83, 84, 86, 0, 87, 183, 183, 0, - 0, 190, 200, 201, 206, 107, 109, 52, 48, 60, - 61, 62, 58, 59, 0, 0, 0, 0, 0, 108, - 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 170, 183, 0, 172, 183, 0, 0, - 0, 111, 0, 50, 46, 66, 0, 0, 0, 0, - 54, 55, 56, 0, 0, 0, 81, 80, 85, 0, - 0, 188, 0, 95, 0, 0, 0, 0, 96, 102, - 103, 104, 105, 106, 97, 98, 99, 101, 100, 0, - 0, 0, 0, 0, 0, 183, 169, 0, 0, 0, - 94, 0, 0, 0, 0, 0, 189, 0, 0, 0, - 0, 183, 171, 183, 173, 183, 223, 0, 72, 0, - 74, 93, 0, 0, 0, 79, 88, 89, 0, 0, - 183, 0, 183, 0, 183, 0, 0, 0, 174, 0, - 0, 57, 0, 0, 63, 65, 182, 68, 182, 70, - 182, 175, 176, 177, 73, 75, 0, 77, 0, 0, - 0, 0, 0, 0, 64, 67, 69, 76, 78 - }; - - const short - parser::yypgoto_[] = - { - -281, -281, -281, 272, 298, 299, -281, -281, -281, 194, - 86, -281, -281, -281, -92, -121, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, 188, - -281, -280, -279, -278, -281, -281, -281, -281, -281, -281, - 92, 203, -66, -62, -281, -281, -127, -46, -281, -281, - -281, -13, 213, 337, -281, 289, 385, -281, -281, -281, - 392, 480, 512, 519, -281, -281, -281, 0, 10, -281, - -17, -281, -281, 130, -281, -281 - }; - - const short - parser::yydefgoto_[] = - { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 223, - 224, 279, 225, 226, 227, 349, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 106, - 412, 251, 252, 253, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 32, 107, 200, 69, 256, - 300, 301, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 198, 84, 85, 86, - 87, 88, 89, 90, 91, 92 - }; - - const short - parser::yytable_[] = - { - 16, 108, 158, 6, 31, 350, 351, 352, 151, 16, - 21, 196, 152, 19, 20, 1, 2, 3, 4, 5, - 6, 391, 6, 94, 17, 18, 33, 199, 95, 96, - 26, 99, 22, 28, 262, 97, 100, 265, 131, 132, - 144, 145, 146, 147, 148, 98, 101, 154, 109, 392, - 6, 126, -193, -193, 7, 151, 27, 93, 108, 152, - 29, 127, 197, 102, 144, 145, 146, 147, 148, 157, - 17, 53, 17, 53, 153, 275, 30, 288, -206, -206, - 170, -206, 333, 30, 127, -206, 56, 170, 336, 277, - 154, 361, 362, 170, -206, 159, 203, -206, 128, 204, - 205, 7, 206, 207, 208, 209, -219, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 35, 36, 155, 38, - 160, 153, 156, 6, 42, 43, 44, 45, 386, 161, - 157, 127, 220, 170, 394, -206, -206, 395, 162, 170, - 221, 222, 170, 116, 146, 147, 148, -198, -198, 342, - -198, 350, 351, 352, -198, 201, 402, 260, 163, 404, - 164, 170, 263, -198, 170, 266, -198, 127, -191, -191, - 359, 360, 428, 17, 53, 272, 441, 170, 442, -192, - -192, 170, 170, 170, -199, -199, 165, -199, 166, 173, - 443, -199, 171, 151, 289, 170, 175, 152, 154, 197, - -199, 276, 260, -199, -198, -198, 260, 380, 282, 281, - 382, 284, 127, 285, 286, 57, 127, 287, 291, 314, - 304, 260, 260, 297, 298, 260, 292, 334, 293, 296, - 127, 127, 127, 337, 103, 127, 309, 110, 111, 151, - 151, -199, -199, 152, 152, 310, 311, 312, 313, 254, - 347, 340, 115, 356, 117, 364, 357, 365, 407, 153, - 366, 367, 390, 379, 118, 385, 388, 381, 383, 127, - 401, 403, 405, 429, 425, 433, 426, 416, 427, 260, - 449, 23, 450, 417, 431, 260, 354, 151, 434, 127, - 435, 152, 169, 437, 254, 127, 439, 445, 254, 451, - 172, 415, 452, 454, 455, 153, 153, 24, 25, 456, - 446, 308, 116, 116, 116, 127, 127, 254, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 131, 132, - 120, 290, 135, 136, 137, 138, 139, 140, 261, 396, - 0, 264, 0, 153, 267, 0, 268, 0, 270, 0, - 255, 271, 304, 127, 144, 145, 146, 147, 148, 0, - 257, 254, 127, 0, 436, 0, 438, 116, 440, 0, - 0, 0, 0, 0, 0, 0, 0, 260, 119, 260, - 0, 280, 414, 0, 0, 0, 278, 127, 0, 127, - 283, 0, 0, 295, 0, 255, 0, 0, 0, 255, - 0, -200, -200, 0, -200, 257, 0, 0, -200, 257, - 0, 0, 0, 117, 117, 117, 0, -200, 255, 260, - -200, 260, 260, 302, 257, 257, 121, 0, 257, 127, - 0, 127, 127, 122, 0, 0, 0, 0, 35, 36, - 0, 38, 260, 260, 116, 6, 42, 43, 44, 45, - 0, 341, 127, 127, 299, 0, 0, 0, -200, -200, - 346, 0, 348, 344, 0, 355, 0, -201, -201, 254, - -201, 254, 255, 0, -201, 0, 0, 271, 117, 0, - 0, 0, 257, -201, 258, 0, -201, 0, 257, 0, - 0, 0, 363, 0, 0, 17, 53, 0, 0, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 0, 254, 0, 116, 254, 0, 0, 384, 0, 0, - 0, 123, 0, 0, -201, -201, 0, 0, 0, 258, - 0, 0, 259, 258, 254, 254, 0, 0, 0, 122, - 0, 0, 397, 398, 399, 400, 0, 303, 258, 258, - 0, 0, 258, 124, 0, 117, 0, 0, 0, 0, - 125, 0, 0, 0, 0, 302, 409, 0, 411, 413, - 0, 408, 0, 410, 0, 0, 0, 259, 0, 0, - 255, 259, 255, 0, 122, 0, 0, 0, 122, 0, - 257, 0, 257, 0, 0, 121, 305, 306, 0, 0, - 259, 0, 122, 122, 122, 0, 258, 122, 0, 0, - 0, 448, 258, 444, 0, 0, 447, 0, 0, 0, - 0, 0, 255, 0, 117, 255, 0, 123, 0, 0, - 0, 0, 257, 0, 257, 257, 457, 458, 0, 0, - 0, 35, 36, 0, 38, 255, 255, 0, 6, 42, - 43, 44, 45, 112, 259, 257, 257, 113, 0, 124, - 353, 122, 35, 36, 0, 38, 125, 122, 0, 6, - 0, 0, 123, 0, 0, 0, 123, 0, 149, 0, - 0, 150, 0, 0, 0, 0, 0, 0, 0, 303, - 123, 123, 123, -202, -202, 123, -202, 0, 17, 53, - -202, 0, 114, 115, 124, 0, 0, 0, 124, -202, - 0, 125, -202, 0, 258, 125, 258, 0, 0, 17, - 53, 0, 124, 124, 124, 0, 0, 124, 0, 125, - 125, 125, 35, 36, 125, 38, 0, 121, 0, 6, - 42, 43, 44, 45, 122, 0, 0, 0, 113, 123, - -202, -202, 0, 0, 0, 123, 258, 0, 258, 258, - 0, 0, 259, 0, 259, 0, 0, 35, 36, 122, - 38, 122, 0, 0, 6, 42, 43, 44, 45, 258, - 258, 124, 0, 220, 0, 0, 0, 124, 125, 17, - 53, 221, 222, 0, 125, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 259, 0, 353, 259, 0, 0, - 0, 122, 0, 122, 122, 315, 316, 0, 317, 318, - 0, 0, 0, 0, 17, 53, 0, 259, 259, 0, - 0, 0, 123, 0, 122, 122, 0, 35, 36, 0, - 38, 0, 0, 0, 6, 0, 0, -203, -203, 0, - -203, 0, 0, 149, -203, 0, 174, 123, 0, 123, - 0, 319, 320, -203, 124, 0, -203, 0, 0, 0, - 0, 125, 0, 0, 0, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 0, 0, 0, 124, - 0, 124, 0, 0, 17, 53, 125, 0, 125, 123, - 0, 123, 123, 0, -203, -203, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 131, 132, 123, 123, 135, 136, 137, 138, 139, 140, - 0, 124, 0, 124, 124, 0, 0, 0, 125, 0, - 125, 125, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 0, 202, 0, 124, 124, 0, 0, 0, 0, - 203, 125, 125, 204, 205, 0, 206, 207, 208, 209, - 0, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 35, 36, 0, 38, 0, 0, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 219, 220, 0, 0, 0, - 0, 0, 0, 0, 221, 222, 0, 0, 0, 0, - 0, -204, -204, 0, -204, 0, -205, -205, -204, -205, - 0, 0, 0, -205, 0, 0, 0, -204, 202, 0, - -204, 0, -205, 0, 0, -205, 203, 17, 53, 204, - 205, 0, 206, 207, 208, 209, 0, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 35, 36, 0, 38, - 0, 0, 0, 6, 42, 43, 44, 45, -204, -204, - 157, 307, 220, -205, -205, 0, 0, 0, 0, 0, - 221, 222, 343, 0, 0, 0, 0, 0, 0, 203, - 0, 0, 204, 205, 0, 206, 207, 208, 209, 0, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 35, - 36, 0, 38, 17, 53, 34, 6, 42, 43, 44, - 45, 0, 0, 157, 0, 220, 0, 0, 0, 0, - 0, 0, 0, 221, 222, 0, 0, 0, 35, 36, - 37, 38, 39, 40, 41, 6, 42, 43, 44, 45, - 46, 0, 0, 0, 104, 105, 0, 0, 48, 0, - 0, 35, 36, 0, 38, 0, 17, 53, 6, 0, - 0, 0, 0, 0, 49, 50, 0, 149, 34, 0, - 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 51, 0, 0, 52, 17, 53, 30, 54, 55, - 56, 35, 36, 37, 38, 39, 40, 41, 6, 42, - 43, 44, 45, 46, 0, 0, 0, 47, 17, 53, - 0, 48, 0, 294, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 49, 50, 0, - 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 51, 0, 0, 52, 17, 53, - 30, 54, 55, 56, 35, 36, 37, 38, 39, 40, - 41, 6, 42, 43, 44, 45, 46, 269, 0, 0, - 47, 0, 0, 130, 48, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 49, 50, 0, 0, 34, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 51, 0, 0, - 52, 17, 53, 30, 54, 55, 56, 35, 36, 37, - 38, 39, 40, 41, 6, 42, 43, 44, 45, 46, - 274, 0, 0, 104, 0, 0, 130, 48, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 49, 50, 0, 0, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 51, 0, 0, 52, 17, 53, 30, 54, 55, 56, - 203, 0, 0, 204, 205, 0, 206, 207, 208, 209, - 0, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 35, 36, 0, 38, 0, 0, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 0, 220, 0, 0, 0, - 0, 0, 0, 0, 221, 222, 35, 36, 0, 38, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, - 0, 0, 149, 0, 0, 174, 0, 0, 0, 0, - 319, 320, 0, 0, 0, 0, 0, 17, 53, 0, - 0, 0, 0, 0, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 167, 0, 0, 0, 0, - 168, 0, 0, 17, 53, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 419, - 0, 0, 0, 0, 420, 0, 0, 0, 0, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 421, 0, 0, 0, 0, 422, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 423, 0, 0, - 0, 0, 424, 0, 0, 0, 0, 130, 0, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 167, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 130, 0, 0, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 387, 0, 141, 142, 143, - 144, 145, 146, 147, 148, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 389, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 393, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 406, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 130, 0, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 418, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 130, 0, 0, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 430, 0, 141, 142, 143, - 144, 145, 146, 147, 148, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 453, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 332, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 335, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 338, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 339, 0, 0, - 0, 0, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 273, 0, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 129, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 345, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 358, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 131, 132, 0, 134, 135, 136, 137, 138, 139, 140, - 131, 132, 0, 0, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 0, 0, 0, 142, 143, 144, 145, 146, 147, - 148, 131, 132, 0, 0, 135, 136, 137, 138, 139, - 140, 131, 132, 0, 0, 0, 0, 137, 138, 139, - 140, 0, 0, 0, 0, 142, 0, 144, 145, 146, - 147, 148, 0, 0, 0, 0, 0, 144, 145, 146, - 147, 148 - }; - - const short - parser::yycheck_[] = - { - 0, 47, 94, 46, 21, 285, 285, 285, 74, 9, - 51, 46, 74, 3, 4, 11, 12, 13, 14, 15, - 46, 29, 46, 52, 96, 97, 26, 154, 57, 55, - 51, 55, 0, 61, 161, 35, 36, 164, 65, 66, - 91, 92, 93, 94, 95, 35, 36, 51, 48, 57, - 46, 51, 56, 57, 97, 121, 77, 52, 104, 121, - 61, 51, 97, 55, 91, 92, 93, 94, 95, 53, - 96, 97, 96, 97, 74, 52, 98, 92, 39, 40, - 57, 42, 52, 98, 74, 46, 101, 57, 52, 12, - 51, 56, 57, 57, 55, 95, 19, 58, 97, 22, - 23, 97, 25, 26, 27, 28, 59, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 59, 42, - 55, 121, 61, 46, 47, 48, 49, 50, 52, 51, - 53, 121, 55, 57, 52, 96, 97, 52, 59, 57, - 63, 64, 57, 51, 93, 94, 95, 39, 40, 276, - 42, 431, 431, 431, 46, 155, 52, 157, 55, 52, - 51, 57, 162, 55, 57, 165, 58, 157, 56, 57, - 297, 298, 52, 96, 97, 175, 52, 57, 52, 56, - 57, 57, 57, 57, 39, 40, 59, 42, 55, 55, - 52, 46, 56, 259, 211, 57, 59, 259, 51, 97, - 55, 51, 202, 58, 96, 97, 206, 334, 51, 61, - 337, 51, 202, 51, 51, 27, 206, 51, 60, 77, - 220, 221, 222, 51, 51, 225, 61, 51, 61, 61, - 220, 221, 222, 51, 46, 225, 61, 49, 50, 305, - 306, 96, 97, 305, 306, 61, 61, 61, 61, 157, - 26, 56, 101, 60, 51, 51, 60, 51, 385, 259, - 51, 51, 61, 56, 51, 51, 51, 56, 56, 259, - 51, 51, 51, 24, 401, 29, 403, 61, 405, 279, - 52, 9, 52, 61, 61, 285, 286, 353, 61, 279, - 61, 353, 104, 61, 202, 285, 61, 61, 206, 52, - 112, 393, 52, 61, 61, 305, 306, 9, 9, 61, - 431, 225, 220, 221, 222, 305, 306, 225, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 65, 66, - 51, 211, 69, 70, 71, 72, 73, 74, 160, 362, - -1, 163, -1, 353, 166, -1, 168, -1, 170, -1, - 157, 173, 362, 353, 91, 92, 93, 94, 95, -1, - 157, 279, 362, -1, 420, -1, 422, 285, 424, -1, - -1, -1, -1, -1, -1, -1, -1, 387, 51, 389, - -1, 203, 392, -1, -1, -1, 202, 387, -1, 389, - 206, -1, -1, 215, -1, 202, -1, -1, -1, 206, - -1, 39, 40, -1, 42, 202, -1, -1, 46, 206, - -1, -1, -1, 220, 221, 222, -1, 55, 225, 429, - 58, 431, 432, 220, 221, 222, 51, -1, 225, 429, - -1, 431, 432, 51, -1, -1, -1, -1, 39, 40, - -1, 42, 452, 453, 362, 46, 47, 48, 49, 50, - -1, 273, 452, 453, 55, -1, -1, -1, 96, 97, - 282, -1, 284, 279, -1, 287, -1, 39, 40, 387, - 42, 389, 279, -1, 46, -1, -1, 299, 285, -1, - -1, -1, 279, 55, 157, -1, 58, -1, 285, -1, - -1, -1, 314, -1, -1, 96, 97, -1, -1, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, - -1, 429, -1, 431, 432, -1, -1, 339, -1, -1, - -1, 51, -1, -1, 96, 97, -1, -1, -1, 202, - -1, -1, 157, 206, 452, 453, -1, -1, -1, 157, - -1, -1, 364, 365, 366, 367, -1, 220, 221, 222, - -1, -1, 225, 51, -1, 362, -1, -1, -1, -1, - 51, -1, -1, -1, -1, 362, 388, -1, 390, 391, - -1, 387, -1, 389, -1, -1, -1, 202, -1, -1, - 387, 206, 389, -1, 202, -1, -1, -1, 206, -1, - 387, -1, 389, -1, -1, 220, 221, 222, -1, -1, - 225, -1, 220, 221, 222, -1, 279, 225, -1, -1, - -1, 433, 285, 429, -1, -1, 432, -1, -1, -1, - -1, -1, 429, -1, 431, 432, -1, 157, -1, -1, - -1, -1, 429, -1, 431, 432, 452, 453, -1, -1, - -1, 39, 40, -1, 42, 452, 453, -1, 46, 47, - 48, 49, 50, 51, 279, 452, 453, 55, -1, 157, - 285, 279, 39, 40, -1, 42, 157, 285, -1, 46, - -1, -1, 202, -1, -1, -1, 206, -1, 55, -1, - -1, 58, -1, -1, -1, -1, -1, -1, -1, 362, - 220, 221, 222, 39, 40, 225, 42, -1, 96, 97, - 46, -1, 100, 101, 202, -1, -1, -1, 206, 55, - -1, 202, 58, -1, 387, 206, 389, -1, -1, 96, - 97, -1, 220, 221, 222, -1, -1, 225, -1, 220, - 221, 222, 39, 40, 225, 42, -1, 362, -1, 46, - 47, 48, 49, 50, 362, -1, -1, -1, 55, 279, - 96, 97, -1, -1, -1, 285, 429, -1, 431, 432, - -1, -1, 387, -1, 389, -1, -1, 39, 40, 387, - 42, 389, -1, -1, 46, 47, 48, 49, 50, 452, - 453, 279, -1, 55, -1, -1, -1, 285, 279, 96, - 97, 63, 64, -1, 285, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 429, -1, 431, 432, -1, -1, - -1, 429, -1, 431, 432, 17, 18, -1, 20, 21, - -1, -1, -1, -1, 96, 97, -1, 452, 453, -1, - -1, -1, 362, -1, 452, 453, -1, 39, 40, -1, - 42, -1, -1, -1, 46, -1, -1, 39, 40, -1, - 42, -1, -1, 55, 46, -1, 58, 387, -1, 389, - -1, 63, 64, 55, 362, -1, 58, -1, -1, -1, - -1, 362, -1, -1, -1, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, -1, -1, -1, 387, - -1, 389, -1, -1, 96, 97, 387, -1, 389, 429, - -1, 431, 432, -1, 96, 97, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, 452, 453, 69, 70, 71, 72, 73, 74, - -1, 429, -1, 431, 432, -1, -1, -1, 429, -1, - 431, 432, -1, 88, 89, 90, 91, 92, 93, 94, - 95, -1, 11, -1, 452, 453, -1, -1, -1, -1, - 19, 452, 453, 22, 23, -1, 25, 26, 27, 28, - -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, -1, 42, -1, -1, -1, 46, 47, 48, - 49, 50, -1, -1, 53, 54, 55, -1, -1, -1, - -1, -1, -1, -1, 63, 64, -1, -1, -1, -1, - -1, 39, 40, -1, 42, -1, 39, 40, 46, 42, - -1, -1, -1, 46, -1, -1, -1, 55, 11, -1, - 58, -1, 55, -1, -1, 58, 19, 96, 97, 22, - 23, -1, 25, 26, 27, 28, -1, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, -1, 42, - -1, -1, -1, 46, 47, 48, 49, 50, 96, 97, - 53, 54, 55, 96, 97, -1, -1, -1, -1, -1, - 63, 64, 12, -1, -1, -1, -1, -1, -1, 19, - -1, -1, 22, 23, -1, 25, 26, 27, 28, -1, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, -1, 42, 96, 97, 16, 46, 47, 48, 49, - 50, -1, -1, 53, -1, 55, -1, -1, -1, -1, - -1, -1, -1, 63, 64, -1, -1, -1, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, -1, -1, -1, 55, 56, -1, -1, 59, -1, - -1, 39, 40, -1, 42, -1, 96, 97, 46, -1, - -1, -1, -1, -1, 75, 76, -1, 55, 16, -1, - 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 92, -1, -1, 95, 96, 97, 98, 99, 100, - 101, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, -1, -1, -1, 55, 96, 97, - -1, 59, -1, 61, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 75, 76, -1, - -1, 16, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 92, -1, -1, 95, 96, 97, - 98, 99, 100, 101, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 56, -1, -1, - 55, -1, -1, 62, 59, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - 75, 76, -1, -1, 16, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 92, -1, -1, - 95, 96, 97, 98, 99, 100, 101, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 56, -1, -1, 55, -1, -1, 62, 59, -1, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, -1, - -1, -1, -1, 75, 76, -1, -1, -1, -1, -1, - -1, -1, 88, 89, 90, 91, 92, 93, 94, 95, - 92, -1, -1, 95, 96, 97, 98, 99, 100, 101, - 19, -1, -1, 22, 23, -1, 25, 26, 27, 28, - -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, -1, 42, -1, -1, -1, 46, 47, 48, - 49, 50, -1, -1, 53, -1, 55, -1, -1, -1, - -1, -1, -1, -1, 63, 64, 39, 40, -1, 42, - -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, - -1, -1, 55, -1, -1, 58, -1, -1, -1, -1, - 63, 64, -1, -1, -1, -1, -1, 96, 97, -1, - -1, -1, -1, -1, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 52, -1, -1, -1, -1, - 57, -1, -1, 96, 97, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 52, - -1, -1, -1, -1, 57, -1, -1, -1, -1, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 52, -1, -1, -1, -1, 57, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 52, -1, -1, - -1, -1, 57, -1, -1, -1, -1, 62, -1, -1, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 52, -1, 88, 89, 90, 91, 92, 93, 94, - 95, 62, -1, -1, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, -1, 88, 89, 90, - 91, 92, 93, 94, 95, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 52, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 52, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 62, -1, -1, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 52, -1, 88, 89, 90, 91, 92, 93, 94, - 95, 62, -1, -1, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, -1, 88, 89, 90, - 91, 92, 93, 94, 95, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 52, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 57, -1, -1, - -1, -1, 62, -1, -1, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 88, 89, - 90, 91, 92, 93, 94, 95, 60, -1, 62, -1, - -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 88, 89, 90, 91, 92, 93, - 94, 95, 61, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 61, 62, -1, - -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 88, 89, 90, 91, 92, 93, - 94, 95, 61, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 62, -1, -1, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 88, - 89, 90, 91, 92, 93, 94, 95, -1, -1, -1, - -1, -1, 88, 89, 90, 91, 92, 93, 94, 95, - 65, 66, -1, 68, 69, 70, 71, 72, 73, 74, - 65, 66, -1, -1, 69, 70, 71, 72, 73, 74, - -1, -1, -1, 88, 89, 90, 91, 92, 93, 94, - 95, -1, -1, -1, 89, 90, 91, 92, 93, 94, - 95, 65, 66, -1, -1, 69, 70, 71, 72, 73, - 74, 65, 66, -1, -1, -1, -1, 71, 72, 73, - 74, -1, -1, -1, -1, 89, -1, 91, 92, 93, - 94, 95, -1, -1, -1, -1, -1, 91, 92, 93, - 94, 95 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 46, 97, 113, 114, - 115, 116, 117, 118, 119, 120, 189, 96, 97, 190, - 190, 51, 0, 115, 116, 117, 51, 77, 61, 61, - 98, 192, 167, 189, 16, 39, 40, 41, 42, 43, - 44, 45, 47, 48, 49, 50, 51, 55, 59, 75, - 76, 92, 95, 97, 99, 100, 101, 151, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 170, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 52, 52, 57, 55, 189, 190, 55, - 189, 190, 55, 151, 55, 56, 151, 168, 169, 189, - 151, 151, 51, 55, 100, 101, 162, 163, 174, 175, - 177, 178, 182, 183, 184, 185, 189, 190, 97, 61, - 62, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 88, 89, 90, 91, 92, 93, 94, 95, 55, - 58, 164, 165, 189, 51, 59, 61, 53, 126, 189, - 55, 51, 59, 55, 51, 59, 55, 52, 57, 151, - 57, 56, 151, 55, 58, 59, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 46, 97, 188, 168, - 169, 189, 11, 19, 22, 23, 25, 26, 27, 28, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 54, - 55, 63, 64, 121, 122, 124, 125, 126, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 153, 154, 155, 162, 163, 171, 174, 175, 178, - 189, 151, 168, 189, 151, 168, 189, 151, 151, 56, - 151, 151, 189, 60, 56, 52, 51, 12, 121, 123, - 151, 61, 51, 121, 51, 51, 51, 51, 92, 192, - 195, 60, 61, 61, 61, 151, 61, 51, 51, 55, - 172, 173, 174, 175, 189, 178, 178, 54, 122, 61, - 61, 61, 61, 61, 77, 17, 18, 20, 21, 63, - 64, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 56, 52, 51, 56, 52, 51, 56, 57, - 56, 151, 168, 12, 121, 61, 151, 26, 151, 127, - 153, 154, 155, 178, 189, 151, 60, 60, 61, 168, - 168, 56, 57, 151, 51, 51, 51, 51, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 56, - 168, 56, 168, 56, 151, 51, 52, 52, 51, 52, - 61, 29, 57, 52, 52, 52, 173, 151, 151, 151, - 151, 51, 52, 51, 52, 51, 52, 168, 121, 151, - 121, 151, 152, 151, 189, 126, 61, 61, 52, 52, - 57, 52, 57, 52, 57, 168, 168, 168, 52, 24, - 52, 61, 52, 29, 61, 61, 169, 61, 169, 61, - 169, 52, 52, 52, 121, 61, 127, 121, 151, 52, - 52, 52, 52, 52, 61, 61, 61, 121, 121 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 112, 113, 113, 114, 114, 114, 114, 114, 114, - 115, 116, 117, 117, 117, 117, 117, 118, 119, 120, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 122, 122, 123, 123, 124, 124, - 125, 125, 126, 126, 127, 127, 127, 127, 128, 128, - 129, 129, 129, 130, 131, 131, 132, 133, 133, 134, - 134, 135, 136, 137, 138, 139, 140, 141, 141, 142, - 143, 143, 144, 145, 146, 147, 147, 148, 149, 150, - 151, 151, 151, 152, 152, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 154, 154, 155, - 155, 156, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 159, 160, - 160, 160, 160, 161, 162, 162, 163, 163, 164, 164, - 164, 164, 164, 164, 165, 165, 165, 165, 166, 167, - 167, 167, 168, 168, 169, 169, 170, 170, 171, 172, - 172, 173, 173, 173, 174, 175, 176, 177, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 189, 190, - 190, 191, 192, 193, 194, 194, 195, 195, 196, 197 - }; - - 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, 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, 2, 2, - 2, 2, 2, 2, 1, 1, 2, 2, 4, 6, - 5, 7, 5, 7, 8, 9, 9, 9, 3, 3, - 1, 0, 1, 0, 3, 1, 2, 3, 3, 3, - 1, 1, 1, 1, 4, 3, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, - 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 7, 2, 1, 2, 1, 1, 1 - }; - - - - -#if IW6CDEBUG - const short - parser::yyrline_[] = - { - 0, 261, 261, 262, 266, 268, 270, 272, 274, 276, - 281, 285, 290, 291, 292, 293, 294, 298, 303, 308, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 340, 341, 345, 347, 352, 354, - 359, 360, 364, 365, 369, 371, 373, 376, 380, 382, - 387, 389, 391, 396, 401, 403, 408, 413, 415, 420, - 422, 427, 432, 437, 442, 447, 452, 457, 459, 464, - 469, 471, 476, 481, 486, 491, 493, 498, 503, 508, - 513, 514, 515, 519, 520, 524, 526, 528, 530, 532, - 534, 536, 538, 540, 542, 544, 546, 551, 553, 558, - 560, 565, 570, 572, 574, 576, 578, 580, 582, 584, - 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, - 629, 630, 631, 632, 633, 634, 635, 636, 640, 645, - 647, 649, 651, 656, 661, 662, 665, 666, 670, 672, - 674, 676, 678, 680, 685, 687, 689, 691, 696, 701, - 703, 706, 710, 713, 717, 719, 724, 726, 731, 736, - 738, 743, 744, 745, 749, 754, 759, 764, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 781, 786, 791, - 796, 801, 806, 811, 816, 821, 826, 831, 833, 838, - 840, 845, 850, 855, 860, 862, 867, 869, 874, 879 - }; - - 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 // IW6CDEBUG - - -#line 13 "parser.ypp" -} } } // xsk::gsc::iw6c -#line 4661 "parser.cpp" - -#line 883 "parser.ypp" - - -void xsk::gsc::iw6c::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/src/experimental/iw6c/xsk/parser.hpp b/src/experimental/iw6c/xsk/parser.hpp deleted file mode 100644 index fd5fecb9..00000000 --- a/src/experimental/iw6c/xsk/parser.hpp +++ /dev/null @@ -1,5550 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// 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::gsc::iw6c::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_IW6C_PARSER_HPP_INCLUDED -# define YY_IW6C_PARSER_HPP_INCLUDED -// "%code requires" blocks. -#line 28 "parser.ypp" - -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw6c.hpp" -namespace xsk::gsc::iw6c { class lexer; } - -#line 58 "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 IW6C_ASSERT -# include -# define IW6C_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 - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# 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 IW6CDEBUG -# if defined YYDEBUG -#if YYDEBUG -# define IW6CDEBUG 1 -# else -# define IW6CDEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define IW6CDEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined IW6CDEBUG */ - -#line 13 "parser.ypp" -namespace xsk { namespace gsc { namespace iw6c { -#line 207 "parser.hpp" - - - - - /// A Bison parser. - class parser - { - public: -#ifdef IW6CSTYPE -# ifdef __GNUC__ -# pragma GCC message "bison: do not #define IW6CSTYPE in C++, use %define api.value.type" -# endif - typedef IW6CSTYPE value_type; -#else - /// 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 value_type - { - public: - /// Type of *this. - typedef value_type self_type; - - /// Empty construction. - value_type () YY_NOEXCEPT - : yyraw_ () - , yytypeid_ (YY_NULLPTR) - {} - - /// Construct and fill. - template - value_type (YY_RVREF (T) t) - : yytypeid_ (&typeid (T)) - { - IW6C_ASSERT (sizeof (T) <= size); - new (yyas_ ()) T (YY_MOVE (t)); - } - -#if 201103L <= YY_CPLUSPLUS - /// Non copyable. - value_type (const self_type&) = delete; - /// Non copyable. - self_type& operator= (const self_type&) = delete; -#endif - - /// Destruction, allowed only if empty. - ~value_type () YY_NOEXCEPT - { - IW6C_ASSERT (!yytypeid_); - } - -# if 201103L <= YY_CPLUSPLUS - /// Instantiate a \a T in here from \a t. - template - T& - emplace (U&&... u) - { - IW6C_ASSERT (!yytypeid_); - IW6C_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 () - { - IW6C_ASSERT (!yytypeid_); - IW6C_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) - { - IW6C_ASSERT (!yytypeid_); - IW6C_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 - { - IW6C_ASSERT (yytypeid_); - IW6C_ASSERT (*yytypeid_ == typeid (T)); - IW6C_ASSERT (sizeof (T) <= size); - return *yyas_ (); - } - - /// Const accessor to a built \a T (for %printer). - template - const T& - as () const YY_NOEXCEPT - { - IW6C_ASSERT (yytypeid_); - IW6C_ASSERT (*yytypeid_ == typeid (T)); - IW6C_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 - { - IW6C_ASSERT (yytypeid_); - IW6C_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. - value_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 = yyraw_; - return static_cast (yyp); - } - - /// Const accessor to raw memory as \a T. - template - const T* - yyas_ () const YY_NOEXCEPT - { - const void *yyp = 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_tuple - // expr_tuple_types - // expr_object - char dummy6[sizeof (ast::expr)]; - - // expr_add_array - char dummy7[sizeof (ast::expr_add_array::ptr)]; - - // expr_anim - char dummy8[sizeof (ast::expr_anim::ptr)]; - - // expr_animation - char dummy9[sizeof (ast::expr_animation::ptr)]; - - // expr_animtree - char dummy10[sizeof (ast::expr_animtree::ptr)]; - - // expr_arguments - // expr_arguments_no_empty - char dummy11[sizeof (ast::expr_arguments::ptr)]; - - // expr_array - char dummy12[sizeof (ast::expr_array::ptr)]; - - // expr_call - char dummy13[sizeof (ast::expr_call::ptr)]; - - // expr_complement - char dummy14[sizeof (ast::expr_complement::ptr)]; - - // expr_empty_array - char dummy15[sizeof (ast::expr_empty_array::ptr)]; - - // expr_false - char dummy16[sizeof (ast::expr_false::ptr)]; - - // expr_field - char dummy17[sizeof (ast::expr_field::ptr)]; - - // expr_float - char dummy18[sizeof (ast::expr_float::ptr)]; - - // expr_game - char dummy19[sizeof (ast::expr_game::ptr)]; - - // expr_identifier_nosize - // expr_identifier - char dummy20[sizeof (ast::expr_identifier::ptr)]; - - // expr_integer - char dummy21[sizeof (ast::expr_integer::ptr)]; - - // expr_istring - char dummy22[sizeof (ast::expr_istring::ptr)]; - - // expr_level - char dummy23[sizeof (ast::expr_level::ptr)]; - - // expr_method - char dummy24[sizeof (ast::expr_method::ptr)]; - - // expr_negate - char dummy25[sizeof (ast::expr_negate::ptr)]; - - // expr_not - char dummy26[sizeof (ast::expr_not::ptr)]; - - // expr_parameters - char dummy27[sizeof (ast::expr_parameters::ptr)]; - - // expr_paren - char dummy28[sizeof (ast::expr_paren::ptr)]; - - // expr_path - char dummy29[sizeof (ast::expr_path::ptr)]; - - // expr_reference - char dummy30[sizeof (ast::expr_reference::ptr)]; - - // expr_self - char dummy31[sizeof (ast::expr_self::ptr)]; - - // expr_size - char dummy32[sizeof (ast::expr_size::ptr)]; - - // expr_string - char dummy33[sizeof (ast::expr_string::ptr)]; - - // expr_thisthread - char dummy34[sizeof (ast::expr_thisthread::ptr)]; - - // expr_true - char dummy35[sizeof (ast::expr_true::ptr)]; - - // expr_tuple_arguments - char dummy36[sizeof (ast::expr_tuple::ptr)]; - - // expr_undefined - char dummy37[sizeof (ast::expr_undefined::ptr)]; - - // expr_vector - char dummy38[sizeof (ast::expr_vector::ptr)]; - - // include - char dummy39[sizeof (ast::include::ptr)]; - - // program - char dummy40[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy41[sizeof (ast::stmt)]; - - // stmt_assign - char dummy42[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy43[sizeof (ast::stmt_break::ptr)]; - - // stmt_breakpoint - char dummy44[sizeof (ast::stmt_breakpoint::ptr)]; - - // stmt_call - char dummy45[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy46[sizeof (ast::stmt_case::ptr)]; - - // stmt_continue - char dummy47[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy48[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy49[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy50[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy51[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy52[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy53[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy54[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy55[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy56[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy57[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy58[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy59[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy60[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy61[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy62[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy63[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waittill - char dummy64[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy65[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy66[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy67[sizeof (ast::stmt_while::ptr)]; - - // "path" - // "identifier" - // "string literal" - // "localized string" - // "float" - // "integer" - char dummy68[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]; - }; - - /// Whether the content is built: if defined, the name of the stored type. - const std::type_info *yytypeid_; - }; - -#endif - /// Backward compatibility (Bison 3.8). - typedef value_type semantic_type; - - /// Symbol locations. - typedef xsk::gsc::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 - { - IW6CEMPTY = -2, - IW6CEOF = 0, // "end of file" - IW6Cerror = 1, // error - IW6CUNDEF = 2, // "invalid token" - SH_DEFINE = 3, // "#define" - SH_UNDEF = 4, // "#undef" - SH_IFDEF = 5, // "#ifdef" - SH_IFNDEF = 6, // "#ifndef" - SH_IF = 7, // "#if" - SH_ELIF = 8, // "#elif" - SH_ELSE = 9, // "#else" - SH_ENDIF = 10, // "#endif" - DEVBEGIN = 11, // "/#" - DEVEND = 12, // "#/" - INLINE = 13, // "#inline" - INCLUDE = 14, // "#include" - USINGTREE = 15, // "#using_animtree" - ANIMTREE = 16, // "#animtree" - ENDON = 17, // "endon" - NOTIFY = 18, // "notify" - WAIT = 19, // "wait" - WAITTILL = 20, // "waittill" - WAITTILLMATCH = 21, // "waittillmatch" - WAITTILLFRAMEEND = 22, // "waittillframeend" - IF = 23, // "if" - ELSE = 24, // "else" - DO = 25, // "do" - WHILE = 26, // "while" - FOR = 27, // "for" - FOREACH = 28, // "foreach" - IN = 29, // "in" - SWITCH = 30, // "switch" - CASE = 31, // "case" - DEFAULT = 32, // "default" - BREAK = 33, // "break" - CONTINUE = 34, // "continue" - RETURN = 35, // "return" - BREAKPOINT = 36, // "breakpoint" - PROFBEGIN = 37, // "prof_begin" - PROFEND = 38, // "prof_end" - THREAD = 39, // "thread" - CHILDTHREAD = 40, // "childthread" - THISTHREAD = 41, // "thisthread" - CALL = 42, // "call" - TRUE = 43, // "true" - FALSE = 44, // "false" - UNDEFINED = 45, // "undefined" - SIZE = 46, // "size" - GAME = 47, // "game" - SELF = 48, // "self" - ANIM = 49, // "anim" - LEVEL = 50, // "level" - LPAREN = 51, // "(" - RPAREN = 52, // ")" - LBRACE = 53, // "{" - RBRACE = 54, // "}" - LBRACKET = 55, // "[" - RBRACKET = 56, // "]" - COMMA = 57, // "," - DOT = 58, // "." - DOUBLECOLON = 59, // "::" - COLON = 60, // ":" - SEMICOLON = 61, // ";" - QMARK = 62, // "?" - INCREMENT = 63, // "++" - DECREMENT = 64, // "--" - LSHIFT = 65, // "<<" - RSHIFT = 66, // ">>" - OR = 67, // "||" - AND = 68, // "&&" - EQUALITY = 69, // "==" - INEQUALITY = 70, // "!=" - LESS_EQUAL = 71, // "<=" - GREATER_EQUAL = 72, // ">=" - LESS = 73, // "<" - GREATER = 74, // ">" - NOT = 75, // "!" - COMPLEMENT = 76, // "~" - ASSIGN = 77, // "=" - ASSIGN_ADD = 78, // "+=" - ASSIGN_SUB = 79, // "-=" - ASSIGN_MUL = 80, // "*=" - ASSIGN_DIV = 81, // "/=" - ASSIGN_MOD = 82, // "%=" - ASSIGN_BW_OR = 83, // "|=" - ASSIGN_BW_AND = 84, // "&=" - ASSIGN_BW_EXOR = 85, // "^=" - ASSIGN_RSHIFT = 86, // ">>=" - ASSIGN_LSHIFT = 87, // "<<=" - BITWISE_OR = 88, // "|" - BITWISE_AND = 89, // "&" - BITWISE_EXOR = 90, // "^" - ADD = 91, // "+" - SUB = 92, // "-" - MUL = 93, // "*" - DIV = 94, // "/" - MOD = 95, // "%" - PATH = 96, // "path" - IDENTIFIER = 97, // "identifier" - STRING = 98, // "string literal" - ISTRING = 99, // "localized string" - FLOAT = 100, // "float" - INTEGER = 101, // "integer" - SIZEOF = 102, // SIZEOF - ADD_ARRAY = 103, // ADD_ARRAY - THEN = 104, // THEN - TERN = 105, // TERN - NEG = 106, // NEG - ANIMREF = 107, // ANIMREF - PREINC = 108, // PREINC - PREDEC = 109, // PREDEC - POSTINC = 110, // POSTINC - POSTDEC = 111 // POSTDEC - }; - /// Backward compatibility alias (Bison 3.6). - typedef token_kind_type yytokentype; - }; - - /// Token kind, as returned by yylex. - typedef token::token_kind_type 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 = 112, ///< Number of tokens. - S_YYEMPTY = -2, - S_YYEOF = 0, // "end of file" - S_YYerror = 1, // error - S_YYUNDEF = 2, // "invalid token" - S_SH_DEFINE = 3, // "#define" - S_SH_UNDEF = 4, // "#undef" - S_SH_IFDEF = 5, // "#ifdef" - S_SH_IFNDEF = 6, // "#ifndef" - S_SH_IF = 7, // "#if" - S_SH_ELIF = 8, // "#elif" - S_SH_ELSE = 9, // "#else" - S_SH_ENDIF = 10, // "#endif" - S_DEVBEGIN = 11, // "/#" - S_DEVEND = 12, // "#/" - S_INLINE = 13, // "#inline" - S_INCLUDE = 14, // "#include" - S_USINGTREE = 15, // "#using_animtree" - S_ANIMTREE = 16, // "#animtree" - S_ENDON = 17, // "endon" - S_NOTIFY = 18, // "notify" - S_WAIT = 19, // "wait" - S_WAITTILL = 20, // "waittill" - S_WAITTILLMATCH = 21, // "waittillmatch" - S_WAITTILLFRAMEEND = 22, // "waittillframeend" - S_IF = 23, // "if" - S_ELSE = 24, // "else" - S_DO = 25, // "do" - S_WHILE = 26, // "while" - S_FOR = 27, // "for" - S_FOREACH = 28, // "foreach" - S_IN = 29, // "in" - S_SWITCH = 30, // "switch" - S_CASE = 31, // "case" - S_DEFAULT = 32, // "default" - S_BREAK = 33, // "break" - S_CONTINUE = 34, // "continue" - S_RETURN = 35, // "return" - S_BREAKPOINT = 36, // "breakpoint" - S_PROFBEGIN = 37, // "prof_begin" - S_PROFEND = 38, // "prof_end" - S_THREAD = 39, // "thread" - S_CHILDTHREAD = 40, // "childthread" - S_THISTHREAD = 41, // "thisthread" - S_CALL = 42, // "call" - S_TRUE = 43, // "true" - S_FALSE = 44, // "false" - S_UNDEFINED = 45, // "undefined" - S_SIZE = 46, // "size" - S_GAME = 47, // "game" - S_SELF = 48, // "self" - S_ANIM = 49, // "anim" - S_LEVEL = 50, // "level" - S_LPAREN = 51, // "(" - S_RPAREN = 52, // ")" - S_LBRACE = 53, // "{" - S_RBRACE = 54, // "}" - S_LBRACKET = 55, // "[" - S_RBRACKET = 56, // "]" - S_COMMA = 57, // "," - S_DOT = 58, // "." - S_DOUBLECOLON = 59, // "::" - S_COLON = 60, // ":" - S_SEMICOLON = 61, // ";" - S_QMARK = 62, // "?" - S_INCREMENT = 63, // "++" - S_DECREMENT = 64, // "--" - S_LSHIFT = 65, // "<<" - S_RSHIFT = 66, // ">>" - S_OR = 67, // "||" - S_AND = 68, // "&&" - S_EQUALITY = 69, // "==" - S_INEQUALITY = 70, // "!=" - S_LESS_EQUAL = 71, // "<=" - S_GREATER_EQUAL = 72, // ">=" - S_LESS = 73, // "<" - S_GREATER = 74, // ">" - S_NOT = 75, // "!" - S_COMPLEMENT = 76, // "~" - S_ASSIGN = 77, // "=" - S_ASSIGN_ADD = 78, // "+=" - S_ASSIGN_SUB = 79, // "-=" - S_ASSIGN_MUL = 80, // "*=" - S_ASSIGN_DIV = 81, // "/=" - S_ASSIGN_MOD = 82, // "%=" - S_ASSIGN_BW_OR = 83, // "|=" - S_ASSIGN_BW_AND = 84, // "&=" - S_ASSIGN_BW_EXOR = 85, // "^=" - S_ASSIGN_RSHIFT = 86, // ">>=" - S_ASSIGN_LSHIFT = 87, // "<<=" - S_BITWISE_OR = 88, // "|" - S_BITWISE_AND = 89, // "&" - S_BITWISE_EXOR = 90, // "^" - S_ADD = 91, // "+" - S_SUB = 92, // "-" - S_MUL = 93, // "*" - S_DIV = 94, // "/" - S_MOD = 95, // "%" - S_PATH = 96, // "path" - S_IDENTIFIER = 97, // "identifier" - S_STRING = 98, // "string literal" - S_ISTRING = 99, // "localized string" - S_FLOAT = 100, // "float" - S_INTEGER = 101, // "integer" - S_SIZEOF = 102, // SIZEOF - S_ADD_ARRAY = 103, // ADD_ARRAY - S_THEN = 104, // THEN - S_TERN = 105, // TERN - S_NEG = 106, // NEG - S_ANIMREF = 107, // ANIMREF - S_PREINC = 108, // PREINC - S_PREDEC = 109, // PREDEC - S_POSTINC = 110, // POSTINC - S_POSTDEC = 111, // POSTDEC - S_YYACCEPT = 112, // $accept - S_root = 113, // root - S_program = 114, // program - S_inline = 115, // inline - S_include = 116, // include - S_declaration = 117, // declaration - S_decl_usingtree = 118, // decl_usingtree - S_decl_constant = 119, // decl_constant - S_decl_thread = 120, // decl_thread - S_stmt = 121, // stmt - S_stmt_or_dev = 122, // stmt_or_dev - S_stmt_list = 123, // stmt_list - S_stmt_or_dev_list = 124, // stmt_or_dev_list - S_stmt_dev = 125, // stmt_dev - S_stmt_block = 126, // stmt_block - S_stmt_expr = 127, // stmt_expr - S_stmt_call = 128, // stmt_call - S_stmt_assign = 129, // stmt_assign - S_stmt_endon = 130, // stmt_endon - S_stmt_notify = 131, // stmt_notify - S_stmt_wait = 132, // stmt_wait - S_stmt_waittill = 133, // stmt_waittill - S_stmt_waittillmatch = 134, // stmt_waittillmatch - S_stmt_waittillframeend = 135, // stmt_waittillframeend - S_stmt_if = 136, // stmt_if - S_stmt_ifelse = 137, // stmt_ifelse - S_stmt_while = 138, // stmt_while - S_stmt_dowhile = 139, // stmt_dowhile - S_stmt_for = 140, // stmt_for - S_stmt_foreach = 141, // stmt_foreach - S_stmt_switch = 142, // stmt_switch - S_stmt_case = 143, // stmt_case - S_stmt_default = 144, // stmt_default - S_stmt_break = 145, // stmt_break - S_stmt_continue = 146, // stmt_continue - S_stmt_return = 147, // stmt_return - S_stmt_breakpoint = 148, // stmt_breakpoint - S_stmt_prof_begin = 149, // stmt_prof_begin - S_stmt_prof_end = 150, // stmt_prof_end - S_expr = 151, // expr - S_expr_or_empty = 152, // expr_or_empty - S_expr_assign = 153, // expr_assign - S_expr_increment = 154, // expr_increment - S_expr_decrement = 155, // expr_decrement - S_expr_ternary = 156, // expr_ternary - S_expr_binary = 157, // expr_binary - S_expr_primitive = 158, // expr_primitive - S_expr_complement = 159, // expr_complement - S_expr_negate = 160, // expr_negate - S_expr_not = 161, // expr_not - S_expr_call = 162, // expr_call - S_expr_method = 163, // expr_method - S_expr_function = 164, // expr_function - S_expr_pointer = 165, // expr_pointer - S_expr_add_array = 166, // expr_add_array - S_expr_parameters = 167, // expr_parameters - S_expr_arguments = 168, // expr_arguments - S_expr_arguments_no_empty = 169, // expr_arguments_no_empty - S_expr_reference = 170, // expr_reference - S_expr_tuple = 171, // expr_tuple - S_expr_tuple_arguments = 172, // expr_tuple_arguments - S_expr_tuple_types = 173, // expr_tuple_types - S_expr_array = 174, // expr_array - S_expr_field = 175, // expr_field - S_expr_size = 176, // expr_size - S_expr_paren = 177, // expr_paren - S_expr_object = 178, // expr_object - S_expr_thisthread = 179, // expr_thisthread - S_expr_empty_array = 180, // expr_empty_array - S_expr_undefined = 181, // expr_undefined - S_expr_game = 182, // expr_game - S_expr_self = 183, // expr_self - S_expr_anim = 184, // expr_anim - S_expr_level = 185, // expr_level - S_expr_animation = 186, // expr_animation - S_expr_animtree = 187, // expr_animtree - S_expr_identifier_nosize = 188, // expr_identifier_nosize - S_expr_identifier = 189, // expr_identifier - S_expr_path = 190, // expr_path - S_expr_istring = 191, // expr_istring - S_expr_string = 192, // expr_string - S_expr_vector = 193, // expr_vector - S_expr_float = 194, // expr_float - S_expr_integer = 195, // expr_integer - S_expr_false = 196, // expr_false - S_expr_true = 197 // 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 () YY_NOEXCEPT - : 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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_add_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_add_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_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_animtree::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_animtree::ptr& v, const location_type& l) - : 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_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_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_negate::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l) - : 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_thisthread::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_thisthread::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_tuple::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_tuple::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::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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.template destroy< ast::expr_add_array::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_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.template destroy< ast::expr_negate::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_thisthread: // expr_thisthread - value.template destroy< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.template destroy< ast::expr_tuple::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_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_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_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. - value_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 - { - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; - - /// Default constructor. - by_kind () YY_NOEXCEPT; - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that) YY_NOEXCEPT; -#endif - - /// Copy constructor. - by_kind (const by_kind& that) YY_NOEXCEPT; - - /// Constructor from (external) token numbers. - by_kind (kind_type t) YY_NOEXCEPT; - - - - /// 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 () YY_NOEXCEPT {} - - /// Constructor for valueless symbols, and symbols from each type. -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, location_type l) - : super_type (token_kind_type (tok), std::move (l)) -#else - symbol_type (int tok, const location_type& l) - : super_type (token_kind_type (tok), l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - IW6C_ASSERT (tok == token::IW6CEOF - || (token::IW6Cerror <= tok && tok <= token::MOD) - || (token::SIZEOF <= tok && tok <= token::POSTDEC)); -#endif - } -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, std::string v, location_type l) - : super_type (token_kind_type (tok), std::move (v), std::move (l)) -#else - symbol_type (int tok, const std::string& v, const location_type& l) - : super_type (token_kind_type (tok), v, l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - IW6C_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); -#endif - } - }; - - /// Build a parser object. - parser (xsk::gsc::iw6c::lexer& lexer_yyarg, xsk::gsc::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 IW6CDEBUG - /// 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 token kind. -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW6CEOF (location_type l) - { - return symbol_type (token::IW6CEOF, std::move (l)); - } -#else - static - symbol_type - make_IW6CEOF (const location_type& l) - { - return symbol_type (token::IW6CEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW6Cerror (location_type l) - { - return symbol_type (token::IW6Cerror, std::move (l)); - } -#else - static - symbol_type - make_IW6Cerror (const location_type& l) - { - return symbol_type (token::IW6Cerror, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW6CUNDEF (location_type l) - { - return symbol_type (token::IW6CUNDEF, std::move (l)); - } -#else - static - symbol_type - make_IW6CUNDEF (const location_type& l) - { - return symbol_type (token::IW6CUNDEF, 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_ANIMTREE (location_type l) - { - return symbol_type (token::ANIMTREE, std::move (l)); - } -#else - static - symbol_type - make_ANIMTREE (const location_type& l) - { - return symbol_type (token::ANIMTREE, 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_CHILDTHREAD (location_type l) - { - return symbol_type (token::CHILDTHREAD, std::move (l)); - } -#else - static - symbol_type - make_CHILDTHREAD (const location_type& l) - { - return symbol_type (token::CHILDTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_THISTHREAD (location_type l) - { - return symbol_type (token::THISTHREAD, std::move (l)); - } -#else - static - symbol_type - make_THISTHREAD (const location_type& l) - { - return symbol_type (token::THISTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_CALL (location_type l) - { - return symbol_type (token::CALL, std::move (l)); - } -#else - static - symbol_type - make_CALL (const location_type& l) - { - return symbol_type (token::CALL, 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_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_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_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_SIZEOF (location_type l) - { - return symbol_type (token::SIZEOF, std::move (l)); - } -#else - static - symbol_type - make_SIZEOF (const location_type& l) - { - return symbol_type (token::SIZEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_ADD_ARRAY (location_type l) - { - return symbol_type (token::ADD_ARRAY, std::move (l)); - } -#else - static - symbol_type - make_ADD_ARRAY (const location_type& l) - { - return symbol_type (token::ADD_ARRAY, 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) YY_NOEXCEPT; - - /// 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) YY_NOEXCEPT; - - 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_kind_type enum. - static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; - - - - // 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 symbol kind of the accessing symbol of - // state STATE-NUM. - static const unsigned char yystos_[]; - - // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. - static const unsigned char yyr1_[]; - - // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. - static const signed char yyr2_[]; - - -#if IW6CDEBUG - // 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT; - - /// Constants. - enum - { - yylast_ = 2371, ///< Last index in yytable_. - yynnts_ = 86, ///< Number of nonterminal symbols. - yyfinal_ = 22 ///< Termination state number. - }; - - - // User arguments. - xsk::gsc::iw6c::lexer& lexer; - xsk::gsc::ast::program::ptr& ast; - - }; - - inline - parser::symbol_kind_type - parser::yytranslate_ (int t) YY_NOEXCEPT - { - 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::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_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); - 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_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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 () YY_NOEXCEPT - : kind_ (symbol_kind::S_YYEMPTY) - {} - -#if 201103L <= YY_CPLUSPLUS - inline - parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT - : kind_ (that.kind_) - { - that.clear (); - } -#endif - - inline - parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT - : kind_ (that.kind_) - {} - - inline - parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT - : 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::gsc::iw6c -#line 5546 "parser.hpp" - - - - -#endif // !YY_IW6C_PARSER_HPP_INCLUDED diff --git a/src/experimental/iw6c/xsk/resolver.cpp b/src/experimental/iw6c/xsk/resolver.cpp deleted file mode 100644 index df3247c3..00000000 --- a/src/experimental/iw6c/xsk/resolver.cpp +++ /dev/null @@ -1,486 +0,0 @@ -// 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 "iw6c.hpp" - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - -namespace xsk::gsc::iw6c -{ - -std::unordered_map opcode_map; -std::unordered_map function_map; -std::unordered_map method_map; -std::unordered_map token_map; -std::unordered_map opcode_map_rev; -std::unordered_map function_map_rev; -std::unordered_map method_map_rev; -std::unordered_map token_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_func_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - const auto itr = function_map.find(id); - - if (itr != function_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_meth_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - const auto itr = method_map.find(id); - - if (itr != method_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_id_")) - { - return static_cast(std::stoul(name.substr(4), nullptr, 16)); - } - - const auto itr = token_map_rev.find(name); - - if (itr != token_map_rev.end()) - { - return itr->second; - } - - return 0; -} - -auto resolver::token_name(std::uint16_t id) -> std::string -{ - const auto itr = token_map.find(id); - - if (itr != token_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - } - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - } - - return false; -} - -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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ - "character"sv, - "codescripts"sv, - "common_scripts"sv, - "destructible_scripts"sv, - "maps"sv, - "vehicle_scripts"sv, - "xmodelalias"sv, - "maps/animated_models"sv, - "maps/createart"sv, - "maps/createfx"sv, - "maps/interactive_models"sv, - "maps/mp"sv, - "maps/mp/agents"sv, - "maps/mp/alien"sv, - "maps/mp/bots"sv, - "maps/mp/gametypes"sv, - "maps/mp/killstreaks"sv, - "maps/mp/perks"sv, - "maps/mp/agents/alien"sv, - "maps/mp/agents/dog"sv, - "maps/mp/agents/alien/alien_ancestor"sv, - "maps/mp/agents/alien/alien_kraken"sv, - "maps/mp/agents/alien/alien_spider"sv, -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -const std::array, 153> opcode_list -{{ - { 0x1D, "OP_CastFieldObject" }, - { 0x1E, "OP_SetLocalVariableFieldCached" }, - { 0x1F, "OP_plus" }, - { 0x20, "OP_RemoveLocalVariables" }, - { 0x21, "OP_EvalSelfFieldVariableRef" }, - { 0x22, "OP_ScriptFarMethodChildThreadCall" }, - { 0x23, "OP_GetGameRef" }, - { 0x24, "OP_EvalAnimFieldVariable" }, - { 0x25, "OP_EvalLevelFieldVariableRef" }, - { 0x26, "OP_GetThisthread" }, - { 0x27, "OP_greater" }, - { 0x28, "OP_waittillmatch" }, - { 0x29, "OP_shift_right" }, - { 0x2A, "OP_dec" }, - { 0x2B, "OP_JumpOnTrue" }, - { 0x2C, "OP_bit_or" }, - { 0x2D, "OP_equality" }, - { 0x2E, "OP_ClearLocalVariableFieldCached0" }, - { 0x2F, "OP_notify" }, - { 0x30, "OP_GetVector" }, - { 0x31, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x32, "OP_PreScriptCall" }, - { 0x33, "OP_GetByte" }, - { 0x34, "OP_ScriptFarThreadCall" }, - { 0x35, "OP_SetSelfFieldVariableField" }, - { 0x36, "OP_JumpOnFalseExpr" }, - { 0x37, "OP_GetUndefined" }, - { 0x38, "OP_jumpback" }, - { 0x39, "OP_JumpOnTrueExpr" }, - { 0x3A, "OP_CallBuiltin0" }, - { 0x3B, "OP_CallBuiltin1" }, - { 0x3C, "OP_CallBuiltin2" }, - { 0x3D, "OP_CallBuiltin3" }, - { 0x3E, "OP_CallBuiltin4" }, - { 0x3F, "OP_CallBuiltin5" }, - { 0x40, "OP_CallBuiltin" }, - { 0x41, "OP_SetLocalVariableFieldCached0" }, - { 0x42, "OP_ClearFieldVariable" }, - { 0x43, "OP_GetLevel" }, - { 0x44, "OP_size" }, - { 0x45, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x46, "OP_ScriptLocalMethodThreadCall" }, - { 0x47, "OP_AddArray" }, - { 0x48, "OP_endon" }, - { 0x49, "OP_EvalFieldVariable" }, - { 0x4A, "OP_shift_left" }, - { 0x4B, "OP_EvalLocalArrayRefCached0" }, - { 0x4C, "OP_Return" }, - { 0x4D, "OP_CreateLocalVariable" }, - { 0x4E, "OP_SafeSetVariableFieldCached0" }, - { 0x4F, "OP_GetBuiltinMethod" }, - { 0x50, "OP_ScriptLocalMethodCall" }, - { 0x51, "OP_CallBuiltinMethodPointer" }, - { 0x52, "OP_ScriptLocalChildThreadCall" }, - { 0x53, "OP_GetSelfObject" }, - { 0x54, "OP_GetGame" }, - { 0x55, "OP_SetLevelFieldVariableField" }, - { 0x56, "OP_EvalArray" }, - { 0x57, "OP_GetSelf" }, - { 0x58, "OP_End" }, - { 0x59, "OP_EvalSelfFieldVariable" }, - { 0x5A, "OP_less_equal" }, - { 0x5B, "OP_EvalLocalVariableCached0" }, - { 0x5C, "OP_EvalLocalVariableCached1" }, - { 0x5D, "OP_EvalLocalVariableCached2" }, - { 0x5E, "OP_EvalLocalVariableCached3" }, - { 0x5F, "OP_EvalLocalVariableCached4" }, - { 0x60, "OP_EvalLocalVariableCached5" }, - { 0x61, "OP_EvalLocalVariableCached" }, - { 0x62, "OP_EvalNewLocalArrayRefCached0" }, - { 0x63, "OP_ScriptChildThreadCallPointer" }, - { 0x64, "OP_EvalLocalVariableObjectCached" }, - { 0x65, "OP_ScriptLocalThreadCall" }, - { 0x66, "OP_GetInteger" }, - { 0x67, "OP_ScriptMethodCallPointer" }, - { 0x68, "OP_checkclearparams" }, - { 0x69, "OP_SetAnimFieldVariableField" }, - { 0x6A, "OP_waittillmatch2" }, - { 0x6B, "OP_minus" }, - { 0x6C, "OP_ScriptLocalFunctionCall2" }, - { 0x6D, "OP_GetNegUnsignedShort" }, - { 0x6E, "OP_GetNegByte" }, - { 0x6F, "OP_SafeCreateVariableFieldCached" }, - { 0x70, "OP_greater_equal" }, - { 0x71, "OP_vector" }, - { 0x72, "OP_GetBuiltinFunction" }, - { 0x73, "OP_endswitch" }, - { 0x74, "OP_ClearArray" }, - { 0x75, "OP_DecTop" }, - { 0x76, "OP_CastBool" }, - { 0x77, "OP_EvalArrayRef" }, - { 0x78, "OP_SetNewLocalVariableFieldCached0" }, - { 0x79, "OP_GetZero" }, - { 0x7A, "OP_wait" }, - { 0x7B, "OP_waittill" }, - { 0x7C, "OP_GetIString" }, - { 0x7D, "OP_ScriptFarFunctionCall" }, - { 0x7E, "OP_GetAnimObject" }, - { 0x7F, "OP_GetAnimTree" }, - { 0x80, "OP_EvalLocalArrayCached" }, - { 0x81, "OP_mod" }, - { 0x82, "OP_ScriptFarMethodThreadCall" }, - { 0x83, "OP_GetUnsignedShort" }, - { 0x84, "OP_clearparams" }, - { 0x85, "OP_ScriptMethodThreadCallPointer" }, - { 0x86, "OP_ScriptFunctionCallPointer" }, - { 0x87, "OP_EmptyArray" }, - { 0x88, "OP_SafeSetVariableFieldCached" }, - { 0x89, "OP_UNK_2" }, - { 0x8A, "OP_EvalFieldVariableRef" }, - { 0x8B, "OP_ScriptLocalMethodChildThreadCall" }, - { 0x8C, "OP_UNK_3" }, - { 0x8D, "OP_GetFloat" }, - { 0x8E, "OP_EvalLocalVariableRefCached" }, - { 0x8F, "OP_JumpOnFalse" }, - { 0x90, "OP_BoolComplement" }, - { 0x91, "OP_ScriptThreadCallPointer" }, - { 0x92, "OP_ScriptFarFunctionCall2" }, - { 0x93, "OP_less" }, - { 0x94, "OP_BoolNot" }, - { 0x95, "OP_waittillFrameEnd" }, - { 0x96, "OP_GetString" }, - { 0x97, "OP_EvalLevelFieldVariable" }, - { 0x98, "OP_GetLevelObject" }, - { 0x99, "OP_inc" }, - { 0x9A, "OP_CallBuiltinMethod0" }, - { 0x9B, "OP_CallBuiltinMethod1" }, - { 0x9C, "OP_CallBuiltinMethod2" }, - { 0x9D, "OP_CallBuiltinMethod3" }, - { 0x9E, "OP_CallBuiltinMethod4" }, - { 0x9F, "OP_CallBuiltinMethod5" }, - { 0xA0, "OP_CallBuiltinMethod" }, - { 0xA1, "OP_GetAnim" }, - { 0xA2, "OP_switch" }, - { 0xA3, "OP_SetVariableField" }, - { 0xA4, "OP_divide" }, - { 0xA5, "OP_GetLocalFunction" }, - { 0xA6, "OP_ScriptFarChildThreadCall" }, - { 0xA7, "OP_multiply" }, - { 0xA8, "OP_ClearLocalVariableFieldCached" }, - { 0xA9, "OP_EvalAnimFieldVariableRef" }, - { 0xAA, "OP_EvalLocalArrayRefCached" }, - { 0xAB, "OP_EvalLocalVariableRefCached0" }, - { 0xAC, "OP_bit_and" }, - { 0xAD, "OP_GetAnimation" }, - { 0xAE, "OP_GetFarFunction" }, - { 0xAF, "OP_CallBuiltinPointer" }, - { 0xB0, "OP_jump" }, - { 0xB1, "OP_voidCodepos" }, - { 0xB2, "OP_ScriptFarMethodCall" }, - { 0xB3, "OP_inequality" }, - { 0xB4, "OP_ScriptLocalFunctionCall" }, - { 0xB5, "OP_bit_ex_or" }, -}}; - -const std::array, 3> function_list -{{ - { 0x12, "isdefined" }, - { 0xB7, "getfirstarraykey" }, - { 0xB8, "getnextarraykey" }, -}}; - -const std::array, 0> method_list -{{ -}}; - -const std::array, 0> token_list -{{ -}}; - -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()); - function_map.reserve(function_list.size()); - function_map_rev.reserve(function_list.size()); - method_map.reserve(method_list.size()); - method_map_rev.reserve(method_list.size()); - token_map.reserve(token_list.size()); - token_map_rev.reserve(token_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 : function_list) - { - function_map.insert({ entry.first, entry.second }); - function_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : method_list) - { - method_map.insert({ entry.first, entry.second }); - method_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : token_list) - { - token_map.insert({ entry.first, entry.second }); - token_map_rev.insert({ entry.second, entry.first }); - } - } -}; - -__init__ _; - -} // namespace xsk::gsc::iw6c - -#ifdef _MSC_VER -#pragma warning(pop) -#endif diff --git a/src/experimental/iw6c/xsk/resolver.hpp b/src/experimental/iw6c/xsk/resolver.hpp deleted file mode 100644 index aca7c8eb..00000000 --- a/src/experimental/iw6c/xsk/resolver.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::iw6c -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint16_t; - static auto token_name(std::uint16_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::gsc::iw6c diff --git a/src/experimental/s1c/stdafx.hpp b/src/experimental/s1c/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/experimental/s1c/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/experimental/s1c/xsk/assembler.cpp b/src/experimental/s1c/xsk/assembler.cpp deleted file mode 100644 index 61d879f9..00000000 --- a/src/experimental/s1c/xsk/assembler.cpp +++ /dev/null @@ -1,555 +0,0 @@ -// 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 "s1c.hpp" - -namespace xsk::gsc::s1c -{ - -auto assembler::output_script() -> std::vector -{ - std::vector script; - - if (script_ == nullptr) return script; - - script.resize(script_->pos()); - std::memcpy(script.data(), script_->buffer().data(), script.size()); - - return script; -} - -auto assembler::output_stack() -> std::vector -{ - std::vector stack; - - if (stack_ == nullptr) return stack; - - stack.resize(stack_->pos()); - std::memcpy(stack.data(), stack_->buffer().data(), stack.size()); - - return stack; -} - -void assembler::assemble(const std::string& file, std::vector& data) -{ - std::vector assembly = utils::string::clean_buffer_lines(data); - std::vector functions; - function::ptr func = nullptr; - std::uint32_t index = 1; - std::uint16_t switchnum = 0; - - for (auto& line : assembly) - { - if (line == "" || line.substr(0, 2) == "//") - { - continue; - } - else if (line.substr(0, 4) == "sub_") - { - func = std::make_unique(); - func->index = index; - func->name = line.substr(4); - } - else if (line.substr(0, 4) == "end_") - { - if (func != nullptr) - { - func->size = index - func->index; - functions.push_back(std::move(func)); - } - } - else if (line.substr(0, 4) == "loc_") - { - func->labels[index] = line; - } - else - { - auto opdata = utils::string::parse_code(line); - - if (switchnum) - { - if (opdata[0] == "case" || opdata[0] == "default") - { - for (auto& entry : opdata) - { - func->instructions.back()->data.push_back(entry); - } - switchnum--; - continue; - } - - throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); - } - else - { - auto inst = std::make_unique(); - inst->index = index; - inst->opcode = resolver::opcode_id(opdata[0]); - inst->size = opcode_size(inst->opcode); - opdata.erase(opdata.begin()); - inst->data = std::move(opdata); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = inst->data[0].substr(4); - break; - case opcode::OP_endswitch: - switchnum = static_cast(std::stoi(inst->data[0])); - inst->size += 7 * switchnum; - break; - default: - break; - } - - index += inst->size; - func->instructions.push_back(std::move(inst)); - } - } - } - - assemble(file, functions); -} - -void assembler::assemble(const std::string& file, std::vector& funcs) -{ - script_ = std::make_unique(0x100000); - stack_ = std::make_unique(0x100000); - filename_ = file; - functions_ = std::move(funcs); - - script_->write_endian(static_cast(opcode::OP_End)); - - for (const auto& func : functions_) - { - assemble_function(func); - } -} - -void assembler::assemble_function(const function::ptr& func) -{ - labels_ = func->labels; - - func->id = resolver::token_id(func->name); - - stack_->write_endian(func->size); - stack_->write_endian(static_cast(func->id)); - - if (func->id == 0) - { - stack_->write_c_string(func->name); - } - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write_endian(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - // case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - // case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->write_endian(std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->write_endian(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - inst->size += script_->align(4); - script_->write_endian(std::stof(inst->data[0])); - script_->write_endian(std::stof(inst->data[1])); - script_->write_endian(std::stof(inst->data[2])); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->write_endian(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_GetAnimation: - script_->write_endian(0); - stack_->write_c_string(inst->data[0]); - stack_->write_c_string(inst->data[1]); - break; - case opcode::OP_GetAnimTree: - script_->write_endian(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_waittillmatch: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - assemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - script_->write_endian(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - assemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - assemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - assemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - assemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - assemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - assemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - assemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - assemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - assemble_jump(inst, false, true); - break; - case opcode::OP_jump: - assemble_jump(inst, false, false); - break; - case opcode::OP_switch: - assemble_switch(inst); - break; - case opcode::OP_endswitch: - assemble_end_switch(inst); - break; - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - script_->write_endian(static_cast(std::stoi(inst->data[1]))); - } - - const auto id = method ? resolver::method_id(inst->data[0]) : resolver::function_id(inst->data[0]); - - script_->write_endian(id); -} - -void assembler::assemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto addr = resolve_function(inst->data[0]); - const auto offset = static_cast(addr - inst->index - 1); - - assemble_offset(offset); - - if (thread) - { - script_->write_endian(static_cast(std::stoi(inst->data[1]))); - } -} - -void assembler::assemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->write_endian(0); - script_->write_endian(0); - - if (thread) - { - script_->write_endian(static_cast(std::stoi(inst->data[2]))); - } - - const auto file_id = resolver::token_id(inst->data[0]); - const auto func_id = resolver::token_id(inst->data[1]); - - stack_->write_endian(file_id); - if (file_id == 0) stack_->write_c_string(inst->data[0]); - stack_->write_endian(func_id); - if (func_id == 0) stack_->write_c_string(inst->data[1]); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const auto addr = resolve_label(inst->data[0]); - - script_->write_endian(addr - inst->index - 4); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - - script_->write_endian(static_cast(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_endian((std::stoi(inst->data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); - } - else - { - script_->write_endian(i + 1); - stack_->write_c_string(inst->data[1 + (3 * i) + 1]); - } - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 2]); - - assemble_offset(addr - index); - - index += 3; - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write_endian(0); - stack_->write_c_string("\x01"); - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 1]); - - assemble_offset(addr - index); - - index += 3; - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::assemble_field_variable(const instruction::ptr& inst) -{ - auto id = resolver::token_id(inst->data[0]); - - if (id == 0) id = 0xFFFF; - - script_->write_endian(id); - - if (id > max_string_id) - { - stack_->write_endian(0); - stack_->write_c_string(inst->data[0]); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - const auto addr = resolve_label(inst->data[0]); - - if (expr) - { - script_->write_endian(static_cast(addr - inst->index - 3)); - } - else if (back) - { - script_->write_endian(static_cast((inst->index + 3) - addr)); - } - else - { - script_->write_endian(static_cast(addr - inst->index - 5)); - } -} - -void assembler::assemble_offset(std::int32_t offset) -{ - std::array bytes = {}; - - offset = (offset << 10) >> 8; - - *reinterpret_cast(bytes.data()) = offset; - - script_->write_endian(bytes[2]); - script_->write_endian(bytes[1]); - script_->write_endian(bytes[0]); -} - -auto assembler::resolve_function(const std::string& name) -> std::int32_t -{ - for (const auto& entry : functions_) - { - if (entry->name == name) - { - return entry->index; - } - } - - throw asm_error("couldn't resolve local function address of '" + name + "'!"); -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/assembler.hpp b/src/experimental/s1c/xsk/assembler.hpp deleted file mode 100644 index 4462ad4c..00000000 --- a/src/experimental/s1c/xsk/assembler.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::s1c -{ - -class assembler : public gsc::assembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output_script() -> std::vector; - auto output_stack() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, std::vector& funcs); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void assemble_local_call(const instruction::ptr& inst, bool thread); - void assemble_far_call(const instruction::ptr& inst, bool thread); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void assemble_field_variable(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst, bool expr, bool back); - void assemble_offset(std::int32_t offset); - auto resolve_function(const std::string& name) -> std::int32_t; - auto resolve_label(const std::string& name) -> std::int32_t; -}; - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/compiler.cpp b/src/experimental/s1c/xsk/compiler.cpp deleted file mode 100644 index 1fbc7d64..00000000 --- a/src/experimental/s1c/xsk/compiler.cpp +++ /dev/null @@ -1,2973 +0,0 @@ -// 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 "s1c.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -namespace xsk::gsc::s1c -{ - -auto compiler::output() -> std::vector -{ - return std::move(assembly_); -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "an unknown error ocurred while parsing gsc file"); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_.clear(); - includes_.clear(); - animtrees_.clear(); - constants_.clear(); - local_functions_.clear(); - index_ = 1; - 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& inc : includes_) - { - if (inc.name == path) - { - throw comp_error(include->loc(), "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(), "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 developer block comment"); - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) -{ - const auto itr = constants_.find(constant->name->value); - - if (itr != constants_.end()) - throw comp_error(constant->loc(), "duplicated constant '" + constant->name->value + "'"); - - 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; - - auto blk = std::make_unique(); - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - break_blks_.clear(); - continue_blks_.clear(); - - process_thread(thread, blk); - - emit_expr_parameters(thread->params, blk); - emit_stmt_list(thread->stmt, blk, true); - emit_opcode(opcode::OP_End); - - function_->size = index_ - function_->index; - assembly_.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list, blk, last); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev, blk, last); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend, blk); - break; - case ast::kind::stmt_waitframe: - emit_stmt_waitframe(stmt.as_waitframe, blk); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if, blk, last); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse, blk, last); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case, blk); - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default, blk); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return, blk); - break; - case ast::kind::stmt_breakpoint: - emit_stmt_breakpoint(stmt.as_breakpoint, blk); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin, blk); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end, blk); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last) -{ - for (const auto& entry : stmt->list) - { - bool last_ = (&entry == &stmt->list.back() && last) ? true : false; - emit_stmt(entry, blk, last_); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last) -{ - emit_stmt_list(stmt->list, blk, last); -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - 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, const block::ptr& blk) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, blk, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, blk, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_endon); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } - - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->time, blk); - emit_opcode(opcode::OP_wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittill); - - for (const auto& entry : stmt->args->list) - { - variable_create(entry.as_identifier, blk); - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(entry.as_identifier, blk)); - } - - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - emit_expr_arguments(stmt->args, blk); - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_waittillmatch2); - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waittillFrameEnd); -} - -void compiler::emit_stmt_waitframe(const ast::stmt_waitframe::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waitFrame); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - blk->transfer(stmt->blk); - - emit_stmt(stmt->stmt, stmt->blk, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last) -{ - std::vector childs; - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - blk->transfer(stmt->blk_if); - - emit_stmt(stmt->stmt_if, stmt->blk_if, last); - - emit_remove_local_vars(stmt->blk_if); - - if (stmt->blk_if->abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - - last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - - blk->transfer(stmt->blk_else); - - emit_stmt(stmt->stmt_else, stmt->blk_else, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk_else); - - if (stmt->blk_else->abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - - insert_label(end_loc); - - blk->init_from_child(childs); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_stmt(stmt->init, blk, false); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->blk_iter); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - can_break_ = true; - can_continue_ = true; - - emit_stmt(stmt->stmt, stmt->blk, false); - - if (stmt->blk->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->blk.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->blk_iter->init_from_child(continue_blks_); - - emit_stmt(stmt->iter, stmt->blk_iter, false); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_expr(stmt->array_expr, blk); - emit_expr_variable_ref(stmt->array, blk, true); - emit_expr_variable(stmt->array, blk); - emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); - emit_expr_variable_ref(stmt->key_expr, blk, true); - - blk->transfer(stmt->ctx); - stmt->ctx->loc_break = break_loc; - stmt->ctx->loc_continue = continue_loc; - - emit_create_local_vars(stmt->ctx); - - blk->local_vars_create_count = stmt->ctx->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->ctx_post); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr, blk); - emit_opcode(opcode::OP_CallBuiltin1, "isdefined"); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr, stmt->ctx); - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->array.as_identifier, stmt->ctx)); - emit_expr_variable_ref(stmt->value_expr, stmt->ctx, true); - emit_stmt(stmt->stmt, stmt->ctx, false); - - if (stmt->ctx->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->ctx.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->ctx_post->init_from_child(continue_blks_); - - emit_expr_variable(stmt->key_expr, stmt->ctx_post); - emit_expr_variable(stmt->array, stmt->ctx_post); - emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); - emit_expr_variable_ref(stmt->key_expr, stmt->ctx_post, true); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - emit_expr_clear_local(stmt->array.as_identifier, blk); - if (!stmt->use_key) emit_expr_clear_local(stmt->key_expr.as_identifier, blk); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_break = can_break_; - break_blks_.clear(); - can_break_ = false; - - auto jmptable_loc = create_label(); - auto break_loc = create_label(); - - emit_expr(stmt->test, blk); - 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; - block* default_ctx = nullptr; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - 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"); - } - - blk->transfer(case_->blk); - case_->blk->loc_break = break_loc; - emit_stmt_list(case_->stmt, case_->blk, false); - if (case_->stmt->list.size() > 0) - emit_remove_local_vars(case_->blk); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - - has_default = true; - default_ctx = entry.as_default->blk.get(); - - blk->transfer(entry.as_default->blk); - entry.as_default->blk->loc_break = break_loc; - emit_stmt_list(entry.as_default->stmt, entry.as_default->blk, false); - if (entry.as_default->stmt->list.size() > 0) - emit_remove_local_vars(entry.as_default->blk); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - } - blk->init_from_child(break_blks_); - } - - insert_label(jmptable_loc); - - emit_opcode(opcode::OP_endswitch, data); - - auto offset = static_cast(7 * stmt->stmt->list.size()); - function_->instructions.back()->size += offset; - index_ += offset; - - insert_label(break_loc); - - can_break_ = old_break; - break_blks_ = old_breaks; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) -{ - if (!can_break_ || blk->abort != abort_t::abort_none || blk->loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - break_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_break; - emit_opcode(opcode::OP_jump, blk->loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) -{ - if (!can_continue_ || blk->abort != abort_t::abort_none || blk->loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - continue_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_continue; - emit_opcode(opcode::OP_jump, blk->loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - blk->abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr, blk); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child, blk); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate, blk); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference, blk); - break; - case ast::kind::expr_add_array: - emit_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_thisthread: - emit_opcode(opcode::OP_GetThisthread); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - 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, blk); - 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, const block::ptr& blk) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue, blk); - } - else if (expr->lvalue == ast::kind::expr_tuple) - { - emit_expr(expr->rvalue, blk); - emit_expr_tuple(expr->lvalue.as_tuple, blk); - } - else - { - emit_expr(expr->rvalue, blk); - emit_expr_variable_ref(expr->lvalue, blk, true); - } - - return; - } - - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - 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_mod); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_ex_or); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, blk, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key, blk); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, blk, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj, blk); - 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, blk, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk) -{ - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); - else - emit_opcode(opcode::OP_ClearLocalVariableFieldCached, variable_access_index(expr, blk)); -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_inc); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_dec); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr, blk); - emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr, blk); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_equality); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_inequality); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_less); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_greater); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_less_equal); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_greater_equal); - 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_ex_or); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_mod); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt && mode_ == gsc::build::prod) - { - const auto& name = expr->name->value; - if (name == "assert" || name == "assertex" || name == "assertmsg") return; - } - - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal && expr->args->list.size() > 0) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptLocalFunctionCall, expr->name->value); - else - emit_opcode(opcode::OP_ScriptLocalFunctionCall2, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptFarFunctionCall, { expr->path->value, expr->name->value }); - else - emit_opcode(opcode::OP_ScriptFarFunctionCall2, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltin0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltin1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltin2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltin3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltin4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltin5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltin, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptLocalMethodCall, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFarMethodCall, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltinMethod0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltinMethod1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltinMethod2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltinMethod3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltinMethod4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltinMethod5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltinMethod, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_EmptyArray); - - for (const auto& arg : expr->args->list) - { - emit_expr(arg, blk); - emit_opcode(opcode::OP_AddArray); - } -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) -{ - for (const auto& entry : expr->list) - { - variable_initialize(entry, blk); - emit_opcode(opcode::OP_SafeCreateVariableFieldCached, variable_create_index(entry, blk)); - } - - emit_opcode(opcode::OP_checkclearparams); -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry, blk); - } -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) -{ - bool method = false; - auto type = resolve_reference_type(expr, method); - - switch (type) - { - case ast::call::type::local: - emit_opcode(opcode::OP_GetLocalFunction, expr->name->value); - break; - case ast::call::type::far: - emit_opcode(opcode::OP_GetFarFunction, { expr->path->value, expr->name->value }); - break; - case ast::call::type::builtin: - if (method) - emit_opcode(opcode::OP_GetBuiltinMethod, expr->name->value); - else - emit_opcode(opcode::OP_GetBuiltinFunction, expr->name->value); - break; - } -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_size); -} - -void compiler::emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - emit_expr_variable_ref(expr->temp, blk, true); - - auto index = 0; - - for (const auto& entry : expr->list) - { - if (index == 0) - emit_opcode(opcode::OP_GetZero); - else - emit_opcode(opcode::OP_GetByte, utils::string::va("%d", index)); - - index++; - - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->temp.as_identifier, blk)); - - emit_expr_variable_ref(entry, blk, true); - } - - emit_expr_clear_local(expr->temp.as_identifier, blk); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, blk, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, blk, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, blk, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set) -{ - emit_expr(expr->key, blk); - - 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, blk, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - { - if (!variable_initialized(expr->obj.as_identifier, blk)) - { - variable_initialize(expr->obj.as_identifier, blk); - emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(expr->obj.as_identifier, blk)); - - if (!set) throw comp_error(expr->loc(), "INTERNAL: VAR CREATED BUT NOT SET!"); - } - else if (variable_stack_index(expr->obj.as_identifier, blk) == 0) - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached0); - } - else - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access_index(expr->obj.as_identifier, blk)); - } - - 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, const block::ptr& blk, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); - break; - case ast::kind::expr_anim: - set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); - break; - case ast::kind::expr_self: - set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - 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, blk); - 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_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, 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 + "'"); - } - - if (set) - { - if (!variable_initialized(expr, blk)) - { - variable_initialize(expr, blk); - emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(expr, blk)); - } - else if (variable_stack_index(expr, blk) == 0) - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached0); - } - else - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached, variable_access_index(expr, blk)); - } - } - else - { - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_EvalLocalVariableRefCached0); - else - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access_index(expr, blk)); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->key, blk); - - if (expr->obj == ast::kind::expr_identifier) - { - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->obj.as_identifier, blk)); - } - else - { - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_EvalArray); - } -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_EvalLevelFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_EvalAnimFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_EvalSelfFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, const block::ptr& blk) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - emit_expr(itr->second, blk); - return; - } - - // is local var - auto index = variable_stack_index(expr, blk); - - switch (index) - { - case 0: - emit_opcode(opcode::OP_EvalLocalVariableCached0); - break; - case 1: - emit_opcode(opcode::OP_EvalLocalVariableCached1); - break; - case 2: - emit_opcode(opcode::OP_EvalLocalVariableCached2); - break; - case 3: - emit_opcode(opcode::OP_EvalLocalVariableCached3); - break; - case 4: - emit_opcode(opcode::OP_EvalLocalVariableCached4); - break; - case 5: - emit_opcode(opcode::OP_EvalLocalVariableCached5); - break; - default: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access_index(expr, blk)); - break; - } -} - -void compiler::emit_expr_object(const ast::expr& expr, const block::ptr& blk) -{ - 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, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr.as_identifier, blk)); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk) -{ - std::vector data; - - bool isexpr = false; - - 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) - { - auto base = index_ + 1; - auto algn = (base + (4 - 1)) & ~(4 - 1); - emit_opcode(opcode::OP_GetVector, data); - index_ += (algn - base); - } - else - { - emit_expr(expr->z, blk); - emit_expr(expr->y, blk); - emit_expr(expr->x, blk); - 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(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimation, { "", expr->value }); - } - else - { - emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); - tree.loaded = true; - } -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error(expr->loc(), "trying to use animtree without specified using animtree"); - } - - auto& tree = animtrees_.back(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimTree, ""); - } - else - { - emit_opcode(opcode::OP_GetAnimTree, tree.name); - tree.loaded = true; - } -} - -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_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_create_local_vars(const block::ptr& blk) -{ - if (blk->local_vars_create_count != blk->local_vars_public_count) - { - for (auto i = blk->local_vars_create_count; i < blk->local_vars_public_count; i++) - { - auto data = utils::string::va("%d", blk->local_vars.at(i).create); - emit_opcode(opcode::OP_CreateLocalVariable, data); - blk->local_vars.at(i).init = true; - } - blk->local_vars_create_count = blk->local_vars_public_count; - } -} - -void compiler::emit_remove_local_vars(const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - auto count = blk->local_vars_create_count - blk->local_vars_public_count; - - if (count > 0) - { - auto data = utils::string::va("%d", count); - emit_opcode(opcode::OP_RemoveLocalVariables, data); - } - } -} - -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, const block::ptr& blk) -{ - process_expr_parameters(decl->params, blk); - process_stmt_list(decl->stmt, blk); -} - -void compiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - 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_waitframe: - case ast::kind::stmt_case: - case ast::kind::stmt_default: - 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, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk) -{ - process_stmt_list(stmt->list, blk); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - 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, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - blk->merge(childs); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - stmt->blk_if = std::make_unique(); - stmt->blk_else = std::make_unique(); - - blk->copy(stmt->blk_if); - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - blk->copy(stmt->blk_else); - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - blk->merge(childs); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - stmt->blk = std::make_unique(); - stmt->blk_iter = std::make_unique(); - - process_stmt(stmt->init, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->blk); - blk->copy(stmt->blk_iter); - - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_stmt(stmt->iter, stmt->blk_iter); - - blk->append({ stmt->blk_iter.get() }); - blk->merge({ stmt->blk_iter.get() }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto array_name = utils::string::va("_temp_%d", ++label_idx_); - auto key_name = utils::string::va("_temp_%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; - - // calculate variables - - stmt->ctx = std::make_unique(); - stmt->ctx_post = std::make_unique(); - - // calculate pre_expr variables - process_expr(stmt->array, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->ctx); - blk->copy(stmt->ctx_post); - - // calculate stmt variables & add missing array access as first stmt - process_expr(stmt->value_expr, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - continue_blks_.push_back(stmt->ctx.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_expr(stmt->key_expr, stmt->ctx_post); - - blk->append({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - // calculate variables - stmt->ctx = std::make_unique(); - std::vector childs; - auto abort = abort_t::abort_return; - bool has_default = false; - block* default_ctx = nullptr; - auto old_breaks = break_blks_; - break_blks_.clear(); - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->copy(entry.as_case->blk); - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort != abort_t::abort_none) - { - if (entry.as_case->blk->abort == abort_t::abort_break ) - { - entry.as_case->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_case->blk.get()); - } - else if (entry.as_case->blk->abort <= abort ) - { - abort = entry.as_case->blk->abort; - } - } - } - else if (entry == ast::kind::stmt_default) - { - entry.as_default->blk = std::make_unique(); - blk->copy(entry.as_default->blk); - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - has_default = true; - default_ctx = entry.as_default->blk.get(); - - if (entry.as_default->blk->abort != abort_t::abort_none) - { - if (entry.as_default->blk->abort == abort_t::abort_break ) - { - entry.as_default->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_default->blk.get()); - } - else if (entry.as_default->blk->abort <= abort ) - { - abort = entry.as_default->blk->abort; - } - } - } - } - - stmt->stmt =std::move(stmt_list); - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - } - - blk->append(break_blks_); - blk->merge(childs); - } - - break_blks_ = old_breaks; -} - -void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - break_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_break; - } -} - -void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - continue_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_continue; - } -} - -void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } -} - -void compiler::process_expr(const ast::expr& expr, const block::ptr& blk) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value, blk); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj, blk); - } - else if (expr == ast::kind::expr_tuple) - { - process_expr_tuple(expr.as_tuple, blk); - } -} - -void compiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - auto array = utils::string::va("_temp_%d", ++label_idx_); - expr->temp = ast::expr(std::make_unique(expr->loc(), array)); - - process_expr(expr->temp, blk); - - for (const auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk) -{ - for (const auto& entry : decl->list) - { - variable_register(entry->value, blk); - } -} - -void compiler::variable_register(const std::string& name, const block::ptr& blk) -{ - auto it = std::find_if (blk->local_vars.begin(), blk->local_vars.end(), - [&](const gsc::local_var& v) { return v.name == name; }); - - if (it == blk->local_vars.end()) - { - auto found = false; - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - blk->local_vars.push_back({ name, static_cast(i), false }); - found = true; - break; - } - } - - if (!found) - { - blk->local_vars.push_back({ name, stack_idx_, false }); - local_stack_.push_back(name); - stack_idx_++; - } - } -} - -void compiler::variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::uint32_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (!blk->local_vars[i].init) - { - for (std::uint32_t j = 0; j < i; j++) - { - if (!blk->local_vars[j].init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", blk->local_vars[j].create)); - blk->local_vars[j].init = true; - } - } - blk->local_vars[i].init = true; - blk->local_vars_create_count = i + 1; - return; - } - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -void compiler::variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - auto& var = blk->local_vars.at(i); - if (var.name == name->value) - { - if (!var.init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); - var.init = true; - blk->local_vars_create_count++; - } - return; - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return static_cast(blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - return utils::string::va("%d", blk->local_vars[i].create); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return utils::string::va("%d", blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - return blk->local_vars.at(i).init; - } - } - - 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_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jump: - case opcode::OP_jumpback: - case opcode::OP_switch: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_endswitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - -auto compiler::map_known_includes(const std::string&) -> bool -{ - return false; -} - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/compiler.hpp b/src/experimental/s1c/xsk/compiler.hpp deleted file mode 100644 index afc82f7f..00000000 --- a/src/experimental/s1c/xsk/compiler.hpp +++ /dev/null @@ -1,160 +0,0 @@ -// 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::gsc::s1c -{ - -enum class opcode : std::uint8_t; - -class compiler : public gsc::compiler -{ - build mode_; - std::string filename_; - std::vector assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector break_blks_; - std::vector continue_blks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - -public: - auto output() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_constant(const ast::decl_constant::ptr& constant); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last); - void emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void emit_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt, const block::ptr& blk); - void emit_stmt_waitframe(const ast::stmt_waitframe::ptr& stmt, const block::ptr& blk); - void emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk); - void emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk); - void emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk); - void emit_expr(const ast::expr& expr, const block::ptr& blk); - void emit_expr_assign(const ast::expr_assign::ptr& expr, const block::ptr& blk); - void emit_expr_clear(const ast::expr& expr, const block::ptr& blk); - void emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk); - void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk); - void emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_variable(const ast::expr& expr, const block::ptr& blk); - void emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void emit_expr_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_object(const ast::expr& expr, const block::ptr& blk); - void emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_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_create_local_vars(const block::ptr& blk); - void emit_remove_local_vars(const block::ptr& blk); - 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, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(const ast::expr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk); - void variable_register(const std::string& name, const block::ptr& blk); - void variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk); - void variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk); - auto variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t; - auto variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool; - 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; -}; - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/context.cpp b/src/experimental/s1c/xsk/context.cpp deleted file mode 100644 index 4bff57e9..00000000 --- a/src/experimental/s1c/xsk/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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 "s1c.hpp" - -namespace xsk::gsc::s1c -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/context.hpp b/src/experimental/s1c/xsk/context.hpp deleted file mode 100644 index 38140a5f..00000000 --- a/src/experimental/s1c/xsk/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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::gsc::s1c -{ - -class context : public gsc::context -{ - s1c::assembler assembler_; - s1c::disassembler disassembler_; - s1c::compiler compiler_; - s1c::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { return assembler_; } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { return compiler_; } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/decompiler.cpp b/src/experimental/s1c/xsk/decompiler.cpp deleted file mode 100644 index 305d994d..00000000 --- a/src/experimental/s1c/xsk/decompiler.cpp +++ /dev/null @@ -1,3442 +0,0 @@ -// 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 "s1c.hpp" - -namespace xsk::gsc::s1c -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// S1 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetLocalFunction: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalFunctionCall2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - 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_ScriptLocalFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalMethodCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodChildThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall2: - { - 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 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_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin1: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin3: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin4: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin5: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod1: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod2: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod3: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod4: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod5: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_waitFrame: - { - auto stmt = ast::stmt(std::make_unique(loc)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_waittill: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto args = std::make_unique(loc); - auto node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // continue is at jumpback, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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 - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - auto use_key = true; - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - use_key = false; - } - - 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)), use_key)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(std::stoi(entry->value.substr(4))), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - auto var = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - auto var1 = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); - blk->local_vars_create_count++; - } - - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/decompiler.hpp b/src/experimental/s1c/xsk/decompiler.hpp deleted file mode 100644 index 67f4e863..00000000 --- a/src/experimental/s1c/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::s1c -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/disassembler.cpp b/src/experimental/s1c/xsk/disassembler.cpp deleted file mode 100644 index d445c96f..00000000 --- a/src/experimental/s1c/xsk/disassembler.cpp +++ /dev/null @@ -1,576 +0,0 @@ -// 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 "s1c.hpp" - -namespace xsk::gsc::s1c -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// S1 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read_endian(); - func->id = stack_->read_endian(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read_endian(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: -// case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: -// case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read_endian())); - break; - case opcode::OP_GetVector: - inst->size += script_->align(4); - inst->data.push_back(utils::string::float_string(script_->read_endian())); - inst->data.push_back(utils::string::float_string(script_->read_endian())); - inst->data.push_back(utils::string::float_string(script_->read_endian())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(2); - inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); - break; - case opcode::OP_GetAnimation: - script_->seek(4); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - disassemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - } - - const auto id = script_->read_endian(); - const auto name = method ? resolver::method_name(id) : resolver::function_name(id); - inst->data.emplace(inst->data.begin(), name); -} - -void disassembler::disassemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto offset = disassemble_offset(); - - inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - } -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(3); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read_endian())); - } - - const auto file_id = stack_->read_endian(); - const auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::token_name(file_id); - const auto func_id = stack_->read_endian(); - const auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); - - inst->data.emplace(inst->data.begin(), func_name); - inst->data.emplace(inst->data.begin(), file_name); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read_endian(); - 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) -{ - const auto count = script_->read_endian(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read_endian(); - - if (value < 0x40000) - { - const auto data = stack_->read_c_string(); - - if (data.data()[0] != 0x01) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(data, false)); - } - else - inst->data.push_back("default"); - } - else - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - index += 4; - - const auto addr = disassemble_offset() + index; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 3; - inst->size += 7; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - const auto id = script_->read_endian(); - std::string name; - - if (id > max_string_id) - { - auto temp = stack_->read_endian(); - name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); - } - else - { - name = resolver::token_name(id); - } - - inst->data.push_back(name); -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read_endian(); - } - else if (back) - { - addr = inst->index + 3 - script_->read_endian(); - } - else - { - addr = inst->index + 5 + script_->read_endian(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -auto disassembler::disassemble_offset() -> std::int32_t -{ - std::array bytes = {}; - - for (auto i = 0; i < 3; i++) - { - bytes[2 - i] = script_->read_endian(); - } - - auto offset = *reinterpret_cast(bytes.data()); - - offset = (offset << 8) >> 10; - - return offset; -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = resolve_function(inst->data[0]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s\n", func->name.data())); - - 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())); - } - - print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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; - } - if (casenum != totalcase - 1) - { - output_->write_string("\n"); - } - } - } - break; - default: - for (auto& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - break; - } - - output_->write_string("\n"); -} - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/disassembler.hpp b/src/experimental/s1c/xsk/disassembler.hpp deleted file mode 100644 index 3614c449..00000000 --- a/src/experimental/s1c/xsk/disassembler.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc::s1c -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_local_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - auto disassemble_offset() -> std::int32_t; - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/lexer.cpp b/src/experimental/s1c/xsk/lexer.cpp deleted file mode 100644 index 63a1e9ff..00000000 --- a/src/experimental/s1c/xsk/lexer.cpp +++ /dev/null @@ -1,849 +0,0 @@ -// 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 "s1c.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -xsk::gsc::s1c::parser::symbol_type S1Clex(xsk::gsc::s1c::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::gsc::s1c -{ - -const std::unordered_map keyword_map -{{ - { "#define", parser::token::SH_DEFINE }, - { "#undef", parser::token::SH_UNDEF }, - { "#ifdef", parser::token::SH_IFDEF }, - { "#ifndef", parser::token::SH_IFNDEF }, - { "#if", parser::token::SH_IF }, - { "#elif", parser::token::SH_ELIF }, - { "#else", parser::token::SH_ELSE }, - { "#endif", parser::token::SH_ENDIF }, - { "#inline", parser::token::INLINE }, - { "#include", parser::token::INCLUDE }, - { "#using_animtree", parser::token::USINGTREE }, - { "#animtree", parser::token::ANIMTREE }, - { "endon", parser::token::ENDON }, - { "notify", parser::token::NOTIFY }, - { "wait", parser::token::WAIT }, - { "waittill", parser::token::WAITTILL }, - { "waittillmatch", parser::token::WAITTILLMATCH }, - { "waittillframeend", parser::token::WAITTILLFRAMEEND }, - { "waitframe", parser::token::WAITFRAME }, - { "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 }, - { "childthread", parser::token::CHILDTHREAD }, - { "thisthread", parser::token::THISTHREAD }, - { "call", parser::token::CALL }, - { "true", parser::token::TRUE }, - { "false", parser::token::FALSE }, - { "undefined", parser::token::UNDEFINED }, - { "size", parser::token::SIZE }, - { "game", parser::token::GAME }, - { "self", parser::token::SELF }, - { "anim", parser::token::ANIM }, - { "level", parser::token::LEVEL }, -}}; - -buffer::buffer() : length(0) -{ - data = static_cast(std::malloc(max_buf_size)); -} - -buffer::~buffer() -{ - if (data) std::free(data); -} - -bool buffer::push(char c) -{ - if (length >= max_buf_size) - return false; - - data[length++] = c; - return true; -} - -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) -{ - -} - -void reader::init(const char* data, size_t size) -{ - if (data && size) - { - state = reader::ok; - buffer_pos = data; - bytes_remaining = static_cast(size); - last_byte = 0; - current_byte = *data; - } - else - { - state = reader::end; - buffer_pos = 0; - bytes_remaining = 0; - last_byte = 0; - current_byte = 0; - } -} - -void reader::advance() -{ - ++buffer_pos; - - if (bytes_remaining-- == 1) - { - state = reader::end; - bytes_remaining = 0; - last_byte = current_byte; - current_byte = 0; - } - else - { - last_byte = current_byte; - current_byte = *buffer_pos; - } -} - -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) -{ - reader_.init(data, size); -} - -void lexer::push_header(const std::string& file) -{ - try - { - if (header_top_++ >= 10) - throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - - auto data = resolver::file_data(file + ".gsh"); - - readers_.push(reader_); - locs_.push(loc_); - loc_.initialize(std::get<0>(data)); - reader_.init(std::get<1>(data), std::get<2>(data)); - clean_ = true; - } - catch (const std::exception& e) - { - throw error("parsing header file '" + file + "': " + e.what()); - } -} - -void lexer::pop_header() -{ - header_top_--; - loc_ = locs_.top(); - locs_.pop(); - reader_ = readers_.top(); - readers_.pop(); -} - -void lexer::ban_header(const location& loc) -{ - if (header_top_ > 0) - { - throw comp_error(loc, "not allowed inside a gsh file"); - } -} - -auto lexer::lex() -> parser::symbol_type -{ - buffer_.length = 0; - state_ = state::start; - - while (true) - { - const auto& state = reader_.state; - auto& last = reader_.last_byte; - auto& curr = reader_.current_byte; - auto path = false; - loc_.step(); - - if (state == reader::end) - { - if (indev_) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (header_top_ > 0) - pop_header(); - else - return parser::make_S1CEOF(loc_); - } - - if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') - clean_ = false; - - advance(); - - switch (last) - { - case ' ': - case '\t': - case '\r': - loc_.step(); - continue; - case '\n': - loc_.lines(); - loc_.step(); - clean_ = true; - continue; - case '\\': - throw comp_error(loc_, "invalid token ('\\')"); - case '/': - if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') - return parser::make_DIV(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_DIV(loc_); - - if (last == '#') - { - if (indev_) - throw comp_error(loc_, "cannot recurse devblock ('/#')"); - - if (mode_ == build::dev) - { - indev_ = true; - return parser::make_DEVBEGIN(loc_); - } - else - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '#' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - } - else if (last == '@') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched script doc comment start ('/@')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '@' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '*') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched multiline comment start ('/*')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '*' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '/') - { - while (true) - { - if (state == reader::end) - break; - - if (curr == '\n') - break; - - advance(); - } - } - continue; - case '#': - if (curr == '/') - { - if (!indev_) - throw comp_error(loc_, "unmatched devblock end ('#/')"); - - advance(); - indev_ = false; - return parser::make_DEVEND(loc_); - } - - buffer_.push(last); - advance(); - - while (state == reader::ok) - { - if (last != ' ' || last != '\t') - break; - - advance(); - } - - if (state == reader::end || !((last > 64 && last < 91) || (last > 96 && last < 123))) - throw comp_error(loc_, "invalid preprocessor directive ('#')"); - - state_ = state::preprocessor; - goto lex_name; - case '*': - if (curr != '=' && curr != '/') - return parser::make_MUL(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_MUL(loc_); - - throw comp_error(loc_, "unmatched multiline comment end ('*/')"); - case '"': - state_ = state::string; - goto lex_string; - case '.': - if (curr < '0' || curr > '9') - return parser::make_DOT(loc_); - goto lex_number; - case '(': - return parser::make_LPAREN(loc_); - case ')': - return parser::make_RPAREN(loc_); - case '{': - return parser::make_LBRACE(loc_); - case '}': - return parser::make_RBRACE(loc_); - case '[': - return parser::make_LBRACKET(loc_); - case ']': - return parser::make_RBRACKET(loc_); - case ',': - return parser::make_COMMA(loc_); - case ';': - return parser::make_SEMICOLON(loc_); - case ':': - if (curr != ':') - return parser::make_COLON(loc_); - - advance(); - return parser::make_DOUBLECOLON(loc_); - case '?': - return parser::make_QMARK(loc_); - case '=': - if (curr != '=') - return parser::make_ASSIGN(loc_); - - advance(); - return parser::make_EQUALITY(loc_); - case '+': - if (curr != '+' && curr != '=') - return parser::make_ADD(loc_); - - advance(); - - if (last == '+') - return parser::make_INCREMENT(loc_); - - return parser::make_ASSIGN_ADD(loc_); - case '-': - if (curr != '-' && curr != '=') - return parser::make_SUB(loc_); - - advance(); - - if (last == '-') - return parser::make_DECREMENT(loc_); - - return parser::make_ASSIGN_SUB(loc_); - case '%': - if (curr != '=') - return parser::make_MOD(loc_); - - advance(); - - return parser::make_ASSIGN_MOD(loc_); - case '|': - if (curr != '|' && curr != '=') - return parser::make_BITWISE_OR(loc_); - - advance(); - - if (last == '|') - return parser::make_OR(loc_); - - return parser::make_ASSIGN_BW_OR(loc_); - case '&': - if (curr != '&' && curr != '=' && curr != '"') - return parser::make_BITWISE_AND(loc_); - - advance(); - - if (last == '&') - return parser::make_AND(loc_); - - if (last == '=') - return parser::make_ASSIGN_BW_AND(loc_); - - state_ = state::localize; - goto lex_string; - case '^': - if (curr != '=') - return parser::make_BITWISE_EXOR(loc_); - - advance(); - return parser::make_ASSIGN_BW_EXOR(loc_); - case '!': - if (curr != '=') - return parser::make_NOT(loc_); - - advance(); - return parser::make_INEQUALITY(loc_); - case '~': - return parser::make_COMPLEMENT(loc_); - case '<': - if (curr != '<' && curr != '=') - return parser::make_LESS(loc_); - - advance(); - if (last == '=') - return parser::make_LESS_EQUAL(loc_); - - if (curr != '=') - return parser::make_LSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_LSHIFT(loc_); - case '>': - if (curr != '>' && curr != '=') - return parser::make_GREATER(loc_); - - advance(); - - if (last == '=') - return parser::make_GREATER_EQUAL(loc_); - - if (curr != '=') - return parser::make_RSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_RSHIFT(loc_); - default: - if (last >= '0' && last <= '9') - goto lex_number; - else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) - goto lex_name; - - throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); - } - -lex_string: - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched string start ('\"')"); - - if (curr == '"') - { - advance(); - break; - } - - if (curr == '\n') - throw comp_error(loc_, "unterminated string literal"); - - if (curr == '\\') - { - advance(); - - if (state == reader::end) - throw comp_error(loc_, "invalid token ('\')"); - - char c = curr; - switch (curr) - { - case 't': c = '\t'; break; - case 'r': c = '\r'; break; - case 'n': c = '\n'; break; - case '"': c = '\"'; break; - case '\\': c = '\\'; break; - default: break; - } - - if (!buffer_.push(c)) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); - -lex_name: - buffer_.push(last); - - while (true) - { - if (state == reader::end) - break; - - if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) - break; - - if (curr == '\\') - { - if (last == '\\') - throw comp_error(loc_, "invalid path '\\\\'"); - - path = true; - if (!buffer_.push('/')) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::preprocessor) - { - auto token = parser::token::S1CUNDEF; - - if (buffer_.length < 16) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - { - if (itr->second > parser::token::SH_ENDIF) - return parser::symbol_type(itr->second, loc_); - - token = itr->second; - } - } - - preprocessor_run(token); - - state_ = state::start; - continue; - } - else - { - 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_); - } - - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - -lex_number: - if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) - { - buffer_.push(last); - - auto dot = last == '.' ? 1 : 0; - auto flt = 0; - - while (true) - { - if (state == reader::end) - break; - - if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) - throw comp_error(loc_, "invalid number literal"); - - if ((curr == '.' || curr == 'f') && last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr == 'f') - flt++; - else if (curr == '.') - dot++; - else if (!(curr > 47 && curr < 58)) - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f')) - throw comp_error(loc_, "invalid number literal"); - - if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); - } - else if (curr == 'o') - { - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) - throw comp_error(loc_, "invalid octal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!(curr > 47 && curr < 56)) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length <= 0) - throw comp_error(loc_, "invalid octal literal"); - - return parser::make_INTEGER(utils::string::oct_to_dec(buffer_.data), loc_); - } - else if (curr == 'b') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) - throw comp_error(loc_, "invalid binary literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr != '0' && curr != '1') - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid binary literal"); - - return parser::make_INTEGER(utils::string::bin_to_dec(buffer_.data), loc_); - } - else if (curr == 'x') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) - throw comp_error(loc_, "invalid hexadecimal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid hexadecimal literal"); - - return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); - } - - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); - } -} - -void lexer::advance() -{ - reader_.advance(); - loc_.end.column++; - - if (reader_.current_byte == '\\') [[unlikely]] - preprocessor_wrap(); -} - -void lexer::preprocessor_wrap() -{ - while (reader_.current_byte == '\\') - { - if (reader_.bytes_remaining == 1) - throw comp_error(loc_, "invalid token ('\\')"); - - if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') - break; - - if (reader_.buffer_pos[1] == '\r') - { - if (reader_.bytes_remaining <= 3 || reader_.buffer_pos[2] != '\n') - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 3; - reader_.bytes_remaining -= 3; - } - - if ((reader_.buffer_pos[1] == '\n')) - { - if (reader_.bytes_remaining == 2) - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 2; - reader_.bytes_remaining -= 2; - } - - if (reader_.bytes_remaining == 0) - { - reader_.state = reader::end; - reader_.current_byte = 0; - } - else - { - reader_.current_byte = *reader_.buffer_pos; - } - - loc_.lines(); - loc_.step(); - } -} - -void lexer::preprocessor_run(parser::token::token_kind_type token) -{ - if (!clean_) - throw comp_error(loc_, "invalid token ('#')"); - - switch (token) - { - case parser::token::SH_DEFINE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_UNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELSE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ENDIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - default: - throw comp_error(loc_, "unknown preprocessor directive"); - } -} - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/lexer.hpp b/src/experimental/s1c/xsk/lexer.hpp deleted file mode 100644 index 03853d2d..00000000 --- a/src/experimental/s1c/xsk/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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::gsc::s1c -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/parser.cpp b/src/experimental/s1c/xsk/parser.cpp deleted file mode 100644 index b02dd770..00000000 --- a/src/experimental/s1c/xsk/parser.cpp +++ /dev/null @@ -1,4733 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::s1c::parser::symbol_type S1Clex(xsk::gsc::s1c::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex S1Clex - - - -#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 S1CDEBUG - -// 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 // !S1CDEBUG - -# 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 // !S1CDEBUG - -#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 gsc { namespace s1c { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::gsc::s1c::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg) -#if S1CDEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - 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_add_array: // expr_add_array - value.YY_MOVE_OR_COPY< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.YY_MOVE_OR_COPY< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.YY_MOVE_OR_COPY< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.YY_MOVE_OR_COPY< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.YY_MOVE_OR_COPY< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.YY_MOVE_OR_COPY< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.YY_MOVE_OR_COPY< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.YY_MOVE_OR_COPY< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.copy< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.copy< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.copy< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.copy< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 S1CDEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if S1CDEBUG - 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 // S1CDEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - yylhs.value.emplace< ast::expr_add_array::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - yylhs.value.emplace< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - yylhs.value.emplace< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - yylhs.value.emplace< ast::stmt_waitframe::ptr > (); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - yylhs.value.emplace< ast::stmt_waittill::ptr > (); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - yylhs.value.emplace< ast::stmt_waittillframeend::ptr > (); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - yylhs.value.emplace< ast::stmt_waittillmatch::ptr > (); - break; - - case symbol_kind::S_stmt_while: // stmt_while - yylhs.value.emplace< ast::stmt_while::ptr > (); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 263 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2040 "parser.cpp" - break; - - case 3: // root: %empty -#line 264 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2046 "parser.cpp" - break; - - case 4: // program: program inline -#line 269 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2052 "parser.cpp" - break; - - case 5: // program: program include -#line 271 "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 2058 "parser.cpp" - break; - - case 6: // program: program declaration -#line 273 "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 2064 "parser.cpp" - break; - - case 7: // program: inline -#line 275 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2070 "parser.cpp" - break; - - case 8: // program: include -#line 277 "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 2076 "parser.cpp" - break; - - case 9: // program: declaration -#line 279 "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 2082 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 283 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2088 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 288 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2094 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 292 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2100 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 293 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2106 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 294 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2112 "parser.cpp" - break; - - case 15: // declaration: decl_constant -#line 295 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } -#line 2118 "parser.cpp" - break; - - case 16: // declaration: decl_thread -#line 296 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2124 "parser.cpp" - break; - - case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 301 "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 2130 "parser.cpp" - break; - - case 18: // decl_constant: expr_identifier "=" expr ";" -#line 306 "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 2136 "parser.cpp" - break; - - case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 311 "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 2142 "parser.cpp" - break; - - case 20: // stmt: stmt_block -#line 315 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2148 "parser.cpp" - break; - - case 21: // stmt: stmt_call -#line 316 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2154 "parser.cpp" - break; - - case 22: // stmt: stmt_assign -#line 317 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2160 "parser.cpp" - break; - - case 23: // stmt: stmt_endon -#line 318 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2166 "parser.cpp" - break; - - case 24: // stmt: stmt_notify -#line 319 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2172 "parser.cpp" - break; - - case 25: // stmt: stmt_wait -#line 320 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2178 "parser.cpp" - break; - - case 26: // stmt: stmt_waittill -#line 321 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2184 "parser.cpp" - break; - - case 27: // stmt: stmt_waittillmatch -#line 322 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2190 "parser.cpp" - break; - - case 28: // stmt: stmt_waittillframeend -#line 323 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2196 "parser.cpp" - break; - - case 29: // stmt: stmt_waitframe -#line 324 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } -#line 2202 "parser.cpp" - break; - - case 30: // stmt: stmt_if -#line 325 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2208 "parser.cpp" - break; - - case 31: // stmt: stmt_ifelse -#line 326 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2214 "parser.cpp" - break; - - case 32: // stmt: stmt_while -#line 327 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2220 "parser.cpp" - break; - - case 33: // stmt: stmt_dowhile -#line 328 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2226 "parser.cpp" - break; - - case 34: // stmt: stmt_for -#line 329 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2232 "parser.cpp" - break; - - case 35: // stmt: stmt_foreach -#line 330 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2238 "parser.cpp" - break; - - case 36: // stmt: stmt_switch -#line 331 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2244 "parser.cpp" - break; - - case 37: // stmt: stmt_case -#line 332 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2250 "parser.cpp" - break; - - case 38: // stmt: stmt_default -#line 333 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2256 "parser.cpp" - break; - - case 39: // stmt: stmt_break -#line 334 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2262 "parser.cpp" - break; - - case 40: // stmt: stmt_continue -#line 335 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2268 "parser.cpp" - break; - - case 41: // stmt: stmt_return -#line 336 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2274 "parser.cpp" - break; - - case 42: // stmt: stmt_breakpoint -#line 337 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } -#line 2280 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_begin -#line 338 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2286 "parser.cpp" - break; - - case 44: // stmt: stmt_prof_end -#line 339 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2292 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt -#line 343 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2298 "parser.cpp" - break; - - case 46: // stmt_or_dev: stmt_dev -#line 344 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2304 "parser.cpp" - break; - - case 47: // stmt_list: stmt_list stmt -#line 349 "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 2310 "parser.cpp" - break; - - case 48: // stmt_list: stmt -#line 351 "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 2316 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 356 "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 2322 "parser.cpp" - break; - - case 50: // stmt_or_dev_list: stmt_or_dev -#line 358 "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 2328 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" stmt_list "#/" -#line 362 "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 2334 "parser.cpp" - break; - - case 52: // stmt_dev: "/#" "#/" -#line 363 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2340 "parser.cpp" - break; - - case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 367 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2346 "parser.cpp" - break; - - case 54: // stmt_block: "{" "}" -#line 368 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2352 "parser.cpp" - break; - - case 55: // stmt_expr: expr_assign -#line 373 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2358 "parser.cpp" - break; - - case 56: // stmt_expr: expr_increment -#line 375 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2364 "parser.cpp" - break; - - case 57: // stmt_expr: expr_decrement -#line 377 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2370 "parser.cpp" - break; - - case 58: // stmt_expr: %empty -#line 379 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2376 "parser.cpp" - break; - - case 59: // stmt_call: expr_call ";" -#line 384 "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 2382 "parser.cpp" - break; - - case 60: // stmt_call: expr_method ";" -#line 386 "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 2388 "parser.cpp" - break; - - case 61: // stmt_assign: expr_assign ";" -#line 391 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2394 "parser.cpp" - break; - - case 62: // stmt_assign: expr_increment ";" -#line 393 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2400 "parser.cpp" - break; - - case 63: // stmt_assign: expr_decrement ";" -#line 395 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2406 "parser.cpp" - break; - - case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 400 "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 2412 "parser.cpp" - break; - - case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 405 "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 2418 "parser.cpp" - break; - - case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 407 "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 2424 "parser.cpp" - break; - - case 67: // stmt_wait: "wait" expr ";" -#line 412 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2430 "parser.cpp" - break; - - case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 417 "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 2436 "parser.cpp" - break; - - case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 419 "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 2442 "parser.cpp" - break; - - case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 424 "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 2448 "parser.cpp" - break; - - case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 426 "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 2454 "parser.cpp" - break; - - case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 431 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2460 "parser.cpp" - break; - - case 73: // stmt_waitframe: "waitframe" ";" -#line 436 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2466 "parser.cpp" - break; - - case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 438 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2472 "parser.cpp" - break; - - case 75: // stmt_if: "if" "(" expr ")" stmt -#line 443 "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 2478 "parser.cpp" - break; - - case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 448 "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 2484 "parser.cpp" - break; - - case 77: // stmt_while: "while" "(" expr ")" stmt -#line 453 "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 2490 "parser.cpp" - break; - - case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 458 "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 2496 "parser.cpp" - break; - - case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 463 "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 2502 "parser.cpp" - break; - - case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 468 "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 2508 "parser.cpp" - break; - - case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 470 "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 2514 "parser.cpp" - break; - - case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 475 "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 2520 "parser.cpp" - break; - - case 83: // stmt_case: "case" expr_integer ":" -#line 480 "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 2526 "parser.cpp" - break; - - case 84: // stmt_case: "case" expr_string ":" -#line 482 "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 2532 "parser.cpp" - break; - - case 85: // stmt_default: "default" ":" -#line 487 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2538 "parser.cpp" - break; - - case 86: // stmt_break: "break" ";" -#line 492 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2544 "parser.cpp" - break; - - case 87: // stmt_continue: "continue" ";" -#line 497 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2550 "parser.cpp" - break; - - case 88: // stmt_return: "return" expr ";" -#line 502 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2556 "parser.cpp" - break; - - case 89: // stmt_return: "return" ";" -#line 504 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2562 "parser.cpp" - break; - - case 90: // stmt_breakpoint: "breakpoint" ";" -#line 509 "parser.ypp" - { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } -#line 2568 "parser.cpp" - break; - - case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 514 "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 2574 "parser.cpp" - break; - - case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 519 "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 2580 "parser.cpp" - break; - - case 93: // expr: expr_ternary -#line 523 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2586 "parser.cpp" - break; - - case 94: // expr: expr_binary -#line 524 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2592 "parser.cpp" - break; - - case 95: // expr: expr_primitive -#line 525 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2598 "parser.cpp" - break; - - case 96: // expr_or_empty: expr -#line 529 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2604 "parser.cpp" - break; - - case 97: // expr_or_empty: %empty -#line 530 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2610 "parser.cpp" - break; - - case 98: // expr_assign: expr_tuple "=" expr -#line 535 "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 2616 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "=" expr -#line 537 "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 2622 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "|=" expr -#line 539 "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 2628 "parser.cpp" - break; - - case 101: // expr_assign: expr_object "&=" expr -#line 541 "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 2634 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "^=" expr -#line 543 "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 2640 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "<<=" expr -#line 545 "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 2646 "parser.cpp" - break; - - case 104: // expr_assign: expr_object ">>=" expr -#line 547 "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 2652 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "+=" expr -#line 549 "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 2658 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "-=" expr -#line 551 "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 2664 "parser.cpp" - break; - - case 107: // expr_assign: expr_object "*=" expr -#line 553 "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 2670 "parser.cpp" - break; - - case 108: // expr_assign: expr_object "/=" expr -#line 555 "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 2676 "parser.cpp" - break; - - case 109: // expr_assign: expr_object "%=" expr -#line 557 "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 2682 "parser.cpp" - break; - - case 110: // expr_increment: "++" expr_object -#line 562 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2688 "parser.cpp" - break; - - case 111: // expr_increment: expr_object "++" -#line 564 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2694 "parser.cpp" - break; - - case 112: // expr_decrement: "--" expr_object -#line 569 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2700 "parser.cpp" - break; - - case 113: // expr_decrement: expr_object "--" -#line 571 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2706 "parser.cpp" - break; - - case 114: // expr_ternary: expr "?" expr ":" expr -#line 576 "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 2712 "parser.cpp" - break; - - case 115: // expr_binary: expr "||" expr -#line 581 "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 2718 "parser.cpp" - break; - - case 116: // expr_binary: expr "&&" expr -#line 583 "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 2724 "parser.cpp" - break; - - case 117: // expr_binary: expr "==" expr -#line 585 "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 2730 "parser.cpp" - break; - - case 118: // expr_binary: expr "!=" expr -#line 587 "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 2736 "parser.cpp" - break; - - case 119: // expr_binary: expr "<=" expr -#line 589 "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 2742 "parser.cpp" - break; - - case 120: // expr_binary: expr ">=" expr -#line 591 "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 2748 "parser.cpp" - break; - - case 121: // expr_binary: expr "<" expr -#line 593 "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 2754 "parser.cpp" - break; - - case 122: // expr_binary: expr ">" expr -#line 595 "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 2760 "parser.cpp" - break; - - case 123: // expr_binary: expr "|" expr -#line 597 "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 2766 "parser.cpp" - break; - - case 124: // expr_binary: expr "&" expr -#line 599 "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 2772 "parser.cpp" - break; - - case 125: // expr_binary: expr "^" expr -#line 601 "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 2778 "parser.cpp" - break; - - case 126: // expr_binary: expr "<<" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2784 "parser.cpp" - break; - - case 127: // expr_binary: expr ">>" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2790 "parser.cpp" - break; - - case 128: // expr_binary: expr "+" expr -#line 607 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2796 "parser.cpp" - break; - - case 129: // expr_binary: expr "-" expr -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2802 "parser.cpp" - break; - - case 130: // expr_binary: expr "*" expr -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2808 "parser.cpp" - break; - - case 131: // expr_binary: expr "/" expr -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2814 "parser.cpp" - break; - - case 132: // expr_binary: expr "%" expr -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2820 "parser.cpp" - break; - - case 133: // expr_primitive: expr_complement -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 2826 "parser.cpp" - break; - - case 134: // expr_primitive: expr_negate -#line 620 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 2832 "parser.cpp" - break; - - case 135: // expr_primitive: expr_not -#line 621 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 2838 "parser.cpp" - break; - - case 136: // expr_primitive: expr_call -#line 622 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 2844 "parser.cpp" - break; - - case 137: // expr_primitive: expr_method -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 2850 "parser.cpp" - break; - - case 138: // expr_primitive: expr_add_array -#line 624 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } -#line 2856 "parser.cpp" - break; - - case 139: // expr_primitive: expr_reference -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 2862 "parser.cpp" - break; - - case 140: // expr_primitive: expr_array -#line 626 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 2868 "parser.cpp" - break; - - case 141: // expr_primitive: expr_field -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 2874 "parser.cpp" - break; - - case 142: // expr_primitive: expr_size -#line 628 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 2880 "parser.cpp" - break; - - case 143: // expr_primitive: expr_paren -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 2886 "parser.cpp" - break; - - case 144: // expr_primitive: expr_thisthread -#line 630 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } -#line 2892 "parser.cpp" - break; - - case 145: // expr_primitive: expr_empty_array -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 2898 "parser.cpp" - break; - - case 146: // expr_primitive: expr_undefined -#line 632 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 2904 "parser.cpp" - break; - - case 147: // expr_primitive: expr_game -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 2910 "parser.cpp" - break; - - case 148: // expr_primitive: expr_self -#line 634 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 2916 "parser.cpp" - break; - - case 149: // expr_primitive: expr_anim -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 2922 "parser.cpp" - break; - - case 150: // expr_primitive: expr_level -#line 636 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 2928 "parser.cpp" - break; - - case 151: // expr_primitive: expr_animation -#line 637 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 2934 "parser.cpp" - break; - - case 152: // expr_primitive: expr_animtree -#line 638 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 2940 "parser.cpp" - break; - - case 153: // expr_primitive: expr_identifier -#line 639 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 2946 "parser.cpp" - break; - - case 154: // expr_primitive: expr_istring -#line 640 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 2952 "parser.cpp" - break; - - case 155: // expr_primitive: expr_string -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 2958 "parser.cpp" - break; - - case 156: // expr_primitive: expr_vector -#line 642 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 2964 "parser.cpp" - break; - - case 157: // expr_primitive: expr_float -#line 643 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 2970 "parser.cpp" - break; - - case 158: // expr_primitive: expr_integer -#line 644 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 2976 "parser.cpp" - break; - - case 159: // expr_primitive: expr_false -#line 645 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 2982 "parser.cpp" - break; - - case 160: // expr_primitive: expr_true -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 2988 "parser.cpp" - break; - - case 161: // expr_complement: "~" expr -#line 651 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2994 "parser.cpp" - break; - - case 162: // expr_negate: "-" expr_identifier -#line 656 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 3000 "parser.cpp" - break; - - case 163: // expr_negate: "-" expr_paren -#line 658 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 3006 "parser.cpp" - break; - - case 164: // expr_negate: "-" expr_array -#line 660 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 3012 "parser.cpp" - break; - - case 165: // expr_negate: "-" expr_field -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 3018 "parser.cpp" - break; - - case 166: // expr_not: "!" expr -#line 667 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3024 "parser.cpp" - break; - - case 167: // expr_call: expr_function -#line 671 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3030 "parser.cpp" - break; - - case 168: // expr_call: expr_pointer -#line 672 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3036 "parser.cpp" - break; - - case 169: // expr_method: expr_object expr_function -#line 675 "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 3042 "parser.cpp" - break; - - case 170: // expr_method: expr_object expr_pointer -#line 676 "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 3048 "parser.cpp" - break; - - case 171: // expr_function: expr_identifier "(" expr_arguments ")" -#line 681 "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 3054 "parser.cpp" - break; - - case 172: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 683 "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 3060 "parser.cpp" - break; - - case 173: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 685 "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 3066 "parser.cpp" - break; - - case 174: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 687 "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 3072 "parser.cpp" - break; - - case 175: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 689 "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::childthread); } -#line 3078 "parser.cpp" - break; - - case 176: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 691 "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::childthread); } -#line 3084 "parser.cpp" - break; - - case 177: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 696 "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 3090 "parser.cpp" - break; - - case 178: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 698 "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 3096 "parser.cpp" - break; - - case 179: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 700 "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::childthread); } -#line 3102 "parser.cpp" - break; - - case 180: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 702 "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::builtin); } -#line 3108 "parser.cpp" - break; - - case 181: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 707 "parser.ypp" - { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } -#line 3114 "parser.cpp" - break; - - case 182: // expr_parameters: expr_parameters "," expr_identifier -#line 712 "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 3120 "parser.cpp" - break; - - case 183: // expr_parameters: expr_identifier -#line 714 "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 3126 "parser.cpp" - break; - - case 184: // expr_parameters: %empty -#line 716 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3132 "parser.cpp" - break; - - case 185: // expr_arguments: expr_arguments_no_empty -#line 721 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3138 "parser.cpp" - break; - - case 186: // expr_arguments: %empty -#line 723 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3144 "parser.cpp" - break; - - case 187: // expr_arguments_no_empty: expr_arguments "," expr -#line 728 "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 3150 "parser.cpp" - break; - - case 188: // expr_arguments_no_empty: expr -#line 730 "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 3156 "parser.cpp" - break; - - case 189: // expr_reference: "::" expr_identifier -#line 735 "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 3162 "parser.cpp" - break; - - case 190: // expr_reference: expr_path "::" expr_identifier -#line 737 "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 3168 "parser.cpp" - break; - - case 191: // expr_tuple: "[" expr_tuple_arguments "]" -#line 742 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[1].value.as < ast::expr_tuple::ptr > ()); } -#line 3174 "parser.cpp" - break; - - case 192: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types -#line 747 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::move(yystack_[2].value.as < ast::expr_tuple::ptr > ()); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3180 "parser.cpp" - break; - - case 193: // expr_tuple_arguments: expr_tuple_types -#line 749 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3186 "parser.cpp" - break; - - case 194: // expr_tuple_types: expr_array -#line 753 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3192 "parser.cpp" - break; - - case 195: // expr_tuple_types: expr_field -#line 754 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3198 "parser.cpp" - break; - - case 196: // expr_tuple_types: expr_identifier -#line 755 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3204 "parser.cpp" - break; - - case 197: // expr_array: expr_object "[" expr "]" -#line 760 "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 3210 "parser.cpp" - break; - - case 198: // expr_field: expr_object "." expr_identifier_nosize -#line 765 "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 3216 "parser.cpp" - break; - - case 199: // expr_size: expr_object "." "size" -#line 770 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3222 "parser.cpp" - break; - - case 200: // expr_paren: "(" expr ")" -#line 775 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3228 "parser.cpp" - break; - - case 201: // expr_object: expr_call -#line 779 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3234 "parser.cpp" - break; - - case 202: // expr_object: expr_method -#line 780 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3240 "parser.cpp" - break; - - case 203: // expr_object: expr_array -#line 781 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3246 "parser.cpp" - break; - - case 204: // expr_object: expr_field -#line 782 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3252 "parser.cpp" - break; - - case 205: // expr_object: expr_game -#line 783 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3258 "parser.cpp" - break; - - case 206: // expr_object: expr_self -#line 784 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3264 "parser.cpp" - break; - - case 207: // expr_object: expr_anim -#line 785 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3270 "parser.cpp" - break; - - case 208: // expr_object: expr_level -#line 786 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3276 "parser.cpp" - break; - - case 209: // expr_object: expr_identifier -#line 787 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3282 "parser.cpp" - break; - - case 210: // expr_thisthread: "thisthread" -#line 792 "parser.ypp" - { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } -#line 3288 "parser.cpp" - break; - - case 211: // expr_empty_array: "[" "]" -#line 797 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3294 "parser.cpp" - break; - - case 212: // expr_undefined: "undefined" -#line 802 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3300 "parser.cpp" - break; - - case 213: // expr_game: "game" -#line 807 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3306 "parser.cpp" - break; - - case 214: // expr_self: "self" -#line 812 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3312 "parser.cpp" - break; - - case 215: // expr_anim: "anim" -#line 817 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3318 "parser.cpp" - break; - - case 216: // expr_level: "level" -#line 822 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3324 "parser.cpp" - break; - - case 217: // expr_animation: "%" "identifier" -#line 827 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3330 "parser.cpp" - break; - - case 218: // expr_animtree: "#animtree" -#line 832 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3336 "parser.cpp" - break; - - case 219: // expr_identifier_nosize: "identifier" -#line 837 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3342 "parser.cpp" - break; - - case 220: // expr_identifier: "identifier" -#line 842 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3348 "parser.cpp" - break; - - case 221: // expr_identifier: "size" -#line 844 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3354 "parser.cpp" - break; - - case 222: // expr_path: "identifier" -#line 849 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3360 "parser.cpp" - break; - - case 223: // expr_path: "path" -#line 851 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3366 "parser.cpp" - break; - - case 224: // expr_istring: "localized string" -#line 856 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3372 "parser.cpp" - break; - - case 225: // expr_string: "string literal" -#line 861 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3378 "parser.cpp" - break; - - case 226: // expr_vector: "(" expr "," expr "," expr ")" -#line 866 "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 3384 "parser.cpp" - break; - - case 227: // expr_float: "-" "float" -#line 871 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3390 "parser.cpp" - break; - - case 228: // expr_float: "float" -#line 873 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3396 "parser.cpp" - break; - - case 229: // expr_integer: "-" "integer" -#line 878 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3402 "parser.cpp" - break; - - case 230: // expr_integer: "integer" -#line 880 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3408 "parser.cpp" - break; - - case 231: // expr_false: "false" -#line 885 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3414 "parser.cpp" - break; - - case 232: // expr_true: "true" -#line 890 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3420 "parser.cpp" - break; - - -#line 3424 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "endon", "notify", "wait", - "waittill", "waittillmatch", "waittillframeend", "waitframe", "if", - "else", "do", "while", "for", "foreach", "in", "switch", "case", - "default", "break", "continue", "return", "breakpoint", "prof_begin", - "prof_end", "thread", "childthread", "thisthread", "call", "true", - "false", "undefined", "size", "game", "self", "anim", "level", "(", ")", - "{", "}", "[", "]", ",", ".", "::", ":", ";", "?", "++", "--", "<<", - ">>", "||", "&&", "==", "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", - "-=", "*=", "/=", "%=", "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", - "+", "-", "*", "/", "%", "path", "identifier", "string literal", - "localized string", "float", "integer", "SIZEOF", "ADD_ARRAY", "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_waitframe", "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_negate", - "expr_not", "expr_call", "expr_method", "expr_function", "expr_pointer", - "expr_add_array", "expr_parameters", "expr_arguments", - "expr_arguments_no_empty", "expr_reference", "expr_tuple", - "expr_tuple_arguments", "expr_tuple_types", "expr_array", "expr_field", - "expr_size", "expr_paren", "expr_object", "expr_thisthread", - "expr_empty_array", "expr_undefined", "expr_game", "expr_self", - "expr_anim", "expr_level", "expr_animation", "expr_animtree", - "expr_identifier_nosize", "expr_identifier", "expr_path", "expr_istring", - "expr_string", "expr_vector", "expr_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 S1CDEBUG - // 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 S1CDEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if S1CDEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -287; - - const short parser::yytable_ninf_ = -223; - - const short - parser::yypact_[] = - { - 6, -287, -287, 5, 5, -24, -287, -287, 37, 6, - -287, -287, -287, -287, -287, -287, -8, -287, -287, -13, - -10, -54, -287, -287, -287, -287, -23, 1223, -287, -287, - -287, 11, -12, -287, -287, -42, 3, -287, 17, -287, - -287, -287, -287, -287, -287, -287, 1223, 821, -23, 1223, - 1223, -18, -36, 26, -287, -287, -287, 2187, -287, -287, - -287, -287, -287, -287, 413, 667, -287, -287, -287, -287, - 699, 729, -287, -287, 1012, -287, -287, -287, 1089, 1187, - 1247, 1317, -287, -287, 574, 39, -287, -287, -287, -287, - -287, -287, -287, 15, 96, -23, 49, 75, 81, 114, - 100, 124, 129, 1439, 821, -287, 2270, 134, 136, -287, - -287, -287, 1223, 142, -287, -287, -287, -287, 699, 729, - -287, 1406, -287, -287, -287, -287, 574, 140, -287, -287, - 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, - 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1286, - -20, -287, -287, 152, 1223, -23, -287, 928, -287, -287, - 1223, 1223, -23, 1223, 1223, -23, 1223, -287, 1223, 1917, - 1223, -287, 1605, 1223, 107, -23, 2152, 179, 179, 2301, - 2311, 2383, 2383, 30, 30, 30, 30, 2342, 728, 2352, - 73, 73, -287, -287, -287, 1957, -287, -287, -287, 35, - -287, 154, 1057, 1223, 146, -5, 161, 1370, 165, 166, - 167, 168, -17, 163, 169, 172, 1160, 183, 173, 175, - -287, 139, 548, 548, -287, -287, 980, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, 184, 185, 188, 191, 192, 177, -287, - -287, 51, 152, 1997, 53, 205, 2037, 56, 206, 2077, - 2116, 203, 2270, 1917, 154, 1223, -287, -287, 1223, -287, - -287, 1134, 2222, -287, 209, -287, 1223, 236, 1223, 639, - -23, 1223, 164, 208, 215, -287, -287, -287, -287, 2257, - -287, 1223, 1223, 1286, 32, -287, 62, 86, 8, 1406, - 1406, -287, -287, -287, -287, -287, -287, -287, 1223, 225, - 227, 228, 230, -287, -287, 1223, 1223, 1223, 1223, 1223, - 1223, 1223, 1223, 1223, 1223, 1223, 210, -287, 1223, 226, - -287, 1223, 229, 1223, 232, 2270, 59, -287, -287, -287, - 223, 1639, 235, 1673, 233, -287, -287, -287, 1396, 9, - 1707, -287, -287, -287, 60, 87, -287, 548, 2270, 1223, - 1223, 1223, 1223, 2270, 2270, 2270, 2270, 2270, 2270, 2270, - 2270, 2270, 2270, 2270, 240, 89, 242, 101, 245, 1741, - 1223, -287, -287, 1370, 1223, 1370, 1223, 1223, -23, 96, - 237, 241, -287, 1775, 1483, 1527, 1571, 1223, -287, 1223, - -287, 1223, -287, 103, 273, 1809, -287, 2270, 243, 1843, - 272, -287, -287, -287, 246, 249, 1223, 250, 1223, 251, - 1223, 113, 123, 125, -287, 1370, 252, 639, 1370, 1223, - -287, -287, 254, -287, 262, -287, 286, -287, -287, -287, - -287, -287, 287, -287, 1877, 279, 280, 281, 1370, 1370, - -287, -287, -287, -287, -287 - }; - - const unsigned char - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 221, 220, 0, 2, - 7, 8, 9, 14, 15, 16, 0, 223, 222, 0, - 0, 0, 1, 4, 5, 6, 184, 0, 10, 11, - 225, 0, 0, 183, 218, 0, 0, 210, 0, 232, - 231, 212, 213, 214, 215, 216, 0, 186, 0, 0, - 0, 0, 0, 220, 224, 228, 230, 0, 93, 94, - 95, 133, 134, 135, 136, 137, 167, 168, 138, 139, - 140, 141, 142, 143, 0, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 0, 154, 155, 156, 157, - 158, 159, 160, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 186, 211, 188, 0, 185, 189, - 166, 161, 0, 0, 227, 229, 201, 202, 164, 165, - 163, 0, 205, 206, 207, 208, 162, 0, 217, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 169, 170, 0, 186, 0, 17, 0, 19, 182, - 0, 186, 0, 0, 186, 0, 0, 200, 0, 188, - 0, 181, 0, 0, 0, 0, 0, 126, 127, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 128, 129, 130, 131, 132, 0, 199, 219, 198, 0, - 185, 190, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 54, 0, 0, 0, 45, 50, 0, 46, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 0, 0, 0, 201, 202, 0, 203, - 204, 0, 209, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 187, 0, 0, 0, 197, 171, 186, 52, - 48, 0, 0, 72, 0, 73, 0, 0, 0, 58, - 0, 0, 0, 0, 0, 85, 86, 87, 89, 0, - 90, 186, 186, 0, 0, 193, 203, 204, 209, 110, - 112, 53, 49, 61, 62, 63, 59, 60, 0, 0, - 0, 0, 0, 111, 113, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 173, 186, 0, - 175, 186, 0, 0, 0, 114, 0, 51, 47, 67, - 0, 0, 0, 0, 0, 55, 56, 57, 0, 0, - 0, 84, 83, 88, 0, 0, 191, 0, 98, 0, - 0, 0, 0, 99, 105, 106, 107, 108, 109, 100, - 101, 102, 104, 103, 0, 0, 0, 0, 0, 0, - 186, 172, 74, 0, 0, 0, 97, 0, 0, 0, - 0, 0, 192, 0, 0, 0, 0, 186, 174, 186, - 176, 186, 226, 0, 75, 0, 77, 96, 0, 0, - 0, 82, 91, 92, 0, 0, 186, 0, 186, 0, - 186, 0, 0, 0, 177, 0, 0, 58, 0, 0, - 64, 66, 185, 69, 185, 71, 185, 178, 179, 180, - 76, 78, 0, 80, 0, 0, 0, 0, 0, 0, - 65, 68, 70, 79, 81 - }; - - const short - parser::yypgoto_[] = - { - -287, -287, -287, 295, 336, 338, -287, -287, -287, -194, - 122, -287, -287, -287, -93, -87, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - 189, -287, -286, -277, -274, -287, -287, -287, -287, -287, - -287, -49, -11, -67, -58, -287, -287, 95, -43, -287, - -287, -287, -16, 197, 324, -287, 302, 355, -287, -287, - -287, 380, 417, 452, 490, -287, -287, -287, 0, 7, - -287, -15, -287, -287, 148, -287, -287 - }; - - const short - parser::yydefgoto_[] = - { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 224, - 225, 281, 226, 227, 228, 354, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 106, 418, 253, 254, 255, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 32, 107, 200, 69, - 258, 304, 305, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 198, 84, 85, - 86, 87, 88, 89, 90, 91, 92 - }; - - const short - parser::yytable_[] = - { - 16, 158, 116, 355, 108, 6, 31, 151, 280, 16, - 19, 20, 356, 287, 96, 357, 152, 1, 2, 3, - 4, 5, 35, 36, 6, 38, 33, 196, 21, 6, - 42, 43, 44, 45, 112, 97, 100, 22, 113, 397, - 117, 94, 98, 101, 26, 30, 95, 284, 109, 28, - 6, 126, 29, 6, 151, 17, 53, 285, 127, 99, - 154, 108, 128, 152, 93, -196, -196, 398, 319, 320, - 27, 321, 322, 102, 153, 7, 292, 156, 197, 17, - 53, 127, 30, 114, 115, 56, -222, 348, 277, 366, - 367, 35, 36, 170, 38, 159, 131, 132, 6, 155, - 17, 53, 17, 18, 7, 160, 337, 149, 256, 340, - 174, 170, 391, 400, 170, 323, 324, 170, 170, -194, - -194, 153, 144, 145, 146, 147, 148, 161, 127, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 401, 162, 408, -195, -195, 170, 257, 170, 17, 53, - 157, 355, 164, 256, 410, 201, 434, 262, 256, 170, - 356, 170, 265, 357, 127, 268, 447, 146, 147, 148, - 163, 170, 116, 116, 116, 274, 448, 256, 449, 35, - 36, 170, 38, 170, 165, 166, 6, 42, 43, 44, - 45, 257, 170, 171, 151, 303, 257, 293, 173, 414, - 175, 416, 262, 152, 154, 197, 278, 262, 283, 127, - 117, 117, 117, 286, 127, 257, 57, 288, 289, 290, - 291, 308, 262, 262, 295, 301, 262, 302, 127, 127, - 127, 296, 256, 127, 297, 103, 17, 53, 110, 111, - 116, 450, 151, 151, 453, 300, 313, 314, 118, 199, - 315, 152, 152, 316, 317, 318, 264, 338, 341, 267, - 344, 153, 350, 352, 463, 464, 115, 384, 127, 361, - 257, 144, 145, 146, 147, 148, 362, 369, 117, 370, - 371, 262, 372, 386, 390, 392, 388, 394, 127, 262, - 359, 151, 407, 169, 409, 396, 127, 411, 435, 422, - 152, 172, 439, 423, 23, 437, 421, 455, 440, 153, - 153, 441, 443, 445, 451, 456, 127, 127, 116, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 457, - 458, 460, 461, 462, 256, 24, 256, 25, 312, 263, - 452, 402, 266, 120, 259, 269, 117, 270, 153, 272, - 294, 0, 273, 0, 0, 127, 0, 308, 0, 0, - 0, 0, 0, 346, 127, 119, 0, 0, 0, 0, - 0, 0, 257, 442, 257, 444, 256, 446, 116, 256, - 0, 0, 282, 262, 0, 262, 364, 365, 420, 259, - 127, 0, 127, 0, 259, 299, 121, 0, 0, 256, - 256, 0, 0, 0, 0, 0, 0, 0, 306, 259, - 259, 0, 0, 259, 257, 0, 117, 257, 0, 0, - 0, 122, 0, 385, 0, 262, 387, 262, 262, 0, - 0, 0, 127, 0, 127, 127, 0, 257, 257, 0, - 0, 0, 0, -201, -201, 0, -201, 0, 262, 262, - -201, 0, 0, 0, 345, 127, 127, 0, 123, -201, - 0, 0, -201, 0, 0, 351, 0, 353, 259, 0, - 360, 260, 0, 0, 0, 413, 259, 0, 0, 0, - 0, 0, 273, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 431, 124, 432, 0, 433, 368, 0, 0, - -201, -201, 261, 0, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 260, 0, 0, 0, - 0, 260, 389, 0, 0, 0, 0, 122, 0, 0, - 0, 125, 0, 0, 0, 307, 260, 260, 0, 0, - 260, 0, 0, 0, 0, 0, 0, 261, 403, 404, - 405, 406, 261, 0, 306, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 123, 0, 121, 309, 310, 0, - 0, 261, 122, 415, 0, 417, 419, 122, 35, 36, - 259, 38, 259, 0, 0, 6, 42, 43, 44, 45, - 0, 122, 122, 122, 113, 260, 122, 0, 0, 124, - 0, 0, 0, 260, -209, -209, 0, -209, 0, 123, - 0, -209, 0, 0, 123, 0, 154, 0, 454, 0, - -209, 0, 259, -209, 259, 259, 261, 0, 123, 123, - 123, 0, 0, 123, 358, 17, 53, 125, 0, 0, - 0, 0, 0, 0, 124, 259, 259, 0, 0, 124, - 0, 122, 0, 0, 0, 0, 0, 0, 0, 122, - 0, -209, -209, 124, 124, 124, 0, 0, 124, 35, - 36, 0, 38, 0, 0, 0, 6, 42, 43, 44, - 45, 307, 125, 0, 0, 221, 0, 125, 123, 0, - 0, 0, 0, 222, 223, 0, 123, -202, -202, 0, - -202, 125, 125, 125, -202, 0, 125, 260, 0, 260, - 0, 0, 121, -202, 0, 0, -202, 0, 0, 0, - 0, 0, 0, 124, 0, 0, 17, 53, 0, -203, - -203, 124, -203, 0, 0, 0, -203, 122, 261, 0, - 261, 0, 0, 0, 0, -203, 0, 0, -203, 260, - 0, 260, 260, 0, -202, -202, 0, 0, 0, -204, - -204, 125, -204, 122, 0, 122, -204, 0, 0, 125, - 0, 0, 260, 260, 123, -204, 0, 0, -204, 0, - 261, 0, 358, 261, 131, 132, -203, -203, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 123, 0, 123, 261, 261, 122, 0, 122, 122, 124, - 144, 145, 146, 147, 148, 0, -204, -204, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 34, 122, 122, - 0, 0, 0, 0, 0, 124, 0, 124, 0, 0, - 0, 0, 123, 0, 123, 123, 0, 125, 0, 0, - 0, 35, 36, 37, 38, 39, 40, 41, 6, 42, - 43, 44, 45, 46, 0, 123, 123, 104, 105, 0, - 0, 48, 0, 125, 0, 125, 0, 124, 0, 124, - 124, 0, 0, 0, 0, 0, 0, 49, 50, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 124, 124, 0, 0, 51, 0, 0, 52, 17, 53, - 30, 54, 55, 56, 0, 125, 0, 125, 125, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, - 0, 0, 0, 0, 0, 0, 0, 203, 125, 125, - 204, 205, 206, 0, 207, 208, 209, 210, 0, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 35, 36, - 0, 38, 0, 0, 0, 6, 42, 43, 44, 45, - 0, 0, 157, 220, 221, 0, 0, 0, 0, 0, - 0, 202, 222, 223, 0, 0, 0, 0, 0, 203, - 0, 0, 204, 205, 206, 0, 207, 208, 209, 210, - 0, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 35, 36, 0, 38, 0, 17, 53, 6, 42, 43, - 44, 45, 0, 0, 157, 311, 221, 0, 0, 0, - 0, 0, 0, 0, 222, 223, 0, 0, 0, 0, - 0, 0, 35, 36, 0, 38, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 149, 279, - 0, 150, 0, 0, 0, 0, 203, 17, 53, 204, - 205, 206, 0, 207, 208, 209, 210, 0, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 35, 36, 0, - 38, 0, 0, 0, 6, 42, 43, 44, 45, 17, - 53, 157, 0, 221, 0, 0, 0, 0, 0, 0, - 0, 222, 223, 0, 0, 0, 0, 0, 0, -205, - -205, 0, -205, 0, 0, 0, -205, 0, 0, 0, - 0, 0, 0, 0, 0, -205, 347, 0, -205, 0, - 0, 0, 0, 203, 17, 53, 204, 205, 206, 0, - 207, 208, 209, 210, 0, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 35, 36, 34, 38, 0, 0, - 0, 6, 42, 43, 44, 45, -205, -205, 157, 0, - 221, 0, 0, 0, 0, 0, 0, 0, 222, 223, - 35, 36, 37, 38, 39, 40, 41, 6, 42, 43, - 44, 45, 46, 0, 0, 0, 47, 0, 0, 0, - 48, 0, 298, 0, 0, 0, 0, -206, -206, 0, - -206, 17, 53, 0, -206, 0, 49, 50, 0, 34, - 0, 0, 0, -206, 0, 0, -206, 0, 0, 0, - 0, 0, 0, 51, 0, 0, 52, 17, 53, 30, - 54, 55, 56, 35, 36, 37, 38, 39, 40, 41, - 6, 42, 43, 44, 45, 46, 0, 0, 0, 47, - 0, 0, 0, 48, -206, -206, 0, -207, -207, 0, - -207, 0, 0, 0, -207, 0, 0, 0, 0, 49, - 50, 0, 34, -207, 0, 0, -207, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 51, 0, 0, 52, - 17, 53, 30, 54, 55, 56, 35, 36, 37, 38, - 39, 40, 41, 6, 42, 43, 44, 45, 46, 0, - 0, 0, 104, 0, -207, -207, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -208, -208, 0, - -208, 0, 49, 50, -208, 0, 0, 0, 0, 0, - 0, 0, 0, -208, 0, 0, -208, 0, 0, 51, - 0, 0, 52, 17, 53, 30, 54, 55, 56, 203, - 0, 0, 204, 205, 206, 0, 207, 208, 209, 210, - 0, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 35, 36, 0, 38, -208, -208, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 0, 221, 0, 0, 0, - 0, 0, 0, 0, 222, 223, 35, 36, 0, 38, - 0, 0, 0, 6, 0, 0, 35, 36, 0, 38, - 0, 0, 149, 6, 0, 174, 0, 0, 0, 0, - 323, 324, 149, 0, 0, 174, 0, 17, 53, 0, - 0, 0, 0, 0, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 0, 0, 0, 0, 0, - 0, 0, 167, 17, 53, 0, 0, 168, 0, 0, - 0, 0, 130, 17, 53, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 425, 0, 0, 0, - 0, 426, 0, 0, 0, 0, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 427, 0, 0, 0, 0, 428, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 429, 0, 0, 0, 0, 430, - 0, 0, 0, 0, 130, 0, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 167, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 393, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 395, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 399, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 412, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 130, 0, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 424, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 436, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 438, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 459, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 271, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 276, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 336, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 339, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 342, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 343, 0, 0, 0, 0, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 275, 0, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 129, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 349, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 363, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 131, 132, 0, - 134, 135, 136, 137, 138, 139, 140, 131, 132, 0, - 0, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 0, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 131, 132, - 0, 0, 135, 136, 137, 138, 139, 140, 131, 132, - 0, 0, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 142, 143, 144, 145, 146, 147, 148, 0, - 0, 0, 142, 0, 144, 145, 146, 147, 148, 131, - 132, 0, 0, 0, 0, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 144, 145, 146, 147, 148 - }; - - const short - parser::yycheck_[] = - { - 0, 94, 51, 289, 47, 47, 21, 74, 202, 9, - 3, 4, 289, 207, 56, 289, 74, 11, 12, 13, - 14, 15, 40, 41, 47, 43, 26, 47, 52, 47, - 48, 49, 50, 51, 52, 35, 36, 0, 56, 30, - 51, 53, 35, 36, 52, 99, 58, 52, 48, 62, - 47, 51, 62, 47, 121, 97, 98, 62, 51, 56, - 52, 104, 98, 121, 53, 57, 58, 58, 17, 18, - 78, 20, 21, 56, 74, 98, 93, 62, 98, 97, - 98, 74, 99, 101, 102, 102, 60, 281, 53, 57, - 58, 40, 41, 58, 43, 95, 66, 67, 47, 60, - 97, 98, 97, 98, 98, 56, 53, 56, 157, 53, - 59, 58, 53, 53, 58, 64, 65, 58, 58, 57, - 58, 121, 92, 93, 94, 95, 96, 52, 121, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 53, 60, 53, 57, 58, 58, 157, 58, 97, 98, - 54, 437, 52, 202, 53, 155, 53, 157, 207, 58, - 437, 58, 162, 437, 157, 165, 53, 94, 95, 96, - 56, 58, 221, 222, 223, 175, 53, 226, 53, 40, - 41, 58, 43, 58, 60, 56, 47, 48, 49, 50, - 51, 202, 58, 57, 261, 56, 207, 212, 56, 393, - 60, 395, 202, 261, 52, 98, 52, 207, 62, 202, - 221, 222, 223, 52, 207, 226, 27, 52, 52, 52, - 52, 221, 222, 223, 61, 52, 226, 52, 221, 222, - 223, 62, 281, 226, 62, 46, 97, 98, 49, 50, - 289, 435, 309, 310, 438, 62, 62, 62, 51, 154, - 62, 309, 310, 62, 62, 78, 161, 52, 52, 164, - 57, 261, 53, 27, 458, 459, 102, 57, 261, 61, - 281, 92, 93, 94, 95, 96, 61, 52, 289, 52, - 52, 281, 52, 57, 52, 62, 57, 52, 281, 289, - 290, 358, 52, 104, 52, 62, 289, 52, 25, 62, - 358, 112, 30, 62, 9, 62, 399, 53, 62, 309, - 310, 62, 62, 62, 62, 53, 309, 310, 367, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 53, - 53, 62, 62, 62, 393, 9, 395, 9, 226, 160, - 437, 367, 163, 51, 157, 166, 367, 168, 358, 170, - 212, -1, 173, -1, -1, 358, -1, 367, -1, -1, - -1, -1, -1, 278, 367, 51, -1, -1, -1, -1, - -1, -1, 393, 426, 395, 428, 435, 430, 437, 438, - -1, -1, 203, 393, -1, 395, 301, 302, 398, 202, - 393, -1, 395, -1, 207, 216, 51, -1, -1, 458, - 459, -1, -1, -1, -1, -1, -1, -1, 221, 222, - 223, -1, -1, 226, 435, -1, 437, 438, -1, -1, - -1, 51, -1, 338, -1, 435, 341, 437, 438, -1, - -1, -1, 435, -1, 437, 438, -1, 458, 459, -1, - -1, -1, -1, 40, 41, -1, 43, -1, 458, 459, - 47, -1, -1, -1, 275, 458, 459, -1, 51, 56, - -1, -1, 59, -1, -1, 286, -1, 288, 281, -1, - 291, 157, -1, -1, -1, 390, 289, -1, -1, -1, - -1, -1, 303, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 407, 51, 409, -1, 411, 318, -1, -1, - 97, 98, 157, -1, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, -1, 202, -1, -1, -1, - -1, 207, 343, -1, -1, -1, -1, 157, -1, -1, - -1, 51, -1, -1, -1, 221, 222, 223, -1, -1, - 226, -1, -1, -1, -1, -1, -1, 202, 369, 370, - 371, 372, 207, -1, 367, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 157, -1, 221, 222, 223, -1, - -1, 226, 202, 394, -1, 396, 397, 207, 40, 41, - 393, 43, 395, -1, -1, 47, 48, 49, 50, 51, - -1, 221, 222, 223, 56, 281, 226, -1, -1, 157, - -1, -1, -1, 289, 40, 41, -1, 43, -1, 202, - -1, 47, -1, -1, 207, -1, 52, -1, 439, -1, - 56, -1, 435, 59, 437, 438, 281, -1, 221, 222, - 223, -1, -1, 226, 289, 97, 98, 157, -1, -1, - -1, -1, -1, -1, 202, 458, 459, -1, -1, 207, - -1, 281, -1, -1, -1, -1, -1, -1, -1, 289, - -1, 97, 98, 221, 222, 223, -1, -1, 226, 40, - 41, -1, 43, -1, -1, -1, 47, 48, 49, 50, - 51, 367, 202, -1, -1, 56, -1, 207, 281, -1, - -1, -1, -1, 64, 65, -1, 289, 40, 41, -1, - 43, 221, 222, 223, 47, -1, 226, 393, -1, 395, - -1, -1, 367, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, 281, -1, -1, 97, 98, -1, 40, - 41, 289, 43, -1, -1, -1, 47, 367, 393, -1, - 395, -1, -1, -1, -1, 56, -1, -1, 59, 435, - -1, 437, 438, -1, 97, 98, -1, -1, -1, 40, - 41, 281, 43, 393, -1, 395, 47, -1, -1, 289, - -1, -1, 458, 459, 367, 56, -1, -1, 59, -1, - 435, -1, 437, 438, 66, 67, 97, 98, 70, 71, - 72, 73, 74, 75, -1, -1, -1, -1, -1, -1, - 393, -1, 395, 458, 459, 435, -1, 437, 438, 367, - 92, 93, 94, 95, 96, -1, 97, 98, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 16, 458, 459, - -1, -1, -1, -1, -1, 393, -1, 395, -1, -1, - -1, -1, 435, -1, 437, 438, -1, 367, -1, -1, - -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, -1, 458, 459, 56, 57, -1, - -1, 60, -1, 393, -1, 395, -1, 435, -1, 437, - 438, -1, -1, -1, -1, -1, -1, 76, 77, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 458, 459, -1, -1, 93, -1, -1, 96, 97, 98, - 99, 100, 101, 102, -1, 435, -1, 437, 438, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, - -1, -1, -1, -1, -1, -1, -1, 19, 458, 459, - 22, 23, 24, -1, 26, 27, 28, 29, -1, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - -1, 43, -1, -1, -1, 47, 48, 49, 50, 51, - -1, -1, 54, 55, 56, -1, -1, -1, -1, -1, - -1, 11, 64, 65, -1, -1, -1, -1, -1, 19, - -1, -1, 22, 23, 24, -1, 26, 27, 28, 29, - -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, -1, 43, -1, 97, 98, 47, 48, 49, - 50, 51, -1, -1, 54, 55, 56, -1, -1, -1, - -1, -1, -1, -1, 64, 65, -1, -1, -1, -1, - -1, -1, 40, 41, -1, 43, -1, -1, -1, 47, - -1, -1, -1, -1, -1, -1, -1, -1, 56, 12, - -1, 59, -1, -1, -1, -1, 19, 97, 98, 22, - 23, 24, -1, 26, 27, 28, 29, -1, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, -1, - 43, -1, -1, -1, 47, 48, 49, 50, 51, 97, - 98, 54, -1, 56, -1, -1, -1, -1, -1, -1, - -1, 64, 65, -1, -1, -1, -1, -1, -1, 40, - 41, -1, 43, -1, -1, -1, 47, -1, -1, -1, - -1, -1, -1, -1, -1, 56, 12, -1, 59, -1, - -1, -1, -1, 19, 97, 98, 22, 23, 24, -1, - 26, 27, 28, 29, -1, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 16, 43, -1, -1, - -1, 47, 48, 49, 50, 51, 97, 98, 54, -1, - 56, -1, -1, -1, -1, -1, -1, -1, 64, 65, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, -1, -1, -1, 56, -1, -1, -1, - 60, -1, 62, -1, -1, -1, -1, 40, 41, -1, - 43, 97, 98, -1, 47, -1, 76, 77, -1, 16, - -1, -1, -1, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, 93, -1, -1, 96, 97, 98, 99, - 100, 101, 102, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, -1, -1, -1, 56, - -1, -1, -1, 60, 97, 98, -1, 40, 41, -1, - 43, -1, -1, -1, 47, -1, -1, -1, -1, 76, - 77, -1, 16, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 93, -1, -1, 96, - 97, 98, 99, 100, 101, 102, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, - -1, -1, 56, -1, 97, 98, 60, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, - 43, -1, 76, 77, 47, -1, -1, -1, -1, -1, - -1, -1, -1, 56, -1, -1, 59, -1, -1, 93, - -1, -1, 96, 97, 98, 99, 100, 101, 102, 19, - -1, -1, 22, 23, 24, -1, 26, 27, 28, 29, - -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, -1, 43, 97, 98, -1, 47, 48, 49, - 50, 51, -1, -1, 54, -1, 56, -1, -1, -1, - -1, -1, -1, -1, 64, 65, 40, 41, -1, 43, - -1, -1, -1, 47, -1, -1, 40, 41, -1, 43, - -1, -1, 56, 47, -1, 59, -1, -1, -1, -1, - 64, 65, 56, -1, -1, 59, -1, 97, 98, -1, - -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, -1, -1, -1, -1, -1, - -1, -1, 53, 97, 98, -1, -1, 58, -1, -1, - -1, -1, 63, 97, 98, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 53, -1, -1, -1, - -1, 58, -1, -1, -1, -1, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 53, -1, -1, -1, -1, 58, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 53, -1, -1, -1, -1, 58, - -1, -1, -1, -1, 63, -1, -1, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 63, -1, - -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 53, -1, 89, 90, 91, 92, 93, 94, - 95, 96, 63, -1, -1, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 53, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 53, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 53, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 63, -1, -1, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 63, -1, - -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 53, -1, 89, 90, 91, 92, 93, 94, - 95, 96, 63, -1, -1, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 53, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 53, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 58, -1, -1, -1, -1, 63, - -1, -1, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 89, 90, 91, 92, 93, - 94, 95, 96, 61, -1, 63, -1, -1, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 89, 90, 91, 92, 93, 94, 95, 96, 62, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 62, 63, -1, -1, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 89, 90, 91, 92, 93, 94, 95, 96, 62, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 63, -1, -1, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 89, 90, 91, 92, - 93, 94, 95, 96, -1, -1, -1, -1, -1, 89, - 90, 91, 92, 93, 94, 95, 96, 66, 67, -1, - 69, 70, 71, 72, 73, 74, 75, 66, 67, -1, - -1, 70, 71, 72, 73, 74, 75, -1, -1, -1, - 89, 90, 91, 92, 93, 94, 95, 96, -1, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 66, 67, - -1, -1, 70, 71, 72, 73, 74, 75, 66, 67, - -1, -1, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, 90, 91, 92, 93, 94, 95, 96, -1, - -1, -1, 90, -1, 92, 93, 94, 95, 96, 66, - 67, -1, -1, -1, -1, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 92, 93, 94, 95, 96 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 47, 98, 114, 115, - 116, 117, 118, 119, 120, 121, 191, 97, 98, 192, - 192, 52, 0, 116, 117, 118, 52, 78, 62, 62, - 99, 194, 169, 191, 16, 40, 41, 42, 43, 44, - 45, 46, 48, 49, 50, 51, 52, 56, 60, 76, - 77, 93, 96, 98, 100, 101, 102, 153, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 172, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 53, 53, 58, 56, 191, 192, 56, - 191, 192, 56, 153, 56, 57, 153, 170, 171, 191, - 153, 153, 52, 56, 101, 102, 164, 165, 176, 177, - 179, 180, 184, 185, 186, 187, 191, 192, 98, 62, - 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 89, 90, 91, 92, 93, 94, 95, 96, 56, - 59, 166, 167, 191, 52, 60, 62, 54, 127, 191, - 56, 52, 60, 56, 52, 60, 56, 53, 58, 153, - 58, 57, 153, 56, 59, 60, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 47, 98, 190, 170, - 171, 191, 11, 19, 22, 23, 24, 26, 27, 28, - 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 55, 56, 64, 65, 122, 123, 125, 126, 127, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 155, 156, 157, 164, 165, 173, 176, - 177, 180, 191, 153, 170, 191, 153, 170, 191, 153, - 153, 57, 153, 153, 191, 61, 57, 53, 52, 12, - 122, 124, 153, 62, 52, 62, 52, 122, 52, 52, - 52, 52, 93, 194, 197, 61, 62, 62, 62, 153, - 62, 52, 52, 56, 174, 175, 176, 177, 191, 180, - 180, 55, 123, 62, 62, 62, 62, 62, 78, 17, - 18, 20, 21, 64, 65, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 57, 53, 52, 57, - 53, 52, 57, 58, 57, 153, 170, 12, 122, 62, - 53, 153, 27, 153, 128, 155, 156, 157, 180, 191, - 153, 61, 61, 62, 170, 170, 57, 58, 153, 52, - 52, 52, 52, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 57, 170, 57, 170, 57, 153, - 52, 53, 62, 53, 52, 53, 62, 30, 58, 53, - 53, 53, 175, 153, 153, 153, 153, 52, 53, 52, - 53, 52, 53, 170, 122, 153, 122, 153, 154, 153, - 191, 127, 62, 62, 53, 53, 58, 53, 58, 53, - 58, 170, 170, 170, 53, 25, 53, 62, 53, 30, - 62, 62, 171, 62, 171, 62, 171, 53, 53, 53, - 122, 62, 128, 122, 153, 53, 53, 53, 53, 53, - 62, 62, 62, 122, 122 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 113, 114, 114, 115, 115, 115, 115, 115, 115, - 116, 117, 118, 118, 118, 118, 118, 119, 120, 121, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 123, 123, 124, 124, 125, - 125, 126, 126, 127, 127, 128, 128, 128, 128, 129, - 129, 130, 130, 130, 131, 132, 132, 133, 134, 134, - 135, 135, 136, 137, 137, 138, 139, 140, 141, 142, - 143, 143, 144, 145, 145, 146, 147, 148, 149, 149, - 150, 151, 152, 153, 153, 153, 154, 154, 155, 155, - 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, - 156, 156, 157, 157, 158, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 161, 162, 162, 162, 162, 163, 164, 164, 165, - 165, 166, 166, 166, 166, 166, 166, 167, 167, 167, - 167, 168, 169, 169, 169, 170, 170, 171, 171, 172, - 172, 173, 174, 174, 175, 175, 175, 176, 177, 178, - 179, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 191, 192, 192, 193, 194, 195, 196, 196, 197, - 197, 198, 199 - }; - - 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, 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, 2, 4, 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, 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, 2, 2, 2, 2, 2, 2, 1, 1, 2, - 2, 4, 6, 5, 7, 5, 7, 8, 9, 9, - 9, 3, 3, 1, 0, 1, 0, 3, 1, 2, - 3, 3, 3, 1, 1, 1, 1, 4, 3, 3, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 2, 1, 2, - 1, 1, 1 - }; - - - - -#if S1CDEBUG - const short - parser::yyrline_[] = - { - 0, 263, 263, 264, 268, 270, 272, 274, 276, 278, - 283, 287, 292, 293, 294, 295, 296, 300, 305, 310, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 343, 344, 348, 350, 355, - 357, 362, 363, 367, 368, 372, 374, 376, 379, 383, - 385, 390, 392, 394, 399, 404, 406, 411, 416, 418, - 423, 425, 430, 435, 437, 442, 447, 452, 457, 462, - 467, 469, 474, 479, 481, 486, 491, 496, 501, 503, - 508, 513, 518, 523, 524, 525, 529, 530, 534, 536, - 538, 540, 542, 544, 546, 548, 550, 552, 554, 556, - 561, 563, 568, 570, 575, 580, 582, 584, 586, 588, - 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, - 610, 612, 614, 619, 620, 621, 622, 623, 624, 625, - 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, - 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, - 646, 650, 655, 657, 659, 661, 666, 671, 672, 675, - 676, 680, 682, 684, 686, 688, 690, 695, 697, 699, - 701, 706, 711, 713, 716, 720, 723, 727, 729, 734, - 736, 741, 746, 748, 753, 754, 755, 759, 764, 769, - 774, 779, 780, 781, 782, 783, 784, 785, 786, 787, - 791, 796, 801, 806, 811, 816, 821, 826, 831, 836, - 841, 843, 848, 850, 855, 860, 865, 870, 872, 877, - 879, 884, 889 - }; - - 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 // S1CDEBUG - - -#line 13 "parser.ypp" -} } } // xsk::gsc::s1c -#line 4726 "parser.cpp" - -#line 893 "parser.ypp" - - -void xsk::gsc::s1c::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/src/experimental/s1c/xsk/parser.hpp b/src/experimental/s1c/xsk/parser.hpp deleted file mode 100644 index 8faccf8b..00000000 --- a/src/experimental/s1c/xsk/parser.hpp +++ /dev/null @@ -1,5601 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// 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::gsc::s1c::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_S1C_PARSER_HPP_INCLUDED -# define YY_S1C_PARSER_HPP_INCLUDED -// "%code requires" blocks. -#line 28 "parser.ypp" - -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "s1c.hpp" -namespace xsk::gsc::s1c { class lexer; } - -#line 58 "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 S1C_ASSERT -# include -# define S1C_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 - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# 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 S1CDEBUG -# if defined YYDEBUG -#if YYDEBUG -# define S1CDEBUG 1 -# else -# define S1CDEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define S1CDEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined S1CDEBUG */ - -#line 13 "parser.ypp" -namespace xsk { namespace gsc { namespace s1c { -#line 207 "parser.hpp" - - - - - /// A Bison parser. - class parser - { - public: -#ifdef S1CSTYPE -# ifdef __GNUC__ -# pragma GCC message "bison: do not #define S1CSTYPE in C++, use %define api.value.type" -# endif - typedef S1CSTYPE value_type; -#else - /// 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 value_type - { - public: - /// Type of *this. - typedef value_type self_type; - - /// Empty construction. - value_type () YY_NOEXCEPT - : yyraw_ () - , yytypeid_ (YY_NULLPTR) - {} - - /// Construct and fill. - template - value_type (YY_RVREF (T) t) - : yytypeid_ (&typeid (T)) - { - S1C_ASSERT (sizeof (T) <= size); - new (yyas_ ()) T (YY_MOVE (t)); - } - -#if 201103L <= YY_CPLUSPLUS - /// Non copyable. - value_type (const self_type&) = delete; - /// Non copyable. - self_type& operator= (const self_type&) = delete; -#endif - - /// Destruction, allowed only if empty. - ~value_type () YY_NOEXCEPT - { - S1C_ASSERT (!yytypeid_); - } - -# if 201103L <= YY_CPLUSPLUS - /// Instantiate a \a T in here from \a t. - template - T& - emplace (U&&... u) - { - S1C_ASSERT (!yytypeid_); - S1C_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 () - { - S1C_ASSERT (!yytypeid_); - S1C_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) - { - S1C_ASSERT (!yytypeid_); - S1C_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 - { - S1C_ASSERT (yytypeid_); - S1C_ASSERT (*yytypeid_ == typeid (T)); - S1C_ASSERT (sizeof (T) <= size); - return *yyas_ (); - } - - /// Const accessor to a built \a T (for %printer). - template - const T& - as () const YY_NOEXCEPT - { - S1C_ASSERT (yytypeid_); - S1C_ASSERT (*yytypeid_ == typeid (T)); - S1C_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 - { - S1C_ASSERT (yytypeid_); - S1C_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. - value_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 = yyraw_; - return static_cast (yyp); - } - - /// Const accessor to raw memory as \a T. - template - const T* - yyas_ () const YY_NOEXCEPT - { - const void *yyp = 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_tuple - // expr_tuple_types - // expr_object - char dummy6[sizeof (ast::expr)]; - - // expr_add_array - char dummy7[sizeof (ast::expr_add_array::ptr)]; - - // expr_anim - char dummy8[sizeof (ast::expr_anim::ptr)]; - - // expr_animation - char dummy9[sizeof (ast::expr_animation::ptr)]; - - // expr_animtree - char dummy10[sizeof (ast::expr_animtree::ptr)]; - - // expr_arguments - // expr_arguments_no_empty - char dummy11[sizeof (ast::expr_arguments::ptr)]; - - // expr_array - char dummy12[sizeof (ast::expr_array::ptr)]; - - // expr_call - char dummy13[sizeof (ast::expr_call::ptr)]; - - // expr_complement - char dummy14[sizeof (ast::expr_complement::ptr)]; - - // expr_empty_array - char dummy15[sizeof (ast::expr_empty_array::ptr)]; - - // expr_false - char dummy16[sizeof (ast::expr_false::ptr)]; - - // expr_field - char dummy17[sizeof (ast::expr_field::ptr)]; - - // expr_float - char dummy18[sizeof (ast::expr_float::ptr)]; - - // expr_game - char dummy19[sizeof (ast::expr_game::ptr)]; - - // expr_identifier_nosize - // expr_identifier - char dummy20[sizeof (ast::expr_identifier::ptr)]; - - // expr_integer - char dummy21[sizeof (ast::expr_integer::ptr)]; - - // expr_istring - char dummy22[sizeof (ast::expr_istring::ptr)]; - - // expr_level - char dummy23[sizeof (ast::expr_level::ptr)]; - - // expr_method - char dummy24[sizeof (ast::expr_method::ptr)]; - - // expr_negate - char dummy25[sizeof (ast::expr_negate::ptr)]; - - // expr_not - char dummy26[sizeof (ast::expr_not::ptr)]; - - // expr_parameters - char dummy27[sizeof (ast::expr_parameters::ptr)]; - - // expr_paren - char dummy28[sizeof (ast::expr_paren::ptr)]; - - // expr_path - char dummy29[sizeof (ast::expr_path::ptr)]; - - // expr_reference - char dummy30[sizeof (ast::expr_reference::ptr)]; - - // expr_self - char dummy31[sizeof (ast::expr_self::ptr)]; - - // expr_size - char dummy32[sizeof (ast::expr_size::ptr)]; - - // expr_string - char dummy33[sizeof (ast::expr_string::ptr)]; - - // expr_thisthread - char dummy34[sizeof (ast::expr_thisthread::ptr)]; - - // expr_true - char dummy35[sizeof (ast::expr_true::ptr)]; - - // expr_tuple_arguments - char dummy36[sizeof (ast::expr_tuple::ptr)]; - - // expr_undefined - char dummy37[sizeof (ast::expr_undefined::ptr)]; - - // expr_vector - char dummy38[sizeof (ast::expr_vector::ptr)]; - - // include - char dummy39[sizeof (ast::include::ptr)]; - - // program - char dummy40[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy41[sizeof (ast::stmt)]; - - // stmt_assign - char dummy42[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy43[sizeof (ast::stmt_break::ptr)]; - - // stmt_breakpoint - char dummy44[sizeof (ast::stmt_breakpoint::ptr)]; - - // stmt_call - char dummy45[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy46[sizeof (ast::stmt_case::ptr)]; - - // stmt_continue - char dummy47[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy48[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy49[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy50[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy51[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy52[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy53[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy54[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy55[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy56[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy57[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy58[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy59[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy60[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy61[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy62[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy63[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waitframe - char dummy64[sizeof (ast::stmt_waitframe::ptr)]; - - // stmt_waittill - char dummy65[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy66[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy67[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy68[sizeof (ast::stmt_while::ptr)]; - - // "path" - // "identifier" - // "string literal" - // "localized string" - // "float" - // "integer" - char dummy69[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]; - }; - - /// Whether the content is built: if defined, the name of the stored type. - const std::type_info *yytypeid_; - }; - -#endif - /// Backward compatibility (Bison 3.8). - typedef value_type semantic_type; - - /// Symbol locations. - typedef xsk::gsc::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 - { - S1CEMPTY = -2, - S1CEOF = 0, // "end of file" - S1Cerror = 1, // error - S1CUNDEF = 2, // "invalid token" - SH_DEFINE = 3, // "#define" - SH_UNDEF = 4, // "#undef" - SH_IFDEF = 5, // "#ifdef" - SH_IFNDEF = 6, // "#ifndef" - SH_IF = 7, // "#if" - SH_ELIF = 8, // "#elif" - SH_ELSE = 9, // "#else" - SH_ENDIF = 10, // "#endif" - DEVBEGIN = 11, // "/#" - DEVEND = 12, // "#/" - INLINE = 13, // "#inline" - INCLUDE = 14, // "#include" - USINGTREE = 15, // "#using_animtree" - ANIMTREE = 16, // "#animtree" - ENDON = 17, // "endon" - NOTIFY = 18, // "notify" - WAIT = 19, // "wait" - WAITTILL = 20, // "waittill" - WAITTILLMATCH = 21, // "waittillmatch" - WAITTILLFRAMEEND = 22, // "waittillframeend" - WAITFRAME = 23, // "waitframe" - IF = 24, // "if" - ELSE = 25, // "else" - DO = 26, // "do" - WHILE = 27, // "while" - FOR = 28, // "for" - FOREACH = 29, // "foreach" - IN = 30, // "in" - SWITCH = 31, // "switch" - CASE = 32, // "case" - DEFAULT = 33, // "default" - BREAK = 34, // "break" - CONTINUE = 35, // "continue" - RETURN = 36, // "return" - BREAKPOINT = 37, // "breakpoint" - PROFBEGIN = 38, // "prof_begin" - PROFEND = 39, // "prof_end" - THREAD = 40, // "thread" - CHILDTHREAD = 41, // "childthread" - THISTHREAD = 42, // "thisthread" - CALL = 43, // "call" - TRUE = 44, // "true" - FALSE = 45, // "false" - UNDEFINED = 46, // "undefined" - SIZE = 47, // "size" - GAME = 48, // "game" - SELF = 49, // "self" - ANIM = 50, // "anim" - LEVEL = 51, // "level" - LPAREN = 52, // "(" - RPAREN = 53, // ")" - LBRACE = 54, // "{" - RBRACE = 55, // "}" - LBRACKET = 56, // "[" - RBRACKET = 57, // "]" - COMMA = 58, // "," - DOT = 59, // "." - DOUBLECOLON = 60, // "::" - COLON = 61, // ":" - SEMICOLON = 62, // ";" - QMARK = 63, // "?" - INCREMENT = 64, // "++" - DECREMENT = 65, // "--" - LSHIFT = 66, // "<<" - RSHIFT = 67, // ">>" - OR = 68, // "||" - AND = 69, // "&&" - EQUALITY = 70, // "==" - INEQUALITY = 71, // "!=" - LESS_EQUAL = 72, // "<=" - GREATER_EQUAL = 73, // ">=" - LESS = 74, // "<" - GREATER = 75, // ">" - NOT = 76, // "!" - COMPLEMENT = 77, // "~" - ASSIGN = 78, // "=" - ASSIGN_ADD = 79, // "+=" - ASSIGN_SUB = 80, // "-=" - ASSIGN_MUL = 81, // "*=" - ASSIGN_DIV = 82, // "/=" - ASSIGN_MOD = 83, // "%=" - ASSIGN_BW_OR = 84, // "|=" - ASSIGN_BW_AND = 85, // "&=" - ASSIGN_BW_EXOR = 86, // "^=" - ASSIGN_RSHIFT = 87, // ">>=" - ASSIGN_LSHIFT = 88, // "<<=" - BITWISE_OR = 89, // "|" - BITWISE_AND = 90, // "&" - BITWISE_EXOR = 91, // "^" - ADD = 92, // "+" - SUB = 93, // "-" - MUL = 94, // "*" - DIV = 95, // "/" - MOD = 96, // "%" - PATH = 97, // "path" - IDENTIFIER = 98, // "identifier" - STRING = 99, // "string literal" - ISTRING = 100, // "localized string" - FLOAT = 101, // "float" - INTEGER = 102, // "integer" - SIZEOF = 103, // SIZEOF - ADD_ARRAY = 104, // ADD_ARRAY - THEN = 105, // THEN - TERN = 106, // TERN - NEG = 107, // NEG - ANIMREF = 108, // ANIMREF - PREINC = 109, // PREINC - PREDEC = 110, // PREDEC - POSTINC = 111, // POSTINC - POSTDEC = 112 // POSTDEC - }; - /// Backward compatibility alias (Bison 3.6). - typedef token_kind_type yytokentype; - }; - - /// Token kind, as returned by yylex. - typedef token::token_kind_type 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 = 113, ///< Number of tokens. - S_YYEMPTY = -2, - S_YYEOF = 0, // "end of file" - S_YYerror = 1, // error - S_YYUNDEF = 2, // "invalid token" - S_SH_DEFINE = 3, // "#define" - S_SH_UNDEF = 4, // "#undef" - S_SH_IFDEF = 5, // "#ifdef" - S_SH_IFNDEF = 6, // "#ifndef" - S_SH_IF = 7, // "#if" - S_SH_ELIF = 8, // "#elif" - S_SH_ELSE = 9, // "#else" - S_SH_ENDIF = 10, // "#endif" - S_DEVBEGIN = 11, // "/#" - S_DEVEND = 12, // "#/" - S_INLINE = 13, // "#inline" - S_INCLUDE = 14, // "#include" - S_USINGTREE = 15, // "#using_animtree" - S_ANIMTREE = 16, // "#animtree" - S_ENDON = 17, // "endon" - S_NOTIFY = 18, // "notify" - S_WAIT = 19, // "wait" - S_WAITTILL = 20, // "waittill" - S_WAITTILLMATCH = 21, // "waittillmatch" - S_WAITTILLFRAMEEND = 22, // "waittillframeend" - S_WAITFRAME = 23, // "waitframe" - S_IF = 24, // "if" - S_ELSE = 25, // "else" - S_DO = 26, // "do" - S_WHILE = 27, // "while" - S_FOR = 28, // "for" - S_FOREACH = 29, // "foreach" - S_IN = 30, // "in" - S_SWITCH = 31, // "switch" - S_CASE = 32, // "case" - S_DEFAULT = 33, // "default" - S_BREAK = 34, // "break" - S_CONTINUE = 35, // "continue" - S_RETURN = 36, // "return" - S_BREAKPOINT = 37, // "breakpoint" - S_PROFBEGIN = 38, // "prof_begin" - S_PROFEND = 39, // "prof_end" - S_THREAD = 40, // "thread" - S_CHILDTHREAD = 41, // "childthread" - S_THISTHREAD = 42, // "thisthread" - S_CALL = 43, // "call" - S_TRUE = 44, // "true" - S_FALSE = 45, // "false" - S_UNDEFINED = 46, // "undefined" - S_SIZE = 47, // "size" - S_GAME = 48, // "game" - S_SELF = 49, // "self" - S_ANIM = 50, // "anim" - S_LEVEL = 51, // "level" - S_LPAREN = 52, // "(" - S_RPAREN = 53, // ")" - S_LBRACE = 54, // "{" - S_RBRACE = 55, // "}" - S_LBRACKET = 56, // "[" - S_RBRACKET = 57, // "]" - S_COMMA = 58, // "," - S_DOT = 59, // "." - S_DOUBLECOLON = 60, // "::" - S_COLON = 61, // ":" - S_SEMICOLON = 62, // ";" - S_QMARK = 63, // "?" - S_INCREMENT = 64, // "++" - S_DECREMENT = 65, // "--" - S_LSHIFT = 66, // "<<" - S_RSHIFT = 67, // ">>" - S_OR = 68, // "||" - S_AND = 69, // "&&" - S_EQUALITY = 70, // "==" - S_INEQUALITY = 71, // "!=" - S_LESS_EQUAL = 72, // "<=" - S_GREATER_EQUAL = 73, // ">=" - S_LESS = 74, // "<" - S_GREATER = 75, // ">" - S_NOT = 76, // "!" - S_COMPLEMENT = 77, // "~" - S_ASSIGN = 78, // "=" - S_ASSIGN_ADD = 79, // "+=" - S_ASSIGN_SUB = 80, // "-=" - S_ASSIGN_MUL = 81, // "*=" - S_ASSIGN_DIV = 82, // "/=" - S_ASSIGN_MOD = 83, // "%=" - S_ASSIGN_BW_OR = 84, // "|=" - S_ASSIGN_BW_AND = 85, // "&=" - S_ASSIGN_BW_EXOR = 86, // "^=" - S_ASSIGN_RSHIFT = 87, // ">>=" - S_ASSIGN_LSHIFT = 88, // "<<=" - S_BITWISE_OR = 89, // "|" - S_BITWISE_AND = 90, // "&" - S_BITWISE_EXOR = 91, // "^" - S_ADD = 92, // "+" - S_SUB = 93, // "-" - S_MUL = 94, // "*" - S_DIV = 95, // "/" - S_MOD = 96, // "%" - S_PATH = 97, // "path" - S_IDENTIFIER = 98, // "identifier" - S_STRING = 99, // "string literal" - S_ISTRING = 100, // "localized string" - S_FLOAT = 101, // "float" - S_INTEGER = 102, // "integer" - S_SIZEOF = 103, // SIZEOF - S_ADD_ARRAY = 104, // ADD_ARRAY - S_THEN = 105, // THEN - S_TERN = 106, // TERN - S_NEG = 107, // NEG - S_ANIMREF = 108, // ANIMREF - S_PREINC = 109, // PREINC - S_PREDEC = 110, // PREDEC - S_POSTINC = 111, // POSTINC - S_POSTDEC = 112, // POSTDEC - S_YYACCEPT = 113, // $accept - S_root = 114, // root - S_program = 115, // program - S_inline = 116, // inline - S_include = 117, // include - S_declaration = 118, // declaration - S_decl_usingtree = 119, // decl_usingtree - S_decl_constant = 120, // decl_constant - S_decl_thread = 121, // decl_thread - S_stmt = 122, // stmt - S_stmt_or_dev = 123, // stmt_or_dev - S_stmt_list = 124, // stmt_list - S_stmt_or_dev_list = 125, // stmt_or_dev_list - S_stmt_dev = 126, // stmt_dev - S_stmt_block = 127, // stmt_block - S_stmt_expr = 128, // stmt_expr - S_stmt_call = 129, // stmt_call - S_stmt_assign = 130, // stmt_assign - S_stmt_endon = 131, // stmt_endon - S_stmt_notify = 132, // stmt_notify - S_stmt_wait = 133, // stmt_wait - S_stmt_waittill = 134, // stmt_waittill - S_stmt_waittillmatch = 135, // stmt_waittillmatch - S_stmt_waittillframeend = 136, // stmt_waittillframeend - S_stmt_waitframe = 137, // stmt_waitframe - S_stmt_if = 138, // stmt_if - S_stmt_ifelse = 139, // stmt_ifelse - S_stmt_while = 140, // stmt_while - S_stmt_dowhile = 141, // stmt_dowhile - S_stmt_for = 142, // stmt_for - S_stmt_foreach = 143, // stmt_foreach - S_stmt_switch = 144, // stmt_switch - S_stmt_case = 145, // stmt_case - S_stmt_default = 146, // stmt_default - S_stmt_break = 147, // stmt_break - S_stmt_continue = 148, // stmt_continue - S_stmt_return = 149, // stmt_return - S_stmt_breakpoint = 150, // stmt_breakpoint - S_stmt_prof_begin = 151, // stmt_prof_begin - S_stmt_prof_end = 152, // stmt_prof_end - S_expr = 153, // expr - S_expr_or_empty = 154, // expr_or_empty - S_expr_assign = 155, // expr_assign - S_expr_increment = 156, // expr_increment - S_expr_decrement = 157, // expr_decrement - S_expr_ternary = 158, // expr_ternary - S_expr_binary = 159, // expr_binary - S_expr_primitive = 160, // expr_primitive - S_expr_complement = 161, // expr_complement - S_expr_negate = 162, // expr_negate - S_expr_not = 163, // expr_not - S_expr_call = 164, // expr_call - S_expr_method = 165, // expr_method - S_expr_function = 166, // expr_function - S_expr_pointer = 167, // expr_pointer - S_expr_add_array = 168, // expr_add_array - S_expr_parameters = 169, // expr_parameters - S_expr_arguments = 170, // expr_arguments - S_expr_arguments_no_empty = 171, // expr_arguments_no_empty - S_expr_reference = 172, // expr_reference - S_expr_tuple = 173, // expr_tuple - S_expr_tuple_arguments = 174, // expr_tuple_arguments - S_expr_tuple_types = 175, // expr_tuple_types - S_expr_array = 176, // expr_array - S_expr_field = 177, // expr_field - S_expr_size = 178, // expr_size - S_expr_paren = 179, // expr_paren - S_expr_object = 180, // expr_object - S_expr_thisthread = 181, // expr_thisthread - S_expr_empty_array = 182, // expr_empty_array - S_expr_undefined = 183, // expr_undefined - S_expr_game = 184, // expr_game - S_expr_self = 185, // expr_self - S_expr_anim = 186, // expr_anim - S_expr_level = 187, // expr_level - S_expr_animation = 188, // expr_animation - S_expr_animtree = 189, // expr_animtree - S_expr_identifier_nosize = 190, // expr_identifier_nosize - S_expr_identifier = 191, // expr_identifier - S_expr_path = 192, // expr_path - S_expr_istring = 193, // expr_istring - S_expr_string = 194, // expr_string - S_expr_vector = 195, // expr_vector - S_expr_float = 196, // expr_float - S_expr_integer = 197, // expr_integer - S_expr_false = 198, // expr_false - S_expr_true = 199 // 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 () YY_NOEXCEPT - : 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::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_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_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_add_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_add_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_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_animtree::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_animtree::ptr& v, const location_type& l) - : 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_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_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_negate::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l) - : 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_thisthread::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_thisthread::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_tuple::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_tuple::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::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_waitframe::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_waitframe::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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.template destroy< ast::expr_add_array::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_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.template destroy< ast::expr_negate::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_thisthread: // expr_thisthread - value.template destroy< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.template destroy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.template destroy< ast::stmt_waitframe::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_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_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. - value_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 - { - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; - - /// Default constructor. - by_kind () YY_NOEXCEPT; - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that) YY_NOEXCEPT; -#endif - - /// Copy constructor. - by_kind (const by_kind& that) YY_NOEXCEPT; - - /// Constructor from (external) token numbers. - by_kind (kind_type t) YY_NOEXCEPT; - - - - /// 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 () YY_NOEXCEPT {} - - /// Constructor for valueless symbols, and symbols from each type. -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, location_type l) - : super_type (token_kind_type (tok), std::move (l)) -#else - symbol_type (int tok, const location_type& l) - : super_type (token_kind_type (tok), l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - S1C_ASSERT (tok == token::S1CEOF - || (token::S1Cerror <= tok && tok <= token::MOD) - || (token::SIZEOF <= tok && tok <= token::POSTDEC)); -#endif - } -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, std::string v, location_type l) - : super_type (token_kind_type (tok), std::move (v), std::move (l)) -#else - symbol_type (int tok, const std::string& v, const location_type& l) - : super_type (token_kind_type (tok), v, l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - S1C_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); -#endif - } - }; - - /// Build a parser object. - parser (xsk::gsc::s1c::lexer& lexer_yyarg, xsk::gsc::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 S1CDEBUG - /// 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 token kind. -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_S1CEOF (location_type l) - { - return symbol_type (token::S1CEOF, std::move (l)); - } -#else - static - symbol_type - make_S1CEOF (const location_type& l) - { - return symbol_type (token::S1CEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_S1Cerror (location_type l) - { - return symbol_type (token::S1Cerror, std::move (l)); - } -#else - static - symbol_type - make_S1Cerror (const location_type& l) - { - return symbol_type (token::S1Cerror, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_S1CUNDEF (location_type l) - { - return symbol_type (token::S1CUNDEF, std::move (l)); - } -#else - static - symbol_type - make_S1CUNDEF (const location_type& l) - { - return symbol_type (token::S1CUNDEF, 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_ANIMTREE (location_type l) - { - return symbol_type (token::ANIMTREE, std::move (l)); - } -#else - static - symbol_type - make_ANIMTREE (const location_type& l) - { - return symbol_type (token::ANIMTREE, 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_WAITFRAME (location_type l) - { - return symbol_type (token::WAITFRAME, std::move (l)); - } -#else - static - symbol_type - make_WAITFRAME (const location_type& l) - { - return symbol_type (token::WAITFRAME, 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_CHILDTHREAD (location_type l) - { - return symbol_type (token::CHILDTHREAD, std::move (l)); - } -#else - static - symbol_type - make_CHILDTHREAD (const location_type& l) - { - return symbol_type (token::CHILDTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_THISTHREAD (location_type l) - { - return symbol_type (token::THISTHREAD, std::move (l)); - } -#else - static - symbol_type - make_THISTHREAD (const location_type& l) - { - return symbol_type (token::THISTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_CALL (location_type l) - { - return symbol_type (token::CALL, std::move (l)); - } -#else - static - symbol_type - make_CALL (const location_type& l) - { - return symbol_type (token::CALL, 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_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_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_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_SIZEOF (location_type l) - { - return symbol_type (token::SIZEOF, std::move (l)); - } -#else - static - symbol_type - make_SIZEOF (const location_type& l) - { - return symbol_type (token::SIZEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_ADD_ARRAY (location_type l) - { - return symbol_type (token::ADD_ARRAY, std::move (l)); - } -#else - static - symbol_type - make_ADD_ARRAY (const location_type& l) - { - return symbol_type (token::ADD_ARRAY, 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) YY_NOEXCEPT; - - /// 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) YY_NOEXCEPT; - - 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_kind_type enum. - static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; - - - - // 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 symbol kind of the accessing symbol of - // state STATE-NUM. - static const unsigned char yystos_[]; - - // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. - static const unsigned char yyr1_[]; - - // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. - static const signed char yyr2_[]; - - -#if S1CDEBUG - // 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT; - - /// Constants. - enum - { - yylast_ = 2479, ///< Last index in yytable_. - yynnts_ = 87, ///< Number of nonterminal symbols. - yyfinal_ = 22 ///< Termination state number. - }; - - - // User arguments. - xsk::gsc::s1c::lexer& lexer; - xsk::gsc::ast::program::ptr& ast; - - }; - - inline - parser::symbol_kind_type - parser::yytranslate_ (int t) YY_NOEXCEPT - { - 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::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_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); - 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_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::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_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_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 () YY_NOEXCEPT - : kind_ (symbol_kind::S_YYEMPTY) - {} - -#if 201103L <= YY_CPLUSPLUS - inline - parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT - : kind_ (that.kind_) - { - that.clear (); - } -#endif - - inline - parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT - : kind_ (that.kind_) - {} - - inline - parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT - : 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::gsc::s1c -#line 5597 "parser.hpp" - - - - -#endif // !YY_S1C_PARSER_HPP_INCLUDED diff --git a/src/experimental/s1c/xsk/resolver.cpp b/src/experimental/s1c/xsk/resolver.cpp deleted file mode 100644 index a59334ff..00000000 --- a/src/experimental/s1c/xsk/resolver.cpp +++ /dev/null @@ -1,520 +0,0 @@ -// 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 "s1c.hpp" - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - -namespace xsk::gsc::s1c -{ - -std::unordered_map opcode_map; -std::unordered_map function_map; -std::unordered_map method_map; -std::unordered_map token_map; -std::unordered_map opcode_map_rev; -std::unordered_map function_map_rev; -std::unordered_map method_map_rev; -std::unordered_map token_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_func_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - const auto itr = function_map.find(id); - - if (itr != function_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_meth_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - const auto itr = method_map.find(id); - - if (itr != method_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_id_")) - { - return static_cast(std::stoul(name.substr(4), nullptr, 16)); - } - - const auto itr = token_map_rev.find(name); - - if (itr != token_map_rev.end()) - { - return itr->second; - } - - return 0; -} - -auto resolver::token_name(std::uint16_t id) -> std::string -{ - const auto itr = token_map.find(id); - - if (itr != token_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - } - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - } - - return false; -} - -void resolver::add_function(const std::string& name, std::uint16_t id) -{ - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - throw error(utils::string::va("builtin function '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - function_map.insert({ id, *str }); - function_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - function_map.insert({ id, *ins.first }); - function_map_rev.insert({ *ins.first, id }); - } - } -} - -void resolver::add_method(const std::string& name, std::uint16_t id) -{ - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - throw error(utils::string::va("builtin method '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - method_map.insert({ id, *str }); - method_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - method_map.insert({ id, *ins.first }); - method_map_rev.insert({ *ins.first, 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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -const std::array, 154> opcode_list -{{ - { 0x1D, "OP_CastFieldObject" }, - { 0x1E, "OP_SetLocalVariableFieldCached" }, - { 0x1F, "OP_plus" }, - { 0x20, "OP_RemoveLocalVariables" }, - { 0x21, "OP_EvalSelfFieldVariableRef" }, - { 0x22, "OP_ScriptFarMethodChildThreadCall" }, - { 0x23, "OP_GetGameRef" }, - { 0x24, "OP_EvalAnimFieldVariable" }, - { 0x25, "OP_EvalLevelFieldVariableRef" }, - { 0x26, "OP_GetThisthread" }, - { 0x27, "OP_greater" }, - { 0x28, "OP_waittillmatch" }, - { 0x29, "OP_shift_right" }, - { 0x2A, "OP_dec" }, - { 0x2B, "OP_JumpOnTrue" }, - { 0x2C, "OP_bit_or" }, - { 0x2D, "OP_equality" }, - { 0x2E, "OP_ClearLocalVariableFieldCached0" }, - { 0x2F, "OP_notify" }, - { 0x30, "OP_GetVector" }, - { 0x31, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x32, "OP_PreScriptCall" }, - { 0x33, "OP_GetByte" }, - { 0x34, "OP_ScriptFarThreadCall" }, - { 0x35, "OP_SetSelfFieldVariableField" }, - { 0x36, "OP_JumpOnFalseExpr" }, - { 0x37, "OP_GetUndefined" }, - { 0x38, "OP_jumpback" }, - { 0x39, "OP_JumpOnTrueExpr" }, - { 0x3A, "OP_CallBuiltin0" }, - { 0x3B, "OP_CallBuiltin1" }, - { 0x3C, "OP_CallBuiltin2" }, - { 0x3D, "OP_CallBuiltin3" }, - { 0x3E, "OP_CallBuiltin4" }, - { 0x3F, "OP_CallBuiltin5" }, - { 0x40, "OP_CallBuiltin" }, - { 0x41, "OP_SetLocalVariableFieldCached0" }, - { 0x42, "OP_ClearFieldVariable" }, - { 0x43, "OP_GetLevel" }, - { 0x44, "OP_size" }, - { 0x45, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x46, "OP_ScriptLocalMethodThreadCall" }, - { 0x47, "OP_AddArray" }, - { 0x48, "OP_endon" }, - { 0x49, "OP_EvalFieldVariable" }, - { 0x4A, "OP_shift_left" }, - { 0x4B, "OP_EvalLocalArrayRefCached0" }, - { 0x4C, "OP_Return" }, - { 0x4D, "OP_CreateLocalVariable" }, - { 0x4E, "OP_SafeSetVariableFieldCached0" }, - { 0x4F, "OP_GetBuiltinMethod" }, - { 0x50, "OP_ScriptLocalMethodCall" }, - { 0x51, "OP_CallBuiltinMethodPointer" }, - { 0x52, "OP_ScriptLocalChildThreadCall" }, - { 0x53, "OP_GetSelfObject" }, - { 0x54, "OP_GetGame" }, - { 0x55, "OP_SetLevelFieldVariableField" }, - { 0x56, "OP_EvalArray" }, - { 0x57, "OP_GetSelf" }, - { 0x58, "OP_End" }, - { 0x59, "OP_EvalSelfFieldVariable" }, - { 0x5A, "OP_less_equal" }, - { 0x5B, "OP_EvalLocalVariableCached0" }, - { 0x5C, "OP_EvalLocalVariableCached1" }, - { 0x5D, "OP_EvalLocalVariableCached2" }, - { 0x5E, "OP_EvalLocalVariableCached3" }, - { 0x5F, "OP_EvalLocalVariableCached4" }, - { 0x60, "OP_EvalLocalVariableCached5" }, - { 0x61, "OP_EvalLocalVariableCached" }, - { 0x62, "OP_EvalNewLocalArrayRefCached0" }, - { 0x63, "OP_ScriptChildThreadCallPointer" }, - { 0x64, "OP_EvalLocalVariableObjectCached" }, - { 0x65, "OP_ScriptLocalThreadCall" }, - { 0x66, "OP_GetInteger" }, - { 0x67, "OP_ScriptMethodCallPointer" }, - { 0x68, "OP_checkclearparams" }, - { 0x69, "OP_SetAnimFieldVariableField" }, - { 0x6A, "OP_waittillmatch2" }, - { 0x6B, "OP_minus" }, - { 0x6C, "OP_ScriptLocalFunctionCall2" }, - { 0x6D, "OP_GetNegUnsignedShort" }, - { 0x6E, "OP_GetNegByte" }, - { 0x6F, "OP_SafeCreateVariableFieldCached" }, - { 0x70, "OP_greater_equal" }, - { 0x71, "OP_vector" }, - { 0x72, "OP_GetBuiltinFunction" }, - { 0x73, "OP_endswitch" }, - { 0x74, "OP_ClearArray" }, - { 0x75, "OP_DecTop" }, - { 0x76, "OP_CastBool" }, - { 0x77, "OP_EvalArrayRef" }, - { 0x78, "OP_SetNewLocalVariableFieldCached0" }, - { 0x79, "OP_GetZero" }, - { 0x7A, "OP_wait" }, - { 0x7B, "OP_waittill" }, - { 0x7C, "OP_GetIString" }, - { 0x7D, "OP_ScriptFarFunctionCall" }, - { 0x7E, "OP_GetAnimObject" }, - { 0x7F, "OP_GetAnimTree" }, - { 0x80, "OP_EvalLocalArrayCached" }, - { 0x81, "OP_mod" }, - { 0x82, "OP_ScriptFarMethodThreadCall" }, - { 0x83, "OP_GetUnsignedShort" }, - { 0x84, "OP_clearparams" }, - { 0x85, "OP_ScriptMethodThreadCallPointer" }, - { 0x86, "OP_ScriptFunctionCallPointer" }, - { 0x87, "OP_EmptyArray" }, - { 0x88, "OP_SafeSetVariableFieldCached" }, - { 0x89, "OP_UNK_2" }, - { 0x8A, "OP_EvalFieldVariableRef" }, - { 0x8B, "OP_ScriptLocalMethodChildThreadCall" }, - { 0x8C, "OP_UNK_3" }, - { 0x8D, "OP_GetFloat" }, - { 0x8E, "OP_EvalLocalVariableRefCached" }, - { 0x8F, "OP_JumpOnFalse" }, - { 0x90, "OP_BoolComplement" }, - { 0x91, "OP_ScriptThreadCallPointer" }, - { 0x92, "OP_ScriptFarFunctionCall2" }, - { 0x93, "OP_less" }, - { 0x94, "OP_BoolNot" }, - { 0x95, "OP_waittillFrameEnd" }, - { 0x96, "OP_waitFrame" }, - { 0x97, "OP_GetString" }, - { 0x98, "OP_EvalLevelFieldVariable" }, - { 0x99, "OP_GetLevelObject" }, - { 0x9A, "OP_inc" }, - { 0x9B, "OP_CallBuiltinMethod0" }, - { 0x9C, "OP_CallBuiltinMethod1" }, - { 0x9D, "OP_CallBuiltinMethod2" }, - { 0x9E, "OP_CallBuiltinMethod3" }, - { 0x9F, "OP_CallBuiltinMethod4" }, - { 0xA0, "OP_CallBuiltinMethod5" }, - { 0xA1, "OP_CallBuiltinMethod" }, - { 0xA2, "OP_GetAnim" }, - { 0xA3, "OP_switch" }, - { 0xA4, "OP_SetVariableField" }, - { 0xA5, "OP_divide" }, - { 0xA6, "OP_GetLocalFunction" }, - { 0xA7, "OP_ScriptFarChildThreadCall" }, - { 0xA8, "OP_multiply" }, - { 0xA9, "OP_ClearLocalVariableFieldCached" }, - { 0xAA, "OP_EvalAnimFieldVariableRef" }, - { 0xAB, "OP_EvalLocalArrayRefCached" }, - { 0xAC, "OP_EvalLocalVariableRefCached0" }, - { 0xAD, "OP_bit_and" }, - { 0xAE, "OP_GetAnimation" }, - { 0xAF, "OP_GetFarFunction" }, - { 0xB0, "OP_CallBuiltinPointer" }, - { 0xB1, "OP_jump" }, - { 0xB2, "OP_voidCodepos" }, - { 0xB3, "OP_ScriptFarMethodCall" }, - { 0xB4, "OP_inequality" }, - { 0xB5, "OP_ScriptLocalFunctionCall" }, - { 0xB6, "OP_bit_ex_or" }, -}}; - -const std::array, 3> function_list -{{ - { 0x12, "isdefined" }, - { 0xC0, "getfirstarraykey" }, - { 0xC1, "getnextarraykey" }, -}}; - -const std::array, 0> method_list -{{ -}}; - -const std::array, 0> token_list -{{ -}}; - -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()); - function_map.reserve(function_list.size()); - function_map_rev.reserve(function_list.size()); - method_map.reserve(method_list.size()); - method_map_rev.reserve(method_list.size()); - token_map.reserve(token_list.size()); - token_map_rev.reserve(token_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 : function_list) - { - function_map.insert({ entry.first, entry.second }); - function_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : method_list) - { - method_map.insert({ entry.first, entry.second }); - method_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : token_list) - { - token_map.insert({ entry.first, entry.second }); - token_map_rev.insert({ entry.second, entry.first }); - } - } -}; - -__init__ _; - -} // namespace xsk::gsc::s1c - -#ifdef _MSC_VER -#pragma warning(pop) -#endif diff --git a/src/experimental/s1c/xsk/resolver.hpp b/src/experimental/s1c/xsk/resolver.hpp deleted file mode 100644 index 9e5132f1..00000000 --- a/src/experimental/s1c/xsk/resolver.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::s1c -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint16_t; - static auto token_name(std::uint16_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/s1c.cpp b/src/experimental/s1c/xsk/s1c.cpp deleted file mode 100644 index 23f5ee79..00000000 --- a/src/experimental/s1c/xsk/s1c.cpp +++ /dev/null @@ -1,181 +0,0 @@ -// 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 "s1c.hpp" - -namespace xsk::gsc::s1c -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_End: - case opcode::OP_Return: - case opcode::OP_GetUndefined: - case opcode::OP_GetZero: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_EvalArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_ClearArray: - case opcode::OP_EmptyArray: - case opcode::OP_AddArray: - case opcode::OP_PreScriptCall: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_GetLevelObject: - case opcode::OP_GetAnimObject: - case opcode::OP_GetSelf: - case opcode::OP_GetThisthread: - case opcode::OP_GetLevel: - case opcode::OP_GetGame: - case opcode::OP_GetAnim: - case opcode::OP_GetGameRef: - case opcode::OP_inc: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_bit_ex_or: - case opcode::OP_bit_and: - case opcode::OP_equality: - case opcode::OP_inequality: - case opcode::OP_less: - case opcode::OP_greater: - case opcode::OP_less_equal: - case opcode::OP_waittillmatch2: - case opcode::OP_waittill: - case opcode::OP_notify: - case opcode::OP_endon: - case opcode::OP_voidCodepos: - case opcode::OP_vector: - case opcode::OP_greater_equal: - case opcode::OP_shift_left: - case opcode::OP_shift_right: - case opcode::OP_plus: - case opcode::OP_minus: - case opcode::OP_multiply: - case opcode::OP_divide: - case opcode::OP_mod: - case opcode::OP_size: - case opcode::OP_GetSelfObject: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_clearparams: - case opcode::OP_checkclearparams: - case opcode::OP_EvalLocalVariableRefCached0: -// case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_SetVariableField: -// case opcode::OP_ClearVariableField: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_wait: - case opcode::OP_DecTop: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_BoolNot: - case opcode::OP_BoolComplement: - return 1; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - case opcode::OP_CreateLocalVariable: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_waittillmatch: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_GetAnimTree: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_EvalLocalVariableObjectCached: - return 2; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_GetString: - case opcode::OP_GetIString: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jumpback: - case opcode::OP_endswitch: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - return 3; - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_GetLocalFunction: - case opcode::OP_CallBuiltin: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - case opcode::OP_GetFarFunction: - return 4; - case opcode::OP_GetInteger: - case opcode::OP_GetFloat: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_GetAnimation: - case opcode::OP_switch: - case opcode::OP_jump: - return 5; - case opcode::OP_GetVector: - return 13; - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/s1c/xsk/s1c.hpp b/src/experimental/s1c/xsk/s1c.hpp deleted file mode 100644 index 0881ba94..00000000 --- a/src/experimental/s1c/xsk/s1c.hpp +++ /dev/null @@ -1,184 +0,0 @@ -// 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 "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::s1c -{ - -constexpr std::uint16_t max_string_id = 0xA51D; -// ps3 ?? -// 360 0xA51D - -enum class opcode : std::uint8_t -{ - OP_CastFieldObject = 0x1D, - OP_SetLocalVariableFieldCached = 0x1E, - OP_plus = 0x1F, - OP_RemoveLocalVariables = 0x20, - OP_EvalSelfFieldVariableRef = 0x21, - OP_ScriptFarMethodChildThreadCall = 0x22, - OP_GetGameRef = 0x23, - OP_EvalAnimFieldVariable = 0x24, - OP_EvalLevelFieldVariableRef = 0x25, - OP_GetThisthread = 0x26, - OP_greater = 0x27, - OP_waittillmatch = 0x28, - OP_shift_right = 0x29, - OP_dec = 0x2A, - OP_JumpOnTrue = 0x2B, - OP_bit_or = 0x2C, - OP_equality = 0x2D, - OP_ClearLocalVariableFieldCached0 = 0x2E, - OP_notify = 0x2F, - OP_GetVector = 0x30, - OP_ScriptMethodChildThreadCallPointer = 0x31, - OP_PreScriptCall = 0x32, - OP_GetByte = 0x33, - OP_ScriptFarThreadCall = 0x34, - OP_SetSelfFieldVariableField = 0x35, - OP_JumpOnFalseExpr = 0x36, - OP_GetUndefined = 0x37, - OP_jumpback = 0x38, - OP_JumpOnTrueExpr = 0x39, - OP_CallBuiltin0 = 0x3A, - OP_CallBuiltin1 = 0x3B, - OP_CallBuiltin2 = 0x3C, - OP_CallBuiltin3 = 0x3D, - OP_CallBuiltin4 = 0x3E, - OP_CallBuiltin5 = 0x3F, - OP_CallBuiltin = 0x40, - OP_SetLocalVariableFieldCached0 = 0x41, - OP_ClearFieldVariable = 0x42, - OP_GetLevel = 0x43, - OP_size = 0x44, - OP_SafeSetWaittillVariableFieldCached = 0x45, - OP_ScriptLocalMethodThreadCall = 0x46, - OP_AddArray = 0x47, - OP_endon = 0x48, - OP_EvalFieldVariable = 0x49, - OP_shift_left = 0x4A, - OP_EvalLocalArrayRefCached0 = 0x4B, - OP_Return = 0x4C, - OP_CreateLocalVariable = 0x4D, - OP_SafeSetVariableFieldCached0 = 0x4E, - OP_GetBuiltinMethod = 0x4F, - OP_ScriptLocalMethodCall = 0x50, - OP_CallBuiltinMethodPointer = 0x51, - OP_ScriptLocalChildThreadCall = 0x52, - OP_GetSelfObject = 0x53, - OP_GetGame = 0x54, - OP_SetLevelFieldVariableField = 0x55, - OP_EvalArray = 0x56, - OP_GetSelf = 0x57, - OP_End = 0x58, - OP_EvalSelfFieldVariable = 0x59, - OP_less_equal = 0x5A, - OP_EvalLocalVariableCached0 = 0x5B, - OP_EvalLocalVariableCached1 = 0x5C, - OP_EvalLocalVariableCached2 = 0x5D, - OP_EvalLocalVariableCached3 = 0x5E, - OP_EvalLocalVariableCached4 = 0x5F, - OP_EvalLocalVariableCached5 = 0x60, - OP_EvalLocalVariableCached = 0x61, - OP_EvalNewLocalArrayRefCached0 = 0x62, - OP_ScriptChildThreadCallPointer = 0x63, - OP_EvalLocalVariableObjectCached = 0x64, - OP_ScriptLocalThreadCall = 0x65, - OP_GetInteger = 0x66, - OP_ScriptMethodCallPointer = 0x67, - OP_checkclearparams = 0x68, - OP_SetAnimFieldVariableField = 0x69, - OP_waittillmatch2 = 0x6A, - OP_minus = 0x6B, - OP_ScriptLocalFunctionCall2 = 0x6C, - OP_GetNegUnsignedShort = 0x6D, - OP_GetNegByte = 0x6E, - OP_SafeCreateVariableFieldCached = 0x6F, - OP_greater_equal = 0x70, - OP_vector = 0x71, - OP_GetBuiltinFunction = 0x72, - OP_endswitch = 0x73, - OP_ClearArray = 0x74, - OP_DecTop = 0x75, - OP_CastBool = 0x76, - OP_EvalArrayRef = 0x77, - OP_SetNewLocalVariableFieldCached0 = 0x78, - OP_GetZero = 0x79, - OP_wait = 0x7A, - OP_waittill = 0x7B, - OP_GetIString = 0x7C, - OP_ScriptFarFunctionCall = 0x7D, - OP_GetAnimObject = 0x7E, - OP_GetAnimTree = 0x7F, - OP_EvalLocalArrayCached = 0x80, - OP_mod = 0x81, - OP_ScriptFarMethodThreadCall = 0x82, - OP_GetUnsignedShort = 0x83, - OP_clearparams = 0x84, - OP_ScriptMethodThreadCallPointer = 0x85, - OP_ScriptFunctionCallPointer = 0x86, - OP_EmptyArray = 0x87, - OP_SafeSetVariableFieldCached = 0x88, - // ---- = 0x89, - OP_EvalFieldVariableRef = 0x8A, - OP_ScriptLocalMethodChildThreadCall = 0x8B, - // ---- = 0x8C, - OP_GetFloat = 0x8D, - OP_EvalLocalVariableRefCached = 0x8E, - OP_JumpOnFalse = 0x8F, - OP_BoolComplement = 0x90, - OP_ScriptThreadCallPointer = 0x91, - OP_ScriptFarFunctionCall2 = 0x92, - OP_less = 0x93, - OP_BoolNot = 0x94, - OP_waittillFrameEnd = 0x95, - OP_waitFrame = 0x96, - OP_GetString = 0x97, - OP_EvalLevelFieldVariable = 0x98, - OP_GetLevelObject = 0x99, - OP_inc = 0x9A, - OP_CallBuiltinMethod0 = 0x9B, - OP_CallBuiltinMethod1 = 0x9C, - OP_CallBuiltinMethod2 = 0x9D, - OP_CallBuiltinMethod3 = 0x9E, - OP_CallBuiltinMethod4 = 0x9F, - OP_CallBuiltinMethod5 = 0xA0, - OP_CallBuiltinMethod = 0xA1, - OP_GetAnim = 0xA2, - OP_switch = 0xA3, - OP_SetVariableField = 0xA4, - OP_divide = 0xA5, - OP_GetLocalFunction = 0xA6, - OP_ScriptFarChildThreadCall = 0xA7, - OP_multiply = 0xA8, - OP_ClearLocalVariableFieldCached = 0xA9, - OP_EvalAnimFieldVariableRef = 0xAA, - OP_EvalLocalArrayRefCached = 0xAB, - OP_EvalLocalVariableRefCached0 = 0xAC, - OP_bit_and = 0xAD, - OP_GetAnimation = 0xAE, - OP_GetFarFunction = 0xAF, - OP_CallBuiltinPointer = 0xB0, - OP_jump = 0xB1, - OP_voidCodepos = 0xB2, - OP_ScriptFarMethodCall = 0xB3, - OP_inequality = 0xB4, - OP_ScriptLocalFunctionCall = 0xB5, - OP_bit_ex_or = 0xB6, -}; - -auto opcode_size(std::uint8_t id) -> std::uint32_t; - -} // namespace xsk::gsc::s1c diff --git a/src/experimental/t4/stdafx.cpp b/src/experimental/t4/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/experimental/t4/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/experimental/t4/stdafx.hpp b/src/experimental/t4/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/experimental/t4/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/experimental/t4/xsk/t4.cpp b/src/experimental/t4/xsk/t4.cpp deleted file mode 100644 index 2c5f31a8..00000000 --- a/src/experimental/t4/xsk/t4.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// 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 "t4.hpp" - -namespace xsk::gsc::t4 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (opcode(id)) - { - default: - throw error("Couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::t4 diff --git a/src/experimental/t5/stdafx.cpp b/src/experimental/t5/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/experimental/t5/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/experimental/t5/stdafx.hpp b/src/experimental/t5/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/experimental/t5/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/experimental/t5/xsk/t5.cpp b/src/experimental/t5/xsk/t5.cpp deleted file mode 100644 index dc857dff..00000000 --- a/src/experimental/t5/xsk/t5.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// 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 "t5.hpp" - -namespace xsk::gsc::t5 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (opcode(id)) - { - default: - throw error("Couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::t5 diff --git a/src/gsc/assembler.cpp b/src/gsc/assembler.cpp new file mode 100644 index 00000000..45d0382c --- /dev/null +++ b/src/gsc/assembler.cpp @@ -0,0 +1,638 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "assembler.hpp" +#include "context.hpp" +#include "utils/string.hpp" + +namespace xsk::gsc +{ + +assembler::assembler(context const* ctx) : ctx_{ ctx }, script_{ ctx->endian() == endian::big }, stack_{ ctx->endian() == endian::big } +{ +} + +auto assembler::assemble(assembly const& data) -> std::pair +{ + assembly_ = &data; + script_.clear(); + stack_.clear(); + + script_.write(ctx_->opcode_id(opcode::OP_End)); + + for (auto const& func : data.functions) + { + assemble_function(*func); + } + + return { buffer{ script_.data(), script_.pos() }, buffer{ stack_.data(), stack_.pos() } }; +} + +auto assembler::assemble_function(function const& func) -> void +{ + func_ = &func; + + stack_.write(func.size); + + if (ctx_->props() & props::hash) + { + stack_.write(ctx_->hash_id(func.name)); + } + else + { + if (ctx_->props() & props::tok4) + stack_.write(func.id); + else + stack_.write(static_cast(func.id)); + + if (func.id == 0) + { + stack_.write_cstr(encrypt_string(func.name)); + } + } + + for (auto const& inst : func.instructions) + { + assemble_instruction(*inst); + } +} + +auto assembler::assemble_instruction(instruction const& inst) -> void +{ + script_.write(ctx_->opcode_id(inst.opcode)); + + switch (inst.opcode) + { + case opcode::OP_CastFieldObject: + case opcode::OP_plus: + case opcode::OP_GetGameRef: + case opcode::OP_GetThisthread: + case opcode::OP_greater: + case opcode::OP_shift_right: + case opcode::OP_dec: + case opcode::OP_bit_or: + case opcode::OP_equality: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_notify: + case opcode::OP_PreScriptCall: + case opcode::OP_GetUndefined: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_size: + case opcode::OP_AddArray: + case opcode::OP_endon: + case opcode::OP_shift_left: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_Return: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetSelfObject: + case opcode::OP_GetGame: + case opcode::OP_EvalArray: + case opcode::OP_GetSelf: + case opcode::OP_End: + case opcode::OP_less_equal: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_checkclearparams: + case opcode::OP_waittillmatch2: + case opcode::OP_minus: + case opcode::OP_greater_equal: + case opcode::OP_vector: + case opcode::OP_ClearArray: + case opcode::OP_DecTop: + case opcode::OP_CastBool: + case opcode::OP_EvalArrayRef: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_waittill: + case opcode::OP_GetAnimObject: + case opcode::OP_mod: + case opcode::OP_clearparams: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_EmptyArray: + case opcode::OP_ClearVariableField: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_BoolComplement: + case opcode::OP_less: + case opcode::OP_BoolNot: + case opcode::OP_waittillFrameEnd: + case opcode::OP_waitframe: + case opcode::OP_GetLevelObject: + case opcode::OP_inc: + case opcode::OP_GetAnim: + case opcode::OP_SetVariableField: + case opcode::OP_divide: + case opcode::OP_multiply: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_bit_and: + case opcode::OP_voidCodepos: + case opcode::OP_inequality: + case opcode::OP_bit_ex_or: + case opcode::OP_BoolNotAfterAnd: + case opcode::OP_IsDefined: + case opcode::OP_IsTrue: + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + script_.write(static_cast(std::stoul(inst.data[0]))); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + script_.write(static_cast(std::stoul(inst.data[0]))); + break; + case opcode::OP_GetUnsignedInt: + case opcode::OP_GetNegUnsignedInt: + script_.write(static_cast(std::stoul(inst.data[0]))); + break; + case opcode::OP_GetInteger: + script_.write(std::stoi(inst.data[0])); + break; + case opcode::OP_GetInteger64: + script_.write(std::stoll(inst.data[0])); + break; + case opcode::OP_GetFloat: + script_.write(std::stof(inst.data[0])); + break; + case opcode::OP_GetVector: + script_.align((ctx_->endian() == endian::little) ? 1 : 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: + if (ctx_->props() & props::str4) + script_.write(0); + else + script_.write(0); + stack_.write_cstr(encrypt_string(inst.data[0])); + break; + case opcode::OP_GetAnimation: + if (ctx_->props() & props::str4) + script_.write(0); + else + script_.write(0); + stack_.write_cstr(encrypt_string(inst.data[0])); + stack_.write_cstr(encrypt_string(inst.data[1])); + break; + case opcode::OP_GetAnimTree: + script_.write(0); + stack_.write_cstr(encrypt_string(inst.data[0])); + break; + case opcode::OP_GetUnkxHash: + script_.write(std::stoul(inst.data[0], nullptr, 16)); + break; + case opcode::OP_GetStatHash: + case opcode::OP_GetEnumHash: + case opcode::OP_GetDvarHash: + script_.write(std::stoull(inst.data[0], nullptr, 16)); + break; + case opcode::OP_waittillmatch: + script_.write(static_cast(std::stoul(inst.data[0]))); + break; + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + script_.write(static_cast(std::stoul(inst.data[0]))); + break; + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_SetNewLocalVariableFieldCached0: + if (ctx_->props() & props::hash) + script_.write(ctx_->hash_id(inst.data[0])); + else + script_.write(static_cast(std::stoul(inst.data[0]))); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + assemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + script_.write(static_cast(std::stoul(inst.data[0]))); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + assemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + assemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + assemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + assemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + assemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + assemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + assemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + assemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + assemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + assemble_jump(inst, false, true); + break; + case opcode::OP_jump: + assemble_jump(inst, false, false); + break; + case opcode::OP_switch: + assemble_switch(inst); + break; + case opcode::OP_endswitch: + assemble_end_switch(inst); + break; + case opcode::OP_FormalParams: + assemble_formal_params(inst); + break; + default: + throw asm_error(fmt::format("unhandled opcode {} at index {:04X}", opcode_name(inst.opcode), inst.index)); + } +} + +auto assembler::assemble_builtin_call(instruction const& inst, bool method, bool args) -> void +{ + if (args) + { + script_.write(static_cast(std::stoi(inst.data[1]))); + } + + if (ctx_->props() & props::hash) + { + stack_.write_cstr(fmt::format("#xS{:x}", ctx_->hash_id(inst.data[0]))); + script_.write(0); + } + else + { + auto const id = method ? ctx_->meth_id(inst.data[0]) : ctx_->func_id(inst.data[0]); + + script_.write(id); + } +} + +auto assembler::assemble_local_call(instruction const& inst, bool thread) -> void +{ + auto const addr = resolve_function(inst.data[0]); + auto const offset = static_cast(addr - inst.index - 1); + + assemble_offset(offset); + + if (thread) + { + script_.write(static_cast(std::stoi(inst.data[1]))); + } +} + +auto assembler::assemble_far_call(instruction const& inst, bool thread) -> void +{ + if (ctx_->props() & props::farcall) + { + if (inst.data[0].empty()) + { + auto const addr = resolve_function(inst.data[1]); + auto const offset = static_cast(addr - inst.index - 1); + + script_.write(static_cast(offset)); // unsigned? + stack_.write(0); + stack_.write(0); + } + else + { + script_.write(0); + stack_.write(ctx_->hash_id(inst.data[0])); + stack_.write(ctx_->hash_id(inst.data[1])); + } + + if (thread) + { + script_.write(static_cast(std::stoi(inst.data[2]))); + } + } + else + { + script_.write(0); + script_.write(0); + + if (thread) + { + script_.write(static_cast(std::stoi(inst.data[2]))); + } + + auto const file_id = ctx_->token_id(inst.data[0]); + auto const func_id = ctx_->token_id(inst.data[1]); + + if (ctx_->props() & props::tok4) + stack_.write(file_id); + else + stack_.write(static_cast(file_id)); + + if (file_id == 0) + stack_.write_cstr(encrypt_string(inst.data[0])); + + if (ctx_->props() & props::tok4) + stack_.write(func_id); + else + stack_.write(static_cast(func_id)); + + if (func_id == 0) + stack_.write_cstr(encrypt_string(inst.data[1])); + } +} + +auto assembler::assemble_switch(instruction const& inst) -> void +{ + auto const addr = resolve_label(inst.data[0]); + + script_.write(addr - inst.index - 4); +} + +auto assembler::assemble_end_switch(instruction const& inst) -> void +{ + auto const count = std::stoul(inst.data[0]); + + script_.write(static_cast(count)); + + auto type = static_cast(std::stoul(inst.data.back())); + auto index = inst.index + 3u; + + for (auto i = 0u; i < count; i++) + { + if (ctx_->engine() == engine::iw9) + { + if (inst.data[1 + (4 * i)] == "case") + { + type = static_cast(std::stoul(inst.data[1 + (4 * i) + 1])); + + if (type == switch_type::integer) + { + script_.write(std::stoi(inst.data[1 + (4 * i) + 2])); //signed? + } + else + { + script_.write(0); + stack_.write_cstr(inst.data[1 + (4 * i) + 2]); + } + + auto const addr = resolve_label(inst.data[1 + (4 * i) + 3]); + + script_.write(static_cast(addr - index - 4)); + script_.write(0); + script_.write(static_cast(type)); + + index += 8; + } + else if (inst.data[1 + (4 * i)] == "default") + { + auto const addr = resolve_label(inst.data[1 + (4 * i) + 1]); + + script_.write(0); + script_.write(static_cast(addr - index - 4)); + script_.write(0); + + index += 8; + } + else + { + throw asm_error(fmt::format("invalid switch case {}", inst.data[1 + (4 * i)])); + } + } + else + { + if (inst.data[1 + (3 * i)] == "case") + { + if (type == switch_type::integer) + { + script_.write((std::stoi(inst.data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); + } + else + { + script_.write(i + 1); + stack_.write_cstr(encrypt_string(inst.data[1 + (3 * i) + 1])); + } + + auto const addr = resolve_label(inst.data[1 + (3 * i) + 2]); + + assemble_offset(addr - index - 4); + + index += 7; + } + else if (inst.data[1 + (3 * i)] == "default") + { + script_.write(0); + stack_.write_cstr("\x01"); + + auto const addr = resolve_label(inst.data[1 + (3 * i) + 1]); + + assemble_offset(addr - index - 4); + + index += 7; + } + else + { + throw asm_error(fmt::format("invalid switch case {}", inst.data[1 + (3 * i)])); + } + } + } +} + +auto assembler::assemble_field_variable(instruction const& inst) -> void +{ + if (ctx_->props() & props::hash) + { + script_.write(ctx_->hash_id(inst.data[0])); + } + else + { + auto id = ctx_->token_id(inst.data[0]); + + if (id == 0) id = 0xFFFFFFFF; + + if (ctx_->props() & props::tok4) + script_.write(id); + else + script_.write(static_cast(id)); + + if (id > ctx_->str_count()) + { + if (ctx_->props() & props::tok4) + stack_.write(0); + else + stack_.write(0); + + stack_.write_cstr(encrypt_string(inst.data[0])); + } + } +} + +auto assembler::assemble_formal_params(instruction const& inst) -> void +{ + auto const count = std::stoul(inst.data[0]); + + script_.write(static_cast(count)); + + for (auto i = 1u; i <= count; i++) + { + if (ctx_->props() & props::hash) + { + script_.write(ctx_->hash_id(inst.data[i])); + } + else + { + script_.write(static_cast(std::stoi(inst.data[i]))); + } + } +} + +auto assembler::assemble_jump(instruction const& inst, bool expr, bool back) -> void +{ + auto const addr = resolve_label(inst.data[0]); + + if (expr) + { + script_.write(static_cast(addr - inst.index - 3)); + } + else if (back) + { + script_.write(static_cast((inst.index + 3) - addr)); + } + else + { + script_.write(static_cast(addr - inst.index - 5)); + } +} + +auto assembler::assemble_offset(i32 offs) -> void +{ + auto bytes = std::array{}; + + auto const shift = (ctx_->props() & props::offs8) ? 8 : (ctx_->props() & props::offs9) ? 9 : 10; + + offs = (offs << shift) >> 8; + + *reinterpret_cast(bytes.data()) = offs; + + if (ctx_->endian() == endian::little) + { + script_.write(bytes[0]); + script_.write(bytes[1]); + script_.write(bytes[2]); + } + else + { + script_.write(bytes[2]); + script_.write(bytes[1]); + script_.write(bytes[0]); + } +} + +auto assembler::resolve_function(std::string const& name) -> std::int32_t +{ + for (auto const& entry : assembly_->functions) + { + if (entry->name == name) + { + return entry->index; + } + } + + throw asm_error(fmt::format("couldn't resolve local function address of {}", name)); +} + +auto assembler::resolve_label(std::string const& name) -> std::int32_t +{ + for (auto const& entry : func_->labels) + { + if (entry.second == name) + { + return entry.first; + } + } + + throw asm_error(fmt::format("couldn't resolve label address of {}", name)); +} + +auto assembler::encrypt_string(std::string const& str) -> std::string +{ + if (str.starts_with("_encstr_") && str.size() % 2 == 0) + { + auto data = std::string{}; + + data.reserve(str.size() / 2); + + for (auto i = 8u; i < str.size(); i += 2) + { + data += static_cast(std::stoul(str.substr(i, 2), 0, 16)); + } + + return data; + } + + return str; +} + +} // namespace xsk::gsc diff --git a/src/gsc/assembler.hpp b/src/gsc/assembler.hpp new file mode 100644 index 00000000..d934e028 --- /dev/null +++ b/src/gsc/assembler.hpp @@ -0,0 +1,43 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "misc/types.hpp" +#include "utils/writer.hpp" + +namespace xsk::gsc +{ + +class assembler +{ + context const* ctx_; + function const* func_; + assembly const* assembly_; + utils::writer script_; + utils::writer stack_; + +public: + assembler(context const* ctx); + auto assemble(assembly const& data) -> std::pair; + +private: + auto assemble_function(function const& func) -> void; + auto assemble_instruction(instruction const& inst) -> void; + auto assemble_builtin_call(instruction const& inst, bool method, bool args) -> void; + auto assemble_local_call(instruction const& inst, bool thread) -> void; + auto assemble_far_call(instruction const& inst, bool thread) -> void; + auto assemble_switch(instruction const& inst) -> void; + auto assemble_end_switch(instruction const& inst) -> void; + auto assemble_field_variable(instruction const& inst) -> void; + auto assemble_formal_params(instruction const& inst) -> void; + auto assemble_jump(instruction const& inst, bool expr, bool back) -> void; + auto assemble_offset(i32 offs) -> void; + auto resolve_function(std::string const& name) -> i32; + auto resolve_label(std::string const& name) -> i32; + auto encrypt_string(std::string const& str) -> std::string; +}; + +} // namespace xsk::gsc diff --git a/src/gsc/compiler.cpp b/src/gsc/compiler.cpp new file mode 100644 index 00000000..580671a6 --- /dev/null +++ b/src/gsc/compiler.cpp @@ -0,0 +1,2983 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "compiler.hpp" +#include "context.hpp" + +namespace xsk::gsc +{ + +compiler::compiler(context* ctx) : ctx_{ ctx } +{ +} + +auto compiler::compile(program const& data) -> assembly::ptr +{ + emit_program(data); + return std::move(assembly_); +} + +auto compiler::compile(std::string const& file, std::vector& data) -> assembly::ptr +{ + auto prog = ctx_->source().parse_program(file, data); + return compile(*prog); +} + +auto compiler::emit_program(program const& prog) -> void +{ + assembly_ = make_assembly(); + localfuncs_.clear(); + developer_thread_ = false; + animload_ = false; + animname_ = {}; + index_ = 1; + + ctx_->init_includes(); + + for (auto const& inc : prog.includes) + { + auto const& path = inc->path->value; + + if (!ctx_->load_include(path)) + { + throw error(fmt::format("duplicated include file {}", path)); + } + } + + for (auto const& dec : prog.declarations) + { + if (dec == node::decl_function) + { + auto const& name = dec.as_function->name->value; + + if (ctx_->func_exists(name) || ctx_->meth_exists(name)) + { + throw comp_error(dec.loc(), fmt::format("function name '{}' already defined as builtin", name)); + } + + for (auto const& entry : localfuncs_) + { + if (entry == name) + throw comp_error(dec.loc(), fmt::format("function name '{}' already defined as local function", name)); + } + + localfuncs_.push_back(dec.as_function->name->value); + } + } + + for (auto const& dec : prog.declarations) + { + emit_decl(dec); + } +} + +auto compiler::emit_decl(decl const& dec) -> void +{ + switch (dec.kind()) + { + case node::decl_dev_begin: + developer_thread_ = true; + break; + case node::decl_dev_end: + developer_thread_ = false; + break; + case node::decl_usingtree: + emit_decl_usingtree(*dec.as_usingtree); + break; + case node::decl_function: + emit_decl_function(*dec.as_function); + break; + default: + throw comp_error(dec.loc(), "unknown declaration"); + } +} + +auto compiler::emit_decl_usingtree(decl_usingtree const& animtree) -> void +{ + if (developer_thread_) + throw comp_error(animtree.loc(), "cannot put #using_animtree inside developer comment"); + + animname_ = animtree.name->value; + animload_ = false; +} + +auto compiler::emit_decl_function(decl_function const& func) -> void +{ + label_idx_ = 0; + can_break_ = false; + can_continue_ = false; + stackframe_.clear(); + break_blks_.clear(); + continue_blks_.clear(); + + function_ = make_function(); + function_->index = index_; + function_->name = func.name->value; + function_->id = ctx_->token_id(function_->name); + + process_function(func); + + auto& scp = scopes_.at(func.body.get()); + + emit_expr_parameters(*func.params, *scp); + emit_stmt_list(*func.body, *scp, true); + emit_opcode(opcode::OP_End); + + function_->size = index_ - function_->index; + assembly_->functions.push_back(std::move(function_)); +} + +auto compiler::emit_stmt(stmt const& stm, scope& scp, bool last) -> void +{ + switch (stm.kind()) + { + case node::stmt_list: + emit_stmt_list(*stm.as_list, scp, last); + break; + case node::stmt_dev: + emit_stmt_dev(*stm.as_dev, scp, last); + break; + case node::stmt_expr: + emit_stmt_expr(*stm.as_expr, scp); + break; + case node::stmt_call: + emit_stmt_call(*stm.as_call, scp); + break; + case node::stmt_assign: + emit_stmt_assign(*stm.as_assign, scp); + break; + case node::stmt_endon: + emit_stmt_endon(*stm.as_endon, scp); + break; + case node::stmt_notify: + emit_stmt_notify(*stm.as_notify, scp); + break; + case node::stmt_wait: + emit_stmt_wait(*stm.as_wait, scp); + break; + case node::stmt_waittill: + emit_stmt_waittill(*stm.as_waittill, scp); + break; + case node::stmt_waittillmatch: + emit_stmt_waittillmatch(*stm.as_waittillmatch, scp); + break; + case node::stmt_waittillframeend: + emit_stmt_waittillframeend(*stm.as_waittillframeend, scp); + break; + case node::stmt_waitframe: + emit_stmt_waitframe(*stm.as_waitframe, scp); + break; + case node::stmt_if: + emit_stmt_if(*stm.as_if, scp, last); + break; + case node::stmt_ifelse: + emit_stmt_ifelse(*stm.as_ifelse, scp, last); + break; + case node::stmt_while: + emit_stmt_while(*stm.as_while, scp); + break; + case node::stmt_dowhile: + emit_stmt_dowhile(*stm.as_dowhile, scp); + break; + case node::stmt_for: + emit_stmt_for(*stm.as_for, scp); + break; + case node::stmt_foreach: + emit_stmt_foreach(*stm.as_foreach, scp); + break; + case node::stmt_switch: + emit_stmt_switch(*stm.as_switch, scp); + break; + case node::stmt_case: + emit_stmt_case(*stm.as_case, scp); + break; + case node::stmt_default: + emit_stmt_default(*stm.as_default, scp); + break; + case node::stmt_break: + emit_stmt_break(*stm.as_break, scp); + break; + case node::stmt_continue: + emit_stmt_continue(*stm.as_continue, scp); + break; + case node::stmt_return: + emit_stmt_return(*stm.as_return, scp); + break; + case node::stmt_breakpoint: + emit_stmt_breakpoint(*stm.as_breakpoint, scp); + break; + case node::stmt_prof_begin: + emit_stmt_prof_begin(*stm.as_prof_begin, scp); + break; + case node::stmt_prof_end: + emit_stmt_prof_end(*stm.as_prof_end, scp); + break; + default: + throw comp_error(stm.loc(), "unknown statement"); + } +} + +auto compiler::emit_stmt_list(stmt_list const& stm, scope& scp, bool last) -> void +{ + for (auto const& entry : stm.list) + { + emit_stmt(entry, scp, (&entry == &stm.list.back() && last) ? true : false); + } +} + +auto compiler::emit_stmt_dev(stmt_dev const& stm, scope& scp, bool last) -> void +{ + emit_stmt_list(*stm.body, scp, last); +} + +auto compiler::emit_stmt_expr(stmt_expr const& stm, scope& scp) -> void +{ + switch (stm.value.kind()) + { + case node::expr_increment: + emit_expr_increment(*stm.value.as_increment, scp, true); + break; + case node::expr_decrement: + emit_expr_decrement(*stm.value.as_decrement, scp, true); + break; + case node::expr_assign_equal: + case node::expr_assign_add: + case node::expr_assign_sub: + case node::expr_assign_mul: + case node::expr_assign_div: + case node::expr_assign_mod: + case node::expr_assign_shift_left: + case node::expr_assign_shift_right: + case node::expr_assign_bitwise_or: + case node::expr_assign_bitwise_and: + case node::expr_assign_bitwise_exor: + emit_expr_assign(*stm.value.as_assign, scp); + break; + case node::null: + break; + default: + throw comp_error(stm.loc(), "unknown expr statement expression"); + } +} + +auto compiler::emit_stmt_call(stmt_call const& stm, scope& scp) -> void +{ + if (stm.value == node::expr_call) + emit_expr_call(*stm.value.as_call, scp, true); + else if (stm.value == node::expr_method) + emit_expr_method(*stm.value.as_method, scp, true); + else + throw comp_error(stm.loc(), "unknown call statement expression"); +} + +auto compiler::emit_stmt_assign(stmt_assign const& stm, scope& scp) -> void +{ + switch (stm.value.kind()) + { + case node::expr_increment: + emit_expr_increment(*stm.value.as_increment, scp, true); + break; + case node::expr_decrement: + emit_expr_decrement(*stm.value.as_decrement, scp, true); + break; + case node::expr_assign_equal: + case node::expr_assign_add: + case node::expr_assign_sub: + case node::expr_assign_mul: + case node::expr_assign_div: + case node::expr_assign_mod: + case node::expr_assign_shift_left: + case node::expr_assign_shift_right: + case node::expr_assign_bitwise_or: + case node::expr_assign_bitwise_and: + case node::expr_assign_bitwise_exor: + emit_expr_assign(*stm.value.as_assign, scp); + break; + default: + throw comp_error(stm.loc(), "unknown assign statement expression"); + } +} + +auto compiler::emit_stmt_endon(stmt_endon const& stm, scope& scp) -> void +{ + emit_expr(stm.event, scp); + emit_expr(stm.obj, scp); + emit_opcode(opcode::OP_endon); +} + +auto compiler::emit_stmt_notify(stmt_notify const& stm, scope& scp) -> void +{ + emit_opcode(opcode::OP_voidCodepos); + + // std::reverse(stm.args->list.begin(), stm.args->list.end()); + + // for (auto const& arg : stm.args->list) // use reverse range later!! + // { + // emit_expr(arg, scp); + // } + + for (auto it = stm.args->list.rbegin(); it != stm.args->list.rend(); ++it) + { + emit_expr(*it, scp); + } + + emit_expr(stm.event, scp); + emit_expr(stm.obj, scp); + emit_opcode(opcode::OP_notify); +} + +auto compiler::emit_stmt_wait(stmt_wait const& stm, scope& scp) -> void +{ + emit_expr(stm.time, scp); + emit_opcode(opcode::OP_wait); +} + +auto compiler::emit_stmt_waittill(stmt_waittill const& stm, scope& scp) -> void +{ + emit_expr(stm.event, scp); + emit_expr(stm.obj, scp); + emit_opcode(opcode::OP_waittill); + + for (auto const& entry : stm.args->list) + { + emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, fmt::format("{}", variable_create(*entry.as_identifier, scp))); + } + + emit_opcode(opcode::OP_clearparams); +} + +auto compiler::emit_stmt_waittillmatch(stmt_waittillmatch const& stm, scope& scp) -> void +{ + emit_expr_arguments(*stm.args, scp); + emit_expr(stm.event, scp); + emit_expr(stm.obj, scp); + emit_opcode(opcode::OP_waittillmatch, fmt::format("{}", stm.args->list.size())); + emit_opcode(opcode::OP_waittillmatch2); + emit_opcode(opcode::OP_clearparams); +} + +auto compiler::emit_stmt_waittillframeend(stmt_waittillframeend const&, scope&) -> void +{ + emit_opcode(opcode::OP_waittillFrameEnd); +} + +auto compiler::emit_stmt_waitframe(stmt_waitframe const&, scope&) -> void +{ + emit_opcode(opcode::OP_waitframe); +} + +auto compiler::emit_stmt_if(stmt_if const& stm, scope& scp, bool last) -> void +{ + auto end_loc = create_label(); + + if (stm.test == node::expr_not) + { + emit_expr(stm.test.as_not->rvalue, scp); + emit_opcode(opcode::OP_JumpOnTrue, end_loc); + } + else + { + emit_expr(stm.test, scp); + emit_opcode(opcode::OP_JumpOnFalse, end_loc); + } + + auto& scp_body = scopes_.at(stm.body.as_node.get()); + + scp.transfer(scp_body); + + emit_stmt(stm.body, *scp_body, last); + + last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(*scp_body); + + insert_label(end_loc); +} + +auto compiler::emit_stmt_ifelse(stmt_ifelse const& stm, scope& scp, bool last) -> void +{ + auto childs = std::vector{}; + auto else_loc = create_label(); + auto end_loc = create_label(); + + if (stm.test == node::expr_not) + { + emit_expr(stm.test.as_not->rvalue, scp); + emit_opcode(opcode::OP_JumpOnTrue, else_loc); + } + else + { + emit_expr(stm.test, scp); + emit_opcode(opcode::OP_JumpOnFalse, else_loc); + } + + auto& scp_then = scopes_.at(stm.stmt_if.as_node.get()); + + scp.transfer(scp_then); + + emit_stmt(stm.stmt_if, *scp_then, last); + + emit_remove_local_vars(*scp_then); + + if (scp_then->abort == scope::abort_none) + childs.push_back(scp_then.get()); + + last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); + + insert_label(else_loc); + + auto& scp_else = scopes_.at(stm.stmt_else.as_node.get()); + + scp.transfer(scp_else); + + emit_stmt(stm.stmt_else, *scp_else, last); + + last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(*scp_else); + + if (scp_else->abort == scope::abort_none) + childs.push_back(scp_else.get()); + + insert_label(end_loc); + + scp.init(childs); +} + +auto compiler::emit_stmt_while(stmt_while const& stm, scope& scp) -> void +{ + auto old_breaks = break_blks_; + auto old_continues = continue_blks_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_blks_.clear(); + continue_blks_.clear(); + can_break_ = true; + can_continue_ = true; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + auto& scp_body = scopes_.at(stm.body.as_node.get()); + + scp.transfer(scp_body); + scp_body->loc_break = break_loc; + scp_body->loc_cont = continue_loc; + + emit_create_local_vars(*scp_body); + + scp.init(scp_body); + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stm.test); + + if (!const_cond) + { + if (stm.test == node::expr_not) + { + emit_expr(stm.test.as_not->rvalue, scp); + emit_opcode(opcode::OP_JumpOnTrue, break_loc); + } + else + { + emit_expr(stm.test, scp); + emit_opcode(opcode::OP_JumpOnFalse, break_loc); + } + } + + emit_stmt(stm.body, *scp_body, false); + + insert_label(continue_loc); + emit_opcode(opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if (const_cond) + scp.init(break_blks_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_blks_ = old_breaks; + continue_blks_ = old_continues; +} + +auto compiler::emit_stmt_dowhile(stmt_dowhile const& stm, scope& scp) -> void +{ + auto old_breaks = break_blks_; + auto old_continues = continue_blks_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_blks_.clear(); + continue_blks_.clear(); + can_break_ = true; + can_continue_ = true; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + auto& scp_body = scopes_.at(stm.body.as_node.get()); + + scp.transfer(scp_body); + scp_body->loc_break = break_loc; + scp_body->loc_cont = continue_loc; + + emit_create_local_vars(*scp_body); + + scp.init(scp_body); + + auto begin_loc = insert_label(); + + emit_stmt(stm.body, *scp_body, false); + + insert_label(continue_loc); + + bool const_cond = is_constant_condition(stm.test); + + if (!const_cond) + { + if (stm.test == node::expr_not) + { + emit_expr(stm.test.as_not->rvalue, scp); + emit_opcode(opcode::OP_JumpOnTrue, break_loc); + } + else + { + emit_expr(stm.test, scp); + emit_opcode(opcode::OP_JumpOnFalse, break_loc); + } + } + + emit_opcode(opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if (const_cond) + scp.init(break_blks_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_blks_ = old_breaks; + continue_blks_ = old_continues; +} + +auto compiler::emit_stmt_for(stmt_for const& stm, scope& scp) -> void +{ + auto old_breaks = break_blks_; + auto old_continues = continue_blks_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_blks_.clear(); + continue_blks_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_stmt(stm.init, scp, false); + + auto& scp_body = scopes_.at(stm.body.as_node.get()); + + scp.transfer(scp_body); + scp_body->loc_break = break_loc; + scp_body->loc_cont = continue_loc; + + emit_create_local_vars(*scp_body); + + scp.init(scp_body); + + auto& scp_iter = scopes_.at(stm.iter.as_node.get()); + + scp.transfer(scp_iter); + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stm.test); + + if (!const_cond) + { + if (stm.test == node::expr_not) + { + emit_expr(stm.test.as_not->rvalue, scp); + emit_opcode(opcode::OP_JumpOnTrue, break_loc); + } + else + { + emit_expr(stm.test, scp); + emit_opcode(opcode::OP_JumpOnFalse, break_loc); + } + } + + can_break_ = true; + can_continue_ = true; + + emit_stmt(stm.body, *scp_body, false); + + if (scp_body->abort == scope::abort_none) + continue_blks_.push_back(scp_body.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + scp_iter->init(continue_blks_); + + emit_stmt(stm.iter, *scp_iter, false); + emit_opcode(opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if (const_cond) + scp.init(break_blks_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_blks_ = old_breaks; + continue_blks_ = old_continues; +} + +auto compiler::emit_stmt_foreach(stmt_foreach const& stm, scope& scp) -> void +{ + auto old_breaks = break_blks_; + auto old_continues = continue_blks_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_blks_.clear(); + continue_blks_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_expr(stm.container, scp); + emit_expr_variable_ref(stm.array, scp, true); + emit_expr_variable(stm.array, scp); + + if (ctx_->props() & props::farcall) + emit_opcode(opcode::OP_CallBuiltin, { "getfirstarraykey"s, "1"s }); + else + emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); + + emit_expr_variable_ref(stm.key, scp, true); + + if (ctx_->props() & props::foreach && stm.use_key) + { + emit_opcode(opcode::OP_GetUndefined); + emit_expr_variable_ref(stm.index, scp, true); + } + + auto& scp_body = scopes_.at(stm.body.as_node.get()); + auto& scp_iter = scopes_.at(stm.key.as_node.get()); + + scp.transfer(scp_body); + scp_body->loc_break = break_loc; + scp_body->loc_cont = continue_loc; + + emit_create_local_vars(*scp_body); + + scp.init(scp_body); + + scp.transfer(scp_iter); + + auto begin_loc = insert_label(); + + emit_expr_variable(stm.key, scp); + + if (ctx_->props() & props::boolfuncs) + emit_opcode(opcode::OP_IsDefined); + else + emit_opcode(opcode::OP_CallBuiltin1, "isdefined"); + + emit_opcode(opcode::OP_JumpOnFalse, break_loc); + + can_break_ = true; + can_continue_ = true; + + emit_expr_variable(stm.key, *scp_body); + emit_opcode(opcode::OP_EvalLocalArrayCached, fmt::format("{}", variable_access(*stm.array.as_identifier, *scp_body))); + emit_expr_variable_ref(stm.value, *scp_body, true); + + if (ctx_->props() & props::foreach && stm.use_key) + { + emit_expr_variable(stm.key, *scp_body); + emit_expr_variable_ref(stm.index, *scp_body, true); + } + + emit_stmt(stm.body, *scp_body, false); + + if (scp_body->abort == scope::abort_none) + continue_blks_.push_back(scp_body.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + scp_iter->init(continue_blks_); + + emit_expr_variable(stm.key, *scp_iter); + emit_expr_variable(stm.array, *scp_iter); + + if (ctx_->props() & props::farcall) + emit_opcode(opcode::OP_CallBuiltin, { "getnextarraykey"s, "2"s }); + else + emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); + + emit_expr_variable_ref(stm.key, *scp_iter, true); + emit_opcode(opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + emit_expr_clear_local(*stm.array.as_identifier, scp); + if (ctx_->props() & props::foreach || !stm.use_key) emit_expr_clear_local(*stm.key.as_identifier, scp); + + can_break_ = old_break; + can_continue_ = old_continue; + break_blks_ = old_breaks; + continue_blks_ = old_continues; +} + +auto compiler::emit_stmt_switch(stmt_switch const& stm, scope& scp) -> void +{ + auto old_breaks = break_blks_; + auto old_break = can_break_; + break_blks_.clear(); + can_break_ = false; + + auto table_loc = create_label(); + auto break_loc = create_label(); + + emit_expr(stm.test, scp); + emit_opcode(opcode::OP_switch, table_loc); + + can_break_ = true; + + auto data = std::vector{}; + data.push_back(fmt::format("{}", stm.body->list.size())); + + auto type = switch_type::none; + auto loc_default = std::string{}; + auto has_default = false; + scope* default_ctx = nullptr; + + for (auto i = 0u; i < stm.body->list.size(); i++) + { + auto const& entry = stm.body->list[i]; + + if (entry == node::stmt_case) + { + data.push_back("case"); + + if (entry.as_case->value == node::expr_integer) + { + if (ctx_->engine() == engine::iw9) + { + data.push_back(fmt::format("{}", static_cast>(switch_type::integer))); + } + else + { + if (type == switch_type::string) + { + throw comp_error(entry.loc(), "switch cases with different types"); + } + + type = switch_type::integer; + } + + data.push_back(entry.as_case->value.as_integer->value); + data.push_back(insert_label()); + } + else if (entry.as_case->value == node::expr_string) + { + if (ctx_->engine() == engine::iw9) + { + data.push_back(fmt::format("{}", static_cast>(switch_type::string))); + } + else + { + if (type == switch_type::integer) + { + throw comp_error(entry.loc(), "switch cases with different types"); + } + + type = switch_type::string; + } + + data.push_back(entry.as_case->value.as_string->value); + data.push_back(insert_label()); + } + else + { + throw comp_error(entry.loc(), "case type must be int or string"); + } + + auto& scp_body = scopes_.at(entry.as_case->body.get()); + + scp.transfer(scp_body); + scp_body->loc_break = break_loc; + emit_stmt_list(*entry.as_case->body, *scp_body, false); + + if (entry.as_case->body->list.size() > 0) + emit_remove_local_vars(*scp_body); + } + else if (entry == node::stmt_default) + { + loc_default = insert_label(); + has_default = true; + + auto& scp_body = scopes_.at(entry.as_default->body.get()); + + default_ctx = scp_body.get(); + + scp.transfer(scp_body); + scp_body->loc_break = break_loc; + emit_stmt_list(*entry.as_default->body, *scp_body, false); + + if (entry.as_default->body->list.size() > 0) + emit_remove_local_vars(*scp_body); + } + else + { + throw comp_error(entry.loc(), "missing case statement"); + } + } + + if (has_default) + { + data.push_back("default"); + data.push_back(loc_default); + + if (default_ctx->abort == scope::abort_none) + break_blks_.push_back(default_ctx); + + scp.init(break_blks_); + } + + data.push_back(fmt::format("{}", static_cast>(type))); + + insert_label(table_loc); + + emit_opcode(opcode::OP_endswitch, data); + + auto offset = static_cast(((ctx_->engine() == engine::iw9) ? 8 : 7) * stm.body->list.size()); + function_->instructions.back()->size += offset; + index_ += offset; + + insert_label(break_loc); + + can_break_ = old_break; + break_blks_ = old_breaks; +} + +auto compiler::emit_stmt_case(stmt_case const& stm, scope&) -> void +{ + throw comp_error(stm.loc(), "illegal case statement"); +} + +auto compiler::emit_stmt_default(stmt_default const& stm, scope&) -> void +{ + throw comp_error(stm.loc(), "illegal default statement"); +} + +auto compiler::emit_stmt_break(stmt_break const& stm, scope& scp) -> void +{ + if (!can_break_ || scp.abort != scope::abort_none || scp.loc_break == "") + throw comp_error(stm.loc(), "illegal break statement"); + + break_blks_.push_back(&scp); + emit_remove_local_vars(scp); + scp.abort = scope::abort_break; + emit_opcode(opcode::OP_jump, scp.loc_break); +} + +auto compiler::emit_stmt_continue(stmt_continue const& stm, scope& scp) -> void +{ + if (!can_continue_ || scp.abort != scope::abort_none || scp.loc_cont == "") + throw comp_error(stm.loc(), "illegal continue statement"); + + continue_blks_.push_back(&scp); + emit_remove_local_vars(scp); + scp.abort = scope::abort_continue; + emit_opcode(opcode::OP_jump, scp.loc_cont); +} + +auto compiler::emit_stmt_return(stmt_return const& stm, scope& scp) -> void +{ + if (scp.abort == scope::abort_none) + scp.abort = scope::abort_return; + + if (stm.value != node::null) + { + emit_expr(stm.value, scp); + emit_opcode(opcode::OP_Return); + } + else + emit_opcode(opcode::OP_End); +} + +auto compiler::emit_stmt_breakpoint(stmt_breakpoint const&, scope&) -> void +{ + // TODO: +} + +auto compiler::emit_stmt_prof_begin(stmt_prof_begin const&, scope&) -> void +{ + // TODO: +} + +auto compiler::emit_stmt_prof_end(stmt_prof_end const&, scope&) -> void +{ + // TODO: +} + +auto compiler::emit_expr(expr const& exp, scope& scp) -> void +{ + switch (exp.kind()) + { + case node::expr_paren: + emit_expr(exp.as_paren->value, scp); + break; + case node::expr_ternary: + emit_expr_ternary(*exp.as_ternary, scp); + break; + case node::expr_and: + emit_expr_and(*exp.as_and, scp); + break; + case node::expr_or: + emit_expr_or(*exp.as_or, scp); + break; + case node::expr_equality: + case node::expr_inequality: + case node::expr_less: + case node::expr_greater: + case node::expr_less_equal: + case node::expr_greater_equal: + case node::expr_bitwise_or: + case node::expr_bitwise_and: + case node::expr_bitwise_exor: + case node::expr_shift_left: + case node::expr_shift_right: + case node::expr_add: + case node::expr_sub: + case node::expr_mul: + case node::expr_div: + case node::expr_mod: + emit_expr_binary(*exp.as_binary, scp); + break; + case node::expr_complement: + emit_expr_complement(*exp.as_complement, scp); + break; + case node::expr_negate: + emit_expr_negate(*exp.as_negate, scp); + break; + case node::expr_not: + emit_expr_not(*exp.as_not, scp); + break; + case node::expr_call: + emit_expr_call(*exp.as_call, scp, false); + break; + case node::expr_method: + emit_expr_method(*exp.as_method, scp, false); + break; + case node::expr_isdefined: + emit_expr_isdefined(*exp.as_isdefined, scp); + break; + case node::expr_istrue: + emit_expr_istrue(*exp.as_istrue, scp); + break; + case node::expr_reference: + emit_expr_reference(*exp.as_reference, scp); + break; + case node::expr_add_array: + emit_expr_add_array(*exp.as_add_array, scp); + break; + case node::expr_array: + emit_expr_array(*exp.as_array, scp); + break; + case node::expr_field: + emit_expr_field(*exp.as_field, scp); + break; + case node::expr_size: + emit_expr_size(*exp.as_size, scp); + break; + case node::expr_thisthread: + emit_opcode(opcode::OP_GetThisthread); + break; + case node::expr_empty_array: + emit_opcode(opcode::OP_EmptyArray); + break; + case node::expr_undefined: + emit_opcode(opcode::OP_GetUndefined); + break; + case node::expr_game: + emit_opcode(opcode::OP_GetGame); + break; + case node::expr_self: + emit_opcode(opcode::OP_GetSelf); + break; + case node::expr_anim: + emit_opcode(opcode::OP_GetAnim); + break; + case node::expr_level: + emit_opcode(opcode::OP_GetLevel); + break; + case node::expr_animation: + emit_expr_animation(*exp.as_animation); + break; + case node::expr_animtree: + emit_expr_animtree(*exp.as_animtree); + break; + case node::expr_identifier: + emit_expr_local(*exp.as_identifier, scp); + break; + case node::expr_istring: + emit_expr_istring(*exp.as_istring); + break; + case node::expr_string: + emit_expr_string(*exp.as_string); + break; + case node::expr_vector: + emit_expr_vector(*exp.as_vector, scp); + break; + case node::expr_float: + emit_expr_float(*exp.as_float); + break; + case node::expr_integer: + emit_expr_integer(*exp.as_integer); + break; + case node::expr_false: + emit_expr_false(*exp.as_false); + break; + case node::expr_true: + emit_expr_true(*exp.as_true); + break; + case node::null: + break; + default: + throw comp_error(exp.loc(), "unknown expression"); + } +} + +auto compiler::emit_expr_assign(expr_assign const& exp, scope& scp) -> void +{ + if (exp.kind() == node::expr_assign_equal) + { + if (exp.rvalue == node::expr_undefined) + { + emit_expr_clear(exp.lvalue, scp); + } + else if (exp.lvalue == node::expr_tuple) + { + emit_expr(exp.rvalue, scp); + emit_expr_tuple(*exp.lvalue.as_tuple, scp); + } + else + { + emit_expr(exp.rvalue, scp); + emit_expr_variable_ref(exp.lvalue, scp, true); + } + + return; + } + + emit_expr(exp.lvalue, scp); + emit_expr(exp.rvalue, scp); + + switch (exp.kind()) + { + case node::expr_assign_add: + emit_opcode(opcode::OP_plus); + break; + case node::expr_assign_sub: + emit_opcode(opcode::OP_minus); + break; + case node::expr_assign_mul: + emit_opcode(opcode::OP_multiply); + break; + case node::expr_assign_div: + emit_opcode(opcode::OP_divide); + break; + case node::expr_assign_mod: + emit_opcode(opcode::OP_mod); + break; + case node::expr_assign_shift_left: + emit_opcode(opcode::OP_shift_left); + break; + case node::expr_assign_shift_right: + emit_opcode(opcode::OP_shift_right); + break; + case node::expr_assign_bitwise_or: + emit_opcode(opcode::OP_bit_or); + break; + case node::expr_assign_bitwise_and: + emit_opcode(opcode::OP_bit_and); + break; + case node::expr_assign_bitwise_exor: + emit_opcode(opcode::OP_bit_ex_or); + break; + default: + throw comp_error(exp.loc(), "unknown assign operation"); + } + + emit_expr_variable_ref(exp.lvalue, scp, true); +} + +auto compiler::emit_expr_clear(expr const& exp, scope& scp) -> void +{ + switch (exp.kind()) + { + case node::expr_array: + emit_expr(exp.as_array->key, scp); + exp.as_array->obj == node::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(exp.as_array->obj, scp, false); + emit_opcode(opcode::OP_ClearArray); + break; + case node::expr_field: + emit_expr_object(exp.as_field->obj, scp); + emit_opcode(opcode::OP_ClearFieldVariable, exp.as_field->field->value); + break; + case node::expr_identifier: + emit_opcode(opcode::OP_GetUndefined); + emit_expr_local_ref(*exp.as_identifier, scp, true); + break; + default: + throw comp_error(exp.loc(), "unknown clear variable lvalue"); + } +} + +auto compiler::emit_expr_clear_local(expr_identifier const& exp, scope& scp) -> void +{ + auto index = variable_access(exp, scp); + + if (index == 0) + emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); + else + emit_opcode(opcode::OP_ClearLocalVariableFieldCached, fmt::format("{}", index)); +} + +auto compiler::emit_expr_increment(expr_increment const& exp, scope& scp, bool is_stmt) -> void +{ + if (is_stmt) + { + emit_expr_variable_ref(exp.lvalue, scp, false); + emit_opcode(opcode::OP_inc); + emit_opcode(opcode::OP_SetVariableField); + } + else + { + // TODO: + } +} + +auto compiler::emit_expr_decrement(expr_decrement const& exp, scope& scp, bool is_stmt) -> void +{ + if (is_stmt) + { + emit_expr_variable_ref(exp.lvalue, scp, false); + emit_opcode(opcode::OP_dec); + emit_opcode(opcode::OP_SetVariableField); + } + else + { + // TODO: + } +} + +auto compiler::emit_expr_ternary(expr_ternary const& exp, scope& scp) -> void +{ + auto else_loc = create_label(); + auto end_loc = create_label(); + + if (exp.test == node::expr_not) + { + emit_expr(exp.test.as_not->rvalue, scp); + emit_opcode(opcode::OP_JumpOnTrue, else_loc); + } + else + { + emit_expr(exp.test, scp); + emit_opcode(opcode::OP_JumpOnFalse, else_loc); + } + + emit_expr(exp.true_expr, scp); + emit_opcode(opcode::OP_jump, end_loc); + + insert_label(else_loc); + emit_expr(exp.false_expr, scp); + insert_label(end_loc); +} + +auto compiler::emit_expr_binary(expr_binary const& exp, scope& scp) -> void +{ + emit_expr(exp.lvalue, scp); + emit_expr(exp.rvalue, scp); + + switch (exp.kind()) + { + case node::expr_equality: + emit_opcode(opcode::OP_equality); + break; + case node::expr_inequality: + emit_opcode(opcode::OP_inequality); + break; + case node::expr_less: + emit_opcode(opcode::OP_less); + break; + case node::expr_greater: + emit_opcode(opcode::OP_greater); + break; + case node::expr_less_equal: + emit_opcode(opcode::OP_less_equal); + break; + case node::expr_greater_equal: + emit_opcode(opcode::OP_greater_equal); + break; + case node::expr_bitwise_or: + emit_opcode(opcode::OP_bit_or); + break; + case node::expr_bitwise_and: + emit_opcode(opcode::OP_bit_and); + break; + case node::expr_bitwise_exor: + emit_opcode(opcode::OP_bit_ex_or); + break; + case node::expr_shift_left: + emit_opcode(opcode::OP_shift_left); + break; + case node::expr_shift_right: + emit_opcode(opcode::OP_shift_right); + break; + case node::expr_add: + emit_opcode(opcode::OP_plus); + break; + case node::expr_sub: + emit_opcode(opcode::OP_minus); + break; + case node::expr_mul: + emit_opcode(opcode::OP_multiply); + break; + case node::expr_div: + emit_opcode(opcode::OP_divide); + break; + case node::expr_mod: + emit_opcode(opcode::OP_mod); + break; + default: + throw comp_error(exp.loc(), "unknown binary expression"); + } +} + +auto compiler::emit_expr_and(expr_and const& exp, scope& scp) -> void +{ + auto label = create_label(); + + emit_expr(exp.lvalue, scp); + emit_opcode(opcode::OP_JumpOnFalseExpr, label); + + if (exp.rvalue == node::expr_not && (ctx_->props() & props::boolnotand)) + { + emit_expr(exp.rvalue.as_not->rvalue, scp); + emit_opcode(opcode::OP_BoolNotAfterAnd); + } + else + { + emit_expr(exp.rvalue, scp); + emit_opcode(opcode::OP_CastBool); + } + + insert_label(label); +} + +auto compiler::emit_expr_or(expr_or const& exp, scope& scp) -> void +{ + auto label = create_label(); + + emit_expr(exp.lvalue, scp); + emit_opcode(opcode::OP_JumpOnTrueExpr, label); + + if (exp.rvalue == node::expr_not && (ctx_->props() & props::boolnotand)) + { + emit_expr(exp.rvalue.as_not->rvalue, scp); + emit_opcode(opcode::OP_BoolNotAfterAnd); + } + else + { + emit_expr(exp.rvalue, scp); + emit_opcode(opcode::OP_CastBool); + } + + insert_label(label); +} + +auto compiler::emit_expr_complement(expr_complement const& exp, scope& scp) -> void +{ + emit_expr(exp.rvalue, scp); + emit_opcode(opcode::OP_BoolComplement); +} + +auto compiler::emit_expr_negate(expr_negate const& exp, scope& scp) -> void +{ + emit_opcode(opcode::OP_GetZero); + emit_expr(exp.rvalue, scp); + emit_opcode(opcode::OP_minus); +} + +auto compiler::emit_expr_not(expr_not const& exp, scope& scp) -> void +{ + emit_expr(exp.rvalue, scp); + emit_opcode(opcode::OP_BoolNot); +} + +auto compiler::emit_expr_call(expr_call const& exp, scope& scp, bool is_stmt) -> void +{ + if (exp.value == node::expr_pointer) + emit_expr_call_pointer(*exp.value.as_pointer, scp, is_stmt); + else if (exp.value == node::expr_function) + emit_expr_call_function(*exp.value.as_function, scp, is_stmt); + else + throw comp_error(exp.loc(), "unknown function call expression"); +} + +auto compiler::emit_expr_call_pointer(expr_pointer const& exp, scope& scp, bool is_stmt) -> void +{ + if (exp.mode == call::mode::normal) + emit_opcode(opcode::OP_PreScriptCall); + + emit_expr_arguments(*exp.args, scp); + emit_expr(exp.func, scp); + + auto argcount = fmt::format("{}", exp.args->list.size()); + + switch (exp.mode) + { + case call::mode::normal: + emit_opcode(opcode::OP_ScriptFunctionCallPointer); + break; + case call::mode::thread: + emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); + break; + case call::mode::childthread: + emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); + break; + case call::mode::builtin: + emit_opcode(opcode::OP_CallBuiltinPointer, argcount); + break; + } + + if (is_stmt) + emit_opcode(opcode::OP_DecTop); +} + +auto compiler::emit_expr_call_function(expr_function const& exp, scope& scp, bool is_stmt) -> void +{ + if (is_stmt && ctx_->build() == build::prod) + { + auto const& name = exp.name->value; + if (name == "assert" || name == "assertex" || name == "assertmsg") return; + } + + auto path = std::string{}; + auto type = resolve_function_type(exp, path); + + if (ctx_->props() & props::farcall && type == call::type::local) + { + type = call::type::far; + } + + if (type != call::type::builtin && exp.mode == call::mode::normal && (ctx_->props() & props::farcall || exp.args->list.size() > 0)) + emit_opcode(opcode::OP_PreScriptCall); + + emit_expr_arguments(*exp.args, scp); + + auto argcount = fmt::format("{}", exp.args->list.size()); + + if (type == call::type::local) + { + switch (exp.mode) + { + case call::mode::normal: + if (exp.args->list.size() > 0) + emit_opcode(opcode::OP_ScriptLocalFunctionCall, exp.name->value); + else + emit_opcode(opcode::OP_ScriptLocalFunctionCall2, exp.name->value); + break; + case call::mode::thread: + emit_opcode(opcode::OP_ScriptLocalThreadCall, { exp.name->value, argcount }); + break; + case call::mode::childthread: + emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { exp.name->value, argcount }); + break; + case call::mode::builtin: + // no local builtins + break; + } + } + else if (type == call::type::far) + { + switch (exp.mode) + { + case call::mode::normal: + if (!(ctx_->props() & props::farcall) && exp.args->list.size() == 0) + emit_opcode(opcode::OP_ScriptFarFunctionCall2, { path, exp.name->value }); + else + emit_opcode(opcode::OP_ScriptFarFunctionCall, { path, exp.name->value }); + break; + case call::mode::thread: + emit_opcode(opcode::OP_ScriptFarThreadCall, { path, exp.name->value, argcount }); + break; + case call::mode::childthread: + emit_opcode(opcode::OP_ScriptFarChildThreadCall, { path, exp.name->value, argcount }); + break; + case call::mode::builtin: + // no far builtins + break; + } + } + else if (type == call::type::builtin) + { + if (exp.mode != call::mode::normal) + throw comp_error(exp.loc(), "builtin calls can't be threaded"); + + if (ctx_->props() & props::farcall) + { + emit_opcode(opcode::OP_CallBuiltin, { exp.name->value, argcount }); + } + else + { + switch (exp.args->list.size()) + { + case 0: + emit_opcode(opcode::OP_CallBuiltin0, exp.name->value); + break; + case 1: + emit_opcode(opcode::OP_CallBuiltin1, exp.name->value); + break; + case 2: + emit_opcode(opcode::OP_CallBuiltin2, exp.name->value); + break; + case 3: + emit_opcode(opcode::OP_CallBuiltin3, exp.name->value); + break; + case 4: + emit_opcode(opcode::OP_CallBuiltin4, exp.name->value); + break; + case 5: + emit_opcode(opcode::OP_CallBuiltin5, exp.name->value); + break; + default: + emit_opcode(opcode::OP_CallBuiltin, { exp.name->value, argcount }); + break; + } + } + } + + if (is_stmt) + emit_opcode(opcode::OP_DecTop); +} + +auto compiler::emit_expr_method(expr_method const& exp, scope& scp, bool is_stmt) -> void +{ + if (exp.value == node::expr_pointer) + emit_expr_method_pointer(*exp.value.as_pointer, exp.obj, scp, is_stmt); + else if (exp.value == node::expr_function) + emit_expr_method_function(*exp.value.as_function, exp.obj, scp, is_stmt); + else + throw comp_error(exp.loc(), "unknown method call expression"); +} + +auto compiler::emit_expr_method_pointer(expr_pointer const& exp, expr const& obj, scope& scp, bool is_stmt) -> void +{ + if (exp.mode == call::mode::normal) + emit_opcode(opcode::OP_PreScriptCall); + + emit_expr_arguments(*exp.args, scp); + emit_expr(obj, scp); + emit_expr(exp.func, scp); + + auto argcount = fmt::format("{}", exp.args->list.size()); + + switch (exp.mode) + { + case call::mode::normal: + emit_opcode(opcode::OP_ScriptMethodCallPointer); + break; + case call::mode::thread: + emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); + break; + case call::mode::childthread: + emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); + break; + case call::mode::builtin: + emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); + break; + } + + if (is_stmt) + emit_opcode(opcode::OP_DecTop); +} + +auto compiler::emit_expr_method_function(expr_function const& exp, expr const& obj, scope& scp, bool is_stmt) -> void +{ + auto path = std::string{}; + auto type = resolve_function_type(exp, path); + + if (ctx_->props() & props::farcall && type == call::type::local) + { + type = call::type::far; + } + + if (type != call::type::builtin && exp.mode == call::mode::normal) + emit_opcode(opcode::OP_PreScriptCall); + + emit_expr_arguments(*exp.args, scp); + emit_expr(obj, scp); + + auto argcount = fmt::format("{}", exp.args->list.size()); + + if (type == call::type::local) + { + switch (exp.mode) + { + case call::mode::normal: + emit_opcode(opcode::OP_ScriptLocalMethodCall, exp.name->value); + break; + case call::mode::thread: + emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { exp.name->value, argcount }); + break; + case call::mode::childthread: + emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { exp.name->value, argcount }); + break; + case call::mode::builtin: + // no local builtins + break; + } + } + else if (type == call::type::far) + { + switch (exp.mode) + { + case call::mode::normal: + emit_opcode(opcode::OP_ScriptFarMethodCall, { path, exp.name->value }); + break; + case call::mode::thread: + emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { path, exp.name->value, argcount }); + break; + case call::mode::childthread: + emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { path, exp.name->value, argcount }); + break; + case call::mode::builtin: + // no far builtins + break; + } + } + else if (type == call::type::builtin) + { + if (exp.mode != call::mode::normal) + throw comp_error(exp.loc(), "builtin calls can't be threaded"); + + if (ctx_->props() & props::farcall) + { + emit_opcode(opcode::OP_CallBuiltinMethod, { exp.name->value, argcount }); + } + else + { + switch (exp.args->list.size()) + { + case 0: + emit_opcode(opcode::OP_CallBuiltinMethod0, exp.name->value); + break; + case 1: + emit_opcode(opcode::OP_CallBuiltinMethod1, exp.name->value); + break; + case 2: + emit_opcode(opcode::OP_CallBuiltinMethod2, exp.name->value); + break; + case 3: + emit_opcode(opcode::OP_CallBuiltinMethod3, exp.name->value); + break; + case 4: + emit_opcode(opcode::OP_CallBuiltinMethod4, exp.name->value); + break; + case 5: + emit_opcode(opcode::OP_CallBuiltinMethod5, exp.name->value); + break; + default: + emit_opcode(opcode::OP_CallBuiltinMethod, { exp.name->value, argcount }); + break; + } + } + } + + if (is_stmt) + emit_opcode(opcode::OP_DecTop); +} + +auto compiler::emit_expr_add_array(expr_add_array const& exp, scope& scp) -> void +{ + emit_opcode(opcode::OP_EmptyArray); + + for (auto const& arg : exp.args->list) + { + emit_expr(arg, scp); + emit_opcode(opcode::OP_AddArray); + } +} + +auto compiler::emit_expr_parameters(expr_parameters const& exp, scope& scp) -> void +{ + if (ctx_->props() & props::params) + { + auto num = static_cast(exp.list.size()); + + if (num) + { + auto data = std::vector{}; + auto size = (ctx_->props() & props::hash) ? num * 8 : num; + + data.push_back(fmt::format("{}", num)); + + for (auto const& entry : exp.list) + { + auto index = variable_initialize(*entry, scp); + data.push_back((ctx_->props() & props::hash) ? entry->value : fmt::format("{}", index)); + } + + emit_opcode(opcode::OP_FormalParams, data); + function_->instructions.back()->size += size; + index_ += size; + } + else + { + emit_opcode( opcode::OP_checkclearparams); + } + } + else + { + for (auto const& entry : exp.list) + { + emit_opcode(opcode::OP_SafeCreateVariableFieldCached, fmt::format("{}", variable_initialize(*entry, scp))); + } + + emit_opcode(opcode::OP_checkclearparams); + } +} + +auto compiler::emit_expr_arguments(expr_arguments const& exp, scope& scp) -> void +{ + //std::reverse(exp.list.begin(), exp.list.end()); // use reverse range + + // for (auto const& entry : exp.list) + // { + // emit_expr(entry, scp); + // } + + for (auto it = exp.list.rbegin(); it != exp.list.rend(); ++it) + { + emit_expr(*it, scp); + } +} + +auto compiler::emit_expr_isdefined(expr_isdefined const& exp, scope& scp) -> void +{ + emit_expr(exp.value, scp); + emit_opcode(opcode::OP_IsDefined); +} + +auto compiler::emit_expr_istrue(expr_istrue const& exp, scope& scp) -> void +{ + emit_expr(exp.value, scp); + emit_opcode(opcode::OP_IsTrue); +} + +auto compiler::emit_expr_reference(expr_reference const& exp, scope&) -> void +{ + bool method = false; + auto path = std::string{}; + auto type = resolve_reference_type(exp, path, method); + + if (ctx_->props() & props::farcall && type == call::type::local) + { + type = call::type::far; + } + + switch (type) + { + case call::type::local: + emit_opcode(opcode::OP_GetLocalFunction, exp.name->value); + break; + case call::type::far: + emit_opcode(opcode::OP_GetFarFunction, { path, exp.name->value }); + break; + case call::type::builtin: + if (method) + emit_opcode(opcode::OP_GetBuiltinMethod, exp.name->value); + else + emit_opcode(opcode::OP_GetBuiltinFunction, exp.name->value); + break; + } +} + +auto compiler::emit_expr_size(expr_size const& exp, scope& scp) -> void +{ + emit_expr(exp.obj, scp); + emit_opcode(opcode::OP_size); +} + +auto compiler::emit_expr_tuple(expr_tuple const& exp, scope& scp) -> void +{ + emit_expr_variable_ref(exp.temp, scp, true); + + auto index = 0u; + + for (auto const& entry : exp.list) + { + if (index == 0) + emit_opcode(opcode::OP_GetZero); + else + emit_opcode(opcode::OP_GetByte, fmt::format("{}", index)); + + index++; + + emit_opcode(opcode::OP_EvalLocalArrayCached, fmt::format("{}", variable_access(*exp.temp.as_identifier, scp))); + + emit_expr_variable_ref(entry, scp, true); + } + + emit_expr_clear_local(*exp.temp.as_identifier, scp); +} + +auto compiler::emit_expr_variable_ref(expr const& exp, scope& scp, bool set) -> void +{ + switch (exp.kind()) + { + case node::expr_array: + emit_expr_array_ref(*exp.as_array, scp, set); + break; + case node::expr_field: + emit_expr_field_ref(*exp.as_field, scp, set); + break; + case node::expr_identifier: + emit_expr_local_ref(*exp.as_identifier, scp, set); + break; + default: + throw comp_error(exp.loc(), "invalid lvalue"); + } +} + +auto compiler::emit_expr_array_ref(expr_array const& exp, scope& scp, bool set) -> void +{ + emit_expr(exp.key, scp); + + switch (exp.obj.kind()) + { + case node::expr_game: + emit_opcode(opcode::OP_GetGameRef); + emit_opcode(opcode::OP_EvalArrayRef); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_array: + case node::expr_field: + emit_expr_variable_ref(exp.obj, scp, false); + emit_opcode(opcode::OP_EvalArrayRef); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_identifier: + { + if (!variable_initialized(*exp.obj.as_identifier, scp)) + { + auto index = variable_initialize(*exp.obj.as_identifier, scp); + emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, (ctx_->props() & props::hash) ? exp.obj.as_identifier->value : fmt::format("{}", index)); + + if (!set) throw comp_error(exp.loc(), "INTERNAL: VAR CREATED BUT NOT SET"); + } + else + { + auto index = variable_access(*exp.obj.as_identifier, scp); + + if (index == 0) + emit_opcode(opcode::OP_EvalLocalArrayRefCached0); + else + emit_opcode(opcode::OP_EvalLocalArrayRefCached, fmt::format("{}", index)); + } + + if (set) emit_opcode(opcode::OP_SetVariableField); + } + break; + case node::expr_call: + case node::expr_method: + default: + throw comp_error(exp.loc(), "invalid array lvalue"); + } +} + +auto compiler::emit_expr_field_ref(expr_field const& exp, scope& scp, bool set) -> void +{ + auto const& field = exp.field->value; + + switch (exp.obj.kind()) + { + case node::expr_level: + set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); + break; + case node::expr_anim: + set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); + break; + case node::expr_self: + set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); + break; + case node::expr_array: + emit_expr_array(*exp.obj.as_array, scp); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_field: + emit_expr_field(*exp.obj.as_field, scp); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_identifier: + emit_opcode(opcode::OP_EvalLocalVariableObjectCached, fmt::format("{}", variable_access(*exp.obj.as_identifier, scp))); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_call: + emit_expr_call(*exp.obj.as_call, scp, false); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_method: + emit_expr_method(*exp.obj.as_method, scp, false); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + default: + throw comp_error(exp.obj.loc(), "not an object"); + } +} + +auto compiler::emit_expr_local_ref(expr_identifier const& exp, scope& scp, bool set) -> void +{ + if (set) + { + if (!variable_initialized(exp, scp)) + { + auto index = variable_initialize(exp, scp); + emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, (ctx_->props() & props::hash) ? exp.value : fmt::format("{}", index)); + } + else + { + auto index = variable_access(exp, scp); + + if (index == 0) + emit_opcode(opcode::OP_SetLocalVariableFieldCached0); + else + emit_opcode(opcode::OP_SetLocalVariableFieldCached, fmt::format("{}", index)); + } + } + else + { + auto index = variable_access(exp, scp); + + if (index == 0) + emit_opcode(opcode::OP_EvalLocalVariableRefCached0); + else + emit_opcode(opcode::OP_EvalLocalVariableRefCached, fmt::format("{}", index)); + } +} + +auto compiler::emit_expr_variable(expr const& exp, scope& scp) -> void +{ + switch (exp.kind()) + { + case node::expr_array: + emit_expr_array(*exp.as_array, scp); + break; + case node::expr_field: + emit_expr_field(*exp.as_field, scp); + break; + case node::expr_identifier: + emit_expr_local(*exp.as_identifier, scp); + break; + default: + throw comp_error(exp.loc(), "invalid variable type."); + } +} + +auto compiler::emit_expr_array(expr_array const& exp, scope& scp) -> void +{ + emit_expr(exp.key, scp); + + if (exp.obj == node::expr_identifier) + { + emit_opcode(opcode::OP_EvalLocalArrayCached, fmt::format("{}", variable_access(*exp.obj.as_identifier, scp))); + } + else + { + emit_expr(exp.obj, scp); + emit_opcode(opcode::OP_EvalArray); + } +} + +auto compiler::emit_expr_field(expr_field const& exp, scope& scp) -> void +{ + auto const& field = exp.field->value; + + switch (exp.obj.kind()) + { + case node::expr_level: + emit_opcode(opcode::OP_EvalLevelFieldVariable, field); + break; + case node::expr_anim: + emit_opcode(opcode::OP_EvalAnimFieldVariable, field); + break; + case node::expr_self: + emit_opcode(opcode::OP_EvalSelfFieldVariable, field); + break; + case node::expr_array: + emit_expr_array(*exp.obj.as_array, scp); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + case node::expr_field: + emit_expr_field(*exp.obj.as_field, scp); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + case node::expr_call: + emit_expr_call(*exp.obj.as_call, scp, false); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + case node::expr_method: + emit_expr_method(*exp.obj.as_method, scp, false); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + case node::expr_identifier: + emit_opcode(opcode::OP_EvalLocalVariableObjectCached, fmt::format("{}", variable_access(*exp.obj.as_identifier, scp))); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + default: + throw comp_error(exp.loc(), "unknown field variable object type"); + } +} + +auto compiler::emit_expr_local(expr_identifier const& exp, scope& scp) -> void +{ + auto index = variable_access(exp, scp); + + switch (index) + { + case 0: + emit_opcode(opcode::OP_EvalLocalVariableCached0); + break; + case 1: + emit_opcode(opcode::OP_EvalLocalVariableCached1); + break; + case 2: + emit_opcode(opcode::OP_EvalLocalVariableCached2); + break; + case 3: + emit_opcode(opcode::OP_EvalLocalVariableCached3); + break; + case 4: + emit_opcode(opcode::OP_EvalLocalVariableCached4); + break; + case 5: + emit_opcode(opcode::OP_EvalLocalVariableCached5); + break; + default: + emit_opcode(opcode::OP_EvalLocalVariableCached, fmt::format("{}", index)); + break; + } +} + +auto compiler::emit_expr_object(expr const& exp, scope& scp) -> void +{ + switch (exp.kind()) + { + case node::expr_level: + emit_opcode(opcode::OP_GetLevelObject); + break; + case node::expr_anim: + emit_opcode(opcode::OP_GetAnimObject); + break; + case node::expr_self: + emit_opcode(opcode::OP_GetSelfObject); + break; + case node::expr_array: + emit_expr_array(*exp.as_array, scp); + emit_opcode(opcode::OP_CastFieldObject); + break; + case node::expr_field: + emit_expr_field(*exp.as_field, scp); + emit_opcode(opcode::OP_CastFieldObject); + break; + case node::expr_call: + emit_expr_call(*exp.as_call, scp, false); + emit_opcode(opcode::OP_CastFieldObject); + break; + case node::expr_method: + emit_expr_method(*exp.as_method, scp, false); + emit_opcode(opcode::OP_CastFieldObject); + break; + case node::expr_identifier: + emit_opcode(opcode::OP_EvalLocalVariableObjectCached, fmt::format("{}", variable_access(*exp.as_identifier, scp))); + break; + default: + throw comp_error(exp.loc(), "not an object"); + } +} + +auto compiler::emit_expr_vector(expr_vector const& exp, scope& scp) -> void +{ + auto data = std::vector{}; + auto isexpr = false; + + if (exp.x == node::expr_integer) + data.push_back(exp.x.as_integer->value); + else if (exp.x == node::expr_float) + data.push_back(exp.x.as_float->value); + else isexpr = true; + + if (exp.y == node::expr_integer) + data.push_back(exp.y.as_integer->value); + else if (exp.y == node::expr_float) + data.push_back(exp.y.as_float->value); + else isexpr = true; + + if (exp.z == node::expr_integer) + data.push_back(exp.z.as_integer->value); + else if (exp.z == node::expr_float) + data.push_back(exp.z.as_float->value); + else isexpr = true; + + if (!isexpr) + { + if (ctx_->endian() == endian::little) + emit_opcode(opcode::OP_GetVector, data); + else + { + auto base = index_ + 1; + auto algn = (base + 3) & ~3; + emit_opcode(opcode::OP_GetVector, data); + index_ += (algn - base); + function_->instructions.back()->size += (algn - base); + } + } + else + { + emit_expr(exp.z, scp); + emit_expr(exp.y, scp); + emit_expr(exp.x, scp); + emit_opcode(opcode::OP_vector); + } +} + +auto compiler::emit_expr_animation(expr_animation const& exp) -> void +{ + if (animname_.empty()) + { + throw comp_error(exp.loc(), "trying to use animation without specified using animtree"); + } + + if (animload_) + { + emit_opcode(opcode::OP_GetAnimation, { "", exp.value }); + } + else + { + animload_ = true; + emit_opcode(opcode::OP_GetAnimation, { animname_, exp.value }); + } +} + +auto compiler::emit_expr_animtree(expr_animtree const& exp) -> void +{ + if (animname_.empty()) + { + throw comp_error(exp.loc(), "trying to use animtree without specified using animtree"); + } + + if (animload_) + { + emit_opcode(opcode::OP_GetAnimTree, ""); + } + else + { + animload_ = true; + emit_opcode(opcode::OP_GetAnimTree, animname_); + } +} + +auto compiler::emit_expr_istring(expr_istring const& exp) -> void +{ + emit_opcode(opcode::OP_GetIString, exp.value); +} + +auto compiler::emit_expr_string(expr_string const& exp) -> void +{ + emit_opcode(opcode::OP_GetString, exp.value); +} + +auto compiler::emit_expr_float(expr_float const& exp) -> void +{ + emit_opcode(opcode::OP_GetFloat, exp.value); +} + +auto compiler::emit_expr_integer(expr_integer const& exp) -> void +{ + auto value = std::atoll(exp.value.data()); + + if (value == 0) + { + emit_opcode(opcode::OP_GetZero); + } + else if (value > 0 && value < 256) + { + emit_opcode(opcode::OP_GetByte, exp.value); + } + else if (value < 0 && value > -256) + { + emit_opcode(opcode::OP_GetNegByte, exp.value.substr(1)); + } + else if (value > 0 && value < 65536) + { + emit_opcode(opcode::OP_GetUnsignedShort, exp.value); + } + else if (value < 0 && value > -65536) + { + emit_opcode(opcode::OP_GetNegUnsignedShort, exp.value.substr(1)); + } + else + { + if (ctx_->engine() == engine::iw9) + { + if (value > 0 && value < 4294967296) + { + emit_opcode(opcode::OP_GetUnsignedInt, exp.value); + } + else if (value < 0 && value > -4294967296) + { + emit_opcode(opcode::OP_GetNegUnsignedInt, exp.value.substr(1)); + } + else + { + emit_opcode(opcode::OP_GetInteger64, exp.value); + } + } + else + { + emit_opcode(opcode::OP_GetInteger, exp.value); + } + } +} + +auto compiler::emit_expr_false(expr_false const&) -> void +{ + emit_opcode(opcode::OP_GetZero); +} + +auto compiler::emit_expr_true(expr_true const&) -> void +{ + emit_opcode(opcode::OP_GetByte, "1"); +} + +auto compiler::emit_create_local_vars(scope& scp) -> void +{ + if (scp.create_count != scp.public_count) + { + for (auto i = scp.create_count; i < scp.public_count; i++) + { + emit_opcode(opcode::OP_CreateLocalVariable, (ctx_->props() & props::hash) ? scp.vars[i].name : fmt::format("{}", scp.vars[i].create)); + scp.vars[i].init = true; + } + + scp.create_count = scp.public_count; + } +} + +auto compiler::emit_remove_local_vars(scope& scp) -> void +{ + if (scp.abort == scope::abort_none) + { + auto count = scp.create_count - scp.public_count; + + if (count > 0) + { + emit_opcode(opcode::OP_RemoveLocalVariables, fmt::format("{}", count)); + } + } +} + +auto compiler::emit_opcode(opcode op) -> void +{ + function_->instructions.push_back(make_instruction()); + + auto& inst = function_->instructions.back(); + inst->opcode = op; + inst->size = ctx_->opcode_size(op); + inst->index = index_; + + index_ += inst->size; +} + +auto compiler::emit_opcode(opcode op, std::string const& data) -> void +{ + function_->instructions.push_back(make_instruction()); + + auto& inst = function_->instructions.back(); + inst->opcode = op; + inst->size = ctx_->opcode_size(op); + inst->index = index_; + inst->data.push_back(data); + + index_ += inst->size; +} + +auto compiler::emit_opcode(opcode op, std::vector const& data) -> void +{ + function_->instructions.push_back(make_instruction()); + + auto& inst = function_->instructions.back(); + inst->opcode = op; + inst->size = ctx_->opcode_size(op); + inst->index = index_; + inst->data = data; + + index_ += inst->size; +} + +auto compiler::process_function(decl_function const& func) -> void +{ + auto ins = scopes_.insert({ func.body.get(), make_scope() }); + auto& scp_body = ins.first->second; + + process_expr_parameters(*func.params, *scp_body); + process_stmt_list(*func.body, *scp_body); +} + +auto compiler::process_stmt(stmt const& stm, scope& scp) -> void +{ + switch (stm.kind()) + { + case node::stmt_list: + process_stmt_list(*stm.as_list, scp); + break; + case node::stmt_dev: + process_stmt_dev(*stm.as_dev, scp); + break; + case node::stmt_expr: + process_stmt_expr(*stm.as_expr, scp); + break; + case node::stmt_assign: + process_stmt_assign(*stm.as_assign, scp); + break; + case node::stmt_waittill: + process_stmt_waittill(*stm.as_waittill, scp); + break; + case node::stmt_if: + process_stmt_if(*stm.as_if, scp); + break; + case node::stmt_ifelse: + process_stmt_ifelse(*stm.as_ifelse, scp); + break; + case node::stmt_while: + process_stmt_while(*stm.as_while, scp); + break; + case node::stmt_dowhile: + process_stmt_dowhile(*stm.as_dowhile, scp); + break; + case node::stmt_for: + process_stmt_for(*stm.as_for, scp); + break; + case node::stmt_foreach: + process_stmt_foreach(*stm.as_foreach, scp); + break; + case node::stmt_switch: + process_stmt_switch(*stm.as_switch, scp); + break; + case node::stmt_break: + process_stmt_break(*stm.as_break, scp); + break; + case node::stmt_continue: + process_stmt_continue(*stm.as_continue, scp); + break; + case node::stmt_return: + process_stmt_return(*stm.as_return, scp); + break; + case node::stmt_call: + case node::stmt_endon: + case node::stmt_notify: + case node::stmt_wait: + case node::stmt_waittillmatch: + case node::stmt_waittillframeend: + case node::stmt_waitframe: + case node::stmt_case: + case node::stmt_default: + case node::stmt_breakpoint: + case node::stmt_prof_begin: + case node::stmt_prof_end: + break; + default: + throw comp_error(stm.loc(), "unknown statement"); + } +} + +auto compiler::process_stmt_list(stmt_list const& stm, scope& scp) -> void +{ + for (auto const& entry : stm.list) + { + process_stmt(entry, scp); + } +} + +auto compiler::process_stmt_dev(stmt_dev const& stm, scope& scp) -> void +{ + process_stmt_list(*stm.body, scp); +} + +auto compiler::process_stmt_expr(stmt_expr const& stm, scope& scp) -> void +{ + switch (stm.value.kind()) + { + case node::expr_increment: + process_expr(stm.value.as_increment->lvalue, scp); + break; + case node::expr_decrement: + process_expr(stm.value.as_decrement->lvalue, scp); + break; + case node::expr_assign_equal: + case node::expr_assign_add: + case node::expr_assign_sub: + case node::expr_assign_mul: + case node::expr_assign_div: + case node::expr_assign_mod: + case node::expr_assign_shift_left: + case node::expr_assign_shift_right: + case node::expr_assign_bitwise_or: + case node::expr_assign_bitwise_and: + case node::expr_assign_bitwise_exor: + process_expr(stm.value.as_assign->lvalue, scp); + break; + case node::null: + break; + default: + throw comp_error(stm.loc(), "unknown expr statement expression"); + } +} + +auto compiler::process_stmt_assign(stmt_assign const& stm, scope& scp) -> void +{ + switch (stm.value.kind()) + { + case node::expr_increment: + process_expr(stm.value.as_increment->lvalue, scp); + break; + case node::expr_decrement: + process_expr(stm.value.as_decrement->lvalue, scp); + break; + case node::expr_assign_equal: + case node::expr_assign_add: + case node::expr_assign_sub: + case node::expr_assign_mul: + case node::expr_assign_div: + case node::expr_assign_mod: + case node::expr_assign_shift_left: + case node::expr_assign_shift_right: + case node::expr_assign_bitwise_or: + case node::expr_assign_bitwise_and: + case node::expr_assign_bitwise_exor: + process_expr(stm.value.as_assign->lvalue, scp); + break; + default: + throw comp_error(stm.loc(), "unknown assign statement expression"); + } +} + +auto compiler::process_stmt_waittill(stmt_waittill const& stm, scope& scp) -> void +{ + for (auto const& entry : stm.args->list) + { + if (entry != node::expr_identifier) + { + throw comp_error(entry.loc(), "illegal waittill param, must be a local variable"); + } + + variable_register(*entry.as_identifier, scp); + } +} + +auto compiler::process_stmt_if(stmt_if const& stm, scope& scp) -> void +{ + auto ins = scopes_.insert({ stm.body.as_node.get(), make_scope() }); + auto& scp_then = ins.first->second; + + scp.copy(scp_then); + process_stmt(stm.body, *scp_then); + + std::vector childs({ scp_then.get() }); + scp.merge(childs); +} + +auto compiler::process_stmt_ifelse(stmt_ifelse const& stm, scope& scp) -> void +{ + auto childs = std::vector{}; + auto abort = scope::abort_return; + + auto ins1 = scopes_.insert({ stm.stmt_if.as_node.get(), make_scope() }); + auto ins2 = scopes_.insert({ stm.stmt_else.as_node.get(), make_scope() }); + auto& scp_then = ins1.first->second; + auto& scp_else = ins2.first->second; + + scp.copy(scp_then); + process_stmt(stm.stmt_if, *scp_then); + + if (scp_then->abort <= scope::abort_return) + { + abort = scp_then->abort; + if (abort == scope::abort_none) + childs.push_back(scp_then.get()); + } + + scp.copy(scp_else); + process_stmt(stm.stmt_else, *scp_else); + + if (scp_else->abort <= abort) + { + abort = scp_else->abort; + if (abort == scope::abort_none) + childs.push_back(scp_else.get()); + } + + if (scp.abort == scope::abort_none) + scp.abort = abort; + + scp.append(childs); + scp.merge(childs); +} + +auto compiler::process_stmt_while(stmt_while const& stm, scope& scp) -> void +{ + bool const_cond = is_constant_condition(stm.test); + + auto old_breaks = break_blks_; + auto old_continues = continue_blks_; + break_blks_.clear(); + continue_blks_.clear(); + + auto ins = scopes_.insert({ stm.body.as_node.get(), make_scope() }); + auto& scp_body = ins.first->second; + + scp.copy(scp_body); + process_stmt(stm.body, *scp_body); + + continue_blks_.push_back(scp_body.get()); + + for (auto i = 0u; i < continue_blks_.size(); i++) + scp.append({ continue_blks_.at(i) }); + + if (const_cond) scp.append(break_blks_); + + scp.merge({ scp_body.get() }); + + break_blks_ = old_breaks; + continue_blks_ = old_continues; +} + +auto compiler::process_stmt_dowhile(stmt_dowhile const& stm, scope& scp) -> void +{ + bool const_cond = is_constant_condition(stm.test); + + auto old_breaks = break_blks_; + auto old_continues = continue_blks_; + break_blks_.clear(); + continue_blks_.clear(); + + auto ins = scopes_.insert({ stm.body.as_node.get(), make_scope() }); + auto& scp_body = ins.first->second; + + scp.copy(scp_body); + process_stmt(stm.body, *scp_body); + + continue_blks_.push_back(scp_body.get()); + + for (auto i = 0u; i < continue_blks_.size(); i++) + scp.append({ continue_blks_.at(i) }); + + if (const_cond) scp.append(break_blks_); + + scp.merge({ scp_body.get() }); + + break_blks_ = old_breaks; + continue_blks_ = old_continues; +} + +auto compiler::process_stmt_for(stmt_for const& stm, scope& scp) -> void +{ + bool const_cond = is_constant_condition(stm.test); + + auto ins1 = scopes_.insert({ stm.body.as_node.get(), make_scope() }); + auto ins2 = scopes_.insert({ stm.iter.as_node.get(), make_scope() }); + auto& scp_body = ins1.first->second; + auto& scp_iter = ins2.first->second; + + process_stmt(stm.init, scp); + + auto old_breaks = break_blks_; + auto old_continues = continue_blks_; + break_blks_.clear(); + continue_blks_.clear(); + + scp.copy(scp_body); + scp.copy(scp_iter); + + process_stmt(stm.body, *scp_body); + + continue_blks_.push_back(scp_body.get()); + + for (auto i = 0u; i < continue_blks_.size(); i++) + scp.append({ continue_blks_.at(i) }); + + process_stmt(stm.iter, *scp_iter); + + scp.append({ scp_iter.get() }); + scp.merge({ scp_iter.get() }); + + if (const_cond) scp.append(break_blks_); + + scp.merge({ scp_body.get() }); + + break_blks_ = old_breaks; + continue_blks_ = old_continues; +} + +auto compiler::process_stmt_foreach(stmt_foreach const& stm, scope& scp) -> void +{ + auto ins1 = scopes_.insert({ stm.body.as_node.get(), make_scope() }); + auto ins2 = scopes_.insert({ stm.key.as_node.get(), make_scope() }); + auto& scp_body = ins1.first->second; + auto& scp_iter = ins2.first->second; + + process_expr(stm.array, scp); + + if (ctx_->props() & props::foreach) + process_expr(stm.key, scp); + + if (ctx_->props() & props::foreach && stm.use_key) + process_expr(stm.index, scp); + + auto old_breaks = break_blks_; + auto old_continues = continue_blks_; + break_blks_.clear(); + continue_blks_.clear(); + + scp.copy(scp_body); + scp.copy(scp_iter); + + process_expr(stm.value, *scp_body); + process_stmt(stm.body, *scp_body); + + continue_blks_.push_back(scp_body.get()); + + for (auto i = 0u; i < continue_blks_.size(); i++) + scp.append({ continue_blks_.at(i) }); + + if (!(ctx_->props() & props::foreach)) + process_expr(stm.key, *scp_iter); + + scp.append({ scp_iter.get() }); + scp.merge({ scp_iter.get() }); + scp.merge({ scp_body.get() }); + + break_blks_ = old_breaks; + continue_blks_ = old_continues; +} + +auto compiler::process_stmt_switch(stmt_switch const& stm, scope& scp) -> void +{ + auto childs = std::vector{}; + auto abort = scope::abort_return; + auto has_default = false; + scope* default_ctx = nullptr; + auto old_breaks = break_blks_; + break_blks_.clear(); + + for (auto i = 0u; i < stm.body->list.size(); i++) + { + auto& entry = stm.body->list[i]; + + if (entry == node::stmt_case) + { + auto ins = scopes_.insert({ entry.as_case->body.get(), make_scope() }); + auto& scp_body = ins.first->second; + + scp.copy(scp_body); + process_stmt_list(*entry.as_case->body, *scp_body); + + if (scp_body->abort != scope::abort_none) + { + if (scp_body->abort == scope::abort_break ) + { + scp_body->abort = scope::abort_none; + abort = scope::abort_none; + childs.push_back(scp_body.get()); + } + else if (scp_body->abort <= abort ) + { + abort = scp_body->abort; + } + } + } + else if (entry == node::stmt_default) + { + auto ins = scopes_.insert({ entry.as_default->body.get(), make_scope() }); + auto& scp_body = ins.first->second; + + scp.copy(scp_body); + process_stmt_list(*entry.as_default->body, *scp_body); + has_default = true; + default_ctx = scp_body.get(); + + if (scp_body->abort != scope::abort_none) + { + if (scp_body->abort == scope::abort_break ) + { + scp_body->abort = scope::abort_none; + abort = scope::abort_none; + childs.push_back(scp_body.get()); + } + else if (scp_body->abort <= abort ) + { + abort = scp_body->abort; + } + } + } + } + + if (has_default) + { + if (default_ctx->abort == scope::abort_none) + { + break_blks_.push_back(default_ctx); + + if (scp.abort == scope::abort_none) + scp.abort = abort; + } + + scp.append(break_blks_); + scp.merge(childs); + } + + break_blks_ = old_breaks; +} + +auto compiler::process_stmt_break(stmt_break const&, scope& scp) -> void +{ + if (scp.abort == scope::abort_none) + { + break_blks_.push_back(&scp); + scp.abort = scope::abort_break; + } +} + +auto compiler::process_stmt_continue(stmt_continue const&, scope& scp) -> void +{ + if (scp.abort == scope::abort_none) + { + continue_blks_.push_back(&scp); + scp.abort = scope::abort_continue; + } +} + +auto compiler::process_stmt_return(stmt_return const&, scope& scp) -> void +{ + if (scp.abort == scope::abort_none) + { + scp.abort = scope::abort_return; + } +} + +auto compiler::process_expr(expr const& exp, scope& scp) -> void +{ + if (exp == node::expr_identifier) + { + variable_register(*exp.as_identifier, scp); + } + else if (exp == node::expr_array) + { + process_expr(exp.as_array->obj, scp); + } + else if (exp == node::expr_tuple) + { + process_expr_tuple(*exp.as_tuple, scp); + } +} + +auto compiler::process_expr_tuple(expr_tuple const& exp, scope& scp) -> void +{ + process_expr(exp.temp, scp); + + for (auto const& entry : exp.list) + { + process_expr(entry, scp); + } +} + +auto compiler::process_expr_parameters(expr_parameters const& exp, scope& scp) -> void +{ + for (auto const& entry : exp.list) + { + variable_register(*entry, scp); + } +} + +auto compiler::variable_register(expr_identifier const& exp, scope& scp) -> void +{ + auto it = std::find_if(scp.vars.begin(), scp.vars.end(), [&](scope::var const& v) { return v.name == exp.value; }); + + if (it == scp.vars.end()) + { + auto found = false; + + for (auto i = 0u; i < stackframe_.size(); i++) + { + if (stackframe_[i] == exp.value) + { + scp.vars.push_back({ exp.value, static_cast(i), false }); + found = true; + break; + } + } + + if (!found) + { + scp.vars.push_back({ exp.value, static_cast(stackframe_.size()), false }); + stackframe_.push_back(exp.value); + } + } +} + +auto compiler::variable_initialized(expr_identifier const& exp, scope& scp) -> bool +{ + for (auto i = 0u; i < scp.vars.size(); i++) + { + if (scp.vars[i].name == exp.value) + { + return scp.vars[i].init; + } + } + + throw comp_error(exp.loc(), fmt::format("local variable '{}' not found", exp.value)); +} + +auto compiler::variable_initialize(expr_identifier const& exp, scope& scp) -> u8 +{ + for (auto i = 0u; i < scp.vars.size(); i++) + { + if (scp.vars[i].name == exp.value) + { + if (!scp.vars[i].init) + { + for (auto j = 0u; j < i; j++) + { + if (!scp.vars[j].init) + { + scp.vars[j].init = true; + emit_opcode(opcode::OP_CreateLocalVariable, (ctx_->props() & props::hash) ? scp.vars[j].name : fmt::format("{}", scp.vars[j].create)); + } + } + + scp.vars[i].init = true; + scp.create_count = i + 1; + return scp.vars[i].create; + } + } + } + + throw comp_error(exp.loc(), fmt::format("local variable '{}' not found", exp.value)); +} + +auto compiler::variable_create(expr_identifier const& exp, scope& scp) -> u8 +{ + for (auto i = 0u; i < scp.vars.size(); i++) + { + auto& var = scp.vars[i]; + + if (var.name == exp.value) + { + if (!var.init) + { + emit_opcode(opcode::OP_CreateLocalVariable, (ctx_->props() & props::hash) ? var.name : fmt::format("{}", var.create)); + var.init = true; + scp.create_count++; + } + + return static_cast(scp.create_count - 1 - i); + } + } + + throw comp_error(exp.loc(), fmt::format("local variable '{}' not found", exp.value)); +} + +auto compiler::variable_access(expr_identifier const& exp, scope& scp) -> u8 +{ + for (auto i = 0u; i < scp.vars.size(); i++) + { + if (scp.vars[i].name == exp.value) + { + if (scp.vars[i].init) + { + return static_cast(scp.create_count - 1 - i); + } + + throw comp_error(exp.loc(), fmt::format("local variable '{}' not initialized", exp.value)); + } + } + + throw comp_error(exp.loc(), fmt::format("local variable '{}' not found", exp.value)); +} + +auto compiler::resolve_function_type(expr_function const& exp, std::string& path) -> call::type +{ + if (!exp.path->value.empty()) + { + path = exp.path->value; + return call::type::far; + } + + auto& name = exp.name->value; + + if (ctx_->func_exists(name) || ctx_->meth_exists(name)) + return call::type::builtin; + + for (auto const& entry : localfuncs_) + { + if (entry == name) + return call::type::local; + } + + if (ctx_->is_includecall(name, path)) + return call::type::far; + + throw comp_error(exp.loc(), "couldn't determine function call type"); +} + +auto compiler::resolve_reference_type(expr_reference const& exp, std::string& path, bool& method) -> call::type +{ + if (!exp.path->value.empty()) + { + path = exp.path->value; + return call::type::far; + } + + auto& name = exp.name->value; + + if (ctx_->func_exists(name)) + { + method = false; + return call::type::builtin; + } + + if (ctx_->meth_exists(name)) + { + method = true; + return call::type::builtin; + } + + for (auto const& entry : localfuncs_) + { + if (entry == name) + return call::type::local; + } + + if (ctx_->is_includecall(name, path)) + return call::type::far; + + throw comp_error(exp.loc(), "couldn't determine function reference type"); +} + +auto compiler::is_constant_condition(expr const& exp) -> bool +{ + switch (exp.kind()) + { + case node::null: + case node::expr_true: + return true; + case node::expr_false: + throw comp_error(exp.loc(), "condition can't be always false"); + case node::expr_integer: + { + auto num = std::stoi(exp.as_integer->value); + if (num != 0) + return true; + else + throw comp_error(exp.loc(), "condition can't be always false"); + } + default: + break; + } + + return false; +} + +auto compiler::insert_label(std::string const& name) -> void +{ + auto const itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + for (auto& inst : function_->instructions) + { + switch (inst->opcode) + { + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_jump: + case opcode::OP_jumpback: + case opcode::OP_switch: + if (inst->data[0] == name) + inst->data[0] = itr->second; + break; + case opcode::OP_endswitch: + default: + break; + } + } + } + else + { + function_->labels.insert({ index_, name }); + } +} + +auto compiler::insert_label() -> std::string +{ + auto const itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + return itr->second; + } + else + { + label_idx_++; + auto name = fmt::format("loc_{}", label_idx_); + function_->labels.insert({ index_, name }); + return name; + } +} + +auto compiler::create_label() -> std::string +{ + label_idx_++; + return fmt::format("loc_{}", label_idx_); +} + +} // namespace xsk::gsc diff --git a/src/gsc/compiler.hpp b/src/gsc/compiler.hpp new file mode 100644 index 00000000..ca7403b2 --- /dev/null +++ b/src/gsc/compiler.hpp @@ -0,0 +1,152 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "misc/types.hpp" + +namespace xsk::gsc +{ + +class compiler +{ + context* ctx_; + assembly::ptr assembly_; + function::ptr function_; + std::vector stackframe_; + std::vector localfuncs_; + std::unordered_map scopes_; + std::vector break_blks_; + std::vector continue_blks_; + std::string animname_; + u32 index_; + u32 label_idx_; + bool can_break_; + bool can_continue_; + bool developer_thread_; + bool animload_; + +public: + compiler(context* ctx); + auto compile(program const& data) -> assembly::ptr; + auto compile(std::string const& file, std::vector& data) -> assembly::ptr; + +private: + auto emit_program(program const& prog) -> void; + auto emit_decl(decl const& dec) -> void; + auto emit_decl_usingtree(decl_usingtree const& animtree) -> void; + auto emit_decl_function(decl_function const& func) -> void; + auto emit_stmt(stmt const& stm, scope& scp, bool last) -> void; + auto emit_stmt_list(stmt_list const& stm, scope& scp, bool last) -> void; + auto emit_stmt_dev(stmt_dev const& stm, scope& scp, bool last) -> void; + auto emit_stmt_expr(stmt_expr const& stm, scope& scp) -> void; + auto emit_stmt_call(stmt_call const& stm, scope& scp) -> void; + auto emit_stmt_assign(stmt_assign const& stm, scope& scp) -> void; + auto emit_stmt_endon(stmt_endon const& stm, scope& scp) -> void; + auto emit_stmt_notify(stmt_notify const& stm, scope& scp) -> void; + auto emit_stmt_wait(stmt_wait const& stm, scope& scp) -> void; + auto emit_stmt_waittill(stmt_waittill const& stm, scope& scp) -> void; + auto emit_stmt_waittillmatch(stmt_waittillmatch const& stm, scope& scp) -> void; + auto emit_stmt_waittillframeend(stmt_waittillframeend const& stm, scope& scp) -> void; + auto emit_stmt_waitframe(stmt_waitframe const& stm, scope& scp) -> void; + auto emit_stmt_if(stmt_if const& stm, scope& scp, bool last) -> void; + auto emit_stmt_ifelse(stmt_ifelse const& stm, scope& scp, bool last) -> void; + auto emit_stmt_while(stmt_while const& stm, scope& scp) -> void; + auto emit_stmt_dowhile(stmt_dowhile const& stm, scope& scp) -> void; + auto emit_stmt_for(stmt_for const& stm, scope& scp) -> void; + auto emit_stmt_foreach(stmt_foreach const& stm, scope& scp) -> void; + auto emit_stmt_switch(stmt_switch const& stm, scope& scp) -> void; + auto emit_stmt_case(stmt_case const& stm, scope& scp) -> void; + auto emit_stmt_default(stmt_default const& stm, scope& scp) -> void; + auto emit_stmt_break(stmt_break const& stm, scope& scp) -> void; + auto emit_stmt_continue(stmt_continue const& stm, scope& scp) -> void; + auto emit_stmt_return(stmt_return const& stm, scope& scp) -> void; + auto emit_stmt_breakpoint(stmt_breakpoint const& stm, scope& scp) -> void; + auto emit_stmt_prof_begin(stmt_prof_begin const& stm, scope& scp) -> void; + auto emit_stmt_prof_end(stmt_prof_end const& stm, scope& scp) -> void; + auto emit_expr(expr const& exp, scope& scp) -> void; + auto emit_expr_assign(expr_assign const& exp, scope& scp) -> void; + auto emit_expr_clear(expr const& exp, scope& scp) -> void; + auto emit_expr_clear_local(expr_identifier const& exp, scope& scp) -> void; + auto emit_expr_increment(expr_increment const& exp, scope& scp, bool is_stmt) -> void; + auto emit_expr_decrement(expr_decrement const& exp, scope& scp, bool is_stmt) -> void; + auto emit_expr_ternary(expr_ternary const& exp, scope& scp) -> void; + auto emit_expr_binary(expr_binary const& exp, scope& scp) -> void; + auto emit_expr_and(expr_and const& exp, scope& scp) -> void; + auto emit_expr_or(expr_or const& exp, scope& scp) -> void; + auto emit_expr_complement(expr_complement const& exp, scope& scp) -> void; + auto emit_expr_negate(expr_negate const& exp, scope& scp) -> void; + auto emit_expr_not(expr_not const& exp, scope& scp) -> void; + auto emit_expr_call(expr_call const& exp, scope& scp, bool is_stmt) -> void; + auto emit_expr_call_pointer(expr_pointer const& exp, scope& scp, bool is_stmt) -> void; + auto emit_expr_call_function(expr_function const& exp, scope& scp, bool is_stmt) -> void; + auto emit_expr_method(expr_method const& exp, scope& scp, bool is_stmt) -> void; + auto emit_expr_method_pointer(expr_pointer const& exp, expr const& obj, scope& scp, bool is_stmt) -> void; + auto emit_expr_method_function(expr_function const& exp, expr const& obj, scope& scp, bool is_stmt) -> void; + auto emit_expr_add_array(expr_add_array const& exp, scope& scp) -> void; + auto emit_expr_parameters(expr_parameters const& exp, scope& scp) -> void; + auto emit_expr_arguments(expr_arguments const& exp, scope& scp) -> void; + auto emit_expr_isdefined(expr_isdefined const& exp, scope& scp) -> void; + auto emit_expr_istrue(expr_istrue const& exp, scope& scp) -> void; + auto emit_expr_reference(expr_reference const& exp, scope& scp) -> void; + auto emit_expr_size(expr_size const& exp, scope& scp) -> void; + auto emit_expr_tuple(expr_tuple const& exp, scope& scp) -> void; + auto emit_expr_variable_ref(expr const& exp, scope& scp, bool set) -> void; + auto emit_expr_array_ref(expr_array const& exp, scope& scp, bool set) -> void; + auto emit_expr_field_ref(expr_field const& exp, scope& scp, bool set) -> void; + auto emit_expr_local_ref(expr_identifier const& exp, scope& scp, bool set) -> void; + auto emit_expr_variable(expr const& exp, scope& scp) -> void; + auto emit_expr_array(expr_array const& exp, scope& scp) -> void; + auto emit_expr_field(expr_field const& exp, scope& scp) -> void; + auto emit_expr_local(expr_identifier const& exp, scope& scp) -> void; + auto emit_expr_object(expr const& exp, scope& scp) -> void; + auto emit_expr_vector(expr_vector const& exp, scope& scp) -> void; + auto emit_expr_animation(expr_animation const& exp) -> void; + auto emit_expr_animtree(expr_animtree const& exp) -> void; + auto emit_expr_istring(expr_istring const& exp) -> void; + auto emit_expr_string(expr_string const& exp) -> void; + auto emit_expr_float(expr_float const& exp) -> void; + auto emit_expr_integer(expr_integer const& exp) -> void; + auto emit_expr_false(expr_false const& exp) -> void; + auto emit_expr_true(expr_true const& exp) -> void; + auto emit_create_local_vars(scope& scp) -> void; + auto emit_remove_local_vars(scope& scp) -> void; + auto emit_opcode(opcode op) -> void; + auto emit_opcode(opcode op, std::string const& data) -> void; + auto emit_opcode(opcode op, std::vector const& data) -> void; + auto process_function(decl_function const& func) -> void; + auto process_stmt(stmt const& stm, scope& scp) -> void; + auto process_stmt_list(stmt_list const& stm, scope& scp) -> void; + auto process_stmt_dev(stmt_dev const& stm, scope& scp) -> void; + auto process_stmt_expr(stmt_expr const& stm, scope& scp) -> void; + auto process_stmt_assign(stmt_assign const& stm, scope& scp) -> void; + auto process_stmt_waittill(stmt_waittill const& stm, scope& scp) -> void; + auto process_stmt_if(stmt_if const& stm, scope& scp) -> void; + auto process_stmt_ifelse(stmt_ifelse const& stm, scope& scp) -> void; + auto process_stmt_while(stmt_while const& stm, scope& scp) -> void; + auto process_stmt_dowhile(stmt_dowhile const& stm, scope& scp) -> void; + auto process_stmt_for(stmt_for const& stm, scope& scp) -> void; + auto process_stmt_foreach(stmt_foreach const& stm, scope& scp) -> void; + auto process_stmt_switch(stmt_switch const& stm, scope& scp) -> void; + auto process_stmt_break(stmt_break const& stm, scope& scp) -> void; + auto process_stmt_continue(stmt_continue const& stm, scope& scp) -> void; + auto process_stmt_return(stmt_return const& stm, scope& scp) -> void; + auto process_expr(expr const& exp, scope& scp) -> void; + auto process_expr_tuple(expr_tuple const& exp, scope& scp) -> void; + auto process_expr_parameters(expr_parameters const& exp, scope& scp) -> void; + auto variable_register(expr_identifier const& exp, scope& scp) -> void; + auto variable_initialized(expr_identifier const& exp, scope& scp) -> bool; + auto variable_initialize(expr_identifier const& exp, scope& scp) -> u8; + auto variable_create(expr_identifier const& exp, scope& scp) -> u8; + auto variable_access(expr_identifier const& exp, scope& scp) -> u8; + auto resolve_function_type(expr_function const& exp, std::string& path) -> call::type; + auto resolve_reference_type(expr_reference const& exp, std::string& path, bool& method) -> call::type; + auto is_constant_condition(expr const& exp) -> bool; + auto insert_label(std::string const& label) -> void; + auto create_label() -> std::string; + auto insert_label() -> std::string; +}; + +} // namespace xsk::gsc diff --git a/src/gsc/context.cpp b/src/gsc/context.cpp new file mode 100644 index 00000000..c1891c98 --- /dev/null +++ b/src/gsc/context.cpp @@ -0,0 +1,661 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "context.hpp" +#include "utils/string.hpp" + +namespace xsk::gsc +{ + +read_cb_type read_callback = nullptr; +std::unordered_map header_files; +std::set includes; +std::unordered_map> include_cache; +std::set new_func_map; +std::set new_meth_map; + +context::context(gsc::props props, gsc::engine engine, gsc::endian endian, gsc::system system, u32 str_count) + : props_{ props }, engine_{ engine }, endian_{ endian }, system_{ system }, str_count_{ str_count }, + source_{ this }, assembler_{ this }, disassembler_{ this }, compiler_{ this }, decompiler_{ this } +{ +} + +auto context::init(gsc::build build, read_cb_type callback) -> void +{ + build_ = build; + read_callback = callback; +} + +auto context::cleanup() -> void +{ + header_files.clear(); + include_cache.clear(); + includes.clear(); +} + +auto context::opcode_size(opcode op) const -> u32 +{ + switch (op) + { + case opcode::OP_CastFieldObject: + case opcode::OP_plus: + case opcode::OP_GetGameRef: + case opcode::OP_GetThisthread: + case opcode::OP_greater: + case opcode::OP_shift_right: + case opcode::OP_dec: + case opcode::OP_bit_or: + case opcode::OP_equality: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_notify: + case opcode::OP_PreScriptCall: + case opcode::OP_GetUndefined: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_size: + case opcode::OP_AddArray: + case opcode::OP_endon: + case opcode::OP_shift_left: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_Return: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetSelfObject: + case opcode::OP_GetGame: + case opcode::OP_EvalArray: + case opcode::OP_GetSelf: + case opcode::OP_End: + case opcode::OP_less_equal: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_checkclearparams: + case opcode::OP_waittillmatch2: + case opcode::OP_minus: + case opcode::OP_greater_equal: + case opcode::OP_vector: + case opcode::OP_ClearArray: + case opcode::OP_DecTop: + case opcode::OP_CastBool: + case opcode::OP_EvalArrayRef: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_waittill: + case opcode::OP_GetAnimObject: + case opcode::OP_mod: + case opcode::OP_clearparams: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_EmptyArray: + case opcode::OP_BoolComplement: + case opcode::OP_less: + case opcode::OP_BoolNot: + case opcode::OP_waittillFrameEnd: + case opcode::OP_waitframe: + case opcode::OP_GetLevelObject: + case opcode::OP_inc: + case opcode::OP_GetAnim: + case opcode::OP_SetVariableField: + case opcode::OP_divide: + case opcode::OP_multiply: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_bit_and: + case opcode::OP_voidCodepos: + case opcode::OP_inequality: + case opcode::OP_bit_ex_or: + case opcode::OP_BoolNotAfterAnd: + case opcode::OP_IsDefined: + case opcode::OP_IsTrue: + return 1; + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_waittillmatch: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_GetByte: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_GetNegByte: + case opcode::OP_GetAnimTree: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_FormalParams: + return 2; + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_jumpback: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetNegUnsignedShort: + case opcode::OP_GetBuiltinMethod: + case opcode::OP_endswitch: + case opcode::OP_GetUnsignedShort: + case opcode::OP_JumpOnFalse: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + return 3; + case opcode::OP_CallBuiltin: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall: + return 4; + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_GetInteger: + case opcode::OP_ScriptLocalMethodChildThreadCall: + case opcode::OP_GetFloat: + case opcode::OP_switch: + case opcode::OP_jump: + case opcode::OP_GetUnkxHash: + case opcode::OP_GetUnsignedInt: + case opcode::OP_GetNegUnsignedInt: + return 5; + case opcode::OP_GetStatHash: + case opcode::OP_GetEnumHash: + case opcode::OP_GetDvarHash: + case opcode::OP_GetInteger64: + return 9; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + return (props_ & props::farcall) ? 5 : 4; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + return (props_ & props::farcall) ? 6 : 5; + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_SetNewLocalVariableFieldCached0: + return (props_ & props::hash) ? 9 : 2; + case opcode::OP_EvalSelfFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_EvalAnimFieldVariableRef: + return (props_ & props::hash) ? 9 : (props_ & props::tok4) ? 5 : 3; + case opcode::OP_GetString: + case opcode::OP_GetIString: + return (props_ & props::str4) ? 5 : 3; + case opcode::OP_GetAnimation: + return (props_ & props::str4) ? 9 : 5; + case opcode::OP_GetVector: + return 13; + case opcode::OP_ClearVariableField: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_NOP: + case opcode::OP_abort: + case opcode::OP_object: + case opcode::OP_thread_object: + case opcode::OP_EvalLocalVariable: + case opcode::OP_EvalLocalVariableRef: + case opcode::OP_breakpoint: + case opcode::OP_assignmentBreakpoint: + case opcode::OP_manualAndAssignmentBreakpoint: + case opcode::OP_prof_begin: + case opcode::OP_prof_end: + case opcode::OP_NativeGetLocalFunction: + case opcode::OP_NativeLocalFunctionCall: + case opcode::OP_NativeLocalFunctionCall2: + case opcode::OP_NativeLocalMethodCall: + case opcode::OP_NativeGetFarFunction: + case opcode::OP_NativeFarFunctionCall: + case opcode::OP_NativeFarFunctionCall2: + case opcode::OP_NativeFarMethodCall: + case opcode::OP_NativeLocalFunctionThreadCall: + case opcode::OP_NativeLocalMethodThreadCall: + case opcode::OP_NativeLocalFunctionChildThreadCall: + case opcode::OP_NativeLocalMethodChildThreadCall: + case opcode::OP_NativeFarFunctionThreadCall: + case opcode::OP_NativeFarMethodThreadCall: + case opcode::OP_NativeFarFunctionChildThreadCall: + case opcode::OP_NativeFarMethodChildThreadCall: + case opcode::OP_EvalNewLocalArrayRefCached0_Precompiled: + case opcode::OP_SetNewLocalVariableFieldCached0_Precompiled: + case opcode::OP_CreateLocalVariable_Precompiled: + case opcode::OP_SafeCreateVariableFieldCached_Precompiled: + case opcode::OP_FormalParams_Precompiled: + case opcode::OP_iw9_139: + case opcode::OP_iw9_140: + case opcode::OP_iw9_141: + case opcode::OP_iw9_142: + case opcode::OP_iw9_143: + case opcode::OP_iw9_144: + case opcode::OP_iw9_166: + default: + throw error(fmt::format("couldn't resolve instruction size for '{}'", opcode_name(op))); + } +} + +auto context::opcode_id(opcode op) const -> u8 +{ + auto const itr = code_map_rev_.find(op); + + if (itr != code_map_rev_.end()) + { + return itr->second; + } + + throw error(fmt::format("couldn't resolve opcode id for '{}'", opcode_name(op))); +} + +auto context::opcode_enum(u8 id) const -> opcode +{ + auto const itr = code_map_.find(id); + + if (itr != code_map_.end()) + { + return itr->second; + } + + throw error(fmt::format("couldn't resolve opcode enum for '{:02X}'", id)); +} + +auto context::func_id(std::string const& name) const -> u16 +{ + if (name.starts_with("_func_")) + { + return static_cast(std::stoul(name.substr(6), nullptr, 16)); + } + + auto const itr = func_map_rev_.find(name); + + if (itr != func_map_rev_.end()) + { + return itr->second; + } + + throw error(fmt::format("couldn't resolve builtin function id for {}", name)); +} + +auto context::func_name(u16 id) const -> std::string +{ + auto const itr = func_map_.find(id); + + if (itr != func_map_.end()) + { + return std::string{ itr->second }; + } + + return fmt::format("_func_{:04X}", id); +} + +auto context::func_exists(std::string const& name) const -> bool +{ + if (name.starts_with("_func_")) return true; + + auto const itr = func_map_rev_.find(name); + + if (itr != func_map_rev_.end()) + { + return true; + } + + return false; +} + +auto context::func_add(std::string const& name, u16 id) -> void +{ + auto const itr = func_map_rev_.find(name); + + if (itr != func_map_rev_.end()) + { + throw error(fmt::format("builtin function '{}' already defined", name)); + } + + auto const str = new_func_map.find(name); + + if (str != new_func_map.end()) + { + func_map_.insert({ id, *str }); + func_map_rev_.insert({ *str, id }); + } + else + { + auto ins = new_func_map.insert(name); + + if (ins.second) + { + func_map_.insert({ id, *ins.first }); + func_map_rev_.insert({ *ins.first, id }); + } + } +} + +auto context::meth_id(std::string const& name) const -> u16 +{ + if (name.starts_with("_meth_")) + { + return static_cast(std::stoul(name.substr(6), nullptr, 16)); + } + + auto const itr = meth_map_rev_.find(name); + + if (itr != meth_map_rev_.end()) + { + return itr->second; + } + + throw error(fmt::format("couldn't resolve builtin method id for {}", name)); +} + +auto context::meth_name(u16 id) const -> std::string +{ + auto const itr = meth_map_.find(id); + + if (itr != meth_map_.end()) + { + return std::string{ itr->second }; + } + + return fmt::format("_meth_{:04X}", id); +} + +auto context::meth_exists(std::string const& name) const -> bool +{ + if (name.starts_with("_meth_")) return true; + + auto const itr = meth_map_rev_.find(name); + + if (itr != meth_map_rev_.end()) + { + return true; + } + + return false; +} + +auto context::meth_add(std::string const& name, u16 id) -> void +{ + auto const itr = meth_map_rev_.find(name); + + if (itr != meth_map_rev_.end()) + { + throw error(fmt::format("builtin method '{}' already defined", name)); + } + + auto const str = new_meth_map.find(name); + + if (str != new_meth_map.end()) + { + meth_map_.insert({ id, *str }); + meth_map_rev_.insert({ *str, id }); + } + else + { + auto ins = new_meth_map.insert(name); + + if (ins.second) + { + meth_map_.insert({ id, *ins.first }); + meth_map_rev_.insert({ *ins.first, id }); + } + } +} + +auto context::token_id(std::string const& name) const -> u32 +{ + if (name.starts_with("_id_")) + { + return static_cast(std::stoul(name.substr(4), nullptr, 16)); + } + + auto const itr = token_map_rev_.find(name); + + if (itr != token_map_rev_.end()) + { + return itr->second; + } + + return 0; +} + +auto context::token_name(u32 id) const -> std::string +{ + auto const itr = token_map_.find(id); + + if (itr != token_map_.end()) + { + return std::string{ itr->second }; + } + + return fmt::format("_id_{:04X}", id); +} + +auto context::path_id(std::string const& name) const -> u64 +{ + if (name.starts_with("_id_")) + { + return static_cast(std::stoull(name.substr(4), nullptr, 16)); + } + + char const* str = name.data(); + u64 hash = 0x47F5817A5EF961BA; + + while ( *str ) + { + u8 byte = *str++; + + if (byte == '\\') + { + byte = '/'; + } + else if (static_cast(byte - 65) <= 25) + { + byte += 32; + } + + hash = (u64)0x100000001B3 * ((u64)byte ^ hash); + } + + return hash & 0x7FFFFFFFFFFFFFFF; +} + +auto context::path_name(u64 id) const -> std::string +{ + auto const itr = path_map_.find(id); + + if (itr != path_map_.end()) + { + return std::string{ itr->second }; + } + + return fmt::format("_id_{:016X}", id); +} + +auto context::hash_id(std::string const& name) const -> u64 +{ + if (name.starts_with("_id_")) + { + return static_cast(std::stoull(name.substr(4), nullptr, 16)); + } + + char const* str = name.data(); + u64 hash = 0x79D6530B0BB9B5D1; + + while ( *str ) + { + u8 byte = *str++; + + if (static_cast(byte - 65) <= 25) + { + byte += 32; + } + + hash = (u64)0x10000000233 * ((u64)byte ^ hash); + } + + return hash; +} + +auto context::hash_name(u64 id) const -> std::string +{ + auto const itr = hash_map_.find(id); + + if (itr != hash_map_.end()) + { + return std::string{ itr->second }; + } + + return fmt::format("_id_{:016X}", id); +} + +auto context::make_token(std::string_view str) const -> std::string +{ + if (str.starts_with("_id_") || str.starts_with("_func_") || str.starts_with("_meth_")) + { + return std::string{ str }; + } + + auto data = std::string{ str.begin(), str.end() }; + + for (auto i = 0u; i < data.size(); i++) + { + data[i] = static_cast(std::tolower(static_cast(str[i]))); + if (data[i] == '\\') data[i] = '/'; + } + + return data; +} + +auto context::header_file_data(std::string const& name) const -> std::tuple +{ + auto const itr = header_files.find(name); + + if (itr != header_files.end()) + { + return { &itr->first, reinterpret_cast(itr->second.data), itr->second.size }; + } + + auto data = read_callback(name); + + if (data.first.data != nullptr && data.first.size != 0 && data.second.data == nullptr && data.second.size == 0) + { + auto const res = header_files.insert({ name, data.first }); + + if (res.second) + { + return { &res.first->first, reinterpret_cast(res.first->second.data), res.first->second.size }; + } + } + + throw error(fmt::format("couldn't open gsh file '{}'", name)); +} + +auto context::load_include(std::string const& name) -> bool +{ + try + { + if (includes.contains(name)) + { + return false; + } + + includes.insert(name); + + if (include_cache.contains(name)) + return true; + + auto file = read_callback(name); + + if (file.first.data == nullptr && file.first.size == 0) + throw std::runtime_error("empty file"); + + if (file.second.data == nullptr && file.second.size == 0) + { + // process RawFile + auto prog = source_.parse_program(name, file.first); + + auto funcs = std::vector{}; + + for (auto const& dec : prog->declarations) + { + if (dec == node::decl_function) + { + funcs.push_back(dec.as_function->name->value); + } + } + + include_cache.insert({ name, std::move(funcs) }); + } + else + { + // process ScriptFile + auto data = disassembler_.disassemble(file.first, file.second); + + auto funcs = std::vector{}; + + for (auto const& fun : data->functions) + { + funcs.push_back(fun->name); + } + + include_cache.insert({ name, std::move(funcs) }); + } + + return true; + } + catch (std::exception const& e) + { + throw error(fmt::format("parsing include file '{}': {}", name, e.what())); + } +} + +auto context::init_includes() -> void +{ + includes.clear(); +} + +auto context::is_includecall(std::string const& name, std::string& path) -> bool +{ + for (auto const& inc : includes) + { + for (auto const& fun : include_cache.at(std::string{ inc })) + { + if (name == fun) + { + path = inc; + return true; + } + } + } + + return false; +} + +} // namespace xsk::gsc diff --git a/src/gsc/context.hpp b/src/gsc/context.hpp new file mode 100644 index 00000000..de1feb0d --- /dev/null +++ b/src/gsc/context.hpp @@ -0,0 +1,119 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "misc/types.hpp" +#include "source.hpp" +#include "assembler.hpp" +#include "disassembler.hpp" +#include "compiler.hpp" +#include "decompiler.hpp" + +namespace xsk::gsc +{ + +class context +{ +public: + context(props props, engine engine, endian endian, system system, u32 str_count); + + auto props() const -> props { return props_; } + + auto build() const -> build { return build_; } + + auto engine() const -> engine { return engine_; } + + auto endian() const -> endian { return endian_; } + + auto system() const -> system { return system_; } + + auto str_count() const -> u32 { return str_count_; } + + auto source() -> source& { return source_; } + + auto assembler() -> assembler& { return assembler_; } + + auto disassembler() -> disassembler& { return disassembler_; } + + auto compiler() -> compiler& { return compiler_; } + + auto decompiler() -> decompiler& { return decompiler_; } + + auto init(gsc::build build, read_cb_type callback) -> void; + + auto cleanup() -> void; + + auto opcode_size(opcode op) const -> u32; + + auto opcode_id(opcode op) const -> u8; + + auto opcode_enum(u8 id) const -> opcode; + + auto func_id(std::string const& name) const -> u16; + + auto func_name(u16 id) const -> std::string; + + auto func_exists(std::string const& name) const -> bool; + + auto func_add(std::string const& name, u16 id) -> void; + + auto meth_id(std::string const& name) const -> u16; + + auto meth_name(u16 id) const -> std::string; + + auto meth_exists(std::string const& name) const -> bool; + + auto meth_add(std::string const& name, u16 id) -> void; + + auto token_id(std::string const& name) const -> u32; + + auto token_name(u32 id) const -> std::string; + + auto path_id(std::string const& name) const -> u64; + + auto path_name(u64 id) const -> std::string; + + auto hash_id(std::string const& name) const -> u64; + + auto hash_name(u64 id) const -> std::string; + + auto make_token(std::string_view str) const -> std::string; + + auto header_file_data(std::string const& name) const -> std::tuple; + + auto fs_to_game_path(std::filesystem::path const& file) const -> std::filesystem::path; + + auto load_include(std::string const& name) -> bool; + + auto init_includes() -> void; + + auto is_includecall(std::string const& name, std::string& path) -> bool; + +protected: + gsc::props props_; + gsc::build build_; + gsc::engine engine_; + gsc::endian endian_; + gsc::system system_; + u32 str_count_; + gsc::source source_; + gsc::assembler assembler_; + gsc::disassembler disassembler_; + gsc::compiler compiler_; + gsc::decompiler decompiler_; + std::unordered_map code_map_; + std::unordered_map code_map_rev_; + std::unordered_map func_map_; + std::unordered_map func_map_rev_; + std::unordered_map meth_map_; + std::unordered_map meth_map_rev_; + std::unordered_map token_map_; + std::unordered_map token_map_rev_; + std::unordered_map path_map_; + std::unordered_map hash_map_; +}; + +} // namespace xsk::gsc diff --git a/src/gsc/decompiler.cpp b/src/gsc/decompiler.cpp new file mode 100644 index 00000000..d7cddd5f --- /dev/null +++ b/src/gsc/decompiler.cpp @@ -0,0 +1,3210 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "decompiler.hpp" +#include "context.hpp" +#include "utils/string.hpp" + +namespace xsk::gsc +{ + +decompiler::decompiler(context const* ctx) : ctx_{ ctx } +{ +} + +auto decompiler::decompile(assembly const& data) -> program::ptr +{ + program_ = make_program(); + + for (auto const& func : data.functions) + { + decompile_function(*func); + } + + return std::move(program_); +} + +auto decompiler::decompile_function(function const& func) -> void +{ + expr_labels_.clear(); + tern_labels_.clear(); + in_waittill_ = false; + labels_ = func.labels; + locs_ = {}; + stack_ = {}; + + auto loc = location{ nullptr, static_cast(func.index) }; + auto name = make_expr_identifier(loc, func.name); + auto prms = make_expr_parameters(loc); + auto body = make_stmt_list(loc); + func_ = make_decl_function(loc, std::move(name), std::move(prms), std::move(body)); + + for (auto const& inst : func.instructions) + { + decompile_instruction(*inst); + } + + if (stack_.size()) + { + throw decomp_error("stack isn't empty at function end"); + } + + locs_.last = true; + locs_.end = func_->body->list.back().label(); + func_->body->list.pop_back(); + + decompile_statements(*func_->body); + process_function(*func_); + + program_->declarations.push_back(decl{ move(func_) }); +} + +auto decompiler::decompile_instruction(instruction const& inst) -> void +{ + decompile_expressions(inst); + + auto loc = location{ nullptr, static_cast(inst.index) }; + + switch (inst.opcode) + { + case opcode::OP_End: + { + func_->body->list.push_back(stmt{ make_stmt_return(loc, expr{ make_node(loc) }) }); + break; + } + case opcode::OP_Return: + { + auto value = expr{ std::move(stack_.top()) }; stack_.pop(); + func_->body->list.push_back(stmt{ make_stmt_return(value.loc(), std::move(value)) }); + break; + } + case opcode::OP_GetZero: + { + stack_.push(make_expr_integer(loc, "0")); + break; + } + case opcode::OP_GetByte: + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetUnsignedInt: + case opcode::OP_GetInteger: + case opcode::OP_GetInteger64: + { + stack_.push(make_expr_integer(loc, inst.data[0])); + break; + } + case opcode::OP_GetNegByte: + case opcode::OP_GetNegUnsignedShort: + case opcode::OP_GetNegUnsignedInt: + { + stack_.push(make_expr_integer(loc, "-" + inst.data[0])); + break; + } + case opcode::OP_GetFloat: + { + stack_.push(make_expr_float(loc, inst.data[0])); + break; + } + case opcode::OP_GetVector: + { + auto x = expr{ make_expr_float(loc, inst.data[0]) }; + auto y = expr{ make_expr_float(loc, inst.data[1]) }; + auto z = expr{ make_expr_float(loc, inst.data[2]) }; + stack_.push(make_expr_vector(loc, std::move(x), std::move(y), std::move(z))); + break; + } + case opcode::OP_GetString: + { + stack_.push(make_expr_string(loc, inst.data[0])); + break; + } + case opcode::OP_GetIString: + { + stack_.push(make_expr_istring(loc, inst.data[0])); + break; + } + case opcode::OP_GetUndefined: + { + stack_.push(make_expr_undefined(loc)); + break; + } + case opcode::OP_EmptyArray: + { + stack_.push(make_expr_empty_array(loc)); + break; + } + case opcode::OP_GetLevel: + case opcode::OP_GetLevelObject: + { + stack_.push(make_expr_level(loc)); + break; + } + case opcode::OP_GetAnim: + case opcode::OP_GetAnimObject: + { + stack_.push(make_expr_anim(loc)); + break; + } + case opcode::OP_GetSelf: + case opcode::OP_GetSelfObject: + { + stack_.push(make_expr_self(loc)); + break; + } + case opcode::OP_GetGame: + case opcode::OP_GetGameRef: + { + stack_.push(make_expr_game(loc)); + break; + } + case opcode::OP_GetAnimation: + { + if (!inst.data[0].empty()) + { + auto dec = make_decl_usingtree(loc, make_expr_string(loc, inst.data[0])); + program_->declarations.push_back(decl{ std::move(dec) }); + } + + stack_.push(make_expr_animation(loc, inst.data[1])); + break; + } + case opcode::OP_GetAnimTree: + { + if (!inst.data[0].empty()) + { + auto dec = make_decl_usingtree(loc, make_expr_string(loc, inst.data[0])); + program_->declarations.push_back(decl{ std::move(dec) }); + } + + stack_.push(make_expr_animtree(loc)); + break; + } + case opcode::OP_GetThisthread: + { + stack_.push(make_expr_thisthread(loc)); + break; + } + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetBuiltinMethod: + { + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_reference(loc, std::move(path), std::move(name))); + break; + } + case opcode::OP_GetLocalFunction: + { + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_reference(loc, std::move(path), std::move(name))); + break; + } + case opcode::OP_GetFarFunction: + { + auto path = make_expr_path(loc, inst.data[0]); + auto name = make_expr_identifier(loc, inst.data[1]); + stack_.push(make_expr_reference(loc, std::move(path), std::move(name))); + break; + } + case opcode::OP_CreateLocalVariable: + { + if (in_waittill_) + { + stack_.push(make_asm_create(loc, inst.data[0])); + } + else + { + func_->body->list.push_back(stmt{ make_asm_create(loc, inst.data[0]) }); + } + break; + } + case opcode::OP_RemoveLocalVariables: + { + func_->body->list.push_back(stmt{ make_asm_remove(loc, inst.data[0]) }); + break; + } + case opcode::OP_EvalLocalVariableCached0: + { + stack_.push(make_asm_access(loc, "0")); + break; + } + case opcode::OP_EvalLocalVariableCached1: + { + stack_.push(make_asm_access(loc, "1")); + break; + } + case opcode::OP_EvalLocalVariableCached2: + { + stack_.push(make_asm_access(loc, "2")); + break; + } + case opcode::OP_EvalLocalVariableCached3: + { + stack_.push(make_asm_access(loc, "3")); + break; + } + case opcode::OP_EvalLocalVariableCached4: + { + stack_.push(make_asm_access(loc, "4")); + break; + } + case opcode::OP_EvalLocalVariableCached5: + { + stack_.push(make_asm_access(loc, "5")); + break; + } + case opcode::OP_EvalLocalVariableCached: + { + stack_.push(make_asm_access(loc, inst.data[0])); + break; + } + case opcode::OP_EvalLocalArrayCached: + { + auto key = expr{ std::move(stack_.top()) }; stack_.pop(); + auto obj = expr{ make_asm_access(loc, inst.data[0]) }; + stack_.push(make_expr_array(key.loc(), std::move(obj), std::move(key))); + break; + } + case opcode::OP_EvalArray: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto key = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_array(key.loc(), std::move(obj), std::move(key))); + break; + } + case opcode::OP_EvalNewLocalArrayRefCached0: + { + auto key = expr{ std::move(stack_.top()) }; stack_.pop(); + auto obj = expr{ make_asm_create(loc, inst.data[0]) }; + stack_.push(make_expr_array(key.loc(), std::move(obj), std::move(key))); + break; + } + case opcode::OP_EvalLocalArrayRefCached0: + { + auto key = expr{ std::move(stack_.top()) }; stack_.pop(); + auto obj = expr{ make_asm_access(loc, "0") }; + stack_.push(make_expr_array(key.loc(), std::move(obj), std::move(key))); + break; + } + case opcode::OP_EvalLocalArrayRefCached: + { + auto key = expr{ std::move(stack_.top()) }; stack_.pop(); + auto obj = expr{ make_asm_access(loc, inst.data[0]) }; + stack_.push(make_expr_array(key.loc(), std::move(obj), std::move(key))); + break; + } + case opcode::OP_EvalArrayRef: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto key = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_array(key.loc(), std::move(obj), std::move(key))); + break; + } + case opcode::OP_ClearArray: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto key = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = key.loc(); + auto lvalue = expr{ make_expr_array(loc, std::move(obj), std::move(key)) }; + auto rvalue = expr{ make_expr_undefined(loc) }; + auto exp = expr{ make_expr_assign_equal(loc, std::move(lvalue), std::move(rvalue)) }; + func_->body->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + break; + } + case opcode::OP_AddArray: + { + auto value = expr{ std::move(stack_.top()) }; stack_.pop(); + auto array = std::move(stack_.top()); stack_.pop(); + + if (array->kind() == node::expr_empty_array) + { + auto args = make_expr_arguments(loc); + args->list.push_back(std::move(value)); + stack_.push(make_expr_add_array(array->loc(), std::move(args))); + } + else if (array->kind() == node::expr_add_array) + { + reinterpret_cast(array.get())->args->list.push_back(std::move(value)); + stack_.push(std::move(array)); + } + else + { + throw decomp_error("unknown add array type (could be an array variable name?)"); + } + break; + } + case opcode::OP_PreScriptCall: + { + stack_.push(make_asm_prescriptcall(loc)); + break; + } + case opcode::OP_ScriptLocalFunctionCall2: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::normal) })); + break; + } + case opcode::OP_ScriptLocalFunctionCall: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + + while (var->kind() != node::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + } + + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::normal) })); + break; + } + case opcode::OP_ScriptLocalMethodCall: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = obj.loc(); + + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + + while (var->kind() != node::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::normal) })); + break; + } + case opcode::OP_ScriptLocalThreadCall: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = std::stoul(inst.data[1]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::thread) })); + break; + } + case opcode::OP_ScriptLocalChildThreadCall: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = std::stoul(inst.data[1]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::childthread) })); + break; + } + case opcode::OP_ScriptLocalMethodThreadCall: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = obj.loc(); + + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = std::stoul(inst.data[1]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::thread) })); + break; + } + case opcode::OP_ScriptLocalMethodChildThreadCall: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = obj.loc(); + + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = std::stoul(inst.data[1]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::childthread) })); + break; + } + case opcode::OP_ScriptFarFunctionCall2: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc, inst.data[0]); + auto name = make_expr_identifier(loc, inst.data[1]); + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::normal) })); + break; + } + case opcode::OP_ScriptFarFunctionCall: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc, inst.data[0]); + auto name = make_expr_identifier(loc, inst.data[1]); + + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + + while (var->kind() != node::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + } + + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::normal) })); + break; + } + case opcode::OP_ScriptFarMethodCall: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = obj.loc(); + + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc, inst.data[0]); + auto name = make_expr_identifier(loc, inst.data[1]); + + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + + while (var->kind() != node::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::normal) })); + break; + } + case opcode::OP_ScriptFarThreadCall: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc, inst.data[0]); + auto name = make_expr_identifier(loc, inst.data[1]); + + for (auto i = std::stoul(inst.data[2]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::thread) })); + break; + } + case opcode::OP_ScriptFarChildThreadCall: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc, inst.data[0]); + auto name = make_expr_identifier(loc, inst.data[1]); + + for (auto i = std::stoul(inst.data[2]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::childthread) })); + break; + } + case opcode::OP_ScriptFarMethodThreadCall: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = obj.loc(); + + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc, inst.data[0]); + auto name = make_expr_identifier(loc, inst.data[1]); + + for (auto i = std::stoul(inst.data[2]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::thread) })); + break; + } + case opcode::OP_ScriptFarMethodChildThreadCall: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = obj.loc(); + + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc, inst.data[0]); + auto name = make_expr_identifier(loc, inst.data[1]); + + for (auto i = std::stoul(inst.data[2]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::childthread) })); + break; + } + case opcode::OP_ScriptFunctionCallPointer: + { + auto args = make_expr_arguments(loc); + auto func = expr{ std::move(stack_.top()) }; stack_.pop(); + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + + while (var->kind() != node::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + } + + stack_.push(make_expr_call(loc, call{ make_expr_pointer(loc, std::move(func), std::move(args), call::mode::normal) })); + break; + } + case opcode::OP_ScriptMethodCallPointer: + { + auto args = make_expr_arguments(loc); + auto func = expr{ std::move(stack_.top()) }; stack_.pop(); + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + + while (var->kind() != node::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_pointer(loc, std::move(func), std::move(args), call::mode::normal) })); + break; + } + case opcode::OP_ScriptThreadCallPointer: + { + auto args = make_expr_arguments(loc); + auto func = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = func.loc(); + + for (auto i = std::stoul(inst.data[0]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_pointer(loc, std::move(func), std::move(args), call::mode::thread) })); + break; + } + case opcode::OP_ScriptChildThreadCallPointer: + { + auto args = make_expr_arguments(loc); + auto func = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = func.loc(); + + for (auto i = std::stoul(inst.data[0]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_pointer(loc, std::move(func), std::move(args), call::mode::childthread) })); + break; + } + case opcode::OP_ScriptMethodThreadCallPointer: + { + auto args = make_expr_arguments(loc); + auto func = expr{ std::move(stack_.top()) }; stack_.pop(); + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = obj.loc(); + + for (auto i = std::stoul(inst.data[0]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_pointer(loc, std::move(func), std::move(args), call::mode::thread) })); + break; + } + case opcode::OP_ScriptMethodChildThreadCallPointer: + { + auto args = make_expr_arguments(loc); + auto func = expr{ std::move(stack_.top()) }; stack_.pop(); + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = obj.loc(); + + for (auto i = std::stoul(inst.data[0]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_pointer(loc, std::move(func), std::move(args), call::mode::childthread) })); + break; + } + case opcode::OP_CallBuiltinPointer: + { + auto args = make_expr_arguments(loc); + auto func = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = func.loc(); + + for (auto i = std::stoul(inst.data[0]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_pointer(loc, std::move(func), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltinMethodPointer: + { + auto args = make_expr_arguments(loc); + auto func = expr{ std::move(stack_.top()) }; stack_.pop(); + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = obj.loc(); + + for (auto i = std::stoul(inst.data[0]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_pointer(loc, std::move(func), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltin0: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltin1: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = 1u; i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltin2: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = 2u; i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltin3: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = 3u; i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltin4: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = 4u; i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltin5: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = 5u; i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltin: + { + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = std::stoul(inst.data[1]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltinMethod0: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = obj.loc(); + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltinMethod1: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = 1u; i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltinMethod2: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = 2u; i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltinMethod3: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = 3u; i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltinMethod4: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = 4u; i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltinMethod5: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = 5u; i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_CallBuiltinMethod: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = obj.loc(); + auto args = make_expr_arguments(loc); + auto path = make_expr_path(loc); + auto name = make_expr_identifier(loc, inst.data[0]); + + for (auto i = std::stoul(inst.data[1]); i > 0; i--) + { + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + args->list.push_back(std::move(var)); + } + + stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::builtin) })); + break; + } + case opcode::OP_DecTop: + { + auto exp = expr{ std::move(stack_.top()) }; stack_.pop(); + func_->body->list.push_back(stmt{ make_stmt_call(exp.loc(), std::move(exp)) }); + break; + } + case opcode::OP_inc: + { + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_increment(lvalue.loc(), std::move(lvalue), false)); + break; + } + case opcode::OP_dec: + { + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_decrement(lvalue.loc(), std::move(lvalue), false)); + break; + } + case opcode::OP_bit_or: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_bitwise_or(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_bit_ex_or: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_bitwise_exor(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_bit_and: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_bitwise_and(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_equality: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_equality(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_inequality: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_inequality(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_less: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_less(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_greater: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_greater(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_less_equal: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_less_equal(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_greater_equal: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_greater_equal(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_shift_left: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_shift_left(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_shift_right: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_shift_right(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_plus: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_add(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_minus: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_sub(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_multiply: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_mul(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_divide: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_div(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_mod: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_mod(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + break; + } + case opcode::OP_wait: + { + auto exp = expr{ std::move(stack_.top()) }; stack_.pop(); + func_->body->list.push_back(stmt{ make_stmt_wait(exp.loc(), std::move(exp)) }); + break; + } + case opcode::OP_waittillFrameEnd: + { + func_->body->list.push_back(stmt{ make_stmt_waittillframeend(loc) }); + break; + } + case opcode::OP_waitframe: + { + func_->body->list.push_back(stmt{ make_stmt_waitframe(loc) }); + break; + } + case opcode::OP_waittill: + { + auto args = make_expr_arguments(loc); + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto event = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_stmt_waittill(event.loc(), std::move(obj), std::move(event), std::move(args))); + in_waittill_ = true; + break; + } + case opcode::OP_waittillmatch: + { + auto args = make_expr_arguments(loc); + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto event = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = event.loc(); + + for (auto i = std::stoul(inst.data[0]); i > 0; i--) + { + auto arg = std::move(stack_.top()); stack_.pop(); + loc = arg->loc(); + args->list.push_back(std::move(arg)); + } + + func_->body->list.push_back(stmt{ make_stmt_waittillmatch(loc, std::move(obj), std::move(event), std::move(args)) }); + break; + } + case opcode::OP_clearparams: + { + if (in_waittill_) + { + auto args = make_expr_arguments(loc); + auto arg = std::move(stack_.top()); stack_.pop(); + + while (arg->kind() != node::stmt_waittill) + { + args->list.push_back(std::move(arg)); + arg = std::move(stack_.top()); stack_.pop(); + } + + if (arg->kind() == node::stmt_waittill) + { + std::reverse(args->list.begin(), args->list.end()); + reinterpret_cast(arg.get())->args = std::move(args); + in_waittill_ = false; + } + + func_->body->list.push_back(stmt{ std::move(arg) }); + } + break; + } + case opcode::OP_notify: + { + auto args = make_expr_arguments(loc); + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto event = expr{ std::move(stack_.top()) }; stack_.pop(); + auto var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + + while (var->kind() != node::asm_voidcodepos) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); stack_.pop(); + loc = var->loc(); + } + + func_->body->list.push_back(stmt{ make_stmt_notify(loc, std::move(obj), std::move(event), std::move(args)) }); + break; + } + case opcode::OP_endon: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto event = expr{ std::move(stack_.top()) }; stack_.pop(); + func_->body->list.push_back(stmt{ make_stmt_endon(event.loc(), std::move(obj), std::move(event)) }); + break; + } + case opcode::OP_voidCodepos: + { + stack_.push(make_asm_voidcodepos(loc)); + break; + } + case opcode::OP_vector: + { + auto x = expr{ std::move(stack_.top()) }; stack_.pop(); + auto y = expr{ std::move(stack_.top()) }; stack_.pop(); + auto z = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_vector(z.loc(), std::move(x), std::move(y), std::move(z))); + break; + } + case opcode::OP_size: + { + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_size(lvalue.loc(), std::move(lvalue))); + break; + } + case opcode::OP_EvalLevelFieldVariable: + { + auto obj = expr{ make_expr_level(loc) }; + auto field = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_field(loc, std::move(obj), std::move(field))); + break; + } + case opcode::OP_EvalAnimFieldVariable: + { + auto obj = expr{ make_expr_anim(loc) }; + auto field = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_field(loc, std::move(obj), std::move(field))); + break; + } + case opcode::OP_EvalSelfFieldVariable: + { + auto obj = expr{ make_expr_self(loc) }; + auto field = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_field(loc, std::move(obj), std::move(field))); + break; + } + case opcode::OP_EvalFieldVariable: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto field = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_field(obj.loc(), std::move(obj), std::move(field))); + break; + } + case opcode::OP_EvalLevelFieldVariableRef: + { + auto obj = expr{ make_expr_level(loc) }; + auto field = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_field(loc, std::move(obj), std::move(field))); + break; + } + case opcode::OP_EvalAnimFieldVariableRef: + { + auto obj = expr{ make_expr_anim(loc) }; + auto field = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_field(loc, std::move(obj), std::move(field))); + break; + } + case opcode::OP_EvalSelfFieldVariableRef: + { + auto obj = expr{ make_expr_self(loc) }; + auto field = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_field(loc, std::move(obj), std::move(field))); + break; + } + case opcode::OP_EvalFieldVariableRef: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto field = make_expr_identifier(loc, inst.data[0]); + stack_.push(make_expr_field(obj.loc(), std::move(obj), std::move(field))); + break; + } + case opcode::OP_ClearFieldVariable: + { + auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = obj.loc(); + auto name = make_expr_identifier(loc, inst.data[0]); + auto field = expr{ make_expr_field(loc, std::move(obj), std::move(name)) }; + auto undef = expr{ make_expr_undefined(loc) }; + auto exp = expr{ make_expr_assign_equal(loc, std::move(field), std::move(undef)) }; + func_->body->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + break; + } + case opcode::OP_SafeCreateVariableFieldCached: + { + auto name = (ctx_->props() & props::hash) ? inst.data[0] : fmt::format("var_{}", inst.data[0]); + func_->params->list.push_back(make_expr_identifier(loc, name)); + break; + } + case opcode::OP_SafeSetWaittillVariableFieldCached: + { + if (stack_.top()->kind() != node::asm_create) + { + stack_.push(make_asm_access(loc, inst.data[0])); + } + break; + } + case opcode::OP_SafeSetVariableFieldCached0: + { + func_->params->list.push_back(make_expr_identifier(loc, "var_0")); + break; + } + case opcode::OP_SafeSetVariableFieldCached: + { + func_->params->list.push_back(make_expr_identifier(loc, "var_" + inst.data[0])); + break; + } + case opcode::OP_EvalLocalVariableRefCached0: + { + stack_.push(make_asm_access(loc, "0")); + break; + } + case opcode::OP_EvalLocalVariableRefCached: + { + stack_.push(make_asm_access(loc, inst.data[0])); + break; + } + case opcode::OP_SetLevelFieldVariableField: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = rvalue.loc(); + auto obj = expr{ make_expr_level(loc) }; + auto field = make_expr_identifier(loc, inst.data[0]); + auto lvalue = expr{ make_expr_field(loc, std::move(obj), std::move(field)) }; + auto exp = expr{ make_expr_assign_equal(loc, std::move(lvalue), std::move(rvalue)) }; + func_->body->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + break; + } + case opcode::OP_SetVariableField: + { + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = lvalue.loc(); + + if (lvalue == node::expr_increment) + { + func_->body->list.push_back(stmt{ make_stmt_assign(loc, std::move(lvalue)) }); + } + else if (lvalue == node::expr_decrement) + { + func_->body->list.push_back(stmt{ make_stmt_assign(loc, std::move(lvalue)) }); + } + else + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = rvalue.loc(); + auto exp = expr{ make_expr_assign_equal(loc, std::move(lvalue), std::move(rvalue)) }; + func_->body->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + } + break; + } + case opcode::OP_SetAnimFieldVariableField: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = rvalue.loc(); + auto obj = expr{ make_expr_anim(loc) }; + auto field = make_expr_identifier(loc, inst.data[0]); + auto lvalue = expr{ make_expr_field(loc, std::move(obj), std::move(field)) }; + auto exp = expr{ make_expr_assign_equal(loc, std::move(lvalue), std::move(rvalue)) }; + func_->body->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + break; + } + case opcode::OP_SetSelfFieldVariableField: + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = rvalue.loc(); + auto obj = expr{ make_expr_self(loc) }; + auto field = make_expr_identifier(loc, inst.data[0]); + auto lvalue = expr{ make_expr_field(loc, std::move(obj), std::move(field)) }; + auto exp = expr{ make_expr_assign_equal(loc, std::move(lvalue), std::move(rvalue)) }; + func_->body->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + break; + } + case opcode::OP_SetLocalVariableFieldCached0: + { + auto lvalue = expr{ make_asm_access(loc, "0") }; + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = rvalue.loc(); + auto exp = expr{ make_expr_assign_equal(loc, std::move(lvalue), std::move(rvalue)) }; + func_->body->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + break; + } + case opcode::OP_SetNewLocalVariableFieldCached0: + { + auto lvalue = expr{ make_asm_create(loc, inst.data[0]) }; + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = rvalue.loc(); + + if (func_->body->list.size() > 0) + { + std::vector vars; + + while (func_->body->list.back() == node::asm_create) + { + auto& entry = func_->body->list.back(); + if (loc.begin.line < entry.loc().begin.line) + { + vars.push_back(entry.as_asm_create->index); + func_->body->list.pop_back(); + continue; + } + break; + } + + std::reverse(vars.begin(), vars.end()); + lvalue.as_asm_create->vars = vars; + } + + auto exp = expr{ make_expr_assign_equal(loc, std::move(lvalue), std::move(rvalue)) }; + func_->body->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + break; + } + case opcode::OP_SetLocalVariableFieldCached: + { + auto lvalue = expr{ make_asm_access(loc, inst.data[0]) }; + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = rvalue.loc(); + auto exp = expr{ make_expr_assign_equal(loc, std::move(lvalue), std::move(rvalue)) }; + func_->body->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + break; + } + case opcode::OP_ClearLocalVariableFieldCached: + { + func_->body->list.push_back(stmt{ make_asm_clear(loc, inst.data[0]) }); + break; + } + case opcode::OP_ClearLocalVariableFieldCached0: + { + func_->body->list.push_back(stmt{ make_asm_clear(loc, "0") }); + break; + } + case opcode::OP_EvalLocalVariableObjectCached: + { + stack_.push(make_asm_access(loc, inst.data[0])); + break; + } + case opcode::OP_BoolNot: + { + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_not(lvalue.loc(), std::move(lvalue))); + break; + } + case opcode::OP_BoolComplement: + { + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_complement(lvalue.loc(), std::move(lvalue))); + break; + } + case opcode::OP_switch: + { + auto test = expr{ std::move(stack_.top()) }; stack_.pop(); + func_->body->list.push_back(stmt{ make_asm_switch(test.loc(), std::move(test), inst.data[0]) }); + break; + } + case opcode::OP_endswitch: + { + func_->body->list.push_back(stmt{ make_asm_endswitch(loc, inst.data) }); + break; + } + case opcode::OP_jump: + { + func_->body->list.push_back(stmt{ make_asm_jmp(loc, inst.data[0]) }); + if (stack_.size() != 0) tern_labels_.push_back(inst.data[0]); + break; + } + case opcode::OP_jumpback: + { + func_->body->list.push_back(stmt{ make_asm_jmp_back(loc, inst.data[0]) }); + break; + } + case opcode::OP_JumpOnTrue: + { + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + loc = lvalue.loc(); + auto test = expr{ make_expr_not(loc, std::move(lvalue)) }; + func_->body->list.push_back(stmt{ make_asm_jmp_cond(loc, std::move(test), inst.data[0]) }); + break; + } + case opcode::OP_JumpOnFalse: + { + auto test = expr{ std::move(stack_.top()) }; stack_.pop(); + func_->body->list.push_back(stmt{ make_asm_jmp_cond(test.loc(), std::move(test), inst.data[0]) }); + break; + } + case opcode::OP_JumpOnTrueExpr: + { + auto test = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_asm_jmp_true(test.loc(), std::move(test), inst.data[0])); + expr_labels_.push_back(inst.data[0]); + break; + } + case opcode::OP_JumpOnFalseExpr: + { + auto test = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_asm_jmp_false(test.loc(), std::move(test), inst.data[0])); + expr_labels_.push_back(inst.data[0]); + break; + } + case opcode::OP_FormalParams: + { + auto count = std::stoi(inst.data[0]); + + for (auto i = 1; i <= count; i++) + { + auto name = (ctx_->props() & props::hash) ? inst.data[i] : fmt::format("var_{}", inst.data[i]); + func_->params->list.push_back(make_expr_identifier(loc, name)); + } + break; + } + case opcode::OP_IsDefined: + { + auto value = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_isdefined(value.loc(), std::move(value))); + break; + } + case opcode::OP_IsTrue: + { + auto value = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_istrue(value.loc(), std::move(value))); + break; + } + case opcode::OP_BoolNotAfterAnd: + { + auto value = expr{ std::move(stack_.top()) }; stack_.pop(); + stack_.push(make_expr_not(value.loc(), std::move(value))); + break; + } + case opcode::OP_GetStatHash: + { + stack_.push(make_expr_string(loc, fmt::format("stat_{}", inst.data[0]))); + break; + } + case opcode::OP_GetUnkxHash: + { + stack_.push(make_expr_string(loc, fmt::format("hunk_{}", inst.data[0]))); + break; + } + case opcode::OP_GetEnumHash: + { + stack_.push(make_expr_string(loc, fmt::format("enum_{}", inst.data[0]))); + break; + } + case opcode::OP_GetDvarHash: + { + stack_.push(make_expr_string(loc, fmt::format("dvar_{}", inst.data[0]))); + break; + } + case opcode::OP_waittillmatch2: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + break; + default: + throw decomp_error(fmt::format("unhandled opcode {}", opcode_name(inst.opcode))); + } +} + +auto decompiler::decompile_expressions(instruction const& inst) -> void +{ + auto const itr = labels_.find(inst.index); + + if (itr == labels_.end()) + return; + + for (auto const& exp : expr_labels_) + { + if (exp == itr->second) + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto jump = std::move(stack_.top()); stack_.pop(); + auto loc = jump->loc(); + + if (jump->kind() == node::asm_jmp_true) + { + auto lvalue = std::move(reinterpret_cast(jump.get())->test); + stack_.push(make_expr_or(loc, std::move(lvalue), std::move(rvalue))); + } + else if (jump->kind() == node::asm_jmp_false) + { + auto lvalue = std::move(reinterpret_cast(jump.get())->test); + stack_.push(make_expr_and(loc, std::move(lvalue), std::move(rvalue))); + } + else + { + throw decomp_error("invalid conditional expression"); + } + } + } + + for (auto const& tern : tern_labels_) + { + if (tern == itr->second) + { + auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + + func_->body->list.pop_back(); + auto stm = std::move(func_->body->list.back()); + func_->body->list.pop_back(); + + if (stm == node::asm_jmp_cond) + { + auto loc = stm.as_cond->loc(); + stack_.push(make_expr_ternary(loc, std::move(stm.as_cond->test), std::move(lvalue), std::move(rvalue))); + } + else + { + throw decomp_error("invalid ternary expression"); + } + } + } +} + +auto decompiler::decompile_statements(stmt_list& stm) -> void +{ + decompile_loops(stm); + decompile_switches(stm); + decompile_ifelses(stm); + decompile_aborts(stm); + decompile_tuples(stm); +} + +auto decompiler::decompile_loops(stmt_list& stm) -> void +{ + if (stm.list.size() == 0) + return; + + for (auto i = static_cast(stm.list.size() - 1); i >= 0; i--) + { + if (stm.list.at(i) == node::asm_jmp_back) + { + auto break_loc = last_location_index(stm, i) ? locs_.end : stm.list.at(i + 1).label(); + auto start = find_location_index(stm, stm.list.at(i).as_jump_back->value); + + if (i > 0 && stm.list.at(i - 1) == node::asm_jmp_cond) + { + if (i - 1 == static_cast(start)) // condition belongs to empty loop + { + decompile_while(stm, start, i); + i = static_cast(stm.list.size()); + continue; + } + else if (static_cast(i) < find_location_index(stm, stm.list.at(i - 1).as_cond->value)) + { + decompile_dowhile(stm, i - 1, i); + i = static_cast(stm.list.size()); + continue; + } + } + + if (i == static_cast(start)) // empty inf loop + { + decompile_inf(stm, start, i); + } + else if (stm.list.at(start) != node::asm_jmp_cond) // no condition + { + decompile_inf(stm, start, i); + } + else if (stm.list.at(start).as_cond->value != break_loc) // condition belong to other stmt + { + decompile_inf(stm, start, i); + } + else // condition belong to loop + { + decompile_loop(stm, start, i); + } + + i = static_cast(stm.list.size()); + } + } +} + +auto decompiler::decompile_switches(stmt_list& stm) -> void +{ + for (auto i = 0u; i < stm.list.size(); i++) + { + if (stm.list[i] == node::asm_switch) + { + auto end = find_location_index(stm, stm.list[i].as_asm_switch->value); + decompile_switch(stm, i, end); + } + } +} + +auto decompiler::decompile_ifelses(stmt_list& stm) -> void +{ + for (auto i = 0u; i < stm.list.size(); i++) + { + auto const& entry = stm.list.at(i); + + if (entry == node::asm_jmp_cond) + { + auto j = find_location_index(stm, entry.as_cond->value) - 1; + auto last_loc = locs_.end; + + if (stm.list.at(j) == node::asm_jmp) + { + // if scope is a loop check break, continue + if (stm.list.at(j).as_jump->value == locs_.cnt) + { + // check for if/else or if/continue + if (j - i > 1 && stm.list.at(j - 1) == node::stmt_return) + { + // scope ends with a return, so jump belows to if/else + decompile_ifelse(stm, i, j); + } + else if (j - i > 1 && stm.list.at(j - 1) == node::asm_jmp) + { + if (stm.list.at(j - 1).as_jump->value == locs_.brk) + { + // scope ends with a break, so jump belows to if/else + decompile_ifelse(stm, i, j); + } + else if (stm.list.at(j - 1).as_jump->value == locs_.cnt) + { + // if { break/return } else { continue } at loop scope end + if (j - i > 2 && (stm.list.at(j - 2) == node::asm_jmp || stm.list.at(j - 2) == node::stmt_return)) + { + decompile_if(stm, i, j); + } + else + { + // scope ends with a continue, so jump belows to if/else + decompile_ifelse(stm, i, j); + } + } + else + { + // jump belows to if/continue + decompile_if(stm, i, j); + } + } + else + { // last if/else inside a loop still trigger this :( + decompile_if(stm, i, j); + } + } + else if (stm.list.at(j).as_jump->value == locs_.brk) + { + decompile_if(stm, i, j); + } + else if (stm.list.at(j).as_jump->value == entry.as_cond->value) + { + if (find_location_reference(stm, i + 1, j, entry.as_cond->value)) + { + // if scope, have a empty else inside at end + decompile_if(stm, i, j); + } + else + { + decompile_ifelse(stm, i, j); // if scope with empty else + } + } + else + { + decompile_ifelse(stm, i, j); + } + } + else if (stm.list.at(j) == node::stmt_return && stm.list.at(j).as_return->value == node::null) + { + if(entry.as_cond->value != locs_.end) + { + auto ref = stm.list.at(j + 1).label(); + + if (find_location_reference(stm, i + 1, j, ref)) + { + // after return is referenced inside the scope + decompile_if(stm, i, j); + continue; + } + } + + if (locs_.brk != "" || locs_.cnt != "") + { + decompile_if(stm, i, j); // inside a loop cant be last + } + else if (j - i == 1) + { + decompile_if(stm, i, j); // only one explicit return + } + else if (stm.list.back() != node::stmt_return) + { + decompile_if(stm, i, j); // scope end is not a last return + } + else if (locs_.last && stm.list.back() != node::stmt_return) + { + decompile_if(stm, i, j); // inside a last scope but is not and inner last + } + else if (find_location_reference(stm, j, stm.list.size(), last_loc)) + { + decompile_if(stm, i, j); // reference to func end after the if + } + else if (!locs_.last) + { + decompile_if(stm, i, j); // fake last ifelse + } + else + { + decompile_ifelse_end(stm, i, j); // special case + } + } + else + { + decompile_if(stm, i, j); + } + } + } +} + +auto decompiler::decompile_aborts(stmt_list& stm) -> void +{ + for (auto i = 0u; i < stm.list.size(); i++) + { + if (stm.list[i] == node::asm_jmp) + { + auto const loc = stm.list[i].loc(); + auto const jmp = stm.list[i].as_jump->value; + + if (jmp == locs_.brk) + { + stm.list.erase(stm.list.begin() + i); + stm.list.insert(stm.list.begin() + i, stmt{ make_stmt_break(loc) }); + } + else if (jmp == locs_.cnt) + { + stm.list.erase(stm.list.begin() + i); + stm.list.insert(stm.list.begin() + i, stmt{ make_stmt_continue(loc) }); + } + else + { + fmt::print("WARNING: unresolved jump to '{}', maybe incomplete for loop\n", jmp); + } + } + } +} + +auto decompiler::decompile_tuples(stmt_list& stm) -> void +{ + for (auto i = 1u; i < stm.list.size(); i++) + { + if (stm.list.at(i) == node::asm_clear) + { + auto j = i - 1; + auto found = false, done = false; + + while (j >= 0 && stm.list.at(j) == node::stmt_assign) + { + auto const& exp = stm.list.at(j).as_assign->value; + + if (exp != node::expr_assign_equal) + break; + + if (!done) + { + if (exp.as_assign_equal->rvalue != node::expr_array) + break; + + if (exp.as_assign_equal->rvalue.as_array->key != node::expr_integer) + break; + + if (exp.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") + done = true; + + j--; + } + else + { + if (exp.as_assign_equal->lvalue == node::asm_create || exp.as_assign_equal->lvalue == node::asm_access) + found = true; + + break; + } + } + + if (found) + { + auto& entry = stm.list.at(j); // temp = expr; + auto tuple = make_expr_tuple(entry.loc()); + tuple->temp = std::move(entry.as_assign->value.as_assign_equal->lvalue); + j++; + + while (j < i) + { + tuple->list.push_back(std::move(stm.list.at(j).as_assign->value.as_assign_equal->lvalue)); + stm.list.erase(stm.list.begin() + j); + i--; + } + + stm.list.erase(stm.list.begin() + j); // clear temp array + i--; + + entry.as_assign->value.as_assign_equal->lvalue = expr{ std::move(tuple) }; + } + } + } +} + +auto decompiler::decompile_if(stmt_list& stm, usize begin, usize end) -> void +{ + auto save = locs_; + locs_.last = false; + locs_.end = stm.list[begin].as_cond->value; + + auto loc = stm.list[begin].loc(); + auto test = std::move(stm.list[begin].as_cond->test); + + stm.list.erase(stm.list.begin() + begin); + + auto body = make_stmt_list(loc); + + for (auto i = begin; i < end; i++) + { + body->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + decompile_statements(*body); + locs_ = save; + stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_if(loc, std::move(test), stmt{ std::move(body) }) }); +} + +auto decompiler::decompile_ifelse(stmt_list& stm, usize begin, usize end) -> void +{ + auto save = locs_; + locs_.last = false; + locs_.end = stm.list[end].label(); + + auto loc = stm.list[begin].loc(); + auto test = std::move(stm.list[begin].as_cond->test); + + stm.list.erase(stm.list.begin() + begin); + end--; + + auto body_if = make_stmt_list(loc); + + for (auto i = begin; i < end; i++) + { + body_if->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + decompile_statements(*body_if); + locs_ = save; + + auto end_loc = stm.list[begin].as_jump->value; + + stm.list.erase(stm.list.begin() + begin); + + end = find_location_index(stm, end_loc); + + save = locs_; + locs_.last = false; + locs_.end = end_loc; + + auto body_else = make_stmt_list(loc); + + for (auto i = begin; i < end; i++) + { + body_else->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + decompile_statements(*body_else); + locs_ = save; + stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_ifelse(loc, std::move(test), stmt{ std::move(body_if) }, stmt{ std::move(body_else) }) }); +} + +auto decompiler::decompile_ifelse_end(stmt_list& stm, usize begin, usize end) -> void +{ + auto save = locs_; + locs_.last = true; + locs_.end = stm.list[find_location_index(stm, stm.list[begin].as_cond->value) - 1].label(); + + auto loc = stm.list[begin].loc(); + auto test = std::move(stm.list[begin].as_cond->test); + + stm.list.erase(stm.list.begin() + begin); + end--; + + auto body_if = make_stmt_list(loc); + + for (auto i = begin; i < end; i++) + { + body_if->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + stm.list.erase(stm.list.begin() + begin); + + decompile_statements(*body_if); + locs_ = save; + + if (begin == stm.list.size()) + { + stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_if(loc, std::move(test), stmt{ std::move(body_if) }) }); + } + else + { + end = stm.list.size() - 1; + save = locs_; + locs_.last = true; + locs_.end = stm.list[end].label(); + + auto body_else = make_stmt_list(loc); + + for (auto i = begin; i < end; i++) + { + body_else->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + stm.list.erase(stm.list.begin() + begin); + + decompile_statements(*body_else); + locs_ = save; + stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_ifelse(loc, std::move(test), stmt{ std::move(body_if) }, stmt{ std::move(body_else) }) }); + } +} + +auto decompiler::decompile_inf(stmt_list& stm, usize begin, usize end) -> void +{ + auto save = locs_; + locs_.last = false; + locs_.brk = last_location_index(stm, end) ? locs_.end : stm.list[end + 1].label(); + locs_.end = stm.list[end].label(); + locs_.cnt = stm.list[end].label(); + + auto loc = stm.list[begin].loc(); + + stm.list.erase(stm.list.begin() + end); + + auto body = make_stmt_list(loc); + + for (auto i = begin; i < end; i++) + { + body->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + decompile_statements(*body); + locs_ = save; + stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_for(loc, stmt{ make_node(loc) }, expr{ make_node(loc) }, stmt{ make_node(loc) }, stmt{ std::move(body) }) }); +} + +auto decompiler::decompile_loop(stmt_list& stm, usize start, usize end) -> void +{ + auto const& last = stm.list.at(end - 1); + + if (last == node::stmt_assign) + { + if (last.as_assign->value == node::expr_assign_equal) + { + auto& val = last.as_assign->value.as_assign_equal->rvalue; + + if (val == node::expr_call && val.as_call->value == node::expr_function) + { + if (utils::string::to_lower(val.as_call->value.as_function->name->value) == "getnextarraykey") + { + auto ref = stm.list.at(start).label(); + + if (!find_location_reference(stm, 0, start, ref)) + { + decompile_foreach(stm, start, end); + return; + } + } + } + } + + if (start > 0) // while at func start + { + auto index = 1; + while (stm.list.at(start - index) == node::asm_create) + { + if (start - index > 0) + index++; + else + break; + } + + if (stm.list.at(start - index) == node::stmt_assign) + { + auto ref = stm.list.at(end).label(); + auto ref2 = stm.list.at(start - index + 1).label(); + + if (find_location_reference(stm, start, end, ref)) + { + // jump is referenced, not post-expr + decompile_while(stm, start, end); + return; + } + else if (find_location_reference(stm, 0, start, ref2)) + { + // begin is at condition or localVarCreate, not pre-expr + decompile_while(stm, start, end); + return; + } + else + { + decompile_for(stm, start, end); + return; + } + } + } + } + + decompile_while(stm, start, end); +} + +auto decompiler::decompile_while(stmt_list& stm, usize begin, usize end) -> void +{ + auto save = locs_; + locs_.last = false; + locs_.end = stm.list[end].label(); + locs_.cnt = stm.list[end].label(); + locs_.brk = stm.list[begin].as_cond->value; + + auto loc = stm.list[begin].loc(); + auto test = std::move(stm.list[begin].as_cond->test); + + end--; + stm.list.erase(stm.list.begin() + begin); + stm.list.erase(stm.list.begin() + end); + + auto body = make_stmt_list(loc); + + for (auto i = begin; i < end; i++) + { + body->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + decompile_statements(*body); + locs_ = save; + stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_while(loc, std::move(test), stmt{ std::move(body) }) }); +} + +auto decompiler::decompile_dowhile(stmt_list& stm, usize begin, usize end) -> void +{ + auto save = locs_; + locs_.last = false; + locs_.end = stm.list[begin].label(); + locs_.cnt = stm.list[begin].label(); + locs_.brk = stm.list[begin].as_cond->value; + + auto test = std::move(stm.list[begin].as_cond->test); + begin = find_location_index(stm, stm.list[end].as_jump_back->value); + auto loc = stm.list[begin].loc(); + + end--; + stm.list.erase(stm.list.begin() + end); + stm.list.erase(stm.list.begin() + end); + + auto body = make_stmt_list(loc); + + for (auto i = begin; i < end; i++) + { + body->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + decompile_statements(*body); + locs_ = save; + stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_dowhile(loc, std::move(test), stmt{ std::move(body) }) }); +} + +auto decompiler::decompile_for(stmt_list& stm, usize begin, usize end) -> void +{ + auto save = locs_; + locs_.last = false; + locs_.end = stm.list[end - 1].label(); + locs_.cnt = stm.list[end - 1].label(); + locs_.brk = stm.list[begin].as_cond->value; + + for (begin -= 1; stm.list[begin] == node::asm_create; begin--); + + auto loc = stm.list[begin].loc(); + auto init = make_stmt_list(loc); + init->is_expr = true; + + while (stm.list[begin] != node::asm_jmp_cond) + { + init->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + auto test = std::move(stm.list[begin].as_cond->test); + stm.list.erase(stm.list.begin() + begin); + + end -= 2 + init->list.size(); + + auto iter = make_stmt_list(loc); + iter->is_expr = true; + iter->list.push_back(std::move(stm.list[end])); + stm.list.erase(stm.list.begin() + end); + stm.list.erase(stm.list.begin() + end); + + auto body = make_stmt_list(loc); + + for (auto i = begin; i < end; i++) + { + body->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + decompile_statements(*body); + locs_ = save; + stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_for(loc, stmt { std::move(init) }, std::move(test), stmt {std::move(iter) }, stmt{ std::move(body) }) }); +} + +auto decompiler::decompile_foreach(stmt_list& stm, usize begin, usize end) -> void +{ + auto save = locs_; + locs_.last = false; + locs_.end = stm.list[end - 1].label(); + locs_.cnt = stm.list[end - 1].label(); + locs_.brk = stm.list[begin].as_cond->value; + + for (begin -= 1; stm.list[begin] == node::asm_create; begin--); + + auto use_index = false; + + if ((ctx_->props() & props::foreach) && stm.list[begin] == node::stmt_assign && stm.list[begin].as_assign->value.as_assign->rvalue == node::expr_undefined) + { + use_index = true; + begin--; + } + + begin--; + + auto loc = stm.list[begin].loc(); + + auto container = std::move(stm.list[begin].as_assign->value.as_assign->rvalue); + auto array = std::move(stm.list[begin].as_assign->value.as_assign->lvalue); + stm.list.erase(stm.list.begin() + begin); + + auto key = std::move(stm.list[begin].as_assign->value.as_assign->lvalue); + stm.list.erase(stm.list.begin() + begin); + + auto index = (use_index) ? std::move(stm.list[begin].as_assign->value.as_assign->lvalue): expr{ make_node() }; + + if (use_index) + { + stm.list.erase(stm.list.begin() + begin); + } + + auto init = make_stmt_list(loc); + + while (stm.list[begin] != node::asm_jmp_cond) + { + init->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + stm.list.erase(stm.list.begin() + begin); + + auto value = std::move(stm.list[begin].as_assign->value.as_assign->lvalue); + stm.list.erase(stm.list.begin() + begin); + + if (use_index) + { + stm.list.erase(stm.list.begin() + begin); + } + + end -= (use_index ? 7 : 5) + init->list.size(); + stm.list.erase(stm.list.begin() + end); + stm.list.erase(stm.list.begin() + end); + + auto use_key = true; + + if (stm.list.size() > end && stm.list[end] == node::asm_clear) + { + stm.list.erase(stm.list.begin() + end); + } + + if (stm.list.size() > end && stm.list[end] == node::asm_clear) + { + stm.list.erase(stm.list.begin() + end); + use_key = false; + } + + auto body = make_stmt_list(loc); + + for (auto i = begin; i < end; i++) + { + body->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + decompile_statements(*body); + locs_ = save; + body->list.insert(body->list.begin(), stmt{ std::move(init) }); + stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_foreach(loc, std::move(container), std::move(value), std::move(index), std::move(array), std::move(key), stmt{ std::move(body) }, (ctx_->props() & props::foreach) ? use_index : use_key) }); +} + +auto decompiler::decompile_switch(stmt_list& stm, usize begin, usize end) -> void +{ + auto const& data = stm.list[end].as_asm_endswitch->data; + auto const count = std::stoul(data[0]); + + if (count) + { + auto type = static_cast(std::stoul(data.back())); + auto index = 1u; + + for (auto i = 0u; i < count; i++) + { + if (data[index] == "case") + { + if (ctx_->engine() == engine::iw9) + { + type = static_cast(std::stoul(data[index + 1])); + auto j = find_location_index(stm, data[index + 3]); + auto loc = stm.list[j].loc(); + auto exp = (type == switch_type::integer) ? expr{ make_expr_integer(loc, data[index + 2]) } : expr{ make_expr_string(loc, data[index + 2]) }; + while (stm.list[j] == node::stmt_case) j++; + stm.list.insert(stm.list.begin() + j, stmt{ make_stmt_case(loc, std::move(exp), make_stmt_list(loc)) }); + index += 4; + } + else + { + auto j = find_location_index(stm, data[index + 2]); + auto loc = stm.list[j].loc(); + auto exp = (type == switch_type::integer) ? expr{ make_expr_integer(loc, data[index + 1]) } : expr{ make_expr_string(loc, data[index + 1]) }; + while (stm.list[j] == node::stmt_case) j++; + stm.list.insert(stm.list.begin() + j, stmt{ make_stmt_case(loc, std::move(exp), make_stmt_list(loc)) }); + index += 3; + } + + } + else if (data[index] == "default") + { + auto j = find_location_index(stm, data[index + 1]); + auto loc = stm.list[j].loc(); + while (stm.list[j] == node::stmt_case) j++; + stm.list.insert(stm.list.begin() + j, stmt{ make_stmt_default(loc, make_stmt_list(loc)) }); + index += 2; + } + else + { + decomp_error("malformed endswitch statement"); + } + } + + end += count; + } + + auto save = locs_; + locs_.last = false; + locs_.brk = last_location_index(stm, end) ? locs_.end : stm.list[end + 1].label(); + locs_.end = stm.list[begin].as_asm_switch->value; + + auto loc = stm.list[begin].loc(); + auto test = std::move(stm.list[begin].as_asm_switch->test); + + end--; + stm.list.erase(stm.list.begin() + begin); + stm.list.erase(stm.list.begin() + end); + + auto body = make_stmt_list(loc); + + for (auto i = begin; i < end; i++) + { + body->list.push_back(std::move(stm.list[begin])); + stm.list.erase(stm.list.begin() + begin); + } + + decompile_statements(*body); + locs_ = save; + + auto temp = stmt{ make_node() }; + + for (auto i = 0u; i < body->list.size(); ) + { + if (body->list[i] == node::stmt_case || body->list[i] == node::stmt_default) + { + if (temp != node::null) + { + body->list.insert(body->list.begin() + i, std::move(temp)); + i++; + } + + temp = std::move(body->list[i]); + body->list.erase(body->list.begin() + i); + } + else + { + if (temp == node::stmt_case) + { + temp.as_case->body->list.push_back(std::move(body->list[i])); + body->list.erase(body->list.begin() + i); + } + else if (temp == node::stmt_default) + { + temp.as_default->body->list.push_back(std::move(body->list[i])); + body->list.erase(body->list.begin() + i); + } + else + { + decomp_error("missing case or default before stmt inside a switch"); + } + } + } + + if (temp != node::null) + { + body->list.push_back(std::move(temp)); + } + + stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_switch(loc, std::move(test), std::move(body)) }); +} + +auto decompiler::find_location_reference(stmt_list const& stm, usize begin, usize end, std::string const& loc) -> bool +{ + for (auto i = begin; i < end; i++) + { + auto const& entry = stm.list.at(i); + + if (entry == node::asm_jmp_cond && entry.as_cond->value == loc) + { + return true; + } + else if (entry == node::asm_jmp && entry.as_jump->value == loc) + { + return true; + } + } + + return false; +} + +auto decompiler::find_location_index(stmt_list const& stm, std::string const& loc) -> usize +{ + auto index = 0u; + + if (loc == locs_.end) + return stm.list.size(); + + for (auto const& entry : stm.list) + { + if (entry.label() == loc) + return index; + + index++; + } + + throw decomp_error(fmt::format("location '{}' not found", loc)); +} + +auto decompiler::last_location_index(stmt_list const& stm, usize index) -> bool +{ + return (index == stm.list.size() - 1) ? true : false; +} + +auto decompiler::process_function(decl_function& func) -> void +{ + auto scp_body = make_scope(); + + for (auto const& entry : func.params->list) + { + scp_body->vars.push_back({ entry->value, static_cast(scp_body->create_count), true }); + scp_body->create_count++; + } + + process_stmt_list(*func.body, *scp_body); +} + +auto decompiler::process_stmt(stmt& stm, scope& scp) -> void +{ + switch (stm.kind()) + { + case node::stmt_list: + process_stmt_list(*stm.as_list, scp); + break; + case node::stmt_expr: + process_stmt_expr(*stm.as_expr, scp); + break; + case node::stmt_call: + process_stmt_call(*stm.as_call, scp); + break; + case node::stmt_assign: + process_stmt_assign(*stm.as_assign, scp); + break; + case node::stmt_endon: + process_stmt_endon(*stm.as_endon, scp); + break; + case node::stmt_notify: + process_stmt_notify(*stm.as_notify, scp); + break; + case node::stmt_wait: + process_stmt_wait(*stm.as_wait, scp); + break; + case node::stmt_waittill: + process_stmt_waittill(*stm.as_waittill, scp); + break; + case node::stmt_waittillmatch: + process_stmt_waittillmatch(*stm.as_waittillmatch, scp); + break; + case node::stmt_if: + process_stmt_if(*stm.as_if, scp); + break; + case node::stmt_ifelse: + process_stmt_ifelse(*stm.as_ifelse, scp); + break; + case node::stmt_while: + process_stmt_while(*stm.as_while, scp); + break; + case node::stmt_dowhile: + process_stmt_dowhile(*stm.as_dowhile, scp); + break; + case node::stmt_for: + process_stmt_for(*stm.as_for, scp); + break; + case node::stmt_foreach: + process_stmt_foreach(*stm.as_foreach, scp); + break; + case node::stmt_switch: + process_stmt_switch(*stm.as_switch, scp); + break; + case node::stmt_break: + process_stmt_break(*stm.as_break, scp); + break; + case node::stmt_continue: + process_stmt_continue(*stm.as_continue, scp); + break; + case node::stmt_return: + process_stmt_return(*stm.as_return, scp); + break; + case node::asm_create: + process_stmt_asm_create(*stm.as_asm_create, scp); + break; + case node::asm_remove: + process_stmt_asm_remove(*stm.as_asm_remove, scp); + break; + default: + break; + } +} + +auto decompiler::process_stmt_list(stmt_list& stm, scope& scp) -> void +{ + for (auto& entry : stm.list) + { + process_stmt(entry, scp); + } + + for (auto i = 0u; i < stm.list.size(); ) + { + if (stm.list[i] == node::asm_create || stm.list[i] == node::asm_remove) + stm.list.erase(stm.list.begin() + i); + else + i++; + } +} + +auto decompiler::process_stmt_expr(stmt_expr& stm, scope& scp) -> void +{ + switch (stm.value.kind()) + { + case node::expr_increment: + process_expr_increment(*stm.value.as_increment, scp); + break; + case node::expr_decrement: + process_expr_decrement(*stm.value.as_decrement, scp); + break; + case node::expr_assign_equal: + case node::expr_assign_add: + case node::expr_assign_sub: + case node::expr_assign_mul: + case node::expr_assign_div: + case node::expr_assign_mod: + case node::expr_assign_shift_left: + case node::expr_assign_shift_right: + case node::expr_assign_bitwise_or: + case node::expr_assign_bitwise_and: + case node::expr_assign_bitwise_exor: + process_expr_assign(stm.value.as_assign, scp); + break; + default: + break; + } +} + +auto decompiler::process_stmt_call(stmt_call& stm, scope& scp) -> void +{ + switch (stm.value.kind()) + { + case node::expr_call: + process_expr_call(*stm.value.as_call, scp); + break; + case node::expr_method: + process_expr_method(*stm.value.as_method, scp); + break; + default: + break; + } +} + +auto decompiler::process_stmt_assign(stmt_assign& stm, scope& scp) -> void +{ + switch (stm.value.kind()) + { + case node::expr_increment: + process_expr_increment(*stm.value.as_increment, scp); + break; + case node::expr_decrement: + process_expr_decrement(*stm.value.as_decrement, scp); + break; + case node::expr_assign_equal: + case node::expr_assign_add: + case node::expr_assign_sub: + case node::expr_assign_mul: + case node::expr_assign_div: + case node::expr_assign_mod: + case node::expr_assign_shift_left: + case node::expr_assign_shift_right: + case node::expr_assign_bitwise_or: + case node::expr_assign_bitwise_and: + case node::expr_assign_bitwise_exor: + process_expr_assign(stm.value.as_assign, scp); + break; + default: + break; + } +} + +auto decompiler::process_stmt_endon(stmt_endon& stm, scope& scp) -> void +{ + process_expr(stm.event, scp); + process_expr(stm.obj, scp); +} + +void decompiler::process_stmt_notify(stmt_notify& stm, scope& scp) +{ + process_expr_arguments(*stm.args, scp); + process_expr(stm.event, scp); + process_expr(stm.obj, scp); +} + +auto decompiler::process_stmt_wait(stmt_wait& stm, scope& scp) -> void +{ + process_expr(stm.time, scp); +} + +auto decompiler::process_stmt_waittill(stmt_waittill& stm, scope& scp) -> void +{ + process_expr(stm.event, scp); + process_expr(stm.obj, scp); + + for (auto& entry : stm.args->list) + { + process_expr(entry, scp); + } +} + +auto decompiler::process_stmt_waittillmatch(stmt_waittillmatch& stm, scope& scp) -> void +{ + process_expr_arguments(*stm.args, scp); + process_expr(stm.event, scp); + process_expr(stm.obj, scp); +} + +auto decompiler::process_stmt_if(stmt_if& stm, scope& scp) -> void +{ + auto scp_then = make_scope(); + + process_expr(stm.test, scp); + + scp.transfer_dec(scp_then); + + process_stmt(stm.body, *scp_then); + + if (stm.body.as_list->list.size() == 1 && !stm.body.as_list->list[0].as_node->is_special_stmt()) + { + stm.body = std::move(stm.body.as_list->list.back()); + } +} + +auto decompiler::process_stmt_ifelse(stmt_ifelse& stm, scope& scp) -> void +{ + auto childs = std::vector{}; + auto abort = scope::abort_return; + auto scp_then = make_scope(); + auto scp_else = make_scope(); + + process_expr(stm.test, scp); + + scp.transfer_dec(scp_then); + + process_stmt(stm.stmt_if, *scp_then); + + if (scp_then->abort <= scope::abort_return) + { + abort = scp_then->abort; + + if (abort == scope::abort_none) + childs.push_back(scp_then.get()); + } + + scp.transfer_dec(scp_else); + + process_stmt(stm.stmt_else, *scp_else); + + if (scp_else->abort <= abort) + { + abort = scp_else->abort; + + if (abort == scope::abort_none) + childs.push_back(scp_else.get()); + } + + if (scp.abort == scope::abort_none) + scp.abort = abort; + + scp.append(childs); + + if (stm.stmt_if.as_list->list.size() == 1 && !stm.stmt_if.as_list->list[0].as_node->is_special_stmt()) + { + stm.stmt_if = std::move(stm.stmt_if.as_list->list.back()); + } + + if (stm.stmt_else.as_list->list.size() == 1 && !stm.stmt_else.as_list->list[0].as_node->is_special_stmt_noif()) + { + stm.stmt_else = std::move(stm.stmt_else.as_list->list.back()); + } +} + +auto decompiler::process_stmt_while(stmt_while& stm, scope& scp) -> void +{ + auto scp_body = make_scope(); + + process_expr(stm.test, scp); + + scp.transfer_dec(scp_body); + + process_stmt(stm.body, *scp_body); + + if (stm.test == node::null) + scp.append_dec(scp_body); + + if (stm.body.as_list->list.size() == 1 && !stm.body.as_list->list[0].as_node->is_special_stmt()) + { + stm.body = std::move(stm.body.as_list->list.back()); + } +} + +auto decompiler::process_stmt_dowhile(stmt_dowhile& stm, scope& scp) -> void +{ + auto scp_body = make_scope(); + + process_expr(stm.test, scp); + + scp.transfer_dec(scp_body); + + process_stmt(stm.body, *scp_body); + + if (stm.test == node::null) + scp.append_dec(scp_body); + + if (stm.body.as_list->list.size() == 1 && !stm.body.as_list->list[0].as_node->is_special_stmt()) + { + stm.body = std::move(stm.body.as_list->list.back()); + } +} + +auto decompiler::process_stmt_for(stmt_for& stm, scope& scp) -> void +{ + auto scp_body = make_scope(); + + process_stmt(stm.init, scp); + + scp.transfer_dec(scp_body); + + process_expr(stm.test, scp); + + process_stmt(stm.body, *scp_body); + + process_stmt(stm.iter, scp); + + if (stm.test == node::null) + scp.append_dec(scp_body); + + if (stm.body.as_list->list.size() == 1 && !stm.body.as_list->list[0].as_node->is_special_stmt()) + { + stm.body = std::move(stm.body.as_list->list.back()); + } +} + +auto decompiler::process_stmt_foreach(stmt_foreach& stm, scope& scp) -> void +{ + auto scp_body = make_scope(); + + process_expr(stm.container, scp); + process_expr(stm.array, scp); + process_expr(stm.key, scp); + + if ((ctx_->props() & props::foreach) && stm.use_key) + { + process_expr(stm.index, scp); + } + + process_stmt(stm.body.as_list->list[0], scp); + + stm.body.as_list->list.erase(stm.body.as_list->list.begin()); + + scp.transfer_dec(scp_body); + + process_expr(stm.value, *scp_body); + process_stmt(stm.body, *scp_body); + + if (stm.body.as_list->list.size() == 1 && !stm.body.as_list->list[0].as_node->is_special_stmt()) + { + stm.body = std::move(stm.body.as_list->list.back()); + } +} + +auto decompiler::process_stmt_switch(stmt_switch& stm, scope& scp) -> void +{ + auto scopes = std::vector{}; + auto childs = std::vector{}; + auto has_default = false; + + process_expr(stm.test, scp); + + for (auto& entry : stm.body->list) + { + if (entry == node::stmt_case) + { + entry.as_case->body->is_case = true; + auto scp_case = make_scope(); + + scp.transfer_dec(scp_case); + + process_stmt_list(*entry.as_case->body, *scp_case); + + if (scp_case->abort == scope::abort_break) + { + childs.push_back(scp_case.get()); + scopes.push_back(std::move(scp_case)); + } + } + else if (entry == node::stmt_default) + { + has_default = true; + entry.as_default->body->is_case = true; + auto scp_case = make_scope(); + + scp.transfer_dec(scp_case); + + process_stmt_list(*entry.as_default->body, *scp_case); + + if (scp_case->abort == scope::abort_break) + { + childs.push_back(scp_case.get()); + scopes.push_back(std::move(scp_case)); + } + } + } + + if (has_default) + { + scp.append(childs); + } +} + +auto decompiler::process_stmt_break(stmt_break&, scope& scp) -> void +{ + if (scp.abort == scope::abort_none) + { + scp.abort = scope::abort_break; + } +} + +auto decompiler::process_stmt_continue(stmt_continue&, scope& scp) -> void +{ + if (scp.abort == scope::abort_none) + { + scp.abort = scope::abort_continue; + } +} + +auto decompiler::process_stmt_return(stmt_return& stm, scope& scp) -> void +{ + if (scp.abort == scope::abort_none) + { + scp.abort = scope::abort_return; + } + + if (stm.value != node::null) + { + process_expr(stm.value, scp); + } +} + +auto decompiler::process_stmt_asm_create(asm_create& stm, scope& scp) -> void +{ + auto var = (ctx_->props() & props::hash) ? stm.index : fmt::format("var_{}", stm.index); + scp.vars.push_back({ var, static_cast(scp.create_count), true }); + scp.create_count++; +} + +auto decompiler::process_stmt_asm_remove(asm_remove& stm, scope& scp) -> void +{ + scp.public_count = static_cast(scp.vars.size() - std::stoi(stm.index)); +} + +auto decompiler::process_expr(expr& exp, scope& scp) -> void +{ + switch (exp.kind()) + { + case node::expr_ternary: + process_expr_ternary(*exp.as_ternary, scp); + break; + case node::expr_and: + process_expr_and(*exp.as_and, scp); + break; + case node::expr_or: + process_expr_or(*exp.as_or, scp); + break; + case node::expr_equality: + case node::expr_inequality: + case node::expr_less: + case node::expr_greater: + case node::expr_less_equal: + case node::expr_greater_equal: + case node::expr_bitwise_or: + case node::expr_bitwise_and: + case node::expr_bitwise_exor: + case node::expr_shift_left: + case node::expr_shift_right: + case node::expr_add: + case node::expr_sub: + case node::expr_mul: + case node::expr_div: + case node::expr_mod: + process_expr_binary(*exp.as_binary, scp); + break; + case node::expr_complement: + process_expr_complement(*exp.as_complement, scp); + break; + case node::expr_not: + process_expr_not(*exp.as_not, scp); + break; + case node::expr_call: + process_expr_call(*exp.as_call, scp); + break; + case node::expr_method: + process_expr_method(*exp.as_method, scp); + break; + case node::expr_isdefined: + process_expr(exp.as_isdefined->value, scp); + break; + case node::expr_istrue: + process_expr(exp.as_istrue->value, scp); + break; + case node::expr_add_array: + process_expr_add_array(*exp.as_add_array, scp); + break; + case node::expr_size: + process_expr_size(*exp.as_size, scp); + break; + case node::expr_tuple: + process_expr_tuple(*exp.as_tuple, scp); + break; + case node::expr_array: + process_expr_array(*exp.as_array, scp); + break; + case node::expr_field: + process_expr_field(*exp.as_field, scp); + break; + case node::expr_vector: + process_expr_vector(*exp.as_vector, scp); + break; + case node::asm_create: + process_expr_asm_create(exp, scp); + break; + case node::asm_access: + process_expr_asm_access(exp, scp); + break; + default: + break; + } +} + +auto decompiler::process_expr_assign(expr_assign::ptr& exp, scope& scp) -> void +{ + process_expr(exp->rvalue, scp); + process_expr(exp->lvalue, scp); + + if (exp->kind() == node::expr_assign_equal) + { + switch (exp->rvalue.kind()) + { + case node::expr_bitwise_or: + if (exp->lvalue == exp->rvalue.as_bitwise_or->lvalue) + exp = make_expr_assign_bitwise_or(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_bitwise_or->rvalue)); + break; + case node::expr_bitwise_and: + if (exp->lvalue == exp->rvalue.as_bitwise_and->lvalue) + exp = make_expr_assign_bitwise_and(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_bitwise_and->rvalue)); + break; + case node::expr_bitwise_exor: + if (exp->lvalue == exp->rvalue.as_bitwise_exor->lvalue) + exp = make_expr_assign_bitwise_exor(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_bitwise_exor->rvalue)); + break; + case node::expr_shift_left: + if (exp->lvalue == exp->rvalue.as_shift_left->lvalue) + exp = make_expr_assign_shift_left(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_shift_left->rvalue)); + break; + case node::expr_shift_right: + if (exp->lvalue == exp->rvalue.as_shift_right->lvalue) + exp = make_expr_assign_shift_right(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_shift_right->rvalue)); + break; + case node::expr_add: + if (exp->lvalue == exp->rvalue.as_add->lvalue) + exp = make_expr_assign_add(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_add->rvalue)); + break; + case node::expr_sub: + if (exp->lvalue == exp->rvalue.as_sub->lvalue) + exp = make_expr_assign_sub(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_sub->rvalue)); + break; + case node::expr_mul: + if (exp->lvalue == exp->rvalue.as_mul->lvalue) + exp = make_expr_assign_mul(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_mul->rvalue)); + break; + case node::expr_div: + if (exp->lvalue == exp->rvalue.as_div->lvalue) + exp = make_expr_assign_div(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_div->rvalue)); + break; + case node::expr_mod: + if (exp->lvalue == exp->rvalue.as_mod->lvalue) + exp = make_expr_assign_mod(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_mod->rvalue)); + break; + default: + break; + } + } +} + +auto decompiler::process_expr_increment(expr_increment& exp, scope& scp) -> void +{ + process_expr(exp.lvalue, scp); +} + +auto decompiler::process_expr_decrement(expr_decrement& exp, scope& scp) -> void +{ + process_expr(exp.lvalue, scp); +} + +auto decompiler::process_expr_ternary(expr_ternary& exp, scope& scp) -> void +{ + process_expr(exp.test, scp); + process_expr(exp.true_expr, scp); + process_expr(exp.false_expr, scp); +} + +auto decompiler::process_expr_binary(expr_binary& exp, scope& scp) -> void +{ + process_expr(exp.lvalue, scp); + process_expr(exp.rvalue, scp); + + auto prec = exp.lvalue.as_node->precedence(); + + if (prec && prec < exp.precedence()) + { + exp.lvalue = expr{ make_expr_paren(exp.loc(), std::move(exp.lvalue)) }; + } + + prec = exp.rvalue.as_node->precedence(); + + if ((prec && prec < exp.precedence()) || (prec == exp.precedence() && exp.kind() == exp.rvalue.as_node->kind())) + { + exp.rvalue = expr{ make_expr_paren(exp.loc(), std::move(exp.rvalue)) }; + } +} + +auto decompiler::process_expr_and(expr_and& exp, scope& scp) -> void +{ + process_expr(exp.lvalue, scp); + process_expr(exp.rvalue, scp); + + auto prec = exp.lvalue.as_node->precedence(); + + if (prec && prec < exp.precedence()) + { + exp.lvalue = expr{ make_expr_paren(exp.loc(), std::move(exp.lvalue)) }; + } + + prec = exp.rvalue.as_node->precedence(); + + if ((prec && prec < exp.precedence()) || (prec == exp.precedence() && exp.kind() == exp.rvalue.kind())) + { + exp.rvalue = expr{ make_expr_paren(exp.loc(), std::move(exp.rvalue)) }; + } +} + +auto decompiler::process_expr_or(expr_or& exp, scope& scp) -> void +{ + process_expr(exp.lvalue, scp); + process_expr(exp.rvalue, scp); +} + +auto decompiler::process_expr_complement(expr_complement& exp, scope& scp) -> void +{ + process_expr(exp.rvalue, scp); + + if (exp.rvalue.as_node->is_binary()) + { + exp.rvalue = expr{ make_expr_paren(exp.loc(), std::move(exp.rvalue)) }; + } +} + +auto decompiler::process_expr_not(expr_not& exp, scope& scp) -> void +{ + process_expr(exp.rvalue, scp); + + if (exp.rvalue.as_node->is_binary()) + { + exp.rvalue = expr{ make_expr_paren(exp.loc(), std::move(exp.rvalue)) }; + } +} + +auto decompiler::process_expr_call(expr_call& exp, scope& scp) -> void +{ + switch (exp.value.kind()) + { + case node::expr_pointer: + process_expr_call_pointer(*exp.value.as_pointer, scp); + break; + case node::expr_function: + process_expr_call_function(*exp.value.as_function, scp); + break; + default: + break; + } +} + +auto decompiler::process_expr_method(expr_method& exp, scope& scp) -> void +{ + switch (exp.value.kind()) + { + case node::expr_pointer: + process_expr_method_pointer(*exp.value.as_pointer, exp.obj, scp); + break; + case node::expr_function: + process_expr_method_function(*exp.value.as_function, exp.obj, scp); + break; + default: + break; + } +} + +auto decompiler::process_expr_call_pointer(expr_pointer& exp, scope& scp) -> void +{ + process_expr_arguments(*exp.args, scp); + process_expr(exp.func, scp); +} + +auto decompiler::process_expr_call_function(expr_function& exp, scope& scp) -> void +{ + process_expr_arguments(*exp.args, scp); +} + +auto decompiler::process_expr_method_pointer(expr_pointer& exp, expr& obj, scope& scp) -> void +{ + process_expr_arguments(*exp.args, scp); + process_expr(obj, scp); + process_expr(exp.func, scp); +} + +auto decompiler::process_expr_method_function(expr_function& exp, expr& obj, scope& scp) -> void +{ + process_expr_arguments(*exp.args, scp); + process_expr(obj, scp); +} + +auto decompiler::process_expr_arguments(expr_arguments& exp, scope& scp) -> void +{ + for (auto i = exp.list.size(); i > 0; i--) + { + process_expr(exp.list[i - 1], scp); + } +} + +auto decompiler::process_expr_add_array(expr_add_array& exp, scope& scp) -> void +{ + for (auto& entry : exp.args->list) + { + process_expr(entry, scp); + } +} + +auto decompiler::process_expr_size(expr_size& exp, scope& scp) -> void +{ + process_expr(exp.obj, scp); +} + +auto decompiler::process_expr_tuple(expr_tuple& exp, scope& scp) -> void +{ + process_expr(exp.temp, scp); + + for (auto& entry : exp.list) + { + process_expr(entry, scp); + } +} + +auto decompiler::process_expr_array(expr_array& exp, scope& scp) -> void +{ + process_expr(exp.key, scp); + process_expr(exp.obj, scp); +} + +auto decompiler::process_expr_field(expr_field& exp, scope& scp) -> void +{ + process_expr(exp.obj, scp); +} + +auto decompiler::process_expr_vector(expr_vector& exp, scope& scp) -> void +{ + process_expr(exp.z, scp); + process_expr(exp.y, scp); + process_expr(exp.x, scp); +} + +auto decompiler::process_expr_asm_create(expr& exp, scope& scp) -> void +{ + for (auto const& entry : exp.as_asm_create->vars) + { + auto var = (ctx_->props() & props::hash) ? entry : fmt::format("var_{}", entry); + scp.vars.push_back({ var, static_cast(scp.create_count), true }); + scp.create_count++; + } + + auto var = (ctx_->props() & props::hash) ? exp.as_asm_create->index : fmt::format("var_{}", exp.as_asm_create->index); + scp.vars.push_back({ var, static_cast(scp.create_count), true }); + scp.create_count++; + + exp = expr{ make_expr_identifier(exp.loc(), var) }; +} + +auto decompiler::process_expr_asm_access(expr& exp, scope& scp) -> void +{ + auto const index = std::stoul(exp.as_asm_access->index); + + if (scp.vars.size() <= index) + { + fmt::print("WARNING: bad local var access\n"); + } + else + { + exp = expr{ make_expr_identifier(exp.loc(), scp.vars[scp.vars.size() - 1 - index].name) }; + } +} + +} // namespace xsk::gsc diff --git a/src/gsc/decompiler.hpp b/src/gsc/decompiler.hpp new file mode 100644 index 00000000..b2397a1c --- /dev/null +++ b/src/gsc/decompiler.hpp @@ -0,0 +1,102 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "misc/types.hpp" + +namespace xsk::gsc +{ + +class decompiler +{ + context const* ctx_; + program::ptr program_; + decl_function::ptr func_; + std::unordered_map labels_; + std::vector expr_labels_; + std::vector tern_labels_; + std::stack stack_; + bool in_waittill_; + locjmp locs_; + +public: + decompiler(context const* ctx); + auto decompile(assembly const& data) -> program::ptr; + +private: + auto decompile_function(function const& func) -> void; + auto decompile_instruction(instruction const& inst) -> void; + auto decompile_expressions(instruction const& inst) -> void; + auto decompile_statements(stmt_list& stm) -> void; + auto decompile_loops(stmt_list& stm) -> void; + auto decompile_switches(stmt_list& stm) -> void; + auto decompile_ifelses(stmt_list& stm) -> void; + auto decompile_aborts(stmt_list& stm) -> void; + auto decompile_tuples(stmt_list& stm) -> void; + auto decompile_if(stmt_list& stm, usize begin, usize end) -> void; + auto decompile_ifelse(stmt_list& stm, usize begin, usize end) -> void; + auto decompile_ifelse_end(stmt_list& stm, usize begin, usize end) -> void; + auto decompile_inf(stmt_list& stm, usize begin, usize end) -> void; + auto decompile_loop(stmt_list& stm, usize begin, usize end) -> void; + auto decompile_while(stmt_list& stm, usize begin, usize end) -> void; + auto decompile_dowhile(stmt_list& stm, usize begin, usize end) -> void; + auto decompile_for(stmt_list& stm, usize begin, usize end) -> void; + auto decompile_foreach(stmt_list& stm, usize begin, usize end) -> void; + auto decompile_switch(stmt_list& stm, usize begin, usize end) -> void; + auto find_location_reference(stmt_list const& stm, usize begin, usize end, std::string const& loc) -> bool; + auto find_location_index(stmt_list const& stm, std::string const& loc) -> usize; + auto last_location_index(stmt_list const& stm, usize index) -> bool; + auto process_function(decl_function& func) -> void; + auto process_stmt(stmt& stm, scope& scp) -> void; + auto process_stmt_list(stmt_list& stm, scope& scp) -> void; + auto process_stmt_expr(stmt_expr& stm, scope& scp) -> void; + auto process_stmt_call(stmt_call& stm, scope& scp) -> void; + auto process_stmt_assign(stmt_assign& stm, scope& scp) -> void; + auto process_stmt_endon(stmt_endon& stm, scope& scp) -> void; + auto process_stmt_notify(stmt_notify& stm, scope& scp) -> void; + auto process_stmt_wait(stmt_wait& stm, scope& scp) -> void; + auto process_stmt_waittill(stmt_waittill& stm, scope& scp) -> void; + auto process_stmt_waittillmatch(stmt_waittillmatch& stm, scope& scp) -> void; + auto process_stmt_if(stmt_if& stm, scope& scp) -> void; + auto process_stmt_ifelse(stmt_ifelse& stm, scope& scp) -> void; + auto process_stmt_while(stmt_while& stm, scope& scp) -> void; + auto process_stmt_dowhile(stmt_dowhile& stm, scope& scp) -> void; + auto process_stmt_for(stmt_for& stm, scope& scp) -> void; + auto process_stmt_foreach(stmt_foreach& stm, scope& scp) -> void; + auto process_stmt_switch(stmt_switch& stm, scope& scp) -> void; + auto process_stmt_break(stmt_break& stm, scope& scp) -> void; + auto process_stmt_continue(stmt_continue& stm, scope& scp) -> void; + auto process_stmt_return(stmt_return& stm, scope& scp) -> void; + auto process_stmt_asm_create(asm_create& stm, scope& scp) -> void; + auto process_stmt_asm_remove(asm_remove& stm, scope& scp) -> void; + auto process_expr(expr& exp, scope& scp) -> void; + auto process_expr_assign(expr_assign::ptr& exp, scope& scp) -> void; + auto process_expr_increment(expr_increment& exp, scope& scp) -> void; + auto process_expr_decrement(expr_decrement& exp, scope& scp) -> void; + auto process_expr_ternary(expr_ternary& exp, scope& scp) -> void; + auto process_expr_binary(expr_binary& exp, scope& scp) -> void; + auto process_expr_and(expr_and& exp, scope& scp) -> void; + auto process_expr_or(expr_or& exp, scope& scp) -> void; + auto process_expr_complement(expr_complement& exp, scope& scp) -> void; + auto process_expr_not(expr_not& exp, scope& scp) -> void; + auto process_expr_call(expr_call& exp, scope& scp) -> void; + auto process_expr_method(expr_method& exp, scope& scp) -> void; + auto process_expr_call_pointer(expr_pointer& exp, scope& scp) -> void; + auto process_expr_call_function(expr_function& exp, scope& scp) -> void; + auto process_expr_method_pointer(expr_pointer& exp, expr& obj, scope& scp) -> void; + auto process_expr_method_function(expr_function& exp, expr& obj, scope& scp) -> void; + auto process_expr_arguments(expr_arguments& exp, scope& scp) -> void; + auto process_expr_add_array(expr_add_array& exp, scope& scp) -> void; + auto process_expr_size(expr_size& exp, scope& scp) -> void; + auto process_expr_tuple(expr_tuple& exp, scope& scp) -> void; + auto process_expr_array(expr_array& exp, scope& scp) -> void; + auto process_expr_field(expr_field& exp, scope& scp) -> void; + auto process_expr_vector(expr_vector& exp, scope& scp) -> void; + auto process_expr_asm_create(expr& exp, scope& scp) -> void; + auto process_expr_asm_access(expr& exp, scope& scp) -> void; +}; + +} // namespace xsk::gsc diff --git a/src/gsc/disassembler.cpp b/src/gsc/disassembler.cpp new file mode 100644 index 00000000..fce36b6e --- /dev/null +++ b/src/gsc/disassembler.cpp @@ -0,0 +1,663 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "disassembler.hpp" +#include "context.hpp" +#include "utils/string.hpp" + +namespace xsk::gsc +{ + +disassembler::disassembler(context const* ctx) : ctx_{ ctx } +{ +} + +auto disassembler::disassemble(buffer const& script, buffer const& stack) -> assembly::ptr +{ + return disassemble(script.data, script.size, stack.data, stack.size); +} + +auto disassembler::disassemble(std::vector const& script, std::vector const& stack) -> assembly::ptr +{ + return disassemble(script.data(), script.size(), stack.data(), stack.size()); +} + +auto disassembler::disassemble(u8 const* script, usize script_size, u8 const* stack, usize stack_size) -> assembly::ptr +{ + stack_ = utils::reader{ stack, static_cast(stack_size), ctx_->endian() == endian::big }; + script_ = utils::reader{ script, static_cast(script_size), ctx_->endian() == endian::big }; + assembly_ = make_assembly(); + + script_.seek(1); + + while (script_.is_avail() && stack_.is_avail()) + { + func_ = make_function(); + func_->index = script_.pos(); + func_->size = stack_.read(); + func_->id = (ctx_->props() & props::hash) ? 0 : (ctx_->props() & props::tok4) ? stack_.read() : stack_.read(); + func_->name = (ctx_->props() & props::hash) ? ctx_->hash_name(stack_.read()) : func_->id == 0 ? decrypt_string(stack_.read_cstr()) : ctx_->token_name(func_->id); + + dissasemble_function(*func_); + + assembly_->functions.push_back(std::move(func_)); + } + + resolve_functions(); + + return std::move(assembly_); +} + +auto disassembler::dissasemble_function(function& func) -> void +{ + auto size = static_cast(func.size); + + while (size > 0) + { + auto inst = make_instruction(); + inst->index = script_.pos(); + inst->opcode = ctx_->opcode_enum(script_.read()); + inst->size = ctx_->opcode_size(inst->opcode); + + dissasemble_instruction(*inst); + + size -= inst->size; + + if (size < 0 || inst->index + inst->size != script_.pos()) + throw disasm_error("bad instruction size"); + + func.instructions.push_back(std::move(inst)); + } +} + +auto disassembler::dissasemble_instruction(instruction& inst) -> void +{ + switch (inst.opcode) + { + case opcode::OP_CastFieldObject: + case opcode::OP_plus: + case opcode::OP_GetGameRef: + case opcode::OP_GetThisthread: + case opcode::OP_greater: + case opcode::OP_shift_right: + case opcode::OP_dec: + case opcode::OP_bit_or: + case opcode::OP_equality: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_notify: + case opcode::OP_PreScriptCall: + case opcode::OP_GetUndefined: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_size: + case opcode::OP_AddArray: + case opcode::OP_endon: + case opcode::OP_shift_left: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_Return: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetSelfObject: + case opcode::OP_GetGame: + case opcode::OP_EvalArray: + case opcode::OP_GetSelf: + case opcode::OP_End: + case opcode::OP_less_equal: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_checkclearparams: + case opcode::OP_waittillmatch2: + case opcode::OP_minus: + case opcode::OP_greater_equal: + case opcode::OP_vector: + case opcode::OP_ClearArray: + case opcode::OP_DecTop: + case opcode::OP_CastBool: + case opcode::OP_EvalArrayRef: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_waittill: + case opcode::OP_GetAnimObject: + case opcode::OP_mod: + case opcode::OP_clearparams: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_EmptyArray: + case opcode::OP_ClearVariableField: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_BoolComplement: + case opcode::OP_less: + case opcode::OP_BoolNot: + case opcode::OP_waittillFrameEnd: + case opcode::OP_waitframe: + case opcode::OP_GetLevelObject: + case opcode::OP_inc: + case opcode::OP_GetAnim: + case opcode::OP_SetVariableField: + case opcode::OP_divide: + case opcode::OP_multiply: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_bit_and: + case opcode::OP_voidCodepos: + case opcode::OP_inequality: + case opcode::OP_bit_ex_or: + case opcode::OP_BoolNotAfterAnd: + case opcode::OP_IsDefined: + case opcode::OP_IsTrue: + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + inst.data.push_back(fmt::format("{}", script_.read())); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + inst.data.push_back(fmt::format("{}", script_.read())); + break; + case opcode::OP_GetUnsignedInt: + case opcode::OP_GetNegUnsignedInt: + inst.data.push_back(fmt::format("{}", script_.read())); + break; + case opcode::OP_GetInteger: + inst.data.push_back(fmt::format("{}", script_.read())); + break; + case opcode::OP_GetInteger64: + inst.data.push_back(fmt::format("{}", script_.read())); + break; + case opcode::OP_GetFloat: + inst.data.push_back(utils::string::float_string(script_.read())); + break; + case opcode::OP_GetVector: + inst.size += script_.align((ctx_->endian() == endian::little) ? 1 : 4); + inst.data.push_back(utils::string::float_string(script_.read(), true)); + inst.data.push_back(utils::string::float_string(script_.read(), true)); + inst.data.push_back(utils::string::float_string(script_.read(), true)); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_.seek((ctx_->props() & props::str4) ? 4 : 2); + inst.data.push_back(decrypt_string(stack_.read_cstr())); + break; + case opcode::OP_GetAnimation: + script_.seek((ctx_->props() & props::str4) ? 8 : 4); + inst.data.push_back(decrypt_string(stack_.read_cstr())); + inst.data.push_back(decrypt_string(stack_.read_cstr())); + break; + case opcode::OP_GetAnimTree: + script_.seek(1); + inst.data.push_back(decrypt_string(stack_.read_cstr())); + break; + case opcode::OP_GetUnkxHash: // xhash : only used on unittests + inst.data.push_back(fmt::format("{:08X}", script_.read())); + break; + case opcode::OP_GetStatHash: // xhash : "kill" -> 0xEF9582D72160F199 + case opcode::OP_GetEnumHash: // xhash : "WEAPON/AMMO_SLUGS" -> 0x6AA606A18241AD16 c++ enum ?? + case opcode::OP_GetDvarHash: // xhash : #d"mapname" -> 0x687FB8F9B7A23245 + inst.data.push_back(fmt::format("{:016X}", script_.read())); + break; + case opcode::OP_waittillmatch: + inst.data.push_back(fmt::format("{}", script_.read())); + break; + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + inst.data.push_back(fmt::format("{}", script_.read())); + break; + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_SetNewLocalVariableFieldCached0: + inst.data.push_back((ctx_->props() & props::hash) ? ctx_->hash_name(script_.read()) : fmt::format("{}", script_.read())); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + disassemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + inst.data.push_back(fmt::format("{}", script_.read())); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + disassemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + disassemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + disassemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + disassemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + disassemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + disassemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + disassemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + disassemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + disassemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + disassemble_jump(inst, false, true); + break; + case opcode::OP_jump: + disassemble_jump(inst, false, false); + break; + case opcode::OP_switch: + disassemble_switch(inst); + break; + case opcode::OP_endswitch: + disassemble_end_switch(inst); + break; + case opcode::OP_FormalParams: + disassemble_formal_params(inst); + break; + default: + throw disasm_error(fmt::format("unhandled opcode {} at index {:04X}", opcode_name(inst.opcode), inst.index)); + } +} + +auto disassembler::disassemble_builtin_call(instruction& inst, bool method, bool args) -> void +{ + if (args) + { + inst.data.push_back(fmt::format("{}", script_.read())); + } + + if (ctx_->props() & props::hash) + { + auto name = stack_.read_cstr(); + + if (name.starts_with("#xS")) + { + name = ctx_->hash_name(std::stoull(name.substr(3), 0, 16)); + } + + script_.seek(2); + inst.data.emplace(inst.data.begin(), name); + } + else + { + auto const id = script_.read(); + auto const name = method ? ctx_->meth_name(id) : ctx_->func_name(id); + + inst.data.emplace(inst.data.begin(), name); + } +} + +auto disassembler::disassemble_local_call(instruction& inst, bool thread) -> void +{ + auto const offs = disassemble_offset(); + + inst.data.push_back(fmt::format("{}", inst.index + 1 + offs)); + + if (thread) + { + inst.data.push_back(fmt::format("{}", script_.read())); + } +} + +auto disassembler::disassemble_far_call(instruction& inst, bool thread) -> void +{ + if (ctx_->props() & props::farcall) + { + auto offs = script_.read(); + + if (thread) + { + inst.data.push_back(fmt::format("{}", script_.read())); + } + + auto file = stack_.read(); + auto name = stack_.read(); + + if (file == 0) + { + inst.data.emplace(inst.data.begin(), fmt::format("{}", inst.index + 1 + offs)); + inst.data.emplace(inst.data.begin(), ""); + } + else + { + auto path = ctx_->path_name(file); + + if (!path.starts_with("id_")) + { + path.resize(path.size() - 4); + } + + inst.data.emplace(inst.data.begin(), ctx_->hash_name(name)); + inst.data.emplace(inst.data.begin(), path); + } + } + else + { + script_.seek(3); + + if (thread) + { + inst.data.push_back(fmt::format("{}", script_.read())); + } + + auto const file_id = (ctx_->props() & props::tok4) ? stack_.read() : stack_.read(); + auto const file_name = file_id == 0 ? decrypt_string(stack_.read_cstr()) : ctx_->token_name(file_id); + auto const func_id = (ctx_->props() & props::tok4) ? stack_.read() : stack_.read(); + auto const func_name = func_id == 0 ? decrypt_string(stack_.read_cstr()) : ctx_->token_name(func_id); + + inst.data.emplace(inst.data.begin(), func_name); + inst.data.emplace(inst.data.begin(), file_name); + } +} + +auto disassembler::disassemble_switch(instruction& inst) -> void +{ + auto const addr = inst.index + 4 + script_.read(); + auto const label = fmt::format("loc_{:X}", addr); + + inst.data.push_back(label); + func_->labels.insert({ addr, label }); +} + +auto disassembler::disassemble_end_switch(instruction& inst) -> void +{ + auto const count = script_.read(); + + inst.data.push_back(fmt::format("{}", count)); + + auto type = switch_type::none; + auto index = inst.index + 3u; + + for (auto i = count; i > 0; i--) + { + if (ctx_->engine() == engine::iw9) + { + auto const data = script_.read(); + auto const offs = script_.read(); + script_.seek(1); + auto const byte = script_.read(); + + if (byte == 1) + { + inst.data.push_back("case"); + inst.data.push_back(fmt::format("{}", static_cast>(switch_type::integer))); + inst.data.push_back(fmt::format("{}", data)); + } + else if (byte == 2) + { + inst.data.push_back("case"); + inst.data.push_back(fmt::format("{}", static_cast>(switch_type::string))); + inst.data.push_back(stack_.read_cstr()); + } + else // byte == 0 + { + // default -> data = 0, byte = 0, i = 1 + inst.data.push_back("default"); + } + + auto const addr = index + 4 + offs; + auto const label = fmt::format("loc_{:X}", addr); + + inst.data.push_back(label); + func_->labels.insert({ addr, label }); + + index += 8; + inst.size += 8; + } + else + { + auto const value = script_.read(); + + if (value == 0) + { + inst.data.push_back("default"); + stack_.read_cstr(); // this should be always [0x01 0x00] unencrypted + } + else if (value < 0x100000) + { + if (type == switch_type::integer) + throw disasm_error("endswitch type mismatch"); + + type = switch_type::string; + inst.data.push_back("case"); + inst.data.push_back(decrypt_string(stack_.read_cstr())); + } + else + { + if (type == switch_type::string) + throw disasm_error("endswitch type mismatch"); + + type = switch_type::integer; + inst.data.push_back("case"); + inst.data.push_back(fmt::format("{}", (value - 0x800000) & 0xFFFFFF)); + } + + auto const addr = index + 4 + disassemble_offset(); + auto const label = fmt::format("loc_{:X}", addr); + + inst.data.push_back(label); + func_->labels.insert({ addr, label }); + + index += 7; + inst.size += 7; + } + } + + inst.data.push_back(fmt::format("{}", static_cast>(type))); +} + +auto disassembler::disassemble_field_variable(instruction& inst) -> void +{ + if (ctx_->props() & props::hash) + { + inst.data.push_back(ctx_->hash_name(script_.read())); + } + else + { + auto const id = (ctx_->props() & props::tok4) ? script_.read() : script_.read(); + auto name = std::string{}; + + if (id > ctx_->str_count()) + { + auto const temp = (ctx_->props() & props::tok4) ? stack_.read() : stack_.read(); + name = (temp == 0) ? decrypt_string(stack_.read_cstr()) : fmt::format("{}", temp); + } + else + { + name = ctx_->token_name(id); + } + + inst.data.push_back(name); + } +} + +auto disassembler::disassemble_formal_params(instruction& inst) -> void +{ + auto const count = script_.read(); + + inst.size += (ctx_->props() & props::hash) ? count * 8 : count; + inst.data.push_back(fmt::format("{}", count)); + + for (auto i = 0u; i < count; i++) + { + inst.data.push_back((ctx_->props() & props::hash) ? ctx_->hash_name(script_.read()) : fmt::format("{}", script_.read())); + } +} + +auto disassembler::disassemble_jump(instruction& inst, bool expr, bool back) -> void +{ + auto addr = i32{}; + + if (expr) + { + addr = inst.index + 3 + script_.read(); + } + else if (back) + { + addr = inst.index + 3 - script_.read(); + } + else + { + addr = inst.index + 5 + script_.read(); + } + + auto const label = fmt::format("loc_{:X}", addr); + + inst.data.push_back(label); + func_->labels.insert({ addr, label }); +} + +auto disassembler::disassemble_offset() -> i32 +{ + auto bytes = std::array{}; + + if (ctx_->endian() == endian::little) + { + bytes[0] = script_.read(); + bytes[1] = script_.read(); + bytes[2] = script_.read(); + } + else + { + bytes[2] = script_.read(); + bytes[1] = script_.read(); + bytes[0] = script_.read(); + } + + auto offs = *reinterpret_cast(bytes.data()); + + auto shift = (ctx_->props() & props::offs8) ? 8 : (ctx_->props() & props::offs9) ? 9 : 10; + + offs = (offs << 8) >> shift; + + return offs; +} + +auto disassembler::resolve_functions() -> void +{ + for (auto const& func : assembly_->functions) + { + for (auto const& inst : func->instructions) + { + switch (inst->opcode) + { + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + inst->data[0] = resolve_function(inst->data[0]); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + if ((ctx_->props() & props::farcall) && inst->data[0].empty()) + inst->data[1] = resolve_function(inst->data[1]); + break; + default: + break; + } + } + } +} + +auto disassembler::resolve_function(std::string const& index) -> std::string +{ + auto addr = static_cast(std::stoul(index)); + + for (auto const& entry : assembly_->functions) + { + if (entry->index == addr) + { + return entry->name; + } + } + + throw disasm_error(fmt::format("couldn't resolve function name at index 0x{}", index)); +} + +auto disassembler::decrypt_string(std::string const& str) -> std::string +{ + if (str.size() > 0 && ((static_cast(str[0]) & 0xC0) == 0x80)) + { + auto data = std::string{ "_encstr_" }; + + data.reserve(str.size() * 2); + + for (auto i = 0u; i < str.size(); i++) + { + data += fmt::format("{:02X}", static_cast(str[i])); + } + + return data; + } + + return std::move(str); +} + +} // namespace xsk::gsc diff --git a/src/gsc/disassembler.hpp b/src/gsc/disassembler.hpp new file mode 100644 index 00000000..b65bc703 --- /dev/null +++ b/src/gsc/disassembler.hpp @@ -0,0 +1,45 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "misc/types.hpp" +#include "utils/reader.hpp" + +namespace xsk::gsc +{ + +class disassembler +{ + context const* ctx_; + function::ptr func_; + assembly::ptr assembly_; + utils::reader script_; + utils::reader stack_; + +public: + disassembler(context const* ctx); + auto disassemble(buffer const& script, buffer const& stack) -> assembly::ptr; + auto disassemble(std::vector const& script, std::vector const& stack) -> assembly::ptr; + auto disassemble(u8 const* script, usize script_size, u8 const* stack, usize stack_size) -> assembly::ptr; + +private: + auto dissasemble_function(function& func) -> void; + auto dissasemble_instruction(instruction& inst) -> void; + auto disassemble_builtin_call(instruction& inst, bool method, bool args) -> void; + auto disassemble_local_call(instruction& inst, bool thread) -> void; + auto disassemble_far_call(instruction& inst, bool thread) -> void; + auto disassemble_switch(instruction& inst) -> void; + auto disassemble_end_switch(instruction& inst) -> void; + auto disassemble_field_variable(instruction& inst) -> void; + auto disassemble_formal_params(instruction& inst) -> void; + auto disassemble_jump(instruction& inst, bool expr, bool back) -> void; + auto disassemble_offset() -> i32; + auto resolve_functions() -> void; + auto resolve_function(std::string const& index) -> std::string; + auto decrypt_string(std::string const& str) -> std::string; +}; + +} // namespace xsk::gsc diff --git a/src/s4/xsk/lexer.cpp b/src/gsc/lexer.cpp similarity index 87% rename from src/s4/xsk/lexer.cpp rename to src/gsc/lexer.cpp index 62deebe8..ebcdc452 100644 --- a/src/s4/xsk/lexer.cpp +++ b/src/gsc/lexer.cpp @@ -1,22 +1,17 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" -#include "s4.hpp" -#include "parser.hpp" +#include "stdinc.hpp" #include "lexer.hpp" +#include "context.hpp" +#include "utils/string.hpp" -xsk::gsc::s4::parser::symbol_type S4lex(xsk::gsc::s4::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::gsc::s4 +namespace xsk::gsc { -const std::unordered_map keyword_map +std::unordered_map const keyword_map {{ { "#define", parser::token::SH_DEFINE }, { "#undef", parser::token::SH_UNDEF }, @@ -69,17 +64,22 @@ const std::unordered_map keywo { "istrue", parser::token::ISTRUE }, }}; -buffer::buffer() : length(0) +auto GSClex(lexer& lexer) -> parser::symbol_type +{ + return lexer.lex(); +} + +charbuf::charbuf() : length{ 0 } { data = static_cast(std::malloc(max_buf_size)); } -buffer::~buffer() +charbuf::~charbuf() { if (data) std::free(data); } -bool buffer::push(char c) +auto charbuf::push(char c) -> bool { if (length >= max_buf_size) return false; @@ -88,18 +88,17 @@ bool buffer::push(char c) return true; } -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) +reader::reader() : buffer_pos{ 0 }, bytes_remaining{ 0 }, last_byte{ 0 }, current_byte{ 0 }, state{ reader::end } { - } -void reader::init(const char* data, size_t size) +auto reader::init(char const* data, usize size) -> void { if (data && size) { state = reader::ok; buffer_pos = data; - bytes_remaining = static_cast(size); + bytes_remaining = static_cast(size); last_byte = 0; current_byte = *data; } @@ -113,7 +112,7 @@ void reader::init(const char* data, size_t size) } } -void reader::advance() +auto reader::advance() -> void { ++buffer_pos; @@ -131,20 +130,20 @@ void reader::advance() } } -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) +lexer::lexer(context const* ctx, std::string const& name, char const* data, usize size) + : ctx_{ ctx }, loc_{ location{ &name } }, locs_{ std::stack{} }, readers_{ std::stack{} }, header_top_{ 0 }, indev_{ false }, clean_{ true } { reader_.init(data, size); } -void lexer::push_header(const std::string& file) +auto lexer::push_header(std::string const& file) -> void { try { if (header_top_++ >= 10) throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - auto data = resolver::file_data(file + ".gsh"); + auto data = ctx_->header_file_data(file + ".gsh"); readers_.push(reader_); locs_.push(loc_); @@ -152,13 +151,13 @@ void lexer::push_header(const std::string& file) reader_.init(std::get<1>(data), std::get<2>(data)); clean_ = true; } - catch (const std::exception& e) + catch (std::exception const& e) { - throw error("parsing header file '" + file + "': " + e.what()); + throw error(fmt::format("parsing header file '{}': {}", file, e.what())); } } -void lexer::pop_header() +auto lexer::pop_header() -> void { header_top_--; loc_ = locs_.top(); @@ -167,7 +166,7 @@ void lexer::pop_header() readers_.pop(); } -void lexer::ban_header(const location& loc) +auto lexer::ban_header(location const& loc) -> void { if (header_top_ > 0) { @@ -182,7 +181,7 @@ auto lexer::lex() -> parser::symbol_type while (true) { - const auto& state = reader_.state; + auto const& state = reader_.state; auto& last = reader_.last_byte; auto& curr = reader_.current_byte; auto path = false; @@ -196,7 +195,7 @@ auto lexer::lex() -> parser::symbol_type if (header_top_ > 0) pop_header(); else - return parser::make_S4EOF(loc_); + return parser::make_GSCEOF(loc_); } if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') @@ -232,7 +231,7 @@ auto lexer::lex() -> parser::symbol_type if (indev_) throw comp_error(loc_, "cannot recurse devblock ('/#')"); - if (mode_ == build::dev) + if (ctx_->build() == build::dev) { indev_ = true; return parser::make_DEVBEGIN(loc_); @@ -487,7 +486,7 @@ auto lexer::lex() -> parser::symbol_type 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)); + throw comp_error(loc_, fmt::format("bad token: '{}'", last)); } lex_string: @@ -533,9 +532,9 @@ lex_string: } if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); + return parser::make_ISTRING(std::string{ buffer_.data, buffer_.length }, loc_); - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); + return parser::make_STRING(std::string{ buffer_.data, buffer_.length }, loc_); lex_name: buffer_.push(last); @@ -565,11 +564,11 @@ lex_name: if (state_ == state::preprocessor) { - auto token = parser::token::S4UNDEF; + auto token = parser::token::GSCUNDEF; if (buffer_.length < 16) { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); + auto const itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); if (itr != keyword_map.end()) { @@ -600,10 +599,25 @@ lex_name: if (buffer_.length < 17) { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); + auto const itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); if (itr != keyword_map.end()) - return parser::symbol_type(itr->second, loc_); + { + if (itr->second == parser::token::WAITFRAME) + { + if (ctx_->props() & props::waitframe) + return parser::symbol_type(itr->second, loc_); + } + else if (itr->second == parser::token::ISDEFINED || itr->second == parser::token::ISTRUE) + { + if (ctx_->props() & props::boolfuncs) + return parser::symbol_type(itr->second, loc_); + } + else + { + return parser::symbol_type(itr->second, loc_); + } + } } if (path) @@ -611,10 +625,10 @@ lex_name: 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_); + return parser::make_PATH(ctx_->make_token(std::string_view(buffer_.data, buffer_.length)), loc_); } - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); + return parser::make_IDENTIFIER(ctx_->make_token(std::string_view(buffer_.data, buffer_.length)), loc_); } lex_number: @@ -662,9 +676,9 @@ lex_number: throw comp_error(loc_, "invalid number literal"); if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); + return parser::make_FLOAT(std::string{ buffer_.data, buffer_.length }, loc_); - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); + return parser::make_INTEGER(std::string{ buffer_.data, buffer_.length }, loc_); } else if (curr == 'o') { @@ -688,7 +702,7 @@ lex_number: break; if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); + throw error("gsc lexer: out of memory"); advance(); } @@ -756,7 +770,7 @@ lex_number: break; if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); + throw error("gsc lexer: out of memory"); advance(); } @@ -767,11 +781,11 @@ lex_number: return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); } - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); + throw error("UNEXPECTED LEXER INTERNAL ERROR"); } } -void lexer::advance() +auto lexer::advance() -> void { reader_.advance(); loc_.end.column++; @@ -780,7 +794,7 @@ void lexer::advance() preprocessor_wrap(); } -void lexer::preprocessor_wrap() +auto lexer::preprocessor_wrap() -> void { while (reader_.current_byte == '\\') { @@ -823,7 +837,7 @@ void lexer::preprocessor_wrap() } } -void lexer::preprocessor_run(parser::token::token_kind_type token) +auto lexer::preprocessor_run(parser::token::token_kind_type token) -> void { if (!clean_) throw comp_error(loc_, "invalid token ('#')"); @@ -859,4 +873,4 @@ void lexer::preprocessor_run(parser::token::token_kind_type token) } } -} // namespace xsk::gsc::s4 +} // namespace xsk::gsc diff --git a/src/gsc/lexer.hpp b/src/gsc/lexer.hpp new file mode 100644 index 00000000..02daf702 --- /dev/null +++ b/src/gsc/lexer.hpp @@ -0,0 +1,81 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "misc/types.hpp" +#include "parser.hpp" + +namespace xsk::gsc +{ + +constexpr usize max_buf_size = 0x2000; + +struct charbuf +{ + char* data; + usize length; + + charbuf(); + ~charbuf(); + auto push(char c) -> bool; +}; + +struct reader +{ + enum state_type : u8 { end, ok }; + + char const* buffer_pos; + u32 bytes_remaining; + char last_byte; + char current_byte; + state_type state; + + reader(); + + reader(reader const& obj) + { + std::memcpy(this, &obj, sizeof(reader)); + } + + reader& operator=(reader const& obj) + { + std::memcpy(this, &obj, sizeof(reader)); + return *this; + } + + auto init(char const* data, usize size) -> void; + auto advance() -> void; +}; + +class lexer +{ + enum class state : u8 { start, string, localize, preprocessor }; + + context const* ctx_; + reader reader_; + charbuf buffer_; + location loc_; + std::stack locs_; + std::stack readers_; + u32 header_top_; + state state_; + bool indev_; + bool clean_; + +public: + lexer(context const* ctx, std::string const& name, char const* data, usize size); + auto lex() -> parser::symbol_type; + auto push_header(std::string const& file) -> void; + auto pop_header() -> void; + auto ban_header(location const& loc) -> void; + +private: + auto advance() -> void; + auto preprocessor_wrap() -> void; + auto preprocessor_run(parser::token::token_kind_type token) -> void; +}; + +} // namespace xsk::gsc diff --git a/src/gsc/misc/assembly.cpp b/src/gsc/misc/assembly.cpp new file mode 100644 index 00000000..5ea7d2bc --- /dev/null +++ b/src/gsc/misc/assembly.cpp @@ -0,0 +1,267 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "assembly.hpp" + +namespace xsk::gsc +{ + +std::array, opcode_count> const opcode_list +{{ + { opcode::vm_invalid, "vm_invalid" }, + { opcode::OP_CastFieldObject, "OP_CastFieldObject" }, + { opcode::OP_SetLocalVariableFieldCached, "OP_SetLocalVariableFieldCached" }, + { opcode::OP_plus, "OP_plus" }, + { opcode::OP_RemoveLocalVariables, "OP_RemoveLocalVariables" }, + { opcode::OP_EvalSelfFieldVariableRef, "OP_EvalSelfFieldVariableRef" }, + { opcode::OP_ScriptFarMethodChildThreadCall, "OP_ScriptFarMethodChildThreadCall" }, + { opcode::OP_GetGameRef, "OP_GetGameRef" }, + { opcode::OP_EvalAnimFieldVariable, "OP_EvalAnimFieldVariable" }, + { opcode::OP_EvalLevelFieldVariableRef, "OP_EvalLevelFieldVariableRef" }, + { opcode::OP_GetThisthread, "OP_GetThisthread" }, + { opcode::OP_greater, "OP_greater" }, + { opcode::OP_waittillmatch, "OP_waittillmatch" }, + { opcode::OP_shift_right, "OP_shift_right" }, + { opcode::OP_dec, "OP_dec" }, + { opcode::OP_JumpOnTrue, "OP_JumpOnTrue" }, + { opcode::OP_bit_or, "OP_bit_or" }, + { opcode::OP_equality, "OP_equality" }, + { opcode::OP_ClearLocalVariableFieldCached0, "OP_ClearLocalVariableFieldCached0" }, + { opcode::OP_notify, "OP_notify" }, + { opcode::OP_GetVector, "OP_GetVector" }, + { opcode::OP_ScriptMethodChildThreadCallPointer, "OP_ScriptMethodChildThreadCallPointer" }, + { opcode::OP_PreScriptCall, "OP_PreScriptCall" }, + { opcode::OP_GetByte, "OP_GetByte" }, + { opcode::OP_ScriptFarThreadCall, "OP_ScriptFarThreadCall" }, + { opcode::OP_SetSelfFieldVariableField, "OP_SetSelfFieldVariableField" }, + { opcode::OP_JumpOnFalseExpr, "OP_JumpOnFalseExpr" }, + { opcode::OP_GetUndefined, "OP_GetUndefined" }, + { opcode::OP_jumpback, "OP_jumpback" }, + { opcode::OP_JumpOnTrueExpr, "OP_JumpOnTrueExpr" }, + { opcode::OP_CallBuiltin0, "OP_CallBuiltin0" }, + { opcode::OP_CallBuiltin1, "OP_CallBuiltin1" }, + { opcode::OP_CallBuiltin2, "OP_CallBuiltin2" }, + { opcode::OP_CallBuiltin3, "OP_CallBuiltin3" }, + { opcode::OP_CallBuiltin4, "OP_CallBuiltin4" }, + { opcode::OP_CallBuiltin5, "OP_CallBuiltin5" }, + { opcode::OP_CallBuiltin, "OP_CallBuiltin" }, + { opcode::OP_SetLocalVariableFieldCached0, "OP_SetLocalVariableFieldCached0" }, + { opcode::OP_ClearFieldVariable, "OP_ClearFieldVariable" }, + { opcode::OP_GetLevel, "OP_GetLevel" }, + { opcode::OP_size, "OP_size" }, + { opcode::OP_SafeSetWaittillVariableFieldCached, "OP_SafeSetWaittillVariableFieldCached" }, + { opcode::OP_ScriptLocalMethodThreadCall, "OP_ScriptLocalMethodThreadCall" }, + { opcode::OP_AddArray, "OP_AddArray" }, + { opcode::OP_endon, "OP_endon" }, + { opcode::OP_EvalFieldVariable, "OP_EvalFieldVariable" }, + { opcode::OP_shift_left, "OP_shift_left" }, + { opcode::OP_EvalLocalArrayRefCached0, "OP_EvalLocalArrayRefCached0" }, + { opcode::OP_Return, "OP_Return" }, + { opcode::OP_CreateLocalVariable, "OP_CreateLocalVariable" }, + { opcode::OP_SafeSetVariableFieldCached0, "OP_SafeSetVariableFieldCached0" }, + { opcode::OP_GetBuiltinFunction, "OP_GetBuiltinFunction" }, + { opcode::OP_ScriptLocalMethodCall, "OP_ScriptLocalMethodCall" }, + { opcode::OP_CallBuiltinMethodPointer, "OP_CallBuiltinMethodPointer" }, + { opcode::OP_ScriptLocalChildThreadCall, "OP_ScriptLocalChildThreadCall" }, + { opcode::OP_GetSelfObject, "OP_GetSelfObject" }, + { opcode::OP_GetGame, "OP_GetGame" }, + { opcode::OP_SetLevelFieldVariableField, "OP_SetLevelFieldVariableField" }, + { opcode::OP_EvalArray, "OP_EvalArray" }, + { opcode::OP_GetSelf, "OP_GetSelf" }, + { opcode::OP_End, "OP_End" }, + { opcode::OP_EvalSelfFieldVariable, "OP_EvalSelfFieldVariable" }, + { opcode::OP_less_equal, "OP_less_equal" }, + { opcode::OP_EvalLocalVariableCached0, "OP_EvalLocalVariableCached0" }, + { opcode::OP_EvalLocalVariableCached1, "OP_EvalLocalVariableCached1" }, + { opcode::OP_EvalLocalVariableCached2, "OP_EvalLocalVariableCached2" }, + { opcode::OP_EvalLocalVariableCached3, "OP_EvalLocalVariableCached3" }, + { opcode::OP_EvalLocalVariableCached4, "OP_EvalLocalVariableCached4" }, + { opcode::OP_EvalLocalVariableCached5, "OP_EvalLocalVariableCached5" }, + { opcode::OP_EvalLocalVariableCached, "OP_EvalLocalVariableCached" }, + { opcode::OP_EvalNewLocalArrayRefCached0, "OP_EvalNewLocalArrayRefCached0" }, + { opcode::OP_ScriptChildThreadCallPointer, "OP_ScriptChildThreadCallPointer" }, + { opcode::OP_EvalLocalVariableObjectCached, "OP_EvalLocalVariableObjectCached" }, + { opcode::OP_ScriptLocalThreadCall, "OP_ScriptLocalThreadCall" }, + { opcode::OP_GetInteger, "OP_GetInteger" }, + { opcode::OP_ScriptMethodCallPointer, "OP_ScriptMethodCallPointer" }, + { opcode::OP_checkclearparams, "OP_checkclearparams" }, + { opcode::OP_SetAnimFieldVariableField, "OP_SetAnimFieldVariableField" }, + { opcode::OP_waittillmatch2, "OP_waittillmatch2" }, + { opcode::OP_minus, "OP_minus" }, + { opcode::OP_ScriptLocalFunctionCall2, "OP_ScriptLocalFunctionCall2" }, + { opcode::OP_GetNegUnsignedShort, "OP_GetNegUnsignedShort" }, + { opcode::OP_GetNegByte, "OP_GetNegByte" }, + { opcode::OP_SafeCreateVariableFieldCached, "OP_SafeCreateVariableFieldCached" }, + { opcode::OP_greater_equal, "OP_greater_equal" }, + { opcode::OP_vector, "OP_vector" }, + { opcode::OP_GetBuiltinMethod, "OP_GetBuiltinMethod" }, + { opcode::OP_endswitch, "OP_endswitch" }, + { opcode::OP_ClearArray, "OP_ClearArray" }, + { opcode::OP_DecTop, "OP_DecTop" }, + { opcode::OP_CastBool, "OP_CastBool" }, + { opcode::OP_EvalArrayRef, "OP_EvalArrayRef" }, + { opcode::OP_SetNewLocalVariableFieldCached0, "OP_SetNewLocalVariableFieldCached0" }, + { opcode::OP_GetZero, "OP_GetZero" }, + { opcode::OP_wait, "OP_wait" }, + { opcode::OP_waittill, "OP_waittill" }, + { opcode::OP_GetIString, "OP_GetIString" }, + { opcode::OP_ScriptFarFunctionCall, "OP_ScriptFarFunctionCall" }, + { opcode::OP_GetAnimObject, "OP_GetAnimObject" }, + { opcode::OP_GetAnimTree, "OP_GetAnimTree" }, + { opcode::OP_EvalLocalArrayCached, "OP_EvalLocalArrayCached" }, + { opcode::OP_mod, "OP_mod" }, + { opcode::OP_ScriptFarMethodThreadCall, "OP_ScriptFarMethodThreadCall" }, + { opcode::OP_GetUnsignedShort, "OP_GetUnsignedShort" }, + { opcode::OP_clearparams, "OP_clearparams" }, + { opcode::OP_ScriptMethodThreadCallPointer, "OP_ScriptMethodThreadCallPointer" }, + { opcode::OP_ScriptFunctionCallPointer, "OP_ScriptFunctionCallPointer" }, + { opcode::OP_EmptyArray, "OP_EmptyArray" }, + { opcode::OP_SafeSetVariableFieldCached, "OP_SafeSetVariableFieldCached" }, + { opcode::OP_ClearVariableField, "OP_ClearVariableField" }, + { opcode::OP_EvalFieldVariableRef, "OP_EvalFieldVariableRef" }, + { opcode::OP_ScriptLocalMethodChildThreadCall, "OP_ScriptLocalMethodChildThreadCall" }, + { opcode::OP_EvalNewLocalVariableRefCached0, "OP_EvalNewLocalVariableRefCached0" }, + { opcode::OP_GetFloat, "OP_GetFloat" }, + { opcode::OP_EvalLocalVariableRefCached, "OP_EvalLocalVariableRefCached" }, + { opcode::OP_JumpOnFalse, "OP_JumpOnFalse" }, + { opcode::OP_BoolComplement, "OP_BoolComplement" }, + { opcode::OP_ScriptThreadCallPointer, "OP_ScriptThreadCallPointer" }, + { opcode::OP_ScriptFarFunctionCall2, "OP_ScriptFarFunctionCall2" }, + { opcode::OP_less, "OP_less" }, + { opcode::OP_BoolNot, "OP_BoolNot" }, + { opcode::OP_waittillFrameEnd, "OP_waittillFrameEnd" }, + { opcode::OP_waitframe, "OP_waitframe" }, + { opcode::OP_GetString, "OP_GetString" }, + { opcode::OP_EvalLevelFieldVariable, "OP_EvalLevelFieldVariable" }, + { opcode::OP_GetLevelObject, "OP_GetLevelObject" }, + { opcode::OP_inc, "OP_inc" }, + { opcode::OP_CallBuiltinMethod0, "OP_CallBuiltinMethod0" }, + { opcode::OP_CallBuiltinMethod1, "OP_CallBuiltinMethod1" }, + { opcode::OP_CallBuiltinMethod2, "OP_CallBuiltinMethod2" }, + { opcode::OP_CallBuiltinMethod3, "OP_CallBuiltinMethod3" }, + { opcode::OP_CallBuiltinMethod4, "OP_CallBuiltinMethod4" }, + { opcode::OP_CallBuiltinMethod5, "OP_CallBuiltinMethod5" }, + { opcode::OP_CallBuiltinMethod, "OP_CallBuiltinMethod" }, + { opcode::OP_GetAnim, "OP_GetAnim" }, + { opcode::OP_switch, "OP_switch" }, + { opcode::OP_SetVariableField, "OP_SetVariableField" }, + { opcode::OP_divide, "OP_divide" }, + { opcode::OP_GetLocalFunction, "OP_GetLocalFunction" }, + { opcode::OP_ScriptFarChildThreadCall, "OP_ScriptFarChildThreadCall" }, + { opcode::OP_multiply, "OP_multiply" }, + { opcode::OP_ClearLocalVariableFieldCached, "OP_ClearLocalVariableFieldCached" }, + { opcode::OP_EvalAnimFieldVariableRef, "OP_EvalAnimFieldVariableRef" }, + { opcode::OP_EvalLocalArrayRefCached, "OP_EvalLocalArrayRefCached" }, + { opcode::OP_EvalLocalVariableRefCached0, "OP_EvalLocalVariableRefCached0" }, + { opcode::OP_bit_and, "OP_bit_and" }, + { opcode::OP_GetAnimation, "OP_GetAnimation" }, + { opcode::OP_GetFarFunction, "OP_GetFarFunction" }, + { opcode::OP_CallBuiltinPointer, "OP_CallBuiltinPointer" }, + { opcode::OP_jump, "OP_jump" }, + { opcode::OP_voidCodepos, "OP_voidCodepos" }, + { opcode::OP_ScriptFarMethodCall, "OP_ScriptFarMethodCall" }, + { opcode::OP_inequality, "OP_inequality" }, + { opcode::OP_ScriptLocalFunctionCall, "OP_ScriptLocalFunctionCall" }, + { opcode::OP_bit_ex_or, "OP_bit_ex_or" }, + { opcode::OP_NOP, "OP_NOP" }, + { opcode::OP_abort, "OP_abort" }, + { opcode::OP_object, "OP_object" }, + { opcode::OP_thread_object, "OP_thread_object" }, + { opcode::OP_EvalLocalVariable, "OP_EvalLocalVariable" }, + { opcode::OP_EvalLocalVariableRef, "OP_EvalLocalVariableRef" }, + { opcode::OP_prof_begin, "OP_prof_begin" }, + { opcode::OP_prof_end, "OP_prof_end" }, + { opcode::OP_breakpoint, "OP_breakpoint" }, + { opcode::OP_assignmentBreakpoint, "OP_assignmentBreakpoint" }, + { opcode::OP_manualAndAssignmentBreakpoint, "OP_manualAndAssignmentBreakpoint" }, + { opcode::OP_BoolNotAfterAnd, "OP_BoolNotAfterAnd" }, + { opcode::OP_FormalParams, "OP_FormalParams" }, + { opcode::OP_IsDefined, "OP_IsDefined" }, + { opcode::OP_IsTrue, "OP_IsTrue" }, + { opcode::OP_NativeGetLocalFunction, "OP_NativeGetLocalFunction" }, + { opcode::OP_NativeLocalFunctionCall, "OP_NativeLocalFunctionCall" }, + { opcode::OP_NativeLocalFunctionCall2, "OP_NativeLocalFunctionCall2" }, + { opcode::OP_NativeLocalMethodCall, "OP_NativeLocalMethodCall" }, + { opcode::OP_NativeLocalFunctionThreadCall, "OP_NativeLocalFunctionThreadCall" }, + { opcode::OP_NativeLocalMethodThreadCall, "OP_NativeLocalMethodThreadCall" }, + { opcode::OP_NativeLocalFunctionChildThreadCall, "OP_NativeLocalFunctionChildThreadCall" }, + { opcode::OP_NativeLocalMethodChildThreadCall, "OP_NativeLocalMethodChildThreadCall" }, + { opcode::OP_NativeGetFarFunction, "OP_NativeGetFarFunction" }, + { opcode::OP_NativeFarFunctionCall, "OP_NativeFarFunctionCall" }, + { opcode::OP_NativeFarFunctionCall2, "OP_NativeFarFunctionCall2" }, + { opcode::OP_NativeFarMethodCall, "OP_NativeFarMethodCall" }, + { opcode::OP_NativeFarFunctionThreadCall, "OP_NativeFarFunctionThreadCall" }, + { opcode::OP_NativeFarMethodThreadCall, "OP_NativeFarMethodThreadCall" }, + { opcode::OP_NativeFarFunctionChildThreadCall, "OP_NativeFarFunctionChildThreadCall" }, + { opcode::OP_NativeFarMethodChildThreadCall, "OP_NativeFarMethodChildThreadCall" }, + { opcode::OP_EvalNewLocalArrayRefCached0_Precompiled, "OP_EvalNewLocalArrayRefCached0_Precompiled" }, + { opcode::OP_SetNewLocalVariableFieldCached0_Precompiled, "OP_SetNewLocalVariableFieldCached0_Precompiled" }, + { opcode::OP_CreateLocalVariable_Precompiled, "OP_CreateLocalVariable_Precompiled" }, + { opcode::OP_SafeCreateVariableFieldCached_Precompiled, "OP_SafeCreateVariableFieldCached_Precompiled" }, + { opcode::OP_FormalParams_Precompiled, "OP_FormalParams_Precompiled" }, + { opcode::OP_GetStatHash, "OP_GetStatHash" }, + { opcode::OP_GetUnkxHash, "OP_GetUnkxHash" }, + { opcode::OP_GetEnumHash, "OP_GetEnumHash" }, + { opcode::OP_GetDvarHash, "OP_GetDvarHash" }, + { opcode::OP_GetUnsignedInt, "OP_GetUnsignedInt" }, + { opcode::OP_GetNegUnsignedInt, "OP_GetNegUnsignedInt" }, + { opcode::OP_GetInteger64, "OP_GetInteger64" }, + { opcode::OP_iw9_139, "OP_iw9_139" }, + { opcode::OP_iw9_140, "OP_iw9_140" }, + { opcode::OP_iw9_141, "OP_iw9_141" }, + { opcode::OP_iw9_142, "OP_iw9_142" }, + { opcode::OP_iw9_143, "OP_iw9_143" }, + { opcode::OP_iw9_144, "OP_iw9_144" }, + { opcode::OP_iw9_166, "OP_iw9_166" }, +}}; + +std::unordered_map opcode_map; +std::unordered_map opcode_map_rev; + +auto opcode_name(opcode op) -> std::string +{ + auto const itr = opcode_map.find(op); + + if (itr != opcode_map.end()) + { + return std::string{ itr->second }; + } + + throw std::runtime_error(fmt::format("couldn't resolve opcode string for enum '{}'", static_cast>(op))); +} + +auto opcode_enum(std::string const& name) -> opcode +{ + auto const itr = opcode_map_rev.find(name); + + if (itr != opcode_map_rev.end()) + { + return itr->second; + } + + throw std::runtime_error(fmt::format("couldn't resolve opcode enum for name '{}'", name)); +} + +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 (auto const& entry : opcode_list) + { + opcode_map.insert({ entry.first, entry.second }); + opcode_map_rev.insert({ entry.second, entry.first }); + } + } +} _; + +} // namespace xsk::gsc diff --git a/src/gsc/misc/assembly.hpp b/src/gsc/misc/assembly.hpp new file mode 100644 index 00000000..6e1d8a2b --- /dev/null +++ b/src/gsc/misc/assembly.hpp @@ -0,0 +1,270 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +constexpr usize opcode_count = 205; + +enum class opcode : u8 +{ + vm_invalid, + OP_CastFieldObject, + OP_SetLocalVariableFieldCached, + OP_plus, + OP_RemoveLocalVariables, + OP_EvalSelfFieldVariableRef, + OP_ScriptFarMethodChildThreadCall, + OP_GetGameRef, + OP_EvalAnimFieldVariable, + OP_EvalLevelFieldVariableRef, + OP_GetThisthread, + OP_greater, + OP_waittillmatch, + OP_shift_right, + OP_dec, + OP_JumpOnTrue, + OP_bit_or, + OP_equality, + OP_ClearLocalVariableFieldCached0, + OP_notify, + OP_GetVector, + OP_ScriptMethodChildThreadCallPointer, + OP_PreScriptCall, + OP_GetByte, + OP_ScriptFarThreadCall, + OP_SetSelfFieldVariableField, + OP_JumpOnFalseExpr, + OP_GetUndefined, + OP_jumpback, + OP_JumpOnTrueExpr, + OP_CallBuiltin0, + OP_CallBuiltin1, + OP_CallBuiltin2, + OP_CallBuiltin3, + OP_CallBuiltin4, + OP_CallBuiltin5, + OP_CallBuiltin, + OP_SetLocalVariableFieldCached0, + OP_ClearFieldVariable, + OP_GetLevel, + OP_size, + OP_SafeSetWaittillVariableFieldCached, + OP_ScriptLocalMethodThreadCall, + OP_AddArray, + OP_endon, + OP_EvalFieldVariable, + OP_shift_left, + OP_EvalLocalArrayRefCached0, + OP_Return, + OP_CreateLocalVariable, + OP_SafeSetVariableFieldCached0, + OP_GetBuiltinFunction, + OP_ScriptLocalMethodCall, + OP_CallBuiltinMethodPointer, + OP_ScriptLocalChildThreadCall, + OP_GetSelfObject, + OP_GetGame, + OP_SetLevelFieldVariableField, + OP_EvalArray, + OP_GetSelf, + OP_End, + OP_EvalSelfFieldVariable, + OP_less_equal, + OP_EvalLocalVariableCached0, + OP_EvalLocalVariableCached1, + OP_EvalLocalVariableCached2, + OP_EvalLocalVariableCached3, + OP_EvalLocalVariableCached4, + OP_EvalLocalVariableCached5, + OP_EvalLocalVariableCached, + OP_EvalNewLocalArrayRefCached0, + OP_ScriptChildThreadCallPointer, + OP_EvalLocalVariableObjectCached, + OP_ScriptLocalThreadCall, + OP_GetInteger, + OP_ScriptMethodCallPointer, + OP_checkclearparams, + OP_SetAnimFieldVariableField, + OP_waittillmatch2, + OP_minus, + OP_ScriptLocalFunctionCall2, + OP_GetNegUnsignedShort, + OP_GetNegByte, + OP_SafeCreateVariableFieldCached, + OP_greater_equal, + OP_vector, + OP_GetBuiltinMethod, + OP_endswitch, + OP_ClearArray, + OP_DecTop, + OP_CastBool, + OP_EvalArrayRef, + OP_SetNewLocalVariableFieldCached0, + OP_GetZero, + OP_wait, + OP_waittill, + OP_GetIString, + OP_ScriptFarFunctionCall, + OP_GetAnimObject, + OP_GetAnimTree, + OP_EvalLocalArrayCached, + OP_mod, + OP_ScriptFarMethodThreadCall, + OP_GetUnsignedShort, + OP_clearparams, + OP_ScriptMethodThreadCallPointer, + OP_ScriptFunctionCallPointer, + OP_EmptyArray, + OP_SafeSetVariableFieldCached, + OP_ClearVariableField, + OP_EvalFieldVariableRef, + OP_ScriptLocalMethodChildThreadCall, + OP_EvalNewLocalVariableRefCached0, + OP_GetFloat, + OP_EvalLocalVariableRefCached, + OP_JumpOnFalse, + OP_BoolComplement, + OP_ScriptThreadCallPointer, + OP_ScriptFarFunctionCall2, + OP_less, + OP_BoolNot, + OP_waittillFrameEnd, + OP_waitframe, + OP_GetString, + OP_EvalLevelFieldVariable, + OP_GetLevelObject, + OP_inc, + OP_CallBuiltinMethod0, + OP_CallBuiltinMethod1, + OP_CallBuiltinMethod2, + OP_CallBuiltinMethod3, + OP_CallBuiltinMethod4, + OP_CallBuiltinMethod5, + OP_CallBuiltinMethod, + OP_GetAnim, + OP_switch, + OP_SetVariableField, + OP_divide, + OP_GetLocalFunction, + OP_ScriptFarChildThreadCall, + OP_multiply, + OP_ClearLocalVariableFieldCached, + OP_EvalAnimFieldVariableRef, + OP_EvalLocalArrayRefCached, + OP_EvalLocalVariableRefCached0, + OP_bit_and, + OP_GetAnimation, + OP_GetFarFunction, + OP_CallBuiltinPointer, + OP_jump, + OP_voidCodepos, + OP_ScriptFarMethodCall, + OP_inequality, + OP_ScriptLocalFunctionCall, + OP_bit_ex_or, + OP_NOP, + OP_abort, + OP_object, + OP_thread_object, + OP_EvalLocalVariable, + OP_EvalLocalVariableRef, + OP_prof_begin, + OP_prof_end, + OP_breakpoint, + OP_assignmentBreakpoint, + OP_manualAndAssignmentBreakpoint, + OP_BoolNotAfterAnd, + OP_FormalParams, + OP_IsDefined, + OP_IsTrue, + OP_NativeGetLocalFunction, + OP_NativeLocalFunctionCall, + OP_NativeLocalFunctionCall2, + OP_NativeLocalMethodCall, + OP_NativeLocalFunctionThreadCall, + OP_NativeLocalMethodThreadCall, + OP_NativeLocalFunctionChildThreadCall, + OP_NativeLocalMethodChildThreadCall, + OP_NativeGetFarFunction, + OP_NativeFarFunctionCall, + OP_NativeFarFunctionCall2, + OP_NativeFarMethodCall, + OP_NativeFarFunctionThreadCall, + OP_NativeFarMethodThreadCall, + OP_NativeFarFunctionChildThreadCall, + OP_NativeFarMethodChildThreadCall, + OP_EvalNewLocalArrayRefCached0_Precompiled, + OP_SetNewLocalVariableFieldCached0_Precompiled, + OP_CreateLocalVariable_Precompiled, + OP_SafeCreateVariableFieldCached_Precompiled, + OP_FormalParams_Precompiled, + OP_GetStatHash, + OP_GetUnkxHash, + OP_GetEnumHash, + OP_GetDvarHash, + OP_GetUnsignedInt, + OP_GetNegUnsignedInt, + OP_GetInteger64, + OP_iw9_139, + OP_iw9_140, + OP_iw9_141, + OP_iw9_142, + OP_iw9_143, + OP_iw9_144, + OP_iw9_166, + OP_count, +}; + +struct instruction +{ + using ptr = std::unique_ptr; + + u32 index; + u32 size; + opcode opcode; + std::vector data; +}; + +struct function +{ + using ptr = std::unique_ptr; + + u32 index; + u32 size; + u32 id; + std::string name; + std::vector instructions; + std::unordered_map labels; +}; + +struct assembly +{ + using ptr = std::unique_ptr; + + std::vector functions; +}; + +inline auto make_instruction() -> std::unique_ptr +{ + return std::unique_ptr(new instruction); +} + +inline auto make_function() -> std::unique_ptr +{ + return std::unique_ptr(new function); +} + +inline auto make_assembly() -> std::unique_ptr +{ + return std::unique_ptr(new assembly); +} + +auto opcode_name(opcode op) -> std::string; +auto opcode_enum(std::string const& name) -> opcode; + +} // namespace xsk::gsc diff --git a/src/gsc/misc/asset.cpp b/src/gsc/misc/asset.cpp new file mode 100644 index 00000000..38bfc377 --- /dev/null +++ b/src/gsc/misc/asset.cpp @@ -0,0 +1,75 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "asset.hpp" + +namespace xsk::gsc +{ + +auto asset::serialize() -> std::vector +{ + auto data = std::vector{}; + + if ((compressedLen != buffer.size() || (compressedLen == 0 && len != buffer.size())) || bytecodeLen != bytecode.size()) + { + throw std::runtime_error("script file serialize error"); + } + + data.resize(name.size() + (compressedLen ? compressedLen : len) + bytecodeLen + 13); + std::memset(data.data(), 0, data.size()); + + auto pos = usize{ 0 }; + + std::memcpy(&data[pos], name.data(), name.size() + 1); + pos += name.size() + 1; + + *reinterpret_cast(&data[pos]) = compressedLen; + pos += 4; + + *reinterpret_cast(&data[pos]) = len; + pos += 4; + + *reinterpret_cast(&data[pos]) = bytecodeLen; + pos += 4; + + std::memcpy(&data[pos], buffer.data(), buffer.size()); + pos += buffer.size(); + + std::memcpy(&data[pos], bytecode.data(), bytecode.size()); + + return data; +} + +auto asset::deserialize(std::vector const& data) -> void +{ + auto pos = usize{ 0 }; + + name = std::string{ reinterpret_cast(data.data()) }; + pos += name.size() + 1; + + compressedLen = *reinterpret_cast(data.data() + pos); + pos += 4; + + len = *reinterpret_cast(data.data() + pos); + pos += 4; + + bytecodeLen = *reinterpret_cast(data.data() + pos); + pos += 4; + + if ((compressedLen + bytecodeLen + name.size() + 13) != data.size()) + { + throw std::runtime_error("script file deserialize error"); + } + + buffer.resize(compressedLen); + std::memcpy(buffer.data(), data.data() + pos, compressedLen); + pos += buffer.size(); + + bytecode.resize(bytecodeLen); + std::memcpy(bytecode.data(), data.data() + pos, bytecodeLen); +} + +} // namespace xsk::gsc diff --git a/src/gsc/misc/asset.hpp b/src/gsc/misc/asset.hpp new file mode 100644 index 00000000..c20fd619 --- /dev/null +++ b/src/gsc/misc/asset.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +struct asset +{ + using ptr = std::unique_ptr; + + std::string name; + u32 compressedLen; + u32 len; + u32 bytecodeLen; + std::vector buffer; + std::vector bytecode; + + auto serialize() -> std::vector; + auto deserialize(std::vector const& data) -> void; +}; + +} // namespace xsk::gsc diff --git a/src/gsc/misc/ast.cpp b/src/gsc/misc/ast.cpp new file mode 100644 index 00000000..3de96147 --- /dev/null +++ b/src/gsc/misc/ast.cpp @@ -0,0 +1,1070 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "location.hpp" +#include "ast.hpp" + +namespace xsk::gsc +{ + +auto node::is_special_stmt() -> bool +{ + switch (kind_) + { + case type::stmt_if: + case type::stmt_ifelse: + case type::stmt_while: + case type::stmt_for: + case type::stmt_foreach: + case type::stmt_switch: + return true; + default: + return false; + } +} + +auto node::is_special_stmt_dev() -> bool +{ + switch (kind_) + { + case type::stmt_dev: + case type::stmt_if: + case type::stmt_ifelse: + case type::stmt_while: + case type::stmt_for: + case type::stmt_foreach: + case type::stmt_switch: + return true; + default: + return false; + } +} + +auto node::is_special_stmt_noif() -> bool +{ + switch (kind_) + { + case type::stmt_while: + case type::stmt_for: + case type::stmt_foreach: + case type::stmt_switch: + return true; + default: + return false; + } +} + +auto node::is_special_stmt_dev_noif() -> bool +{ + switch (kind_) + { + case type::stmt_dev: + case type::stmt_while: + case type::stmt_for: + case type::stmt_foreach: + case type::stmt_switch: + return true; + default: + return false; + } +} + +auto node::is_binary() -> bool +{ + switch (kind_) + { + case type::expr_or: + case type::expr_and: + case type::expr_bitwise_or: + case type::expr_bitwise_exor: + case type::expr_bitwise_and: + case type::expr_equality: + case type::expr_inequality: + case type::expr_less: + case type::expr_greater: + case type::expr_less_equal: + case type::expr_greater_equal: + case type::expr_shift_left: + case type::expr_shift_right: + case type::expr_add: + case type::expr_sub: + case type::expr_mul: + case type::expr_div: + case type::expr_mod: + return true; + default: + return false; + } +} + +auto node::precedence() -> u8 +{ + switch (kind_) + { + case type::expr_or: return 1; + case type::expr_and: return 2; + case type::expr_bitwise_or: return 3; + case type::expr_bitwise_exor: return 4; + case type::expr_bitwise_and: return 5; + case type::expr_equality: return 6; + case type::expr_inequality: return 6; + case type::expr_less: return 7; + case type::expr_greater: return 7; + case type::expr_less_equal: return 7; + case type::expr_greater_equal:return 7; + case type::expr_shift_left: return 8; + case type::expr_shift_right: return 8; + case type::expr_add: return 9; + case type::expr_sub: return 9; + case type::expr_mul: return 10; + case type::expr_div: return 10; + case type::expr_mod: return 10; + default: return 0; + } +} + +expr_true::expr_true(location const& loc) : node{ type::expr_true, loc } +{ +} + +expr_false::expr_false(location const& loc) : node{ type::expr_false, loc } +{ +} + +expr_integer::expr_integer(location const& loc, std::string const& value) : node{ type::expr_integer, loc }, value{ std::move(value) } +{ +} + +expr_float::expr_float(location const& loc, std::string const& value) : node{ type::expr_float, loc }, value{ std::move(value) } +{ +} + +expr_vector::expr_vector(location const& loc, expr x, expr y, expr z) : node{ type::expr_vector, loc }, x{ std::move(x) }, y{ std::move(y) }, z{ std::move(z) } +{ +} + +expr_string::expr_string(location const& loc, const std::string& value) : node{ type::expr_string, loc }, value{ value } +{ +} + +expr_istring::expr_istring(location const& loc, const std::string& value) : node{ type::expr_istring, loc }, value{ std::move(value) } +{ +} + +expr_path::expr_path(location const& loc) : node{ type::expr_path, loc } +{ +} + +expr_path::expr_path(location const& loc, std::string const& value) : node{ type::expr_path, loc }, value{ value } +{ +} + +expr_identifier::expr_identifier(location const& loc, std::string const& value) : node{ type::expr_identifier, loc }, value{ value } +{ +} + +expr_animtree::expr_animtree(location const& loc) : node{ type::expr_animtree, loc } +{ +} + +expr_animation::expr_animation(location const& loc, std::string const& value) : node{ type::expr_animation, loc }, value{ value } +{ +} + +expr_level::expr_level(location const& loc) : node{ type::expr_level, loc } +{ +} + +expr_anim::expr_anim(location const& loc) : node{ type::expr_anim, loc } +{ +} + +expr_self::expr_self(location const& loc) : node{ type::expr_self, loc } +{ +} + +expr_game::expr_game(location const& loc) : node{ type::expr_game, loc } +{ +} + +expr_undefined::expr_undefined(location const& loc) : node{ type::expr_undefined, loc } +{ +} + +expr_empty_array::expr_empty_array(location const& loc) : node{ type::expr_empty_array, loc } +{ +} + +expr_thisthread::expr_thisthread(location const& loc) : node{ type::expr_thisthread, loc } +{ +} + +expr_paren::expr_paren(location const& loc, expr value) : node{ type::expr_paren, loc }, value{ std::move(value) } +{ +} + +expr_size::expr_size(location const& loc, expr obj) : node{ type::expr_size, loc }, obj{ std::move(obj) } +{ +} + +expr_field::expr_field(location const& loc, expr obj, expr_identifier::ptr field) : node{ type::expr_field, loc }, obj{ std::move(obj) }, field{ std::move(field) } +{ +} + +expr_array::expr_array(location const& loc, expr obj, expr key) : node{ type::expr_array, loc }, obj{ std::move(obj) }, key{ std::move(key) } +{ +} + +expr_tuple::expr_tuple(location const& loc) : node{ type::expr_tuple, loc } +{ +} + +expr_reference::expr_reference(location const& loc, expr_path::ptr path, expr_identifier::ptr name) : node{ type::expr_reference, loc }, path{ std::move(path) }, name{ std::move(name) } +{ +} + +expr_istrue::expr_istrue(location const& loc, expr value) : node{ type::expr_istrue, loc }, value{ std::move(value) } +{ +} + +expr_isdefined::expr_isdefined(location const& loc, expr value) : node{ type::expr_isdefined, loc }, value{ std::move(value) } +{ +} + +expr_arguments::expr_arguments(location const& loc) : node{ type::expr_arguments, loc } +{ +} + +expr_parameters::expr_parameters(location const& loc) : node{ type::expr_parameters, loc } +{ +} + +expr_add_array::expr_add_array(location const& loc, expr_arguments::ptr args) : node{ type::expr_add_array, loc }, args{ std::move(args) } +{ +} + +expr_pointer::expr_pointer(location const& loc, expr func, expr_arguments::ptr args, call::mode mode) : node{ type::expr_pointer, loc }, func{ std::move(func) }, args{ std::move(args) }, mode{ mode } +{ +} + +expr_function::expr_function(location const& loc, expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode) : node{ type::expr_function, loc }, path{ std::move(path) }, name{ std::move(name) }, args{ std::move(args) }, mode{ mode } +{ +} + +expr_method::expr_method(location const& loc, expr obj, call value) : node{ type::expr_method, loc }, obj{ std::move(obj) }, value{ std::move(value) } +{ +} + +expr_call::expr_call(location const& loc, call value) : node{ type::expr_call, loc }, value{ std::move(value) } +{ +} + +expr_complement::expr_complement(location const& loc, expr rvalue) : node{ type::expr_complement, loc }, rvalue{ std::move(rvalue) } +{ +} + +expr_negate::expr_negate(location const& loc, expr rvalue) : node{ type::expr_negate, loc }, rvalue{ std::move(rvalue) } +{ +} + +expr_not::expr_not(location const& loc, expr rvalue) : node{ type::expr_not, loc }, rvalue{ std::move(rvalue) } +{ +} + +expr_binary::expr_binary(type t, location const& loc, expr lvalue, expr rvalue) : node{ t, loc }, lvalue{ std::move(lvalue) }, rvalue{ std::move(rvalue) } +{ +} + +expr_add::expr_add(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_add, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_sub::expr_sub(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_sub, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_mul::expr_mul(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_mul, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_div::expr_div(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_div, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_mod::expr_mod(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_mod, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_shift_left::expr_shift_left(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_shift_left, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_shift_right::expr_shift_right(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_shift_right, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_bitwise_or::expr_bitwise_or(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_bitwise_or, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_bitwise_and::expr_bitwise_and(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_bitwise_and, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_bitwise_exor::expr_bitwise_exor(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_bitwise_exor, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_equality::expr_equality(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_equality, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_inequality::expr_inequality(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_inequality, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_less_equal::expr_less_equal(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_less_equal, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_greater_equal::expr_greater_equal(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_greater_equal, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_less::expr_less(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_less, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_greater::expr_greater(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_greater, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_or::expr_or(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_or, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_and::expr_and(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_and, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_ternary::expr_ternary(location const& loc, expr test, expr true_expr, expr false_expr) : node{ type::expr_ternary, loc }, test{ std::move(test) }, true_expr{ std::move(true_expr) }, false_expr{ std::move(false_expr) } +{ +} + +expr_increment::expr_increment(location const& loc, expr lvalue, bool prefix) : node{ type::expr_increment, loc }, lvalue{ std::move(lvalue) }, prefix{ prefix } +{ +} + +expr_decrement::expr_decrement(location const& loc, expr lvalue, bool prefix) : node{ type::expr_decrement, loc }, lvalue{ std::move(lvalue) }, prefix{ prefix } +{ +} + +expr_assign::expr_assign(type t, location const& loc, expr lvalue, expr rvalue) : node{ t, loc }, lvalue{ std::move(lvalue) }, rvalue{ std::move(rvalue) } +{ +} + +expr_assign_equal::expr_assign_equal(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_equal, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_assign_add::expr_assign_add(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_add, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_assign_sub::expr_assign_sub(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_sub, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_assign_mul::expr_assign_mul(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_mul, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_assign_div::expr_assign_div(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_div, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_assign_mod::expr_assign_mod(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_mod, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_assign_shift_left::expr_assign_shift_left(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_shift_left, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_assign_shift_right::expr_assign_shift_right(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_shift_right, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_assign_bitwise_or::expr_assign_bitwise_or(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_bitwise_or, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_assign_bitwise_and::expr_assign_bitwise_and(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_bitwise_and, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +expr_assign_bitwise_exor::expr_assign_bitwise_exor(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_bitwise_exor, loc, std::move(lvalue), std::move(rvalue) } +{ +} + +stmt_list::stmt_list(location const& loc) : node{ type::stmt_list, loc } +{ +} + +stmt_dev::stmt_dev(location const& loc, stmt_list::ptr body) : node{ type::stmt_dev, loc }, body{ std::move(body) } +{ +} + +stmt_expr::stmt_expr(location const& loc, expr value) : node{ type::stmt_expr, loc }, value{ std::move(value) } +{ +} + +stmt_call::stmt_call(location const& loc, expr value) : node{ type::stmt_call, loc }, value{ std::move(value) } +{ +} + +stmt_assign::stmt_assign(location const& loc, expr value) : node{ type::stmt_assign, loc }, value{ std::move(value) } +{ +} + +stmt_endon::stmt_endon(location const& loc, expr obj, expr event) : node{ type::stmt_endon, loc }, obj{ std::move(obj) }, event{ std::move(event) } +{ +} + +stmt_notify::stmt_notify(location const& loc, expr obj, expr event, expr_arguments::ptr args) : node{ type::stmt_notify, loc }, obj{ std::move(obj) }, event{ std::move(event) }, args{ std::move(args) } +{ +} + +stmt_wait::stmt_wait(location const& loc, expr time) : node{ type::stmt_wait, loc }, time{ std::move(time) } +{ +} + +stmt_waittill::stmt_waittill(location const& loc, expr obj, expr event, expr_arguments::ptr args) : node{ type::stmt_waittill, loc }, obj{ std::move(obj) }, event{ std::move(event) }, args{ std::move(args) } +{ +} + +stmt_waittillmatch::stmt_waittillmatch(location const& loc, expr obj, expr event, expr_arguments::ptr args) : node{ type::stmt_waittillmatch, loc }, obj{ std::move(obj) }, event{ std::move(event) }, args{ std::move(args) } +{ +} + +stmt_waittillframeend::stmt_waittillframeend(location const& loc) : node{ type::stmt_waittillframeend, loc } +{ +} + +stmt_waitframe::stmt_waitframe(location const& loc) : node{ type::stmt_waitframe, loc } +{ +} + +stmt_if::stmt_if(location const& loc, expr test, stmt body) : node{ type::stmt_if, loc }, test{ std::move(test) }, body{ std::move(body) } +{ +} + +stmt_ifelse::stmt_ifelse(location const& loc, expr test, stmt stmt_if, stmt stmt_else) : node{ type::stmt_ifelse, loc }, test{ std::move(test) }, stmt_if{ std::move(stmt_if) }, stmt_else{ std::move(stmt_else) } +{ +} + +stmt_while::stmt_while(location const& loc, expr test, stmt body) : node{ type::stmt_while, loc }, test{ std::move(test) }, body{ std::move(body) } +{ +} + +stmt_dowhile::stmt_dowhile(location const& loc, expr test, stmt body) : node{ type::stmt_dowhile, loc }, test{ std::move(test) }, body{ std::move(body) } +{ +} + +stmt_for::stmt_for(location const& loc, stmt init, expr test, stmt iter, stmt body) : node{ type::stmt_for, loc }, init{ std::move(init) }, test{ std::move(test) }, iter{ std::move(iter) }, body{ std::move(body) } +{ +} + +stmt_foreach::stmt_foreach(location const& loc, expr container, expr value, expr index, expr array, expr key, stmt body, bool use_key) : node{ type::stmt_foreach, loc }, container{ std::move(container) }, value{ std::move(value) }, index{ std::move(index) }, array{ std::move(array) }, key{ std::move(key) }, body{ std::move(body) }, use_key{ use_key } +{ +} + +stmt_switch::stmt_switch(location const& loc, expr test, stmt_list::ptr body) : node{ type::stmt_switch, loc }, test{ std::move(test) }, body{ std::move(body) } +{ +} + +stmt_case::stmt_case(location const& loc, expr value) : node{ type::stmt_case, loc }, value{ std::move(value) }, body{ nullptr } +{ +} + +stmt_case::stmt_case(location const& loc, expr value, stmt_list::ptr body) : node{ type::stmt_case, loc }, value{ std::move(value) }, body{ std::move(body) } +{ +} + +stmt_default::stmt_default(location const& loc) : node{ type::stmt_default, loc }, body{ nullptr } +{ +} + +stmt_default::stmt_default(location const& loc, stmt_list::ptr body) : node{ type::stmt_default, loc }, body{ std::move(body) } +{ +} + +stmt_break::stmt_break(location const& loc) : node{ type::stmt_break, loc } +{ +} + +stmt_continue::stmt_continue(location const& loc) : node{ type::stmt_continue, loc } +{ +} + +stmt_return::stmt_return(location const& loc, expr value) : node{ type::stmt_return, loc }, value{ std::move(value) } +{ +} + +stmt_breakpoint::stmt_breakpoint(location const& loc) : node{ type::stmt_breakpoint, loc } +{ +} + +stmt_prof_begin::stmt_prof_begin(location const& loc, expr_arguments::ptr args) : node{ type::stmt_prof_begin, loc }, args{ std::move(args) } +{ +} + +stmt_prof_end::stmt_prof_end(location const& loc, expr_arguments::ptr args) : node{ type::stmt_prof_end, loc }, args{ std::move(args) } +{ +} + +decl_function::decl_function(location const& loc, expr_identifier::ptr name, expr_parameters::ptr params, stmt_list::ptr body) : node{ type::decl_function, loc }, name{ std::move(name) }, params{ std::move(params) }, body{ std::move(body) } +{ +} + +decl_usingtree::decl_usingtree(location const& loc, expr_string::ptr name) : node{ type::decl_usingtree, loc }, name{ std::move(name) } +{ +} + +decl_dev_begin::decl_dev_begin(location const& loc) : node{ type::decl_dev_begin, loc } +{ +} + +decl_dev_end::decl_dev_end(location const& loc) : node{ type::decl_dev_end, loc } +{ +} + +include::include(location const& loc, expr_path::ptr path) : node{ type::include, loc }, path{ std::move(path) } +{ +} + +program::program() : node{ type::program } +{ +} + +program::program(location const& loc) : node{ type::program, loc } +{ +} + +asm_jmp::asm_jmp(location const& loc, std::string const& value) : node{ type::asm_jmp, loc }, value{ value } +{ +} + +asm_jmp_back::asm_jmp_back(location const& loc, std::string const& value) : node{ type::asm_jmp_back, loc }, value{ value } +{ +} + +asm_jmp_cond::asm_jmp_cond(location const& loc, expr test, std::string const& value) : node{ type::asm_jmp_cond, loc }, test{ std::move(test) }, value{ value } +{ +} + +asm_jmp_true::asm_jmp_true(location const& loc, expr test, std::string const& value) : node{ type::asm_jmp_true, loc }, test{ std::move(test) }, value{ value } +{ +} + +asm_jmp_false::asm_jmp_false(location const& loc, expr test, std::string const& value) : node{ type::asm_jmp_false, loc }, test{ std::move(test) }, value{ value } +{ +} + +asm_switch::asm_switch(location const& loc, expr test, std::string const& value) : node{ type::asm_switch, loc }, test{ std::move(test) }, value{ value } +{ +} + +asm_endswitch::asm_endswitch(location const& loc, std::vector data) : node{ type::asm_endswitch, loc }, data{ std::move(data) } +{ +} + +asm_prescriptcall::asm_prescriptcall(location const& loc) : node{ type::asm_prescriptcall, loc } +{ +} + +asm_voidcodepos::asm_voidcodepos(location const& loc) : node{ type::asm_voidcodepos, loc } +{ +} + +asm_create::asm_create(location const& loc, std::string const& index) : node{ type::asm_create, loc }, index{ index } +{ +} + +asm_access::asm_access(location const& loc, std::string const& index) : node{ type::asm_access, loc }, index{ index } +{ +} + +asm_remove::asm_remove(location const& loc, std::string const& index) : node{ type::asm_remove, loc }, index{ index } +{ +} + +asm_clear::asm_clear(location const& loc, std::string const& index) : node{ type::asm_clear, loc }, index{ index } +{ +} + +auto operator==(node const& n, node::type k) -> bool +{ + return n.kind_ == k; +} + +auto operator==(node const& lhs, node const& rhs) -> bool +{ + return lhs.kind_ == rhs.kind_; +} + +auto operator==(expr_true const&, expr_true const&) -> bool +{ + return true; +} + +auto operator==(expr_false const&, expr_false const&) -> bool +{ + return true; +} + +auto operator==(expr_integer const& lhs, expr_integer const& rhs) -> bool +{ + return lhs.value == rhs.value; +} + +auto operator==(expr_float const& lhs, expr_float const& rhs) -> bool +{ + return lhs.value == rhs.value; +} + +auto operator==(expr_vector const& lhs, expr_vector const& rhs) -> bool +{ + return lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z; +} + +auto operator==(expr_string const& lhs, expr_string const& rhs) -> bool +{ + return lhs.value == rhs.value; +} + +auto operator==(expr_istring const& lhs, expr_istring const& rhs) -> bool +{ + return lhs.value == rhs.value; +} + +auto operator==(expr_path const& lhs, expr_path const& rhs) -> bool +{ + return lhs.value == rhs.value; +} + +auto operator==(expr_identifier const& lhs, expr_identifier const& rhs) -> bool +{ + return lhs.value == rhs.value; +} + +auto operator==(expr_animtree const&, expr_animtree const&) -> bool +{ + return true; +} + +auto operator==(expr_animation const& lhs, expr_animation const& rhs) -> bool +{ + return lhs.value == rhs.value; +} + +auto operator==(expr_level const&, expr_level const&) -> bool +{ + return true; +} + +auto operator==(expr_anim const&, expr_anim const&) -> bool +{ + return true; +} + +auto operator==(expr_self const&, expr_self const&) -> bool +{ + return true; +} + +auto operator==(expr_game const&, expr_game const&) -> bool +{ + return true; +} + +auto operator==(expr_undefined const&, expr_undefined const&) -> bool +{ + return true; +} + +auto operator==(expr_empty_array const&, expr_empty_array const&) -> bool +{ + return true; +} + +auto operator==(expr_thisthread const&, expr_thisthread const&) -> bool +{ + return true; +} + +auto operator==(expr_paren const& lhs, expr_paren const& rhs) -> bool +{ + return lhs.value == rhs.value; +} + +auto operator==(expr_size const& lhs, expr_size const& rhs) -> bool +{ + return lhs.obj == rhs.obj; +} + +auto operator==(expr_field const& lhs, expr_field const& rhs) -> bool +{ + return lhs.obj == rhs.obj && *lhs.field == *rhs.field; +} + +auto operator==(expr_array const& lhs, expr_array const& rhs) -> bool +{ + return lhs.obj == rhs.obj && lhs.key == rhs.key; +} + +call::call() : as_node{ nullptr } +{ +} + +call::call(std::unique_ptr value) : as_node{ std::move(value) } +{ +} + +call::call(call&& value) +{ + new(&as_node) std::unique_ptr{ std::move(value.as_node) }; +} + +call::~call() +{ + if (as_node == nullptr) return; + + switch (as_node->kind()) + { + case node::null: as_node.~unique_ptr(); return; + case node::expr_pointer: as_pointer.~unique_ptr(); return; + case node::expr_function: as_function.~unique_ptr(); return; + default: return; + } +} + +auto operator==(call const& lhs, node::type rhs) -> bool +{ + return *lhs.as_node == rhs; +} + +auto call::loc() const -> location +{ + return as_node->loc(); +} + +auto call::kind() const -> node::type +{ + return as_node->kind(); +} + +auto call::label() const -> std::string +{ + return as_node->label(); +} + +expr::expr() : as_node{ nullptr } +{ +} + +expr::expr(std::unique_ptr value) : as_node{ std::move(value) } +{ +} + +expr::expr(expr&& value) +{ + new(&as_node) std::unique_ptr{ std::move(value.as_node) }; +} + +expr& expr::operator=(expr&& value) +{ + new(&as_node) std::unique_ptr{ std::move(value.as_node) }; + return *(expr*)&as_node; +} + +expr::~expr() +{ + if (as_node == nullptr) return; + + switch (as_node->kind()) + { + case node::null: as_node.~unique_ptr(); return; + case node::expr_true: as_true.~unique_ptr(); return; + case node::expr_false: as_false.~unique_ptr(); return; + case node::expr_integer: as_integer.~unique_ptr(); return; + case node::expr_float: as_float.~unique_ptr(); return; + case node::expr_vector: as_vector.~unique_ptr(); return; + case node::expr_string: as_string.~unique_ptr(); return; + case node::expr_istring: as_istring.~unique_ptr(); return; + case node::expr_path: as_path.~unique_ptr(); return; + case node::expr_identifier: as_identifier.~unique_ptr(); return; + case node::expr_animtree: as_animtree.~unique_ptr(); return; + case node::expr_animation: as_animation.~unique_ptr(); return; + case node::expr_level: as_level.~unique_ptr(); return; + case node::expr_anim: as_anim.~unique_ptr(); return; + case node::expr_self: as_self.~unique_ptr(); return; + case node::expr_game: as_game.~unique_ptr(); return; + case node::expr_undefined: as_undefined.~unique_ptr(); return; + case node::expr_empty_array: as_empty_array.~unique_ptr(); return; + case node::expr_thisthread: as_thisthread.~unique_ptr(); return; + case node::expr_paren: as_paren.~unique_ptr(); return; + case node::expr_size: as_size.~unique_ptr(); return; + case node::expr_field: as_field.~unique_ptr(); return; + case node::expr_array: as_array.~unique_ptr(); return; + case node::expr_tuple: as_tuple.~unique_ptr(); return; + case node::expr_reference: as_reference.~unique_ptr(); return; + case node::expr_arguments: as_arguments.~unique_ptr(); return; + case node::expr_parameters: as_parameters.~unique_ptr(); return; + case node::expr_add_array: as_add_array.~unique_ptr(); return; + case node::expr_pointer: as_pointer.~unique_ptr(); return; + case node::expr_function: as_function.~unique_ptr(); return; + case node::expr_method: as_method.~unique_ptr(); return; + case node::expr_call: as_call.~unique_ptr(); return; + case node::expr_complement: as_complement.~unique_ptr(); return; + case node::expr_negate: as_negate.~unique_ptr(); return; + case node::expr_not: as_not.~unique_ptr(); return; + case node::expr_add: as_add.~unique_ptr(); return; + case node::expr_sub: as_sub.~unique_ptr(); return; + case node::expr_mul: as_mul.~unique_ptr(); return; + case node::expr_div: as_div.~unique_ptr(); return; + case node::expr_mod: as_mod.~unique_ptr(); return; + case node::expr_shift_left: as_shift_left.~unique_ptr(); return; + case node::expr_shift_right: as_shift_right.~unique_ptr(); return; + case node::expr_bitwise_or: as_bitwise_or.~unique_ptr(); return; + case node::expr_bitwise_and: as_bitwise_and.~unique_ptr(); return; + case node::expr_bitwise_exor: as_bitwise_exor.~unique_ptr(); return; + case node::expr_equality: as_equality.~unique_ptr(); return; + case node::expr_inequality: as_inequality.~unique_ptr(); return; + case node::expr_less_equal: as_less_equal.~unique_ptr(); return; + case node::expr_greater_equal: as_greater_equal.~unique_ptr(); return; + case node::expr_less: as_less.~unique_ptr(); return; + case node::expr_greater: as_greater.~unique_ptr(); return; + case node::expr_or: as_or.~unique_ptr(); return; + case node::expr_and: as_and.~unique_ptr(); return; + case node::expr_ternary: as_ternary.~unique_ptr(); return; + case node::expr_increment: as_increment.~unique_ptr(); return; + case node::expr_decrement: as_decrement.~unique_ptr(); return; + case node::expr_assign_equal: as_assign_equal.~unique_ptr(); return; + case node::expr_assign_add: as_assign_add.~unique_ptr(); return; + case node::expr_assign_sub: as_assign_sub.~unique_ptr(); return; + case node::expr_assign_mul: as_assign_mul.~unique_ptr(); return; + case node::expr_assign_div: as_assign_div.~unique_ptr(); return; + case node::expr_assign_mod: as_assign_mod.~unique_ptr(); return; + case node::expr_assign_shift_left: as_assign_shift_left.~unique_ptr(); return; + case node::expr_assign_shift_right: as_assign_shift_right.~unique_ptr(); return; + case node::expr_assign_bitwise_or: as_assign_bw_or.~unique_ptr(); return; + case node::expr_assign_bitwise_and: as_assign_bw_and.~unique_ptr(); return; + case node::expr_assign_bitwise_exor: as_assign_bw_exor.~unique_ptr(); return; + case node::asm_create: as_asm_create.~unique_ptr(); return; + case node::asm_access: as_asm_access.~unique_ptr(); return; + default: return; + } +} + +auto operator!=(expr const& lhs, node::type rhs) -> bool +{ + return lhs.as_node->kind() != rhs; +} + +auto operator==(expr const& lhs, node::type rhs) -> bool +{ + return *lhs.as_node == rhs; +} + +auto operator==(expr const& lhs, expr const& rhs) -> bool +{ + if (!(*lhs.as_node == *rhs.as_node)) return false; + + switch(lhs.as_node->kind()) + { + case node::expr_true: return *lhs.as_true == *rhs.as_true; + case node::expr_false: return *lhs.as_false == *rhs.as_false; + case node::expr_integer: return *lhs.as_integer == *rhs.as_integer; + case node::expr_float: return *lhs.as_float == *rhs.as_float; + case node::expr_vector: return *lhs.as_vector == *rhs.as_vector; + case node::expr_string: return *lhs.as_string == *rhs.as_string; + case node::expr_istring: return *lhs.as_istring == *rhs.as_istring; + case node::expr_path: return *lhs.as_path == *rhs.as_path; + case node::expr_identifier: return *lhs.as_identifier == *rhs.as_identifier; + case node::expr_animtree: return *lhs.as_animtree == *rhs.as_animtree; + case node::expr_animation: return *lhs.as_animation == *rhs.as_animation; + case node::expr_level: return *lhs.as_level == *rhs.as_level; + case node::expr_anim: return *lhs.as_anim == *rhs.as_anim; + case node::expr_self: return *lhs.as_self == *rhs.as_self; + case node::expr_game: return *lhs.as_game == *rhs.as_game; + case node::expr_undefined: return *lhs.as_undefined == *rhs.as_undefined; + case node::expr_empty_array: return *lhs.as_empty_array == *rhs.as_empty_array; + case node::expr_thisthread: return *lhs.as_thisthread == *rhs.as_thisthread; + case node::expr_paren: return *lhs.as_paren == *rhs.as_paren; + case node::expr_size: return *lhs.as_size == *rhs.as_size; + case node::expr_field: return *lhs.as_field == *rhs.as_field; + case node::expr_array: return *lhs.as_array == *rhs.as_array; + default: return false; + } +} + +auto expr::loc() const -> location +{ + return as_node->loc(); +} + +auto expr::kind() const -> node::type +{ + return as_node->kind(); +} + +auto expr::label() const -> std::string +{ + return as_node->label(); +} + +stmt::stmt() : as_node{ nullptr } +{ +} + +stmt::stmt(std::unique_ptr value) : as_node{ std::move(value) } +{ +} + +stmt::stmt(stmt&& value) +{ + new(&as_node) std::unique_ptr{ std::move(value.as_node) }; +} + +stmt& stmt::operator=(stmt&& value) +{ + new(&as_node) std::unique_ptr{ std::move(value.as_node) }; + return *(stmt*)&as_node; +} + +stmt::~stmt() +{ + if (as_node == nullptr) return; + + switch (as_node->kind()) + { + case node::null: as_node.~unique_ptr(); return; + case node::stmt_list: as_list.~unique_ptr(); return; + case node::stmt_dev: as_dev.~unique_ptr(); return; + case node::stmt_expr: as_expr.~unique_ptr(); return; + case node::stmt_call: as_call.~unique_ptr(); return; + case node::stmt_assign: as_assign.~unique_ptr(); return; + case node::stmt_endon: as_endon.~unique_ptr(); return; + case node::stmt_notify: as_notify.~unique_ptr(); return; + case node::stmt_wait: as_wait.~unique_ptr(); return; + case node::stmt_waittill: as_waittill.~unique_ptr(); return; + case node::stmt_waittillmatch: as_waittillmatch.~unique_ptr(); return; + case node::stmt_waittillframeend: as_waittillframeend.~unique_ptr(); return; + case node::stmt_waitframe: as_waitframe.~unique_ptr(); return; + case node::stmt_if: as_if.~unique_ptr(); return; + case node::stmt_ifelse: as_ifelse.~unique_ptr(); return; + case node::stmt_while: as_while.~unique_ptr(); return; + case node::stmt_dowhile: as_dowhile.~unique_ptr(); return; + case node::stmt_for: as_for.~unique_ptr(); return; + case node::stmt_foreach: as_foreach.~unique_ptr(); return; + case node::stmt_switch: as_switch.~unique_ptr(); return; + case node::stmt_case: as_case.~unique_ptr(); return; + case node::stmt_default: as_default.~unique_ptr(); return; + case node::stmt_break: as_break.~unique_ptr(); return; + case node::stmt_continue: as_continue.~unique_ptr(); return; + case node::stmt_return: as_return.~unique_ptr(); return; + case node::stmt_breakpoint: as_breakpoint.~unique_ptr(); return; + case node::stmt_prof_begin: as_prof_begin.~unique_ptr(); return; + case node::stmt_prof_end: as_prof_end.~unique_ptr(); return; + case node::asm_jmp: as_jump.~unique_ptr(); return; + case node::asm_jmp_back: as_jump_back.~unique_ptr(); return; + case node::asm_jmp_cond: as_cond.~unique_ptr(); return; + case node::asm_switch: as_asm_switch.~unique_ptr(); return; + case node::asm_endswitch: as_asm_endswitch.~unique_ptr(); return; + case node::asm_create: as_asm_create.~unique_ptr(); return; + case node::asm_access: as_asm_access.~unique_ptr(); return; + case node::asm_remove: as_asm_remove.~unique_ptr(); return; + case node::asm_clear: as_asm_clear.~unique_ptr(); return; + default: return; + } +} + +auto operator==(stmt const& lhs, node::type rhs) -> bool +{ + return *lhs.as_node == rhs; +} + +auto stmt::loc() const -> location +{ + return as_node->loc(); +} + +auto stmt::kind() const -> node::type +{ + return as_node->kind(); +} + +auto stmt::label() const -> std::string +{ + return as_node->label(); +} + +decl::decl() : as_node{ nullptr } +{ +} + +decl::decl(std::unique_ptr value) : as_node{ std::move(value) } +{ +} + +decl::decl(decl&& value) +{ + new(&as_node) std::unique_ptr{ std::move(value.as_node) }; +} + +decl& decl::operator=(decl&& value) +{ + new(&as_node) std::unique_ptr{ std::move(value.as_node) }; + return *(decl*)&as_node; +} + +decl::~decl() +{ + if (as_node == nullptr) return; + + switch (as_node->kind()) + { + case node::null: as_node.~unique_ptr(); return; + case node::decl_dev_begin: as_dev_begin.~unique_ptr(); return; + case node::decl_dev_end: as_dev_end.~unique_ptr(); return; + case node::decl_function: as_function.~unique_ptr(); return; + case node::decl_usingtree: as_usingtree.~unique_ptr(); return; + default: return; + } +} + +auto operator==(decl const& lhs, node::type rhs) -> bool +{ + return *lhs.as_node == rhs; +} + +auto decl::loc() const -> location +{ + return as_node->loc(); +} + +auto decl::kind() const -> node::type +{ + return as_node->kind(); +} + +auto decl::label() const -> std::string +{ + return as_node->label(); +} + +} // namespace xsk::gsc diff --git a/src/gsc/misc/ast.hpp b/src/gsc/misc/ast.hpp new file mode 100644 index 00000000..ab2daa39 --- /dev/null +++ b/src/gsc/misc/ast.hpp @@ -0,0 +1,1613 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +struct node +{ + using ptr = std::unique_ptr; + + enum type + { + null, + expr_true, + expr_false, + expr_integer, + expr_float, + expr_vector, + expr_string, + expr_istring, + expr_path, + expr_identifier, + expr_animtree, + expr_animation, + expr_level, + expr_anim, + expr_self, + expr_game, + expr_undefined, + expr_empty_array, + expr_thisthread, + expr_paren, + expr_size, + expr_field, + expr_array, + expr_tuple, + expr_reference, + expr_istrue, + expr_isdefined, + expr_arguments, + expr_parameters, + expr_add_array, + expr_pointer, + expr_function, + expr_method, + expr_call, + expr_complement, + expr_negate, + expr_not, + expr_add, + expr_sub, + expr_mul, + expr_div, + expr_mod, + expr_shift_left, + expr_shift_right, + expr_bitwise_or, + expr_bitwise_and, + expr_bitwise_exor, + expr_equality, + expr_inequality, + expr_less_equal, + expr_greater_equal, + expr_less, + expr_greater, + expr_or, + expr_and, + expr_ternary, + expr_increment, + expr_decrement, + expr_assign_equal, + expr_assign_add, + expr_assign_sub, + expr_assign_mul, + expr_assign_div, + expr_assign_mod, + expr_assign_shift_left, + expr_assign_shift_right, + expr_assign_bitwise_or, + expr_assign_bitwise_and, + expr_assign_bitwise_exor, + stmt_list, + stmt_dev, + stmt_expr, + stmt_call, + stmt_assign, + stmt_endon, + stmt_notify, + stmt_wait, + stmt_waittill, + stmt_waittillmatch, + stmt_waittillframeend, + stmt_waitframe, + 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_function, + decl_usingtree, + decl_dev_begin, + decl_dev_end, + include, + program, + asm_jmp, + asm_jmp_back, + asm_jmp_cond, + asm_jmp_true, + asm_jmp_false, + asm_switch, + asm_endswitch, + asm_prescriptcall, + asm_voidcodepos, + asm_create, + asm_access, + asm_remove, + asm_clear, + }; + +public: + node() : kind_(type::null) {} + node(location const& loc) : kind_(type::null), loc_(loc) {} + node(type t) : kind_(t) {} + node(type t, location const& loc) : kind_(t), loc_(loc) {} + + virtual ~node() = default; + friend bool operator==(node const& n, type t); + friend bool operator==(node const& lhs, node const& rhs); + + auto kind() const -> type { return kind_; } + auto loc() const -> location const& { return loc_; } + auto label() const -> std::string { return loc_.label(); } + + 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() -> u8; + +private: + type kind_; + location loc_; +}; + +struct expr_true; +struct expr_false; +struct expr_integer; +struct expr_float; +struct expr_vector; +struct expr_string; +struct expr_istring; +struct expr_path; +struct expr_identifier; +struct expr_animtree; +struct expr_animation; +struct expr_level; +struct expr_anim; +struct expr_self; +struct expr_game; +struct expr_undefined; +struct expr_empty_array; +struct expr_thisthread; +struct expr_paren; +struct expr_size; +struct expr_field; +struct expr_array; +struct expr_tuple; +struct expr_reference; +struct expr_istrue; +struct expr_isdefined; +struct expr_arguments; +struct expr_parameters; +struct expr_add_array; +struct expr_pointer; +struct expr_function; +struct expr_method; +struct expr_call; +struct expr_complement; +struct expr_negate; +struct expr_not; +struct expr_binary; +struct expr_add; +struct expr_sub; +struct expr_mul; +struct expr_div; +struct expr_mod; +struct expr_shift_left; +struct expr_shift_right; +struct expr_bitwise_or; +struct expr_bitwise_and; +struct expr_bitwise_exor; +struct expr_equality; +struct expr_inequality; +struct expr_less_equal; +struct expr_greater_equal; +struct expr_less; +struct expr_greater; +struct expr_or; +struct expr_and; +struct expr_ternary; +struct expr_increment; +struct expr_decrement; +struct expr_assign; +struct expr_assign_equal; +struct expr_assign_add; +struct expr_assign_sub; +struct expr_assign_mul; +struct expr_assign_div; +struct expr_assign_mod; +struct expr_assign_shift_left; +struct expr_assign_shift_right; +struct expr_assign_bitwise_or; +struct expr_assign_bitwise_and; +struct expr_assign_bitwise_exor; +struct stmt_list; +struct stmt_dev; +struct stmt_expr; +struct stmt_call; +struct stmt_assign; +struct stmt_endon; +struct stmt_notify; +struct stmt_wait; +struct stmt_waittill; +struct stmt_waittillmatch; +struct stmt_waittillframeend; +struct stmt_waitframe; +struct stmt_if; +struct stmt_ifelse; +struct stmt_while; +struct stmt_dowhile; +struct stmt_for; +struct stmt_foreach; +struct stmt_switch; +struct stmt_case; +struct stmt_default; +struct stmt_break; +struct stmt_continue; +struct stmt_return; +struct stmt_breakpoint; +struct stmt_prof_begin; +struct stmt_prof_end; +struct decl_function; +struct decl_usingtree; +struct decl_dev_begin; +struct decl_dev_end; +struct include; +struct program; +struct asm_jmp; +struct asm_jmp_back; +struct asm_jmp_cond; +struct asm_jmp_false; +struct asm_jmp_true; +struct asm_switch; +struct asm_endswitch; +struct asm_prescriptcall; +struct asm_voidcodepos; +struct asm_create; +struct asm_access; +struct asm_remove; +struct asm_clear; + +union call +{ + enum class type { local, far, builtin }; + enum class mode { normal, thread, childthread, builtin }; + + 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(call const&) = delete; + call& operator=(call const&) = delete; + ~call(); + friend auto operator==(call const& lhs, node::type rhs) -> bool; + auto loc() const -> location; + auto kind() const -> node::type; + auto label() const -> std::string; +}; + +union expr +{ + std::unique_ptr as_node; + std::unique_ptr as_true; + std::unique_ptr as_false; + std::unique_ptr as_integer; + std::unique_ptr as_float; + std::unique_ptr as_vector; + std::unique_ptr as_string; + std::unique_ptr as_istring; + std::unique_ptr as_path; + std::unique_ptr as_identifier; + std::unique_ptr as_animtree; + std::unique_ptr as_animation; + std::unique_ptr as_level; + std::unique_ptr as_anim; + std::unique_ptr as_self; + std::unique_ptr as_game; + std::unique_ptr as_undefined; + std::unique_ptr as_empty_array; + std::unique_ptr as_thisthread; + std::unique_ptr as_paren; + std::unique_ptr as_size; + std::unique_ptr as_field; + std::unique_ptr as_array; + std::unique_ptr as_tuple; + std::unique_ptr as_reference; + std::unique_ptr as_istrue; + std::unique_ptr as_isdefined; + std::unique_ptr as_arguments; + std::unique_ptr as_parameters; + std::unique_ptr as_add_array; + std::unique_ptr as_pointer; + std::unique_ptr as_function; + std::unique_ptr as_method; + std::unique_ptr as_call; + std::unique_ptr as_complement; + std::unique_ptr as_negate; + std::unique_ptr as_not; + std::unique_ptr as_binary; + std::unique_ptr as_add; + std::unique_ptr as_sub; + std::unique_ptr as_mul; + std::unique_ptr as_div; + std::unique_ptr as_mod; + std::unique_ptr as_shift_left; + std::unique_ptr as_shift_right; + std::unique_ptr as_bitwise_or; + std::unique_ptr as_bitwise_and; + std::unique_ptr as_bitwise_exor; + std::unique_ptr as_equality; + std::unique_ptr as_inequality; + std::unique_ptr as_less_equal; + std::unique_ptr as_greater_equal; + std::unique_ptr as_less; + std::unique_ptr as_greater; + std::unique_ptr as_or; + std::unique_ptr as_and; + std::unique_ptr as_ternary; + std::unique_ptr as_increment; + std::unique_ptr as_decrement; + std::unique_ptr as_assign; + std::unique_ptr as_assign_equal; + std::unique_ptr as_assign_add; + std::unique_ptr as_assign_sub; + std::unique_ptr as_assign_mul; + std::unique_ptr as_assign_div; + std::unique_ptr as_assign_mod; + std::unique_ptr as_assign_shift_left; + std::unique_ptr as_assign_shift_right; + std::unique_ptr as_assign_bw_or; + std::unique_ptr as_assign_bw_and; + std::unique_ptr as_assign_bw_exor; + std::unique_ptr as_asm_create; + std::unique_ptr as_asm_access; + + expr(); + expr(std::unique_ptr value); + expr(expr&& value); + expr& operator=(expr&& value); + expr(expr const&) = delete; + expr& operator=(expr const&) = delete; + ~expr(); + friend auto operator!=(expr const& lhs, node::type rhs) -> bool; + friend auto operator==(expr const& lhs, node::type rhs) -> bool; + friend auto operator==(expr const& lhs, expr const& rhs) -> bool; + auto loc() const -> location; + auto kind() const -> node::type; + auto label() const -> std::string; +}; + +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_wait; + std::unique_ptr as_waittill; + std::unique_ptr as_waittillmatch; + std::unique_ptr as_waittillframeend; + std::unique_ptr as_waitframe; + 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_cond; + std::unique_ptr as_jump; + std::unique_ptr as_jump_back; + std::unique_ptr as_asm_switch; + std::unique_ptr as_asm_endswitch; + std::unique_ptr as_asm_create; + std::unique_ptr as_asm_access; + std::unique_ptr as_asm_remove; + std::unique_ptr as_asm_clear; + + stmt(); + stmt(std::unique_ptr value); + stmt(stmt&& value); + stmt& operator=(stmt&& value); + stmt(stmt const&) = delete; + stmt& operator=(stmt const&) = delete; + ~stmt(); + friend auto operator==(stmt const& lhs, node::type rhs) -> bool; + auto loc() const -> location; + auto kind() const -> node::type; + auto label() const -> std::string; +}; + +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_function; + + decl(); + decl(std::unique_ptr value); + decl(decl&& value); + decl& operator=(decl&& value); + decl(decl const&) = delete; + decl& operator=(decl const&) = delete; + ~decl(); + friend auto operator==(decl const& lhs, node::type rhs) -> bool; + auto loc() const -> location; + auto kind() const -> node::type; + auto label() const -> std::string; +}; + +struct expr_true : public node +{ + using ptr = std::unique_ptr; + + expr_true(location const& loc); + friend auto operator==(expr_true const& lhs, expr_true const& rhs) -> bool; +}; + +struct expr_false : public node +{ + using ptr = std::unique_ptr; + + expr_false(location const& loc); + friend auto operator==(expr_false const& lhs, expr_false const& rhs) -> bool; +}; + +struct expr_integer : public node +{ + using ptr = std::unique_ptr; + + std::string value; + + expr_integer(location const& loc, std::string const& value); + friend auto operator==(expr_integer const& lhs, expr_integer const& rhs) -> bool; +}; + +struct expr_float : public node +{ + using ptr = std::unique_ptr; + + std::string value; + + expr_float(location const& loc, std::string const& value); + friend auto operator==(expr_float const& lhs, expr_float const& rhs) -> bool; +}; + +struct expr_vector : public node +{ + using ptr = std::unique_ptr; + + expr x; + expr y; + expr z; + + expr_vector(location const& loc, expr x, expr y, expr z); + friend auto operator==(expr_vector const& lhs, expr_vector const& rhs) -> bool; +}; + +struct expr_string : public node +{ + using ptr = std::unique_ptr; + + std::string value; + + expr_string(location const& loc, std::string const& value); + friend auto operator==(expr_string const& lhs, expr_string const& rhs) -> bool; +}; + +struct expr_istring : public node +{ + using ptr = std::unique_ptr; + + std::string value; + + expr_istring(location const& loc, std::string const& value); + friend auto operator==(expr_istring const& lhs, expr_istring const& rhs) -> bool; +}; + +struct expr_path : public node +{ + using ptr = std::unique_ptr; + + std::string value; + + expr_path(location const& loc); + expr_path(location const& loc, std::string const& value); + friend auto operator==(expr_path const& lhs, expr_path const& rhs) -> bool; +}; + +struct expr_identifier : public node +{ + using ptr = std::unique_ptr; + + std::string value; + + expr_identifier(location const& loc, std::string const& value); + friend auto operator==(expr_identifier const& lhs, expr_identifier const& rhs) -> bool; +}; + +struct expr_animtree : public node +{ + using ptr = std::unique_ptr; + + expr_animtree(location const& loc); + friend auto operator==(expr_animtree const& lhs, expr_animtree const& rhs) -> bool; +}; + +struct expr_animation : public node +{ + using ptr = std::unique_ptr; + + std::string value; + + expr_animation(location const& loc, std::string const& value); + friend auto operator==(expr_animation const& lhs, expr_animation const& rhs) -> bool; +}; + +struct expr_level : public node +{ + using ptr = std::unique_ptr; + + expr_level(location const& loc); + friend auto operator==(expr_level const& lhs, expr_level const& rhs) -> bool; +}; + +struct expr_anim : public node +{ + using ptr = std::unique_ptr; + + expr_anim(location const& loc); + friend auto operator==(expr_anim const& lhs, expr_anim const& rhs) -> bool; +}; + +struct expr_self : public node +{ + using ptr = std::unique_ptr; + + expr_self(location const& loc); + friend auto operator==(expr_self const& lhs, expr_self const& rhs) -> bool; +}; + +struct expr_game : public node +{ + using ptr = std::unique_ptr; + + expr_game(location const& loc); + friend auto operator==(expr_game const& lhs, expr_game const& rhs) -> bool; +}; + +struct expr_undefined : public node +{ + using ptr = std::unique_ptr; + + expr_undefined(location const& loc); + friend auto operator==(expr_undefined const& lhs, expr_undefined const& rhs) -> bool; +}; + +struct expr_empty_array : public node +{ + using ptr = std::unique_ptr; + + expr_empty_array(location const& loc); + friend auto operator==(expr_empty_array const& lhs, expr_empty_array const& rhs) -> bool; +}; + +struct expr_thisthread : public node +{ + using ptr = std::unique_ptr; + + expr_thisthread(location const& loc); + friend auto operator==(expr_thisthread const& lhs, expr_thisthread const& rhs) -> bool; +}; + +struct expr_paren : public node +{ + using ptr = std::unique_ptr; + + expr value; + + expr_paren(location const& loc, expr value); + friend auto operator==(expr_paren const& lhs, expr_paren const& rhs) -> bool; +}; + +struct expr_size : public node +{ + using ptr = std::unique_ptr; + + expr obj; + + expr_size(location const& loc, expr obj); + friend auto operator==(expr_size const& lhs, expr_size const& rhs) -> bool; +}; + +struct expr_field : public node +{ + using ptr = std::unique_ptr; + + expr obj; + expr_identifier::ptr field; + + expr_field(location const& loc, expr obj, expr_identifier::ptr field); + friend auto operator==(expr_field const& lhs, expr_field const& rhs) -> bool; +}; + +struct expr_array : public node +{ + using ptr = std::unique_ptr; + + expr obj; + expr key; + + expr_array(location const& loc, expr obj, expr key); + friend auto operator==(expr_array const& lhs, expr_array const& rhs) -> bool; +}; + +struct expr_tuple : public node +{ + using ptr = std::unique_ptr; + + std::vector list; + expr temp; + + expr_tuple(location const& loc); +}; + +struct expr_reference : public node +{ + using ptr = std::unique_ptr; + + expr_path::ptr path; + expr_identifier::ptr name; + + expr_reference(location const& loc, expr_path::ptr path, expr_identifier::ptr name); +}; + +struct expr_istrue : public node +{ + using ptr = std::unique_ptr; + + expr value; + + expr_istrue(location const& loc, expr value); +}; + +struct expr_isdefined : public node +{ + using ptr = std::unique_ptr; + + expr value; + + expr_isdefined(location const& loc, expr value); +}; + +struct expr_arguments : public node +{ + using ptr = std::unique_ptr; + + std::vector list; + + expr_arguments(location const& loc); +}; + +struct expr_parameters : public node +{ + using ptr = std::unique_ptr; + + std::vector list; + + expr_parameters(location const& loc); +}; + +struct expr_add_array : public node +{ + using ptr = std::unique_ptr; + + expr_arguments::ptr args; + + expr_add_array(location const& loc, expr_arguments::ptr args); +}; + +struct expr_pointer : public node +{ + using ptr = std::unique_ptr; + + expr func; + expr_arguments::ptr args; + call::mode mode; + + expr_pointer(location const& loc, expr func, expr_arguments::ptr args, call::mode mode); +}; + +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(location const& loc, expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode); +}; + +struct expr_method : public node +{ + using ptr = std::unique_ptr; + + expr obj; + call value; + + expr_method(location const& loc, expr obj, call value); +}; + +struct expr_call : public node +{ + using ptr = std::unique_ptr; + + call value; + + expr_call(location const& loc, call value); +}; + +struct expr_complement : public node +{ + using ptr = std::unique_ptr; + + expr rvalue; + + expr_complement(location const& loc, expr rvalue); +}; + +struct expr_negate : public node +{ + using ptr = std::unique_ptr; + + expr rvalue; + + expr_negate(location const& loc, expr rvalue); +}; + +struct expr_not : public node +{ + using ptr = std::unique_ptr; + + expr rvalue; + + expr_not(location const& loc, expr rvalue); +}; + +struct expr_binary : public node +{ + using ptr = std::unique_ptr; + + expr lvalue; + expr rvalue; + + expr_binary(type t, location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_add : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_add(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_sub : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_sub(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_mul : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_mul(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_div : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_div(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_mod : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_mod(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_shift_left : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_shift_left(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_shift_right : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_shift_right(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_bitwise_or : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_bitwise_or(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_bitwise_and : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_bitwise_and(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_bitwise_exor : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_bitwise_exor(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_equality : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_equality(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_inequality : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_inequality(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_less_equal : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_less_equal(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_greater_equal : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_greater_equal(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_less : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_less(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_greater : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_greater(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_or : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_or(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_and : public expr_binary +{ + using ptr = std::unique_ptr; + + expr_and(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_ternary : public node +{ + using ptr = std::unique_ptr; + + expr test; + expr true_expr; + expr false_expr; + + expr_ternary(location const& loc, expr test, expr true_expr, expr false_expr); +}; + +struct expr_increment : node +{ + using ptr = std::unique_ptr; + + expr lvalue; + bool prefix; + + expr_increment(location const& loc, expr lvalue, bool prefix); +}; + +struct expr_decrement : node +{ + using ptr = std::unique_ptr; + + expr lvalue; + bool prefix; + + expr_decrement(location const& loc, expr lvalue, bool prefix); +}; + +struct expr_assign : public node +{ + using ptr = std::unique_ptr; + + expr lvalue; + expr rvalue; + + expr_assign(type t, location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_assign_equal : public expr_assign +{ + using ptr = std::unique_ptr; + + expr_assign_equal(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_assign_add : public expr_assign +{ + using ptr = std::unique_ptr; + + expr_assign_add(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_assign_sub : public expr_assign +{ + using ptr = std::unique_ptr; + + expr_assign_sub(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_assign_mul : public expr_assign +{ + using ptr = std::unique_ptr; + + expr_assign_mul(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_assign_div : public expr_assign +{ + using ptr = std::unique_ptr; + + expr_assign_div(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_assign_mod : public expr_assign +{ + using ptr = std::unique_ptr; + + expr_assign_mod(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_assign_shift_left : public expr_assign +{ + using ptr = std::unique_ptr; + + expr_assign_shift_left(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_assign_shift_right : public expr_assign +{ + using ptr = std::unique_ptr; + + expr_assign_shift_right(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_assign_bitwise_or : public expr_assign +{ + using ptr = std::unique_ptr; + + expr_assign_bitwise_or(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_assign_bitwise_and : public expr_assign +{ + using ptr = std::unique_ptr; + + expr_assign_bitwise_and(location const& loc, expr lvalue, expr rvalue); +}; + +struct expr_assign_bitwise_exor : public expr_assign +{ + using ptr = std::unique_ptr; + + expr_assign_bitwise_exor(location const& loc, expr lvalue, expr rvalue); +}; + +struct stmt_list : public node +{ + using ptr = std::unique_ptr; + + std::vector list; + bool is_case = false; + bool is_expr = false; + + stmt_list(location const& loc); +}; + +struct stmt_dev : public node +{ + using ptr = std::unique_ptr; + + stmt_list::ptr body; + + stmt_dev(location const& loc, stmt_list::ptr body); +}; + +struct stmt_expr : public node +{ + using ptr = std::unique_ptr; + + expr value; + + stmt_expr(location const& loc, expr value); +}; + +struct stmt_call : public node +{ + using ptr = std::unique_ptr; + + expr value; + + stmt_call(location const& loc, expr value); +}; + +struct stmt_assign : public node +{ + using ptr = std::unique_ptr; + + expr value; + + stmt_assign(location const& loc, expr value); +}; + +struct stmt_endon : public node +{ + using ptr = std::unique_ptr; + + expr obj; + expr event; + + stmt_endon(location const& loc, expr obj, expr event); +}; + +struct stmt_notify : public node +{ + using ptr = std::unique_ptr; + + expr obj; + expr event; + expr_arguments::ptr args; + + stmt_notify(location const& loc, expr obj, expr event, expr_arguments::ptr args); +}; + +struct stmt_wait : public node +{ + using ptr = std::unique_ptr; + + expr time; + + stmt_wait(location const& loc, expr time); +}; + +struct stmt_waittill : public node +{ + using ptr = std::unique_ptr; + + expr obj; + expr event; + expr_arguments::ptr args; + + stmt_waittill(location const& loc, expr obj, expr event, expr_arguments::ptr args); +}; + +struct stmt_waittillmatch : public node +{ + using ptr = std::unique_ptr; + + expr obj; + expr event; + expr_arguments::ptr args; + + stmt_waittillmatch(location const& loc, expr obj, expr expr, expr_arguments::ptr args); +}; + +struct stmt_waittillframeend : public node +{ + using ptr = std::unique_ptr; + + stmt_waittillframeend(location const& loc); +}; + +struct stmt_waitframe : public node +{ + using ptr = std::unique_ptr; + + stmt_waitframe(location const& loc); +}; + +struct stmt_if : public node +{ + using ptr = std::unique_ptr; + + expr test; + stmt body; + + stmt_if(location const& loc, expr test, stmt body); +}; + +struct stmt_ifelse : public node +{ + using ptr = std::unique_ptr; + + expr test; + stmt stmt_if; + stmt stmt_else; + + stmt_ifelse(location const& loc, expr test, stmt stmt_if, stmt stmt_else); +}; + +struct stmt_while : public node +{ + using ptr = std::unique_ptr; + + expr test; + stmt body; + + stmt_while(location const& loc, expr test, stmt body); +}; + +struct stmt_dowhile : public node +{ + using ptr = std::unique_ptr; + + expr test; + stmt body; + + stmt_dowhile(location const& loc, expr test, stmt body); +}; + +struct stmt_for : public node +{ + using ptr = std::unique_ptr; + + stmt init; + expr test; + stmt iter; + stmt body; + + stmt_for(location const& loc, stmt init, expr test, stmt iter, stmt body); +}; + +struct stmt_foreach : public node +{ + using ptr = std::unique_ptr; + + expr container; + expr value; + expr index; + expr array; + expr key; + stmt body; + bool use_key; + + stmt_foreach(location const& loc, expr container, expr value, expr index, expr array, expr key, stmt body, bool use_key); +}; + +struct stmt_switch : public node +{ + using ptr = std::unique_ptr; + + expr test; + stmt_list::ptr body; + + stmt_switch(location const& loc, expr test, stmt_list::ptr body); +}; + +struct stmt_case : public node +{ + using ptr = std::unique_ptr; + + expr value; + stmt_list::ptr body; + + stmt_case(location const& loc, expr value); + stmt_case(location const& loc, expr value, stmt_list::ptr body); +}; + +struct stmt_default : public node +{ + using ptr = std::unique_ptr; + + stmt_list::ptr body; + + stmt_default(location const& loc); + stmt_default(location const& loc, stmt_list::ptr body); +}; + +struct stmt_break : public node +{ + using ptr = std::unique_ptr; + + stmt_break(location const& loc); +}; + +struct stmt_continue : public node +{ + using ptr = std::unique_ptr; + + stmt_continue(location const& loc); +}; + +struct stmt_return : public node +{ + using ptr = std::unique_ptr; + + expr value; + + stmt_return(location const& loc, expr value); +}; + +struct stmt_breakpoint : public node +{ + using ptr = std::unique_ptr; + + stmt_breakpoint(location const& loc); +}; + +struct stmt_prof_begin : public node +{ + using ptr = std::unique_ptr; + + expr_arguments::ptr args; + + stmt_prof_begin(location const& loc, expr_arguments::ptr args); +}; + +struct stmt_prof_end : public node +{ + using ptr = std::unique_ptr; + + expr_arguments::ptr args; + + stmt_prof_end(location const& loc, expr_arguments::ptr args); +}; + +struct decl_function : public node +{ + using ptr = std::unique_ptr; + + expr_identifier::ptr name; + expr_parameters::ptr params; + stmt_list::ptr body; + + decl_function(location const& loc, expr_identifier::ptr name, expr_parameters::ptr params, stmt_list::ptr body); +}; + +struct decl_usingtree : public node +{ + using ptr = std::unique_ptr; + + expr_string::ptr name; + + decl_usingtree(location const& loc, expr_string::ptr name); +}; + +struct decl_dev_begin : public node +{ + using ptr = std::unique_ptr; + + decl_dev_begin(location const& loc); +}; + +struct decl_dev_end : public node +{ + using ptr = std::unique_ptr; + + decl_dev_end(location const& loc); +}; + +struct include : public node +{ + using ptr = std::unique_ptr; + + expr_path::ptr path; + + include(location const& loc, expr_path::ptr path); +}; + +struct program : public node +{ + using ptr = std::unique_ptr; + + std::vector includes; + std::vector declarations; + + program(); + program(location const& loc); +}; + +struct asm_jmp : public node +{ + using ptr = std::unique_ptr; + + std::string value; + + asm_jmp(location const& loc, std::string const& value); +}; + +struct asm_jmp_back : public node +{ + using ptr = std::unique_ptr; + + std::string value; + + asm_jmp_back(location const& loc, std::string const& value); +}; + +struct asm_jmp_cond : public node +{ + using ptr = std::unique_ptr; + + expr test; + std::string value; + + asm_jmp_cond(location const& loc, expr test, std::string const& value); +}; + +struct asm_jmp_true : public node +{ + using ptr = std::unique_ptr; + + expr test; + std::string value; + + asm_jmp_true(location const& loc, expr test, std::string const& value); +}; + +struct asm_jmp_false : public node +{ + using ptr = std::unique_ptr; + + expr test; + std::string value; + + asm_jmp_false(location const& loc, expr test, std::string const& value); +}; + +struct asm_switch : public node +{ + using ptr = std::unique_ptr; + + expr test; + std::string value; + + asm_switch(location const& loc, expr test, std::string const& value); +}; + +struct asm_endswitch : public node +{ + using ptr = std::unique_ptr; + + std::vector data; + + asm_endswitch(location const& loc, std::vector data); +}; + +struct asm_prescriptcall : public node +{ + using ptr = std::unique_ptr; + + asm_prescriptcall(location const& loc); +}; + +struct asm_voidcodepos : public node +{ + using ptr = std::unique_ptr; + + asm_voidcodepos(location const& loc); +}; + +struct asm_create : public node +{ + using ptr = std::unique_ptr; + + std::string index; + std::vector vars; + + asm_create(location const& loc, std::string const& index); +}; + +struct asm_access : public node +{ + using ptr = std::unique_ptr; + + std::string index; + + asm_access(location const& loc, std::string const& index); +}; + +struct asm_remove : public node +{ + using ptr = std::unique_ptr; + + std::string index; + + asm_remove(location const& loc, std::string const& index); +}; + +struct asm_clear : public node +{ + using ptr = std::unique_ptr; + + std::string index; + + asm_clear(location const& loc, std::string const& index); +}; + +#define XSK_GSC_MAKE_GENERIC(node_type) \ +template \ +inline auto make_ ## node_type(Args&&... args) -> std::unique_ptr \ +{ \ + return std::unique_ptr(new node_type(std::forward(args)...)); \ +} + +XSK_GSC_MAKE_GENERIC(node) +XSK_GSC_MAKE_GENERIC(expr_true) +XSK_GSC_MAKE_GENERIC(expr_false) +XSK_GSC_MAKE_GENERIC(expr_integer) +XSK_GSC_MAKE_GENERIC(expr_float) +XSK_GSC_MAKE_GENERIC(expr_vector) +XSK_GSC_MAKE_GENERIC(expr_string) +XSK_GSC_MAKE_GENERIC(expr_istring) +XSK_GSC_MAKE_GENERIC(expr_path) +XSK_GSC_MAKE_GENERIC(expr_identifier) +XSK_GSC_MAKE_GENERIC(expr_animtree) +XSK_GSC_MAKE_GENERIC(expr_animation) +XSK_GSC_MAKE_GENERIC(expr_level) +XSK_GSC_MAKE_GENERIC(expr_anim) +XSK_GSC_MAKE_GENERIC(expr_self) +XSK_GSC_MAKE_GENERIC(expr_game) +XSK_GSC_MAKE_GENERIC(expr_undefined) +XSK_GSC_MAKE_GENERIC(expr_empty_array) +XSK_GSC_MAKE_GENERIC(expr_thisthread) +XSK_GSC_MAKE_GENERIC(expr_paren) +XSK_GSC_MAKE_GENERIC(expr_size) +XSK_GSC_MAKE_GENERIC(expr_field) +XSK_GSC_MAKE_GENERIC(expr_array) +XSK_GSC_MAKE_GENERIC(expr_tuple) +XSK_GSC_MAKE_GENERIC(expr_reference) +XSK_GSC_MAKE_GENERIC(expr_istrue) +XSK_GSC_MAKE_GENERIC(expr_isdefined) +XSK_GSC_MAKE_GENERIC(expr_arguments) +XSK_GSC_MAKE_GENERIC(expr_parameters) +XSK_GSC_MAKE_GENERIC(expr_add_array) +XSK_GSC_MAKE_GENERIC(expr_pointer) +XSK_GSC_MAKE_GENERIC(expr_function) +XSK_GSC_MAKE_GENERIC(expr_method) +XSK_GSC_MAKE_GENERIC(expr_call) +XSK_GSC_MAKE_GENERIC(expr_complement) +XSK_GSC_MAKE_GENERIC(expr_negate) +XSK_GSC_MAKE_GENERIC(expr_not) +XSK_GSC_MAKE_GENERIC(expr_add) +XSK_GSC_MAKE_GENERIC(expr_sub) +XSK_GSC_MAKE_GENERIC(expr_mul) +XSK_GSC_MAKE_GENERIC(expr_div) +XSK_GSC_MAKE_GENERIC(expr_mod) +XSK_GSC_MAKE_GENERIC(expr_shift_left) +XSK_GSC_MAKE_GENERIC(expr_shift_right) +XSK_GSC_MAKE_GENERIC(expr_bitwise_or) +XSK_GSC_MAKE_GENERIC(expr_bitwise_and) +XSK_GSC_MAKE_GENERIC(expr_bitwise_exor) +XSK_GSC_MAKE_GENERIC(expr_equality) +XSK_GSC_MAKE_GENERIC(expr_inequality) +XSK_GSC_MAKE_GENERIC(expr_less_equal) +XSK_GSC_MAKE_GENERIC(expr_greater_equal) +XSK_GSC_MAKE_GENERIC(expr_less) +XSK_GSC_MAKE_GENERIC(expr_greater) +XSK_GSC_MAKE_GENERIC(expr_or) +XSK_GSC_MAKE_GENERIC(expr_and) +XSK_GSC_MAKE_GENERIC(expr_ternary) +XSK_GSC_MAKE_GENERIC(expr_increment) +XSK_GSC_MAKE_GENERIC(expr_decrement) +XSK_GSC_MAKE_GENERIC(expr_assign_equal) +XSK_GSC_MAKE_GENERIC(expr_assign_add) +XSK_GSC_MAKE_GENERIC(expr_assign_sub) +XSK_GSC_MAKE_GENERIC(expr_assign_mul) +XSK_GSC_MAKE_GENERIC(expr_assign_div) +XSK_GSC_MAKE_GENERIC(expr_assign_mod) +XSK_GSC_MAKE_GENERIC(expr_assign_shift_left) +XSK_GSC_MAKE_GENERIC(expr_assign_shift_right) +XSK_GSC_MAKE_GENERIC(expr_assign_bitwise_or) +XSK_GSC_MAKE_GENERIC(expr_assign_bitwise_and) +XSK_GSC_MAKE_GENERIC(expr_assign_bitwise_exor) +XSK_GSC_MAKE_GENERIC(stmt_list) +XSK_GSC_MAKE_GENERIC(stmt_dev) +XSK_GSC_MAKE_GENERIC(stmt_expr) +XSK_GSC_MAKE_GENERIC(stmt_call) +XSK_GSC_MAKE_GENERIC(stmt_assign) +XSK_GSC_MAKE_GENERIC(stmt_endon) +XSK_GSC_MAKE_GENERIC(stmt_notify) +XSK_GSC_MAKE_GENERIC(stmt_wait) +XSK_GSC_MAKE_GENERIC(stmt_waittill) +XSK_GSC_MAKE_GENERIC(stmt_waittillmatch) +XSK_GSC_MAKE_GENERIC(stmt_waittillframeend) +XSK_GSC_MAKE_GENERIC(stmt_waitframe) +XSK_GSC_MAKE_GENERIC(stmt_if) +XSK_GSC_MAKE_GENERIC(stmt_ifelse) +XSK_GSC_MAKE_GENERIC(stmt_while) +XSK_GSC_MAKE_GENERIC(stmt_dowhile) +XSK_GSC_MAKE_GENERIC(stmt_for) +XSK_GSC_MAKE_GENERIC(stmt_foreach) +XSK_GSC_MAKE_GENERIC(stmt_switch) +XSK_GSC_MAKE_GENERIC(stmt_case) +XSK_GSC_MAKE_GENERIC(stmt_default) +XSK_GSC_MAKE_GENERIC(stmt_break) +XSK_GSC_MAKE_GENERIC(stmt_continue) +XSK_GSC_MAKE_GENERIC(stmt_return) +XSK_GSC_MAKE_GENERIC(stmt_breakpoint) +XSK_GSC_MAKE_GENERIC(stmt_prof_begin) +XSK_GSC_MAKE_GENERIC(stmt_prof_end) +XSK_GSC_MAKE_GENERIC(decl_function) +XSK_GSC_MAKE_GENERIC(decl_usingtree) +XSK_GSC_MAKE_GENERIC(decl_dev_begin) +XSK_GSC_MAKE_GENERIC(decl_dev_end) +XSK_GSC_MAKE_GENERIC(include) +XSK_GSC_MAKE_GENERIC(program) +XSK_GSC_MAKE_GENERIC(asm_jmp) +XSK_GSC_MAKE_GENERIC(asm_jmp_back) +XSK_GSC_MAKE_GENERIC(asm_jmp_cond) +XSK_GSC_MAKE_GENERIC(asm_jmp_false) +XSK_GSC_MAKE_GENERIC(asm_jmp_true) +XSK_GSC_MAKE_GENERIC(asm_switch) +XSK_GSC_MAKE_GENERIC(asm_endswitch) +XSK_GSC_MAKE_GENERIC(asm_prescriptcall) +XSK_GSC_MAKE_GENERIC(asm_voidcodepos) +XSK_GSC_MAKE_GENERIC(asm_create) +XSK_GSC_MAKE_GENERIC(asm_access) +XSK_GSC_MAKE_GENERIC(asm_remove) +XSK_GSC_MAKE_GENERIC(asm_clear) + +#undef XSK_GSC_MAKE_GENERIC + +} // namespace xsk::gsc::ast diff --git a/src/gsc/misc/exception.cpp b/src/gsc/misc/exception.cpp new file mode 100644 index 00000000..2e7ab2b3 --- /dev/null +++ b/src/gsc/misc/exception.cpp @@ -0,0 +1,33 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "location.hpp" +#include "exception.hpp" + +namespace xsk::gsc +{ + +error::error(std::string const& what) : std::runtime_error(fmt::format("[ERROR]: {}", what)) +{ +} + +asm_error::asm_error(std::string const& what) : std::runtime_error(fmt::format("[ERROR]:assembler: {}", what)) +{ +} + +disasm_error::disasm_error(std::string const& what) : std::runtime_error(fmt::format("[ERROR]:disassembler: {}", what)) +{ +} + +comp_error::comp_error(location const& loc, std::string const& what) : std::runtime_error(fmt::format("[ERROR]:compiler:{}: {}", loc.print(), what)) +{ +} + +decomp_error::decomp_error(std::string const& what) : std::runtime_error(fmt::format("[ERROR]:decompiler: {}", what)) +{ +} + +} // namespace xsk::gsc diff --git a/src/gsc/misc/exception.hpp b/src/gsc/misc/exception.hpp new file mode 100644 index 00000000..38666d9b --- /dev/null +++ b/src/gsc/misc/exception.hpp @@ -0,0 +1,41 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +class error : public std::runtime_error +{ +public: + error(std::string const& what); +}; + +class asm_error : public std::runtime_error +{ +public: + asm_error(std::string const& what); +}; + +class disasm_error : public std::runtime_error +{ +public: + disasm_error(std::string const& what); +}; + +class comp_error : public std::runtime_error +{ +public: + comp_error(location const& loc, std::string const& what); +}; + +class decomp_error : public std::runtime_error +{ +public: + decomp_error(std::string const& what); +}; + +} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/types.cpp b/src/gsc/misc/location.cpp similarity index 62% rename from src/utils/xsk/gsc/types.cpp rename to src/gsc/misc/location.cpp index 102d3e20..71e89faa 100644 --- a/src/utils/xsk/gsc/types.cpp +++ b/src/gsc/misc/location.cpp @@ -1,9 +1,10 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "stdinc.hpp" +#include "location.hpp" namespace xsk::gsc { diff --git a/src/utils/xsk/gsc/location.hpp b/src/gsc/misc/location.hpp similarity index 60% rename from src/utils/xsk/gsc/location.hpp rename to src/gsc/misc/location.hpp index 3f6f7e23..16629284 100644 --- a/src/utils/xsk/gsc/location.hpp +++ b/src/gsc/misc/location.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. @@ -8,20 +8,19 @@ namespace xsk::gsc { -/// 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. + filename_type *filename; + counter_type line; + counter_type column; + 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; @@ -29,9 +28,6 @@ public: column = c; } - /** \name Line and Column related manipulators - ** \{ */ - /// (line related) Advance to the COUNT next lines. void lines(counter_type count = 1) { if (count) @@ -41,179 +37,131 @@ public: } } - /// (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) +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. + position begin; + position end; + 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); + return fmt::format("{}:{}:{}", *begin.filename, begin.line, begin.column); } auto label() const -> std::string { - return utils::string::va("loc_%X", begin.line); + return fmt::format("loc_{:X}", begin.line); } - -public: - /// Beginning of the located region. - position begin; - /// End of the located region. - position end; }; -/// Join two locations, in place. inline location& operator+=(location &res, const location &end) { res.end = end.end; return res; } -/// Join two locations. inline location operator+(location res, const location &end) { return res += end; } -/// Add \a width columns to the end position, in place. inline location& operator+=(location &res, location::counter_type width) { res.columns(width); return res; } -/// Add \a width columns to the end position. inline location operator+(location res, location::counter_type width) { return res += width; } -/// Subtract \a width columns to the end position, in place. inline location& operator-=(location &res, location::counter_type width) { return res += -width; } -/// Subtract \a width columns to the end position. inline location operator-(location res, location::counter_type width) { return res -= width; } -/** \brief Intercept output stream redirection. - ** \param ostr the destination output stream -** \param loc a reference to the location to redirect -** -** Avoid duplicate information. -*/ -template -std::basic_ostream& operator<<(std::basic_ostream &ostr, const location &loc) +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; diff --git a/src/gsc/misc/scope.cpp b/src/gsc/misc/scope.cpp new file mode 100644 index 00000000..58d15116 --- /dev/null +++ b/src/gsc/misc/scope.cpp @@ -0,0 +1,183 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "scope.hpp" + +namespace xsk::gsc +{ + +scope::scope() : abort{ scope::abort_none }, create_count{ 0 }, public_count{ 0 }, is_last{ false } +{ +} + +auto scope::transfer_dec(scope::ptr const& child) -> void +{ + for (auto i = u32{ 0 }; i < vars.size(); i++) + { + child->vars.push_back(vars[i]); + } + + child->public_count = static_cast(vars.size()); +} + +auto scope::transfer(scope::ptr const& child) -> void +{ + child->abort = scope::abort_none; + child->loc_break = loc_break; + child->loc_cont = loc_cont; + + for (auto i = u32{ 0 }; i < child->public_count || i < create_count; i++) + { + auto pos = child->find(i, vars[i].name); + + if (pos < 0) + { + child->public_count++; + child->vars.insert(child->vars.begin() + i, vars[i]); + } + else + { + if (pos > static_cast(i)) + std::rotate(child->vars.rend() - pos - 1, child->vars.rend() - pos, child->vars.rend() - i); + else + std::rotate(child->vars.begin() + pos, child->vars.begin() + pos + 1, child->vars.begin() + i + 1); + + child->vars[i].init = vars[i].init; + + if (child->public_count <= i) + child->public_count++; + } + } + + child->create_count = create_count; +} + +auto scope::copy(scope::ptr const& child) -> void +{ + child->vars = vars; + child->create_count = create_count; + child->public_count = 0; +} + +auto scope::append_dec(scope::ptr const& child) -> void +{ + for (auto i = vars.size(); i < child->public_count; i++) + { + vars.push_back(child->vars[i]); + } +} + +auto scope::append(std::vector const& childs) -> void +{ + auto glob = true; + + if (childs.size() == 0) return; + + for (auto i = usize{ 0 }; i < childs[0]->vars.size(); i++) + { + glob = true; + auto& var = childs[0]->vars[i]; + + if (find(0, var.name) < 0) + { + for (auto j = usize{ 1 }; j < childs.size(); j++) + { + if (childs[j]->find(0, var.name) < 0) + { + glob = false; + } + } + + if (glob) + { + vars.push_back(var); + } + } + } +} + +auto scope::merge(std::vector const& childs) -> void +{ + if (childs.size() == 0) return; + + for (auto i = usize{ 0 }; i < childs.size(); i++) + { + auto child = childs[i]; + + child->public_count = static_cast(vars.size()); + + for (auto j = usize{ 0 }; j < vars.size(); j++) + { + auto pos = child->find(j, vars[j].name); + + if (pos < 0) + { + child->vars.insert(child->vars.begin() + j, vars[j]); + } + else if (pos > static_cast(j)) + { + auto& v = child->vars; + std::rotate(v.rend() - pos - 1, v.rend() - pos, v.rend() - j); + } + } + } +} + +auto scope::init(scope::ptr const& child) -> void +{ + create_count = child->create_count; + + for (auto i = u32{ 0 }; i < create_count; i++) + { + if (!vars[i].init) + vars[i].init = true; + } +} + +auto scope::init(std::vector const& childs) -> void +{ + if (childs.size() == 0) return; + + auto count = childs[0]->public_count; + + for (auto i = usize{ 1 }; i < childs.size(); i++) + { + if (childs[i]->public_count < count) + count = childs[i]->public_count; + } + + create_count = count; + + auto init = true; + + for (auto i = u32{ 0 }; i < count; i++) + { + init = true; + if (!vars[i].init) + { + for (auto j = usize{ 0 }; j < childs.size(); j++) + { + if (!childs[j]->vars[i].init) + init = false; + } + + if (init) vars[i].init = true; + } + } +} + +auto scope::find(usize start, std::string const& name) -> i32 +{ + for (auto i = start; i < vars.size(); i++) + { + if (vars[i].name == name) + return static_cast(i); + } + + return -1; +} + +} // namespace xsk::gsc diff --git a/src/gsc/misc/scope.hpp b/src/gsc/misc/scope.hpp new file mode 100644 index 00000000..c900f228 --- /dev/null +++ b/src/gsc/misc/scope.hpp @@ -0,0 +1,64 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +struct locjmp +{ + std::string end; + std::string cnt; + std::string brk; + bool last; +}; + +struct scope +{ + using ptr = std::unique_ptr; + + enum abort_type + { + abort_none = 0, + abort_continue = 1, + abort_break = 2, + abort_return = 3, + }; + + struct var + { + std::string name; + u8 create; + bool init; + }; + + abort_type abort; + std::string loc_end; + std::string loc_cont; + std::string loc_break; + u32 create_count; + u32 public_count; + std::vector vars; + bool is_last; + + scope(); + auto transfer_dec(scope::ptr const& child) -> void; + auto transfer(scope::ptr const& child) -> void; + auto copy(scope::ptr const& child) -> void; + auto append_dec(scope::ptr const& child) -> void; + auto append(std::vector const& childs) -> void; + auto merge(std::vector const& childs) -> void; + auto init(scope::ptr const& child) -> void; + auto init(std::vector const& childs) -> void; + auto find(usize start, std::string const& name) -> i32; +}; + +inline auto make_scope() -> std::unique_ptr +{ + return std::unique_ptr(new scope); +} + +} // namespace xsk::gsc diff --git a/src/gsc/misc/types.cpp b/src/gsc/misc/types.cpp new file mode 100644 index 00000000..36ec45c9 --- /dev/null +++ b/src/gsc/misc/types.cpp @@ -0,0 +1,31 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "types.hpp" + +namespace xsk::gsc +{ + +auto engine_name(engine engine) -> std::string_view +{ + switch (engine) + { + case engine::iw5: return "IW5"; + case engine::iw6: return "IW6"; + case engine::iw7: return "IW7"; + case engine::iw8: return "IW8"; + case engine::iw9: return "IW9"; + case engine::s1: return "S1"; + case engine::s2: return "S2"; + case engine::s4: return "S4"; + case engine::h1: return "H1"; + case engine::h2: return "H2"; + } + + return ""; +} + +} // namespace xsk::gsc diff --git a/src/gsc/misc/types.hpp b/src/gsc/misc/types.hpp new file mode 100644 index 00000000..0e0be991 --- /dev/null +++ b/src/gsc/misc/types.hpp @@ -0,0 +1,112 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "asset.hpp" +#include "scope.hpp" +#include "assembly.hpp" +#include "location.hpp" +#include "exception.hpp" +#include "ast.hpp" + +namespace xsk::gsc +{ + +enum class build : u8 +{ + dev, + prod, +}; + +enum class endian : u8 +{ + little, + big, +}; + +enum class system : u8 +{ + pc, + ps3, + xb2, +}; + +enum class engine : u8 +{ + iw5, + iw6, + iw7, + iw8, + iw9, + s1, + s2, + s4, + h1, + h2, +}; + +struct props +{ + enum values : u32 + { + none = 0 << 0, + str4 = 1 << 0, // strings size 4 + tok4 = 1 << 1, // tokenid size 4 + waitframe = 1 << 2, // waitframe opcode + params = 1 << 3, // packed func params + boolfuncs = 1 << 4, // isdefined, istrue + boolnotand = 1 << 5, // !&& expr opcode + offs8 = 1 << 6, // offset shift by 8 + offs9 = 1 << 7, // offset shift by 9 + hash = 1 << 9, // iw9 identifiers + farcall = 1 << 9, // iw9 new call system + foreach = 1 << 10, // iw9 foreach + }; + + props(values value) : value_(value) {} + operator values() { return value_; } + operator bool() { return value_ != values::none; } + props::values operator|(props::values rhs) const { return static_cast(value_ | rhs); } + props::values operator&(props::values rhs) const { return static_cast(value_ & rhs); } + + friend props::values operator|(props::values lhs, props::values rhs) + { + return static_cast(static_cast::type>(lhs) | static_cast::type>(rhs)); + } + + friend props::values operator&(props::values lhs, props::values rhs) + { + return static_cast(static_cast::type>(lhs) & static_cast::type>(rhs)); + } + +private: + values value_; +}; + +enum class switch_type +{ + none, + integer, + string, +}; + +struct buffer +{ + u8 const* data; + usize const size; + + buffer() : data{ nullptr }, size{ 0 } {} + buffer(u8 const* data, usize size) : data{ data }, size{ size } {} +}; + +using read_cb_type = std::function(std::string const&)>; + +auto engine_name(engine engine) -> std::string_view; + +// fordward decl for modules ref +class context; + +} // namespace xsk::gsc diff --git a/src/gsc/parser.cpp b/src/gsc/parser.cpp new file mode 100644 index 00000000..82c9b86d --- /dev/null +++ b/src/gsc/parser.cpp @@ -0,0 +1,4835 @@ +// A Bison parser, made by GNU Bison 3.8.2. + +// Skeleton implementation for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +// "%code top" blocks. +#line 40 "parser.ypp" + +#include "stdinc.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +namespace xsk::gsc +{ + auto GSClex(lexer& lexer) -> parser::symbol_type; + auto parse_switch(stmt_switch& stm) -> void; +} + +#line 51 "parser.cpp" + +// Take the name prefix into account. +#define yylex GSClex + + + +#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 GSCDEBUG + +// 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 // !GSCDEBUG + +# 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 // !GSCDEBUG + +#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 gsc { +#line 153 "parser.cpp" + + /// Build a parser object. + parser::parser (xsk::gsc::context const* ctx__yyarg, xsk::gsc::lexer& lexer_yyarg, xsk::gsc::program::ptr& ast_yyarg, std::uint32_t index_yyarg) +#if GSCDEBUG + : yydebug_ (false), + yycdebug_ (&std::cerr), +#else + : +#endif + yy_lac_established_ (false), + ctx_ (ctx__yyarg), + lexer (lexer_yyarg), + ast (ast_yyarg), + index (index_yyarg) + {} + + parser::~parser () + {} + + parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW + {} + + /*---------. + | symbol. | + `---------*/ + + + + // by_state. + parser::by_state::by_state () YY_NOEXCEPT + : state (empty_state) + {} + + parser::by_state::by_state (const by_state& that) YY_NOEXCEPT + : state (that.state) + {} + + void + parser::by_state::clear () YY_NOEXCEPT + { + state = empty_state; + } + + void + parser::by_state::move (by_state& that) + { + state = that.state; + that.clear (); + } + + parser::by_state::by_state (state_type s) YY_NOEXCEPT + : state (s) + {} + + parser::symbol_kind_type + parser::by_state::kind () const YY_NOEXCEPT + { + if (state == empty_state) + return symbol_kind::S_YYEMPTY; + else + return YY_CAST (symbol_kind_type, yystos_[+state]); + } + + parser::stack_symbol_type::stack_symbol_type () + {} + + parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) + : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + value.YY_MOVE_OR_COPY< call > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_declaration: // declaration + value.YY_MOVE_OR_COPY< decl > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_decl_function: // decl_function + value.YY_MOVE_OR_COPY< decl_function::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + value.YY_MOVE_OR_COPY< decl_usingtree::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_or_empty: // expr_or_empty + case symbol_kind::S_expr_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_tuple: // expr_tuple + case symbol_kind::S_expr_tuple_types: // expr_tuple_types + case symbol_kind::S_expr_object: // expr_object + value.YY_MOVE_OR_COPY< expr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_add_array: // expr_add_array + value.YY_MOVE_OR_COPY< expr_add_array::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_anim: // expr_anim + value.YY_MOVE_OR_COPY< expr_anim::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_animation: // expr_animation + value.YY_MOVE_OR_COPY< expr_animation::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_animtree: // expr_animtree + value.YY_MOVE_OR_COPY< expr_animtree::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty + value.YY_MOVE_OR_COPY< expr_arguments::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_array: // expr_array + value.YY_MOVE_OR_COPY< expr_array::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + value.YY_MOVE_OR_COPY< expr_call::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_complement: // expr_complement + value.YY_MOVE_OR_COPY< expr_complement::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_empty_array: // expr_empty_array + value.YY_MOVE_OR_COPY< expr_empty_array::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_false: // expr_false + value.YY_MOVE_OR_COPY< expr_false::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_field: // expr_field + value.YY_MOVE_OR_COPY< expr_field::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_float: // expr_float + value.YY_MOVE_OR_COPY< expr_float::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_game: // expr_game + value.YY_MOVE_OR_COPY< expr_game::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize + case symbol_kind::S_expr_identifier: // expr_identifier + value.YY_MOVE_OR_COPY< expr_identifier::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_integer: // expr_integer + value.YY_MOVE_OR_COPY< expr_integer::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + value.YY_MOVE_OR_COPY< expr_isdefined::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_istring: // expr_istring + value.YY_MOVE_OR_COPY< expr_istring::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_istrue: // expr_istrue + value.YY_MOVE_OR_COPY< expr_istrue::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_level: // expr_level + value.YY_MOVE_OR_COPY< expr_level::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_method: // expr_method + value.YY_MOVE_OR_COPY< expr_method::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_negate: // expr_negate + value.YY_MOVE_OR_COPY< expr_negate::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_not: // expr_not + value.YY_MOVE_OR_COPY< expr_not::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_parameters: // expr_parameters + value.YY_MOVE_OR_COPY< expr_parameters::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_paren: // expr_paren + value.YY_MOVE_OR_COPY< expr_paren::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_path: // expr_path + value.YY_MOVE_OR_COPY< expr_path::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_reference: // expr_reference + value.YY_MOVE_OR_COPY< expr_reference::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_self: // expr_self + value.YY_MOVE_OR_COPY< expr_self::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_size: // expr_size + value.YY_MOVE_OR_COPY< expr_size::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_string: // expr_string + value.YY_MOVE_OR_COPY< expr_string::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_thisthread: // expr_thisthread + value.YY_MOVE_OR_COPY< expr_thisthread::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_true: // expr_true + value.YY_MOVE_OR_COPY< expr_true::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments + value.YY_MOVE_OR_COPY< expr_tuple::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_undefined: // expr_undefined + value.YY_MOVE_OR_COPY< expr_undefined::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_vector: // expr_vector + value.YY_MOVE_OR_COPY< expr_vector::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.YY_MOVE_OR_COPY< include::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.YY_MOVE_OR_COPY< program::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_PATH: // "path" + case symbol_kind::S_IDENTIFIER: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "integer" + value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.YY_MOVE_OR_COPY< stmt > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.YY_MOVE_OR_COPY< stmt_assign::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.YY_MOVE_OR_COPY< stmt_break::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_breakpoint: // stmt_breakpoint + value.YY_MOVE_OR_COPY< stmt_breakpoint::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.YY_MOVE_OR_COPY< stmt_call::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.YY_MOVE_OR_COPY< stmt_case::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.YY_MOVE_OR_COPY< stmt_continue::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.YY_MOVE_OR_COPY< stmt_default::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.YY_MOVE_OR_COPY< stmt_dev::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.YY_MOVE_OR_COPY< stmt_dowhile::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.YY_MOVE_OR_COPY< stmt_endon::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + value.YY_MOVE_OR_COPY< stmt_expr::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.YY_MOVE_OR_COPY< stmt_for::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.YY_MOVE_OR_COPY< stmt_foreach::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.YY_MOVE_OR_COPY< stmt_if::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.YY_MOVE_OR_COPY< stmt_ifelse::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + case symbol_kind::S_stmt_block: // stmt_block + value.YY_MOVE_OR_COPY< stmt_list::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.YY_MOVE_OR_COPY< stmt_notify::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.YY_MOVE_OR_COPY< stmt_prof_begin::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.YY_MOVE_OR_COPY< stmt_prof_end::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.YY_MOVE_OR_COPY< stmt_return::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.YY_MOVE_OR_COPY< stmt_switch::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.YY_MOVE_OR_COPY< stmt_wait::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.YY_MOVE_OR_COPY< stmt_waitframe::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.YY_MOVE_OR_COPY< stmt_waittill::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.YY_MOVE_OR_COPY< stmt_waittillframeend::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.YY_MOVE_OR_COPY< stmt_waittillmatch::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.YY_MOVE_OR_COPY< stmt_while::ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + +#if 201103L <= YY_CPLUSPLUS + // that is emptied. + that.state = empty_state; +#endif + } + + parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) + : super_type (s, YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + value.move< call > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_declaration: // declaration + value.move< decl > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_decl_function: // decl_function + value.move< decl_function::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + value.move< decl_usingtree::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_or_empty: // expr_or_empty + case symbol_kind::S_expr_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_tuple: // expr_tuple + case symbol_kind::S_expr_tuple_types: // expr_tuple_types + case symbol_kind::S_expr_object: // expr_object + value.move< expr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_add_array: // expr_add_array + value.move< expr_add_array::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_anim: // expr_anim + value.move< expr_anim::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_animation: // expr_animation + value.move< expr_animation::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_animtree: // expr_animtree + value.move< expr_animtree::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty + value.move< expr_arguments::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_array: // expr_array + value.move< expr_array::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + value.move< expr_call::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_complement: // expr_complement + value.move< expr_complement::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_empty_array: // expr_empty_array + value.move< expr_empty_array::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_false: // expr_false + value.move< expr_false::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_field: // expr_field + value.move< expr_field::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_float: // expr_float + value.move< expr_float::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_game: // expr_game + value.move< expr_game::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize + case symbol_kind::S_expr_identifier: // expr_identifier + value.move< expr_identifier::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_integer: // expr_integer + value.move< expr_integer::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + value.move< expr_isdefined::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_istring: // expr_istring + value.move< expr_istring::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_istrue: // expr_istrue + value.move< expr_istrue::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_level: // expr_level + value.move< expr_level::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_method: // expr_method + value.move< expr_method::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_negate: // expr_negate + value.move< expr_negate::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_not: // expr_not + value.move< expr_not::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_parameters: // expr_parameters + value.move< expr_parameters::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_paren: // expr_paren + value.move< expr_paren::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_path: // expr_path + value.move< expr_path::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_reference: // expr_reference + value.move< expr_reference::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_self: // expr_self + value.move< expr_self::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_size: // expr_size + value.move< expr_size::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_string: // expr_string + value.move< expr_string::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_thisthread: // expr_thisthread + value.move< expr_thisthread::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_true: // expr_true + value.move< expr_true::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments + value.move< expr_tuple::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_undefined: // expr_undefined + value.move< expr_undefined::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_vector: // expr_vector + value.move< expr_vector::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_PATH: // "path" + case symbol_kind::S_IDENTIFIER: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "integer" + value.move< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.move< stmt > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_breakpoint: // stmt_breakpoint + value.move< stmt_breakpoint::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.move< stmt_dev::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.move< stmt_dowhile::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + value.move< stmt_expr::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + case symbol_kind::S_stmt_block: // stmt_block + value.move< stmt_list::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.move< stmt_prof_begin::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.move< stmt_prof_end::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while::ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + // that is emptied. + that.kind_ = symbol_kind::S_YYEMPTY; + } + +#if YY_CPLUSPLUS < 201103L + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + value.copy< call > (that.value); + break; + + case symbol_kind::S_declaration: // declaration + value.copy< decl > (that.value); + break; + + case symbol_kind::S_decl_function: // decl_function + value.copy< decl_function::ptr > (that.value); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + value.copy< decl_usingtree::ptr > (that.value); + break; + + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_or_empty: // expr_or_empty + case symbol_kind::S_expr_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_tuple: // expr_tuple + case symbol_kind::S_expr_tuple_types: // expr_tuple_types + case symbol_kind::S_expr_object: // expr_object + value.copy< expr > (that.value); + break; + + case symbol_kind::S_expr_add_array: // expr_add_array + value.copy< expr_add_array::ptr > (that.value); + break; + + case symbol_kind::S_expr_anim: // expr_anim + value.copy< expr_anim::ptr > (that.value); + break; + + case symbol_kind::S_expr_animation: // expr_animation + value.copy< expr_animation::ptr > (that.value); + break; + + case symbol_kind::S_expr_animtree: // expr_animtree + value.copy< expr_animtree::ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty + value.copy< expr_arguments::ptr > (that.value); + break; + + case symbol_kind::S_expr_array: // expr_array + value.copy< expr_array::ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + value.copy< expr_call::ptr > (that.value); + break; + + case symbol_kind::S_expr_complement: // expr_complement + value.copy< expr_complement::ptr > (that.value); + break; + + case symbol_kind::S_expr_empty_array: // expr_empty_array + value.copy< expr_empty_array::ptr > (that.value); + break; + + case symbol_kind::S_expr_false: // expr_false + value.copy< expr_false::ptr > (that.value); + break; + + case symbol_kind::S_expr_field: // expr_field + value.copy< expr_field::ptr > (that.value); + break; + + case symbol_kind::S_expr_float: // expr_float + value.copy< expr_float::ptr > (that.value); + break; + + case symbol_kind::S_expr_game: // expr_game + value.copy< expr_game::ptr > (that.value); + break; + + case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize + case symbol_kind::S_expr_identifier: // expr_identifier + value.copy< expr_identifier::ptr > (that.value); + break; + + case symbol_kind::S_expr_integer: // expr_integer + value.copy< expr_integer::ptr > (that.value); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + value.copy< expr_isdefined::ptr > (that.value); + break; + + case symbol_kind::S_expr_istring: // expr_istring + value.copy< expr_istring::ptr > (that.value); + break; + + case symbol_kind::S_expr_istrue: // expr_istrue + value.copy< expr_istrue::ptr > (that.value); + break; + + case symbol_kind::S_expr_level: // expr_level + value.copy< expr_level::ptr > (that.value); + break; + + case symbol_kind::S_expr_method: // expr_method + value.copy< expr_method::ptr > (that.value); + break; + + case symbol_kind::S_expr_negate: // expr_negate + value.copy< expr_negate::ptr > (that.value); + break; + + case symbol_kind::S_expr_not: // expr_not + value.copy< expr_not::ptr > (that.value); + break; + + case symbol_kind::S_expr_parameters: // expr_parameters + value.copy< expr_parameters::ptr > (that.value); + break; + + case symbol_kind::S_expr_paren: // expr_paren + value.copy< expr_paren::ptr > (that.value); + break; + + case symbol_kind::S_expr_path: // expr_path + value.copy< expr_path::ptr > (that.value); + break; + + case symbol_kind::S_expr_reference: // expr_reference + value.copy< expr_reference::ptr > (that.value); + break; + + case symbol_kind::S_expr_self: // expr_self + value.copy< expr_self::ptr > (that.value); + break; + + case symbol_kind::S_expr_size: // expr_size + value.copy< expr_size::ptr > (that.value); + break; + + case symbol_kind::S_expr_string: // expr_string + value.copy< expr_string::ptr > (that.value); + break; + + case symbol_kind::S_expr_thisthread: // expr_thisthread + value.copy< expr_thisthread::ptr > (that.value); + break; + + case symbol_kind::S_expr_true: // expr_true + value.copy< expr_true::ptr > (that.value); + break; + + case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments + value.copy< expr_tuple::ptr > (that.value); + break; + + case symbol_kind::S_expr_undefined: // expr_undefined + value.copy< expr_undefined::ptr > (that.value); + break; + + case symbol_kind::S_expr_vector: // expr_vector + value.copy< expr_vector::ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.copy< include::ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.copy< program::ptr > (that.value); + break; + + case symbol_kind::S_PATH: // "path" + case symbol_kind::S_IDENTIFIER: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "integer" + value.copy< std::string > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.copy< stmt > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign::ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break::ptr > (that.value); + break; + + case symbol_kind::S_stmt_breakpoint: // stmt_breakpoint + value.copy< stmt_breakpoint::ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call::ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case::ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue::ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default::ptr > (that.value); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.copy< stmt_dev::ptr > (that.value); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.copy< stmt_dowhile::ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon::ptr > (that.value); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + value.copy< stmt_expr::ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for::ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach::ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if::ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse::ptr > (that.value); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + case symbol_kind::S_stmt_block: // stmt_block + value.copy< stmt_list::ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify::ptr > (that.value); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.copy< stmt_prof_begin::ptr > (that.value); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.copy< stmt_prof_end::ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return::ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch::ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.copy< stmt_waitframe::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch::ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while::ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + return *this; + } + + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + value.move< call > (that.value); + break; + + case symbol_kind::S_declaration: // declaration + value.move< decl > (that.value); + break; + + case symbol_kind::S_decl_function: // decl_function + value.move< decl_function::ptr > (that.value); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + value.move< decl_usingtree::ptr > (that.value); + break; + + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_or_empty: // expr_or_empty + case symbol_kind::S_expr_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_tuple: // expr_tuple + case symbol_kind::S_expr_tuple_types: // expr_tuple_types + case symbol_kind::S_expr_object: // expr_object + value.move< expr > (that.value); + break; + + case symbol_kind::S_expr_add_array: // expr_add_array + value.move< expr_add_array::ptr > (that.value); + break; + + case symbol_kind::S_expr_anim: // expr_anim + value.move< expr_anim::ptr > (that.value); + break; + + case symbol_kind::S_expr_animation: // expr_animation + value.move< expr_animation::ptr > (that.value); + break; + + case symbol_kind::S_expr_animtree: // expr_animtree + value.move< expr_animtree::ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty + value.move< expr_arguments::ptr > (that.value); + break; + + case symbol_kind::S_expr_array: // expr_array + value.move< expr_array::ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + value.move< expr_call::ptr > (that.value); + break; + + case symbol_kind::S_expr_complement: // expr_complement + value.move< expr_complement::ptr > (that.value); + break; + + case symbol_kind::S_expr_empty_array: // expr_empty_array + value.move< expr_empty_array::ptr > (that.value); + break; + + case symbol_kind::S_expr_false: // expr_false + value.move< expr_false::ptr > (that.value); + break; + + case symbol_kind::S_expr_field: // expr_field + value.move< expr_field::ptr > (that.value); + break; + + case symbol_kind::S_expr_float: // expr_float + value.move< expr_float::ptr > (that.value); + break; + + case symbol_kind::S_expr_game: // expr_game + value.move< expr_game::ptr > (that.value); + break; + + case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize + case symbol_kind::S_expr_identifier: // expr_identifier + value.move< expr_identifier::ptr > (that.value); + break; + + case symbol_kind::S_expr_integer: // expr_integer + value.move< expr_integer::ptr > (that.value); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + value.move< expr_isdefined::ptr > (that.value); + break; + + case symbol_kind::S_expr_istring: // expr_istring + value.move< expr_istring::ptr > (that.value); + break; + + case symbol_kind::S_expr_istrue: // expr_istrue + value.move< expr_istrue::ptr > (that.value); + break; + + case symbol_kind::S_expr_level: // expr_level + value.move< expr_level::ptr > (that.value); + break; + + case symbol_kind::S_expr_method: // expr_method + value.move< expr_method::ptr > (that.value); + break; + + case symbol_kind::S_expr_negate: // expr_negate + value.move< expr_negate::ptr > (that.value); + break; + + case symbol_kind::S_expr_not: // expr_not + value.move< expr_not::ptr > (that.value); + break; + + case symbol_kind::S_expr_parameters: // expr_parameters + value.move< expr_parameters::ptr > (that.value); + break; + + case symbol_kind::S_expr_paren: // expr_paren + value.move< expr_paren::ptr > (that.value); + break; + + case symbol_kind::S_expr_path: // expr_path + value.move< expr_path::ptr > (that.value); + break; + + case symbol_kind::S_expr_reference: // expr_reference + value.move< expr_reference::ptr > (that.value); + break; + + case symbol_kind::S_expr_self: // expr_self + value.move< expr_self::ptr > (that.value); + break; + + case symbol_kind::S_expr_size: // expr_size + value.move< expr_size::ptr > (that.value); + break; + + case symbol_kind::S_expr_string: // expr_string + value.move< expr_string::ptr > (that.value); + break; + + case symbol_kind::S_expr_thisthread: // expr_thisthread + value.move< expr_thisthread::ptr > (that.value); + break; + + case symbol_kind::S_expr_true: // expr_true + value.move< expr_true::ptr > (that.value); + break; + + case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments + value.move< expr_tuple::ptr > (that.value); + break; + + case symbol_kind::S_expr_undefined: // expr_undefined + value.move< expr_undefined::ptr > (that.value); + break; + + case symbol_kind::S_expr_vector: // expr_vector + value.move< expr_vector::ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.move< include::ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.move< program::ptr > (that.value); + break; + + case symbol_kind::S_PATH: // "path" + case symbol_kind::S_IDENTIFIER: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "integer" + value.move< std::string > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.move< stmt > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign::ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break::ptr > (that.value); + break; + + case symbol_kind::S_stmt_breakpoint: // stmt_breakpoint + value.move< stmt_breakpoint::ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call::ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case::ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue::ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default::ptr > (that.value); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.move< stmt_dev::ptr > (that.value); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.move< stmt_dowhile::ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon::ptr > (that.value); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + value.move< stmt_expr::ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for::ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach::ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if::ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse::ptr > (that.value); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + case symbol_kind::S_stmt_block: // stmt_block + value.move< stmt_list::ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify::ptr > (that.value); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.move< stmt_prof_begin::ptr > (that.value); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.move< stmt_prof_end::ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return::ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch::ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch::ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while::ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + // that is emptied. + that.state = empty_state; + return *this; + } +#endif + + template + void + parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym); + } + +#if GSCDEBUG + template + void + parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const + { + std::ostream& yyoutput = yyo; + YY_USE (yyoutput); + if (yysym.empty ()) + yyo << "empty symbol"; + else + { + symbol_kind_type yykind = yysym.kind (); + yyo << (yykind < YYNTOKENS ? "token" : "nterm") + << ' ' << yysym.name () << " (" + << yysym.location << ": "; + YY_USE (yykind); + yyo << ')'; + } + } +#endif + + void + parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) + { + if (m) + YY_SYMBOL_PRINT (m, sym); + yystack_.push (YY_MOVE (sym)); + } + + void + parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) + { +#if 201103L <= YY_CPLUSPLUS + yypush_ (m, stack_symbol_type (s, std::move (sym))); +#else + stack_symbol_type ss (s, sym); + yypush_ (m, ss); +#endif + } + + void + parser::yypop_ (int n) YY_NOEXCEPT + { + yystack_.pop (n); + } + +#if GSCDEBUG + 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 // GSCDEBUG + + parser::state_type + parser::yy_lr_goto_state_ (state_type yystate, int yysym) + { + int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - YYNTOKENS]; + } + + bool + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT + { + return yyvalue == yypact_ninf_; + } + + bool + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT + { + return yyvalue == yytable_ninf_; + } + + int + parser::operator() () + { + return parse (); + } + + int + parser::parse () + { + int yyn; + /// Length of the RHS of the rule being reduced. + int yylen = 0; + + // Error handling. + int yynerrs_ = 0; + int yyerrstatus_ = 0; + + /// The lookahead symbol. + symbol_type yyla; + + /// The locations where the error started and ended. + stack_symbol_type yyerror_range[3]; + + /// The return value of parse (). + int yyresult; + + // Discard the LAC context in case there still is one left from a + // previous invocation. + yy_lac_discard_ ("init"); + +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + YYCDEBUG << "Starting parse\n"; + + + /* Initialize the stack. The initial state will be set in + yynewstate, since the latter expects the semantical and the + location values to have been already stored, initialize these + stacks with a primary value. */ + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); + + /*-----------------------------------------------. + | yynewstate -- push a new symbol on the stack. | + `-----------------------------------------------*/ + yynewstate: + YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; + YY_STACK_PRINT (); + + // Accept? + if (yystack_[0].state == yyfinal_) + YYACCEPT; + + goto yybackup; + + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + // Try to take a decision without lookahead. + yyn = yypact_[+yystack_[0].state]; + if (yy_pact_value_is_default_ (yyn)) + goto yydefault; + + // Read a lookahead token. + if (yyla.empty ()) + { + YYCDEBUG << "Reading a token\n"; +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + symbol_type yylookahead (yylex (lexer)); + yyla.move (yylookahead); + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + goto yyerrlab1; + } +#endif // YY_EXCEPTIONS + } + YY_SYMBOL_PRINT ("Next token is", yyla); + + if (yyla.kind () == symbol_kind::S_YYerror) + { + // The scanner already issued an error message, process directly + // to error recovery. But do not keep the error token as + // lookahead, it is too special and may lead us to an endless + // loop in error recovery. */ + yyla.kind_ = symbol_kind::S_YYUNDEF; + goto yyerrlab1; + } + + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.kind (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) + { + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + goto yydefault; + } + + // Reduce or error. + yyn = yytable_[yyn]; + if (yyn <= 0) + { + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + + yyn = -yyn; + goto yyreduce; + } + + // Count tokens shifted since error; after three, turn off error status. + if (yyerrstatus_) + --yyerrstatus_; + + // Shift the lookahead token. + yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); + yy_lac_discard_ ("shift"); + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact_[+yystack_[0].state]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- do a reduction. | + `-----------------------------*/ + yyreduce: + yylen = yyr2_[yyn]; + { + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); + /* Variants are always initialized to an empty instance of the + correct type. The default '$$ = $1' action is NOT applied + when using variants. */ + switch (yyr1_[yyn]) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + yylhs.value.emplace< call > (); + break; + + case symbol_kind::S_declaration: // declaration + yylhs.value.emplace< decl > (); + break; + + case symbol_kind::S_decl_function: // decl_function + yylhs.value.emplace< decl_function::ptr > (); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + yylhs.value.emplace< decl_usingtree::ptr > (); + break; + + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_or_empty: // expr_or_empty + case symbol_kind::S_expr_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_tuple: // expr_tuple + case symbol_kind::S_expr_tuple_types: // expr_tuple_types + case symbol_kind::S_expr_object: // expr_object + yylhs.value.emplace< expr > (); + break; + + case symbol_kind::S_expr_add_array: // expr_add_array + yylhs.value.emplace< expr_add_array::ptr > (); + break; + + case symbol_kind::S_expr_anim: // expr_anim + yylhs.value.emplace< expr_anim::ptr > (); + break; + + case symbol_kind::S_expr_animation: // expr_animation + yylhs.value.emplace< expr_animation::ptr > (); + break; + + case symbol_kind::S_expr_animtree: // expr_animtree + yylhs.value.emplace< expr_animtree::ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty + yylhs.value.emplace< expr_arguments::ptr > (); + break; + + case symbol_kind::S_expr_array: // expr_array + yylhs.value.emplace< expr_array::ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + yylhs.value.emplace< expr_call::ptr > (); + break; + + case symbol_kind::S_expr_complement: // expr_complement + yylhs.value.emplace< expr_complement::ptr > (); + break; + + case symbol_kind::S_expr_empty_array: // expr_empty_array + yylhs.value.emplace< expr_empty_array::ptr > (); + break; + + case symbol_kind::S_expr_false: // expr_false + yylhs.value.emplace< expr_false::ptr > (); + break; + + case symbol_kind::S_expr_field: // expr_field + yylhs.value.emplace< expr_field::ptr > (); + break; + + case symbol_kind::S_expr_float: // expr_float + yylhs.value.emplace< expr_float::ptr > (); + break; + + case symbol_kind::S_expr_game: // expr_game + yylhs.value.emplace< expr_game::ptr > (); + break; + + case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize + case symbol_kind::S_expr_identifier: // expr_identifier + yylhs.value.emplace< expr_identifier::ptr > (); + break; + + case symbol_kind::S_expr_integer: // expr_integer + yylhs.value.emplace< expr_integer::ptr > (); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + yylhs.value.emplace< expr_isdefined::ptr > (); + break; + + case symbol_kind::S_expr_istring: // expr_istring + yylhs.value.emplace< expr_istring::ptr > (); + break; + + case symbol_kind::S_expr_istrue: // expr_istrue + yylhs.value.emplace< expr_istrue::ptr > (); + break; + + case symbol_kind::S_expr_level: // expr_level + yylhs.value.emplace< expr_level::ptr > (); + break; + + case symbol_kind::S_expr_method: // expr_method + yylhs.value.emplace< expr_method::ptr > (); + break; + + case symbol_kind::S_expr_negate: // expr_negate + yylhs.value.emplace< expr_negate::ptr > (); + break; + + case symbol_kind::S_expr_not: // expr_not + yylhs.value.emplace< expr_not::ptr > (); + break; + + case symbol_kind::S_expr_parameters: // expr_parameters + yylhs.value.emplace< expr_parameters::ptr > (); + break; + + case symbol_kind::S_expr_paren: // expr_paren + yylhs.value.emplace< expr_paren::ptr > (); + break; + + case symbol_kind::S_expr_path: // expr_path + yylhs.value.emplace< expr_path::ptr > (); + break; + + case symbol_kind::S_expr_reference: // expr_reference + yylhs.value.emplace< expr_reference::ptr > (); + break; + + case symbol_kind::S_expr_self: // expr_self + yylhs.value.emplace< expr_self::ptr > (); + break; + + case symbol_kind::S_expr_size: // expr_size + yylhs.value.emplace< expr_size::ptr > (); + break; + + case symbol_kind::S_expr_string: // expr_string + yylhs.value.emplace< expr_string::ptr > (); + break; + + case symbol_kind::S_expr_thisthread: // expr_thisthread + yylhs.value.emplace< expr_thisthread::ptr > (); + break; + + case symbol_kind::S_expr_true: // expr_true + yylhs.value.emplace< expr_true::ptr > (); + break; + + case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments + yylhs.value.emplace< expr_tuple::ptr > (); + break; + + case symbol_kind::S_expr_undefined: // expr_undefined + yylhs.value.emplace< expr_undefined::ptr > (); + break; + + case symbol_kind::S_expr_vector: // expr_vector + yylhs.value.emplace< expr_vector::ptr > (); + break; + + case symbol_kind::S_include: // include + yylhs.value.emplace< include::ptr > (); + break; + + case symbol_kind::S_program: // program + yylhs.value.emplace< program::ptr > (); + break; + + case symbol_kind::S_PATH: // "path" + case symbol_kind::S_IDENTIFIER: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "integer" + yylhs.value.emplace< std::string > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + yylhs.value.emplace< stmt > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + yylhs.value.emplace< stmt_assign::ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + yylhs.value.emplace< stmt_break::ptr > (); + break; + + case symbol_kind::S_stmt_breakpoint: // stmt_breakpoint + yylhs.value.emplace< stmt_breakpoint::ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + yylhs.value.emplace< stmt_call::ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + yylhs.value.emplace< stmt_case::ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + yylhs.value.emplace< stmt_continue::ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + yylhs.value.emplace< stmt_default::ptr > (); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + yylhs.value.emplace< stmt_dev::ptr > (); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + yylhs.value.emplace< stmt_dowhile::ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + yylhs.value.emplace< stmt_endon::ptr > (); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + yylhs.value.emplace< stmt_expr::ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + yylhs.value.emplace< stmt_for::ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + yylhs.value.emplace< stmt_foreach::ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + yylhs.value.emplace< stmt_if::ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + yylhs.value.emplace< stmt_ifelse::ptr > (); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + case symbol_kind::S_stmt_block: // stmt_block + yylhs.value.emplace< stmt_list::ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + yylhs.value.emplace< stmt_notify::ptr > (); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + yylhs.value.emplace< stmt_prof_begin::ptr > (); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + yylhs.value.emplace< stmt_prof_end::ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + yylhs.value.emplace< stmt_return::ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + yylhs.value.emplace< stmt_switch::ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + yylhs.value.emplace< stmt_wait::ptr > (); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + yylhs.value.emplace< stmt_waitframe::ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + yylhs.value.emplace< stmt_waittill::ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + yylhs.value.emplace< stmt_waittillframeend::ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + yylhs.value.emplace< stmt_waittillmatch::ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + yylhs.value.emplace< stmt_while::ptr > (); + break; + + default: + break; + } + + + // Default location. + { + stack_type::slice range (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, range, yylen); + yyerror_range[1].location = yylhs.location; + } + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + switch (yyn) + { + case 2: // root: program +#line 272 "parser.ypp" + { ast = std::move(yystack_[0].value.as < program::ptr > ()); } +#line 2066 "parser.cpp" + break; + + case 3: // root: %empty +#line 273 "parser.ypp" + { ast = make_program(yylhs.location); } +#line 2072 "parser.cpp" + break; + + case 4: // program: program inline +#line 278 "parser.ypp" + { yylhs.value.as < program::ptr > () = std::move(yystack_[1].value.as < program::ptr > ()); } +#line 2078 "parser.cpp" + break; + + case 5: // program: program include +#line 280 "parser.ypp" + { yylhs.value.as < program::ptr > () = std::move(yystack_[1].value.as < program::ptr > ()); yylhs.value.as < program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include::ptr > ())); } +#line 2084 "parser.cpp" + break; + + case 6: // program: program declaration +#line 282 "parser.ypp" + { yylhs.value.as < program::ptr > () = std::move(yystack_[1].value.as < program::ptr > ()); yylhs.value.as < program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < decl > ())); } +#line 2090 "parser.cpp" + break; + + case 7: // program: inline +#line 284 "parser.ypp" + { yylhs.value.as < program::ptr > () = make_program(yylhs.location); } +#line 2096 "parser.cpp" + break; + + case 8: // program: include +#line 286 "parser.ypp" + { yylhs.value.as < program::ptr > () = make_program(yylhs.location); yylhs.value.as < program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include::ptr > ())); } +#line 2102 "parser.cpp" + break; + + case 9: // program: declaration +#line 288 "parser.ypp" + { yylhs.value.as < program::ptr > () = make_program(yylhs.location); yylhs.value.as < program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < decl > ())); } +#line 2108 "parser.cpp" + break; + + case 10: // inline: "#inline" expr_path ";" +#line 292 "parser.ypp" + { lexer.push_header(yystack_[1].value.as < expr_path::ptr > ()->value); } +#line 2114 "parser.cpp" + break; + + case 11: // include: "#include" expr_path ";" +#line 297 "parser.ypp" + { yylhs.value.as < include::ptr > () = make_include(yylhs.location, std::move(yystack_[1].value.as < expr_path::ptr > ())); } +#line 2120 "parser.cpp" + break; + + case 12: // declaration: "/#" +#line 301 "parser.ypp" + { yylhs.value.as < decl > ().as_dev_begin = make_decl_dev_begin(yylhs.location); } +#line 2126 "parser.cpp" + break; + + case 13: // declaration: "#/" +#line 302 "parser.ypp" + { yylhs.value.as < decl > ().as_dev_end = make_decl_dev_end(yylhs.location); } +#line 2132 "parser.cpp" + break; + + case 14: // declaration: decl_usingtree +#line 303 "parser.ypp" + { yylhs.value.as < decl > ().as_usingtree = std::move(yystack_[0].value.as < decl_usingtree::ptr > ()); } +#line 2138 "parser.cpp" + break; + + case 15: // declaration: decl_function +#line 304 "parser.ypp" + { yylhs.value.as < decl > ().as_function = std::move(yystack_[0].value.as < decl_function::ptr > ()); } +#line 2144 "parser.cpp" + break; + + case 16: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" +#line 309 "parser.ypp" + { lexer.ban_header(yylhs.location); yylhs.value.as < decl_usingtree::ptr > () = make_decl_usingtree(yylhs.location, std::move(yystack_[2].value.as < expr_string::ptr > ())); } +#line 2150 "parser.cpp" + break; + + case 17: // decl_function: expr_identifier "(" expr_parameters ")" stmt_block +#line 314 "parser.ypp" + { lexer.ban_header(yylhs.location); yylhs.value.as < decl_function::ptr > () = make_decl_function(yylhs.location, std::move(yystack_[4].value.as < expr_identifier::ptr > ()), std::move(yystack_[2].value.as < expr_parameters::ptr > ()), std::move(yystack_[0].value.as < stmt_list::ptr > ())); } +#line 2156 "parser.cpp" + break; + + case 18: // stmt: stmt_block +#line 318 "parser.ypp" + { yylhs.value.as < stmt > ().as_list = std::move(yystack_[0].value.as < stmt_list::ptr > ()); } +#line 2162 "parser.cpp" + break; + + case 19: // stmt: stmt_call +#line 319 "parser.ypp" + { yylhs.value.as < stmt > ().as_call = std::move(yystack_[0].value.as < stmt_call::ptr > ()); } +#line 2168 "parser.cpp" + break; + + case 20: // stmt: stmt_assign +#line 320 "parser.ypp" + { yylhs.value.as < stmt > ().as_assign = std::move(yystack_[0].value.as < stmt_assign::ptr > ()); } +#line 2174 "parser.cpp" + break; + + case 21: // stmt: stmt_endon +#line 321 "parser.ypp" + { yylhs.value.as < stmt > ().as_endon = std::move(yystack_[0].value.as < stmt_endon::ptr > ()); } +#line 2180 "parser.cpp" + break; + + case 22: // stmt: stmt_notify +#line 322 "parser.ypp" + { yylhs.value.as < stmt > ().as_notify = std::move(yystack_[0].value.as < stmt_notify::ptr > ()); } +#line 2186 "parser.cpp" + break; + + case 23: // stmt: stmt_wait +#line 323 "parser.ypp" + { yylhs.value.as < stmt > ().as_wait = std::move(yystack_[0].value.as < stmt_wait::ptr > ()); } +#line 2192 "parser.cpp" + break; + + case 24: // stmt: stmt_waittill +#line 324 "parser.ypp" + { yylhs.value.as < stmt > ().as_waittill = std::move(yystack_[0].value.as < stmt_waittill::ptr > ()); } +#line 2198 "parser.cpp" + break; + + case 25: // stmt: stmt_waittillmatch +#line 325 "parser.ypp" + { yylhs.value.as < stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < stmt_waittillmatch::ptr > ()); } +#line 2204 "parser.cpp" + break; + + case 26: // stmt: stmt_waittillframeend +#line 326 "parser.ypp" + { yylhs.value.as < stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < stmt_waittillframeend::ptr > ()); } +#line 2210 "parser.cpp" + break; + + case 27: // stmt: stmt_waitframe +#line 327 "parser.ypp" + { yylhs.value.as < stmt > ().as_waitframe = std::move(yystack_[0].value.as < stmt_waitframe::ptr > ()); } +#line 2216 "parser.cpp" + break; + + case 28: // stmt: stmt_if +#line 328 "parser.ypp" + { yylhs.value.as < stmt > ().as_if = std::move(yystack_[0].value.as < stmt_if::ptr > ()); } +#line 2222 "parser.cpp" + break; + + case 29: // stmt: stmt_ifelse +#line 329 "parser.ypp" + { yylhs.value.as < stmt > ().as_ifelse = std::move(yystack_[0].value.as < stmt_ifelse::ptr > ()); } +#line 2228 "parser.cpp" + break; + + case 30: // stmt: stmt_while +#line 330 "parser.ypp" + { yylhs.value.as < stmt > ().as_while = std::move(yystack_[0].value.as < stmt_while::ptr > ()); } +#line 2234 "parser.cpp" + break; + + case 31: // stmt: stmt_dowhile +#line 331 "parser.ypp" + { yylhs.value.as < stmt > ().as_dowhile = std::move(yystack_[0].value.as < stmt_dowhile::ptr > ()); } +#line 2240 "parser.cpp" + break; + + case 32: // stmt: stmt_for +#line 332 "parser.ypp" + { yylhs.value.as < stmt > ().as_for = std::move(yystack_[0].value.as < stmt_for::ptr > ()); } +#line 2246 "parser.cpp" + break; + + case 33: // stmt: stmt_foreach +#line 333 "parser.ypp" + { yylhs.value.as < stmt > ().as_foreach = std::move(yystack_[0].value.as < stmt_foreach::ptr > ()); } +#line 2252 "parser.cpp" + break; + + case 34: // stmt: stmt_switch +#line 334 "parser.ypp" + { yylhs.value.as < stmt > ().as_switch = std::move(yystack_[0].value.as < stmt_switch::ptr > ()); } +#line 2258 "parser.cpp" + break; + + case 35: // stmt: stmt_case +#line 335 "parser.ypp" + { yylhs.value.as < stmt > ().as_case = std::move(yystack_[0].value.as < stmt_case::ptr > ()); } +#line 2264 "parser.cpp" + break; + + case 36: // stmt: stmt_default +#line 336 "parser.ypp" + { yylhs.value.as < stmt > ().as_default = std::move(yystack_[0].value.as < stmt_default::ptr > ()); } +#line 2270 "parser.cpp" + break; + + case 37: // stmt: stmt_break +#line 337 "parser.ypp" + { yylhs.value.as < stmt > ().as_break = std::move(yystack_[0].value.as < stmt_break::ptr > ()); } +#line 2276 "parser.cpp" + break; + + case 38: // stmt: stmt_continue +#line 338 "parser.ypp" + { yylhs.value.as < stmt > ().as_continue = std::move(yystack_[0].value.as < stmt_continue::ptr > ()); } +#line 2282 "parser.cpp" + break; + + case 39: // stmt: stmt_return +#line 339 "parser.ypp" + { yylhs.value.as < stmt > ().as_return = std::move(yystack_[0].value.as < stmt_return::ptr > ()); } +#line 2288 "parser.cpp" + break; + + case 40: // stmt: stmt_breakpoint +#line 340 "parser.ypp" + { yylhs.value.as < stmt > ().as_breakpoint = std::move(yystack_[0].value.as < stmt_breakpoint::ptr > ()); } +#line 2294 "parser.cpp" + break; + + case 41: // stmt: stmt_prof_begin +#line 341 "parser.ypp" + { yylhs.value.as < stmt > ().as_prof_begin = std::move(yystack_[0].value.as < stmt_prof_begin::ptr > ()); } +#line 2300 "parser.cpp" + break; + + case 42: // stmt: stmt_prof_end +#line 342 "parser.ypp" + { yylhs.value.as < stmt > ().as_prof_end = std::move(yystack_[0].value.as < stmt_prof_end::ptr > ()); } +#line 2306 "parser.cpp" + break; + + case 43: // stmt_or_dev: stmt +#line 346 "parser.ypp" + { yylhs.value.as < stmt > () = std::move(yystack_[0].value.as < stmt > ()); } +#line 2312 "parser.cpp" + break; + + case 44: // stmt_or_dev: stmt_dev +#line 347 "parser.ypp" + { yylhs.value.as < stmt > ().as_dev = std::move(yystack_[0].value.as < stmt_dev::ptr > ()); } +#line 2318 "parser.cpp" + break; + + case 45: // stmt_list: stmt_list stmt +#line 352 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = std::move(yystack_[1].value.as < stmt_list::ptr > ()); yylhs.value.as < stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < stmt > ())); } +#line 2324 "parser.cpp" + break; + + case 46: // stmt_list: stmt +#line 354 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = make_stmt_list(yylhs.location); yylhs.value.as < stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < stmt > ())); } +#line 2330 "parser.cpp" + break; + + case 47: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev +#line 359 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = std::move(yystack_[1].value.as < stmt_list::ptr > ()); yylhs.value.as < stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < stmt > ())); } +#line 2336 "parser.cpp" + break; + + case 48: // stmt_or_dev_list: stmt_or_dev +#line 361 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = make_stmt_list(yylhs.location); yylhs.value.as < stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < stmt > ())); } +#line 2342 "parser.cpp" + break; + + case 49: // stmt_dev: "/#" stmt_list "#/" +#line 365 "parser.ypp" + { yylhs.value.as < stmt_dev::ptr > () = make_stmt_dev(yylhs.location, std::move(yystack_[1].value.as < stmt_list::ptr > ())); } +#line 2348 "parser.cpp" + break; + + case 50: // stmt_dev: "/#" "#/" +#line 366 "parser.ypp" + { yylhs.value.as < stmt_dev::ptr > () = make_stmt_dev(yylhs.location, make_stmt_list(yylhs.location)); } +#line 2354 "parser.cpp" + break; + + case 51: // stmt_block: "{" stmt_or_dev_list "}" +#line 370 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = std::move(yystack_[1].value.as < stmt_list::ptr > ()); } +#line 2360 "parser.cpp" + break; + + case 52: // stmt_block: "{" "}" +#line 371 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = make_stmt_list(yylhs.location); } +#line 2366 "parser.cpp" + break; + + case 53: // stmt_expr: expr_assign +#line 376 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = make_stmt_expr(yylhs.location, std::move(yystack_[0].value.as < expr > ())); } +#line 2372 "parser.cpp" + break; + + case 54: // stmt_expr: expr_increment +#line 378 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = make_stmt_expr(yylhs.location, std::move(yystack_[0].value.as < expr > ())); } +#line 2378 "parser.cpp" + break; + + case 55: // stmt_expr: expr_decrement +#line 380 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = make_stmt_expr(yylhs.location, std::move(yystack_[0].value.as < expr > ())); } +#line 2384 "parser.cpp" + break; + + case 56: // stmt_expr: %empty +#line 382 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = make_stmt_expr(yylhs.location, make_node(yylhs.location)); } +#line 2390 "parser.cpp" + break; + + case 57: // stmt_call: expr_call ";" +#line 387 "parser.ypp" + { yylhs.value.as < stmt_call::ptr > () = make_stmt_call(yylhs.location, expr{ std::move(yystack_[1].value.as < expr_call::ptr > ()) }); } +#line 2396 "parser.cpp" + break; + + case 58: // stmt_call: expr_method ";" +#line 389 "parser.ypp" + { yylhs.value.as < stmt_call::ptr > () = make_stmt_call(yylhs.location, expr{ std::move(yystack_[1].value.as < expr_method::ptr > ()) }); } +#line 2402 "parser.cpp" + break; + + case 59: // stmt_assign: expr_assign ";" +#line 394 "parser.ypp" + { yylhs.value.as < stmt_assign::ptr > () = make_stmt_assign(yylhs.location, std::move(yystack_[1].value.as < expr > ())); } +#line 2408 "parser.cpp" + break; + + case 60: // stmt_assign: expr_increment ";" +#line 396 "parser.ypp" + { yylhs.value.as < stmt_assign::ptr > () = make_stmt_assign(yylhs.location, std::move(yystack_[1].value.as < expr > ())); } +#line 2414 "parser.cpp" + break; + + case 61: // stmt_assign: expr_decrement ";" +#line 398 "parser.ypp" + { yylhs.value.as < stmt_assign::ptr > () = make_stmt_assign(yylhs.location, std::move(yystack_[1].value.as < expr > ())); } +#line 2420 "parser.cpp" + break; + + case 62: // stmt_endon: expr_object "endon" "(" expr ")" ";" +#line 403 "parser.ypp" + { yylhs.value.as < stmt_endon::ptr > () = make_stmt_endon(yylhs.location, std::move(yystack_[5].value.as < expr > ()), std::move(yystack_[2].value.as < expr > ())); } +#line 2426 "parser.cpp" + break; + + case 63: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" +#line 408 "parser.ypp" + { yylhs.value.as < stmt_notify::ptr > () = make_stmt_notify(yylhs.location, std::move(yystack_[7].value.as < expr > ()), std::move(yystack_[4].value.as < expr > ()), std::move(yystack_[2].value.as < expr_arguments::ptr > ())); } +#line 2432 "parser.cpp" + break; + + case 64: // stmt_notify: expr_object "notify" "(" expr ")" ";" +#line 410 "parser.ypp" + { yylhs.value.as < stmt_notify::ptr > () = make_stmt_notify(yylhs.location, std::move(yystack_[5].value.as < expr > ()), std::move(yystack_[2].value.as < expr > ()), make_expr_arguments(yylhs.location)); } +#line 2438 "parser.cpp" + break; + + case 65: // stmt_wait: "wait" expr ";" +#line 415 "parser.ypp" + { yylhs.value.as < stmt_wait::ptr > () = make_stmt_wait(yylhs.location, std::move(yystack_[1].value.as < expr > ())); } +#line 2444 "parser.cpp" + break; + + case 66: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" +#line 420 "parser.ypp" + { yylhs.value.as < stmt_waittill::ptr > () = make_stmt_waittill(yylhs.location, std::move(yystack_[7].value.as < expr > ()), std::move(yystack_[4].value.as < expr > ()), std::move(yystack_[2].value.as < expr_arguments::ptr > ())); } +#line 2450 "parser.cpp" + break; + + case 67: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" +#line 422 "parser.ypp" + { yylhs.value.as < stmt_waittill::ptr > () = make_stmt_waittill(yylhs.location, std::move(yystack_[5].value.as < expr > ()), std::move(yystack_[2].value.as < expr > ()), make_expr_arguments(yylhs.location)); } +#line 2456 "parser.cpp" + break; + + case 68: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" +#line 427 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch::ptr > () = make_stmt_waittillmatch(yylhs.location, std::move(yystack_[7].value.as < expr > ()), std::move(yystack_[4].value.as < expr > ()), std::move(yystack_[2].value.as < expr_arguments::ptr > ())); } +#line 2462 "parser.cpp" + break; + + case 69: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" +#line 429 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch::ptr > () = make_stmt_waittillmatch(yylhs.location, std::move(yystack_[5].value.as < expr > ()), std::move(yystack_[2].value.as < expr > ()), make_expr_arguments(yylhs.location)); } +#line 2468 "parser.cpp" + break; + + case 70: // stmt_waittillframeend: "waittillframeend" ";" +#line 434 "parser.ypp" + { yylhs.value.as < stmt_waittillframeend::ptr > () = make_stmt_waittillframeend(yylhs.location); } +#line 2474 "parser.cpp" + break; + + case 71: // stmt_waitframe: "waitframe" ";" +#line 439 "parser.ypp" + { yylhs.value.as < stmt_waitframe::ptr > () = make_stmt_waitframe(yylhs.location); } +#line 2480 "parser.cpp" + break; + + case 72: // stmt_waitframe: "waitframe" "(" ")" ";" +#line 441 "parser.ypp" + { yylhs.value.as < stmt_waitframe::ptr > () = make_stmt_waitframe(yylhs.location); } +#line 2486 "parser.cpp" + break; + + case 73: // stmt_if: "if" "(" expr ")" stmt +#line 446 "parser.ypp" + { yylhs.value.as < stmt_if::ptr > () = make_stmt_if(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < stmt > ())); } +#line 2492 "parser.cpp" + break; + + case 74: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt +#line 451 "parser.ypp" + { yylhs.value.as < stmt_ifelse::ptr > () = make_stmt_ifelse(yylhs.location, std::move(yystack_[4].value.as < expr > ()), std::move(yystack_[2].value.as < stmt > ()), std::move(yystack_[0].value.as < stmt > ())); } +#line 2498 "parser.cpp" + break; + + case 75: // stmt_while: "while" "(" expr ")" stmt +#line 456 "parser.ypp" + { yylhs.value.as < stmt_while::ptr > () = make_stmt_while(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < stmt > ())); } +#line 2504 "parser.cpp" + break; + + case 76: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" +#line 461 "parser.ypp" + { yylhs.value.as < stmt_dowhile::ptr > () = make_stmt_dowhile(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[5].value.as < stmt > ())); } +#line 2510 "parser.cpp" + break; + + case 77: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt +#line 466 "parser.ypp" + { yylhs.value.as < stmt_for::ptr > () = make_stmt_for(yylhs.location, stmt{ std::move(yystack_[6].value.as < stmt_expr::ptr > ()) }, std::move(yystack_[4].value.as < expr > ()), stmt{ std::move(yystack_[2].value.as < stmt_expr::ptr > ()) }, std::move(yystack_[0].value.as < stmt > ())); } +#line 2516 "parser.cpp" + break; + + case 78: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt +#line 471 "parser.ypp" + { + auto array = expr{ make_expr_identifier(yylhs.location, fmt::format("_temp_{}", ++index)) }; + auto key = expr{ make_expr_identifier(yylhs.location, fmt::format("_temp_{}", ++index)) }; + yylhs.value.as < stmt_foreach::ptr > () = make_stmt_foreach(yylhs.location, std::move(yystack_[2].value.as < expr > ()), expr{ std::move(yystack_[4].value.as < expr_identifier::ptr > ()) }, expr{ make_node(yylhs.location) }, std::move(array), std::move(key), std::move(yystack_[0].value.as < stmt > ()), false); } +#line 2525 "parser.cpp" + break; + + case 79: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt +#line 476 "parser.ypp" + { + auto array = expr{ make_expr_identifier(yylhs.location, fmt::format("_temp_{}", ++index)) }; + auto key = (ctx_->props() & props::foreach) ? expr{ make_expr_identifier(yylhs.location, fmt::format("_temp_{}", ++index)) } : expr{ std::move(yystack_[6].value.as < expr_identifier::ptr > ()) }; + yylhs.value.as < stmt_foreach::ptr > () = make_stmt_foreach(yylhs.location, std::move(yystack_[2].value.as < expr > ()), expr{ std::move(yystack_[4].value.as < expr_identifier::ptr > ()) }, (ctx_->props() & props::foreach) ? expr{ std::move(yystack_[6].value.as < expr_identifier::ptr > ()) } : expr{ make_node(yylhs.location) }, std::move(array), std::move(key), std::move(yystack_[0].value.as < stmt > ()), true); + } +#line 2535 "parser.cpp" + break; + + case 80: // stmt_switch: "switch" "(" expr ")" stmt_block +#line 485 "parser.ypp" + { yylhs.value.as < stmt_switch::ptr > () = make_stmt_switch(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < stmt_list::ptr > ())); + parse_switch(*yylhs.value.as < stmt_switch::ptr > ()); + } +#line 2543 "parser.cpp" + break; + + case 81: // stmt_case: "case" expr_integer ":" +#line 492 "parser.ypp" + { yylhs.value.as < stmt_case::ptr > () = make_stmt_case(yylhs.location, expr{ std::move(yystack_[1].value.as < expr_integer::ptr > ()) }, make_stmt_list(yylhs.location)); } +#line 2549 "parser.cpp" + break; + + case 82: // stmt_case: "case" expr_string ":" +#line 494 "parser.ypp" + { yylhs.value.as < stmt_case::ptr > () = make_stmt_case(yylhs.location, expr{ std::move(yystack_[1].value.as < expr_string::ptr > ()) }, make_stmt_list(yylhs.location)); } +#line 2555 "parser.cpp" + break; + + case 83: // stmt_default: "default" ":" +#line 499 "parser.ypp" + { yylhs.value.as < stmt_default::ptr > () = make_stmt_default(yylhs.location, make_stmt_list(yylhs.location)); } +#line 2561 "parser.cpp" + break; + + case 84: // stmt_break: "break" ";" +#line 504 "parser.ypp" + { yylhs.value.as < stmt_break::ptr > () = make_stmt_break(yylhs.location); } +#line 2567 "parser.cpp" + break; + + case 85: // stmt_continue: "continue" ";" +#line 509 "parser.ypp" + { yylhs.value.as < stmt_continue::ptr > () = make_stmt_continue(yylhs.location); } +#line 2573 "parser.cpp" + break; + + case 86: // stmt_return: "return" expr ";" +#line 514 "parser.ypp" + { yylhs.value.as < stmt_return::ptr > () = make_stmt_return(yylhs.location, std::move(yystack_[1].value.as < expr > ())); } +#line 2579 "parser.cpp" + break; + + case 87: // stmt_return: "return" ";" +#line 516 "parser.ypp" + { yylhs.value.as < stmt_return::ptr > () = make_stmt_return(yylhs.location, make_node(yylhs.location)); } +#line 2585 "parser.cpp" + break; + + case 88: // stmt_breakpoint: "breakpoint" ";" +#line 521 "parser.ypp" + { yylhs.value.as < stmt_breakpoint::ptr > () = make_stmt_breakpoint(yylhs.location); } +#line 2591 "parser.cpp" + break; + + case 89: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" +#line 526 "parser.ypp" + { yylhs.value.as < stmt_prof_begin::ptr > () = make_stmt_prof_begin(yylhs.location, std::move(yystack_[2].value.as < expr_arguments::ptr > ())); } +#line 2597 "parser.cpp" + break; + + case 90: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" +#line 531 "parser.ypp" + { yylhs.value.as < stmt_prof_end::ptr > () = make_stmt_prof_end(yylhs.location, std::move(yystack_[2].value.as < expr_arguments::ptr > ())); } +#line 2603 "parser.cpp" + break; + + case 91: // expr: expr_ternary +#line 535 "parser.ypp" + { yylhs.value.as < expr > () = std::move(yystack_[0].value.as < expr > ()); } +#line 2609 "parser.cpp" + break; + + case 92: // expr: expr_binary +#line 536 "parser.ypp" + { yylhs.value.as < expr > () = std::move(yystack_[0].value.as < expr > ()); } +#line 2615 "parser.cpp" + break; + + case 93: // expr: expr_primitive +#line 537 "parser.ypp" + { yylhs.value.as < expr > () = std::move(yystack_[0].value.as < expr > ()); } +#line 2621 "parser.cpp" + break; + + case 94: // expr_or_empty: expr +#line 541 "parser.ypp" + { yylhs.value.as < expr > () = std::move(yystack_[0].value.as < expr > ()); } +#line 2627 "parser.cpp" + break; + + case 95: // expr_or_empty: %empty +#line 542 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_node(yylhs.location); } +#line 2633 "parser.cpp" + break; + + case 96: // expr_assign: expr_tuple "=" expr +#line 547 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_assign_equal(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2639 "parser.cpp" + break; + + case 97: // expr_assign: expr_object "=" expr +#line 549 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_assign_equal(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2645 "parser.cpp" + break; + + case 98: // expr_assign: expr_object "|=" expr +#line 551 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_assign_bitwise_or(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2651 "parser.cpp" + break; + + case 99: // expr_assign: expr_object "&=" expr +#line 553 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_assign_bitwise_and(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2657 "parser.cpp" + break; + + case 100: // expr_assign: expr_object "^=" expr +#line 555 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_assign_bitwise_exor(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2663 "parser.cpp" + break; + + case 101: // expr_assign: expr_object "<<=" expr +#line 557 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_assign_shift_left(yylhs.location, std::move(yystack_[2].value.as < expr > ()),std::move( yystack_[0].value.as < expr > ())); } +#line 2669 "parser.cpp" + break; + + case 102: // expr_assign: expr_object ">>=" expr +#line 559 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_assign_shift_right(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2675 "parser.cpp" + break; + + case 103: // expr_assign: expr_object "+=" expr +#line 561 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_assign_add(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2681 "parser.cpp" + break; + + case 104: // expr_assign: expr_object "-=" expr +#line 563 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_assign_sub(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2687 "parser.cpp" + break; + + case 105: // expr_assign: expr_object "*=" expr +#line 565 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_assign_mul(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2693 "parser.cpp" + break; + + case 106: // expr_assign: expr_object "/=" expr +#line 567 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_assign_div(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2699 "parser.cpp" + break; + + case 107: // expr_assign: expr_object "%=" expr +#line 569 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_assign_mod(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2705 "parser.cpp" + break; + + case 108: // expr_increment: "++" expr_object +#line 574 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_increment(yylhs.location, std::move(yystack_[0].value.as < expr > ()), true); } +#line 2711 "parser.cpp" + break; + + case 109: // expr_increment: expr_object "++" +#line 576 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_increment(yylhs.location, std::move(yystack_[1].value.as < expr > ()), false); } +#line 2717 "parser.cpp" + break; + + case 110: // expr_decrement: "--" expr_object +#line 581 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_decrement(yylhs.location, std::move(yystack_[0].value.as < expr > ()), true); } +#line 2723 "parser.cpp" + break; + + case 111: // expr_decrement: expr_object "--" +#line 583 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_decrement(yylhs.location, std::move(yystack_[1].value.as < expr > ()), false); } +#line 2729 "parser.cpp" + break; + + case 112: // expr_ternary: expr "?" expr ":" expr +#line 588 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_ternary(yylhs.location, std::move(yystack_[4].value.as < expr > ()), std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2735 "parser.cpp" + break; + + case 113: // expr_binary: expr "||" expr +#line 593 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_or(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2741 "parser.cpp" + break; + + case 114: // expr_binary: expr "&&" expr +#line 595 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_and(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2747 "parser.cpp" + break; + + case 115: // expr_binary: expr "==" expr +#line 597 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_equality(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2753 "parser.cpp" + break; + + case 116: // expr_binary: expr "!=" expr +#line 599 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_inequality(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2759 "parser.cpp" + break; + + case 117: // expr_binary: expr "<=" expr +#line 601 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_less_equal(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2765 "parser.cpp" + break; + + case 118: // expr_binary: expr ">=" expr +#line 603 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_greater_equal(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2771 "parser.cpp" + break; + + case 119: // expr_binary: expr "<" expr +#line 605 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_less(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2777 "parser.cpp" + break; + + case 120: // expr_binary: expr ">" expr +#line 607 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_greater(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2783 "parser.cpp" + break; + + case 121: // expr_binary: expr "|" expr +#line 609 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_bitwise_or(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2789 "parser.cpp" + break; + + case 122: // expr_binary: expr "&" expr +#line 611 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_bitwise_and(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2795 "parser.cpp" + break; + + case 123: // expr_binary: expr "^" expr +#line 613 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_bitwise_exor(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2801 "parser.cpp" + break; + + case 124: // expr_binary: expr "<<" expr +#line 615 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_shift_left(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2807 "parser.cpp" + break; + + case 125: // expr_binary: expr ">>" expr +#line 617 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_shift_right(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2813 "parser.cpp" + break; + + case 126: // expr_binary: expr "+" expr +#line 619 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_add(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2819 "parser.cpp" + break; + + case 127: // expr_binary: expr "-" expr +#line 621 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_sub(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2825 "parser.cpp" + break; + + case 128: // expr_binary: expr "*" expr +#line 623 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_mul(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2831 "parser.cpp" + break; + + case 129: // expr_binary: expr "/" expr +#line 625 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_div(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2837 "parser.cpp" + break; + + case 130: // expr_binary: expr "%" expr +#line 627 "parser.ypp" + { yylhs.value.as < expr > ().as_node = make_expr_mod(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr > ())); } +#line 2843 "parser.cpp" + break; + + case 131: // expr_primitive: expr_complement +#line 631 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_complement::ptr > ()); } +#line 2849 "parser.cpp" + break; + + case 132: // expr_primitive: expr_negate +#line 632 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_negate::ptr > ()); } +#line 2855 "parser.cpp" + break; + + case 133: // expr_primitive: expr_not +#line 633 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_not::ptr > ()); } +#line 2861 "parser.cpp" + break; + + case 134: // expr_primitive: expr_call +#line 634 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_call::ptr > ()); } +#line 2867 "parser.cpp" + break; + + case 135: // expr_primitive: expr_method +#line 635 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_method::ptr > ()); } +#line 2873 "parser.cpp" + break; + + case 136: // expr_primitive: expr_add_array +#line 636 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_add_array::ptr > ()); } +#line 2879 "parser.cpp" + break; + + case 137: // expr_primitive: expr_isdefined +#line 637 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_isdefined::ptr > ()); } +#line 2885 "parser.cpp" + break; + + case 138: // expr_primitive: expr_istrue +#line 638 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_istrue::ptr > ()); } +#line 2891 "parser.cpp" + break; + + case 139: // expr_primitive: expr_reference +#line 639 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_reference::ptr > ()); } +#line 2897 "parser.cpp" + break; + + case 140: // expr_primitive: expr_array +#line 640 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_array::ptr > ()); } +#line 2903 "parser.cpp" + break; + + case 141: // expr_primitive: expr_field +#line 641 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_field::ptr > ()); } +#line 2909 "parser.cpp" + break; + + case 142: // expr_primitive: expr_size +#line 642 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_size::ptr > ()); } +#line 2915 "parser.cpp" + break; + + case 143: // expr_primitive: expr_paren +#line 643 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_paren::ptr > ()); } +#line 2921 "parser.cpp" + break; + + case 144: // expr_primitive: expr_thisthread +#line 644 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_thisthread::ptr > ()); } +#line 2927 "parser.cpp" + break; + + case 145: // expr_primitive: expr_empty_array +#line 645 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_empty_array::ptr > ()); } +#line 2933 "parser.cpp" + break; + + case 146: // expr_primitive: expr_undefined +#line 646 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_undefined::ptr > ()); } +#line 2939 "parser.cpp" + break; + + case 147: // expr_primitive: expr_game +#line 647 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_game::ptr > ()); } +#line 2945 "parser.cpp" + break; + + case 148: // expr_primitive: expr_self +#line 648 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_self::ptr > ()); } +#line 2951 "parser.cpp" + break; + + case 149: // expr_primitive: expr_anim +#line 649 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_anim::ptr > ()); } +#line 2957 "parser.cpp" + break; + + case 150: // expr_primitive: expr_level +#line 650 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_level::ptr > ()); } +#line 2963 "parser.cpp" + break; + + case 151: // expr_primitive: expr_animation +#line 651 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_animation::ptr > ()); } +#line 2969 "parser.cpp" + break; + + case 152: // expr_primitive: expr_animtree +#line 652 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_animtree::ptr > ()); } +#line 2975 "parser.cpp" + break; + + case 153: // expr_primitive: expr_identifier +#line 653 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_identifier::ptr > ()); } +#line 2981 "parser.cpp" + break; + + case 154: // expr_primitive: expr_istring +#line 654 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_istring::ptr > ()); } +#line 2987 "parser.cpp" + break; + + case 155: // expr_primitive: expr_string +#line 655 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_string::ptr > ()); } +#line 2993 "parser.cpp" + break; + + case 156: // expr_primitive: expr_vector +#line 656 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_vector::ptr > ()); } +#line 2999 "parser.cpp" + break; + + case 157: // expr_primitive: expr_float +#line 657 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_float::ptr > ()); } +#line 3005 "parser.cpp" + break; + + case 158: // expr_primitive: expr_integer +#line 658 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_integer::ptr > ()); } +#line 3011 "parser.cpp" + break; + + case 159: // expr_primitive: expr_false +#line 659 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_false::ptr > ()); } +#line 3017 "parser.cpp" + break; + + case 160: // expr_primitive: expr_true +#line 660 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_true::ptr > ()); } +#line 3023 "parser.cpp" + break; + + case 161: // expr_complement: "~" expr +#line 665 "parser.ypp" + { yylhs.value.as < expr_complement::ptr > () = make_expr_complement(yylhs.location, std::move(yystack_[0].value.as < expr > ())); } +#line 3029 "parser.cpp" + break; + + case 162: // expr_negate: "-" expr_identifier +#line 670 "parser.ypp" + { yylhs.value.as < expr_negate::ptr > () = make_expr_negate(yylhs.location, expr{ std::move(yystack_[0].value.as < expr_identifier::ptr > ()) }); } +#line 3035 "parser.cpp" + break; + + case 163: // expr_negate: "-" expr_paren +#line 672 "parser.ypp" + { yylhs.value.as < expr_negate::ptr > () = make_expr_negate(yylhs.location, expr{ std::move(yystack_[0].value.as < expr_paren::ptr > ()) }); } +#line 3041 "parser.cpp" + break; + + case 164: // expr_negate: "-" expr_array +#line 674 "parser.ypp" + { yylhs.value.as < expr_negate::ptr > () = make_expr_negate(yylhs.location, expr{ std::move(yystack_[0].value.as < expr_array::ptr > ()) }); } +#line 3047 "parser.cpp" + break; + + case 165: // expr_negate: "-" expr_field +#line 676 "parser.ypp" + { yylhs.value.as < expr_negate::ptr > () = make_expr_negate(yylhs.location, expr{ std::move(yystack_[0].value.as < expr_field::ptr > ()) }); } +#line 3053 "parser.cpp" + break; + + case 166: // expr_not: "!" expr +#line 681 "parser.ypp" + { yylhs.value.as < expr_not::ptr > () = make_expr_not(yylhs.location, std::move(yystack_[0].value.as < expr > ())); } +#line 3059 "parser.cpp" + break; + + case 167: // expr_call: expr_function +#line 685 "parser.ypp" + { yylhs.value.as < expr_call::ptr > () = make_expr_call(yylhs.location, std::move(yystack_[0].value.as < call > ())); } +#line 3065 "parser.cpp" + break; + + case 168: // expr_call: expr_pointer +#line 686 "parser.ypp" + { yylhs.value.as < expr_call::ptr > () = make_expr_call(yylhs.location, std::move(yystack_[0].value.as < call > ())); } +#line 3071 "parser.cpp" + break; + + case 169: // expr_method: expr_object expr_function +#line 689 "parser.ypp" + { yylhs.value.as < expr_method::ptr > () = make_expr_method(yylhs.location, std::move(yystack_[1].value.as < expr > ()), std::move(yystack_[0].value.as < call > ())); } +#line 3077 "parser.cpp" + break; + + case 170: // expr_method: expr_object expr_pointer +#line 690 "parser.ypp" + { yylhs.value.as < expr_method::ptr > () = make_expr_method(yylhs.location, std::move(yystack_[1].value.as < expr > ()), std::move(yystack_[0].value.as < call > ())); } +#line 3083 "parser.cpp" + break; + + case 171: // expr_function: expr_identifier "(" expr_arguments ")" +#line 695 "parser.ypp" + { yylhs.value.as < call > ().as_function = make_expr_function(yylhs.location, make_expr_path(yylhs.location), std::move(yystack_[3].value.as < expr_identifier::ptr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::normal); } +#line 3089 "parser.cpp" + break; + + case 172: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" +#line 697 "parser.ypp" + { yylhs.value.as < call > ().as_function = make_expr_function(yylhs.location, std::move(yystack_[5].value.as < expr_path::ptr > ()), std::move(yystack_[3].value.as < expr_identifier::ptr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::normal); } +#line 3095 "parser.cpp" + break; + + case 173: // expr_function: "thread" expr_identifier "(" expr_arguments ")" +#line 699 "parser.ypp" + { yylhs.value.as < call > ().as_function = make_expr_function(yylhs.location, make_expr_path(yylhs.location), std::move(yystack_[3].value.as < expr_identifier::ptr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::thread); } +#line 3101 "parser.cpp" + break; + + case 174: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" +#line 701 "parser.ypp" + { yylhs.value.as < call > ().as_function = make_expr_function(yylhs.location, std::move(yystack_[5].value.as < expr_path::ptr > ()), std::move(yystack_[3].value.as < expr_identifier::ptr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::thread); } +#line 3107 "parser.cpp" + break; + + case 175: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" +#line 703 "parser.ypp" + { yylhs.value.as < call > ().as_function = make_expr_function(yylhs.location, make_expr_path(yylhs.location), std::move(yystack_[3].value.as < expr_identifier::ptr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::childthread); } +#line 3113 "parser.cpp" + break; + + case 176: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" +#line 705 "parser.ypp" + { yylhs.value.as < call > ().as_function = make_expr_function(yylhs.location, std::move(yystack_[5].value.as < expr_path::ptr > ()), std::move(yystack_[3].value.as < expr_identifier::ptr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::childthread); } +#line 3119 "parser.cpp" + break; + + case 177: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 710 "parser.ypp" + { yylhs.value.as < call > ().as_pointer = make_expr_pointer(yylhs.location, std::move(yystack_[5].value.as < expr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::normal); } +#line 3125 "parser.cpp" + break; + + case 178: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 712 "parser.ypp" + { yylhs.value.as < call > ().as_pointer = make_expr_pointer(yylhs.location, std::move(yystack_[5].value.as < expr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::thread); } +#line 3131 "parser.cpp" + break; + + case 179: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 714 "parser.ypp" + { yylhs.value.as < call > ().as_pointer = make_expr_pointer(yylhs.location, std::move(yystack_[5].value.as < expr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::childthread); } +#line 3137 "parser.cpp" + break; + + case 180: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 716 "parser.ypp" + { yylhs.value.as < call > ().as_pointer = make_expr_pointer(yylhs.location, std::move(yystack_[5].value.as < expr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::builtin); } +#line 3143 "parser.cpp" + break; + + case 181: // expr_add_array: "[" expr_arguments_no_empty "]" +#line 721 "parser.ypp" + { yylhs.value.as < expr_add_array::ptr > () = make_expr_add_array(yylhs.location, std::move(yystack_[1].value.as < expr_arguments::ptr > ())); } +#line 3149 "parser.cpp" + break; + + case 182: // expr_parameters: expr_parameters "," expr_identifier +#line 726 "parser.ypp" + { yylhs.value.as < expr_parameters::ptr > () = std::move(yystack_[2].value.as < expr_parameters::ptr > ()); yylhs.value.as < expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_identifier::ptr > ())); } +#line 3155 "parser.cpp" + break; + + case 183: // expr_parameters: expr_identifier +#line 728 "parser.ypp" + { yylhs.value.as < expr_parameters::ptr > () = make_expr_parameters(yylhs.location); yylhs.value.as < expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_identifier::ptr > ())); } +#line 3161 "parser.cpp" + break; + + case 184: // expr_parameters: %empty +#line 730 "parser.ypp" + { yylhs.value.as < expr_parameters::ptr > () = make_expr_parameters(yylhs.location); } +#line 3167 "parser.cpp" + break; + + case 185: // expr_arguments: expr_arguments_no_empty +#line 735 "parser.ypp" + { yylhs.value.as < expr_arguments::ptr > () = std::move(yystack_[0].value.as < expr_arguments::ptr > ()); } +#line 3173 "parser.cpp" + break; + + case 186: // expr_arguments: %empty +#line 737 "parser.ypp" + { yylhs.value.as < expr_arguments::ptr > () = make_expr_arguments(yylhs.location); } +#line 3179 "parser.cpp" + break; + + case 187: // expr_arguments_no_empty: expr_arguments "," expr +#line 742 "parser.ypp" + { yylhs.value.as < expr_arguments::ptr > () = std::move(yystack_[2].value.as < expr_arguments::ptr > ()); yylhs.value.as < expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr > ())); } +#line 3185 "parser.cpp" + break; + + case 188: // expr_arguments_no_empty: expr +#line 744 "parser.ypp" + { yylhs.value.as < expr_arguments::ptr > () = make_expr_arguments(yylhs.location); yylhs.value.as < expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr > ())); } +#line 3191 "parser.cpp" + break; + + case 189: // expr_isdefined: "isdefined" "(" expr ")" +#line 749 "parser.ypp" + { yylhs.value.as < expr_isdefined::ptr > () = make_expr_isdefined(yylhs.location, std::move(yystack_[1].value.as < expr > ())); } +#line 3197 "parser.cpp" + break; + + case 190: // expr_istrue: "istrue" "(" expr ")" +#line 754 "parser.ypp" + { yylhs.value.as < expr_istrue::ptr > () = make_expr_istrue(yylhs.location, std::move(yystack_[1].value.as < expr > ())); } +#line 3203 "parser.cpp" + break; + + case 191: // expr_reference: "::" expr_identifier +#line 759 "parser.ypp" + { yylhs.value.as < expr_reference::ptr > () = make_expr_reference(yylhs.location, make_expr_path(yylhs.location), std::move(yystack_[0].value.as < expr_identifier::ptr > ())); } +#line 3209 "parser.cpp" + break; + + case 192: // expr_reference: expr_path "::" expr_identifier +#line 761 "parser.ypp" + { yylhs.value.as < expr_reference::ptr > () = make_expr_reference(yylhs.location, std::move(yystack_[2].value.as < expr_path::ptr > ()), std::move(yystack_[0].value.as < expr_identifier::ptr > ())); } +#line 3215 "parser.cpp" + break; + + case 193: // expr_tuple: "[" expr_tuple_arguments "]" +#line 766 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[1].value.as < expr_tuple::ptr > ()); + yylhs.value.as < expr > ().as_tuple->temp = expr{ std::make_unique(yylhs.value.as < expr > ().loc(), fmt::format("_temp_{}", ++index)) }; + } +#line 3223 "parser.cpp" + break; + + case 194: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types +#line 773 "parser.ypp" + { yylhs.value.as < expr_tuple::ptr > () = std::move(yystack_[2].value.as < expr_tuple::ptr > ()); yylhs.value.as < expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr > ())); } +#line 3229 "parser.cpp" + break; + + case 195: // expr_tuple_arguments: expr_tuple_types +#line 775 "parser.ypp" + { yylhs.value.as < expr_tuple::ptr > () = make_expr_tuple(yylhs.location); yylhs.value.as < expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr > ())); } +#line 3235 "parser.cpp" + break; + + case 196: // expr_tuple_types: expr_array +#line 779 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_array::ptr > ()); } +#line 3241 "parser.cpp" + break; + + case 197: // expr_tuple_types: expr_field +#line 780 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_field::ptr > ()); } +#line 3247 "parser.cpp" + break; + + case 198: // expr_tuple_types: expr_identifier +#line 781 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_identifier::ptr > ()); } +#line 3253 "parser.cpp" + break; + + case 199: // expr_array: expr_object "[" expr "]" +#line 786 "parser.ypp" + { yylhs.value.as < expr_array::ptr > () = make_expr_array(yylhs.location, std::move(yystack_[3].value.as < expr > ()), std::move(yystack_[1].value.as < expr > ())); } +#line 3259 "parser.cpp" + break; + + case 200: // expr_field: expr_object "." expr_identifier_nosize +#line 791 "parser.ypp" + { yylhs.value.as < expr_field::ptr > () = make_expr_field(yylhs.location, std::move(yystack_[2].value.as < expr > ()), std::move(yystack_[0].value.as < expr_identifier::ptr > ())); } +#line 3265 "parser.cpp" + break; + + case 201: // expr_size: expr_object "." "size" +#line 796 "parser.ypp" + { yylhs.value.as < expr_size::ptr > () = make_expr_size(yylhs.location, std::move(yystack_[2].value.as < expr > ())); } +#line 3271 "parser.cpp" + break; + + case 202: // expr_paren: "(" expr ")" +#line 801 "parser.ypp" + { yylhs.value.as < expr_paren::ptr > () = make_expr_paren(yylhs.location, std::move(yystack_[1].value.as < expr > ())); } +#line 3277 "parser.cpp" + break; + + case 203: // expr_object: expr_call +#line 805 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_call::ptr > ()); } +#line 3283 "parser.cpp" + break; + + case 204: // expr_object: expr_method +#line 806 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_method::ptr > ()); } +#line 3289 "parser.cpp" + break; + + case 205: // expr_object: expr_array +#line 807 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_array::ptr > ()); } +#line 3295 "parser.cpp" + break; + + case 206: // expr_object: expr_field +#line 808 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_field::ptr > ()); } +#line 3301 "parser.cpp" + break; + + case 207: // expr_object: expr_game +#line 809 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_game::ptr > ()); } +#line 3307 "parser.cpp" + break; + + case 208: // expr_object: expr_self +#line 810 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_self::ptr > ()); } +#line 3313 "parser.cpp" + break; + + case 209: // expr_object: expr_anim +#line 811 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_anim::ptr > ()); } +#line 3319 "parser.cpp" + break; + + case 210: // expr_object: expr_level +#line 812 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_level::ptr > ()); } +#line 3325 "parser.cpp" + break; + + case 211: // expr_object: expr_identifier +#line 813 "parser.ypp" + { yylhs.value.as < expr > ().as_node = std::move(yystack_[0].value.as < expr_identifier::ptr > ()); } +#line 3331 "parser.cpp" + break; + + case 212: // expr_thisthread: "thisthread" +#line 818 "parser.ypp" + { yylhs.value.as < expr_thisthread::ptr > () = make_expr_thisthread(yylhs.location); } +#line 3337 "parser.cpp" + break; + + case 213: // expr_empty_array: "[" "]" +#line 823 "parser.ypp" + { yylhs.value.as < expr_empty_array::ptr > () = make_expr_empty_array(yylhs.location); } +#line 3343 "parser.cpp" + break; + + case 214: // expr_undefined: "undefined" +#line 828 "parser.ypp" + { yylhs.value.as < expr_undefined::ptr > () = make_expr_undefined(yylhs.location); } +#line 3349 "parser.cpp" + break; + + case 215: // expr_game: "game" +#line 833 "parser.ypp" + { yylhs.value.as < expr_game::ptr > () = make_expr_game(yylhs.location); } +#line 3355 "parser.cpp" + break; + + case 216: // expr_self: "self" +#line 838 "parser.ypp" + { yylhs.value.as < expr_self::ptr > () = make_expr_self(yylhs.location); } +#line 3361 "parser.cpp" + break; + + case 217: // expr_anim: "anim" +#line 843 "parser.ypp" + { yylhs.value.as < expr_anim::ptr > () = make_expr_anim(yylhs.location); } +#line 3367 "parser.cpp" + break; + + case 218: // expr_level: "level" +#line 848 "parser.ypp" + { yylhs.value.as < expr_level::ptr > () = make_expr_level(yylhs.location); } +#line 3373 "parser.cpp" + break; + + case 219: // expr_animation: "%" "identifier" +#line 853 "parser.ypp" + { yylhs.value.as < expr_animation::ptr > () = make_expr_animation(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3379 "parser.cpp" + break; + + case 220: // expr_animtree: "#animtree" +#line 858 "parser.ypp" + { yylhs.value.as < expr_animtree::ptr > () = make_expr_animtree(yylhs.location); } +#line 3385 "parser.cpp" + break; + + case 221: // expr_identifier_nosize: "identifier" +#line 863 "parser.ypp" + { yylhs.value.as < expr_identifier::ptr > () = make_expr_identifier(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3391 "parser.cpp" + break; + + case 222: // expr_identifier: "identifier" +#line 868 "parser.ypp" + { yylhs.value.as < expr_identifier::ptr > () = make_expr_identifier(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3397 "parser.cpp" + break; + + case 223: // expr_identifier: "size" +#line 870 "parser.ypp" + { yylhs.value.as < expr_identifier::ptr > () = make_expr_identifier(yylhs.location, "size"); } +#line 3403 "parser.cpp" + break; + + case 224: // expr_path: "path" "/" "identifier" +#line 875 "parser.ypp" + { yylhs.value.as < expr_path::ptr > () = make_expr_path(yylhs.location, yystack_[2].value.as < std::string > () + "/" + yystack_[0].value.as < std::string > ()); } +#line 3409 "parser.cpp" + break; + + case 225: // expr_path: "identifier" +#line 877 "parser.ypp" + { yylhs.value.as < expr_path::ptr > () = make_expr_path(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3415 "parser.cpp" + break; + + case 226: // expr_path: "path" +#line 879 "parser.ypp" + { yylhs.value.as < expr_path::ptr > () = make_expr_path(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3421 "parser.cpp" + break; + + case 227: // expr_istring: "localized string" +#line 884 "parser.ypp" + { yylhs.value.as < expr_istring::ptr > () = make_expr_istring(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3427 "parser.cpp" + break; + + case 228: // expr_string: "string literal" +#line 889 "parser.ypp" + { yylhs.value.as < expr_string::ptr > () = make_expr_string(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3433 "parser.cpp" + break; + + case 229: // expr_vector: "(" expr "," expr "," expr ")" +#line 894 "parser.ypp" + { yylhs.value.as < expr_vector::ptr > () = make_expr_vector(yylhs.location, std::move(yystack_[5].value.as < expr > ()), std::move(yystack_[3].value.as < expr > ()), std::move(yystack_[1].value.as < expr > ())); } +#line 3439 "parser.cpp" + break; + + case 230: // expr_float: "-" "float" +#line 899 "parser.ypp" + { yylhs.value.as < expr_float::ptr > () = make_expr_float(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 3445 "parser.cpp" + break; + + case 231: // expr_float: "float" +#line 901 "parser.ypp" + { yylhs.value.as < expr_float::ptr > () = make_expr_float(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3451 "parser.cpp" + break; + + case 232: // expr_integer: "-" "integer" +#line 906 "parser.ypp" + { yylhs.value.as < expr_integer::ptr > () = make_expr_integer(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 3457 "parser.cpp" + break; + + case 233: // expr_integer: "integer" +#line 908 "parser.ypp" + { yylhs.value.as < expr_integer::ptr > () = make_expr_integer(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3463 "parser.cpp" + break; + + case 234: // expr_false: "false" +#line 913 "parser.ypp" + { yylhs.value.as < expr_false::ptr > () = make_expr_false(yylhs.location); } +#line 3469 "parser.cpp" + break; + + case 235: // expr_true: "true" +#line 918 "parser.ypp" + { yylhs.value.as < expr_true::ptr > () = make_expr_true(yylhs.location); } +#line 3475 "parser.cpp" + break; + + +#line 3479 "parser.cpp" + + default: + break; + } + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + YYERROR; + } +#endif // YY_EXCEPTIONS + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + } + goto yynewstate; + + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + context yyctx (*this, yyla); + std::string msg = yysyntax_error_ (yyctx); + error (yyla.location, YY_MOVE (msg)); + } + + + yyerror_range[1].location = yyla.location; + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.kind () == symbol_kind::S_YYEOF) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and + the label yyerrorlab therefore never appears in user code. */ + if (false) + YYERROR; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + // Pop stack until we find a state that shifts the error token. + for (;;) + { + yyn = yypact_[+yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += symbol_kind::S_YYerror; + if (0 <= yyn && yyn <= yylast_ + && yycheck_[yyn] == symbol_kind::S_YYerror) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } + { + stack_symbol_type error_token; + + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); + + // Shift the error token. + yy_lac_discard_ ("error recovery"); + error_token.state = state_type (yyn); + yypush_ ("Shifting", YY_MOVE (error_token)); + } + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + + /*-----------------------------------------------------. + | yyreturn -- parsing is finished, return the result. | + `-----------------------------------------------------*/ + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + YY_STACK_PRINT (); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } +#if YY_EXCEPTIONS + catch (...) + { + YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; + // Do not try to display the values of the reclaimed symbols, + // as their printers might throw an exception. + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } + throw; + } +#endif // YY_EXCEPTIONS + } + + void + parser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what ()); + } + + const char * + parser::symbol_name (symbol_kind_type yysymbol) + { + static const char *const yy_sname[] = + { + "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", + "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", + "#include", "#using_animtree", "#animtree", "endon", "notify", "wait", + "waittill", "waittillmatch", "waittillframeend", "waitframe", "if", + "else", "do", "while", "for", "foreach", "in", "switch", "case", + "default", "break", "continue", "return", "breakpoint", "prof_begin", + "prof_end", "thread", "childthread", "thisthread", "call", "true", + "false", "undefined", "size", "game", "self", "anim", "level", + "isdefined", "istrue", "(", ")", "{", "}", "[", "]", ",", ".", "::", ":", + ";", "?", "++", "--", "<<", ">>", "||", "&&", "==", "!=", "<=", ">=", + "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", "%=", "|=", "&=", "^=", + ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", "%", "path", + "identifier", "string literal", "localized string", "float", "integer", + "SIZEOF", "ADD_ARRAY", "THEN", "TERN", "NEG", "ANIMREF", "PREINC", + "PREDEC", "POSTINC", "POSTDEC", "$accept", "root", "program", "inline", + "include", "declaration", "decl_usingtree", "decl_function", "stmt", + "stmt_or_dev", "stmt_list", "stmt_or_dev_list", "stmt_dev", "stmt_block", + "stmt_expr", "stmt_call", "stmt_assign", "stmt_endon", "stmt_notify", + "stmt_wait", "stmt_waittill", "stmt_waittillmatch", + "stmt_waittillframeend", "stmt_waitframe", "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_negate", "expr_not", "expr_call", "expr_method", + "expr_function", "expr_pointer", "expr_add_array", "expr_parameters", + "expr_arguments", "expr_arguments_no_empty", "expr_isdefined", + "expr_istrue", "expr_reference", "expr_tuple", "expr_tuple_arguments", + "expr_tuple_types", "expr_array", "expr_field", "expr_size", + "expr_paren", "expr_object", "expr_thisthread", "expr_empty_array", + "expr_undefined", "expr_game", "expr_self", "expr_anim", "expr_level", + "expr_animation", "expr_animtree", "expr_identifier_nosize", + "expr_identifier", "expr_path", "expr_istring", "expr_string", + "expr_vector", "expr_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 GSCDEBUG + // 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 GSCDEBUG + YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; +#endif + std::ptrdiff_t lac_top = 0; + while (true) + { + state_type top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + int yyrule = yypact_[+top_state]; + if (yy_pact_value_is_default_ (yyrule) + || (yyrule += yytoken) < 0 || yylast_ < yyrule + || yycheck_[yyrule] != yytoken) + { + // Use the default action. + yyrule = yydefact_[+top_state]; + if (yyrule == 0) + { + YYCDEBUG << " Err\n"; + return false; + } + } + else + { + // Use the action from yytable. + yyrule = yytable_[yyrule]; + if (yy_table_value_is_error_ (yyrule)) + { + YYCDEBUG << " Err\n"; + return false; + } + if (0 < yyrule) + { + YYCDEBUG << " S" << yyrule << '\n'; + return true; + } + yyrule = -yyrule; + } + // By now we know we have to simulate a reduce. + YYCDEBUG << " R" << yyrule - 1; + // Pop the corresponding number of values from the stack. + { + std::ptrdiff_t yylen = yyr2_[yyrule]; + // First pop from the LAC stack as many tokens as possible. + std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); + if (yylen < lac_size) + { + yylac_stack_.resize (std::size_t (lac_size - yylen)); + yylen = 0; + } + else if (lac_size) + { + yylac_stack_.clear (); + yylen -= lac_size; + } + // Only afterwards look at the main stack. + // We simulate popping elements by incrementing lac_top. + lac_top += yylen; + } + // Keep top_state in sync with the updated stack. + top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + // Push the resulting state of the reduction. + state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); + YYCDEBUG << " G" << int (state); + yylac_stack_.push_back (state); + } + } + + // Establish the initial context if no initial context currently exists. + bool + parser::yy_lac_establish_ (symbol_kind_type yytoken) + { + /* Establish the initial context for the current lookahead if no initial + context is currently established. + + We define a context as a snapshot of the parser stacks. We define + the initial context for a lookahead as the context in which the + parser initially examines that lookahead in order to select a + syntactic action. Thus, if the lookahead eventually proves + syntactically unacceptable (possibly in a later context reached via a + series of reductions), the initial context can be used to determine + the exact set of tokens that would be syntactically acceptable in the + lookahead's place. Moreover, it is the context after which any + further semantic actions would be erroneous because they would be + determined by a syntactically unacceptable token. + + yy_lac_establish_ should be invoked when a reduction is about to be + performed in an inconsistent state (which, for the purposes of LAC, + includes consistent states that don't know they're consistent because + their default reductions have been disabled). + + For parse.lac=full, the implementation of yy_lac_establish_ is as + follows. If no initial context is currently established for the + current lookahead, then check if that lookahead can eventually be + shifted if syntactic actions continue from the current context. */ + if (yy_lac_established_) + return true; + else + { +#if GSCDEBUG + YYCDEBUG << "LAC: initial context established for " + << symbol_name (yytoken) << '\n'; +#endif + yy_lac_established_ = true; + return yy_lac_check_ (yytoken); + } + } + + // Discard any previous initial lookahead context. + void + parser::yy_lac_discard_ (const char* event) + { + /* Discard any previous initial lookahead context because of Event, + which may be a lookahead change or an invalidation of the currently + established initial context for the current lookahead. + + The most common example of a lookahead change is a shift. An example + of both cases is syntax error recovery. That is, a syntax error + occurs when the lookahead is syntactically erroneous for the + currently established initial context, so error recovery manipulates + the parser stacks to try to find a new initial context in which the + current lookahead is syntactically acceptable. If it fails to find + such a context, it discards the lookahead. */ + if (yy_lac_established_) + { + YYCDEBUG << "LAC: initial context discarded due to " + << event << '\n'; + yy_lac_established_ = false; + } + } + + + int + parser::yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const + { + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yyla) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yyla. (However, yyla is currently not documented for users.) + In the first two cases, it might appear that the current syntax + error should have been detected in the previous state when + yy_lac_check was invoked. However, at that time, there might + have been a different syntax error that discarded a different + initial context during error recovery, leaving behind the + current lookahead. + */ + + if (!yyctx.lookahead ().empty ()) + { + if (yyarg) + yyarg[0] = yyctx.token (); + int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); + return yyn + 1; + } + return 0; + } + + // Generate an error message. + std::string + parser::yysyntax_error_ (const context& yyctx) const + { + // Its maximum. + enum { YYARGS_MAX = 5 }; + // Arguments of yyformat. + symbol_kind_type yyarg[YYARGS_MAX]; + int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + std::string yyres; + // Argument number. + std::ptrdiff_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += symbol_name (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres; + } + + + const short parser::yypact_ninf_ = -177; + + const short parser::yytable_ninf_ = -226; + + const short + parser::yypact_[] = + { + 185, -177, -177, -51, -51, -43, -177, -177, 30, 185, + -177, -177, -177, -177, -177, -3, -31, -177, -10, 10, + -11, -177, -177, -177, -177, -30, 4, -177, -177, -177, + 29, -16, -177, -177, 33, 44, -30, -177, 928, -177, + -177, 1089, 1326, 48, -50, 85, 1477, 86, 101, 104, + 105, -73, 74, 97, 107, 1196, 108, 127, 129, -37, + -35, 89, -177, -177, -177, -177, -177, 229, 565, 565, + 87, -177, -177, 1010, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + 120, 121, 126, 130, 131, -177, -177, 70, -177, -177, + 626, -177, -177, -177, -177, 147, 140, -177, -177, 1168, + -177, -177, -177, -177, -177, 152, 154, 1326, 1261, -30, + 1326, 1326, 486, 69, -177, -177, -177, 2183, -177, -177, + -177, -177, -177, -177, 35, 448, -177, -177, -177, -177, + 526, 638, -177, -177, 765, -177, -177, -177, 888, 956, + 965, 1042, -177, -177, 352, 151, -177, -177, -177, -177, + -177, -177, -177, -177, 157, -177, 1326, 189, 1326, 551, + -30, 1326, 113, 158, 161, -177, -177, -177, -177, 2218, + -177, 1326, 1326, 162, 171, 164, 170, 175, 169, 176, + 1391, -177, -177, 55, -177, 58, 68, 1121, -27, 177, + 1121, 1121, -177, -177, -177, -177, -177, -177, -177, 1326, + 179, 183, 186, 187, 1391, 139, -177, -177, 1326, 1326, + 1326, 1326, 1326, 1326, 1326, 1326, 1326, 1326, 1326, -177, + -177, 147, 1326, -30, -177, -177, 1326, 1326, 1487, 1261, + -177, 2231, 182, 190, -177, -177, -177, 1326, -177, -177, + 526, 638, -177, 352, -177, -177, 1326, 1326, 1326, 1326, + 1326, 1326, 1326, 1326, 1326, 1326, 1326, 1326, 1326, 1326, + 1326, 1326, 1326, 1326, 1326, -23, -30, 193, 1653, 204, + 1687, 195, -177, -177, -177, 688, -17, 1721, -177, -177, + -177, -13, -177, 28, 1326, 1326, -30, 1326, 1326, -30, + 1326, 1257, -177, 565, 1326, 2231, 1326, 1326, 1326, 1326, + 1322, -177, -177, 2231, 2231, 2231, 2231, 2231, 2231, 2231, + 2231, 2231, 2231, 2231, 31, 206, 1755, 1789, -177, 1326, + 1257, 1326, -177, 1823, 2148, 150, 150, 2262, 2272, 559, + 559, 254, 254, 254, 254, 2303, 829, 2313, -78, -78, + -177, -177, -177, -177, 206, -177, 1477, 1326, 1477, 1326, + 1326, -30, 44, 198, 199, 1387, 32, 210, 2033, 39, + 211, 2073, 207, -177, 1857, 1531, 1575, 1619, -177, -177, + 1326, -177, -177, 2112, 2231, 1326, 242, 1891, -177, 2231, + 209, 1925, 241, -177, -177, -177, 216, -177, 1326, 222, + -177, 1326, 230, 237, 232, 233, 1326, 235, 1326, 239, + 1326, 51, 1326, 2231, 1477, 240, 551, 1477, 1326, 257, + 61, 258, 83, 260, 1326, -177, -177, 238, -177, 253, + -177, 261, -177, 1959, -177, -177, 262, -177, 1993, 1326, + -177, 1326, -177, 1326, 93, 255, 256, 263, -177, 1477, + 1477, 96, 115, 118, -177, -177, -177, -177, -177, -177, + -177, -177, -177 + }; + + const unsigned char + parser::yydefact_[] = + { + 3, 12, 13, 0, 0, 0, 223, 222, 0, 2, + 7, 8, 9, 14, 15, 0, 226, 225, 0, 0, + 0, 1, 4, 5, 6, 184, 0, 10, 11, 228, + 0, 0, 183, 224, 0, 0, 0, 16, 0, 17, + 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 215, 216, 217, 218, 52, 0, 0, 0, + 222, 43, 48, 0, 44, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 0, 0, 0, 203, 204, 167, 168, 0, 205, 206, + 0, 207, 208, 209, 210, 211, 0, 50, 46, 0, + 220, 212, 235, 234, 214, 0, 0, 0, 186, 0, + 0, 0, 0, 0, 227, 231, 233, 0, 91, 92, + 93, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 0, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 0, 154, 155, 156, 157, + 158, 159, 160, 70, 0, 71, 0, 0, 0, 56, + 0, 0, 0, 0, 0, 83, 84, 85, 87, 0, + 88, 186, 186, 0, 0, 0, 0, 0, 0, 0, + 0, 203, 204, 0, 195, 205, 206, 0, 211, 0, + 108, 110, 51, 47, 59, 60, 61, 57, 58, 0, + 0, 0, 0, 0, 0, 0, 109, 111, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 169, + 170, 0, 186, 0, 49, 45, 0, 0, 0, 186, + 213, 188, 0, 185, 191, 166, 161, 0, 230, 232, + 164, 165, 163, 162, 219, 65, 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, 53, 54, 55, 0, 0, 0, 82, 81, + 86, 0, 185, 0, 0, 186, 0, 0, 186, 0, + 0, 0, 193, 0, 0, 96, 0, 0, 0, 0, + 0, 221, 200, 97, 103, 104, 105, 106, 107, 98, + 99, 100, 102, 101, 0, 0, 0, 0, 202, 0, + 188, 0, 181, 0, 0, 124, 125, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 126, 127, + 128, 129, 130, 201, 192, 72, 0, 0, 0, 95, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 194, 0, 0, 0, 0, 199, 171, + 186, 189, 190, 0, 187, 0, 73, 0, 75, 94, + 0, 0, 0, 80, 89, 90, 0, 173, 186, 0, + 175, 186, 0, 0, 0, 0, 186, 0, 186, 0, + 186, 0, 0, 112, 0, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 186, 62, 64, 185, 67, 185, + 69, 185, 172, 0, 74, 76, 0, 78, 0, 186, + 174, 186, 176, 186, 0, 0, 0, 0, 229, 0, + 0, 0, 0, 0, 177, 63, 66, 68, 77, 79, + 178, 179, 180 + }; + + const short + parser::yypgoto_[] = + { + -177, -177, -177, 315, 317, 321, -177, -177, -6, 266, + -177, -177, -177, -34, -91, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, 603, + -177, -176, -174, -172, -177, -177, -177, -177, -177, -177, + -12, 57, -102, -65, -177, -177, -90, -126, -177, -177, + -177, -177, -177, 23, 95, 119, -177, 208, 136, -177, + -177, -177, 215, 264, 336, 432, -177, -177, -177, 0, + 12, -177, -14, -177, -177, 290, -177, -177 + }; + + const short + parser::yydefgoto_[] = + { + 0, 8, 9, 10, 11, 12, 13, 14, 71, 72, + 119, 73, 74, 75, 291, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 251, + 400, 100, 101, 102, 138, 139, 140, 141, 142, 143, + 144, 145, 105, 106, 146, 31, 252, 302, 147, 148, + 149, 107, 203, 204, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 322, 164, + 165, 166, 167, 168, 169, 170, 171, 172 + }; + + const short + parser::yytable_[] = + { + 15, 39, 253, 292, 174, 293, 30, 294, 239, 15, + 6, 20, 6, 370, 175, 18, 19, 6, 282, 283, + 284, 193, 182, 196, 363, 32, 103, 242, 29, 103, + 21, 136, -198, -198, 103, 118, 40, 183, 115, 35, + 177, 115, 373, 371, 36, 240, 115, 341, 16, 17, + 116, 25, 239, 116, 27, 201, 201, 201, 116, 194, + 197, 103, 16, 70, 16, 70, 26, 208, 115, 115, + 7, 195, 198, 115, 28, -203, -203, 321, -203, 116, + 116, 116, -203, 374, 34, 116, 389, 407, 341, 240, + 29, 341, 341, -203, 410, 104, -203, 37, 104, 341, + 38, 301, 303, 104, 33, 239, 442, 103, 239, 239, + 241, 341, 173, 245, 312, 313, 450, -196, -196, 115, + 201, 341, 116, 253, 202, 202, 202, -197, -197, 254, + 104, 116, 263, 108, -203, -203, 108, 185, 452, 176, + 178, 108, 240, 341, 116, 240, 240, 199, 464, -225, + 219, 470, 334, 341, 241, 179, 341, 109, 180, 181, + 109, 186, 205, 108, 108, 109, 116, 201, 108, 264, + 471, 187, 190, 472, 110, 341, 104, 110, 341, 115, + 296, 191, 110, 192, 214, 215, 206, 109, 109, 202, + 216, 116, 109, 239, 217, 218, 1, 2, 3, 4, + 5, 242, 243, 207, 210, 211, 246, 241, 247, 110, + 241, 241, 287, 286, 108, 376, 289, 259, 379, 116, + 304, 298, 116, 116, 299, 305, 306, 260, 307, 308, + 240, 309, 6, 316, 310, 314, 202, 317, 109, 321, + 318, 319, 341, 335, 280, 281, 282, 283, 284, 342, + 292, 261, 293, 111, 294, 110, 111, 365, 367, 369, + 390, 111, 404, 405, 408, 411, 413, 424, 207, 59, + 60, 428, 61, 426, 108, 429, 6, 62, 63, 64, + 65, 431, 111, 111, 111, 7, 364, 200, 111, 433, + 437, 434, 439, 455, 441, 241, 435, 436, 109, 438, + 421, 201, 112, 440, 445, 112, 377, 116, 456, 380, + 112, 449, 451, 208, 453, 295, 457, 459, 430, 465, + 466, 432, 267, 268, 22, 116, 23, 467, 16, 70, + 24, 112, 112, 112, 111, 446, 383, 112, 403, 213, + 262, 184, 0, 0, 454, 0, 0, 111, 280, 281, + 282, 283, 284, 0, 103, 0, 103, 0, 0, 461, + 396, 462, 398, 463, 0, 0, 115, 0, 115, 0, + 202, 402, 0, 0, 113, 0, 0, 113, 116, 0, + 116, 0, 113, 112, 0, 0, 0, 0, 0, 0, + 0, 0, -211, -211, 111, -211, 112, 0, 0, -211, + 0, 0, 0, 113, 113, 113, 242, 0, 205, 113, + -211, 0, 103, -211, 201, 103, 0, 0, 444, 0, + 0, 447, 0, 104, 115, 104, 115, 115, 0, 0, + 0, 0, 206, 0, 0, 0, 116, 0, 116, 116, + 0, 0, 0, 112, 0, 0, 0, 103, 103, 207, + 0, -211, -211, 468, 469, 113, 0, 0, 0, 115, + 115, 108, 0, 108, 0, 0, 0, 0, 113, 0, + 114, 116, 116, 114, 0, 0, 0, 0, 114, 0, + 0, 104, 0, 202, 104, 109, 0, 109, -204, -204, + 0, -204, 0, 0, 0, -204, 0, 0, 0, 114, + 114, 114, 110, 0, 110, 114, -204, 0, 0, -204, + 0, 0, 0, 0, 0, 113, 104, 104, 0, 108, + 0, 108, 108, 0, 0, 0, 59, 60, 111, 61, + 0, 0, 0, 6, 62, 63, 64, 65, 0, 0, + 257, 0, 0, 109, 209, 109, 109, -204, -204, 0, + 0, 114, 0, 0, 108, 108, 0, 0, 0, 0, + 110, 0, 295, 110, 114, 0, -205, -205, 0, -205, + 0, 0, 0, -205, 0, 0, 0, 112, 109, 109, + 0, 111, 0, 111, -205, 16, 70, -205, 0, 258, + 259, 59, 60, 0, 61, 110, 110, 0, 6, 62, + 63, 64, 65, 0, 0, 59, 60, 0, 61, 67, + 0, 114, 6, 62, 63, 64, 65, 68, 69, 0, + 0, 0, 0, 209, 0, -205, -205, 267, 268, 0, + 112, 0, 112, 273, 274, 275, 276, 0, 0, 111, + 0, 111, 111, 220, 221, 137, 222, 223, 0, 113, + 16, 70, 0, 280, 281, 282, 283, 284, 189, 0, + 0, 0, 0, 0, 16, 70, 59, 60, 0, 61, + 0, 0, 0, 6, 111, 111, 0, 0, -206, -206, + 0, -206, 0, 0, 224, -206, 0, 225, 112, 0, + 112, 112, 226, 227, 0, 0, -206, 0, 0, -206, + 0, 0, 113, 0, 113, 0, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 0, 0, 0, + 0, 0, 0, 112, 112, 16, 70, 0, 59, 60, + 248, 61, 0, 255, 256, 6, 0, -206, -206, 0, + 0, 0, 0, 0, 0, 114, 224, 0, 0, 225, + 0, 0, 0, 0, 226, 227, 0, 0, 0, 0, + 113, 0, 113, 113, 0, 0, 0, 0, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 288, + 0, 290, 0, 0, 297, 0, 0, 16, 70, 0, + 0, 0, 0, 0, 0, 113, 113, 0, 114, 0, + 114, 0, 0, 311, 0, 59, 60, 0, 61, 0, + 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 315, 224, 0, 0, 285, 320, 0, 0, + 0, 323, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 0, 0, 0, 0, 0, 0, 0, 336, + 337, 0, 340, 0, 0, 0, 114, 0, 114, 114, + 343, 0, 0, 0, 16, 70, 0, 0, 0, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 0, 0, + 0, 114, 114, 0, 0, 0, 0, 267, 268, 0, + 0, 271, 272, 273, 274, 275, 276, 375, 0, 0, + 378, 0, 0, 381, 0, 0, 0, 311, 0, 384, + 385, 386, 387, 280, 281, 282, 283, 284, -207, -207, + 0, -207, 0, 0, 0, -207, 0, 0, 0, 41, + 0, 0, 393, 0, 394, 0, -207, 42, 0, -207, + 43, 44, 45, 0, 46, 47, 48, 49, 0, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 397, 61, 399, 401, 0, 6, 62, 63, 64, 65, + 0, 0, 0, 0, 38, 66, 67, -207, -207, 0, + 0, 0, 0, 0, 68, 69, -208, -208, 423, -208, + 0, 0, 0, -208, 0, -209, -209, 0, -209, 0, + 0, 0, -209, 0, -208, 0, 0, -208, 0, 0, + 0, 41, 0, -209, 0, 443, -209, 16, 70, 42, + 0, 448, 43, 44, 45, 0, 46, 47, 48, 49, + 0, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 0, 61, 0, -208, -208, 6, 62, 63, + 64, 65, 0, 0, -209, -209, 38, 212, 67, 0, + 0, 0, 0, 0, 0, 0, 68, 69, 0, 0, + 0, 0, -210, -210, 0, -210, 0, 0, 0, -210, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -210, 117, 0, -210, 0, 0, 0, 0, 42, 16, + 70, 43, 44, 45, 0, 46, 47, 48, 49, 0, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 0, 61, 0, 0, 0, 6, 62, 63, 64, + 65, -210, -210, 0, 0, 38, 0, 67, 0, 0, + 0, 0, 0, 0, 0, 68, 69, 0, 0, 0, + 0, 59, 60, 0, 61, 0, 0, 0, 6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, + 244, 0, 225, 0, 0, 0, 0, 42, 16, 70, + 43, 44, 45, 0, 46, 47, 48, 49, 0, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 0, 61, 120, 0, 0, 6, 62, 63, 64, 65, + 16, 70, 0, 0, 38, 0, 67, 0, 0, 0, + 0, 0, 0, 0, 68, 69, 59, 60, 121, 61, + 122, 123, 124, 6, 62, 63, 64, 65, 125, 126, + 127, 0, 0, 0, 128, 0, 0, 0, 129, 0, + 188, 0, 0, 0, 0, 0, 0, 16, 70, 0, + 0, 0, 0, 0, 130, 131, 0, 120, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 132, 0, 0, 133, 16, 70, 29, 134, 135, + 136, 59, 60, 121, 61, 122, 123, 124, 6, 62, + 63, 64, 65, 125, 126, 127, 382, 0, 0, 249, + 250, 0, 266, 129, 0, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 0, 0, 0, 130, + 131, 0, 120, 0, 0, 0, 0, 0, 277, 278, + 279, 280, 281, 282, 283, 284, 132, 0, 0, 133, + 16, 70, 29, 134, 135, 136, 59, 60, 121, 61, + 122, 123, 124, 6, 62, 63, 64, 65, 125, 126, + 127, 388, 0, 0, 128, 0, 0, 266, 129, 0, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 0, 0, 0, 0, 130, 131, 0, 120, 0, 0, + 0, 0, 0, 277, 278, 279, 280, 281, 282, 283, + 284, 132, 0, 0, 133, 16, 70, 29, 134, 135, + 136, 59, 60, 121, 61, 122, 123, 124, 6, 62, + 63, 64, 65, 125, 126, 127, 406, 0, 0, 249, + 0, 0, 266, 129, 0, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 0, 0, 0, 130, + 131, 0, 0, 0, 0, 0, 0, 0, 277, 278, + 279, 280, 281, 282, 283, 284, 132, 0, 0, 133, + 16, 70, 29, 134, 135, 136, 42, 0, 0, 43, + 44, 45, 0, 46, 47, 48, 49, 0, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 0, + 61, 0, 0, 0, 6, 62, 63, 64, 65, 0, + 0, 0, 0, 38, 0, 67, 0, 0, 0, 0, + 0, 0, 338, 68, 69, 0, 0, 339, 0, 0, + 0, 0, 266, 0, 0, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 16, 70, 277, 278, + 279, 280, 281, 282, 283, 284, 415, 0, 0, 0, + 0, 416, 0, 0, 0, 0, 266, 0, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 277, 278, 279, 280, 281, 282, 283, 284, + 417, 0, 0, 0, 0, 418, 0, 0, 0, 0, + 266, 0, 0, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 277, 278, 279, 280, + 281, 282, 283, 284, 419, 0, 0, 0, 0, 420, + 0, 0, 0, 0, 266, 0, 0, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 366, 0, + 277, 278, 279, 280, 281, 282, 283, 284, 266, 0, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 368, 0, 277, 278, 279, 280, 281, 282, + 283, 284, 266, 0, 0, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 372, 0, 277, 278, + 279, 280, 281, 282, 283, 284, 266, 0, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 391, 0, 277, 278, 279, 280, 281, 282, 283, 284, + 266, 0, 0, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 392, 0, 277, 278, 279, 280, + 281, 282, 283, 284, 266, 0, 0, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 338, 0, + 277, 278, 279, 280, 281, 282, 283, 284, 266, 0, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 414, 0, 277, 278, 279, 280, 281, 282, + 283, 284, 266, 0, 0, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 425, 0, 277, 278, + 279, 280, 281, 282, 283, 284, 266, 0, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 427, 0, 277, 278, 279, 280, 281, 282, 283, 284, + 266, 0, 0, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 458, 0, 277, 278, 279, 280, + 281, 282, 283, 284, 266, 0, 0, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 460, 0, + 277, 278, 279, 280, 281, 282, 283, 284, 266, 0, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 277, 278, 279, 280, 281, 282, + 283, 284, 409, 0, 0, 0, 0, 0, 266, 0, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 277, 278, 279, 280, 281, 282, + 283, 284, 412, 0, 0, 0, 0, 0, 266, 0, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 277, 278, 279, 280, 281, 282, + 283, 284, 422, 0, 0, 0, 0, 266, 0, 0, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 277, 278, 279, 280, 281, 282, 283, + 284, 395, 0, 266, 0, 0, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 277, + 278, 279, 280, 281, 282, 283, 284, 265, 266, 0, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 277, 278, 279, 280, 281, 282, + 283, 284, 300, 266, 0, 0, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 266, 0, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 0, 0, 0, + 0, 0, 277, 278, 279, 280, 281, 282, 283, 284, + 267, 268, 0, 270, 271, 272, 273, 274, 275, 276, + 267, 268, 0, 0, 271, 272, 273, 274, 275, 276, + 0, 0, 0, 277, 278, 279, 280, 281, 282, 283, + 284, 0, 0, 277, 278, 279, 280, 281, 282, 283, + 284, 267, 268, 0, 0, 271, 272, 273, 274, 275, + 276, 267, 268, 0, 0, 271, 272, 273, 274, 275, + 276, 0, 0, 0, 0, 278, 279, 280, 281, 282, + 283, 284, 0, 0, 0, 278, 0, 280, 281, 282, + 283, 284 + }; + + const short + parser::yycheck_[] = + { + 0, 35, 128, 179, 54, 179, 20, 179, 110, 9, + 47, 54, 47, 30, 64, 3, 4, 47, 96, 97, + 98, 58, 95, 58, 47, 25, 38, 54, 101, 41, + 0, 104, 59, 60, 46, 41, 36, 51, 38, 55, + 46, 41, 55, 60, 60, 110, 46, 60, 99, 100, + 38, 54, 154, 41, 64, 67, 68, 69, 46, 59, + 60, 73, 99, 100, 99, 100, 97, 67, 68, 69, + 100, 59, 60, 73, 64, 40, 41, 100, 43, 67, + 68, 69, 47, 55, 55, 73, 55, 55, 60, 154, + 101, 60, 60, 58, 55, 38, 61, 64, 41, 60, + 56, 191, 192, 46, 100, 207, 55, 119, 210, 211, + 110, 60, 64, 119, 59, 60, 55, 59, 60, 119, + 132, 60, 110, 249, 67, 68, 69, 59, 60, 129, + 73, 119, 132, 38, 99, 100, 41, 63, 55, 54, + 54, 46, 207, 60, 132, 210, 211, 58, 55, 62, + 80, 55, 242, 60, 154, 54, 60, 38, 54, 54, + 41, 64, 67, 68, 69, 46, 154, 179, 73, 100, + 55, 64, 64, 55, 38, 60, 119, 41, 60, 179, + 180, 54, 46, 54, 64, 64, 67, 68, 69, 132, + 64, 179, 73, 295, 64, 64, 11, 12, 13, 14, + 15, 54, 62, 67, 68, 69, 54, 207, 54, 73, + 210, 211, 55, 62, 119, 305, 27, 104, 308, 207, + 58, 63, 210, 211, 63, 54, 62, 132, 58, 54, + 295, 62, 47, 54, 58, 58, 179, 54, 119, 100, + 54, 54, 60, 243, 94, 95, 96, 97, 98, 59, + 426, 132, 426, 38, 426, 119, 41, 64, 54, 64, + 54, 46, 64, 64, 54, 54, 59, 25, 132, 40, + 41, 30, 43, 64, 179, 59, 47, 48, 49, 50, + 51, 59, 67, 68, 69, 100, 286, 58, 73, 59, + 416, 54, 418, 55, 420, 295, 64, 64, 179, 64, + 390, 313, 38, 64, 64, 41, 306, 295, 55, 309, + 46, 54, 54, 313, 54, 179, 55, 55, 408, 64, + 64, 411, 68, 69, 9, 313, 9, 64, 99, 100, + 9, 67, 68, 69, 119, 426, 313, 73, 372, 73, + 132, 51, -1, -1, 434, -1, -1, 132, 94, 95, + 96, 97, 98, -1, 366, -1, 368, -1, -1, 449, + 366, 451, 368, 453, -1, -1, 366, -1, 368, -1, + 313, 371, -1, -1, 38, -1, -1, 41, 366, -1, + 368, -1, 46, 119, -1, -1, -1, -1, -1, -1, + -1, -1, 40, 41, 179, 43, 132, -1, -1, 47, + -1, -1, -1, 67, 68, 69, 54, -1, 313, 73, + 58, -1, 424, 61, 426, 427, -1, -1, 424, -1, + -1, 427, -1, 366, 424, 368, 426, 427, -1, -1, + -1, -1, 313, -1, -1, -1, 424, -1, 426, 427, + -1, -1, -1, 179, -1, -1, -1, 459, 460, 313, + -1, 99, 100, 459, 460, 119, -1, -1, -1, 459, + 460, 366, -1, 368, -1, -1, -1, -1, 132, -1, + 38, 459, 460, 41, -1, -1, -1, -1, 46, -1, + -1, 424, -1, 426, 427, 366, -1, 368, 40, 41, + -1, 43, -1, -1, -1, 47, -1, -1, -1, 67, + 68, 69, 366, -1, 368, 73, 58, -1, -1, 61, + -1, -1, -1, -1, -1, 179, 459, 460, -1, 424, + -1, 426, 427, -1, -1, -1, 40, 41, 313, 43, + -1, -1, -1, 47, 48, 49, 50, 51, -1, -1, + 54, -1, -1, 424, 58, 426, 427, 99, 100, -1, + -1, 119, -1, -1, 459, 460, -1, -1, -1, -1, + 424, -1, 426, 427, 132, -1, 40, 41, -1, 43, + -1, -1, -1, 47, -1, -1, -1, 313, 459, 460, + -1, 366, -1, 368, 58, 99, 100, 61, -1, 103, + 104, 40, 41, -1, 43, 459, 460, -1, 47, 48, + 49, 50, 51, -1, -1, 40, 41, -1, 43, 58, + -1, 179, 47, 48, 49, 50, 51, 66, 67, -1, + -1, -1, -1, 58, -1, 99, 100, 68, 69, -1, + 366, -1, 368, 74, 75, 76, 77, -1, -1, 424, + -1, 426, 427, 17, 18, 42, 20, 21, -1, 313, + 99, 100, -1, 94, 95, 96, 97, 98, 55, -1, + -1, -1, -1, -1, 99, 100, 40, 41, -1, 43, + -1, -1, -1, 47, 459, 460, -1, -1, 40, 41, + -1, 43, -1, -1, 58, 47, -1, 61, 424, -1, + 426, 427, 66, 67, -1, -1, 58, -1, -1, 61, + -1, -1, 366, -1, 368, -1, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, -1, -1, -1, + -1, -1, -1, 459, 460, 99, 100, -1, 40, 41, + 127, 43, -1, 130, 131, 47, -1, 99, 100, -1, + -1, -1, -1, -1, -1, 313, 58, -1, -1, 61, + -1, -1, -1, -1, 66, 67, -1, -1, -1, -1, + 424, -1, 426, 427, -1, -1, -1, -1, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 176, + -1, 178, -1, -1, 181, -1, -1, 99, 100, -1, + -1, -1, -1, -1, -1, 459, 460, -1, 366, -1, + 368, -1, -1, 200, -1, 40, 41, -1, 43, -1, + -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 219, 58, -1, -1, 61, 224, -1, -1, + -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, -1, -1, -1, -1, -1, -1, -1, 246, + 247, -1, 249, -1, -1, -1, 424, -1, 426, 427, + 257, -1, -1, -1, 99, 100, -1, -1, -1, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, -1, -1, + -1, 459, 460, -1, -1, -1, -1, 68, 69, -1, + -1, 72, 73, 74, 75, 76, 77, 304, -1, -1, + 307, -1, -1, 310, -1, -1, -1, 314, -1, 316, + 317, 318, 319, 94, 95, 96, 97, 98, 40, 41, + -1, 43, -1, -1, -1, 47, -1, -1, -1, 11, + -1, -1, 339, -1, 341, -1, 58, 19, -1, 61, + 22, 23, 24, -1, 26, 27, 28, 29, -1, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 367, 43, 369, 370, -1, 47, 48, 49, 50, 51, + -1, -1, -1, -1, 56, 57, 58, 99, 100, -1, + -1, -1, -1, -1, 66, 67, 40, 41, 395, 43, + -1, -1, -1, 47, -1, 40, 41, -1, 43, -1, + -1, -1, 47, -1, 58, -1, -1, 61, -1, -1, + -1, 11, -1, 58, -1, 422, 61, 99, 100, 19, + -1, 428, 22, 23, 24, -1, 26, 27, 28, 29, + -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, -1, 43, -1, 99, 100, 47, 48, 49, + 50, 51, -1, -1, 99, 100, 56, 57, 58, -1, + -1, -1, -1, -1, -1, -1, 66, 67, -1, -1, + -1, -1, 40, 41, -1, 43, -1, -1, -1, 47, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 58, 12, -1, 61, -1, -1, -1, -1, 19, 99, + 100, 22, 23, 24, -1, 26, 27, 28, 29, -1, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, -1, 43, -1, -1, -1, 47, 48, 49, 50, + 51, 99, 100, -1, -1, 56, -1, 58, -1, -1, + -1, -1, -1, -1, -1, 66, 67, -1, -1, -1, + -1, 40, 41, -1, 43, -1, -1, -1, 47, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, + 12, -1, 61, -1, -1, -1, -1, 19, 99, 100, + 22, 23, 24, -1, 26, 27, 28, 29, -1, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + -1, 43, 16, -1, -1, 47, 48, 49, 50, 51, + 99, 100, -1, -1, 56, -1, 58, -1, -1, -1, + -1, -1, -1, -1, 66, 67, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, -1, -1, -1, 58, -1, -1, -1, 62, -1, + 64, -1, -1, -1, -1, -1, -1, 99, 100, -1, + -1, -1, -1, -1, 78, 79, -1, 16, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 95, -1, -1, 98, 99, 100, 101, 102, 103, + 104, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 59, -1, -1, 58, + 59, -1, 65, 62, -1, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, -1, -1, -1, -1, 78, + 79, -1, 16, -1, -1, -1, -1, -1, 91, 92, + 93, 94, 95, 96, 97, 98, 95, -1, -1, 98, + 99, 100, 101, 102, 103, 104, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 59, -1, -1, 58, -1, -1, 65, 62, -1, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + -1, -1, -1, -1, 78, 79, -1, 16, -1, -1, + -1, -1, -1, 91, 92, 93, 94, 95, 96, 97, + 98, 95, -1, -1, 98, 99, 100, 101, 102, 103, + 104, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 59, -1, -1, 58, + -1, -1, 65, 62, -1, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, -1, -1, -1, -1, 78, + 79, -1, -1, -1, -1, -1, -1, -1, 91, 92, + 93, 94, 95, 96, 97, 98, 95, -1, -1, 98, + 99, 100, 101, 102, 103, 104, 19, -1, -1, 22, + 23, 24, -1, 26, 27, 28, 29, -1, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, -1, + 43, -1, -1, -1, 47, 48, 49, 50, 51, -1, + -1, -1, -1, 56, -1, 58, -1, -1, -1, -1, + -1, -1, 55, 66, 67, -1, -1, 60, -1, -1, + -1, -1, 65, -1, -1, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 99, 100, 91, 92, + 93, 94, 95, 96, 97, 98, 55, -1, -1, -1, + -1, 60, -1, -1, -1, -1, 65, -1, -1, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 91, 92, 93, 94, 95, 96, 97, 98, + 55, -1, -1, -1, -1, 60, -1, -1, -1, -1, + 65, -1, -1, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 91, 92, 93, 94, + 95, 96, 97, 98, 55, -1, -1, -1, -1, 60, + -1, -1, -1, -1, 65, -1, -1, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, + 91, 92, 93, 94, 95, 96, 97, 98, 65, -1, + -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 55, -1, 91, 92, 93, 94, 95, 96, + 97, 98, 65, -1, -1, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 55, -1, 91, 92, + 93, 94, 95, 96, 97, 98, 65, -1, -1, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 55, -1, 91, 92, 93, 94, 95, 96, 97, 98, + 65, -1, -1, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 55, -1, 91, 92, 93, 94, + 95, 96, 97, 98, 65, -1, -1, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, + 91, 92, 93, 94, 95, 96, 97, 98, 65, -1, + -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 55, -1, 91, 92, 93, 94, 95, 96, + 97, 98, 65, -1, -1, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 55, -1, 91, 92, + 93, 94, 95, 96, 97, 98, 65, -1, -1, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 55, -1, 91, 92, 93, 94, 95, 96, 97, 98, + 65, -1, -1, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 55, -1, 91, 92, 93, 94, + 95, 96, 97, 98, 65, -1, -1, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, + 91, 92, 93, 94, 95, 96, 97, 98, 65, -1, + -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 91, 92, 93, 94, 95, 96, + 97, 98, 59, -1, -1, -1, -1, -1, 65, -1, + -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 91, 92, 93, 94, 95, 96, + 97, 98, 59, -1, -1, -1, -1, -1, 65, -1, + -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 91, 92, 93, 94, 95, 96, + 97, 98, 60, -1, -1, -1, -1, 65, -1, -1, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 91, 92, 93, 94, 95, 96, 97, + 98, 63, -1, 65, -1, -1, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, + 92, 93, 94, 95, 96, 97, 98, 64, 65, -1, + -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 91, 92, 93, 94, 95, 96, + 97, 98, 64, 65, -1, -1, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 65, -1, -1, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 91, + 92, 93, 94, 95, 96, 97, 98, -1, -1, -1, + -1, -1, 91, 92, 93, 94, 95, 96, 97, 98, + 68, 69, -1, 71, 72, 73, 74, 75, 76, 77, + 68, 69, -1, -1, 72, 73, 74, 75, 76, 77, + -1, -1, -1, 91, 92, 93, 94, 95, 96, 97, + 98, -1, -1, 91, 92, 93, 94, 95, 96, 97, + 98, 68, 69, -1, -1, 72, 73, 74, 75, 76, + 77, 68, 69, -1, -1, 72, 73, 74, 75, 76, + 77, -1, -1, -1, -1, 92, 93, 94, 95, 96, + 97, 98, -1, -1, -1, 92, -1, 94, 95, 96, + 97, 98 + }; + + const unsigned char + parser::yystos_[] = + { + 0, 11, 12, 13, 14, 15, 47, 100, 116, 117, + 118, 119, 120, 121, 122, 194, 99, 100, 195, 195, + 54, 0, 118, 119, 120, 54, 97, 64, 64, 101, + 197, 170, 194, 100, 55, 55, 60, 64, 56, 128, + 194, 11, 19, 22, 23, 24, 26, 27, 28, 29, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 43, 48, 49, 50, 51, 57, 58, 66, 67, + 100, 123, 124, 126, 127, 128, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 156, 157, 158, 165, 166, 167, 168, 176, 179, 180, + 183, 187, 188, 189, 190, 194, 195, 12, 123, 125, + 16, 42, 44, 45, 46, 52, 53, 54, 58, 62, + 78, 79, 95, 98, 102, 103, 104, 154, 159, 160, + 161, 162, 163, 164, 165, 166, 169, 173, 174, 175, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 64, 54, 64, 54, 123, 54, 54, + 54, 54, 95, 197, 200, 63, 64, 64, 64, 154, + 64, 54, 54, 58, 194, 195, 58, 194, 195, 58, + 58, 165, 166, 177, 178, 179, 180, 183, 194, 58, + 183, 183, 57, 124, 64, 64, 64, 64, 64, 80, + 17, 18, 20, 21, 58, 61, 66, 67, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 167, + 168, 194, 54, 62, 12, 123, 54, 54, 154, 58, + 59, 154, 171, 172, 194, 154, 154, 54, 103, 104, + 179, 180, 182, 194, 100, 64, 65, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 91, 92, 93, + 94, 95, 96, 97, 98, 61, 62, 55, 154, 27, + 154, 129, 156, 157, 158, 183, 194, 154, 63, 63, + 64, 171, 172, 171, 58, 54, 62, 58, 54, 62, + 58, 154, 59, 60, 58, 154, 54, 54, 54, 54, + 154, 100, 193, 154, 154, 154, 154, 154, 154, 154, + 154, 154, 154, 154, 171, 194, 154, 154, 55, 60, + 154, 60, 59, 154, 154, 154, 154, 154, 154, 154, + 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, + 154, 154, 154, 47, 194, 64, 55, 54, 55, 64, + 30, 60, 55, 55, 55, 154, 171, 194, 154, 171, + 194, 154, 59, 178, 154, 154, 154, 154, 59, 55, + 54, 55, 55, 154, 154, 63, 123, 154, 123, 154, + 155, 154, 194, 128, 64, 64, 59, 55, 54, 59, + 55, 54, 59, 59, 55, 55, 60, 55, 60, 55, + 60, 171, 60, 154, 25, 55, 64, 55, 30, 59, + 171, 59, 171, 59, 54, 64, 64, 172, 64, 172, + 64, 172, 55, 154, 123, 64, 129, 123, 154, 54, + 55, 54, 55, 54, 171, 55, 55, 55, 55, 55, + 55, 171, 171, 171, 55, 64, 64, 64, 123, 123, + 55, 55, 55 + }; + + const unsigned char + parser::yyr1_[] = + { + 0, 115, 116, 116, 117, 117, 117, 117, 117, 117, + 118, 119, 120, 120, 120, 120, 121, 122, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 124, 124, 125, 125, 126, 126, 127, + 127, 128, 128, 129, 129, 129, 129, 130, 130, 131, + 131, 131, 132, 133, 133, 134, 135, 135, 136, 136, + 137, 138, 138, 139, 140, 141, 142, 143, 144, 144, + 145, 146, 146, 147, 148, 149, 150, 150, 151, 152, + 153, 154, 154, 154, 155, 155, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 157, 157, + 158, 158, 159, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 162, 163, 163, 163, 163, 164, 165, 165, 166, + 166, 167, 167, 167, 167, 167, 167, 168, 168, 168, + 168, 169, 170, 170, 170, 171, 171, 172, 172, 173, + 174, 175, 175, 176, 177, 177, 178, 178, 178, 179, + 180, 181, 182, 183, 183, 183, 183, 183, 183, 183, + 183, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 194, 195, 195, 195, 196, 197, 198, + 199, 199, 200, 200, 201, 202 + }; + + const signed char + parser::yyr2_[] = + { + 0, 2, 1, 0, 2, 2, 2, 1, 1, 1, + 3, 3, 1, 1, 1, 1, 5, 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, 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, 2, 4, 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, 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, 2, 2, 2, 2, 2, 2, 1, 1, 2, + 2, 4, 6, 5, 7, 5, 7, 8, 9, 9, + 9, 3, 3, 1, 0, 1, 0, 3, 1, 4, + 4, 2, 3, 3, 3, 1, 1, 1, 1, 4, + 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, + 1, 1, 1, 1, 3, 1, 1, 1, 1, 7, + 2, 1, 2, 1, 1, 1 + }; + + + + +#if GSCDEBUG + const short + parser::yyrline_[] = + { + 0, 272, 272, 273, 277, 279, 281, 283, 285, 287, + 292, 296, 301, 302, 303, 304, 308, 313, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 346, 347, 351, 353, 358, 360, 365, + 366, 370, 371, 375, 377, 379, 382, 386, 388, 393, + 395, 397, 402, 407, 409, 414, 419, 421, 426, 428, + 433, 438, 440, 445, 450, 455, 460, 465, 470, 475, + 484, 491, 493, 498, 503, 508, 513, 515, 520, 525, + 530, 535, 536, 537, 541, 542, 546, 548, 550, 552, + 554, 556, 558, 560, 562, 564, 566, 568, 573, 575, + 580, 582, 587, 592, 594, 596, 598, 600, 602, 604, + 606, 608, 610, 612, 614, 616, 618, 620, 622, 624, + 626, 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, 664, 669, 671, 673, 675, 680, 685, 686, 689, + 690, 694, 696, 698, 700, 702, 704, 709, 711, 713, + 715, 720, 725, 727, 730, 734, 737, 741, 743, 748, + 753, 758, 760, 765, 772, 774, 779, 780, 781, 785, + 790, 795, 800, 805, 806, 807, 808, 809, 810, 811, + 812, 813, 817, 822, 827, 832, 837, 842, 847, 852, + 857, 862, 867, 869, 874, 876, 878, 883, 888, 893, + 898, 900, 905, 907, 912, 917 + }; + + 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 // GSCDEBUG + + +#line 13 "parser.ypp" +} } // xsk::gsc +#line 4772 "parser.cpp" + +#line 921 "parser.ypp" + + +namespace xsk::gsc +{ + +void parser::error(location const& loc, std::string const& msg) +{ + throw comp_error(loc, msg); +} + +auto parse_switch(stmt_switch& stm) -> void +{ + auto body = make_stmt_list(stm.body->loc()); + auto current_case = stmt{ nullptr }; + + auto num = stm.body->list.size(); + + for (auto i = 0u; i < num; i++) + { + auto& entry = stm.body->list[0]; + + if (entry == node::stmt_case || entry == node::stmt_default) + { + if (current_case.as_node != nullptr) + { + body->list.push_back(std::move(current_case)); + } + + current_case = std::move(stm.body->list[0]); + stm.body->list.erase(stm.body->list.begin()); + } + else + { + if (current_case.as_node != nullptr) + { + if (current_case == node::stmt_case) + { + current_case.as_case->body->list.push_back(std::move(entry)); + stm.body->list.erase(stm.body->list.begin()); + } + else + { + current_case.as_default->body->list.push_back(std::move(entry)); + stm.body->list.erase(stm.body->list.begin()); + } + } + else + { + throw comp_error(entry.loc(), "missing case statement"); + } + } + } + + if (current_case.as_node != nullptr) + { + body->list.push_back(std::move(current_case)); + } + + stm.body = std::move(body); +} + +} // namespace xsk::gsc diff --git a/src/s4/xsk/parser.hpp b/src/gsc/parser.hpp similarity index 73% rename from src/s4/xsk/parser.hpp rename to src/gsc/parser.hpp index db2999ae..172c7217 100644 --- a/src/s4/xsk/parser.hpp +++ b/src/gsc/parser.hpp @@ -33,7 +33,7 @@ /** ** \file parser.hpp - ** Define the xsk::gsc::s4::parser class. + ** Define the xsk::gsc::parser class. */ // C++ LALR(1) parser skeleton written by Akim Demaille. @@ -42,17 +42,17 @@ // especially those whose name start with YY_ or yy_. They are // private implementation details that can be changed or removed. -#ifndef YY_S4_PARSER_HPP_INCLUDED -# define YY_S4_PARSER_HPP_INCLUDED +#ifndef YY_GSC_PARSER_HPP_INCLUDED +# define YY_GSC_PARSER_HPP_INCLUDED // "%code requires" blocks. -#line 28 "parser.ypp" +#line 30 "parser.ypp" #ifdef _MSC_VER #pragma warning(disable:4065) #pragma warning(disable:4127) #endif -#include "s4.hpp" -namespace xsk::gsc::s4 { class lexer; } +#include "context.hpp" +namespace xsk::gsc { class lexer; } #line 58 "parser.hpp" @@ -101,9 +101,9 @@ namespace xsk::gsc::s4 { class lexer; } #endif #include -#ifndef S4_ASSERT +#ifndef GSC_ASSERT # include -# define S4_ASSERT assert +# define GSC_ASSERT assert #endif @@ -189,20 +189,20 @@ namespace xsk::gsc::s4 { class lexer; } # endif /* Debug traces. */ -#ifndef S4DEBUG +#ifndef GSCDEBUG # if defined YYDEBUG #if YYDEBUG -# define S4DEBUG 1 +# define GSCDEBUG 1 # else -# define S4DEBUG 0 +# define GSCDEBUG 0 # endif # else /* ! defined YYDEBUG */ -# define S4DEBUG 1 +# define GSCDEBUG 1 # endif /* ! defined YYDEBUG */ -#endif /* ! defined S4DEBUG */ +#endif /* ! defined GSCDEBUG */ #line 13 "parser.ypp" -namespace xsk { namespace gsc { namespace s4 { +namespace xsk { namespace gsc { #line 207 "parser.hpp" @@ -212,11 +212,11 @@ namespace xsk { namespace gsc { namespace s4 { class parser { public: -#ifdef S4STYPE +#ifdef GSCSTYPE # ifdef __GNUC__ -# pragma GCC message "bison: do not #define S4STYPE in C++, use %define api.value.type" +# pragma GCC message "bison: do not #define GSCSTYPE in C++, use %define api.value.type" # endif - typedef S4STYPE value_type; + typedef GSCSTYPE value_type; #else /// A buffer to store and retrieve objects. /// @@ -240,7 +240,7 @@ namespace xsk { namespace gsc { namespace s4 { value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { - S4_ASSERT (sizeof (T) <= size); + GSC_ASSERT (sizeof (T) <= size); new (yyas_ ()) T (YY_MOVE (t)); } @@ -254,7 +254,7 @@ namespace xsk { namespace gsc { namespace s4 { /// Destruction, allowed only if empty. ~value_type () YY_NOEXCEPT { - S4_ASSERT (!yytypeid_); + GSC_ASSERT (!yytypeid_); } # if 201103L <= YY_CPLUSPLUS @@ -263,8 +263,8 @@ namespace xsk { namespace gsc { namespace s4 { T& emplace (U&&... u) { - S4_ASSERT (!yytypeid_); - S4_ASSERT (sizeof (T) <= size); + GSC_ASSERT (!yytypeid_); + GSC_ASSERT (sizeof (T) <= size); yytypeid_ = & typeid (T); return *new (yyas_ ()) T (std::forward (u)...); } @@ -274,8 +274,8 @@ namespace xsk { namespace gsc { namespace s4 { T& emplace () { - S4_ASSERT (!yytypeid_); - S4_ASSERT (sizeof (T) <= size); + GSC_ASSERT (!yytypeid_); + GSC_ASSERT (sizeof (T) <= size); yytypeid_ = & typeid (T); return *new (yyas_ ()) T (); } @@ -285,8 +285,8 @@ namespace xsk { namespace gsc { namespace s4 { T& emplace (const T& t) { - S4_ASSERT (!yytypeid_); - S4_ASSERT (sizeof (T) <= size); + GSC_ASSERT (!yytypeid_); + GSC_ASSERT (sizeof (T) <= size); yytypeid_ = & typeid (T); return *new (yyas_ ()) T (t); } @@ -315,9 +315,9 @@ namespace xsk { namespace gsc { namespace s4 { T& as () YY_NOEXCEPT { - S4_ASSERT (yytypeid_); - S4_ASSERT (*yytypeid_ == typeid (T)); - S4_ASSERT (sizeof (T) <= size); + GSC_ASSERT (yytypeid_); + GSC_ASSERT (*yytypeid_ == typeid (T)); + GSC_ASSERT (sizeof (T) <= size); return *yyas_ (); } @@ -326,9 +326,9 @@ namespace xsk { namespace gsc { namespace s4 { const T& as () const YY_NOEXCEPT { - S4_ASSERT (yytypeid_); - S4_ASSERT (*yytypeid_ == typeid (T)); - S4_ASSERT (sizeof (T) <= size); + GSC_ASSERT (yytypeid_); + GSC_ASSERT (*yytypeid_ == typeid (T)); + GSC_ASSERT (sizeof (T) <= size); return *yyas_ (); } @@ -344,8 +344,8 @@ namespace xsk { namespace gsc { namespace s4 { void swap (self_type& that) YY_NOEXCEPT { - S4_ASSERT (yytypeid_); - S4_ASSERT (*yytypeid_ == *that.yytypeid_); + GSC_ASSERT (yytypeid_); + GSC_ASSERT (*yytypeid_ == *that.yytypeid_); std::swap (as (), that.as ()); } @@ -424,19 +424,16 @@ namespace xsk { namespace gsc { namespace s4 { { // expr_function // expr_pointer - char dummy1[sizeof (ast::call)]; + char dummy1[sizeof (call)]; // declaration - char dummy2[sizeof (ast::decl)]; + char dummy2[sizeof (decl)]; - // decl_constant - char dummy3[sizeof (ast::decl_constant::ptr)]; - - // decl_thread - char dummy4[sizeof (ast::decl_thread::ptr)]; + // decl_function + char dummy3[sizeof (decl_function::ptr)]; // decl_usingtree - char dummy5[sizeof (ast::decl_usingtree::ptr)]; + char dummy4[sizeof (decl_usingtree::ptr)]; // expr // expr_or_empty @@ -449,204 +446,117 @@ namespace xsk { namespace gsc { namespace s4 { // expr_tuple // expr_tuple_types // expr_object - char dummy6[sizeof (ast::expr)]; + char dummy5[sizeof (expr)]; // expr_add_array - char dummy7[sizeof (ast::expr_add_array::ptr)]; + char dummy6[sizeof (expr_add_array::ptr)]; // expr_anim - char dummy8[sizeof (ast::expr_anim::ptr)]; + char dummy7[sizeof (expr_anim::ptr)]; // expr_animation - char dummy9[sizeof (ast::expr_animation::ptr)]; + char dummy8[sizeof (expr_animation::ptr)]; // expr_animtree - char dummy10[sizeof (ast::expr_animtree::ptr)]; + char dummy9[sizeof (expr_animtree::ptr)]; // expr_arguments // expr_arguments_no_empty - char dummy11[sizeof (ast::expr_arguments::ptr)]; + char dummy10[sizeof (expr_arguments::ptr)]; // expr_array - char dummy12[sizeof (ast::expr_array::ptr)]; + char dummy11[sizeof (expr_array::ptr)]; // expr_call - char dummy13[sizeof (ast::expr_call::ptr)]; + char dummy12[sizeof (expr_call::ptr)]; // expr_complement - char dummy14[sizeof (ast::expr_complement::ptr)]; + char dummy13[sizeof (expr_complement::ptr)]; // expr_empty_array - char dummy15[sizeof (ast::expr_empty_array::ptr)]; + char dummy14[sizeof (expr_empty_array::ptr)]; // expr_false - char dummy16[sizeof (ast::expr_false::ptr)]; + char dummy15[sizeof (expr_false::ptr)]; // expr_field - char dummy17[sizeof (ast::expr_field::ptr)]; + char dummy16[sizeof (expr_field::ptr)]; // expr_float - char dummy18[sizeof (ast::expr_float::ptr)]; + char dummy17[sizeof (expr_float::ptr)]; // expr_game - char dummy19[sizeof (ast::expr_game::ptr)]; + char dummy18[sizeof (expr_game::ptr)]; // expr_identifier_nosize // expr_identifier - char dummy20[sizeof (ast::expr_identifier::ptr)]; + char dummy19[sizeof (expr_identifier::ptr)]; // expr_integer - char dummy21[sizeof (ast::expr_integer::ptr)]; + char dummy20[sizeof (expr_integer::ptr)]; // expr_isdefined - char dummy22[sizeof (ast::expr_isdefined::ptr)]; + char dummy21[sizeof (expr_isdefined::ptr)]; // expr_istring - char dummy23[sizeof (ast::expr_istring::ptr)]; + char dummy22[sizeof (expr_istring::ptr)]; // expr_istrue - char dummy24[sizeof (ast::expr_istrue::ptr)]; + char dummy23[sizeof (expr_istrue::ptr)]; // expr_level - char dummy25[sizeof (ast::expr_level::ptr)]; + char dummy24[sizeof (expr_level::ptr)]; // expr_method - char dummy26[sizeof (ast::expr_method::ptr)]; + char dummy25[sizeof (expr_method::ptr)]; // expr_negate - char dummy27[sizeof (ast::expr_negate::ptr)]; + char dummy26[sizeof (expr_negate::ptr)]; // expr_not - char dummy28[sizeof (ast::expr_not::ptr)]; + char dummy27[sizeof (expr_not::ptr)]; // expr_parameters - char dummy29[sizeof (ast::expr_parameters::ptr)]; + char dummy28[sizeof (expr_parameters::ptr)]; // expr_paren - char dummy30[sizeof (ast::expr_paren::ptr)]; + char dummy29[sizeof (expr_paren::ptr)]; // expr_path - char dummy31[sizeof (ast::expr_path::ptr)]; + char dummy30[sizeof (expr_path::ptr)]; // expr_reference - char dummy32[sizeof (ast::expr_reference::ptr)]; + char dummy31[sizeof (expr_reference::ptr)]; // expr_self - char dummy33[sizeof (ast::expr_self::ptr)]; + char dummy32[sizeof (expr_self::ptr)]; // expr_size - char dummy34[sizeof (ast::expr_size::ptr)]; + char dummy33[sizeof (expr_size::ptr)]; // expr_string - char dummy35[sizeof (ast::expr_string::ptr)]; + char dummy34[sizeof (expr_string::ptr)]; // expr_thisthread - char dummy36[sizeof (ast::expr_thisthread::ptr)]; + char dummy35[sizeof (expr_thisthread::ptr)]; // expr_true - char dummy37[sizeof (ast::expr_true::ptr)]; + char dummy36[sizeof (expr_true::ptr)]; // expr_tuple_arguments - char dummy38[sizeof (ast::expr_tuple::ptr)]; + char dummy37[sizeof (expr_tuple::ptr)]; // expr_undefined - char dummy39[sizeof (ast::expr_undefined::ptr)]; + char dummy38[sizeof (expr_undefined::ptr)]; // expr_vector - char dummy40[sizeof (ast::expr_vector::ptr)]; + char dummy39[sizeof (expr_vector::ptr)]; // include - char dummy41[sizeof (ast::include::ptr)]; + char dummy40[sizeof (include::ptr)]; // program - char dummy42[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy43[sizeof (ast::stmt)]; - - // stmt_assign - char dummy44[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy45[sizeof (ast::stmt_break::ptr)]; - - // stmt_breakpoint - char dummy46[sizeof (ast::stmt_breakpoint::ptr)]; - - // stmt_call - char dummy47[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy48[sizeof (ast::stmt_case::ptr)]; - - // stmt_continue - char dummy49[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy50[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy51[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy52[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy53[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy54[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy55[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy56[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy57[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy58[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy59[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy60[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy61[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy62[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy63[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy64[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy65[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waitframe - char dummy66[sizeof (ast::stmt_waitframe::ptr)]; - - // stmt_waittill - char dummy67[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy68[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy69[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy70[sizeof (ast::stmt_while::ptr)]; + char dummy41[sizeof (program::ptr)]; // "path" // "identifier" @@ -654,7 +564,94 @@ namespace xsk { namespace gsc { namespace s4 { // "localized string" // "float" // "integer" - char dummy71[sizeof (std::string)]; + char dummy42[sizeof (std::string)]; + + // stmt + // stmt_or_dev + char dummy43[sizeof (stmt)]; + + // stmt_assign + char dummy44[sizeof (stmt_assign::ptr)]; + + // stmt_break + char dummy45[sizeof (stmt_break::ptr)]; + + // stmt_breakpoint + char dummy46[sizeof (stmt_breakpoint::ptr)]; + + // stmt_call + char dummy47[sizeof (stmt_call::ptr)]; + + // stmt_case + char dummy48[sizeof (stmt_case::ptr)]; + + // stmt_continue + char dummy49[sizeof (stmt_continue::ptr)]; + + // stmt_default + char dummy50[sizeof (stmt_default::ptr)]; + + // stmt_dev + char dummy51[sizeof (stmt_dev::ptr)]; + + // stmt_dowhile + char dummy52[sizeof (stmt_dowhile::ptr)]; + + // stmt_endon + char dummy53[sizeof (stmt_endon::ptr)]; + + // stmt_expr + char dummy54[sizeof (stmt_expr::ptr)]; + + // stmt_for + char dummy55[sizeof (stmt_for::ptr)]; + + // stmt_foreach + char dummy56[sizeof (stmt_foreach::ptr)]; + + // stmt_if + char dummy57[sizeof (stmt_if::ptr)]; + + // stmt_ifelse + char dummy58[sizeof (stmt_ifelse::ptr)]; + + // stmt_list + // stmt_or_dev_list + // stmt_block + char dummy59[sizeof (stmt_list::ptr)]; + + // stmt_notify + char dummy60[sizeof (stmt_notify::ptr)]; + + // stmt_prof_begin + char dummy61[sizeof (stmt_prof_begin::ptr)]; + + // stmt_prof_end + char dummy62[sizeof (stmt_prof_end::ptr)]; + + // stmt_return + char dummy63[sizeof (stmt_return::ptr)]; + + // stmt_switch + char dummy64[sizeof (stmt_switch::ptr)]; + + // stmt_wait + char dummy65[sizeof (stmt_wait::ptr)]; + + // stmt_waitframe + char dummy66[sizeof (stmt_waitframe::ptr)]; + + // stmt_waittill + char dummy67[sizeof (stmt_waittill::ptr)]; + + // stmt_waittillframeend + char dummy68[sizeof (stmt_waittillframeend::ptr)]; + + // stmt_waittillmatch + char dummy69[sizeof (stmt_waittillmatch::ptr)]; + + // stmt_while + char dummy70[sizeof (stmt_while::ptr)]; }; /// The size of the largest semantic type. @@ -703,10 +700,10 @@ namespace xsk { namespace gsc { namespace s4 { { enum token_kind_type { - S4EMPTY = -2, - S4EOF = 0, // "end of file" - S4error = 1, // error - S4UNDEF = 2, // "invalid token" + GSCEMPTY = -2, + GSCEOF = 0, // "end of file" + GSCerror = 1, // error + GSCUNDEF = 2, // "invalid token" SH_DEFINE = 3, // "#define" SH_UNDEF = 4, // "#undef" SH_IFDEF = 5, // "#ifdef" @@ -959,88 +956,87 @@ namespace xsk { namespace gsc { namespace s4 { S_include = 119, // include S_declaration = 120, // declaration S_decl_usingtree = 121, // decl_usingtree - S_decl_constant = 122, // decl_constant - S_decl_thread = 123, // decl_thread - S_stmt = 124, // stmt - S_stmt_or_dev = 125, // stmt_or_dev - S_stmt_list = 126, // stmt_list - S_stmt_or_dev_list = 127, // stmt_or_dev_list - S_stmt_dev = 128, // stmt_dev - S_stmt_block = 129, // stmt_block - S_stmt_expr = 130, // stmt_expr - S_stmt_call = 131, // stmt_call - S_stmt_assign = 132, // stmt_assign - S_stmt_endon = 133, // stmt_endon - S_stmt_notify = 134, // stmt_notify - S_stmt_wait = 135, // stmt_wait - S_stmt_waittill = 136, // stmt_waittill - S_stmt_waittillmatch = 137, // stmt_waittillmatch - S_stmt_waittillframeend = 138, // stmt_waittillframeend - S_stmt_waitframe = 139, // stmt_waitframe - S_stmt_if = 140, // stmt_if - S_stmt_ifelse = 141, // stmt_ifelse - S_stmt_while = 142, // stmt_while - S_stmt_dowhile = 143, // stmt_dowhile - S_stmt_for = 144, // stmt_for - S_stmt_foreach = 145, // stmt_foreach - S_stmt_switch = 146, // stmt_switch - S_stmt_case = 147, // stmt_case - S_stmt_default = 148, // stmt_default - S_stmt_break = 149, // stmt_break - S_stmt_continue = 150, // stmt_continue - S_stmt_return = 151, // stmt_return - S_stmt_breakpoint = 152, // stmt_breakpoint - S_stmt_prof_begin = 153, // stmt_prof_begin - S_stmt_prof_end = 154, // stmt_prof_end - S_expr = 155, // expr - S_expr_or_empty = 156, // expr_or_empty - S_expr_assign = 157, // expr_assign - S_expr_increment = 158, // expr_increment - S_expr_decrement = 159, // expr_decrement - S_expr_ternary = 160, // expr_ternary - S_expr_binary = 161, // expr_binary - S_expr_primitive = 162, // expr_primitive - S_expr_complement = 163, // expr_complement - S_expr_negate = 164, // expr_negate - S_expr_not = 165, // expr_not - S_expr_call = 166, // expr_call - S_expr_method = 167, // expr_method - S_expr_function = 168, // expr_function - S_expr_pointer = 169, // expr_pointer - S_expr_add_array = 170, // expr_add_array - S_expr_parameters = 171, // expr_parameters - S_expr_arguments = 172, // expr_arguments - S_expr_arguments_no_empty = 173, // expr_arguments_no_empty - S_expr_isdefined = 174, // expr_isdefined - S_expr_istrue = 175, // expr_istrue - S_expr_reference = 176, // expr_reference - S_expr_tuple = 177, // expr_tuple - S_expr_tuple_arguments = 178, // expr_tuple_arguments - S_expr_tuple_types = 179, // expr_tuple_types - S_expr_array = 180, // expr_array - S_expr_field = 181, // expr_field - S_expr_size = 182, // expr_size - S_expr_paren = 183, // expr_paren - S_expr_object = 184, // expr_object - S_expr_thisthread = 185, // expr_thisthread - S_expr_empty_array = 186, // expr_empty_array - S_expr_undefined = 187, // expr_undefined - S_expr_game = 188, // expr_game - S_expr_self = 189, // expr_self - S_expr_anim = 190, // expr_anim - S_expr_level = 191, // expr_level - S_expr_animation = 192, // expr_animation - S_expr_animtree = 193, // expr_animtree - S_expr_identifier_nosize = 194, // expr_identifier_nosize - S_expr_identifier = 195, // expr_identifier - S_expr_path = 196, // expr_path - S_expr_istring = 197, // expr_istring - S_expr_string = 198, // expr_string - S_expr_vector = 199, // expr_vector - S_expr_float = 200, // expr_float - S_expr_integer = 201, // expr_integer - S_expr_false = 202, // expr_false - S_expr_true = 203 // expr_true + S_decl_function = 122, // decl_function + S_stmt = 123, // stmt + S_stmt_or_dev = 124, // stmt_or_dev + S_stmt_list = 125, // stmt_list + S_stmt_or_dev_list = 126, // stmt_or_dev_list + S_stmt_dev = 127, // stmt_dev + S_stmt_block = 128, // stmt_block + S_stmt_expr = 129, // stmt_expr + S_stmt_call = 130, // stmt_call + S_stmt_assign = 131, // stmt_assign + S_stmt_endon = 132, // stmt_endon + S_stmt_notify = 133, // stmt_notify + S_stmt_wait = 134, // stmt_wait + S_stmt_waittill = 135, // stmt_waittill + S_stmt_waittillmatch = 136, // stmt_waittillmatch + S_stmt_waittillframeend = 137, // stmt_waittillframeend + S_stmt_waitframe = 138, // stmt_waitframe + S_stmt_if = 139, // stmt_if + S_stmt_ifelse = 140, // stmt_ifelse + S_stmt_while = 141, // stmt_while + S_stmt_dowhile = 142, // stmt_dowhile + S_stmt_for = 143, // stmt_for + S_stmt_foreach = 144, // stmt_foreach + S_stmt_switch = 145, // stmt_switch + S_stmt_case = 146, // stmt_case + S_stmt_default = 147, // stmt_default + S_stmt_break = 148, // stmt_break + S_stmt_continue = 149, // stmt_continue + S_stmt_return = 150, // stmt_return + S_stmt_breakpoint = 151, // stmt_breakpoint + S_stmt_prof_begin = 152, // stmt_prof_begin + S_stmt_prof_end = 153, // stmt_prof_end + S_expr = 154, // expr + S_expr_or_empty = 155, // expr_or_empty + S_expr_assign = 156, // expr_assign + S_expr_increment = 157, // expr_increment + S_expr_decrement = 158, // expr_decrement + S_expr_ternary = 159, // expr_ternary + S_expr_binary = 160, // expr_binary + S_expr_primitive = 161, // expr_primitive + S_expr_complement = 162, // expr_complement + S_expr_negate = 163, // expr_negate + S_expr_not = 164, // expr_not + S_expr_call = 165, // expr_call + S_expr_method = 166, // expr_method + S_expr_function = 167, // expr_function + S_expr_pointer = 168, // expr_pointer + S_expr_add_array = 169, // expr_add_array + S_expr_parameters = 170, // expr_parameters + S_expr_arguments = 171, // expr_arguments + S_expr_arguments_no_empty = 172, // expr_arguments_no_empty + S_expr_isdefined = 173, // expr_isdefined + S_expr_istrue = 174, // expr_istrue + S_expr_reference = 175, // expr_reference + S_expr_tuple = 176, // expr_tuple + S_expr_tuple_arguments = 177, // expr_tuple_arguments + S_expr_tuple_types = 178, // expr_tuple_types + S_expr_array = 179, // expr_array + S_expr_field = 180, // expr_field + S_expr_size = 181, // expr_size + S_expr_paren = 182, // expr_paren + S_expr_object = 183, // expr_object + S_expr_thisthread = 184, // expr_thisthread + S_expr_empty_array = 185, // expr_empty_array + S_expr_undefined = 186, // expr_undefined + S_expr_game = 187, // expr_game + S_expr_self = 188, // expr_self + S_expr_anim = 189, // expr_anim + S_expr_level = 190, // expr_level + S_expr_animation = 191, // expr_animation + S_expr_animtree = 192, // expr_animtree + S_expr_identifier_nosize = 193, // expr_identifier_nosize + S_expr_identifier = 194, // expr_identifier + S_expr_path = 195, // expr_path + S_expr_istring = 196, // expr_istring + S_expr_string = 197, // expr_string + S_expr_vector = 198, // expr_vector + S_expr_float = 199, // expr_float + S_expr_integer = 200, // expr_integer + S_expr_false = 201, // expr_false + S_expr_true = 202 // expr_true }; }; @@ -1079,23 +1075,19 @@ namespace xsk { namespace gsc { namespace s4 { { case symbol_kind::S_expr_function: // expr_function case symbol_kind::S_expr_pointer: // expr_pointer - value.move< ast::call > (std::move (that.value)); + value.move< call > (std::move (that.value)); break; case symbol_kind::S_declaration: // declaration - value.move< ast::decl > (std::move (that.value)); + value.move< 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)); + case symbol_kind::S_decl_function: // decl_function + value.move< decl_function::ptr > (std::move (that.value)); break; case symbol_kind::S_decl_usingtree: // decl_usingtree - value.move< ast::decl_usingtree::ptr > (std::move (that.value)); + value.move< decl_usingtree::ptr > (std::move (that.value)); break; case symbol_kind::S_expr: // expr @@ -1109,268 +1101,153 @@ namespace xsk { namespace gsc { namespace s4 { case symbol_kind::S_expr_tuple: // expr_tuple case symbol_kind::S_expr_tuple_types: // expr_tuple_types case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); + value.move< expr > (std::move (that.value)); break; case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (std::move (that.value)); + value.move< expr_add_array::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (std::move (that.value)); + value.move< expr_anim::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (std::move (that.value)); + value.move< expr_animation::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); + value.move< expr_animtree::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_arguments: // expr_arguments case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); + value.move< expr_arguments::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (std::move (that.value)); + value.move< expr_array::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (std::move (that.value)); + value.move< expr_call::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (std::move (that.value)); + value.move< expr_complement::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (std::move (that.value)); + value.move< expr_empty_array::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (std::move (that.value)); + value.move< expr_false::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (std::move (that.value)); + value.move< expr_field::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (std::move (that.value)); + value.move< expr_float::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (std::move (that.value)); + value.move< expr_game::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (std::move (that.value)); + value.move< expr_identifier::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (std::move (that.value)); + value.move< expr_integer::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_isdefined: // expr_isdefined - value.move< ast::expr_isdefined::ptr > (std::move (that.value)); + value.move< expr_isdefined::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (std::move (that.value)); + value.move< expr_istring::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_istrue: // expr_istrue - value.move< ast::expr_istrue::ptr > (std::move (that.value)); + value.move< expr_istrue::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (std::move (that.value)); + value.move< expr_level::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (std::move (that.value)); + value.move< expr_method::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); + value.move< expr_negate::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); + value.move< expr_not::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (std::move (that.value)); + value.move< expr_parameters::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (std::move (that.value)); + value.move< expr_paren::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (std::move (that.value)); + value.move< expr_path::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (std::move (that.value)); + value.move< expr_reference::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (std::move (that.value)); + value.move< expr_self::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (std::move (that.value)); + value.move< expr_size::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (std::move (that.value)); + value.move< expr_string::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::ptr > (std::move (that.value)); + value.move< expr_thisthread::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_true: // expr_true - value.move< ast::expr_true::ptr > (std::move (that.value)); + value.move< expr_true::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::ptr > (std::move (that.value)); + value.move< expr_tuple::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_undefined: // expr_undefined - value.move< ast::expr_undefined::ptr > (std::move (that.value)); + value.move< expr_undefined::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_vector: // expr_vector - value.move< ast::expr_vector::ptr > (std::move (that.value)); + value.move< expr_vector::ptr > (std::move (that.value)); break; case symbol_kind::S_include: // include - value.move< ast::include::ptr > (std::move (that.value)); + value.move< include::ptr > (std::move (that.value)); break; case symbol_kind::S_program: // program - value.move< ast::program::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - value.move< ast::stmt > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - value.move< ast::stmt_assign::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_break: // stmt_break - value.move< ast::stmt_break::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (std::move (that.value)); + value.move< program::ptr > (std::move (that.value)); break; case symbol_kind::S_PATH: // "path" @@ -1382,6 +1259,121 @@ namespace xsk { namespace gsc { namespace s4 { value.move< std::string > (std::move (that.value)); break; + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.move< stmt > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_breakpoint: // stmt_breakpoint + value.move< stmt_breakpoint::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.move< stmt_dev::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.move< stmt_dowhile::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + value.move< stmt_expr::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + case symbol_kind::S_stmt_block: // stmt_block + value.move< stmt_list::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.move< stmt_prof_begin::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.move< stmt_prof_end::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while::ptr > (std::move (that.value)); + break; + default: break; } @@ -1406,13 +1398,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::call&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, call&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::call& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const call& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1420,13 +1412,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::decl&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, decl&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::decl& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const decl& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1434,13 +1426,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::decl_constant::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, decl_function::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::decl_constant::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const decl_function::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1448,13 +1440,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::decl_thread::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, decl_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_thread::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const decl_usingtree::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1462,13 +1454,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::decl_usingtree::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, 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::decl_usingtree::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1476,13 +1468,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_add_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& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_add_array::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1490,13 +1482,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_add_array::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_anim::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_add_array::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_anim::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1504,13 +1496,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_anim::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_anim::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_animation::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1518,13 +1510,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_animation::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_animtree::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_animation::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_animtree::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1532,13 +1524,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_animtree::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_animtree::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_arguments::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1546,13 +1538,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_arguments::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_arguments::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_array::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1560,13 +1552,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_array::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_array::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_call::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1574,13 +1566,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_call::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_call::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_complement::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1588,13 +1580,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_complement::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_complement::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_empty_array::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1602,13 +1594,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_empty_array::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_empty_array::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_false::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1616,13 +1608,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_false::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_false::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_field::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1630,13 +1622,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_field::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_field::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_float::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1644,13 +1636,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_float::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_float::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_game::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1658,13 +1650,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_game::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_game::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_identifier::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1672,13 +1664,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_identifier::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_identifier::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_integer::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1686,13 +1678,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_integer::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_integer::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_isdefined::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1700,13 +1692,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_isdefined::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_isdefined::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_istring::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1714,13 +1706,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_istring::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_istrue::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_istring::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_istrue::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1728,13 +1720,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_istrue::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_level::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_istrue::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_level::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1742,13 +1734,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_level::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_level::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_method::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1756,13 +1748,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_method::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_negate::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_method::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_negate::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1770,13 +1762,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_negate::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_negate::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_not::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1784,13 +1776,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_not::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_not::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_parameters::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1798,13 +1790,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_parameters::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_parameters::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_paren::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1812,13 +1804,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_paren::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_paren::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_path::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1826,13 +1818,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_path::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_path::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_reference::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1840,13 +1832,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_reference::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_reference::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_self::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1854,13 +1846,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_self::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_self::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_size::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1868,13 +1860,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_size::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_size::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_string::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1882,13 +1874,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_string::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_thisthread::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_string::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_thisthread::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1896,13 +1888,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_thisthread::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_true::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_thisthread::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_true::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1910,13 +1902,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_true::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_tuple::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_true::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_tuple::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1924,13 +1916,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_tuple::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_undefined::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_tuple::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_undefined::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1938,13 +1930,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_undefined::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_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_undefined::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_vector::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1952,13 +1944,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_vector::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, 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::expr_vector::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const include::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1966,419 +1958,13 @@ namespace xsk { namespace gsc { namespace s4 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::include::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, 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::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_waitframe::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_waitframe::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_waittill::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_waittill::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_waittillframeend::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_waittillframeend::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_waittillmatch::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_waittillmatch::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_while::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_while::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const program::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2399,6 +1985,398 @@ namespace xsk { namespace gsc { namespace s4 { {} #endif +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, 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 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, stmt_break::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_break::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_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 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, 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 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, stmt_case::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_case::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_continue::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_continue::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_default::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_default::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_dev::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_dev::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_dowhile::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_dowhile::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_endon::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_endon::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_expr::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_expr::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_for::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_for::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_foreach::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_foreach::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_if::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_if::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ifelse::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ifelse::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_list::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_list::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_notify::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_notify::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_prof_begin::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_prof_begin::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_prof_end::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_prof_end::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_return::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_return::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_switch::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_switch::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_wait::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_wait::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waitframe::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waitframe::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittill::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittill::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillframeend::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillframeend::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillmatch::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillmatch::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_while::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_while::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + /// Destroy the symbol. ~basic_symbol () { @@ -2425,23 +2403,19 @@ switch (yykind) { case symbol_kind::S_expr_function: // expr_function case symbol_kind::S_expr_pointer: // expr_pointer - value.template destroy< ast::call > (); + value.template destroy< call > (); break; case symbol_kind::S_declaration: // declaration - value.template destroy< ast::decl > (); + value.template destroy< 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 > (); + case symbol_kind::S_decl_function: // decl_function + value.template destroy< decl_function::ptr > (); break; case symbol_kind::S_decl_usingtree: // decl_usingtree - value.template destroy< ast::decl_usingtree::ptr > (); + value.template destroy< decl_usingtree::ptr > (); break; case symbol_kind::S_expr: // expr @@ -2455,268 +2429,153 @@ switch (yykind) case symbol_kind::S_expr_tuple: // expr_tuple case symbol_kind::S_expr_tuple_types: // expr_tuple_types case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); + value.template destroy< expr > (); break; case symbol_kind::S_expr_add_array: // expr_add_array - value.template destroy< ast::expr_add_array::ptr > (); + value.template destroy< expr_add_array::ptr > (); break; case symbol_kind::S_expr_anim: // expr_anim - value.template destroy< ast::expr_anim::ptr > (); + value.template destroy< expr_anim::ptr > (); break; case symbol_kind::S_expr_animation: // expr_animation - value.template destroy< ast::expr_animation::ptr > (); + value.template destroy< expr_animation::ptr > (); break; case symbol_kind::S_expr_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); + value.template destroy< expr_animtree::ptr > (); break; case symbol_kind::S_expr_arguments: // expr_arguments case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.template destroy< ast::expr_arguments::ptr > (); + value.template destroy< expr_arguments::ptr > (); break; case symbol_kind::S_expr_array: // expr_array - value.template destroy< ast::expr_array::ptr > (); + value.template destroy< expr_array::ptr > (); break; case symbol_kind::S_expr_call: // expr_call - value.template destroy< ast::expr_call::ptr > (); + value.template destroy< expr_call::ptr > (); break; case symbol_kind::S_expr_complement: // expr_complement - value.template destroy< ast::expr_complement::ptr > (); + value.template destroy< expr_complement::ptr > (); break; case symbol_kind::S_expr_empty_array: // expr_empty_array - value.template destroy< ast::expr_empty_array::ptr > (); + value.template destroy< expr_empty_array::ptr > (); break; case symbol_kind::S_expr_false: // expr_false - value.template destroy< ast::expr_false::ptr > (); + value.template destroy< expr_false::ptr > (); break; case symbol_kind::S_expr_field: // expr_field - value.template destroy< ast::expr_field::ptr > (); + value.template destroy< expr_field::ptr > (); break; case symbol_kind::S_expr_float: // expr_float - value.template destroy< ast::expr_float::ptr > (); + value.template destroy< expr_float::ptr > (); break; case symbol_kind::S_expr_game: // expr_game - value.template destroy< ast::expr_game::ptr > (); + value.template destroy< expr_game::ptr > (); break; case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize case symbol_kind::S_expr_identifier: // expr_identifier - value.template destroy< ast::expr_identifier::ptr > (); + value.template destroy< expr_identifier::ptr > (); break; case symbol_kind::S_expr_integer: // expr_integer - value.template destroy< ast::expr_integer::ptr > (); + value.template destroy< expr_integer::ptr > (); break; case symbol_kind::S_expr_isdefined: // expr_isdefined - value.template destroy< ast::expr_isdefined::ptr > (); + value.template destroy< expr_isdefined::ptr > (); break; case symbol_kind::S_expr_istring: // expr_istring - value.template destroy< ast::expr_istring::ptr > (); + value.template destroy< expr_istring::ptr > (); break; case symbol_kind::S_expr_istrue: // expr_istrue - value.template destroy< ast::expr_istrue::ptr > (); + value.template destroy< expr_istrue::ptr > (); break; case symbol_kind::S_expr_level: // expr_level - value.template destroy< ast::expr_level::ptr > (); + value.template destroy< expr_level::ptr > (); break; case symbol_kind::S_expr_method: // expr_method - value.template destroy< ast::expr_method::ptr > (); + value.template destroy< expr_method::ptr > (); break; case symbol_kind::S_expr_negate: // expr_negate - value.template destroy< ast::expr_negate::ptr > (); + value.template destroy< expr_negate::ptr > (); break; case symbol_kind::S_expr_not: // expr_not - value.template destroy< ast::expr_not::ptr > (); + value.template destroy< expr_not::ptr > (); break; case symbol_kind::S_expr_parameters: // expr_parameters - value.template destroy< ast::expr_parameters::ptr > (); + value.template destroy< expr_parameters::ptr > (); break; case symbol_kind::S_expr_paren: // expr_paren - value.template destroy< ast::expr_paren::ptr > (); + value.template destroy< expr_paren::ptr > (); break; case symbol_kind::S_expr_path: // expr_path - value.template destroy< ast::expr_path::ptr > (); + value.template destroy< expr_path::ptr > (); break; case symbol_kind::S_expr_reference: // expr_reference - value.template destroy< ast::expr_reference::ptr > (); + value.template destroy< expr_reference::ptr > (); break; case symbol_kind::S_expr_self: // expr_self - value.template destroy< ast::expr_self::ptr > (); + value.template destroy< expr_self::ptr > (); break; case symbol_kind::S_expr_size: // expr_size - value.template destroy< ast::expr_size::ptr > (); + value.template destroy< expr_size::ptr > (); break; case symbol_kind::S_expr_string: // expr_string - value.template destroy< ast::expr_string::ptr > (); + value.template destroy< expr_string::ptr > (); break; case symbol_kind::S_expr_thisthread: // expr_thisthread - value.template destroy< ast::expr_thisthread::ptr > (); + value.template destroy< expr_thisthread::ptr > (); break; case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); + value.template destroy< expr_true::ptr > (); break; case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.template destroy< ast::expr_tuple::ptr > (); + value.template destroy< expr_tuple::ptr > (); break; case symbol_kind::S_expr_undefined: // expr_undefined - value.template destroy< ast::expr_undefined::ptr > (); + value.template destroy< expr_undefined::ptr > (); break; case symbol_kind::S_expr_vector: // expr_vector - value.template destroy< ast::expr_vector::ptr > (); + value.template destroy< expr_vector::ptr > (); break; case symbol_kind::S_include: // include - value.template destroy< ast::include::ptr > (); + value.template destroy< include::ptr > (); break; case symbol_kind::S_program: // program - value.template destroy< ast::program::ptr > (); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - value.template destroy< ast::stmt > (); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - value.template destroy< ast::stmt_assign::ptr > (); - break; - - case symbol_kind::S_stmt_break: // stmt_break - value.template destroy< ast::stmt_break::ptr > (); - break; - - case symbol_kind::S_stmt_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_waitframe: // stmt_waitframe - value.template destroy< ast::stmt_waitframe::ptr > (); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.template destroy< ast::stmt_waittill::ptr > (); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.template destroy< ast::stmt_waittillframeend::ptr > (); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.template destroy< ast::stmt_waittillmatch::ptr > (); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.template destroy< ast::stmt_while::ptr > (); + value.template destroy< program::ptr > (); break; case symbol_kind::S_PATH: // "path" @@ -2728,6 +2587,121 @@ switch (yykind) value.template destroy< std::string > (); break; + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.template destroy< stmt > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.template destroy< stmt_assign::ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.template destroy< stmt_break::ptr > (); + break; + + case symbol_kind::S_stmt_breakpoint: // stmt_breakpoint + value.template destroy< stmt_breakpoint::ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.template destroy< stmt_call::ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.template destroy< stmt_case::ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.template destroy< stmt_continue::ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.template destroy< stmt_default::ptr > (); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.template destroy< stmt_dev::ptr > (); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.template destroy< stmt_dowhile::ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.template destroy< stmt_endon::ptr > (); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + value.template destroy< stmt_expr::ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.template destroy< stmt_for::ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.template destroy< stmt_foreach::ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.template destroy< stmt_if::ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.template destroy< stmt_ifelse::ptr > (); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + case symbol_kind::S_stmt_block: // stmt_block + value.template destroy< stmt_list::ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.template destroy< stmt_notify::ptr > (); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.template destroy< stmt_prof_begin::ptr > (); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.template destroy< stmt_prof_end::ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.template destroy< stmt_return::ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.template destroy< stmt_switch::ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.template destroy< stmt_wait::ptr > (); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.template destroy< stmt_waitframe::ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.template destroy< stmt_waittill::ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.template destroy< stmt_waittillframeend::ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.template destroy< stmt_waittillmatch::ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.template destroy< stmt_while::ptr > (); + break; + default: break; } @@ -2825,8 +2799,8 @@ switch (yykind) #endif { #if !defined _MSC_VER || defined __clang__ - S4_ASSERT (tok == token::S4EOF - || (token::S4error <= tok && tok <= token::MOD) + GSC_ASSERT (tok == token::GSCEOF + || (token::GSCerror <= tok && tok <= token::MOD) || (token::SIZEOF <= tok && tok <= token::POSTDEC)); #endif } @@ -2839,13 +2813,13 @@ switch (yykind) #endif { #if !defined _MSC_VER || defined __clang__ - S4_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); + GSC_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); #endif } }; /// Build a parser object. - parser (xsk::gsc::s4::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg); + parser (xsk::gsc::context const* ctx__yyarg, xsk::gsc::lexer& lexer_yyarg, xsk::gsc::program::ptr& ast_yyarg, std::uint32_t index_yyarg); virtual ~parser (); #if 201103L <= YY_CPLUSPLUS @@ -2863,7 +2837,7 @@ switch (yykind) /// \returns 0 iff parsing succeeded. virtual int parse (); -#if S4DEBUG +#if GSCDEBUG /// The current debugging stream. std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; /// Set the current debugging stream. @@ -2893,46 +2867,46 @@ switch (yykind) #if 201103L <= YY_CPLUSPLUS static symbol_type - make_S4EOF (location_type l) + make_GSCEOF (location_type l) { - return symbol_type (token::S4EOF, std::move (l)); + return symbol_type (token::GSCEOF, std::move (l)); } #else static symbol_type - make_S4EOF (const location_type& l) + make_GSCEOF (const location_type& l) { - return symbol_type (token::S4EOF, l); + return symbol_type (token::GSCEOF, l); } #endif #if 201103L <= YY_CPLUSPLUS static symbol_type - make_S4error (location_type l) + make_GSCerror (location_type l) { - return symbol_type (token::S4error, std::move (l)); + return symbol_type (token::GSCerror, std::move (l)); } #else static symbol_type - make_S4error (const location_type& l) + make_GSCerror (const location_type& l) { - return symbol_type (token::S4error, l); + return symbol_type (token::GSCerror, l); } #endif #if 201103L <= YY_CPLUSPLUS static symbol_type - make_S4UNDEF (location_type l) + make_GSCUNDEF (location_type l) { - return symbol_type (token::S4UNDEF, std::move (l)); + return symbol_type (token::GSCUNDEF, std::move (l)); } #else static symbol_type - make_S4UNDEF (const location_type& l) + make_GSCUNDEF (const location_type& l) { - return symbol_type (token::S4UNDEF, l); + return symbol_type (token::GSCUNDEF, l); } #endif #if 201103L <= YY_CPLUSPLUS @@ -4721,7 +4695,7 @@ switch (yykind) static const signed char yyr2_[]; -#if S4DEBUG +#if GSCDEBUG // 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. @@ -4959,15 +4933,17 @@ switch (yykind) /// Constants. enum { - yylast_ = 2542, ///< Last index in yytable_. - yynnts_ = 89, ///< Number of nonterminal symbols. - yyfinal_ = 22 ///< Termination state number. + yylast_ = 2411, ///< Last index in yytable_. + yynnts_ = 88, ///< Number of nonterminal symbols. + yyfinal_ = 21 ///< Termination state number. }; // User arguments. - xsk::gsc::s4::lexer& lexer; - xsk::gsc::ast::program::ptr& ast; + xsk::gsc::context const* ctx_; + xsk::gsc::lexer& lexer; + xsk::gsc::program::ptr& ast; + std::uint32_t index; }; @@ -4989,23 +4965,19 @@ switch (yykind) { case symbol_kind::S_expr_function: // expr_function case symbol_kind::S_expr_pointer: // expr_pointer - value.copy< ast::call > (YY_MOVE (that.value)); + value.copy< call > (YY_MOVE (that.value)); break; case symbol_kind::S_declaration: // declaration - value.copy< ast::decl > (YY_MOVE (that.value)); + value.copy< 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)); + case symbol_kind::S_decl_function: // decl_function + value.copy< decl_function::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_decl_usingtree: // decl_usingtree - value.copy< ast::decl_usingtree::ptr > (YY_MOVE (that.value)); + value.copy< decl_usingtree::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr: // expr @@ -5019,268 +4991,153 @@ switch (yykind) case symbol_kind::S_expr_tuple: // expr_tuple case symbol_kind::S_expr_tuple_types: // expr_tuple_types case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); + value.copy< expr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (YY_MOVE (that.value)); + value.copy< expr_add_array::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (YY_MOVE (that.value)); + value.copy< expr_anim::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (YY_MOVE (that.value)); + value.copy< expr_animation::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); + value.copy< expr_animtree::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_arguments: // expr_arguments case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (YY_MOVE (that.value)); + value.copy< expr_arguments::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (YY_MOVE (that.value)); + value.copy< expr_array::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (YY_MOVE (that.value)); + value.copy< expr_call::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (YY_MOVE (that.value)); + value.copy< expr_complement::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); + value.copy< expr_empty_array::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (YY_MOVE (that.value)); + value.copy< expr_false::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (YY_MOVE (that.value)); + value.copy< expr_field::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (YY_MOVE (that.value)); + value.copy< expr_float::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (YY_MOVE (that.value)); + value.copy< expr_game::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (YY_MOVE (that.value)); + value.copy< expr_identifier::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (YY_MOVE (that.value)); + value.copy< expr_integer::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_isdefined: // expr_isdefined - value.copy< ast::expr_isdefined::ptr > (YY_MOVE (that.value)); + value.copy< expr_isdefined::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (YY_MOVE (that.value)); + value.copy< expr_istring::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_istrue: // expr_istrue - value.copy< ast::expr_istrue::ptr > (YY_MOVE (that.value)); + value.copy< expr_istrue::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (YY_MOVE (that.value)); + value.copy< expr_level::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (YY_MOVE (that.value)); + value.copy< expr_method::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); + value.copy< expr_negate::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); + value.copy< expr_not::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (YY_MOVE (that.value)); + value.copy< expr_parameters::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (YY_MOVE (that.value)); + value.copy< expr_paren::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (YY_MOVE (that.value)); + value.copy< expr_path::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (YY_MOVE (that.value)); + value.copy< expr_reference::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (YY_MOVE (that.value)); + value.copy< expr_self::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (YY_MOVE (that.value)); + value.copy< expr_size::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (YY_MOVE (that.value)); + value.copy< expr_string::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::ptr > (YY_MOVE (that.value)); + value.copy< expr_thisthread::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_true: // expr_true - value.copy< ast::expr_true::ptr > (YY_MOVE (that.value)); + value.copy< expr_true::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::ptr > (YY_MOVE (that.value)); + value.copy< expr_tuple::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_undefined: // expr_undefined - value.copy< ast::expr_undefined::ptr > (YY_MOVE (that.value)); + value.copy< expr_undefined::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_vector: // expr_vector - value.copy< ast::expr_vector::ptr > (YY_MOVE (that.value)); + value.copy< expr_vector::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_include: // include - value.copy< ast::include::ptr > (YY_MOVE (that.value)); + value.copy< include::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_program: // program - value.copy< ast::program::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - value.copy< ast::stmt > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - value.copy< ast::stmt_assign::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_break: // stmt_break - value.copy< ast::stmt_break::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.copy< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.copy< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.copy< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.copy< ast::stmt_while::ptr > (YY_MOVE (that.value)); + value.copy< program::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_PATH: // "path" @@ -5292,6 +5149,121 @@ switch (yykind) value.copy< std::string > (YY_MOVE (that.value)); break; + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.copy< stmt > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_breakpoint: // stmt_breakpoint + value.copy< stmt_breakpoint::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.copy< stmt_dev::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.copy< stmt_dowhile::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + value.copy< stmt_expr::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + case symbol_kind::S_stmt_block: // stmt_block + value.copy< stmt_list::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.copy< stmt_prof_begin::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.copy< stmt_prof_end::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.copy< stmt_waitframe::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while::ptr > (YY_MOVE (that.value)); + break; + default: break; } @@ -5325,23 +5297,19 @@ switch (yykind) { case symbol_kind::S_expr_function: // expr_function case symbol_kind::S_expr_pointer: // expr_pointer - value.move< ast::call > (YY_MOVE (s.value)); + value.move< call > (YY_MOVE (s.value)); break; case symbol_kind::S_declaration: // declaration - value.move< ast::decl > (YY_MOVE (s.value)); + value.move< 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)); + case symbol_kind::S_decl_function: // decl_function + value.move< decl_function::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_decl_usingtree: // decl_usingtree - value.move< ast::decl_usingtree::ptr > (YY_MOVE (s.value)); + value.move< decl_usingtree::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr: // expr @@ -5355,268 +5323,153 @@ switch (yykind) case symbol_kind::S_expr_tuple: // expr_tuple case symbol_kind::S_expr_tuple_types: // expr_tuple_types case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); + value.move< expr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (s.value)); + value.move< expr_add_array::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (s.value)); + value.move< expr_anim::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (s.value)); + value.move< expr_animation::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); + value.move< expr_animtree::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_arguments: // expr_arguments case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); + value.move< expr_arguments::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (s.value)); + value.move< expr_array::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (s.value)); + value.move< expr_call::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (s.value)); + value.move< expr_complement::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (s.value)); + value.move< expr_empty_array::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (s.value)); + value.move< expr_false::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (s.value)); + value.move< expr_field::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (s.value)); + value.move< expr_float::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (s.value)); + value.move< expr_game::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (s.value)); + value.move< expr_identifier::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (s.value)); + value.move< expr_integer::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_isdefined: // expr_isdefined - value.move< ast::expr_isdefined::ptr > (YY_MOVE (s.value)); + value.move< expr_isdefined::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (s.value)); + value.move< expr_istring::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_istrue: // expr_istrue - value.move< ast::expr_istrue::ptr > (YY_MOVE (s.value)); + value.move< expr_istrue::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (s.value)); + value.move< expr_level::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (s.value)); + value.move< expr_method::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); + value.move< expr_negate::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); + value.move< expr_not::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (s.value)); + value.move< expr_parameters::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (s.value)); + value.move< expr_paren::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (s.value)); + value.move< expr_path::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (s.value)); + value.move< expr_reference::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (s.value)); + value.move< expr_self::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (s.value)); + value.move< expr_size::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (s.value)); + value.move< expr_string::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::ptr > (YY_MOVE (s.value)); + value.move< expr_thisthread::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_true: // expr_true - value.move< ast::expr_true::ptr > (YY_MOVE (s.value)); + value.move< expr_true::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::ptr > (YY_MOVE (s.value)); + value.move< expr_tuple::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_undefined: // expr_undefined - value.move< ast::expr_undefined::ptr > (YY_MOVE (s.value)); + value.move< expr_undefined::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_vector: // expr_vector - value.move< ast::expr_vector::ptr > (YY_MOVE (s.value)); + value.move< expr_vector::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_include: // include - value.move< ast::include::ptr > (YY_MOVE (s.value)); + value.move< include::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_program: // program - value.move< ast::program::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - value.move< ast::stmt > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - value.move< ast::stmt_assign::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_break: // stmt_break - value.move< ast::stmt_break::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (YY_MOVE (s.value)); + value.move< program::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_PATH: // "path" @@ -5628,6 +5481,121 @@ switch (yykind) value.move< std::string > (YY_MOVE (s.value)); break; + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.move< stmt > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_breakpoint: // stmt_breakpoint + value.move< stmt_breakpoint::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.move< stmt_dev::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.move< stmt_dowhile::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + value.move< stmt_expr::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + case symbol_kind::S_stmt_block: // stmt_block + value.move< stmt_list::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.move< stmt_prof_begin::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.move< stmt_prof_end::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while::ptr > (YY_MOVE (s.value)); + break; + default: break; } @@ -5694,10 +5662,10 @@ switch (yykind) #line 13 "parser.ypp" -} } } // xsk::gsc::s4 -#line 5699 "parser.hpp" +} } // xsk::gsc +#line 5667 "parser.hpp" -#endif // !YY_S4_PARSER_HPP_INCLUDED +#endif // !YY_GSC_PARSER_HPP_INCLUDED diff --git a/src/gsc/source.cpp b/src/gsc/source.cpp new file mode 100644 index 00000000..ca46f3ac --- /dev/null +++ b/src/gsc/source.cpp @@ -0,0 +1,1699 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "source.hpp" +#include "context.hpp" +#include "lexer.hpp" +#include "utils/string.hpp" + +namespace xsk::gsc +{ + +source::source(context const* ctx) : ctx_{ ctx } +{ +} + +auto source::parse_assembly(buffer const& data) -> assembly::ptr +{ + return parse_assembly(data.data, data.size); +} + +auto source::parse_assembly(std::vector const& data) -> assembly::ptr +{ + return parse_assembly(data.data(), data.size()); +} + +auto source::parse_assembly(u8 const* data, usize size) -> assembly::ptr +{ + auto buffer = std::vector{}; + buffer.resize(size); + std::memcpy(buffer.data(), data, buffer.size()); + + auto lines = utils::string::clean_buffer_lines(buffer); + auto assembly = make_assembly(); + auto func = function::ptr{ nullptr }; + u32 index = 1; + u16 switchnum = 0; + + for (auto& line : lines) + { + if (line == "" || line.substr(0, 2) == "//") + { + continue; + } + else if (line.substr(0, 4) == "sub:") + { + func = make_function(); + func->index = index; + func->name = line.substr(4); + func->id = ctx_->token_id(func->name); + + } + else if (line.substr(0, 4) == "end:") + { + if (func != nullptr) + { + func->size = index - func->index; + assembly->functions.push_back(std::move(func)); + } + } + else if (line.substr(0, 4) == "loc_") + { + func->labels[index] = line; + } + else + { + auto opdata = utils::string::parse_code(line); + + if (switchnum) + { + if (opdata[0] == "case" || opdata[0] == "default") + { + for (auto& entry : opdata) + { + func->instructions.back()->data.push_back(entry); + } + switchnum--; + continue; + } + + throw asm_error("invalid instruction inside endswitch \""s + line + "\""); + } + else + { + auto inst = make_instruction(); + inst->index = index; + inst->opcode = opcode_enum(opdata[0]); + inst->size = ctx_->opcode_size(inst->opcode); + opdata.erase(opdata.begin()); + inst->data = std::move(opdata); + + switch (inst->opcode) + { + case opcode::OP_GetVector: + { + if (ctx_->endian() == endian::big) + { + auto base = inst->index + 1; + auto algn = (base + 3) & ~3; + inst->size += (algn - base); + } + break; + } + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + inst->data[0] = inst->data[0].substr(4); + break; + case opcode::OP_endswitch: + switchnum = static_cast(std::stoi(inst->data[0])); + inst->size += 7 * switchnum; + break; + default: + break; + } + + index += inst->size; + func->instructions.push_back(std::move(inst)); + } + } + } + + return assembly; +} + +auto source::parse_program(std::string const& name, buffer const& data) -> program::ptr +{ + return parse_program(name, data.data, data.size); +} + +auto source::parse_program(std::string const& name, std::vector const& data) -> program::ptr +{ + return parse_program(name, data.data(), data.size()); +} + +auto source::parse_program(std::string const& name, u8 const* data, usize size) -> program::ptr +{ + auto res = program::ptr{ nullptr }; + auto lxr = lexer{ ctx_, name, reinterpret_cast(data), size }; + auto psr = parser{ ctx_, lxr, res, 0 }; + + if (!psr.parse() && res != nullptr) + return res; + + throw error{ fmt::format("an unknown error ocurred while parsing script {}", name) }; +} + +auto source::dump(assembly const& data) -> std::vector +{ + buf_ = std::vector{}; + buf_.reserve(0x10000); + + fmt::format_to(std::back_inserter(buf_), "// {} GSC ASSEMBLY\n", engine_name(ctx_->engine())); + fmt::format_to(std::back_inserter(buf_), "// Dumped by https://github.com/xensik/gsc-tool\n"); + + dump_assembly(data); + + return buf_; +} + +auto source::dump(program const& data) -> std::vector +{ + buf_ = std::vector{}; + buf_.reserve(0x10000); + + fmt::format_to(std::back_inserter(buf_), "// {} GSC SOURCE\n", engine_name(ctx_->engine())); + fmt::format_to(std::back_inserter(buf_), "// Dumped by https://github.com/xensik/gsc-tool\n"); + + dump_program(data); + + return buf_; +} + +auto source::dump_assembly(assembly const& data) -> void +{ + for (auto const& func : data.functions) + { + dump_function(*func); + } +} + +auto source::dump_function(function const& func) -> void +{ + fmt::format_to(std::back_inserter(buf_), "\nsub:{}\n", func.name); + + for (auto const& inst : func.instructions) + { + auto const itr = func.labels.find(inst->index); + + if (itr != func.labels.end()) + { + fmt::format_to(std::back_inserter(buf_), "\t{}\n", itr->second); + } + + dump_instruction(*inst); + } + + fmt::format_to(std::back_inserter(buf_), "end:{}\n", func.name); +} + +auto source::dump_instruction(instruction const& inst) -> void +{ + fmt::format_to(std::back_inserter(buf_), "\t\t{}", opcode_name(inst.opcode)); + + switch (inst.opcode) + { + case opcode::OP_GetString: + case opcode::OP_GetIString: + case opcode::OP_GetAnimTree: + fmt::format_to(std::back_inserter(buf_), " \"{}\"", inst.data[0]); + break; + case opcode::OP_GetAnimation: + fmt::format_to(std::back_inserter(buf_), " \"{}\" \"{}\"", inst.data[0], inst.data[1]); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalMethodCall: + fmt::format_to(std::back_inserter(buf_), " {}", inst.data[0]); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + fmt::format_to(std::back_inserter(buf_), " {} {}\n", inst.data[0], inst.data[1]); + break; + case opcode::OP_endswitch: + { + auto count = static_cast(std::stoul(inst.data[0])); + auto type = static_cast(std::stoul(inst.data.back())); + auto index = 1; + + fmt::format_to(std::back_inserter(buf_), " {}\n", count); + + for (auto i = 0u; i < count; i++) + { + if (inst.data[index] == "case") + { + if (ctx_->engine() == engine::iw9) + { + type = static_cast(std::stoul(inst.data[index + 1])); + auto data = (type == switch_type::integer) ? fmt::format("{}", inst.data[index + 2]) : fmt::format("\"{}\"", inst.data[index + 2]); + fmt::format_to(std::back_inserter(buf_), "\t\t\t{} {} {}", inst.data[index], data, inst.data[index + 3]); + index += 4; + } + else + { + auto data = (type == switch_type::integer) ? fmt::format("{}", inst.data[index + 1]) : fmt::format("\"{}\"", inst.data[index + 1]); + fmt::format_to(std::back_inserter(buf_), "\t\t\t{} {} {}", inst.data[index], data, inst.data[index + 2]); + index += 3; + } + } + else if (inst.data[index] == "default") + { + fmt::format_to(std::back_inserter(buf_), "\t\t\t{} {}", inst.data[index], inst.data[index + 1]); + index += 2; + } + if (i != count - 1) + { + fmt::format_to(std::back_inserter(buf_), "\n"); + } + } + break; + } + default: + for (auto const& entry : inst.data) + { + fmt::format_to(std::back_inserter(buf_), " {}", entry); + } + break; + } + + fmt::format_to(std::back_inserter(buf_), "\n"); +} + +auto source::dump_program(program const& data) -> void +{ + for (auto const& inc : data.includes) + { + dump_include(*inc); + } + + for (auto const& dec : data.declarations) + { + fmt::format_to(std::back_inserter(buf_), "\n"); + dump_decl(dec); + } +} + +auto source::dump_include(include const& inc) -> void +{ + fmt::format_to(std::back_inserter(buf_), "#include "); + dump_expr_path(*inc.path); + fmt::format_to(std::back_inserter(buf_), ";\n"); +} + +auto source::dump_decl(decl const& dec) -> void +{ + switch (dec.kind()) + { + case node::decl_dev_begin: + dump_decl_dev_begin(*dec.as_dev_begin); + break; + case node::decl_dev_end: + dump_decl_dev_end(*dec.as_dev_end); + break; + case node::decl_usingtree: + dump_decl_usingtree(*dec.as_usingtree); + break; + case node::decl_function: + dump_decl_function(*dec.as_function); + break; + default: + break; + } +} + +auto source::dump_decl_dev_begin(decl_dev_begin const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "/#"); +} + +auto source::dump_decl_dev_end(decl_dev_end const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "#/"); +} + +auto source::dump_decl_usingtree(decl_usingtree const& dec) -> void +{ + fmt::format_to(std::back_inserter(buf_), "#using_animtree("); + dump_expr_string(*dec.name); + fmt::format_to(std::back_inserter(buf_), ");\n"); +} + +auto source::dump_decl_function(decl_function const& dec) -> void +{ + dump_expr_identifier(*dec.name); + fmt::format_to(std::back_inserter(buf_), "("); + dump_expr_parameters(*dec.params); + fmt::format_to(std::back_inserter(buf_), ")\n"); + dump_stmt_list(*dec.body); + fmt::format_to(std::back_inserter(buf_), "\n"); +} + +auto source::dump_stmt(stmt const& stm) -> void +{ + switch (stm.kind()) + { + case node::stmt_list: + dump_stmt_list(*stm.as_list); + break; + case node::stmt_dev: + dump_stmt_dev(*stm.as_dev); + break; + case node::stmt_expr: + dump_stmt_expr(*stm.as_expr); + break; + case node::stmt_call: + dump_stmt_call(*stm.as_call); + break; + case node::stmt_assign: + dump_stmt_assign(*stm.as_assign); + break; + case node::stmt_endon: + dump_stmt_endon(*stm.as_endon); + break; + case node::stmt_notify: + dump_stmt_notify(*stm.as_notify); + break; + case node::stmt_wait: + dump_stmt_wait(*stm.as_wait); + break; + case node::stmt_waittill: + dump_stmt_waittill(*stm.as_waittill); + break; + case node::stmt_waittillmatch: + dump_stmt_waittillmatch(*stm.as_waittillmatch); + break; + case node::stmt_waittillframeend: + dump_stmt_waittillframeend(*stm.as_waittillframeend); + break; + case node::stmt_waitframe: + dump_stmt_waitframe(*stm.as_waitframe); + break; + case node::stmt_if: + dump_stmt_if(*stm.as_if); + break; + case node::stmt_ifelse: + dump_stmt_ifelse(*stm.as_ifelse); + break; + case node::stmt_while: + dump_stmt_while(*stm.as_while); + break; + case node::stmt_dowhile: + dump_stmt_dowhile(*stm.as_dowhile); + break; + case node::stmt_for: + dump_stmt_for(*stm.as_for); + break; + case node::stmt_foreach: + dump_stmt_foreach(*stm.as_foreach); + break; + case node::stmt_switch: + dump_stmt_switch(*stm.as_switch); + break; + case node::stmt_case: + dump_stmt_case(*stm.as_case); + break; + case node::stmt_default: + dump_stmt_default(*stm.as_default); + break; + case node::stmt_break: + dump_stmt_break(*stm.as_break); + break; + case node::stmt_continue: + dump_stmt_continue(*stm.as_continue); + break; + case node::stmt_return: + dump_stmt_return(*stm.as_return); + break; + case node::stmt_breakpoint: + dump_stmt_breakpoint(*stm.as_breakpoint); + break; + case node::stmt_prof_begin: + dump_stmt_prof_begin(*stm.as_prof_begin); + break; + case node::stmt_prof_end: + dump_stmt_prof_end(*stm.as_prof_end); + break; + case node::asm_jmp: + dump_asm_jmp(*stm.as_jump); + break; + case node::asm_jmp_back: + dump_asm_jmp_back(*stm.as_jump_back); + break; + case node::asm_jmp_cond: + dump_asm_jmp_cond(*stm.as_cond); + break; + case node::asm_switch: + dump_asm_switch(*stm.as_asm_switch); + break; + case node::asm_endswitch: + dump_asm_endswitch(*stm.as_asm_endswitch); + break; + case node::asm_create: + dump_asm_create(*stm.as_asm_create); + break; + case node::asm_access: + dump_asm_access(*stm.as_asm_access); + break; + case node::asm_remove: + dump_asm_remove(*stm.as_asm_remove); + break; + case node::asm_clear: + dump_asm_clear(*stm.as_asm_clear); + break; + default: + break; + } +} + +auto source::dump_stmt_list(stmt_list const& stm) -> void +{ + if (stm.is_expr) + { + if (stm.list.size() > 0) + { + dump_stmt(stm.list[0]); + buf_.pop_back(); + } + + return; + } + + bool last_special = false; + + if (!stm.is_case) + fmt::format_to(std::back_inserter(buf_), "{: >{}}\n", "{", indent_ + 1); + + indent_ += 4; + + for (auto const& entry : stm.list) + { + if ((&entry != &stm.list.front() && entry.as_node->is_special_stmt()) || last_special) + fmt::format_to(std::back_inserter(buf_), "\n"); + + if (entry == node::stmt_dev) + { + dump_stmt(entry); + } + else + { + fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); + dump_stmt(entry); + } + + if (&entry != &stm.list.back()) + fmt::format_to(std::back_inserter(buf_), "\n"); + + if (entry.as_node->is_special_stmt()) + last_special = true; + else + last_special = false; + } + + indent_ -= 4; + + if (!stm.is_case) + fmt::format_to(std::back_inserter(buf_), "\n{: >{}}", "}", indent_ + 1); +} + +auto source::dump_stmt_dev(stmt_dev const& stm) -> void +{ + bool last_special = false; + + fmt::format_to(std::back_inserter(buf_), "/#\n"); + + for (auto const& entry : stm.body->list) + { + if ((&entry != &stm.body->list.front() && entry.as_node->is_special_stmt()) || last_special) + fmt::format_to(std::back_inserter(buf_), "\n"); + + if (entry == node::stmt_dev) + dump_stmt(entry); + else + { + fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); + dump_stmt(entry); + } + + if (&entry != &stm.body->list.back()) + fmt::format_to(std::back_inserter(buf_), "\n"); + + if (entry.as_node->is_special_stmt()) + last_special = true; + else + last_special = false; + } + + fmt::format_to(std::back_inserter(buf_), "\n#/"); +} + +auto source::dump_stmt_expr(stmt_expr const& stm) -> void +{ + dump_expr(stm.value); +} + +auto source::dump_stmt_call(stmt_call const& stm) -> void +{ + dump_expr(stm.value); + fmt::format_to(std::back_inserter(buf_), ";"); +} + +auto source::dump_stmt_assign(stmt_assign const& stm) -> void +{ + dump_expr(stm.value); + fmt::format_to(std::back_inserter(buf_), ";"); +} + +auto source::dump_stmt_endon(stmt_endon const& stm) -> void +{ + dump_expr(stm.obj); + fmt::format_to(std::back_inserter(buf_), " endon( "); + dump_expr(stm.event); + fmt::format_to(std::back_inserter(buf_), " );"); +} + +auto source::dump_stmt_notify(stmt_notify const& stm) -> void +{ + dump_expr(stm.obj); + fmt::format_to(std::back_inserter(buf_), " notify( "); + dump_expr(stm.event); + + if (stm.args->list.size() > 0) + { + fmt::format_to(std::back_inserter(buf_), ","); + dump_expr_arguments(*stm.args); + } + else + { + fmt::format_to(std::back_inserter(buf_), " "); + } + + fmt::format_to(std::back_inserter(buf_), ");"); +} + +auto source::dump_stmt_wait(stmt_wait const& stm) -> void +{ + if (stm.time == node::expr_float || stm.time == node::expr_integer) + { + fmt::format_to(std::back_inserter(buf_), "wait "); + dump_expr(stm.time); + fmt::format_to(std::back_inserter(buf_), ";"); + } + else + { + fmt::format_to(std::back_inserter(buf_), "wait("); + dump_expr(stm.time); + fmt::format_to(std::back_inserter(buf_), ");"); + } +} + +auto source::dump_stmt_waittill(stmt_waittill const& stm) -> void +{ + dump_expr(stm.obj); + fmt::format_to(std::back_inserter(buf_), " waittill( "); + dump_expr(stm.event); + + if (stm.args->list.size() > 0) + { + fmt::format_to(std::back_inserter(buf_), ","); + dump_expr_arguments(*stm.args); + } + else + { + fmt::format_to(std::back_inserter(buf_), " "); + } + + fmt::format_to(std::back_inserter(buf_), ");"); +} + +auto source::dump_stmt_waittillmatch(stmt_waittillmatch const& stm) -> void +{ + dump_expr(stm.obj); + fmt::format_to(std::back_inserter(buf_), " waittillmatch( "); + dump_expr(stm.event); + + if (stm.args->list.size() > 0) + { + fmt::format_to(std::back_inserter(buf_), ","); + dump_expr_arguments(*stm.args); + } + else + { + fmt::format_to(std::back_inserter(buf_), " "); + } + + fmt::format_to(std::back_inserter(buf_), ");"); +} + +auto source::dump_stmt_waittillframeend(stmt_waittillframeend const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "waittillframeend;"); +} + +auto source::dump_stmt_waitframe(stmt_waitframe const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "waitframe();"); +} + +auto source::dump_stmt_if(stmt_if const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "if ( "); + dump_expr(stm.test); + fmt::format_to(std::back_inserter(buf_), " )\n"); + + if (stm.body == node::stmt_list) + { + dump_stmt(stm.body); + } + else + { + indent_ += 4; + fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); + dump_stmt(stm.body); + indent_ -= 4; + } +} + +auto source::dump_stmt_ifelse(stmt_ifelse const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "if ( "); + dump_expr(stm.test); + fmt::format_to(std::back_inserter(buf_), " )\n"); + + if (stm.stmt_if == node::stmt_list) + { + dump_stmt(stm.stmt_if); + } + else + { + indent_ += 4; + fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); + dump_stmt(stm.stmt_if); + indent_ -= 4; + } + + fmt::format_to(std::back_inserter(buf_), "\n{: >{}}else", "", indent_); + + if (stm.stmt_else == node::stmt_list) + { + fmt::format_to(std::back_inserter(buf_), "\n"); + dump_stmt(stm.stmt_else); + } + else + { + if (stm.stmt_else == node::stmt_if || stm.stmt_else == node::stmt_ifelse) + { + fmt::format_to(std::back_inserter(buf_), " "); + dump_stmt(stm.stmt_else); + } + else + { + indent_ += 4; + fmt::format_to(std::back_inserter(buf_), "\n{: >{}}", "", indent_); + dump_stmt(stm.stmt_else); + indent_ -= 4; + } + } +} + +auto source::dump_stmt_while(stmt_while const& stm) -> void +{ + if (stm.test == node::null) + { + fmt::format_to(std::back_inserter(buf_), "while ( true )\n"); + } + else + { + fmt::format_to(std::back_inserter(buf_), "while ( "); + dump_expr(stm.test); + fmt::format_to(std::back_inserter(buf_), " )\n"); + } + + if (stm.body == node::stmt_list) + { + dump_stmt(stm.body); + } + else + { + indent_ += 4; + fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); + dump_stmt(stm.body); + indent_ -= 4; + } +} + +auto source::dump_stmt_dowhile(stmt_dowhile const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "do\n"); + + if (stm.body == node::stmt_list) + { + dump_stmt(stm.body); + } + else + { + indent_ += 4; + fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); + dump_stmt(stm.body); + indent_ -= 4; + } + + if (stm.test == node::null) + { + fmt::format_to(std::back_inserter(buf_), "\n{: >{}}while ( true )", "", indent_); + } + else + { + fmt::format_to(std::back_inserter(buf_), "\n{: >{}}while (", "", indent_); + dump_expr(stm.test); + fmt::format_to(std::back_inserter(buf_), " );"); + } +} + +auto source::dump_stmt_for(stmt_for const& stm) -> void +{ + if (stm.test == node::null) + { + fmt::format_to(std::back_inserter(buf_), "for (;;)\n"); + } + else + { + fmt::format_to(std::back_inserter(buf_), "for ( "); + dump_stmt(stm.init); + fmt::format_to(std::back_inserter(buf_), "; "); + dump_expr(stm.test); + fmt::format_to(std::back_inserter(buf_), "; "); + dump_stmt(stm.iter); + fmt::format_to(std::back_inserter(buf_), " )\n"); + } + + if (stm.body == node::stmt_list) + { + dump_stmt(stm.body); + } + else + { + indent_ += 4; + fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); + dump_stmt(stm.body); + indent_ -= 4; + } +} + +auto source::dump_stmt_foreach(stmt_foreach const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "foreach ( "); + + if (stm.use_key) + { + dump_expr((ctx_->props() & props::foreach) ? stm.index : stm.key); + fmt::format_to(std::back_inserter(buf_), ", "); + } + + dump_expr(stm.value); + fmt::format_to(std::back_inserter(buf_), " in "); + dump_expr(stm.container); + fmt::format_to(std::back_inserter(buf_), " )\n"); + + if (stm.body == node::stmt_list) + { + dump_stmt(stm.body); + } + else + { + indent_ += 4; + fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); + dump_stmt(stm.body); + indent_ -= 4; + } +} + +auto source::dump_stmt_switch(stmt_switch const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "switch ( "); + dump_expr(stm.test); + fmt::format_to(std::back_inserter(buf_), " )\n"); + dump_stmt_list(*stm.body); +} + +auto source::dump_stmt_case(stmt_case const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "case "); + dump_expr(stm.value); + fmt::format_to(std::back_inserter(buf_), ":"); + + if (stm.body != nullptr && stm.body->list.size() > 0) + { + fmt::format_to(std::back_inserter(buf_), "\n"); + dump_stmt_list(*stm.body); + } +} + +auto source::dump_stmt_default(stmt_default const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "default:"); + + if (stm.body != nullptr && stm.body->list.size() > 0) + { + fmt::format_to(std::back_inserter(buf_), "\n"); + dump_stmt_list(*stm.body); + } +} + +auto source::dump_stmt_break(stmt_break const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "break;"); +} + +auto source::dump_stmt_continue(stmt_continue const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "continue;"); +} + +auto source::dump_stmt_return(stmt_return const& stm) -> void +{ + if (stm.value == node::null) + { + fmt::format_to(std::back_inserter(buf_), "return;"); + } + else + { + fmt::format_to(std::back_inserter(buf_), "return "); + dump_expr(stm.value); + fmt::format_to(std::back_inserter(buf_), ";"); + } +} + +auto source::dump_stmt_breakpoint(stmt_breakpoint const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "breakpoint;"); +} + +auto source::dump_stmt_prof_begin(stmt_prof_begin const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "prof_begin("); + dump_expr_arguments(*stm.args); + fmt::format_to(std::back_inserter(buf_), ")"); +} + +auto source::dump_stmt_prof_end(stmt_prof_end const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "prof_end("); + dump_expr_arguments(*stm.args); + fmt::format_to(std::back_inserter(buf_), ")"); +} + +auto source::dump_expr(expr const& exp) -> void +{ + switch (exp.as_node->kind()) + { + case node::expr_increment: + dump_expr_increment(*exp.as_increment); + break; + case node::expr_decrement: + dump_expr_decrement(*exp.as_decrement); + break; + case node::expr_assign_equal: + dump_expr_assign_equal(*exp.as_assign_equal); + break; + case node::expr_assign_add: + dump_expr_assign_add(*exp.as_assign_add); + break; + case node::expr_assign_sub: + dump_expr_assign_sub(*exp.as_assign_sub); + break; + case node::expr_assign_mul: + dump_expr_assign_mul(*exp.as_assign_mul); + break; + case node::expr_assign_div: + dump_expr_assign_div(*exp.as_assign_div); + break; + case node::expr_assign_mod: + dump_expr_assign_mod(*exp.as_assign_mod); + break; + case node::expr_assign_shift_left: + dump_expr_assign_shift_left(*exp.as_assign_shift_left); + break; + case node::expr_assign_shift_right: + dump_expr_assign_shift_right(*exp.as_assign_shift_right); + break; + case node::expr_assign_bitwise_or: + dump_expr_assign_bitwise_or(*exp.as_assign_bw_or); + break; + case node::expr_assign_bitwise_and: + dump_expr_assign_bitwise_and(*exp.as_assign_bw_and); + break; + case node::expr_assign_bitwise_exor: + dump_expr_assign_bitwise_exor(*exp.as_assign_bw_exor); + break; + case node::expr_ternary: + dump_expr_ternary(*exp.as_ternary); + break; + case node::expr_and: + dump_expr_and(*exp.as_and); + break; + case node::expr_or: + dump_expr_or(*exp.as_or); + break; + case node::expr_equality: + dump_expr_equality(*exp.as_equality); + break; + case node::expr_inequality: + dump_expr_inequality(*exp.as_inequality); + break; + case node::expr_less_equal: + dump_expr_less_equal(*exp.as_less_equal); + break; + case node::expr_greater_equal: + dump_expr_greater_equal(*exp.as_greater_equal); + break; + case node::expr_less: + dump_expr_less(*exp.as_less); + break; + case node::expr_greater: + dump_expr_greater(*exp.as_greater); + break; + case node::expr_add: + dump_expr_add(*exp.as_add); + break; + case node::expr_sub: + dump_expr_sub(*exp.as_sub); + break; + case node::expr_mul: + dump_expr_mul(*exp.as_mul); + break; + case node::expr_div: + dump_expr_div(*exp.as_div); + break; + case node::expr_mod: + dump_expr_mod(*exp.as_mod); + break; + case node::expr_shift_left: + dump_expr_shift_left(*exp.as_shift_left); + break; + case node::expr_shift_right: + dump_expr_shift_right(*exp.as_shift_right); + break; + case node::expr_bitwise_or: + dump_expr_bitwise_or(*exp.as_bitwise_or); + break; + case node::expr_bitwise_and: + dump_expr_bitwise_and(*exp.as_bitwise_and); + break; + case node::expr_bitwise_exor: + dump_expr_bitwise_exor(*exp.as_bitwise_exor); + break; + case node::expr_complement: + dump_expr_complement(*exp.as_complement); + break; + case node::expr_negate: + dump_expr_negate(*exp.as_negate); + break; + case node::expr_not: + dump_expr_not(*exp.as_not); + break; + case node::expr_call: + dump_expr_call(*exp.as_call); + break; + case node::expr_method: + dump_expr_method(*exp.as_method); + break; + case node::expr_function: + dump_expr_function(*exp.as_function); + break; + case node::expr_pointer: + dump_expr_pointer(*exp.as_pointer); + break; + case node::expr_add_array: + dump_expr_add_array(*exp.as_add_array); + break; + case node::expr_parameters: + dump_expr_parameters(*exp.as_parameters); + break; + case node::expr_arguments: + dump_expr_arguments(*exp.as_arguments); + break; + case node::expr_isdefined: + dump_expr_isdefined(*exp.as_isdefined); + break; + case node::expr_istrue: + dump_expr_istrue(*exp.as_istrue); + break; + case node::expr_reference: + dump_expr_reference(*exp.as_reference); + break; + case node::expr_tuple: + dump_expr_tuple(*exp.as_tuple); + break; + case node::expr_array: + dump_expr_array(*exp.as_array); + break; + case node::expr_field: + dump_expr_field(*exp.as_field); + break; + case node::expr_size: + dump_expr_size(*exp.as_size); + break; + case node::expr_paren: + dump_expr_paren(*exp.as_paren); + break; + case node::expr_thisthread: + dump_expr_thisthread(*exp.as_thisthread); + break; + case node::expr_empty_array: + dump_expr_empty_array(*exp.as_empty_array); + break; + case node::expr_undefined: + dump_expr_undefined(*exp.as_undefined); + break; + case node::expr_game: + dump_expr_game(*exp.as_game); + break; + case node::expr_self: + dump_expr_self(*exp.as_self); + break; + case node::expr_anim: + dump_expr_anim(*exp.as_anim); + break; + case node::expr_level: + dump_expr_level(*exp.as_level); + break; + case node::expr_animation: + dump_expr_animation(*exp.as_animation); + break; + case node::expr_animtree: + dump_expr_animtree(*exp.as_animtree); + break; + case node::expr_identifier: + dump_expr_identifier(*exp.as_identifier); + break; + case node::expr_path: + dump_expr_path(*exp.as_path); + break; + case node::expr_istring: + dump_expr_istring(*exp.as_istring); + break; + case node::expr_string: + dump_expr_string(*exp.as_string); + break; + case node::expr_vector: + dump_expr_vector(*exp.as_vector); + break; + case node::expr_float: + dump_expr_float(*exp.as_float); + break; + case node::expr_integer: + dump_expr_integer(*exp.as_integer); + break; + case node::expr_false: + dump_expr_false(*exp.as_false); + break; + case node::expr_true: + dump_expr_true(*exp.as_true); + break; + default: + break; + } +} + +auto source::dump_expr_increment(expr_increment const& exp) -> void +{ + if (exp.prefix) + { + fmt::format_to(std::back_inserter(buf_), "++"); + dump_expr(exp.lvalue); + } + else + { + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), "++"); + } +} + +auto source::dump_expr_decrement(expr_decrement const& exp) -> void +{ + if (exp.prefix) + { + fmt::format_to(std::back_inserter(buf_), "--"); + dump_expr(exp.lvalue); + } + else + { + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), "--"); + } +} + +auto source::dump_expr_assign_equal(expr_assign_equal const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " = "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_assign_add(expr_assign_add const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " += "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_assign_sub(expr_assign_sub const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " -= "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_assign_mul(expr_assign_mul const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " *= "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_assign_div(expr_assign_div const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " /= "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_assign_mod(expr_assign_mod const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " %= "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_assign_shift_left(expr_assign_shift_left const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " <<= "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_assign_shift_right(expr_assign_shift_right const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " >>= "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_assign_bitwise_or(expr_assign_bitwise_or const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " |= "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_assign_bitwise_and(expr_assign_bitwise_and const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " &= "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_assign_bitwise_exor(expr_assign_bitwise_exor const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " ^= "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_ternary(expr_ternary const& exp) -> void +{ + dump_expr(exp.test); + fmt::format_to(std::back_inserter(buf_), " ? "); + dump_expr(exp.true_expr); + fmt::format_to(std::back_inserter(buf_), " : "); + dump_expr(exp.false_expr); +} + +auto source::dump_expr_or(expr_or const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " || "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_and(expr_and const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " && "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_equality(expr_equality const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " == "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_inequality(expr_inequality const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " != "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_less_equal(expr_less_equal const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " <= "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_greater_equal(expr_greater_equal const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " >= "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_less(expr_less const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " < "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_greater(expr_greater const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " > "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_add(expr_add const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " + "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_sub(expr_sub const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " - "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_mul(expr_mul const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " * "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_div(expr_div const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " / "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_mod(expr_mod const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " % "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_shift_left(expr_shift_left const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " << "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_shift_right(expr_shift_right const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " >> "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_bitwise_or(expr_bitwise_or const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " | "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_bitwise_and(expr_bitwise_and const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " & "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_bitwise_exor(expr_bitwise_exor const& exp) -> void +{ + dump_expr(exp.lvalue); + fmt::format_to(std::back_inserter(buf_), " ^ "); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_not(expr_not const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "!"); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_negate(expr_negate const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "-"); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_complement(expr_complement const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "~"); + dump_expr(exp.rvalue); +} + +auto source::dump_expr_call(expr_call const& exp) -> void +{ + dump_call(exp.value); +} + +auto source::dump_expr_method(expr_method const& exp) -> void +{ + dump_expr(exp.obj); + fmt::format_to(std::back_inserter(buf_), " "); + dump_call(exp.value); +} + +auto source::dump_call(call const& exp) -> void +{ + switch (exp.as_node->kind()) + { + case node::expr_function: + dump_expr_function(*exp.as_function); + break; + case node::expr_pointer: + dump_expr_pointer(*exp.as_pointer); + break; + default: + break; + } +} + +auto source::dump_expr_function(expr_function const& exp) -> void +{ + if (exp.mode == call::mode::thread) + fmt::format_to(std::back_inserter(buf_), "thread "); + else if (exp.mode == call::mode::childthread) + fmt::format_to(std::back_inserter(buf_), "childthread "); + + if (exp.path->value != "") + { + dump_expr_path(*exp.path); + fmt::format_to(std::back_inserter(buf_), "::"); + } + + dump_expr_identifier(*exp.name); + fmt::format_to(std::back_inserter(buf_), "("); + dump_expr_arguments(*exp.args); + fmt::format_to(std::back_inserter(buf_), ")"); +} + +auto source::dump_expr_pointer(expr_pointer const& exp) -> void +{ + if (exp.mode == call::mode::builtin) + fmt::format_to(std::back_inserter(buf_), "call "); + else if (exp.mode == call::mode::thread) + fmt::format_to(std::back_inserter(buf_), "thread "); + else if (exp.mode == call::mode::childthread) + fmt::format_to(std::back_inserter(buf_), "childthread "); + + fmt::format_to(std::back_inserter(buf_), "[[ "); + dump_expr(exp.func); + fmt::format_to(std::back_inserter(buf_), " ]]("); + dump_expr_arguments(*exp.args); + fmt::format_to(std::back_inserter(buf_), ")"); +} + +auto source::dump_expr_add_array(expr_add_array const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "["); + dump_expr_arguments(*exp.args); + fmt::format_to(std::back_inserter(buf_), "]"); +} + +auto source::dump_expr_parameters(expr_parameters const& exp) -> void +{ + for (auto const& entry : exp.list) + { + fmt::format_to(std::back_inserter(buf_), " "); + dump_expr_identifier(*entry); + + if (&entry != &exp.list.back()) + fmt::format_to(std::back_inserter(buf_), ","); + else + fmt::format_to(std::back_inserter(buf_), " "); + } +} + +auto source::dump_expr_arguments(expr_arguments const& exp) -> void +{ + for (auto const& entry : exp.list) + { + fmt::format_to(std::back_inserter(buf_), " "); + dump_expr(entry); + + if (&entry != &exp.list.back()) + fmt::format_to(std::back_inserter(buf_), ","); + else + fmt::format_to(std::back_inserter(buf_), " "); + } +} + +auto source::dump_expr_isdefined(expr_isdefined const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "isdefined( "); + dump_expr(exp.value); + fmt::format_to(std::back_inserter(buf_), " )"); +} + +auto source::dump_expr_istrue(expr_istrue const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "istrue( "); + dump_expr(exp.value); + fmt::format_to(std::back_inserter(buf_), " )"); +} + +auto source::dump_expr_reference(expr_reference const& exp) -> void +{ + dump_expr_path(*exp.path); + fmt::format_to(std::back_inserter(buf_), "::"); + dump_expr_identifier(*exp.name); +} + +auto source::dump_expr_tuple(expr_tuple const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "["); + + for (auto const& entry : exp.list) + { + dump_expr(entry); + + if (&entry != &exp.list.back()) + fmt::format_to(std::back_inserter(buf_), ", "); + } + + fmt::format_to(std::back_inserter(buf_), "]"); +} + +auto source::dump_expr_array(expr_array const& exp) -> void +{ + dump_expr(exp.obj); + fmt::format_to(std::back_inserter(buf_), "["); + dump_expr(exp.key); + fmt::format_to(std::back_inserter(buf_), "]"); +} + +auto source::dump_expr_field(expr_field const& exp) -> void +{ + dump_expr(exp.obj); + fmt::format_to(std::back_inserter(buf_), "."); + dump_expr_identifier(*exp.field); +} + +auto source::dump_expr_size(expr_size const& exp) -> void +{ + dump_expr(exp.obj); + fmt::format_to(std::back_inserter(buf_), ".size"); +} + +auto source::dump_expr_paren(expr_paren const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "( "); + dump_expr(exp.value); + fmt::format_to(std::back_inserter(buf_), " )"); +} + +auto source::dump_expr_thisthread(expr_thisthread const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "thisthread"); +} + +auto source::dump_expr_empty_array(expr_empty_array const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "[]"); +} + +auto source::dump_expr_undefined(expr_undefined const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "undefined"); +} + +auto source::dump_expr_game(expr_game const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "game"); +} + +auto source::dump_expr_self(expr_self const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "self"); +} + +auto source::dump_expr_anim(expr_anim const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "anim"); +} + +auto source::dump_expr_level(expr_level const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "level"); +} + +auto source::dump_expr_animation(expr_animation const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "%{}", exp.value); +} + +auto source::dump_expr_animtree(expr_animtree const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "#animtree"); +} + +auto source::dump_expr_identifier(expr_identifier const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "{}", exp.value); +} + +auto source::dump_expr_path(expr_path const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "{}", utils::string::backslash(exp.value)); +} + +auto source::dump_expr_istring(expr_istring const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "&{}", utils::string::to_literal(exp.value)); +} + +auto source::dump_expr_string(expr_string const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "{}", utils::string::to_literal(exp.value)); +} + +auto source::dump_expr_vector(expr_vector const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "( "); + dump_expr(exp.x); + fmt::format_to(std::back_inserter(buf_), ", "); + dump_expr(exp.y); + fmt::format_to(std::back_inserter(buf_), ", "); + dump_expr(exp.z); + fmt::format_to(std::back_inserter(buf_), " )"); +} + +auto source::dump_expr_float(expr_float const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "{}", exp.value); +} + +auto source::dump_expr_integer(expr_integer const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "{}", exp.value); +} + +auto source::dump_expr_false(expr_false const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "false"); +} + +auto source::dump_expr_true(expr_true const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "true"); +} + +auto source::dump_asm_jmp(asm_jmp const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_jmp( {} )", exp.value); +} + +auto source::dump_asm_jmp_back(asm_jmp_back const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_jmp_back( {} )", exp.value); +} + +auto source::dump_asm_jmp_cond(asm_jmp_cond const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_jmp_cond( {} )", exp.value); +} + +auto source::dump_asm_jmp_true(asm_jmp_true const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_jmp_expr_true( {} )", exp.value); +} + +auto source::dump_asm_jmp_false(asm_jmp_false const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_jmp_expr_false( {} )", exp.value); +} + +auto source::dump_asm_switch(asm_switch const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_switch( {} )", exp.value); +} + +auto source::dump_asm_endswitch(asm_endswitch const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_endswitch()"); +} + +auto source::dump_asm_prescriptcall(asm_prescriptcall const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_prescriptcall()"); +} + +auto source::dump_asm_voidcodepos(asm_voidcodepos const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_voidcodepos()"); +} + +auto source::dump_asm_create(asm_create const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_var_create( {} )", exp.index); +} + +auto source::dump_asm_access(asm_access const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_var_access( {} )", exp.index); +} + +auto source::dump_asm_remove(asm_remove const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_var_remove( {} )", exp.index); +} + +auto source::dump_asm_clear(asm_clear const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_var_clear( {} )", exp.index); +} + +} // namespace xsk::gsc diff --git a/src/gsc/source.hpp b/src/gsc/source.hpp new file mode 100644 index 00000000..3705a32c --- /dev/null +++ b/src/gsc/source.hpp @@ -0,0 +1,154 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "misc/types.hpp" + +namespace xsk::gsc +{ + +class source +{ + context const* ctx_; + std::vector buf_; + u32 indent_; + +public: + source(context const* ctx); + auto parse_assembly(buffer const& data) -> assembly::ptr; + auto parse_assembly(std::vector const& data) -> assembly::ptr; + auto parse_assembly(u8 const* data, usize size) -> assembly::ptr; + auto parse_program(std::string const& name, buffer const& data) -> program::ptr; + auto parse_program(std::string const& name, std::vector const& data) -> program::ptr; + auto parse_program(std::string const& name, u8 const* data, usize size) -> program::ptr; + auto dump(assembly const& data) -> std::vector; + auto dump(program const& data) -> std::vector; + +private: + auto dump_assembly(assembly const& data) -> void; + auto dump_function(function const& func) -> void; + auto dump_instruction(instruction const& inst) -> void; + auto dump_program(program const& data) -> void; + auto dump_include(include const& inc) -> void; + auto dump_decl(decl const& dec) -> void; + auto dump_decl_dev_begin(decl_dev_begin const& dec) -> void; + auto dump_decl_dev_end(decl_dev_end const& dec) -> void; + auto dump_decl_usingtree(decl_usingtree const& dec) -> void; + auto dump_decl_function(decl_function const& dec) -> void; + auto dump_stmt(stmt const& stm) -> void; + auto dump_stmt_list(stmt_list const& stm) -> void; + auto dump_stmt_dev(stmt_dev const& stm) -> void; + auto dump_stmt_expr(stmt_expr const& stm) -> void; + auto dump_stmt_call(stmt_call const& stm) -> void; + auto dump_stmt_assign(stmt_assign const& stm) -> void; + auto dump_stmt_endon(stmt_endon const& stm) -> void; + auto dump_stmt_notify(stmt_notify const& stm) -> void; + auto dump_stmt_wait(stmt_wait const& stm) -> void; + auto dump_stmt_waittill(stmt_waittill const& stm) -> void; + auto dump_stmt_waittillmatch(stmt_waittillmatch const& stm) -> void; + auto dump_stmt_waittillframeend(stmt_waittillframeend const& stm) -> void; + auto dump_stmt_waitframe(stmt_waitframe const& stm) -> void; + auto dump_stmt_if(stmt_if const& stm) -> void; + auto dump_stmt_ifelse(stmt_ifelse const& stm) -> void; + auto dump_stmt_while(stmt_while const& stm) -> void; + auto dump_stmt_dowhile(stmt_dowhile const& stm) -> void; + auto dump_stmt_for(stmt_for const& stm) -> void; + auto dump_stmt_foreach(stmt_foreach const& stm) -> void; + auto dump_stmt_switch(stmt_switch const& stm) -> void; + auto dump_stmt_case(stmt_case const& stm) -> void; + auto dump_stmt_default(stmt_default const& stm) -> void; + auto dump_stmt_break(stmt_break const& stm) -> void; + auto dump_stmt_continue(stmt_continue const& stm) -> void; + auto dump_stmt_return(stmt_return const& stm) -> void; + auto dump_stmt_breakpoint(stmt_breakpoint const& stm) -> void; + auto dump_stmt_prof_begin(stmt_prof_begin const& stm) -> void; + auto dump_stmt_prof_end(stmt_prof_end const& stm) -> void; + auto dump_expr(expr const& exp) -> void; + auto dump_expr_increment(expr_increment const& exp) -> void; + auto dump_expr_decrement(expr_decrement const& exp) -> void; + auto dump_expr_assign_equal(expr_assign_equal const& exp) -> void; + auto dump_expr_assign_add(expr_assign_add const& exp) -> void; + auto dump_expr_assign_sub(expr_assign_sub const& exp) -> void; + auto dump_expr_assign_mul(expr_assign_mul const& exp) -> void; + auto dump_expr_assign_div(expr_assign_div const& exp) -> void; + auto dump_expr_assign_mod(expr_assign_mod const& exp) -> void; + auto dump_expr_assign_shift_left(expr_assign_shift_left const& exp) -> void; + auto dump_expr_assign_shift_right(expr_assign_shift_right const& exp) -> void; + auto dump_expr_assign_bitwise_or(expr_assign_bitwise_or const& exp) -> void; + auto dump_expr_assign_bitwise_and(expr_assign_bitwise_and const& exp) -> void; + auto dump_expr_assign_bitwise_exor(expr_assign_bitwise_exor const& exp) -> void; + auto dump_expr_ternary(expr_ternary const& exp) -> void; + auto dump_expr_or(expr_or const& exp) -> void; + auto dump_expr_and(expr_and const& exp) -> void; + auto dump_expr_equality(expr_equality const& exp) -> void; + auto dump_expr_inequality(expr_inequality const& exp) -> void; + auto dump_expr_less_equal(expr_less_equal const& exp) -> void; + auto dump_expr_greater_equal(expr_greater_equal const& exp) -> void; + auto dump_expr_less(expr_less const& exp) -> void; + auto dump_expr_greater(expr_greater const& exp) -> void; + auto dump_expr_add(expr_add const& exp) -> void; + auto dump_expr_sub(expr_sub const& exp) -> void; + auto dump_expr_mul(expr_mul const& exp) -> void; + auto dump_expr_div(expr_div const& exp) -> void; + auto dump_expr_mod(expr_mod const& exp) -> void; + auto dump_expr_shift_left(expr_shift_left const& exp) -> void; + auto dump_expr_shift_right(expr_shift_right const& exp) -> void; + auto dump_expr_bitwise_or(expr_bitwise_or const& exp) -> void; + auto dump_expr_bitwise_and(expr_bitwise_and const& exp) -> void; + auto dump_expr_bitwise_exor(expr_bitwise_exor const& exp) -> void; + auto dump_expr_not(expr_not const& exp) -> void; + auto dump_expr_negate(expr_negate const& exp) -> void; + auto dump_expr_complement(expr_complement const& exp) -> void; + auto dump_expr_call(expr_call const& exp) -> void; + auto dump_expr_method(expr_method const& exp) -> void; + auto dump_call(call const& exp) -> void; + auto dump_expr_function(expr_function const& exp) -> void; + auto dump_expr_pointer(expr_pointer const& exp) -> void; + auto dump_expr_add_array(expr_add_array const& exp) -> void; + auto dump_expr_parameters(expr_parameters const& exp) -> void; + auto dump_expr_arguments(expr_arguments const& exp) -> void; + auto dump_expr_isdefined(expr_isdefined const& exp) -> void; + auto dump_expr_istrue(expr_istrue const& exp) -> void; + auto dump_expr_reference(expr_reference const& exp) -> void; + auto dump_expr_tuple(expr_tuple const& exp) -> void; + auto dump_expr_array(expr_array const& exp) -> void; + auto dump_expr_field(expr_field const& exp) -> void; + auto dump_expr_size(expr_size const& exp) -> void; + auto dump_expr_paren(expr_paren const& exp) -> void; + auto dump_expr_thisthread(expr_thisthread const& exp) -> void; + auto dump_expr_empty_array(expr_empty_array const& exp) -> void; + auto dump_expr_undefined(expr_undefined const& exp) -> void; + auto dump_expr_game(expr_game const& exp) -> void; + auto dump_expr_self(expr_self const& exp) -> void; + auto dump_expr_anim(expr_anim const& exp) -> void; + auto dump_expr_level(expr_level const& exp) -> void; + auto dump_expr_animation(expr_animation const& exp) -> void; + auto dump_expr_animtree(expr_animtree const& exp) -> void; + auto dump_expr_identifier(expr_identifier const& exp) -> void; + auto dump_expr_path(expr_path const& exp) -> void; + auto dump_expr_istring(expr_istring const& exp) -> void; + auto dump_expr_string(expr_string const& exp) -> void; + auto dump_expr_vector(expr_vector const& exp) -> void; + auto dump_expr_float(expr_float const& exp) -> void; + auto dump_expr_integer(expr_integer const& exp) -> void; + auto dump_expr_false(expr_false const& exp) -> void; + auto dump_expr_true(expr_true const& exp) -> void; + auto dump_asm_jmp(asm_jmp const& exp) -> void; + auto dump_asm_jmp_back(asm_jmp_back const& exp) -> void; + auto dump_asm_jmp_cond(asm_jmp_cond const& exp) -> void; + auto dump_asm_jmp_true(asm_jmp_true const& exp) -> void; + auto dump_asm_jmp_false(asm_jmp_false const& exp) -> void; + auto dump_asm_switch(asm_switch const& exp) -> void; + auto dump_asm_endswitch(asm_endswitch const& exp) -> void; + auto dump_asm_prescriptcall(asm_prescriptcall const& exp) -> void; + auto dump_asm_voidcodepos(asm_voidcodepos const& exp) -> void; + auto dump_asm_create(asm_create const& exp) -> void; + auto dump_asm_access(asm_access const& exp) -> void; + auto dump_asm_remove(asm_remove const& exp) -> void; + auto dump_asm_clear(asm_clear const& exp) -> void; +}; + +} // namespace xsk::gsc diff --git a/src/h1/h1.cpp b/src/h1/h1.cpp new file mode 100644 index 00000000..0d765e49 --- /dev/null +++ b/src/h1/h1.cpp @@ -0,0 +1,52 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "h1.hpp" + +namespace xsk::gsc::h1 +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::str4 | props::waitframe, engine::h1, endian::little, system::pc, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::h1 diff --git a/src/h1/h1.hpp b/src/h1/h1.hpp new file mode 100644 index 00000000..cfcf47e5 --- /dev/null +++ b/src/h1/h1.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::h1 +{ +// H1 PC 1.15.1251288 +constexpr usize code_count = 154; +constexpr usize func_count = 778; +constexpr usize meth_count = 1415; +constexpr usize token_count = 42947; +constexpr u32 max_string_id = 42989; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::h1 diff --git a/src/h1/h1_code.cpp b/src/h1/h1_code.cpp new file mode 100644 index 00000000..145a5957 --- /dev/null +++ b/src/h1/h1_code.cpp @@ -0,0 +1,169 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "h1.hpp" + +namespace xsk::gsc::h1 +{ + +extern std::array, code_count> const code_list +{{ + { 0x17, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x18, opcode::OP_EvalSelfFieldVariable }, + { 0x19, opcode::OP_Return }, + { 0x1A, opcode::OP_CallBuiltin0 }, + { 0x1B, opcode::OP_CallBuiltin1 }, + { 0x1C, opcode::OP_CallBuiltin2 }, + { 0x1D, opcode::OP_CallBuiltin3 }, + { 0x1E, opcode::OP_CallBuiltin4 }, + { 0x1F, opcode::OP_CallBuiltin5 }, + { 0x20, opcode::OP_CallBuiltin }, + { 0x21, opcode::OP_BoolNot }, + { 0x22, opcode::OP_ScriptFarMethodThreadCall }, + { 0x23, opcode::OP_JumpOnTrueExpr }, + { 0x24, opcode::OP_SetLevelFieldVariableField }, + { 0x25, opcode::OP_CastBool }, + { 0x26, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x27, opcode::OP_CallBuiltinPointer }, + { 0x28, opcode::OP_inequality }, + { 0x29, opcode::OP_GetThisthread }, + { 0x2A, opcode::OP_ClearFieldVariable }, + { 0x2B, opcode::OP_GetFloat }, + { 0x2C, opcode::OP_SafeCreateVariableFieldCached }, + { 0x2D, opcode::OP_ScriptFarFunctionCall2 }, + { 0x2E, opcode::OP_ScriptFarFunctionCall }, + { 0x2F, opcode::OP_ScriptFarChildThreadCall }, + { 0x30, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x31, opcode::OP_ClearLocalVariableFieldCached }, + { 0x32, opcode::OP_checkclearparams }, + { 0x33, opcode::OP_CastFieldObject }, + { 0x34, opcode::OP_End }, + { 0x35, opcode::OP_size }, + { 0x36, opcode::OP_EmptyArray }, + { 0x37, opcode::OP_bit_and }, + { 0x38, opcode::OP_less_equal }, + { 0x39, opcode::OP_voidCodepos }, + { 0x3A, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3B, opcode::OP_endswitch }, + { 0x3C, opcode::OP_ClearVariableField }, + { 0x3D, opcode::OP_divide }, + { 0x3E, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x3F, opcode::OP_GetUnsignedShort }, + { 0x40, opcode::OP_JumpOnTrue }, + { 0x41, opcode::OP_GetSelf }, + { 0x42, opcode::OP_ScriptFarThreadCall }, + { 0x43, opcode::OP_ScriptLocalThreadCall }, + { 0x44, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x45, opcode::OP_SetLocalVariableFieldCached }, + { 0x46, opcode::OP_plus }, + { 0x47, opcode::OP_BoolComplement }, + { 0x48, opcode::OP_ScriptMethodCallPointer }, + { 0x49, opcode::OP_inc }, + { 0x4A, opcode::OP_RemoveLocalVariables }, + { 0x4B, opcode::OP_JumpOnFalseExpr }, + { 0x4C, opcode::OP_switch }, + { 0x4D, opcode::OP_clearparams }, + { 0x4E, opcode::OP_EvalLocalVariableRefCached0 }, + { 0x4F, opcode::OP_EvalLocalVariableRefCached }, + { 0x50, opcode::OP_ScriptLocalMethodCall }, + { 0x51, opcode::OP_EvalFieldVariable }, + { 0x52, opcode::OP_EvalFieldVariableRef }, + { 0x53, opcode::OP_GetString }, + { 0x54, opcode::OP_ScriptFunctionCallPointer }, + { 0x55, opcode::OP_EvalLevelFieldVariable }, + { 0x56, opcode::OP_GetVector }, + { 0x57, opcode::OP_endon }, + { 0x58, opcode::OP_greater_equal }, + { 0x59, opcode::OP_GetSelfObject }, + { 0x5A, opcode::OP_SetAnimFieldVariableField }, + { 0x5B, opcode::OP_SetVariableField }, + { 0x5C, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x5D, opcode::OP_ScriptLocalFunctionCall }, + { 0x5E, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x5F, opcode::OP_EvalLocalArrayRefCached }, + { 0x60, opcode::OP_GetFarFunction }, + { 0x61, opcode::OP_less }, + { 0x62, opcode::OP_GetGameRef }, + { 0x63, opcode::OP_waittillFrameEnd }, + { 0x64, opcode::OP_waitframe }, + { 0x65, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x66, opcode::OP_SafeSetVariableFieldCached }, + { 0x67, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x68, opcode::OP_GetLevel }, + { 0x69, opcode::OP_notify }, + { 0x6A, opcode::OP_DecTop }, + { 0x6B, opcode::OP_shift_left }, + { 0x6C, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x6D, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x6E, opcode::OP_greater }, + { 0x6F, opcode::OP_EvalLocalVariableCached0 }, + { 0x70, opcode::OP_EvalLocalVariableCached1 }, + { 0x71, opcode::OP_EvalLocalVariableCached2 }, + { 0x72, opcode::OP_EvalLocalVariableCached3 }, + { 0x73, opcode::OP_EvalLocalVariableCached4 }, + { 0x74, opcode::OP_EvalLocalVariableCached5 }, + { 0x75, opcode::OP_EvalLocalVariableCached }, + { 0x76, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x77, opcode::OP_jump }, + { 0x78, opcode::OP_ScriptThreadCallPointer }, + { 0x79, opcode::OP_GetZero }, + { 0x7A, opcode::OP_wait }, + { 0x7B, opcode::OP_minus }, + { 0x7C, opcode::OP_SetSelfFieldVariableField }, + { 0x7D, opcode::OP_EvalNewLocalVariableRefCached0 }, + { 0x7E, opcode::OP_multiply }, + { 0x7F, opcode::OP_CreateLocalVariable }, + { 0x80, opcode::OP_ScriptLocalChildThreadCall }, + { 0x81, opcode::OP_GetInteger }, + { 0x82, opcode::OP_mod }, + { 0x83, opcode::OP_EvalAnimFieldVariableRef }, + { 0x84, opcode::OP_GetBuiltinFunction }, + { 0x85, opcode::OP_GetGame }, + { 0x86, opcode::OP_waittill }, + { 0x87, opcode::OP_dec }, + { 0x88, opcode::OP_EvalLocalVariableObjectCached }, + { 0x89, opcode::OP_PreScriptCall }, + { 0x8A, opcode::OP_GetAnim }, + { 0x8B, opcode::OP_GetUndefined }, + { 0x8C, opcode::OP_EvalLevelFieldVariableRef }, + { 0x8D, opcode::OP_GetAnimObject }, + { 0x8E, opcode::OP_GetLevelObject }, + { 0x8F, opcode::OP_bit_ex_or }, + { 0x90, opcode::OP_equality }, + { 0x91, opcode::OP_ClearArray }, + { 0x92, opcode::OP_jumpback }, + { 0x93, opcode::OP_GetAnimation }, + { 0x94, opcode::OP_EvalAnimFieldVariable }, + { 0x95, opcode::OP_GetAnimTree }, + { 0x96, opcode::OP_GetIString }, + { 0x97, opcode::OP_EvalArrayRef }, + { 0x98, opcode::OP_EvalSelfFieldVariableRef }, + { 0x99, opcode::OP_GetNegByte }, + { 0x9A, opcode::OP_GetBuiltinMethod }, + { 0x9B, opcode::OP_CallBuiltinMethodPointer }, + { 0x9C, opcode::OP_EvalArray }, + { 0x9D, opcode::OP_vector }, + { 0x9E, opcode::OP_ScriptFarMethodCall }, + { 0x9F, opcode::OP_EvalLocalArrayCached }, + { 0xA0, opcode::OP_GetByte }, + { 0xA1, opcode::OP_ScriptChildThreadCallPointer }, + { 0xA2, opcode::OP_bit_or }, + { 0xA3, opcode::OP_AddArray }, + { 0xA4, opcode::OP_waittillmatch2 }, + { 0xA5, opcode::OP_waittillmatch }, + { 0xA6, opcode::OP_GetLocalFunction }, + { 0xA7, opcode::OP_GetNegUnsignedShort }, + { 0xA8, opcode::OP_shift_right }, + { 0xA9, opcode::OP_CallBuiltinMethod0 }, + { 0xAA, opcode::OP_CallBuiltinMethod1 }, + { 0xAB, opcode::OP_CallBuiltinMethod2 }, + { 0xAC, opcode::OP_CallBuiltinMethod3 }, + { 0xAD, opcode::OP_CallBuiltinMethod4 }, + { 0xAE, opcode::OP_CallBuiltinMethod5 }, + { 0xAF, opcode::OP_CallBuiltinMethod }, + { 0xB0, opcode::OP_JumpOnFalse }, +}}; + +} // namespace xsk::gsc::h1 diff --git a/src/h1/h1_func.cpp b/src/h1/h1_func.cpp new file mode 100644 index 00000000..4493d2ab --- /dev/null +++ b/src/h1/h1_func.cpp @@ -0,0 +1,793 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "h1.hpp" + +namespace xsk::gsc::h1 +{ + +extern std::array, func_count> const func_list +{{ + { 0x001, "precacheturret" }, + { 0x002, "getweaponarray" }, + { 0x003, "createprintchannel" }, + { 0x004, "updategamerprofileall" }, + { 0x005, "clearlocalizedstrings" }, + { 0x006, "setphysicsgravitydir" }, + { 0x007, "gettimescale" }, + { 0x008, "settimescale" }, + { 0x009, "setslowmotionview" }, + { 0x00A, "teleportscene" }, + { 0x00B, "forcesharedammo" }, + { 0x00C, "refreshhudcompass" }, + { 0x00D, "refreshhudammocounter" }, + { 0x00E, "notifyoncommand" }, + { 0x00F, "setprintchannel" }, + { 0x010, "print" }, + { 0x011, "println" }, + { 0x012, "print3d" }, + { 0x013, "line" }, + { 0x014, "box" }, + { 0x015, "orientedbox" }, + { 0x016, "sphere" }, + { 0x017, "cylinder" }, + { 0x018, "spawnturret" }, + { 0x019, "canspawnturret" }, + { 0x01A, "assert" }, + { 0x01B, "pausecinematicingame" }, + { 0x01C, "drawcompassfriendlies" }, + { 0x01D, "bulletspread" }, + { 0x01E, "bullettracer" }, + { 0x01F, "badplace_delete" }, + { 0x020, "badplace_cylinder" }, + { 0x021, "badplace_arc" }, + { 0x022, "badplace_brush" }, + { 0x023, "clearallcorpses" }, + { 0x024, "setturretnode" }, + { 0x025, "unsetturretnode" }, + { 0x026, "setnodepriority" }, + { 0x027, "_func_027" }, + { 0x028, "_func_028" }, + { 0x029, "_func_029" }, + { 0x02A, "setdebugorigin" }, + { 0x02B, "setdebugangles" }, + { 0x02C, "updategamerprofile" }, + { 0x02D, "assertex" }, + { 0x02E, "assertmsg" }, + { 0x02F, "isdefined" }, + { 0x030, "isvalidmissile" }, + { 0x031, "isstring" }, + { 0x032, "setomnvar" }, + { 0x033, "getomnvar" }, + { 0x034, "setdvar" }, + { 0x035, "setdynamicdvar" }, + { 0x036, "setdvarifuninitialized" }, + { 0x037, "setdevdvar" }, + { 0x038, "setdevdvarifuninitialized" }, + { 0x039, "getdvar" }, + { 0x03A, "getdvarint" }, + { 0x03B, "getdvarfloat" }, + { 0x03C, "getdvarvector" }, + { 0x03D, "gettime" }, + { 0x03E, "gettimeutc" }, + { 0x03F, "getradiometricunit" }, + { 0x040, "getentbynum" }, + { 0x041, "getscreenwidth" }, + { 0x042, "getscreenheight" }, + { 0x043, "getweaponmodel" }, + { 0x044, "getculldist" }, + { 0x045, "sethalfresparticles" }, + { 0x046, "getmapsunlight" }, + { 0x047, "setsunlight" }, + { 0x048, "resetsunlight" }, + { 0x049, "getmapsundirection" }, + { 0x04A, "getmapsunangles" }, + { 0x04B, "setsundirection" }, + { 0x04C, "lerpsundirection" }, + { 0x04D, "lerpsunangles" }, + { 0x04E, "resetsundirection" }, + { 0x04F, "enableforcedsunshadows" }, + { 0x050, "enableforcednosunshadows" }, + { 0x051, "disableforcedsunshadows" }, + { 0x052, "enableouterspacemodellighting" }, + { 0x053, "disableouterspacemodellighting" }, + { 0x054, "remapstage" }, + { 0x055, "changelevel" }, + { 0x056, "missionsuccess" }, + { 0x057, "missionfailed" }, + { 0x058, "cinematic" }, + { 0x059, "cinematicingame" }, + { 0x05A, "cinematicingamesync" }, + { 0x05B, "cinematicingameloop" }, + { 0x05C, "cinematicingameloopresident" }, + { 0x05D, "iscinematicplaying" }, + { 0x05E, "stopcinematicingame" }, + { 0x05F, "getweapondisplayname" }, + { 0x060, "getweaponbasename" }, + { 0x061, "getweaponattachments" }, + { 0x062, "getweaponattachmentdisplaynames" }, + { 0x063, "getweaponcamoname" }, + { 0x064, "getweaponreticlename" }, + { 0x065, "getanimlength" }, + { 0x066, "animhasnotetrack" }, + { 0x067, "getnotetracktimes" }, + { 0x068, "spawn" }, + { 0x069, "spawnloopsound" }, + { 0x06A, "spawnloopingsound" }, + { 0x06B, "bullettrace" }, + { 0x06C, "target_setmaxsize" }, + { 0x06D, "target_setcolor" }, + { 0x06E, "target_setdelay" }, + { 0x06F, "getstartorigin" }, + { 0x070, "getstartangles" }, + { 0x071, "getcycleoriginoffset" }, + { 0x072, "magicgrenade" }, + { 0x073, "magicgrenademanual" }, + { 0x074, "setblur" }, + { 0x075, "musicplay" }, + { 0x076, "musicstop" }, + { 0x077, "soundfade" }, + { 0x078, "addsoundsubmix" }, + { 0x079, "clearsoundsubmix" }, + { 0x07A, "clearallsubmixes" }, + { 0x07B, "blendsoundsubmix" }, + { 0x07C, "makesoundsubmixsticky" }, + { 0x07D, "makesoundsubmixunsticky" }, + { 0x07E, "soundsettimescalefactor" }, + { 0x07F, "soundresettimescale" }, + { 0x080, "levelsoundfade" }, + { 0x081, "precachenightvisioncodeassets" }, + { 0x082, "precachedigitaldistortcodeassets" }, + { 0x083, "precachesonarvisioncodeassets" }, + { 0x084, "precacheminimapsentrycodeassets" }, + { 0x085, "savegame" }, + { 0x086, "issavesuccessful" }, + { 0x087, "issaverecentlyloaded" }, + { 0x088, "savegamenocommit" }, + { 0x089, "commitsave" }, + { 0x08A, "commitwouldbevalid" }, + { 0x08B, "getfxvisibility" }, + { 0x08C, "setculldist" }, + { 0x08D, "bullettracepassed" }, + { 0x08E, "sighttracepassed" }, + { 0x08F, "physicstrace" }, + { 0x090, "playerphysicstrace" }, + { 0x091, "getgroundposition" }, + { 0x092, "getmovedelta" }, + { 0x093, "getangledelta" }, + { 0x094, "getnorthyaw" }, + { 0x095, "getcommandfromkey" }, + { 0x096, "getsticksconfig" }, + { 0x097, "weaponfightdist" }, + { 0x098, "weaponmaxdist" }, + { 0x099, "isturretactive" }, + { 0x09A, "getturretfov" }, + { 0x09B, "target_alloc" }, + { 0x09C, "target_flush" }, + { 0x09D, "target_set" }, + { 0x09E, "target_remove" }, + { 0x09F, "target_setshader" }, + { 0x0A0, "target_setoffscreenshader" }, + { 0x0A1, "target_isinrect" }, + { 0x0A2, "target_isincircle" }, + { 0x0A3, "target_startreticlelockon" }, + { 0x0A4, "target_clearreticlelockon" }, + { 0x0A5, "target_getarray" }, + { 0x0A6, "target_istarget" }, + { 0x0A7, "target_setattackmode" }, + { 0x0A8, "target_setjavelinonly" }, + { 0x0A9, "target_hidefromplayer" }, + { 0x0AA, "target_showtoplayer" }, + { 0x0AB, "target_setscaledrendermode" }, + { 0x0AC, "target_drawcornersonly" }, + { 0x0AD, "target_drawsquare" }, + { 0x0AE, "target_drawsingle" }, + { 0x0AF, "target_setminsize" }, + { 0x0B0, "setnorthyaw" }, + { 0x0B1, "setslowmotion" }, + { 0x0B2, "randomint" }, + { 0x0B3, "randomfloat" }, + { 0x0B4, "randomintrange" }, + { 0x0B5, "randomfloatrange" }, + { 0x0B6, "sin" }, + { 0x0B7, "cos" }, + { 0x0B8, "tan" }, + { 0x0B9, "asin" }, + { 0x0BA, "acos" }, + { 0x0BB, "atan" }, + { 0x0BC, "int" }, + { 0x0BD, "float" }, + { 0x0BE, "abs" }, + { 0x0BF, "min" }, + { 0x0C0, "objective_additionalcurrent" }, + { 0x0C1, "objective_ring" }, + { 0x0C2, "objective_setpointertextoverride" }, + { 0x0C3, "getnode" }, + { 0x0C4, "getnodearray" }, + { 0x0C5, "getallnodes" }, + { 0x0C6, "getnodesinradius" }, + { 0x0C7, "getnodesinradiussorted" }, + { 0x0C8, "getclosestnodeinsight" }, + { 0x0C9, "getreflectionlocs" }, + { 0x0CA, "getreflectionreferencelocs" }, + { 0x0CB, "getvehicletracksegment" }, + { 0x0CC, "getvehicletracksegmentarray" }, + { 0x0CD, "getallvehicletracksegments" }, + { 0x0CE, "isarray" }, + { 0x0CF, "isai" }, + { 0x0D0, "getindexforluincstring" }, + { 0x0D1, "issentient" }, + { 0x0D2, "isgodmode" }, + { 0x0D3, "getdebugdvar" }, + { 0x0D4, "getdebugdvarint" }, + { 0x0D5, "getdebugdvarfloat" }, + { 0x0D6, "setsaveddvar" }, + { 0x0D7, "getfreeaicount" }, + { 0x0D8, "getaicount" }, + { 0x0D9, "getaiarray" }, + { 0x0DA, "getaispeciesarray" }, + { 0x0DB, "getspawnerarray" }, + { 0x0DC, "getcorpsearray" }, + { 0x0DD, "getspawnerteamarray" }, + { 0x0DE, "getweaponclipmodel" }, + { 0x0DF, "getbrushmodelcenter" }, + { 0x0E0, "getkeybinding" }, + { 0x0E1, "max" }, + { 0x0E2, "floor" }, + { 0x0E3, "ceil" }, + { 0x0E4, "exp" }, + { 0x0E5, "_func_0E5" }, + { 0x0E6, "log" }, + { 0x0E7, "sqrt" }, + { 0x0E8, "squared" }, + { 0x0E9, "clamp" }, + { 0x0EA, "angleclamp" }, + { 0x0EB, "angleclamp180" }, + { 0x0EC, "vectorfromlinetopoint" }, + { 0x0ED, "pointonsegmentnearesttopoint" }, + { 0x0EE, "distance" }, + { 0x0EF, "distance2d" }, + { 0x0F0, "distancesquared" }, + { 0x0F1, "length" }, + { 0x0F2, "length2d" }, + { 0x0F3, "lengthsquared" }, + { 0x0F4, "length2dsquared" }, + { 0x0F5, "closer" }, + { 0x0F6, "vectordot" }, + { 0x0F7, "vectorcross" }, + { 0x0F8, "axistoangles" }, + { 0x0F9, "visionsetthermal" }, + { 0x0FA, "visionsetpain" }, + { 0x0FB, "endlobby" }, + { 0x0FC, "setac130ambience" }, + { 0x0FD, "getmapcustom" }, + { 0x0FE, "spawnsighttrace" }, + { 0x0FF, "incrementcounter" }, + { 0x100, "getcountertotal" }, + { 0x101, "getlevelticks" }, + { 0x102, "perlinnoise2d" }, + { 0x103, "calcrockingangles" }, + { 0x104, "reconevent" }, + { 0x105, "reconspatialevent" }, + { 0x106, "setsunflareposition" }, + { 0x107, "createthreatbiasgroup" }, + { 0x108, "threatbiasgroupexists" }, + { 0x109, "getthreatbias" }, + { 0x10A, "setthreatbias" }, + { 0x10B, "setthreatbiasagainstall" }, + { 0x10C, "setignoremegroup" }, + { 0x10D, "isenemyteam" }, + { 0x10E, "objective_additionalentity" }, + { 0x10F, "objective_state_nomessage" }, + { 0x110, "objective_string" }, + { 0x111, "objective_string_nomessage" }, + { 0x112, "objective_additionalposition" }, + { 0x113, "objective_current_nomessage" }, + { 0x114, "vectornormalize" }, + { 0x115, "vectortoangles" }, + { 0x116, "vectortoyaw" }, + { 0x117, "vectorlerp" }, + { 0x118, "anglestoup" }, + { 0x119, "anglestoright" }, + { 0x11A, "anglestoforward" }, + { 0x11B, "anglesdelta" }, + { 0x11C, "combineangles" }, + { 0x11D, "transformmove" }, + { 0x11E, "rotatevector" }, + { 0x11F, "rotatepointaroundvector" }, + { 0x120, "issubstr" }, + { 0x121, "isendstr" }, + { 0x122, "getsubstr" }, + { 0x123, "tolower" }, + { 0x124, "strtok" }, + { 0x125, "stricmp" }, + { 0x126, "ambientplay" }, + { 0x127, "getuavstrengthmax" }, + { 0x128, "getuavstrengthlevelneutral" }, + { 0x129, "getuavstrengthlevelshowenemyfastsweep" }, + { 0x12A, "getuavstrengthlevelshowenemydirectional" }, + { 0x12B, "blockteamradar" }, + { 0x12C, "unblockteamradar" }, + { 0x12D, "isteamradarblocked" }, + { 0x12E, "getassignedteam" }, + { 0x12F, "setmatchdata" }, + { 0x130, "getmatchdata" }, + { 0x131, "sendmatchdata" }, + { 0x132, "clearmatchdata" }, + { 0x133, "setmatchdatadef" }, + { 0x134, "setmatchclientip" }, + { 0x135, "setmatchdataid" }, + { 0x136, "setclientmatchdata" }, + { 0x137, "getclientmatchdata" }, + { 0x138, "setclientmatchdatadef" }, + { 0x139, "sendclientmatchdata" }, + { 0x13A, "getbuildversion" }, + { 0x13B, "getbuildnumber" }, + { 0x13C, "getsystemtime" }, + { 0x13D, "getmatchrulesdata" }, + { 0x13E, "isusingmatchrulesdata" }, + { 0x13F, "kick" }, + { 0x140, "issplitscreen" }, + { 0x141, "setmapcenter" }, + { 0x142, "setgameendtime" }, + { 0x143, "visionsetnaked" }, + { 0x144, "visionsetnight" }, + { 0x145, "visionsetmissilecam" }, + { 0x146, "ambientstop" }, + { 0x147, "precachemodel" }, + { 0x148, "precacheshellshock" }, + { 0x149, "precacheitem" }, + { 0x14A, "precacheshader" }, + { 0x14B, "precachestring" }, + { 0x14C, "precachemenu" }, + { 0x14D, "precacherumble" }, + { 0x14E, "precachelocationselector" }, + { 0x14F, "precacheleaderboards" }, + { 0x150, "loadfx" }, + { 0x151, "playfx" }, + { 0x152, "playfxontag" }, + { 0x153, "stopfxontag" }, + { 0x154, "killfxontag" }, + { 0x155, "playloopedfx" }, + { 0x156, "spawnfx" }, + { 0x157, "triggerfx" }, + { 0x158, "playfxontagforclients" }, + { 0x159, "setfxkillondelete" }, + { 0x15A, "playimpactheadfatalfx" }, + { 0x15B, "setwinningteam" }, + { 0x15C, "announcement" }, + { 0x15D, "clientannouncement" }, + { 0x15E, "setteammode" }, + { 0x15F, "getteamscore" }, + { 0x160, "setteamscore" }, + { 0x161, "setclientnamemode" }, + { 0x162, "updateclientnames" }, + { 0x163, "getteamplayersalive" }, + { 0x164, "logprint" }, + { 0x165, "worldentnumber" }, + { 0x166, "obituary" }, + { 0x167, "positionwouldtelefrag" }, + { 0x168, "canspawn" }, + { 0x169, "getstarttime" }, + { 0x16A, "precacheheadicon" }, + { 0x16B, "precacheminimapicon" }, + { 0x16C, "precachempanim" }, + { 0x16D, "map_restart" }, + { 0x16E, "exitlevel" }, + { 0x16F, "addtestclient" }, + { 0x170, "addagent" }, + { 0x171, "setarchive" }, + { 0x172, "allclientsprint" }, + { 0x173, "clientprint" }, + { 0x174, "mapexists" }, + { 0x175, "isvalidgametype" }, + { 0x176, "matchend" }, + { 0x177, "setplayerteamrank" }, + { 0x178, "endparty" }, + { 0x179, "setteamradar" }, + { 0x17A, "getteamradar" }, + { 0x17B, "setteamradarstrength" }, + { 0x17C, "getteamradarstrength" }, + { 0x17D, "getuavstrengthmin" }, + { 0x17E, "physicsexplosionsphere" }, + { 0x17F, "physicsexplosioncylinder" }, + { 0x180, "physicsjolt" }, + { 0x181, "physicsjitter" }, + { 0x182, "setexpfog" }, + { 0x183, "setexpfogext" }, + { 0x184, "setexpfogdvarsonly" }, + { 0x185, "setexpfogextdvarsonly" }, + { 0x186, "setatmosfog" }, + { 0x187, "setatmosfogdvarsonly" }, + { 0x188, "isexplosivedamagemod" }, + { 0x189, "radiusdamage" }, + { 0x18A, "setplayerignoreradiusdamage" }, + { 0x18B, "glassradiusdamage" }, + { 0x18C, "earthquake" }, + { 0x18D, "getnumparts" }, + { 0x18E, "objective_onentity" }, + { 0x18F, "objective_onentitywithrotation" }, + { 0x190, "objective_team" }, + { 0x191, "objective_player" }, + { 0x192, "objective_playerteam" }, + { 0x193, "objective_playerenemyteam" }, + { 0x194, "objective_playermask_hidefromall" }, + { 0x195, "objective_playermask_hidefrom" }, + { 0x196, "objective_playermask_showtoall" }, + { 0x197, "objective_playermask_showto" }, + { 0x198, "iprintln" }, + { 0x199, "iprintlnbold" }, + { 0x19A, "logstring" }, + { 0x19B, "getent" }, + { 0x19C, "getentarray" }, + { 0x19D, "getspawnarray" }, + { 0x19E, "spawnplane" }, + { 0x19F, "spawnstruct" }, + { 0x1A0, "spawnhelicopter" }, + { 0x1A1, "isalive" }, + { 0x1A2, "isspawner" }, + { 0x1A3, "missile_createattractorent" }, + { 0x1A4, "missile_createattractororigin" }, + { 0x1A5, "missile_createrepulsorent" }, + { 0x1A6, "missile_createrepulsororigin" }, + { 0x1A7, "missile_deleteattractor" }, + { 0x1A8, "playsoundatpos" }, + { 0x1A9, "newhudelem" }, + { 0x1AA, "newclienthudelem" }, + { 0x1AB, "newteamhudelem" }, + { 0x1AC, "resettimeout" }, + { 0x1AD, "isplayer" }, + { 0x1AE, "isplayernumber" }, + { 0x1AF, "getpartname" }, + { 0x1B0, "weaponfiretime" }, + { 0x1B1, "weaponclipsize" }, + { 0x1B2, "weaponisauto" }, + { 0x1B3, "weaponissemiauto" }, + { 0x1B4, "weaponisboltaction" }, + { 0x1B5, "weaponinheritsperks" }, + { 0x1B6, "weaponburstcount" }, + { 0x1B7, "weapontype" }, + { 0x1B8, "weaponclass" }, + { 0x1B9, "getnextarraykey" }, + { 0x1BA, "sortbydistance" }, + { 0x1BB, "tablelookup" }, + { 0x1BC, "tablelookupbyrow" }, + { 0x1BD, "tablelookupistring" }, + { 0x1BE, "tablelookupistringbyrow" }, + { 0x1BF, "tablelookuprownum" }, + { 0x1C0, "tableexists" }, + { 0x1C1, "getmissileowner" }, + { 0x1C2, "magicbullet" }, + { 0x1C3, "getweaponflashtagname" }, + { 0x1C4, "averagepoint" }, + { 0x1C5, "averagenormal" }, + { 0x1C6, "vehicle_getspawnerarray" }, + { 0x1C7, "playrumbleonposition" }, + { 0x1C8, "playrumblelooponposition" }, + { 0x1C9, "stopallrumbles" }, + { 0x1CA, "soundexists" }, + { 0x1CB, "openfile" }, + { 0x1CC, "closefile" }, + { 0x1CD, "fprintln" }, + { 0x1CE, "fprintfields" }, + { 0x1CF, "freadln" }, + { 0x1D0, "fgetarg" }, + { 0x1D1, "setminimap" }, + { 0x1D2, "setthermalbodymaterial" }, + { 0x1D3, "getarraykeys" }, + { 0x1D4, "getfirstarraykey" }, + { 0x1D5, "getglass" }, + { 0x1D6, "getglassarray" }, + { 0x1D7, "getglassorigin" }, + { 0x1D8, "isglassdestroyed" }, + { 0x1D9, "destroyglass" }, + { 0x1DA, "deleteglass" }, + { 0x1DB, "getentchannelscount" }, + { 0x1DC, "getentchannelname" }, + { 0x1DD, "objective_add" }, + { 0x1DE, "objective_delete" }, + { 0x1DF, "objective_state" }, + { 0x1E0, "objective_icon" }, + { 0x1E1, "objective_indentlevel" }, + { 0x1E2, "objective_position" }, + { 0x1E3, "objective_current" }, + { 0x1E4, "weaponinventorytype" }, + { 0x1E5, "weaponstartammo" }, + { 0x1E6, "weaponmaxammo" }, + { 0x1E7, "weaponaltweaponname" }, + { 0x1E8, "isweaponcliponly" }, + { 0x1E9, "isweapondetonationtimed" }, + { 0x1EA, "isweaponmanuallydetonatedbyemptythrow" }, + { 0x1EB, "weaponhasthermalscope" }, + { 0x1EC, "getvehiclenode" }, + { 0x1ED, "getvehiclenodearray" }, + { 0x1EE, "getallvehiclenodes" }, + { 0x1EF, "getnumvehicles" }, + { 0x1F0, "precachevehicle" }, + { 0x1F1, "spawnvehicle" }, + { 0x1F2, "vehicle_getarray" }, + { 0x1F3, "pow" }, + { 0x1F4, "atan2" }, + { 0x1F5, "botgetmemoryevents" }, + { 0x1F6, "botautoconnectenabled" }, + { 0x1F7, "botzonegetcount" }, + { 0x1F8, "botzonesetteam" }, + { 0x1F9, "botzonenearestcount" }, + { 0x1FA, "botmemoryflags" }, + { 0x1FB, "botflagmemoryevents" }, + { 0x1FC, "botzonegetindoorpercent" }, + { 0x1FD, "botsentientswap" }, + { 0x1FE, "isbot" }, + { 0x1FF, "isagent" }, + { 0x200, "getmaxagents" }, + { 0x201, "botdebugdrawtrigger" }, + { 0x202, "botgetclosestnavigablepoint" }, + { 0x203, "getnodesintrigger" }, + { 0x204, "nodesvisible" }, + { 0x205, "getnodesonpath" }, + { 0x206, "getzonecount" }, + { 0x207, "getzonenearest" }, + { 0x208, "getzonenodes" }, + { 0x209, "getzonepath" }, + { 0x20A, "getzoneorigin" }, + { 0x20B, "getnodezone" }, + { 0x20C, "getzonenodesbydist" }, + { 0x20D, "getzonenodeforindex" }, + { 0x20E, "getweaponexplosionradius" }, + { 0x20F, "markdangerousnodes" }, + { 0x210, "markdangerousnodesintrigger" }, + { 0x211, "nodeexposedtosky" }, + { 0x212, "findentrances" }, + { 0x213, "badplace_global" }, + { 0x214, "getpathdist" }, + { 0x215, "getlinkednodes" }, + { 0x216, "disconnectnodepair" }, + { 0x217, "connectnodepair" }, + { 0x218, "gettimesincelastpaused" }, + { 0x219, "precachefxontag" }, + { 0x21A, "precachetag" }, + { 0x21B, "precachesound" }, + { 0x21C, "devsetminimapdvarsettings" }, + { 0x21D, "loadtransient" }, + { 0x21E, "unloadtransient" }, + { 0x21F, "unloadalltransients" }, + { 0x220, "synctransients" }, + { 0x221, "aretransientsbusy" }, + { 0x222, "istransientqueued" }, + { 0x223, "istransientloaded" }, + { 0x224, "loadstartpointtransient" }, + { 0x225, "distance2dsquared" }, + { 0x226, "getangledelta3d" }, + { 0x227, "activateclientexploder" }, + { 0x228, "trajectorycalculateinitialvelocity" }, + { 0x229, "trajectorycalculateminimumvelocity" }, + { 0x22A, "trajectorycalculateexitangle" }, + { 0x22B, "trajectoryestimatedesiredinairtime" }, + { 0x22C, "trajectorycomputedeltaheightattime" }, + { 0x22D, "trajectorycanattemptaccuratejump" }, + { 0x22E, "adddebugcommand" }, + { 0x22F, "ispointinvolume" }, + { 0x230, "cinematicgettimeinmsec" }, + { 0x231, "cinematicgetframe" }, + { 0x232, "iscinematicloaded" }, + { 0x233, "bbprint" }, + { 0x234, "getenemysquaddata" }, + { 0x235, "lookupsoundlength" }, + { 0x236, "getscriptablearray" }, + { 0x237, "clearfog" }, + { 0x238, "setleveldopplerpreset" }, + { 0x239, "screenshake" }, + { 0x23A, "isusinghdr" }, + { 0x23B, "isusingssao" }, + { 0x23C, "grantloot" }, + { 0x23D, "playerphysicstraceinfo" }, + { 0x23E, "_func_23E" }, + { 0x23F, "getminchargetime" }, + { 0x240, "getchargetimepershot" }, + { 0x241, "getmaxchargeshots" }, + { 0x242, "weaponischargeable" }, + { 0x243, "weaponusesheat" }, + { 0x244, "lootserviceonendgame" }, + { 0x245, "luinotifyevent" }, + { 0x246, "lootserviceonstartgame" }, + { 0x247, "tournamentreportplayerspm" }, + { 0x248, "tournamentreportwinningteam" }, + { 0x249, "tournamentreportendofgame" }, + { 0x24A, "wakeupphysicssphere" }, + { 0x24B, "wakeupragdollsphere" }, + { 0x24C, "dopplerpitch" }, + { 0x24D, "piecewiselinearlookup" }, + { 0x24E, "anglestoaxis" }, + { 0x24F, "visionsetwater" }, + { 0x250, "sendscriptusageanalysisdata" }, + { 0x251, "resetscriptusageanalysisdata" }, + { 0x252, "instantlylogusageanalysisdata" }, + { 0x253, "invertangles" }, + { 0x254, "rotatevectorinverted" }, + { 0x255, "calculatestartorientation" }, + { 0x256, "droptoground" }, + { 0x257, "setdemigodmode" }, + { 0x258, "precachelaser" }, + { 0x259, "_func_259" }, + { 0x25A, "getcsplinecount" }, + { 0x25B, "getcsplinepointcount" }, + { 0x25C, "getcsplinelength" }, + { 0x25D, "getcsplinepointid" }, + { 0x25E, "getcsplinepointlabel" }, + { 0x25F, "getcsplinepointtension" }, + { 0x260, "getcsplinepointposition" }, + { 0x261, "getcsplinepointcorridordims" }, + { 0x262, "getcsplinepointtangent" }, + { 0x263, "getcsplinepointdisttonextpoint" }, + { 0x264, "calccsplineposition" }, + { 0x265, "calccsplinetangent" }, + { 0x266, "calccsplinecorridor" }, + { 0x267, "setnojipscore" }, + { 0x268, "setnojiptime" }, + { 0x269, "getpredictedentityposition" }, + { 0x26A, "gamedvrprohibitrecording" }, + { 0x26B, "gamedvrstartrecording" }, + { 0x26C, "gamedvrstoprecording" }, + { 0x26D, "gamedvrsetvideometadata" }, + { 0x26E, "gamedvrprohibitscreenshots" }, + { 0x26F, "gamedvrsetscreenshotmetadata" }, + { 0x270, "queuedialog" }, + { 0x271, "speechenablegrammar" }, + { 0x272, "speechenable" }, + { 0x273, "livestreamingenable" }, + { 0x274, "livestreamingsetbitrate" }, + { 0x275, "livestreamingsetmetadata" }, + { 0x276, "livestreamingenablearchiving" }, + { 0x277, "triggerportableradarping" }, + { 0x278, "setglaregrimematerial" }, + { 0x279, "botgetteamlimit" }, + { 0x27A, "spawnfxforclient" }, + { 0x27B, "botgetteamdifficulty" }, + { 0x27C, "debugstar" }, + { 0x27D, "newdebughudelem" }, + { 0x27E, "printlightsetsettings" }, + { 0x27F, "lightsetdumpstate" }, + { 0x280, "getsquadassaultelo" }, + { 0x281, "loadluifile" }, + { 0x282, "isdedicatedserver" }, + { 0x283, "getplaylistversion" }, + { 0x284, "getplaylistid" }, + { 0x285, "getactiveclientcount" }, + { 0x286, "issquadsmode" }, + { 0x287, "getsquadassaultsquadindex" }, + { 0x288, "visionsetpostapply" }, + { 0x289, "addbot" }, + { 0x28A, "ishairrunning" }, + { 0x28B, "getnearbyarrayelements" }, + { 0x28C, "vectorclamp" }, + { 0x28D, "isalliedsentient" }, + { 0x28E, "istestclient" }, + { 0x28F, "getrandomnodedestination" }, + { 0x290, "debuglocalizestring" }, + { 0x291, "enablesoundcontextoverride" }, + { 0x292, "disablesoundcontextoverride" }, + { 0x293, "notifyoncommandremove" }, + { 0x294, "getsndaliasvalue" }, + { 0x295, "setsndaliasvalue" }, + { 0x296, "packedtablelookup" }, + { 0x297, "packedtablesectionlookup" }, + { 0x298, "packedtablelookupwithrange" }, + { 0x299, "grappletrace" }, + { 0x29A, "stopclientexploder" }, + { 0x29B, "closestpointstwosegs" }, + { 0x29C, "isremovedentity" }, + { 0x29D, "tablegetrowcount" }, + { 0x29E, "tablegetcolumncount" }, + { 0x29F, "batteryusepershot" }, + { 0x2A0, "batteryreqtouse" }, + { 0x2A1, "isweaponmanuallydetonatedbydoubletap" }, + { 0x2A2, "grapplegetmagnets" }, + { 0x2A3, "getweaponname" }, + { 0x2A4, "activatepersistentclientexploder" }, + { 0x2A5, "deployriotshield" }, + { 0x2A6, "validatecostume" }, + { 0x2A7, "randomcostume" }, + { 0x2A8, "shootblank" }, + { 0x2A9, "boidflockupdate" }, + { 0x2AA, "debuggetanimname" }, + { 0x2AB, "setspmatchdata" }, + { 0x2AC, "getspmatchdata" }, + { 0x2AD, "sendspmatchdata" }, + { 0x2AE, "clearspmatchdata" }, + { 0x2AF, "setspmatchdatadef" }, + { 0x2B0, "playcinematicforall" }, + { 0x2B1, "preloadcinematicforall" }, + { 0x2B2, "stopcinematicforall" }, + { 0x2B3, "capsuletracepassed" }, + { 0x2B4, "stopfxontagforclient" }, + { 0x2B5, "killfxontagforclient" }, + { 0x2B6, "isvector" }, + { 0x2B7, "notifychallengecomplete" }, + { 0x2B8, "lootservicestarttrackingplaytime" }, + { 0x2B9, "lootservicestoptrackingplaytime" }, + { 0x2BA, "lootservicevalidateplaytime" }, + { 0x2BB, "recordbreadcrumbdataforplayer" }, + { 0x2BC, "getweaponandattachmentmodels" }, + { 0x2BD, "changewhizbyautosimparams" }, + { 0x2BE, "sysprint" }, + { 0x2BF, "objective_mlgspectator" }, + { 0x2C0, "setspcheckpointdata" }, + { 0x2C1, "getspcheckpointdata" }, + { 0x2C2, "isnumber" }, + { 0x2C3, "isonlinegame" }, + { 0x2C4, "issystemlink" }, + { 0x2C5, "setsoundmasteringfadetime" }, + { 0x2C6, "getstanceandmotionstateforplayer" }, + { 0x2C7, "nodeisnotusable" }, + { 0x2C8, "nodesetnotusable" }, + { 0x2C9, "spawnlinkedfx" }, + { 0x2CA, "spawnlinkedfxforclient" }, + { 0x2CB, "getplaylistname" }, + { 0x2CC, "getlocaltimestring" }, + { 0x2CD, "isonwifi" }, + { 0x2CE, "getbuttonsconfig" }, + { 0x2CF, "getchallengeid" }, + { 0x2D0, "nodehasremotemissileset" }, + { 0x2D1, "nodegetremotemissilename" }, + { 0x2D2, "remotemissileenttracetooriginpassed" }, + { 0x2D3, "bombingruntracepassed" }, + { 0x2D4, "soundsettraceflags" }, + { 0x2D5, "handlepickupdeployedriotshield" }, + { 0x2D6, "getcodanywherecurrentplatform" }, + { 0x2D7, "getcostumefromtable" }, + { 0x2D8, "visionsetoverdrive" }, + { 0x2D9, "nodegetsplitgroup" }, + { 0x2DA, "recordbreadcrumbdataforplayersp" }, + { 0x2DB, "getchallengerewarditem" }, + { 0x2DC, "setentplayerxuidforemblem" }, + { 0x2DD, "resetentplayerxuidforemblems" }, + { 0x2DE, "nodesetremotemissilename" }, + { 0x2DF, "isshipbuild" }, + { 0x2E0, "strinsertnumericdelimiters" }, + { 0x2E1, "isscriptedagent" }, + { 0x2E2, "playfxonweapon" }, + { 0x2E3, "stopfxonweapon" }, + { 0x2E4, "killfxonweapon" }, + { 0x2E5, "getdefaultmaxfaceenemydistance" }, + { 0x2E6, "applyaccelerationonentity" }, + { 0x2E7, "applyimpulseonentity" }, + { 0x2E8, "setshaderconstant" }, + { 0x2E9, "getinventoryitemtype" }, + { 0x2EA, "getweaponmodelbounds" }, + { 0x2EB, "weaponitemplayidleanim" }, + { 0x2EC, "_func_2EC" }, + { 0x2ED, "getstaticmodelcount" }, + { 0x2EE, "getstaticmodelname" }, + { 0x2EF, "getstaticmodelbounds" }, + { 0x2F0, "findstaticmodelindex" }, + { 0x2F1, "getdynentcount" }, + { 0x2F2, "getdynentmodelname" }, + { 0x2F3, "getdynentmodelbounds" }, + { 0x2F4, "finddynentwithmodelindex" }, + { 0x2F5, "getentitymodelname" }, + { 0x2F6, "getentitymodelbounds" }, + { 0x2F7, "findentitywithmodelindex" }, + { 0x2F8, "_func_2F8" }, + { 0x2F9, "_func_2F9" }, + { 0x2FA, "_func_2FA" }, + { 0x2FB, "_func_2FB" }, + { 0x2FC, "_func_2FC" }, + { 0x2FD, "_func_2FD" }, + { 0x2FE, "_func_2FE" }, + { 0x2FF, "_func_2FF" }, + { 0x300, "_func_300" }, + { 0x301, "_func_301" }, + { 0x302, "_func_302" }, + { 0x303, "_func_303" }, + { 0x304, "_func_304" }, + { 0x305, "_func_305" }, + { 0x306, "_func_306" }, + { 0x307, "_func_307" }, + { 0x308, "_func_308" }, + { 0x309, "_func_309" }, + { 0x30A, "_func_30A" }, +}}; + +} // namespace xsk::gsc::h1 diff --git a/src/h1/h1_meth.cpp b/src/h1/h1_meth.cpp new file mode 100644 index 00000000..fcb2e2cc --- /dev/null +++ b/src/h1/h1_meth.cpp @@ -0,0 +1,1430 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "h1.hpp" + +namespace xsk::gsc::h1 +{ + +extern std::array, meth_count> const meth_list +{{ + { 0x8000, "thermaldrawdisable" }, + { 0x8001, "setturretdismountorg" }, + { 0x8002, "setdamagestage" }, + { 0x8003, "playsoundtoteam" }, + { 0x8004, "playsoundtoplayer" }, + { 0x8005, "playerhide" }, + { 0x8006, "playershow" }, + { 0x8007, "showtoplayer" }, + { 0x8008, "threatdetectedtoplayer" }, + { 0x8009, "clearthreatdetected" }, + { 0x800A, "enableplayeruse" }, + { 0x800B, "disableplayeruse" }, + { 0x800C, "enableammogeneration" }, + { 0x800D, "disableammogeneration" }, + { 0x800E, "makescrambler" }, + { 0x800F, "makeportableradar" }, + { 0x8010, "clearscrambler" }, + { 0x8011, "clearportableradar" }, + { 0x8012, "placespawnpoint" }, + { 0x8013, "setteamfortrigger" }, + { 0x8014, "clientclaimtrigger" }, + { 0x8015, "clientreleasetrigger" }, + { 0x8016, "releaseclaimedtrigger" }, + { 0x8017, "isusingonlinedataoffline" }, + { 0x8018, "getrestedtime" }, + { 0x8019, "sendleaderboards" }, + { 0x801A, "isonladder" }, + { 0x801B, "getcorpseanim" }, + { 0x801C, "playerforcedeathanim" }, + { 0x801D, "attach" }, + { 0x801E, "getlightfovinner" }, + { 0x801F, "getlightfovouter" }, + { 0x8020, "setlightfovrange" }, + { 0x8021, "getlightexponent" }, + { 0x8022, "setlightexponent" }, + { 0x8023, "startragdoll" }, + { 0x8024, "startragdollfromimpact" }, + { 0x8025, "queryshouldearlyragdoll" }, + { 0x8026, "logstring" }, + { 0x8027, "laserhidefromclient" }, + { 0x8028, "stopsounddspbus" }, + { 0x8029, "thermaldrawenable" }, + { 0x802A, "detach" }, + { 0x802B, "detachall" }, + { 0x802C, "getattachsize" }, + { 0x802D, "getattachmodelname" }, + { 0x802E, "getattachtagname" }, + { 0x802F, "setturretcanaidetach" }, + { 0x8030, "setturretfov" }, + { 0x8031, "setplayerturretfov" }, + { 0x8032, "lerpfov" }, + { 0x8033, "lerpfovscale" }, + { 0x8034, "getvalidcoverpeekouts" }, + { 0x8035, "gethighestnodestance" }, + { 0x8036, "doesnodeallowstance" }, + { 0x8037, "doesnodeforcecombat" }, + { 0x8038, "getgunangles" }, + { 0x8039, "magicgrenade" }, + { 0x803A, "magicgrenademanual" }, + { 0x803B, "getentnum" }, + { 0x803C, "launch" }, + { 0x803D, "setsoundblend" }, + { 0x803E, "makefakeai" }, + { 0x803F, "spawndrone" }, + { 0x8040, "setcorpseremovetimer" }, + { 0x8041, "setlookattext" }, + { 0x8042, "setspawnerteam" }, + { 0x8043, "addaieventlistener" }, + { 0x8044, "removeaieventlistener" }, + { 0x8045, "getlightcolor" }, + { 0x8046, "setlightcolor" }, + { 0x8047, "getlightradius" }, + { 0x8048, "setlightradius" }, + { 0x8049, "getattachignorecollision" }, + { 0x804A, "hidepart" }, + { 0x804B, "hidepart_allinstances" }, + { 0x804C, "hideallparts" }, + { 0x804D, "showpart" }, + { 0x804E, "showallparts" }, + { 0x804F, "linkto" }, + { 0x8050, "linktoblendtotag" }, + { 0x8051, "unlink" }, + { 0x8052, "setnormalhealth" }, + { 0x8053, "dodamage" }, + { 0x8054, "kill" }, + { 0x8055, "show" }, + { 0x8056, "hide" }, + { 0x8057, "showonclient" }, + { 0x8058, "hideonclient" }, + { 0x8059, "disconnectpaths" }, + { 0x805A, "connectpaths" }, + { 0x805B, "disconnectnode" }, + { 0x805C, "connectnode" }, + { 0x805D, "startusingheroonlylighting" }, + { 0x805E, "stopusingheroonlylighting" }, + { 0x805F, "startusinglessfrequentlighting" }, + { 0x8060, "stopusinglessfrequentlighting" }, + { 0x8061, "setmovingplatformplayerturnrate" }, + { 0x8062, "setthermalfog" }, + { 0x8063, "setnightvisionfog" }, + { 0x8064, "clearthermalfog" }, + { 0x8065, "clearnightvisionfog" }, + { 0x8066, "digitaldistortsetparams" }, + { 0x8067, "setmode" }, + { 0x8068, "getmode" }, + { 0x8069, "setturretignoregoals" }, + { 0x806A, "islinked" }, + { 0x806B, "enablelinkto" }, + { 0x806C, "playsoundatviewheight" }, + { 0x806D, "prefetchsound" }, + { 0x806E, "setpitch" }, + { 0x806F, "scalepitch" }, + { 0x8070, "setvolume" }, + { 0x8071, "scalevolume" }, + { 0x8072, "enableportalgroup" }, + { 0x8073, "setspeakermapmonotostereo" }, + { 0x8074, "setspeakermapmonoto51" }, + { 0x8075, "setdistributed2dsound" }, + { 0x8076, "playsoundasmaster" }, + { 0x8077, "playloopsound" }, + { 0x8078, "eqon" }, + { 0x8079, "eqoff" }, + { 0x807A, "haseq" }, + { 0x807B, "iswaitingonsound" }, + { 0x807C, "playfoley" }, + { 0x807D, "getnormalhealth" }, + { 0x807E, "playerlinkto" }, + { 0x807F, "playerlinktodelta" }, + { 0x8080, "playerlinkweaponviewtodelta" }, + { 0x8081, "playerlinktoabsolute" }, + { 0x8082, "playerlinktoblend" }, + { 0x8083, "playerlinkedoffsetenable" }, + { 0x8084, "setwaypointedgestyle_secondaryarrow" }, + { 0x8085, "setwaypointiconoffscreenonly" }, + { 0x8086, "fadeovertime" }, + { 0x8087, "scaleovertime" }, + { 0x8088, "moveovertime" }, + { 0x8089, "reset" }, + { 0x808A, "destroy" }, + { 0x808B, "setpulsefx" }, + { 0x808C, "setplayernamestring" }, + { 0x808D, "changefontscaleovertime" }, + { 0x808E, "startignoringspotlight" }, + { 0x808F, "stopignoringspotlight" }, + { 0x8090, "dontcastshadows" }, + { 0x8091, "castshadows" }, + { 0x8092, "setstablemissile" }, + { 0x8093, "playersetgroundreferenceent" }, + { 0x8094, "dontinterpolate" }, + { 0x8095, "dospawn" }, + { 0x8096, "stalingradspawn" }, + { 0x8097, "getorigin" }, + { 0x8098, "getcentroid" }, + { 0x8099, "getshootatpos" }, + { 0x809A, "getdebugeye" }, + { 0x809B, "useby" }, + { 0x809C, "playsound" }, + { 0x809D, "playsoundevent" }, + { 0x809E, "getsoundeventplayingonentity" }, + { 0x809F, "setsoundeventparameter" }, + { 0x80A0, "stopsoundevent" }, + { 0x80A1, "playerlinkedoffsetdisable" }, + { 0x80A2, "playerlinkedsetviewznear" }, + { 0x80A3, "playerlinkedsetusebaseangleforviewclamp" }, + { 0x80A4, "lerpviewangleclamp" }, + { 0x80A5, "setviewangleresistance" }, + { 0x80A6, "springcamenabled" }, + { 0x80A7, "springcamdisabled" }, + { 0x80A8, "linktoplayerview" }, + { 0x80A9, "unlinkfromplayerview" }, + { 0x80AA, "geteye" }, + { 0x80AB, "istouching" }, + { 0x80AC, "getistouchingentities" }, + { 0x80AD, "stoploopsound" }, + { 0x80AE, "stopsounds" }, + { 0x80AF, "playrumbleonentity" }, + { 0x80B0, "playrumblelooponentity" }, + { 0x80B1, "stoprumble" }, + { 0x80B2, "delete" }, + { 0x80B3, "setmodel" }, + { 0x80B4, "laseron" }, + { 0x80B5, "laseroff" }, + { 0x80B6, "laseraltviewon" }, + { 0x80B7, "laseraltviewoff" }, + { 0x80B8, "thermalvisionon" }, + { 0x80B9, "thermalvisionoff" }, + { 0x80BA, "thermalvisionfofoverlayon" }, + { 0x80BB, "thermalvisionfofoverlayoff" }, + { 0x80BC, "autospotoverlayon" }, + { 0x80BD, "autospotoverlayoff" }, + { 0x80BE, "seteyesonuplinkenabled" }, + { 0x80BF, "setdamagefeedback" }, + { 0x80C0, "setcontents" }, + { 0x80C1, "makeusable" }, + { 0x80C2, "makeunusable" }, + { 0x80C3, "makeglobalusable" }, + { 0x80C4, "makeglobalunusable" }, + { 0x80C5, "setwhizbyprobabilities" }, + { 0x80C6, "visionsetnakedforplayer_lerp" }, + { 0x80C7, "setwaitnode" }, + { 0x80C8, "returnplayercontrol" }, + { 0x80C9, "vehphys_starttrack" }, + { 0x80CA, "vehphys_clearautodisable" }, + { 0x80CB, "vehicleusealtblendedaudio" }, + { 0x80CC, "settext" }, + { 0x80CD, "clearalltextafterhudelem" }, + { 0x80CE, "setshader" }, + { 0x80CF, "settargetent" }, + { 0x80D0, "cleartargetent" }, + { 0x80D1, "settimer" }, + { 0x80D2, "settimerup" }, + { 0x80D3, "settimerstatic" }, + { 0x80D4, "settenthstimer" }, + { 0x80D5, "settenthstimerup" }, + { 0x80D6, "settenthstimerstatic" }, + { 0x80D7, "setclock" }, + { 0x80D8, "setclockup" }, + { 0x80D9, "setvalue" }, + { 0x80DA, "setwaypoint" }, + { 0x80DB, "setwaypointedgestyle_rotatingicon" }, + { 0x80DC, "setcursorhint" }, + { 0x80DD, "sethintstring" }, + { 0x80DE, "setsecondaryhintstring" }, + { 0x80DF, "forceusehinton" }, + { 0x80E0, "forceusehintoff" }, + { 0x80E1, "makesoft" }, + { 0x80E2, "makehard" }, + { 0x80E3, "willneverchange" }, + { 0x80E4, "startfiring" }, + { 0x80E5, "stopfiring" }, + { 0x80E6, "isfiringturret" }, + { 0x80E7, "startbarrelspin" }, + { 0x80E8, "stopbarrelspin" }, + { 0x80E9, "getbarrelspinrate" }, + { 0x80EA, "remotecontrolturret" }, + { 0x80EB, "remotecontrolturretoff" }, + { 0x80EC, "shootturret" }, + { 0x80ED, "getturretowner" }, + { 0x80EE, "enabledeathshield" }, + { 0x80EF, "nightvisiongogglesforceon" }, + { 0x80F0, "nightvisiongogglesforceoff" }, + { 0x80F1, "enableinvulnerability" }, + { 0x80F2, "disableinvulnerability" }, + { 0x80F3, "enablebreaching" }, + { 0x80F4, "disablebreaching" }, + { 0x80F5, "forceviewmodelanimation" }, + { 0x80F6, "disableturretdismount" }, + { 0x80F7, "enableturretdismount" }, + { 0x80F8, "uploadscore" }, + { 0x80F9, "uploadtime" }, + { 0x80FA, "uploadleaderboards" }, + { 0x80FB, "giveachievement" }, + { 0x80FC, "hidehud" }, + { 0x80FD, "showhud" }, + { 0x80FE, "mountvehicle" }, + { 0x80FF, "dismountvehicle" }, + { 0x8100, "enableslowaim" }, + { 0x8101, "disableslowaim" }, + { 0x8102, "usehintsinvehicle" }, + { 0x8103, "vehicleattackbuttonpressed" }, + { 0x8104, "setwhizbyoffset" }, + { 0x8105, "setsentryowner" }, + { 0x8106, "setsentrycarrier" }, + { 0x8107, "setturretminimapvisible" }, + { 0x8108, "settargetentity" }, + { 0x8109, "snaptotargetentity" }, + { 0x810A, "cleartargetentity" }, + { 0x810B, "getturrettarget" }, + { 0x810C, "setplayerspread" }, + { 0x810D, "setaispread" }, + { 0x810E, "setsuppressiontime" }, + { 0x810F, "setflaggedanimknobrestart" }, + { 0x8110, "setflaggedanimknoblimitedrestart" }, + { 0x8111, "setflaggedanimknoball" }, + { 0x8112, "setflaggedanimknoballrestart" }, + { 0x8113, "setflaggedanim" }, + { 0x8114, "setflaggedanimlimited" }, + { 0x8115, "setflaggedanimrestart" }, + { 0x8116, "setflaggedanimlimitedrestart" }, + { 0x8117, "useanimtree" }, + { 0x8118, "stopuseanimtree" }, + { 0x8119, "setanimtime" }, + { 0x811A, "allowstand" }, + { 0x811B, "allowcrouch" }, + { 0x811C, "allowprone" }, + { 0x811D, "allowlean" }, + { 0x811E, "allowswim" }, + { 0x811F, "setocclusion" }, + { 0x8120, "_meth_8120" }, + { 0x8121, "deactivateocclusion" }, + { 0x8122, "deactivateallocclusion" }, + { 0x8123, "isocclusionenabled" }, + { 0x8124, "_meth_8124" }, + { 0x8125, "_meth_8125" }, + { 0x8126, "_meth_8126" }, + { 0x8127, "_meth_8127" }, + { 0x8128, "iseqenabled" }, + { 0x8129, "seteq" }, + { 0x812A, "seteqbands" }, + { 0x812B, "deactivateeq" }, + { 0x812C, "seteqlerp" }, + { 0x812D, "islookingat" }, + { 0x812E, "isthrowinggrenade" }, + { 0x812F, "isfiring" }, + { 0x8130, "ismeleeing" }, + { 0x8131, "setautopickup" }, + { 0x8132, "allowmelee" }, + { 0x8133, "allowfire" }, + { 0x8134, "enablehealthshield" }, + { 0x8135, "setconvergencetime" }, + { 0x8136, "setconvergenceheightpercent" }, + { 0x8137, "setturretteam" }, + { 0x8138, "maketurretsolid" }, + { 0x8139, "maketurretoperable" }, + { 0x813A, "maketurretinoperable" }, + { 0x813B, "makeentitysentient" }, + { 0x813C, "freeentitysentient" }, + { 0x813D, "isindoor" }, + { 0x813E, "getdroptofloorposition" }, + { 0x813F, "isbadguy" }, + { 0x8140, "animscripted" }, + { 0x8141, "animscriptedthirdperson" }, + { 0x8142, "animrelative" }, + { 0x8143, "stopanimscripted" }, + { 0x8144, "clearanim" }, + { 0x8145, "setanimknob" }, + { 0x8146, "setanimknoblimited" }, + { 0x8147, "setanimknobrestart" }, + { 0x8148, "setanimknoblimitedrestart" }, + { 0x8149, "setanimknoball" }, + { 0x814A, "setanimknoballlimited" }, + { 0x814B, "setanimknoballrestart" }, + { 0x814C, "setanimknoballlimitedrestart" }, + { 0x814D, "setanim" }, + { 0x814E, "setanimlimited" }, + { 0x814F, "setanimrestart" }, + { 0x8150, "setanimlimitedrestart" }, + { 0x8151, "getanimtime" }, + { 0x8152, "getanimweight" }, + { 0x8153, "getanimassettype" }, + { 0x8154, "setflaggedanimknob" }, + { 0x8155, "setflaggedanimknoblimited" }, + { 0x8156, "setturretaccuracy" }, + { 0x8157, "setrightarc" }, + { 0x8158, "setleftarc" }, + { 0x8159, "settoparc" }, + { 0x815A, "setbottomarc" }, + { 0x815B, "setautorotationdelay" }, + { 0x815C, "setdefaultdroppitch" }, + { 0x815D, "restoredefaultdroppitch" }, + { 0x815E, "turretfiredisable" }, + { 0x815F, "getfixednodesafevolume" }, + { 0x8160, "clearfixednodesafevolume" }, + { 0x8161, "isingoal" }, + { 0x8162, "setruntopos" }, + { 0x8163, "nearnode" }, + { 0x8164, "nearclaimnode" }, + { 0x8165, "nearclaimnodeandangle" }, + { 0x8166, "atdangerousnode" }, + { 0x8167, "getisforcedincombat" }, + { 0x8168, "setisforcedincombat" }, + { 0x8169, "getenemyinfo" }, + { 0x816A, "clearenemy" }, + { 0x816B, "setentitytarget" }, + { 0x816C, "clearentitytarget" }, + { 0x816D, "setpotentialthreat" }, + { 0x816E, "clearpotentialthreat" }, + { 0x816F, "setflashbanged" }, + { 0x8170, "setengagementmindist" }, + { 0x8171, "setengagementmaxdist" }, + { 0x8172, "isknownenemyinradius" }, + { 0x8173, "isknownenemyinvolume" }, + { 0x8174, "settalktospecies" }, + { 0x8175, "invisiblenotsolid" }, + { 0x8176, "visiblesolid" }, + { 0x8177, "setdefaultaimlimits" }, + { 0x8178, "initriotshieldhealth" }, + { 0x8179, "getenemysqdist" }, + { 0x817A, "getclosestenemysqdist" }, + { 0x817B, "setthreatbiasgroup" }, + { 0x817C, "getthreatbiasgroup" }, + { 0x817D, "turretfireenable" }, + { 0x817E, "setturretmodechangewait" }, + { 0x817F, "usetriggerrequirelookat" }, + { 0x8180, "getstance" }, + { 0x8181, "setstance" }, + { 0x8182, "itemweaponsetammo" }, + { 0x8183, "getammocount" }, + { 0x8184, "gettagorigin" }, + { 0x8185, "gettagangles" }, + { 0x8186, "shellshock" }, + { 0x8187, "stunplayer" }, + { 0x8188, "stopshellshock" }, + { 0x8189, "fadeoutshellshock" }, + { 0x818A, "setdepthoffield" }, + { 0x818B, "setviewmodeldepthoffield" }, + { 0x818C, "setmotionblurmovescale" }, + { 0x818D, "pickupgrenade" }, + { 0x818E, "useturret" }, + { 0x818F, "stopuseturret" }, + { 0x8190, "canuseturret" }, + { 0x8191, "traversemode" }, + { 0x8192, "animmode" }, + { 0x8193, "orientmode" }, + { 0x8194, "getmotionangle" }, + { 0x8195, "shouldfacemotion" }, + { 0x8196, "getanglestolikelyenemypath" }, + { 0x8197, "setturretanim" }, + { 0x8198, "getturret" }, + { 0x8199, "getgroundenttype" }, + { 0x819A, "forcestartnegotiation" }, + { 0x819B, "setalienjumpcostscale" }, + { 0x819C, "setalienruncostscale" }, + { 0x819D, "setalientraversecostscale" }, + { 0x819E, "animcustom" }, + { 0x819F, "isinscriptedstate" }, + { 0x81A0, "canattackenemynode" }, + { 0x81A1, "getnegotiationstartnode" }, + { 0x81A2, "getnegotiationendnode" }, + { 0x81A3, "getnegotiationnextnode" }, + { 0x81A4, "getdoorpathnode" }, + { 0x81A5, "comparenodedirtopathdir" }, + { 0x81A6, "checkprone" }, + { 0x81A7, "pushplayer" }, + { 0x81A8, "checkgrenadethrowpos" }, + { 0x81A9, "setgoalnode" }, + { 0x81AA, "setgoalpos" }, + { 0x81AB, "setgoalentity" }, + { 0x81AC, "setgoalvolume" }, + { 0x81AD, "setgoalvolumeauto" }, + { 0x81AE, "getgoalvolume" }, + { 0x81AF, "cleargoalvolume" }, + { 0x81B0, "setfixednodesafevolume" }, + { 0x81B1, "setmotionblurturnscale" }, + { 0x81B2, "setmotionblurzoomscale" }, + { 0x81B3, "viewkick" }, + { 0x81B4, "localtoworldcoords" }, + { 0x81B5, "getentitynumber" }, + { 0x81B6, "getentityvelocity" }, + { 0x81B7, "enablegrenadetouchdamage" }, + { 0x81B8, "disablegrenadetouchdamage" }, + { 0x81B9, "enableaimassist" }, + { 0x81BA, "_meth_81BA" }, + { 0x81BB, "stoplookat" }, + { 0x81BC, "getmuzzlepos" }, + { 0x81BD, "getmuzzleangle" }, + { 0x81BE, "getmuzzlesideoffsetpos" }, + { 0x81BF, "getaimangle" }, + { 0x81C0, "canshoot" }, + { 0x81C1, "canshootenemy" }, + { 0x81C2, "cansee" }, + { 0x81C3, "seerecently" }, + { 0x81C4, "lastknowntime" }, + { 0x81C5, "lastknownpos" }, + { 0x81C6, "dropweapon" }, + { 0x81C7, "maymovetopoint" }, + { 0x81C8, "maymovefrompointtopoint" }, + { 0x81C9, "teleport" }, + { 0x81CA, "forceteleport" }, + { 0x81CB, "safeteleport" }, + { 0x81CC, "withinapproxpathdist" }, + { 0x81CD, "ispathdirect" }, + { 0x81CE, "allowedstances" }, + { 0x81CF, "isstanceallowed" }, + { 0x81D0, "issuppressionwaiting" }, + { 0x81D1, "issuppressed" }, + { 0x81D2, "ismovesuppressed" }, + { 0x81D3, "checkgrenadethrow" }, + { 0x81D4, "checkgrenadelaunch" }, + { 0x81D5, "checkgrenadelaunchpos" }, + { 0x81D6, "throwgrenade" }, + { 0x81D7, "disableaimassist" }, + { 0x81D8, "radiusdamage" }, + { 0x81D9, "detonate" }, + { 0x81DA, "damageconetrace" }, + { 0x81DB, "sightconetrace" }, + { 0x81DC, "missile_settargetent" }, + { 0x81DD, "missile_settargetpos" }, + { 0x81DE, "missile_cleartarget" }, + { 0x81DF, "missile_setflightmodedirect" }, + { 0x81E0, "missile_setflightmodetop" }, + { 0x81E1, "getlightintensity" }, + { 0x81E2, "setlightintensity" }, + { 0x81E3, "isragdoll" }, + { 0x81E4, "setmovespeedscale" }, + { 0x81E5, "cameralinkto" }, + { 0x81E6, "cameraunlink" }, + { 0x81E7, "startcoverarrival" }, + { 0x81E8, "starttraversearrival" }, + { 0x81E9, "checkcoverexitposwithpath" }, + { 0x81EA, "shoot" }, + { 0x81EB, "shootblank" }, + { 0x81EC, "melee" }, + { 0x81ED, "updateplayersightaccuracy" }, + { 0x81EE, "findshufflecovernode" }, + { 0x81EF, "findnearbycovernode" }, + { 0x81F0, "findcovernode" }, + { 0x81F1, "findbestcovernode" }, + { 0x81F2, "getcovernode" }, + { 0x81F3, "usecovernode" }, + { 0x81F4, "iscovervalidagainstenemy" }, + { 0x81F5, "reacquirestep" }, + { 0x81F6, "findreacquiredirectpath" }, + { 0x81F7, "trimpathtoattack" }, + { 0x81F8, "reacquiremove" }, + { 0x81F9, "findreacquireproximatepath" }, + { 0x81FA, "flagenemyunattackable" }, + { 0x81FB, "enterprone" }, + { 0x81FC, "exitprone" }, + { 0x81FD, "setproneanimnodes" }, + { 0x81FE, "updateprone" }, + { 0x81FF, "clearpitchorient" }, + { 0x8200, "setlookatanimnodes" }, + { 0x8201, "setlookat" }, + { 0x8202, "setlookatentity" }, + { 0x8203, "setlookatyawlimits" }, + { 0x8204, "controlslinkto" }, + { 0x8205, "controlsunlink" }, + { 0x8206, "makevehiclesolidcapsule" }, + { 0x8207, "teleportentityrelative" }, + { 0x8208, "makevehiclesolidsphere" }, + { 0x8209, "makevehiclesolid" }, + { 0x820A, "remotecontrolvehicle" }, + { 0x820B, "remotecontrolvehicleoff" }, + { 0x820C, "isfiringvehicleturret" }, + { 0x820D, "remotecontrolvehicletarget" }, + { 0x820E, "remotecontrolvehicletargetoff" }, + { 0x820F, "drivevehicleandcontrolturret" }, + { 0x8210, "drivevehicleandcontrolturretoff" }, + { 0x8211, "getplayersetting" }, + { 0x8212, "getlocalplayerprofiledata" }, + { 0x8213, "setlocalplayerprofiledata" }, + { 0x8214, "remotecamerasoundscapeon" }, + { 0x8215, "remotecamerasoundscapeoff" }, + { 0x8216, "setmotiontrackervisible" }, + { 0x8217, "getmotiontrackervisible" }, + { 0x8218, "worldpointinreticle_circle" }, + { 0x8219, "worldpointinreticle_rect" }, + { 0x821A, "getpointinbounds" }, + { 0x821B, "transfermarkstonewscriptmodel" }, + { 0x821C, "setwatersheeting" }, + { 0x821D, "addontoviewmodel" }, + { 0x821E, "clearviewmodeladdons" }, + { 0x821F, "setweaponhudiconoverride" }, + { 0x8220, "getweaponhudiconoverride" }, + { 0x8221, "setempjammed" }, + { 0x8222, "playersetexpfog" }, + { 0x8223, "playersetexpfogext" }, + { 0x8224, "playersetatmosfog" }, + { 0x8225, "isitemunlocked" }, + { 0x8226, "getplayerdata" }, + { 0x8227, "vehicleturretcontroloff" }, + { 0x8228, "isturretready" }, + { 0x8229, "vehicledriveto" }, + { 0x822A, "vehicle_dospawn" }, + { 0x822B, "vehicle_isphysveh" }, + { 0x822C, "vehphys_crash" }, + { 0x822D, "vehphys_launch" }, + { 0x822E, "vehphys_disablecrashing" }, + { 0x822F, "vehphys_enablecrashing" }, + { 0x8230, "vehphys_setspeed" }, + { 0x8231, "vehphys_setconveyorbelt" }, + { 0x8232, "freehelicopter" }, + { 0x8233, "playerlinkedturretanglesenable" }, + { 0x8234, "playerlinkedturretanglesdisable" }, + { 0x8235, "playerlinkedvehicleanglesenable" }, + { 0x8236, "playerlinkedvehicleanglesdisable" }, + { 0x8237, "playersetstreamorigin" }, + { 0x8238, "playerclearstreamorigin" }, + { 0x8239, "nightvisionviewon" }, + { 0x823A, "nightvisionviewoff" }, + { 0x823B, "painvisionon" }, + { 0x823C, "painvisionoff" }, + { 0x823D, "getplayerintelisfound" }, + { 0x823E, "setplayerintelfound" }, + { 0x823F, "newpip" }, + { 0x8240, "sethuddynlight" }, + { 0x8241, "startscriptedanim" }, + { 0x8242, "startcoverbehavior" }, + { 0x8243, "setplayerdata" }, + { 0x8244, "getcacplayerdata" }, + { 0x8245, "setcacplayerdata" }, + { 0x8246, "trackerupdate" }, + { 0x8247, "pingplayer" }, + { 0x8248, "buttonpressed" }, + { 0x8249, "sayteam" }, + { 0x824A, "sayall" }, + { 0x824B, "setspawnweapon" }, + { 0x824C, "dropitem" }, + { 0x824D, "dropscavengerbag" }, + { 0x824E, "setjitterparams" }, + { 0x824F, "sethoverparams" }, + { 0x8250, "joltbody" }, + { 0x8251, "freevehicle" }, + { 0x8252, "getwheelsurface" }, + { 0x8253, "getvehicleowner" }, + { 0x8254, "setvehiclelookattext" }, + { 0x8255, "setvehicleteam" }, + { 0x8256, "setneargoalnotifydist" }, + { 0x8257, "setvehgoalpos" }, + { 0x8258, "setgoalyaw" }, + { 0x8259, "cleargoalyaw" }, + { 0x825A, "settargetyaw" }, + { 0x825B, "cleartargetyaw" }, + { 0x825C, "vehicle_helisetai" }, + { 0x825D, "setturrettargetvec" }, + { 0x825E, "setturrettargetent" }, + { 0x825F, "clearturrettarget" }, + { 0x8260, "vehicle_canturrettargetpoint" }, + { 0x8261, "setlookatent" }, + { 0x8262, "clearlookatent" }, + { 0x8263, "setvehweapon" }, + { 0x8264, "fireweapon" }, + { 0x8265, "vehicleturretcontrolon" }, + { 0x8266, "finishplayerdamage" }, + { 0x8267, "suicide" }, + { 0x8268, "closeingamemenu" }, + { 0x8269, "iprintln" }, + { 0x826A, "iprintlnbold" }, + { 0x826B, "spawn" }, + { 0x826C, "setentertime" }, + { 0x826D, "cloneplayer" }, + { 0x826E, "istalking" }, + { 0x826F, "allowspectateteam" }, + { 0x8270, "forcespectatepov" }, + { 0x8271, "getguid" }, + { 0x8272, "physicslaunchserver" }, + { 0x8273, "physicslaunchserveritem" }, + { 0x8274, "clonebrushmodeltoscriptmodel" }, + { 0x8275, "scriptmodelplayanim" }, + { 0x8276, "scriptmodelclearanim" }, + { 0x8277, "scriptmodelplayanimdeltamotion" }, + { 0x8278, "vehicle_teleport" }, + { 0x8279, "attachpath" }, + { 0x827A, "getattachpos" }, + { 0x827B, "startpath" }, + { 0x827C, "setswitchnode" }, + { 0x827D, "setwaitspeed" }, + { 0x827E, "vehicle_finishdamage" }, + { 0x827F, "vehicle_setspeed" }, + { 0x8280, "vehicle_setspeedimmediate" }, + { 0x8281, "vehicle_rotateyaw" }, + { 0x8282, "vehicle_getspeed" }, + { 0x8283, "vehicle_getvelocity" }, + { 0x8284, "vehicle_getbodyvelocity" }, + { 0x8285, "vehicle_getsteering" }, + { 0x8286, "vehicle_getthrottle" }, + { 0x8287, "vehicle_turnengineoff" }, + { 0x8288, "vehicle_turnengineon" }, + { 0x8289, "vehicle_orientto" }, + { 0x828A, "getgoalspeedmph" }, + { 0x828B, "setacceleration" }, + { 0x828C, "setdeceleration" }, + { 0x828D, "resumespeed" }, + { 0x828E, "setyawspeed" }, + { 0x828F, "setyawspeedbyname" }, + { 0x8290, "setmaxpitchroll" }, + { 0x8291, "setairresistance" }, + { 0x8292, "setturningability" }, + { 0x8293, "getxuid" }, + { 0x8294, "getucdidhigh" }, + { 0x8295, "getucdidlow" }, + { 0x8296, "getclanidhigh" }, + { 0x8297, "getclanidlow" }, + { 0x8298, "ishost" }, + { 0x8299, "getspectatingplayer" }, + { 0x829A, "predictstreampos" }, + { 0x829B, "updatescores" }, + { 0x829C, "updatedmscores" }, + { 0x829D, "setrank" }, + { 0x829E, "setcardtitle" }, + { 0x829F, "weaponlocknoclearance" }, + { 0x82A0, "visionsyncwithplayer" }, + { 0x82A1, "showhudsplash" }, + { 0x82A2, "setperk" }, + { 0x82A3, "hasperk" }, + { 0x82A4, "clearperks" }, + { 0x82A5, "unsetperk" }, + { 0x82A6, "registerparty" }, + { 0x82A7, "getfireteammembers" }, + { 0x82A8, "noclip" }, + { 0x82A9, "ufo" }, + { 0x82AA, "moveto" }, + { 0x82AB, "movex" }, + { 0x82AC, "movey" }, + { 0x82AD, "movez" }, + { 0x82AE, "movegravity" }, + { 0x82AF, "moveslide" }, + { 0x82B0, "stopmoveslide" }, + { 0x82B1, "rotateto" }, + { 0x82B2, "rotatepitch" }, + { 0x82B3, "rotateyaw" }, + { 0x82B4, "rotateroll" }, + { 0x82B5, "addpitch" }, + { 0x82B6, "addyaw" }, + { 0x82B7, "addroll" }, + { 0x82B8, "vibrate" }, + { 0x82B9, "rotatevelocity" }, + { 0x82BA, "solid" }, + { 0x82BB, "notsolid" }, + { 0x82BC, "setcandamage" }, + { 0x82BD, "setcanradiusdamage" }, + { 0x82BE, "physicslaunchclient" }, + { 0x82BF, "setcardicon" }, + { 0x82C0, "setcardnameplate" }, + { 0x82C1, "setcarddisplayslot" }, + { 0x82C2, "kc_regweaponforfxremoval" }, + { 0x82C3, "laststandrevive" }, + { 0x82C4, "startlaststand" }, + { 0x82C5, "setspectatedefaults" }, + { 0x82C6, "getthirdpersoncrosshairoffset" }, + { 0x82C7, "disableweaponpickup" }, + { 0x82C8, "enableweaponpickup" }, + { 0x82C9, "weaponpickupenabled" }, + { 0x82CA, "issplitscreenplayer" }, + { 0x82CB, "getweaponslistoffhands" }, + { 0x82CC, "getweaponslistitems" }, + { 0x82CD, "getweaponslistexclusives" }, + { 0x82CE, "getweaponslist" }, + { 0x82CF, "canplayerplacesentry" }, + { 0x82D0, "canplayerplacetank" }, + { 0x82D1, "visionsetnakedforplayer" }, + { 0x82D2, "visionsetnightforplayer" }, + { 0x82D3, "visionsetmissilecamforplayer" }, + { 0x82D4, "visionsetthermalforplayer" }, + { 0x82D5, "visionsetpainforplayer" }, + { 0x82D6, "setblurforplayer" }, + { 0x82D7, "getplayerweaponmodel" }, + { 0x82D8, "getplayerknifemodel" }, + { 0x82D9, "updateentitywithweapons" }, + { 0x82DA, "notifyonplayercommand" }, + { 0x82DB, "canmantle" }, + { 0x82DC, "forcemantle" }, + { 0x82DD, "ismantling" }, + { 0x82DE, "playfx" }, + { 0x82DF, "player_recoilscaleon" }, + { 0x82E0, "player_recoilscaleoff" }, + { 0x82E1, "weaponlockstart" }, + { 0x82E2, "weaponlockfinalize" }, + { 0x82E3, "weaponlockfree" }, + { 0x82E4, "weaponlocktargettooclose" }, + { 0x82E5, "issplitscreenplayerprimary" }, + { 0x82E6, "markforeyeson" }, + { 0x82E7, "issighted" }, + { 0x82E8, "getsightedplayers" }, + { 0x82E9, "getplayerssightingme" }, + { 0x82EA, "getviewmodel" }, + { 0x82EB, "fragbuttonpressed" }, + { 0x82EC, "secondaryoffhandbuttonpressed" }, + { 0x82ED, "getcurrentweaponclipammo" }, + { 0x82EE, "setvelocity" }, + { 0x82EF, "getplayerviewheight" }, + { 0x82F0, "getnormalizedmovement" }, + { 0x82F1, "playlocalsound" }, + { 0x82F2, "stoplocalsound" }, + { 0x82F3, "setweaponammoclip" }, + { 0x82F4, "setweaponammostock" }, + { 0x82F5, "getweaponammoclip" }, + { 0x82F6, "getweaponammostock" }, + { 0x82F7, "anyammoforweaponmodes" }, + { 0x82F8, "setclientomnvar" }, + { 0x82F9, "setclientdvar" }, + { 0x82FA, "setclientdvars" }, + { 0x82FB, "setclientspawnsighttraces" }, + { 0x82FC, "clientspawnsighttracepassed" }, + { 0x82FD, "allowads" }, + { 0x82FE, "allowjump" }, + { 0x82FF, "allowladder" }, + { 0x8300, "allowmantle" }, + { 0x8301, "allowsprint" }, + { 0x8302, "setspreadoverride" }, + { 0x8303, "resetspreadoverride" }, + { 0x8304, "setaimspreadmovementscale" }, + { 0x8305, "setactionslot" }, + { 0x8306, "setviewkickscale" }, + { 0x8307, "getviewkickscale" }, + { 0x8308, "getweaponslistall" }, + { 0x8309, "getweaponslistprimaries" }, + { 0x830A, "getnormalizedcameramovement" }, + { 0x830B, "giveweapon" }, + { 0x830C, "takeweapon" }, + { 0x830D, "takeallweapons" }, + { 0x830E, "getcurrentweapon" }, + { 0x830F, "getcurrentprimaryweapon" }, + { 0x8310, "getcurrentoffhand" }, + { 0x8311, "hasweapon" }, + { 0x8312, "switchtoweapon" }, + { 0x8313, "switchtoweaponimmediate" }, + { 0x8314, "gethybridsightenabled" }, + { 0x8315, "switchtooffhand" }, + { 0x8316, "settacticalweapon" }, + { 0x8317, "gettacticalweapon" }, + { 0x8318, "beginlocationselection" }, + { 0x8319, "endlocationselection" }, + { 0x831A, "disableweapons" }, + { 0x831B, "enableweapons" }, + { 0x831C, "disableoffhandweapons" }, + { 0x831D, "enableoffhandweapons" }, + { 0x831E, "disableweaponswitch" }, + { 0x831F, "enableweaponswitch" }, + { 0x8320, "openpopupmenu" }, + { 0x8321, "openpopupmenunomouse" }, + { 0x8322, "closepopupmenu" }, + { 0x8323, "openmenu" }, + { 0x8324, "closemenu" }, + { 0x8325, "savematchrulestohistory" }, + { 0x8326, "freezecontrols" }, + { 0x8327, "disableusability" }, + { 0x8328, "enableusability" }, + { 0x8329, "setwhizbyspreads" }, + { 0x832A, "setwhizbyradii" }, + { 0x832B, "setreverb" }, + { 0x832C, "deactivatereverb" }, + { 0x832D, "setvolmod" }, + { 0x832E, "givestartammo" }, + { 0x832F, "givemaxammo" }, + { 0x8330, "getfractionstartammo" }, + { 0x8331, "getfractionmaxammo" }, + { 0x8332, "isdualwielding" }, + { 0x8333, "isreloading" }, + { 0x8334, "isswitchingweapon" }, + { 0x8335, "setorigin" }, + { 0x8336, "getvelocity" }, + { 0x8337, "setplayerangles" }, + { 0x8338, "getplayerangles" }, + { 0x8339, "usebuttonpressed" }, + { 0x833A, "attackbuttonpressed" }, + { 0x833B, "adsbuttonpressed" }, + { 0x833C, "meleebuttonpressed" }, + { 0x833D, "playerads" }, + { 0x833E, "isonground" }, + { 0x833F, "isusingturret" }, + { 0x8340, "setviewmodel" }, + { 0x8341, "setlethalweapon" }, + { 0x8342, "getlethalweapon" }, + { 0x8343, "enablefocus" }, + { 0x8344, "disablefocus" }, + { 0x8345, "enableaudiozoom" }, + { 0x8346, "disableaudiozoom" }, + { 0x8347, "_meth_8347" }, + { 0x8348, "startac130" }, + { 0x8349, "stopac130" }, + { 0x834A, "enablemousesteer" }, + { 0x834B, "setscriptmoverkillcam" }, + { 0x834C, "usinggamepad" }, + { 0x834D, "forcethirdpersonwhenfollowing" }, + { 0x834E, "disableforcethirdpersonwhenfollowing" }, + { 0x834F, "botsetflag" }, + { 0x8350, "botsetstance" }, + { 0x8351, "botsetscriptmove" }, + { 0x8352, "botsetscriptgoal" }, + { 0x8353, "botsetscriptgoalnode" }, + { 0x8354, "botclearscriptgoal" }, + { 0x8355, "botsetscriptenemy" }, + { 0x8356, "botclearscriptenemy" }, + { 0x8357, "botsetattacker" }, + { 0x8358, "botgetscriptgoal" }, + { 0x8359, "botgetscriptgoalradius" }, + { 0x835A, "botgetscriptgoalyaw" }, + { 0x835B, "botgetscriptgoaltype" }, + { 0x835C, "botgetentrancepoint" }, + { 0x835D, "botgetworldsize" }, + { 0x835E, "botnodeavailable" }, + { 0x835F, "botfindnoderandom" }, + { 0x8360, "botmemoryevent" }, + { 0x8361, "botmemoryselectpos" }, + { 0x8362, "botnodepick" }, + { 0x8363, "bothasscriptgoal" }, + { 0x8364, "botgetpersonality" }, + { 0x8365, "botthrowgrenade" }, + { 0x8366, "botgetmemoryevents" }, + { 0x8367, "botsetpersonality" }, + { 0x8368, "botsetdifficulty" }, + { 0x8369, "botgetdifficulty" }, + { 0x836A, "botgetworldclosestedge" }, + { 0x836B, "botlookatpoint" }, + { 0x836C, "botpredictseepoint" }, + { 0x836D, "botcanseeentity" }, + { 0x836E, "botgetnodesonpath" }, + { 0x836F, "botnodepickmultiple" }, + { 0x8370, "botgetnearestnode" }, + { 0x8371, "botgetfovdot" }, + { 0x8372, "botsetawareness" }, + { 0x8373, "botpursuingscriptgoal" }, + { 0x8374, "botgetscriptgoalnode" }, + { 0x8375, "botgetimperfectenemyinfo" }, + { 0x8376, "botflagmemoryevents" }, + { 0x8377, "botsetpathingstyle" }, + { 0x8378, "botsetdifficultysetting" }, + { 0x8379, "botgetdifficultysetting" }, + { 0x837A, "botgetpathdist" }, + { 0x837B, "botisrandomized" }, + { 0x837C, "botpressbutton" }, + { 0x837D, "botclearbutton" }, + { 0x837E, "botnodescoremultiple" }, + { 0x837F, "getnodenumber" }, + { 0x8380, "setclientowner" }, + { 0x8381, "setotherent" }, + { 0x8382, "setaisightlinevisible" }, + { 0x8383, "setentityowner" }, + { 0x8384, "nodeisdisconnected" }, + { 0x8385, "getnearestnode" }, + { 0x8386, "makeentitynomeleetarget" }, + { 0x8387, "isagent" }, + { 0x8388, "spawnagent" }, + { 0x8389, "finishagentdamage" }, + { 0x838A, "setagentattacker" }, + { 0x838B, "cloneagent" }, + { 0x838C, "agentcanseesentient" }, + { 0x838D, "scragentsetwaypoint" }, + { 0x838E, "scragentsetgoalpos" }, + { 0x838F, "scragentgetgoalpos" }, + { 0x8390, "scragentsetgoalnode" }, + { 0x8391, "scragentsetgoalentity" }, + { 0x8392, "scragentsetgoalradius" }, + { 0x8393, "scragentsetanimscale" }, + { 0x8394, "scragentsetorientmode" }, + { 0x8395, "scragentsetanimmode" }, + { 0x8396, "scragentsetphysicsmode" }, + { 0x8397, "scragentsetclipmode" }, + { 0x8398, "scragentsetmaxturnspeed" }, + { 0x8399, "scragentgetmaxturnspeed" }, + { 0x839A, "scragentbeginmelee" }, + { 0x839B, "scragentsetscripted" }, + { 0x839C, "scragentdotrajectory" }, + { 0x839D, "scragentdoanimlerp" }, + { 0x839E, "scragentsetviewheight" }, + { 0x839F, "scragentclaimnode" }, + { 0x83A0, "scragentrelinquishclaimednode" }, + { 0x83A1, "setradarping" }, + { 0x83A2, "setradarhighlight" }, + { 0x83A3, "setsonarvision" }, + { 0x83A4, "setharmonicbreach" }, + { 0x83A5, "setmaterialscriptparam" }, + { 0x83A6, "getaimassistdeltas" }, + { 0x83A7, "getaimassisttargetangles" }, + { 0x83A8, "getchargetime" }, + { 0x83A9, "overridereflectionprobe" }, + { 0x83AA, "defaultreflectionprobe" }, + { 0x83AB, "isholdinggrenade" }, + { 0x83AC, "isswitchinggrenade" }, + { 0x83AD, "ispreparinggrenade" }, + { 0x83AE, "setstencilstateoverride" }, + { 0x83AF, "clearstencilstateoverride" }, + { 0x83B0, "allowhighjump" }, + { 0x83B1, "isjumping" }, + { 0x83B2, "ishighjumping" }, + { 0x83B3, "vehicle_setvelocity" }, + { 0x83B4, "vehicle_addvelocity" }, + { 0x83B5, "getbraggingright" }, + { 0x83B6, "getmodelfromentity" }, + { 0x83B7, "getweaponheatlevel" }, + { 0x83B8, "isweaponoverheated" }, + { 0x83B9, "sprintbuttonpressed" }, + { 0x83BA, "vehicle_planethrottleoverride" }, + { 0x83BB, "vehicle_planethrottlereturncontrol" }, + { 0x83BC, "vehicle_planecrash" }, + { 0x83BD, "copyanimtreestate" }, + { 0x83BE, "lightsetforplayer" }, + { 0x83BF, "lightsetoverrideenableforplayer" }, + { 0x83C0, "lightsetoverridedisableforplayer" }, + { 0x83C1, "physicslaunchclientwithimpulse" }, + { 0x83C2, "setorcaavoidance" }, + { 0x83C3, "iswheelslipping" }, + { 0x83C4, "killnotification" }, + { 0x83C5, "setanimrate" }, + { 0x83C6, "setdoghandler" }, + { 0x83C7, "setdogcommand" }, + { 0x83C8, "setdogattackradius" }, + { 0x83C9, "isdogfollowinghandler" }, + { 0x83CA, "setdogmaxdrivespeed" }, + { 0x83CB, "isdogbeingdriven" }, + { 0x83CC, "setdogautoattackwhendriven" }, + { 0x83CD, "getdogattackbeginnode" }, + { 0x83CE, "setanimclass" }, + { 0x83CF, "enableanimstate" }, + { 0x83D0, "setanimstate" }, + { 0x83D1, "getanimentry" }, + { 0x83D2, "getanimentryname" }, + { 0x83D3, "getanimentryalias" }, + { 0x83D4, "getanimentrycount" }, + { 0x83D5, "pushplayervector" }, + { 0x83D6, "issprinting" }, + { 0x83D7, "playerlinkeduselinkedvelocity" }, + { 0x83D8, "shootstopsound" }, + { 0x83D9, "setclothtype" }, + { 0x83DA, "getclothmovesound" }, + { 0x83DB, "getequipmovesound" }, + { 0x83DC, "jumpbuttonpressed" }, + { 0x83DD, "rotateby" }, + { 0x83DE, "getlookaheaddir" }, + { 0x83DF, "getpathgoalpos" }, + { 0x83E0, "setrocketcorpse" }, + { 0x83E1, "setcorpsefalling" }, + { 0x83E2, "setsurfacetype" }, + { 0x83E3, "aiphysicstrace" }, + { 0x83E4, "aiphysicstracepassed" }, + { 0x83E5, "setdevtext" }, + { 0x83E6, "forcemovingplatformentity" }, + { 0x83E7, "setmovingplatformtrigger" }, + { 0x83E8, "visionsetstage" }, + { 0x83E9, "linkwaypointtotargetwithoffset" }, + { 0x83EA, "getlinkedparent" }, + { 0x83EB, "getmovingplatformparent" }, + { 0x83EC, "setnameplatematerial" }, + { 0x83ED, "retargetscriptmodellighting" }, + { 0x83EE, "setmantlesoundflavor" }, + { 0x83EF, "clearclienttriggeraudiozone" }, + { 0x83F0, "setclienttriggeraudiozone" }, + { 0x83F1, "makevehiclenotcollidewithplayers" }, + { 0x83F2, "getbobrate" }, + { 0x83F3, "setbobrate" }, + { 0x83F4, "setscriptablepartstate" }, + { 0x83F5, "stopsliding" }, + { 0x83F6, "cancelrocketcorpse" }, + { 0x83F7, "setdronegoalpos" }, + { 0x83F8, "hudoutlineenable" }, + { 0x83F9, "hudoutlinedisable" }, + { 0x83FA, "motionblurhqenable" }, + { 0x83FB, "motionblurhqdisable" }, + { 0x83FC, "screenshakeonentity" }, + { 0x83FD, "setpitchorient" }, + { 0x83FE, "worldpointtoscreenpos" }, + { 0x83FF, "linktoplayerviewignoreparentrot" }, + { 0x8400, "shouldplaymeleedeathanim" }, + { 0x8401, "botfirstavailablegrenade" }, + { 0x8402, "visionsetwaterforplayer" }, + { 0x8403, "setwatersurfacetransitionfx" }, + { 0x8404, "linktoplayerviewfollowwatersurface" }, + { 0x8405, "linktoplayerviewattachwatersurfacetransitioneffects" }, + { 0x8406, "playersetwaterfog" }, + { 0x8407, "emissiveblend" }, + { 0x8408, "enableforceviewmodeldof" }, + { 0x8409, "disableforceviewmodeldof" }, + { 0x840A, "setviewmodeldepth" }, + { 0x840B, "isenemyaware" }, + { 0x840C, "hasenemybeenseen" }, + { 0x840D, "physicssetmaxlinvel" }, + { 0x840E, "physicssetmaxangvel" }, + { 0x840F, "physicsgetlinvel" }, + { 0x8410, "physicsgetlinspeed" }, + { 0x8411, "physicsgetangvel" }, + { 0x8412, "physicsgetangspeed" }, + { 0x8413, "disablemissileboosting" }, + { 0x8414, "enablemissileboosting" }, + { 0x8415, "canspawntestclient" }, + { 0x8416, "spawntestclient" }, + { 0x8417, "setgrenadethrowscale" }, + { 0x8418, "setgrenadecookscale" }, + { 0x8419, "setplanesplineid" }, + { 0x841A, "hudoutlineenableforclient" }, + { 0x841B, "hudoutlinedisableforclient" }, + { 0x841C, "hudoutlineenableforclients" }, + { 0x841D, "hudoutlinedisableforclients" }, + { 0x841E, "turretsetbarrelspinenabled" }, + { 0x841F, "loadcustomizationplayerview" }, + { 0x8420, "hasloadedcustomizationplayerview" }, + { 0x8421, "setclienttriggeraudiozonelerp" }, + { 0x8422, "setclienttriggeraudiozonepartial" }, + { 0x8423, "scragentdoanimrelative" }, + { 0x8424, "rotatetolinked" }, + { 0x8425, "rotatebylinked" }, + { 0x8426, "setlinkedangles" }, + { 0x8427, "getcorpseentity" }, + { 0x8428, "removefrommovingplatformsystem" }, + { 0x8429, "logmatchdatalife" }, + { 0x842A, "logmatchdatadeath" }, + { 0x842B, "queuedialogforplayer" }, + { 0x842C, "setmlgcameradefaults" }, + { 0x842D, "ismlgspectator" }, + { 0x842E, "disableautoreload" }, + { 0x842F, "enableautoreload" }, + { 0x8430, "issprintsliding" }, + { 0x8431, "getlinkedchildren" }, + { 0x8432, "botpredictenemycampspots" }, + { 0x8433, "playsoundonmovingent" }, + { 0x8434, "cancelmantle" }, + { 0x8435, "hasfemalecustomizationmodel" }, + { 0x8436, "loadviewweapons" }, + { 0x8437, "setscriptabledamageowner" }, + { 0x8438, "getscriptabletypeforentity" }, + { 0x8439, "setfxkilldefondelete" }, + { 0x843A, "getdogavoident" }, + { 0x843B, "enabledogavoidance" }, + { 0x843C, "enablehybridsight" }, + { 0x843D, "lastknownreason" }, + { 0x843E, "gettagindex" }, + { 0x843F, "challengenotification" }, + { 0x8440, "cancelaimove" }, + { 0x8441, "vehicle_jetbikesethoverforcescale" }, + { 0x8442, "linktosynchronizedparent" }, + { 0x8443, "getclientomnvar" }, + { 0x8444, "drawpostresolve" }, + { 0x8445, "drawpostresolveoff" }, + { 0x8446, "getcacplayerdataforgroup" }, + { 0x8447, "cloakingenable" }, + { 0x8448, "cloakingdisable" }, + { 0x8449, "getunnormalizedcameramovement" }, + { 0x844A, "getturretheat" }, + { 0x844B, "isturretoverheated" }, + { 0x844C, "vehicle_jetbikegetthrustfraction" }, + { 0x844D, "vehicle_jetbikegetdragfraction" }, + { 0x844E, "vehicle_jetbikegetantislipfraction" }, + { 0x844F, "vehicle_jetbikegettotalrepulsorfraction" }, + { 0x8450, "vehicle_assignbrushmodelcollision" }, + { 0x8451, "vehicle_removebrushmodelcollision" }, + { 0x8452, "vehicle_hovertanksethoverforcescale" }, + { 0x8453, "forcesprint" }, + { 0x8454, "forceads" }, + { 0x8455, "forcedeathfall" }, + { 0x8456, "gethybridscopestate" }, + { 0x8457, "sethybridscopestate" }, + { 0x8458, "getvieworigin" }, + { 0x8459, "setweaponmodelvariant" }, + { 0x845A, "ridevehicle" }, + { 0x845B, "stopridingvehicle" }, + { 0x845C, "getmantlesound" }, + { 0x845D, "autoboltmissileeffects" }, + { 0x845E, "disablemissilestick" }, + { 0x845F, "enablemissilestick" }, + { 0x8460, "setmissileminimapvisible" }, + { 0x8461, "isoffhandweaponreadytothrow" }, + { 0x8462, "isleaning" }, + { 0x8463, "makecollidewithitemclip" }, + { 0x8464, "ismovementfromgamepad" }, + { 0x8465, "visionsetpostapplyforplayer" }, + { 0x8466, "setlookattarget" }, + { 0x8467, "clearlookattarget" }, + { 0x8468, "overridematerial" }, + { 0x8469, "overridematerialreset" }, + { 0x846A, "overridetexture" }, + { 0x846B, "overrideviewmodelmaterial" }, + { 0x846C, "overrideviewmodelmaterialreset" }, + { 0x846D, "enemyincrosshairs" }, + { 0x846E, "setviewmodelmaterialscriptparam" }, + { 0x846F, "vehicle_hovertankgetthrottleforce" }, + { 0x8470, "vehicle_hovertankgetrepulsorforces" }, + { 0x8471, "vehicle_hovertankgetantislipforce" }, + { 0x8472, "vehicle_hovertankgetuprightingforce" }, + { 0x8473, "vehicle_hovertankgetautoyawforce" }, + { 0x8474, "getturretyawrate" }, + { 0x8475, "getturretpitchrate" }, + { 0x8476, "setclienttriggervisionset" }, + { 0x8477, "overridelightingorigin" }, + { 0x8478, "defaultlightingorigin" }, + { 0x8479, "playdynamicambience" }, + { 0x847A, "stopdynamicambience" }, + { 0x847B, "isusinghandbrake" }, + { 0x847C, "isusingboost" }, + { 0x847D, "showviewmodel" }, + { 0x847E, "hideviewmodel" }, + { 0x847F, "setpickupweapon" }, + { 0x8480, "playerlinkedmantleenable" }, + { 0x8481, "allowpowerslide" }, + { 0x8482, "allowhighjumpdrop" }, + { 0x8483, "despawnagent" }, + { 0x8484, "vehicle_setfakespeed" }, + { 0x8485, "vehicle_jetbikesetthrustscale" }, + { 0x8486, "agentclearscriptvars" }, + { 0x8487, "scriptmodelplayanimdeltamotionfrompos" }, + { 0x8488, "drawfacingentity" }, + { 0x8489, "allowdodge" }, + { 0x848A, "setcanspawnvehicleson" }, + { 0x848B, "vehicle_setminimapvisible" }, + { 0x848C, "setclutforplayer" }, + { 0x848D, "setclutoverrideenableforplayer" }, + { 0x848E, "setclutoverridedisableforplayer" }, + { 0x848F, "setpainvisioneq" }, + { 0x8490, "setplayermech" }, + { 0x8491, "setdamagecallbackon" }, + { 0x8492, "finishentitydamage" }, + { 0x8493, "getlightshadowstate" }, + { 0x8494, "setlightshadowstate" }, + { 0x8495, "forceviewmodelanimationclear" }, + { 0x8496, "designatefoftarget" }, + { 0x8497, "sethintstringvisibleonlytoowner" }, + { 0x8498, "notifyonplayercommandremove" }, + { 0x8499, "canmantleex" }, + { 0x849A, "allowboostjump" }, + { 0x849B, "batterydischargebegin" }, + { 0x849C, "batterydischargeend" }, + { 0x849D, "batterydischargeonce" }, + { 0x849E, "batterygetcharge" }, + { 0x849F, "batterysetcharge" }, + { 0x84A0, "batteryfullrecharge" }, + { 0x84A1, "batterygetsize" }, + { 0x84A2, "batterysetdischargescale" }, + { 0x84A3, "batterygetdischargerate" }, + { 0x84A4, "batteryisinuse" }, + { 0x84A5, "enablephysicaldepthoffieldscripting" }, + { 0x84A6, "disablephysicaldepthoffieldscripting" }, + { 0x84A7, "setphysicaldepthoffield" }, + { 0x84A8, "setadsphysicaldepthoffield" }, + { 0x84A9, "vehicle_gettopspeed" }, + { 0x84AA, "gettoparc" }, + { 0x84AB, "getbottomarc" }, + { 0x84AC, "forcejump" }, + { 0x84AD, "vehicle_helicoptersetmaxangularvelocity" }, + { 0x84AE, "vehicle_helicoptersetmaxangularacceleration" }, + { 0x84AF, "setdemigod" }, + { 0x84B0, "attachnobuilddobj" }, + { 0x84B1, "setviewmodelanim" }, + { 0x84B2, "setviewmodelanimtime" }, + { 0x84B3, "pauseviewmodelanim" }, + { 0x84B4, "setadditiveviewmodelanim" }, + { 0x84B5, "activityfeedwriteingamepost" }, + { 0x84B6, "setcostumemodels" }, + { 0x84B7, "vehicle_getcurrentnode" }, + { 0x84B8, "setphysicalviewmodeldepthoffield" }, + { 0x84B9, "scriptmodelpauseanim" }, + { 0x84BA, "digitaldistortsetmaterial" }, + { 0x84BB, "disableoffhandsecondaryweapons" }, + { 0x84BC, "enableoffhandsecondaryweapons" }, + { 0x84BD, "canplaceriotshield" }, + { 0x84BE, "setriotshieldfailhint" }, + { 0x84BF, "enabledetonate" }, + { 0x84C0, "getdetonateenabled" }, + { 0x84C1, "playergetuseent" }, + { 0x84C2, "refreshshieldmodels" }, + { 0x84C3, "vehicle_diveboatissubmerged" }, + { 0x84C4, "scragentusemodelcollisionbounds" }, + { 0x84C5, "scragentsetwallruncost" }, + { 0x84C6, "getgravity" }, + { 0x84C7, "setgravityoverride" }, + { 0x84C8, "resetgravityoverride" }, + { 0x84C9, "vehphys_getvelocity" }, + { 0x84CA, "vehphys_isoffground" }, + { 0x84CB, "getjointype" }, + { 0x84CC, "vehicle_diveboatdive" }, + { 0x84CD, "addsoundmutedevice" }, + { 0x84CE, "removesoundmutedevice" }, + { 0x84CF, "clientaddsoundsubmix" }, + { 0x84D0, "clientclearsoundsubmix" }, + { 0x84D1, "clientclearallsubmixes" }, + { 0x84D2, "clientblendsoundsubmix" }, + { 0x84D3, "clientmakesoundsubmixsticky" }, + { 0x84D4, "clientmakesoundsubmixunsticky" }, + { 0x84D5, "clientenablesoundcontextoverride" }, + { 0x84D6, "clientdisablesoundcontextoverride" }, + { 0x84D7, "getthreatsightdelay" }, + { 0x84D8, "isusingoffhand" }, + { 0x84D9, "physicsstop" }, + { 0x84DA, "setremotehelicopterthrottlescale" }, + { 0x84DB, "actorusemodelcollisionbounds" }, + { 0x84DC, "setaxialmove" }, + { 0x84DD, "pathabilityadd" }, + { 0x84DE, "pathabilityremove" }, + { 0x84DF, "evaluatetrajectorydelta" }, + { 0x84E0, "rotateovertime" }, + { 0x84E1, "vehicle_diveboatenabledive" }, + { 0x84E2, "initwaterclienttrigger" }, + { 0x84E3, "getplayerweaponviewmodel" }, + { 0x84E4, "setturretheatwhenoverheating" }, + { 0x84E5, "setthreatdetection" }, + { 0x84E6, "loadcostumemodels" }, + { 0x84E7, "crouchbuttonpressed" }, + { 0x84E8, "disablealternatemelee" }, + { 0x84E9, "enablealternatemelee" }, + { 0x84EA, "hasblendshapes" }, + { 0x84EB, "getactiveanimations" }, + { 0x84EC, "hidepartviewmodel" }, + { 0x84ED, "luiopenmenu" }, + { 0x84EE, "screenpostoworldpoint" }, + { 0x84EF, "iscloaked" }, + { 0x84F0, "vehicleget3pcameraoffset" }, + { 0x84F1, "vehicleget3ppitchclamp" }, + { 0x84F2, "setstompbreakthrough" }, + { 0x84F3, "getstompbreakthrough" }, + { 0x84F4, "selfieaccessselfievalidflaginplayerdef" }, + { 0x84F5, "selfieaccessselfiecustomassetsarestreamed" }, + { 0x84F6, "selfieupdateselfieviewparameters" }, + { 0x84F7, "selfieinitializeselfieupdate" }, + { 0x84F8, "selfiescreenshottaken" }, + { 0x84F9, "selfieuploadcompleted" }, + { 0x84FA, "selfierestorebufferswaps" }, + { 0x84FB, "getsystemtimesp" }, + { 0x84FC, "setmissilecoasting" }, + { 0x84FD, "setmlgspectator" }, + { 0x84FE, "gettotalmpxp" }, + { 0x84FF, "turretsetgroundaimentity" }, + { 0x8500, "hideweapontags" }, + { 0x8501, "getweapondamagelocationmultiplier" }, + { 0x8502, "setorbiterents" }, + { 0x8503, "enablereload" }, + { 0x8504, "isgroundentoverwater" }, + { 0x8505, "setballpassallowed" }, + { 0x8506, "consumereinforcement" }, + { 0x8507, "ghost" }, + { 0x8508, "loadweapons" }, + { 0x8509, "playscheduledcinematicsound" }, + { 0x850A, "setopaqueunlitforplayer" }, + { 0x850B, "setwaypointiconfadeatcenter" }, + { 0x850C, "setreinforcementhintstrings" }, + { 0x850D, "enablecustomweaponcontext" }, + { 0x850E, "disablecustomweaponcontext" }, + { 0x850F, "setshadowrendering" }, + { 0x8510, "playlocalannouncersound" }, + { 0x8511, "setmissilespecialclipmask" }, + { 0x8512, "vehicle_diveboatgetthrottleforce" }, + { 0x8513, "vehicle_diveboatgetdragforce" }, + { 0x8514, "isdodging" }, + { 0x8515, "ispowersliding" }, + { 0x8516, "getusableentity" }, + { 0x8517, "getcurrentping" }, + { 0x8518, "sethidetrigger" }, + { 0x8519, "detonatebydoubletap" }, + { 0x851A, "getnormalizedflick" }, + { 0x851B, "getdwid" }, + { 0x851C, "setplayerinfospmatchdata" }, + { 0x851D, "physicsisactive" }, + { 0x851E, "hasanimtree" }, + { 0x851F, "isgod" }, + { 0x8520, "setagentcostumeindex" }, + { 0x8521, "visionsetoverdriveforplayer" }, + { 0x8522, "issplitscreenotherplayerenemy" }, + { 0x8523, "setowneroriginal" }, + { 0x8524, "getlinkedtagname" }, + { 0x8525, "forcefirstpersonwhenfollowed" }, + { 0x8526, "disableforcefirstpersonwhenfollowed" }, + { 0x8527, "setwaypointaerialtargeting" }, + { 0x8528, "worldweaponsloaded" }, + { 0x8529, "enablegrenadethrowback" }, + { 0x852A, "usetriggertouchcheckstance" }, + { 0x852B, "onlystreamactiveweapon" }, + { 0x852C, "precachekillcamiconforweapon" }, + { 0x852D, "selfierequestupdate" }, + { 0x852E, "getclanwarsbonus" }, + { 0x852F, "scragentsetspecies" }, + { 0x8530, "scragentallowboost" }, + { 0x8531, "scragentsetnopenetrate" }, + { 0x8532, "finishplayerdamage_impactfx" }, + { 0x8533, "finishagentdamage_impactfx" }, + { 0x8534, "scragentsetorienttoground" }, + { 0x8535, "scragentsetallowragdoll" }, + { 0x8536, "scragentsetobstacleavoid" }, + { 0x8537, "scragentsetlateralcodemove" }, + { 0x8538, "scragentsetpathteamspread" }, + { 0x8539, "isnotarget" }, + { 0x853A, "setmovingplatformjitter" }, + { 0x853B, "agentusescragentclipmask" }, + { 0x853C, "setmeleechargevalid" }, + { 0x853D, "ishighjumpallowed" }, + { 0x853E, "setprestigemastery" }, + { 0x853F, "agentsetfavoriteenemy" }, + { 0x8540, "getpointinmodelbounds" }, + { 0x8541, "setexomeleechargevalid" }, + { 0x8542, "setdivision" }, + { 0x8543, "setgrapplinghooktarget" }, + { 0x8544, "scragentgetnodesonpath" }, + { 0x8545, "addzmexploderbloodfx" }, + { 0x8546, "sethighjumpresetallowed" }, + { 0x8547, "scragentsetzombietype" }, + { 0x8548, "getgroundentity" }, + { 0x8549, "isnoclip" }, + { 0x854A, "deleteonhostmigration" }, + { 0x854B, "scragentgetphysicsmode" }, + { 0x854C, "deathdropgrenade" }, + { 0x854D, "stopsound" }, + { 0x854E, "scragentsettraversenoderadius" }, + { 0x854F, "scragentgettraversenoderadius" }, + { 0x8550, "_meth_8550" }, // not allowriotshieldplant, something to do with lighting + { 0x8551, "setstatic" }, + { 0x8552, "scragentsynchronizeanims" }, + { 0x8553, "settertiaryhintstring" }, + { 0x8554, "scragentclearpath" }, + { 0x8555, "scragenttrimpath" }, + { 0x8556, "getsnapshotindexforclient" }, + { 0x8557, "getsnapshotacknowledgedindexforclient" }, + { 0x8558, "hasanimstate" }, + { 0x8559, "movecomparison_enable" }, + { 0x855A, "movecomparison_setbuttonpressed" }, + { 0x855B, "movecomparison_setstickvalue" }, + { 0x855C, "cloneclientasscriptmodel" }, + { 0x855D, "disablerootmotion" }, + { 0x855E, "playerlinktodeltablendviewangle" }, + { 0x855F, "startweaponinspection" }, + { 0x8560, "isinspectingweapon" }, + { 0x8561, "luinotifyevent" }, + { 0x8562, "luinotifyeventtospectators" }, + { 0x8563, "enablequatinterpolationrotation" }, + { 0x8564, "doesnodeforceidle" }, + { 0x8565, "setisignoringgrenades" }, + { 0x8566, "_meth_8566" }, + { 0x8567, "_meth_8567" }, + { 0x8568, "_meth_8568" }, + { 0x8569, "_meth_8569" }, + { 0x856A, "_meth_856A" }, + { 0x856B, "_meth_856B" }, + { 0x856C, "_meth_856C" }, + { 0x856D, "_meth_856D" }, + { 0x856E, "_meth_856E" }, + { 0x856F, "_meth_856F" }, + { 0x8570, "_meth_8570" }, + { 0x8571, "_meth_8571" }, + { 0x8572, "_meth_8572" }, + { 0x8573, "_meth_8573" }, + { 0x8574, "_meth_8574" }, + { 0x8575, "_meth_8575" }, + { 0x8576, "_meth_8576" }, + { 0x8577, "_meth_8577" }, + { 0x8578, "_meth_8578" }, + { 0x8579, "_meth_8579" }, // luinotifyeventto whom? + { 0x857A, "_meth_857A" }, + { 0x857B, "_meth_857B" }, + { 0x857C, "_meth_857C" }, + { 0x857D, "_meth_857D" }, + { 0x857E, "_meth_857E" }, + { 0x857F, "_meth_857F" }, + { 0x8580, "_meth_8580" }, + { 0x8581, "_meth_8581" }, + { 0x8582, "_meth_8582" }, + { 0x8583, "_meth_8583" }, + { 0x8584, "_meth_8584" }, + { 0x8585, "_meth_8585" }, + { 0x8586, "_meth_8586" }, +}}; + +} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/resolver.cpp b/src/h1/h1_token.cpp similarity index 94% rename from src/h1/xsk/resolver.cpp rename to src/h1/h1_token.cpp index aa336d4e..c9579a49 100644 --- a/src/h1/xsk/resolver.cpp +++ b/src/h1/h1_token.cpp @@ -1,2678 +1,14 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" #include "h1.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - namespace xsk::gsc::h1 { -std::unordered_map opcode_map; -std::unordered_map function_map; -std::unordered_map method_map; -std::unordered_map token_map; -std::unordered_map opcode_map_rev; -std::unordered_map function_map_rev; -std::unordered_map method_map_rev; -std::unordered_map token_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_func_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - const auto itr = function_map.find(id); - - if (itr != function_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_meth_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - const auto itr = method_map.find(id); - - if (itr != method_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_id_")) - { - return static_cast(std::stoul(name.substr(4), nullptr, 16)); - } - - const auto itr = token_map_rev.find(name); - - if (itr != token_map_rev.end()) - { - return itr->second; - } - - return 0; -} - -auto resolver::token_name(std::uint16_t id) -> std::string -{ - const auto itr = token_map.find(id); - - if (itr != token_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - } - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - } - - return false; -} - -void resolver::add_function(const std::string& name, std::uint16_t id) -{ - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - throw error(utils::string::va("builtin function '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - function_map.insert({ id, *str }); - function_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - function_map.insert({ id, *ins.first }); - function_map_rev.insert({ *ins.first, id }); - } - } -} - -void resolver::add_method(const std::string& name, std::uint16_t id) -{ - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - throw error(utils::string::va("builtin method '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - method_map.insert({ id, *str }); - method_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - method_map.insert({ id, *ins.first }); - method_map_rev.insert({ *ins.first, 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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ - "animscripts"sv, - "animscripts/traverse"sv, - "character"sv, - "codescripts"sv, - "common_scripts"sv, - "destructible_scripts"sv, - "maps"sv, - "maps/animated_models"sv, - "maps/createart"sv, - "maps/createfx"sv, - "maps/mp"sv, - "maps/mp/gametypes"sv, - "maps/mp/killstreaks"sv, - "maps/mp/perks"sv, - "mptype"sv, - "soundscripts"sv, - "vehicle_scripts"sv, - "xmodelalias"sv, -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -const std::array, 154> opcode_list -{{ - { 0x17, "OP_SetNewLocalVariableFieldCached0" }, - { 0x18, "OP_EvalSelfFieldVariable" }, - { 0x19, "OP_Return" }, - { 0x1A, "OP_CallBuiltin0" }, - { 0x1B, "OP_CallBuiltin1" }, - { 0x1C, "OP_CallBuiltin2" }, - { 0x1D, "OP_CallBuiltin3" }, - { 0x1E, "OP_CallBuiltin4" }, - { 0x1F, "OP_CallBuiltin5" }, - { 0x20, "OP_CallBuiltin" }, - { 0x21, "OP_BoolNot" }, - { 0x22, "OP_ScriptFarMethodThreadCall" }, - { 0x23, "OP_JumpOnTrueExpr" }, - { 0x24, "OP_SetLevelFieldVariableField" }, - { 0x25, "OP_CastBool" }, - { 0x26, "OP_EvalNewLocalArrayRefCached0" }, - { 0x27, "OP_CallBuiltinPointer" }, - { 0x28, "OP_inequality" }, - { 0x29, "OP_GetThisthread" }, - { 0x2A, "OP_ClearFieldVariable" }, - { 0x2B, "OP_GetFloat" }, - { 0x2C, "OP_SafeCreateVariableFieldCached" }, - { 0x2D, "OP_ScriptFarFunctionCall2" }, - { 0x2E, "OP_ScriptFarFunctionCall" }, - { 0x2F, "OP_ScriptFarChildThreadCall" }, - { 0x30, "OP_ClearLocalVariableFieldCached0" }, - { 0x31, "OP_ClearLocalVariableFieldCached" }, - { 0x32, "OP_checkclearparams" }, - { 0x33, "OP_CastFieldObject" }, - { 0x34, "OP_End" }, - { 0x35, "OP_size" }, - { 0x36, "OP_EmptyArray" }, - { 0x37, "OP_bit_and" }, - { 0x38, "OP_less_equal" }, - { 0x39, "OP_voidCodepos" }, - { 0x3A, "OP_ScriptMethodThreadCallPointer" }, - { 0x3B, "OP_endswitch" }, - { 0x3C, "OP_ClearVariableField" }, - { 0x3D, "OP_divide" }, - { 0x3E, "OP_ScriptFarMethodChildThreadCall" }, - { 0x3F, "OP_GetUnsignedShort" }, - { 0x40, "OP_JumpOnTrue" }, - { 0x41, "OP_GetSelf" }, - { 0x42, "OP_ScriptFarThreadCall" }, - { 0x43, "OP_ScriptLocalThreadCall" }, - { 0x44, "OP_SetLocalVariableFieldCached0" }, - { 0x45, "OP_SetLocalVariableFieldCached" }, - { 0x46, "OP_plus" }, - { 0x47, "OP_BoolComplement" }, - { 0x48, "OP_ScriptMethodCallPointer" }, - { 0x49, "OP_inc" }, - { 0x4A, "OP_RemoveLocalVariables" }, - { 0x4B, "OP_JumpOnFalseExpr" }, - { 0x4C, "OP_switch" }, - { 0x4D, "OP_clearparams" }, - { 0x4E, "OP_EvalLocalVariableRefCached0" }, - { 0x4F, "OP_EvalLocalVariableRefCached" }, - { 0x50, "OP_ScriptLocalMethodCall" }, - { 0x51, "OP_EvalFieldVariable" }, - { 0x52, "OP_EvalFieldVariableRef" }, - { 0x53, "OP_GetString" }, - { 0x54, "OP_ScriptFunctionCallPointer" }, - { 0x55, "OP_EvalLevelFieldVariable" }, - { 0x56, "OP_GetVector" }, - { 0x57, "OP_endon" }, - { 0x58, "OP_greater_equal" }, - { 0x59, "OP_GetSelfObject" }, - { 0x5A, "OP_SetAnimFieldVariableField" }, - { 0x5B, "OP_SetVariableField" }, - { 0x5C, "OP_ScriptLocalFunctionCall2" }, - { 0x5D, "OP_ScriptLocalFunctionCall" }, - { 0x5E, "OP_EvalLocalArrayRefCached0" }, - { 0x5F, "OP_EvalLocalArrayRefCached" }, - { 0x60, "OP_GetFarFunction" }, - { 0x61, "OP_less" }, - { 0x62, "OP_GetGameRef" }, - { 0x63, "OP_waittillFrameEnd" }, - { 0x64, "OP_waitFrame" }, - { 0x65, "OP_SafeSetVariableFieldCached0" }, - { 0x66, "OP_SafeSetVariableFieldCached" }, - { 0x67, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x68, "OP_GetLevel" }, - { 0x69, "OP_notify" }, - { 0x6A, "OP_DecTop" }, - { 0x6B, "OP_shift_left" }, - { 0x6C, "OP_ScriptLocalMethodThreadCall" }, - { 0x6D, "OP_ScriptLocalMethodChildThreadCall" }, - { 0x6E, "OP_greater" }, - { 0x6F, "OP_EvalLocalVariableCached0" }, - { 0x70, "OP_EvalLocalVariableCached1" }, - { 0x71, "OP_EvalLocalVariableCached2" }, - { 0x72, "OP_EvalLocalVariableCached3" }, - { 0x73, "OP_EvalLocalVariableCached4" }, - { 0x74, "OP_EvalLocalVariableCached5" }, - { 0x75, "OP_EvalLocalVariableCached" }, - { 0x76, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x77, "OP_jump" }, - { 0x78, "OP_ScriptThreadCallPointer" }, - { 0x79, "OP_GetZero" }, - { 0x7A, "OP_wait" }, - { 0x7B, "OP_minus" }, - { 0x7C, "OP_SetSelfFieldVariableField" }, - { 0x7D, "OP_EvalNewLocalVariableRefCached0" }, - { 0x7E, "OP_multiply" }, - { 0x7F, "OP_CreateLocalVariable" }, - { 0x80, "OP_ScriptLocalChildThreadCall" }, - { 0x81, "OP_GetInteger" }, - { 0x82, "OP_mod" }, - { 0x83, "OP_EvalAnimFieldVariableRef" }, - { 0x84, "OP_GetBuiltinFunction" }, - { 0x85, "OP_GetGame" }, - { 0x86, "OP_waittill" }, - { 0x87, "OP_dec" }, - { 0x88, "OP_EvalLocalVariableObjectCached" }, - { 0x89, "OP_PreScriptCall" }, - { 0x8A, "OP_GetAnim" }, - { 0x8B, "OP_GetUndefined" }, - { 0x8C, "OP_EvalLevelFieldVariableRef" }, - { 0x8D, "OP_GetAnimObject" }, - { 0x8E, "OP_GetLevelObject" }, - { 0x8F, "OP_bit_ex_or" }, - { 0x90, "OP_equality" }, - { 0x91, "OP_ClearArray" }, - { 0x92, "OP_jumpback" }, - { 0x93, "OP_GetAnimation" }, - { 0x94, "OP_EvalAnimFieldVariable" }, - { 0x95, "OP_GetAnimTree" }, - { 0x96, "OP_GetIString" }, - { 0x97, "OP_EvalArrayRef" }, - { 0x98, "OP_EvalSelfFieldVariableRef" }, - { 0x99, "OP_GetNegByte" }, - { 0x9A, "OP_GetBuiltinMethod" }, - { 0x9B, "OP_CallBuiltinMethodPointer" }, - { 0x9C, "OP_EvalArray" }, - { 0x9D, "OP_vector" }, - { 0x9E, "OP_ScriptFarMethodCall" }, - { 0x9F, "OP_EvalLocalArrayCached" }, - { 0xA0, "OP_GetByte" }, - { 0xA1, "OP_ScriptChildThreadCallPointer" }, - { 0xA2, "OP_bit_or" }, - { 0xA3, "OP_AddArray" }, - { 0xA4, "OP_waittillmatch2" }, - { 0xA5, "OP_waittillmatch" }, - { 0xA6, "OP_GetLocalFunction" }, - { 0xA7, "OP_GetNegUnsignedShort" }, - { 0xA8, "OP_shift_right" }, - { 0xA9, "OP_CallBuiltinMethod0" }, - { 0xAA, "OP_CallBuiltinMethod1" }, - { 0xAB, "OP_CallBuiltinMethod2" }, - { 0xAC, "OP_CallBuiltinMethod3" }, - { 0xAD, "OP_CallBuiltinMethod4" }, - { 0xAE, "OP_CallBuiltinMethod5" }, - { 0xAF, "OP_CallBuiltinMethod" }, - { 0xB0, "OP_JumpOnFalse" }, -}}; - -const std::array, 778> function_list -{{ - { 0x001, "precacheturret" }, - { 0x002, "getweaponarray" }, - { 0x003, "createprintchannel" }, - { 0x004, "updategamerprofileall" }, - { 0x005, "clearlocalizedstrings" }, - { 0x006, "setphysicsgravitydir" }, - { 0x007, "gettimescale" }, - { 0x008, "settimescale" }, - { 0x009, "setslowmotionview" }, - { 0x00A, "teleportscene" }, - { 0x00B, "forcesharedammo" }, - { 0x00C, "refreshhudcompass" }, - { 0x00D, "refreshhudammocounter" }, - { 0x00E, "notifyoncommand" }, - { 0x00F, "setprintchannel" }, - { 0x010, "print" }, - { 0x011, "println" }, - { 0x012, "print3d" }, - { 0x013, "line" }, - { 0x014, "box" }, - { 0x015, "orientedbox" }, - { 0x016, "sphere" }, - { 0x017, "cylinder" }, - { 0x018, "spawnturret" }, - { 0x019, "canspawnturret" }, - { 0x01A, "assert" }, - { 0x01B, "pausecinematicingame" }, - { 0x01C, "drawcompassfriendlies" }, - { 0x01D, "bulletspread" }, - { 0x01E, "bullettracer" }, - { 0x01F, "badplace_delete" }, - { 0x020, "badplace_cylinder" }, - { 0x021, "badplace_arc" }, - { 0x022, "badplace_brush" }, - { 0x023, "clearallcorpses" }, - { 0x024, "setturretnode" }, - { 0x025, "unsetturretnode" }, - { 0x026, "setnodepriority" }, - { 0x027, "_func_027" }, - { 0x028, "_func_028" }, - { 0x029, "_func_029" }, - { 0x02A, "setdebugorigin" }, - { 0x02B, "setdebugangles" }, - { 0x02C, "updategamerprofile" }, - { 0x02D, "assertex" }, - { 0x02E, "assertmsg" }, - { 0x02F, "isdefined" }, - { 0x030, "isvalidmissile" }, - { 0x031, "isstring" }, - { 0x032, "setomnvar" }, - { 0x033, "getomnvar" }, - { 0x034, "setdvar" }, - { 0x035, "setdynamicdvar" }, - { 0x036, "setdvarifuninitialized" }, - { 0x037, "setdevdvar" }, - { 0x038, "setdevdvarifuninitialized" }, - { 0x039, "getdvar" }, - { 0x03A, "getdvarint" }, - { 0x03B, "getdvarfloat" }, - { 0x03C, "getdvarvector" }, - { 0x03D, "gettime" }, - { 0x03E, "gettimeutc" }, - { 0x03F, "getradiometricunit" }, - { 0x040, "getentbynum" }, - { 0x041, "getscreenwidth" }, - { 0x042, "getscreenheight" }, - { 0x043, "getweaponmodel" }, - { 0x044, "getculldist" }, - { 0x045, "sethalfresparticles" }, - { 0x046, "getmapsunlight" }, - { 0x047, "setsunlight" }, - { 0x048, "resetsunlight" }, - { 0x049, "getmapsundirection" }, - { 0x04A, "getmapsunangles" }, - { 0x04B, "setsundirection" }, - { 0x04C, "lerpsundirection" }, - { 0x04D, "lerpsunangles" }, - { 0x04E, "resetsundirection" }, - { 0x04F, "enableforcedsunshadows" }, - { 0x050, "enableforcednosunshadows" }, - { 0x051, "disableforcedsunshadows" }, - { 0x052, "enableouterspacemodellighting" }, - { 0x053, "disableouterspacemodellighting" }, - { 0x054, "remapstage" }, - { 0x055, "changelevel" }, - { 0x056, "missionsuccess" }, - { 0x057, "missionfailed" }, - { 0x058, "cinematic" }, - { 0x059, "cinematicingame" }, - { 0x05A, "cinematicingamesync" }, - { 0x05B, "cinematicingameloop" }, - { 0x05C, "cinematicingameloopresident" }, - { 0x05D, "iscinematicplaying" }, - { 0x05E, "stopcinematicingame" }, - { 0x05F, "getweapondisplayname" }, - { 0x060, "getweaponbasename" }, - { 0x061, "getweaponattachments" }, - { 0x062, "getweaponattachmentdisplaynames" }, - { 0x063, "getweaponcamoname" }, - { 0x064, "getweaponreticlename" }, - { 0x065, "getanimlength" }, - { 0x066, "animhasnotetrack" }, - { 0x067, "getnotetracktimes" }, - { 0x068, "spawn" }, - { 0x069, "spawnloopsound" }, - { 0x06A, "spawnloopingsound" }, - { 0x06B, "bullettrace" }, - { 0x06C, "target_setmaxsize" }, - { 0x06D, "target_setcolor" }, - { 0x06E, "target_setdelay" }, - { 0x06F, "getstartorigin" }, - { 0x070, "getstartangles" }, - { 0x071, "getcycleoriginoffset" }, - { 0x072, "magicgrenade" }, - { 0x073, "magicgrenademanual" }, - { 0x074, "setblur" }, - { 0x075, "musicplay" }, - { 0x076, "musicstop" }, - { 0x077, "soundfade" }, - { 0x078, "addsoundsubmix" }, - { 0x079, "clearsoundsubmix" }, - { 0x07A, "clearallsubmixes" }, - { 0x07B, "blendsoundsubmix" }, - { 0x07C, "makesoundsubmixsticky" }, - { 0x07D, "makesoundsubmixunsticky" }, - { 0x07E, "soundsettimescalefactor" }, - { 0x07F, "soundresettimescale" }, - { 0x080, "levelsoundfade" }, - { 0x081, "precachenightvisioncodeassets" }, - { 0x082, "precachedigitaldistortcodeassets" }, - { 0x083, "precachesonarvisioncodeassets" }, - { 0x084, "precacheminimapsentrycodeassets" }, - { 0x085, "savegame" }, - { 0x086, "issavesuccessful" }, - { 0x087, "issaverecentlyloaded" }, - { 0x088, "savegamenocommit" }, - { 0x089, "commitsave" }, - { 0x08A, "commitwouldbevalid" }, - { 0x08B, "getfxvisibility" }, - { 0x08C, "setculldist" }, - { 0x08D, "bullettracepassed" }, - { 0x08E, "sighttracepassed" }, - { 0x08F, "physicstrace" }, - { 0x090, "playerphysicstrace" }, - { 0x091, "getgroundposition" }, - { 0x092, "getmovedelta" }, - { 0x093, "getangledelta" }, - { 0x094, "getnorthyaw" }, - { 0x095, "getcommandfromkey" }, - { 0x096, "getsticksconfig" }, - { 0x097, "weaponfightdist" }, - { 0x098, "weaponmaxdist" }, - { 0x099, "isturretactive" }, - { 0x09A, "getturretfov" }, - { 0x09B, "target_alloc" }, - { 0x09C, "target_flush" }, - { 0x09D, "target_set" }, - { 0x09E, "target_remove" }, - { 0x09F, "target_setshader" }, - { 0x0A0, "target_setoffscreenshader" }, - { 0x0A1, "target_isinrect" }, - { 0x0A2, "target_isincircle" }, - { 0x0A3, "target_startreticlelockon" }, - { 0x0A4, "target_clearreticlelockon" }, - { 0x0A5, "target_getarray" }, - { 0x0A6, "target_istarget" }, - { 0x0A7, "target_setattackmode" }, - { 0x0A8, "target_setjavelinonly" }, - { 0x0A9, "target_hidefromplayer" }, - { 0x0AA, "target_showtoplayer" }, - { 0x0AB, "target_setscaledrendermode" }, - { 0x0AC, "target_drawcornersonly" }, - { 0x0AD, "target_drawsquare" }, - { 0x0AE, "target_drawsingle" }, - { 0x0AF, "target_setminsize" }, - { 0x0B0, "setnorthyaw" }, - { 0x0B1, "setslowmotion" }, - { 0x0B2, "randomint" }, - { 0x0B3, "randomfloat" }, - { 0x0B4, "randomintrange" }, - { 0x0B5, "randomfloatrange" }, - { 0x0B6, "sin" }, - { 0x0B7, "cos" }, - { 0x0B8, "tan" }, - { 0x0B9, "asin" }, - { 0x0BA, "acos" }, - { 0x0BB, "atan" }, - { 0x0BC, "int" }, - { 0x0BD, "float" }, - { 0x0BE, "abs" }, - { 0x0BF, "min" }, - { 0x0C0, "objective_additionalcurrent" }, - { 0x0C1, "objective_ring" }, - { 0x0C2, "objective_setpointertextoverride" }, - { 0x0C3, "getnode" }, - { 0x0C4, "getnodearray" }, - { 0x0C5, "getallnodes" }, - { 0x0C6, "getnodesinradius" }, - { 0x0C7, "getnodesinradiussorted" }, - { 0x0C8, "getclosestnodeinsight" }, - { 0x0C9, "getreflectionlocs" }, - { 0x0CA, "getreflectionreferencelocs" }, - { 0x0CB, "getvehicletracksegment" }, - { 0x0CC, "getvehicletracksegmentarray" }, - { 0x0CD, "getallvehicletracksegments" }, - { 0x0CE, "isarray" }, - { 0x0CF, "isai" }, - { 0x0D0, "getindexforluincstring" }, - { 0x0D1, "issentient" }, - { 0x0D2, "isgodmode" }, - { 0x0D3, "getdebugdvar" }, - { 0x0D4, "getdebugdvarint" }, - { 0x0D5, "getdebugdvarfloat" }, - { 0x0D6, "setsaveddvar" }, - { 0x0D7, "getfreeaicount" }, - { 0x0D8, "getaicount" }, - { 0x0D9, "getaiarray" }, - { 0x0DA, "getaispeciesarray" }, - { 0x0DB, "getspawnerarray" }, - { 0x0DC, "getcorpsearray" }, - { 0x0DD, "getspawnerteamarray" }, - { 0x0DE, "getweaponclipmodel" }, - { 0x0DF, "getbrushmodelcenter" }, - { 0x0E0, "getkeybinding" }, - { 0x0E1, "max" }, - { 0x0E2, "floor" }, - { 0x0E3, "ceil" }, - { 0x0E4, "exp" }, - { 0x0E5, "_func_0E5" }, - { 0x0E6, "log" }, - { 0x0E7, "sqrt" }, - { 0x0E8, "squared" }, - { 0x0E9, "clamp" }, - { 0x0EA, "angleclamp" }, - { 0x0EB, "angleclamp180" }, - { 0x0EC, "vectorfromlinetopoint" }, - { 0x0ED, "pointonsegmentnearesttopoint" }, - { 0x0EE, "distance" }, - { 0x0EF, "distance2d" }, - { 0x0F0, "distancesquared" }, - { 0x0F1, "length" }, - { 0x0F2, "length2d" }, - { 0x0F3, "lengthsquared" }, - { 0x0F4, "length2dsquared" }, - { 0x0F5, "closer" }, - { 0x0F6, "vectordot" }, - { 0x0F7, "vectorcross" }, - { 0x0F8, "axistoangles" }, - { 0x0F9, "visionsetthermal" }, - { 0x0FA, "visionsetpain" }, - { 0x0FB, "endlobby" }, - { 0x0FC, "setac130ambience" }, - { 0x0FD, "getmapcustom" }, - { 0x0FE, "spawnsighttrace" }, - { 0x0FF, "incrementcounter" }, - { 0x100, "getcountertotal" }, - { 0x101, "getlevelticks" }, - { 0x102, "perlinnoise2d" }, - { 0x103, "calcrockingangles" }, - { 0x104, "reconevent" }, - { 0x105, "reconspatialevent" }, - { 0x106, "setsunflareposition" }, - { 0x107, "createthreatbiasgroup" }, - { 0x108, "threatbiasgroupexists" }, - { 0x109, "getthreatbias" }, - { 0x10A, "setthreatbias" }, - { 0x10B, "setthreatbiasagainstall" }, - { 0x10C, "setignoremegroup" }, - { 0x10D, "isenemyteam" }, - { 0x10E, "objective_additionalentity" }, - { 0x10F, "objective_state_nomessage" }, - { 0x110, "objective_string" }, - { 0x111, "objective_string_nomessage" }, - { 0x112, "objective_additionalposition" }, - { 0x113, "objective_current_nomessage" }, - { 0x114, "vectornormalize" }, - { 0x115, "vectortoangles" }, - { 0x116, "vectortoyaw" }, - { 0x117, "vectorlerp" }, - { 0x118, "anglestoup" }, - { 0x119, "anglestoright" }, - { 0x11A, "anglestoforward" }, - { 0x11B, "anglesdelta" }, - { 0x11C, "combineangles" }, - { 0x11D, "transformmove" }, - { 0x11E, "rotatevector" }, - { 0x11F, "rotatepointaroundvector" }, - { 0x120, "issubstr" }, - { 0x121, "isendstr" }, - { 0x122, "getsubstr" }, - { 0x123, "tolower" }, - { 0x124, "strtok" }, - { 0x125, "stricmp" }, - { 0x126, "ambientplay" }, - { 0x127, "getuavstrengthmax" }, - { 0x128, "getuavstrengthlevelneutral" }, - { 0x129, "getuavstrengthlevelshowenemyfastsweep" }, - { 0x12A, "getuavstrengthlevelshowenemydirectional" }, - { 0x12B, "blockteamradar" }, - { 0x12C, "unblockteamradar" }, - { 0x12D, "isteamradarblocked" }, - { 0x12E, "getassignedteam" }, - { 0x12F, "setmatchdata" }, - { 0x130, "getmatchdata" }, - { 0x131, "sendmatchdata" }, - { 0x132, "clearmatchdata" }, - { 0x133, "setmatchdatadef" }, - { 0x134, "setmatchclientip" }, - { 0x135, "setmatchdataid" }, - { 0x136, "setclientmatchdata" }, - { 0x137, "getclientmatchdata" }, - { 0x138, "setclientmatchdatadef" }, - { 0x139, "sendclientmatchdata" }, - { 0x13A, "getbuildversion" }, - { 0x13B, "getbuildnumber" }, - { 0x13C, "getsystemtime" }, - { 0x13D, "getmatchrulesdata" }, - { 0x13E, "isusingmatchrulesdata" }, - { 0x13F, "kick" }, - { 0x140, "issplitscreen" }, - { 0x141, "setmapcenter" }, - { 0x142, "setgameendtime" }, - { 0x143, "visionsetnaked" }, - { 0x144, "visionsetnight" }, - { 0x145, "visionsetmissilecam" }, - { 0x146, "ambientstop" }, - { 0x147, "precachemodel" }, - { 0x148, "precacheshellshock" }, - { 0x149, "precacheitem" }, - { 0x14A, "precacheshader" }, - { 0x14B, "precachestring" }, - { 0x14C, "precachemenu" }, - { 0x14D, "precacherumble" }, - { 0x14E, "precachelocationselector" }, - { 0x14F, "precacheleaderboards" }, - { 0x150, "loadfx" }, - { 0x151, "playfx" }, - { 0x152, "playfxontag" }, - { 0x153, "stopfxontag" }, - { 0x154, "killfxontag" }, - { 0x155, "playloopedfx" }, - { 0x156, "spawnfx" }, - { 0x157, "triggerfx" }, - { 0x158, "playfxontagforclients" }, - { 0x159, "setfxkillondelete" }, - { 0x15A, "playimpactheadfatalfx" }, - { 0x15B, "setwinningteam" }, - { 0x15C, "announcement" }, - { 0x15D, "clientannouncement" }, - { 0x15E, "setteammode" }, - { 0x15F, "getteamscore" }, - { 0x160, "setteamscore" }, - { 0x161, "setclientnamemode" }, - { 0x162, "updateclientnames" }, - { 0x163, "getteamplayersalive" }, - { 0x164, "logprint" }, - { 0x165, "worldentnumber" }, - { 0x166, "obituary" }, - { 0x167, "positionwouldtelefrag" }, - { 0x168, "canspawn" }, - { 0x169, "getstarttime" }, - { 0x16A, "precacheheadicon" }, - { 0x16B, "precacheminimapicon" }, - { 0x16C, "precachempanim" }, - { 0x16D, "map_restart" }, - { 0x16E, "exitlevel" }, - { 0x16F, "addtestclient" }, - { 0x170, "addagent" }, - { 0x171, "setarchive" }, - { 0x172, "allclientsprint" }, - { 0x173, "clientprint" }, - { 0x174, "mapexists" }, - { 0x175, "isvalidgametype" }, - { 0x176, "matchend" }, - { 0x177, "setplayerteamrank" }, - { 0x178, "endparty" }, - { 0x179, "setteamradar" }, - { 0x17A, "getteamradar" }, - { 0x17B, "setteamradarstrength" }, - { 0x17C, "getteamradarstrength" }, - { 0x17D, "getuavstrengthmin" }, - { 0x17E, "physicsexplosionsphere" }, - { 0x17F, "physicsexplosioncylinder" }, - { 0x180, "physicsjolt" }, - { 0x181, "physicsjitter" }, - { 0x182, "setexpfog" }, - { 0x183, "setexpfogext" }, - { 0x184, "setexpfogdvarsonly" }, - { 0x185, "setexpfogextdvarsonly" }, - { 0x186, "setatmosfog" }, - { 0x187, "setatmosfogdvarsonly" }, - { 0x188, "isexplosivedamagemod" }, - { 0x189, "radiusdamage" }, - { 0x18A, "setplayerignoreradiusdamage" }, - { 0x18B, "glassradiusdamage" }, - { 0x18C, "earthquake" }, - { 0x18D, "getnumparts" }, - { 0x18E, "objective_onentity" }, - { 0x18F, "objective_onentitywithrotation" }, - { 0x190, "objective_team" }, - { 0x191, "objective_player" }, - { 0x192, "objective_playerteam" }, - { 0x193, "objective_playerenemyteam" }, - { 0x194, "objective_playermask_hidefromall" }, - { 0x195, "objective_playermask_hidefrom" }, - { 0x196, "objective_playermask_showtoall" }, - { 0x197, "objective_playermask_showto" }, - { 0x198, "iprintln" }, - { 0x199, "iprintlnbold" }, - { 0x19A, "logstring" }, - { 0x19B, "getent" }, - { 0x19C, "getentarray" }, - { 0x19D, "getspawnarray" }, - { 0x19E, "spawnplane" }, - { 0x19F, "spawnstruct" }, - { 0x1A0, "spawnhelicopter" }, - { 0x1A1, "isalive" }, - { 0x1A2, "isspawner" }, - { 0x1A3, "missile_createattractorent" }, - { 0x1A4, "missile_createattractororigin" }, - { 0x1A5, "missile_createrepulsorent" }, - { 0x1A6, "missile_createrepulsororigin" }, - { 0x1A7, "missile_deleteattractor" }, - { 0x1A8, "playsoundatpos" }, - { 0x1A9, "newhudelem" }, - { 0x1AA, "newclienthudelem" }, - { 0x1AB, "newteamhudelem" }, - { 0x1AC, "resettimeout" }, - { 0x1AD, "isplayer" }, - { 0x1AE, "isplayernumber" }, - { 0x1AF, "getpartname" }, - { 0x1B0, "weaponfiretime" }, - { 0x1B1, "weaponclipsize" }, - { 0x1B2, "weaponisauto" }, - { 0x1B3, "weaponissemiauto" }, - { 0x1B4, "weaponisboltaction" }, - { 0x1B5, "weaponinheritsperks" }, - { 0x1B6, "weaponburstcount" }, - { 0x1B7, "weapontype" }, - { 0x1B8, "weaponclass" }, - { 0x1B9, "getnextarraykey" }, - { 0x1BA, "sortbydistance" }, - { 0x1BB, "tablelookup" }, - { 0x1BC, "tablelookupbyrow" }, - { 0x1BD, "tablelookupistring" }, - { 0x1BE, "tablelookupistringbyrow" }, - { 0x1BF, "tablelookuprownum" }, - { 0x1C0, "tableexists" }, - { 0x1C1, "getmissileowner" }, - { 0x1C2, "magicbullet" }, - { 0x1C3, "getweaponflashtagname" }, - { 0x1C4, "averagepoint" }, - { 0x1C5, "averagenormal" }, - { 0x1C6, "vehicle_getspawnerarray" }, - { 0x1C7, "playrumbleonposition" }, - { 0x1C8, "playrumblelooponposition" }, - { 0x1C9, "stopallrumbles" }, - { 0x1CA, "soundexists" }, - { 0x1CB, "openfile" }, - { 0x1CC, "closefile" }, - { 0x1CD, "fprintln" }, - { 0x1CE, "fprintfields" }, - { 0x1CF, "freadln" }, - { 0x1D0, "fgetarg" }, - { 0x1D1, "setminimap" }, - { 0x1D2, "setthermalbodymaterial" }, - { 0x1D3, "getarraykeys" }, - { 0x1D4, "getfirstarraykey" }, - { 0x1D5, "getglass" }, - { 0x1D6, "getglassarray" }, - { 0x1D7, "getglassorigin" }, - { 0x1D8, "isglassdestroyed" }, - { 0x1D9, "destroyglass" }, - { 0x1DA, "deleteglass" }, - { 0x1DB, "getentchannelscount" }, - { 0x1DC, "getentchannelname" }, - { 0x1DD, "objective_add" }, - { 0x1DE, "objective_delete" }, - { 0x1DF, "objective_state" }, - { 0x1E0, "objective_icon" }, - { 0x1E1, "objective_indentlevel" }, - { 0x1E2, "objective_position" }, - { 0x1E3, "objective_current" }, - { 0x1E4, "weaponinventorytype" }, - { 0x1E5, "weaponstartammo" }, - { 0x1E6, "weaponmaxammo" }, - { 0x1E7, "weaponaltweaponname" }, - { 0x1E8, "isweaponcliponly" }, - { 0x1E9, "isweapondetonationtimed" }, - { 0x1EA, "isweaponmanuallydetonatedbyemptythrow" }, - { 0x1EB, "weaponhasthermalscope" }, - { 0x1EC, "getvehiclenode" }, - { 0x1ED, "getvehiclenodearray" }, - { 0x1EE, "getallvehiclenodes" }, - { 0x1EF, "getnumvehicles" }, - { 0x1F0, "precachevehicle" }, - { 0x1F1, "spawnvehicle" }, - { 0x1F2, "vehicle_getarray" }, - { 0x1F3, "pow" }, - { 0x1F4, "atan2" }, - { 0x1F5, "botgetmemoryevents" }, - { 0x1F6, "botautoconnectenabled" }, - { 0x1F7, "botzonegetcount" }, - { 0x1F8, "botzonesetteam" }, - { 0x1F9, "botzonenearestcount" }, - { 0x1FA, "botmemoryflags" }, - { 0x1FB, "botflagmemoryevents" }, - { 0x1FC, "botzonegetindoorpercent" }, - { 0x1FD, "botsentientswap" }, - { 0x1FE, "isbot" }, - { 0x1FF, "isagent" }, - { 0x200, "getmaxagents" }, - { 0x201, "botdebugdrawtrigger" }, - { 0x202, "botgetclosestnavigablepoint" }, - { 0x203, "getnodesintrigger" }, - { 0x204, "nodesvisible" }, - { 0x205, "getnodesonpath" }, - { 0x206, "getzonecount" }, - { 0x207, "getzonenearest" }, - { 0x208, "getzonenodes" }, - { 0x209, "getzonepath" }, - { 0x20A, "getzoneorigin" }, - { 0x20B, "getnodezone" }, - { 0x20C, "getzonenodesbydist" }, - { 0x20D, "getzonenodeforindex" }, - { 0x20E, "getweaponexplosionradius" }, - { 0x20F, "markdangerousnodes" }, - { 0x210, "markdangerousnodesintrigger" }, - { 0x211, "nodeexposedtosky" }, - { 0x212, "findentrances" }, - { 0x213, "badplace_global" }, - { 0x214, "getpathdist" }, - { 0x215, "getlinkednodes" }, - { 0x216, "disconnectnodepair" }, - { 0x217, "connectnodepair" }, - { 0x218, "gettimesincelastpaused" }, - { 0x219, "precachefxontag" }, - { 0x21A, "precachetag" }, - { 0x21B, "precachesound" }, - { 0x21C, "devsetminimapdvarsettings" }, - { 0x21D, "loadtransient" }, - { 0x21E, "unloadtransient" }, - { 0x21F, "unloadalltransients" }, - { 0x220, "synctransients" }, - { 0x221, "aretransientsbusy" }, - { 0x222, "istransientqueued" }, - { 0x223, "istransientloaded" }, - { 0x224, "loadstartpointtransient" }, - { 0x225, "distance2dsquared" }, - { 0x226, "getangledelta3d" }, - { 0x227, "activateclientexploder" }, - { 0x228, "trajectorycalculateinitialvelocity" }, - { 0x229, "trajectorycalculateminimumvelocity" }, - { 0x22A, "trajectorycalculateexitangle" }, - { 0x22B, "trajectoryestimatedesiredinairtime" }, - { 0x22C, "trajectorycomputedeltaheightattime" }, - { 0x22D, "trajectorycanattemptaccuratejump" }, - { 0x22E, "adddebugcommand" }, - { 0x22F, "ispointinvolume" }, - { 0x230, "cinematicgettimeinmsec" }, - { 0x231, "cinematicgetframe" }, - { 0x232, "iscinematicloaded" }, - { 0x233, "bbprint" }, - { 0x234, "getenemysquaddata" }, - { 0x235, "lookupsoundlength" }, - { 0x236, "getscriptablearray" }, - { 0x237, "clearfog" }, - { 0x238, "setleveldopplerpreset" }, - { 0x239, "screenshake" }, - { 0x23A, "isusinghdr" }, - { 0x23B, "isusingssao" }, - { 0x23C, "grantloot" }, - { 0x23D, "playerphysicstraceinfo" }, - { 0x23E, "_func_23E" }, - { 0x23F, "getminchargetime" }, - { 0x240, "getchargetimepershot" }, - { 0x241, "getmaxchargeshots" }, - { 0x242, "weaponischargeable" }, - { 0x243, "weaponusesheat" }, - { 0x244, "lootserviceonendgame" }, - { 0x245, "luinotifyevent" }, - { 0x246, "lootserviceonstartgame" }, - { 0x247, "tournamentreportplayerspm" }, - { 0x248, "tournamentreportwinningteam" }, - { 0x249, "tournamentreportendofgame" }, - { 0x24A, "wakeupphysicssphere" }, - { 0x24B, "wakeupragdollsphere" }, - { 0x24C, "dopplerpitch" }, - { 0x24D, "piecewiselinearlookup" }, - { 0x24E, "anglestoaxis" }, - { 0x24F, "visionsetwater" }, - { 0x250, "sendscriptusageanalysisdata" }, - { 0x251, "resetscriptusageanalysisdata" }, - { 0x252, "instantlylogusageanalysisdata" }, - { 0x253, "invertangles" }, - { 0x254, "rotatevectorinverted" }, - { 0x255, "calculatestartorientation" }, - { 0x256, "droptoground" }, - { 0x257, "setdemigodmode" }, - { 0x258, "precachelaser" }, - { 0x259, "_func_259" }, - { 0x25A, "getcsplinecount" }, - { 0x25B, "getcsplinepointcount" }, - { 0x25C, "getcsplinelength" }, - { 0x25D, "getcsplinepointid" }, - { 0x25E, "getcsplinepointlabel" }, - { 0x25F, "getcsplinepointtension" }, - { 0x260, "getcsplinepointposition" }, - { 0x261, "getcsplinepointcorridordims" }, - { 0x262, "getcsplinepointtangent" }, - { 0x263, "getcsplinepointdisttonextpoint" }, - { 0x264, "calccsplineposition" }, - { 0x265, "calccsplinetangent" }, - { 0x266, "calccsplinecorridor" }, - { 0x267, "setnojipscore" }, - { 0x268, "setnojiptime" }, - { 0x269, "getpredictedentityposition" }, - { 0x26A, "gamedvrprohibitrecording" }, - { 0x26B, "gamedvrstartrecording" }, - { 0x26C, "gamedvrstoprecording" }, - { 0x26D, "gamedvrsetvideometadata" }, - { 0x26E, "gamedvrprohibitscreenshots" }, - { 0x26F, "gamedvrsetscreenshotmetadata" }, - { 0x270, "queuedialog" }, - { 0x271, "speechenablegrammar" }, - { 0x272, "speechenable" }, - { 0x273, "livestreamingenable" }, - { 0x274, "livestreamingsetbitrate" }, - { 0x275, "livestreamingsetmetadata" }, - { 0x276, "livestreamingenablearchiving" }, - { 0x277, "triggerportableradarping" }, - { 0x278, "setglaregrimematerial" }, - { 0x279, "botgetteamlimit" }, - { 0x27A, "spawnfxforclient" }, - { 0x27B, "botgetteamdifficulty" }, - { 0x27C, "debugstar" }, - { 0x27D, "newdebughudelem" }, - { 0x27E, "printlightsetsettings" }, - { 0x27F, "lightsetdumpstate" }, - { 0x280, "getsquadassaultelo" }, - { 0x281, "loadluifile" }, - { 0x282, "isdedicatedserver" }, - { 0x283, "getplaylistversion" }, - { 0x284, "getplaylistid" }, - { 0x285, "getactiveclientcount" }, - { 0x286, "issquadsmode" }, - { 0x287, "getsquadassaultsquadindex" }, - { 0x288, "visionsetpostapply" }, - { 0x289, "addbot" }, - { 0x28A, "ishairrunning" }, - { 0x28B, "getnearbyarrayelements" }, - { 0x28C, "vectorclamp" }, - { 0x28D, "isalliedsentient" }, - { 0x28E, "istestclient" }, - { 0x28F, "getrandomnodedestination" }, - { 0x290, "debuglocalizestring" }, - { 0x291, "enablesoundcontextoverride" }, - { 0x292, "disablesoundcontextoverride" }, - { 0x293, "notifyoncommandremove" }, - { 0x294, "getsndaliasvalue" }, - { 0x295, "setsndaliasvalue" }, - { 0x296, "packedtablelookup" }, - { 0x297, "packedtablesectionlookup" }, - { 0x298, "packedtablelookupwithrange" }, - { 0x299, "grappletrace" }, - { 0x29A, "stopclientexploder" }, - { 0x29B, "closestpointstwosegs" }, - { 0x29C, "isremovedentity" }, - { 0x29D, "tablegetrowcount" }, - { 0x29E, "tablegetcolumncount" }, - { 0x29F, "batteryusepershot" }, - { 0x2A0, "batteryreqtouse" }, - { 0x2A1, "isweaponmanuallydetonatedbydoubletap" }, - { 0x2A2, "grapplegetmagnets" }, - { 0x2A3, "getweaponname" }, - { 0x2A4, "activatepersistentclientexploder" }, - { 0x2A5, "deployriotshield" }, - { 0x2A6, "validatecostume" }, - { 0x2A7, "randomcostume" }, - { 0x2A8, "shootblank" }, - { 0x2A9, "boidflockupdate" }, - { 0x2AA, "debuggetanimname" }, - { 0x2AB, "setspmatchdata" }, - { 0x2AC, "getspmatchdata" }, - { 0x2AD, "sendspmatchdata" }, - { 0x2AE, "clearspmatchdata" }, - { 0x2AF, "setspmatchdatadef" }, - { 0x2B0, "playcinematicforall" }, - { 0x2B1, "preloadcinematicforall" }, - { 0x2B2, "stopcinematicforall" }, - { 0x2B3, "capsuletracepassed" }, - { 0x2B4, "stopfxontagforclient" }, - { 0x2B5, "killfxontagforclient" }, - { 0x2B6, "isvector" }, - { 0x2B7, "notifychallengecomplete" }, - { 0x2B8, "lootservicestarttrackingplaytime" }, - { 0x2B9, "lootservicestoptrackingplaytime" }, - { 0x2BA, "lootservicevalidateplaytime" }, - { 0x2BB, "recordbreadcrumbdataforplayer" }, - { 0x2BC, "getweaponandattachmentmodels" }, - { 0x2BD, "changewhizbyautosimparams" }, - { 0x2BE, "sysprint" }, - { 0x2BF, "objective_mlgspectator" }, - { 0x2C0, "setspcheckpointdata" }, - { 0x2C1, "getspcheckpointdata" }, - { 0x2C2, "isnumber" }, - { 0x2C3, "isonlinegame" }, - { 0x2C4, "issystemlink" }, - { 0x2C5, "setsoundmasteringfadetime" }, - { 0x2C6, "getstanceandmotionstateforplayer" }, - { 0x2C7, "nodeisnotusable" }, - { 0x2C8, "nodesetnotusable" }, - { 0x2C9, "spawnlinkedfx" }, - { 0x2CA, "spawnlinkedfxforclient" }, - { 0x2CB, "getplaylistname" }, - { 0x2CC, "getlocaltimestring" }, - { 0x2CD, "isonwifi" }, - { 0x2CE, "getbuttonsconfig" }, - { 0x2CF, "getchallengeid" }, - { 0x2D0, "nodehasremotemissileset" }, - { 0x2D1, "nodegetremotemissilename" }, - { 0x2D2, "remotemissileenttracetooriginpassed" }, - { 0x2D3, "bombingruntracepassed" }, - { 0x2D4, "soundsettraceflags" }, - { 0x2D5, "handlepickupdeployedriotshield" }, - { 0x2D6, "getcodanywherecurrentplatform" }, - { 0x2D7, "getcostumefromtable" }, - { 0x2D8, "visionsetoverdrive" }, - { 0x2D9, "nodegetsplitgroup" }, - { 0x2DA, "recordbreadcrumbdataforplayersp" }, - { 0x2DB, "getchallengerewarditem" }, - { 0x2DC, "setentplayerxuidforemblem" }, - { 0x2DD, "resetentplayerxuidforemblems" }, - { 0x2DE, "nodesetremotemissilename" }, - { 0x2DF, "isshipbuild" }, - { 0x2E0, "strinsertnumericdelimiters" }, - { 0x2E1, "isscriptedagent" }, - { 0x2E2, "playfxonweapon" }, - { 0x2E3, "stopfxonweapon" }, - { 0x2E4, "killfxonweapon" }, - { 0x2E5, "getdefaultmaxfaceenemydistance" }, - { 0x2E6, "applyaccelerationonentity" }, - { 0x2E7, "applyimpulseonentity" }, - { 0x2E8, "setshaderconstant" }, - { 0x2E9, "getinventoryitemtype" }, - { 0x2EA, "getweaponmodelbounds" }, - { 0x2EB, "weaponitemplayidleanim" }, - { 0x2EC, "_func_2EC" }, - { 0x2ED, "getstaticmodelcount" }, - { 0x2EE, "getstaticmodelname" }, - { 0x2EF, "getstaticmodelbounds" }, - { 0x2F0, "findstaticmodelindex" }, - { 0x2F1, "getdynentcount" }, - { 0x2F2, "getdynentmodelname" }, - { 0x2F3, "getdynentmodelbounds" }, - { 0x2F4, "finddynentwithmodelindex" }, - { 0x2F5, "getentitymodelname" }, - { 0x2F6, "getentitymodelbounds" }, - { 0x2F7, "findentitywithmodelindex" }, - { 0x2F8, "_func_2F8" }, - { 0x2F9, "_func_2F9" }, - { 0x2FA, "_func_2FA" }, - { 0x2FB, "_func_2FB" }, - { 0x2FC, "_func_2FC" }, - { 0x2FD, "_func_2FD" }, - { 0x2FE, "_func_2FE" }, - { 0x2FF, "_func_2FF" }, - { 0x300, "_func_300" }, - { 0x301, "_func_301" }, - { 0x302, "_func_302" }, - { 0x303, "_func_303" }, - { 0x304, "_func_304" }, - { 0x305, "_func_305" }, - { 0x306, "_func_306" }, - { 0x307, "_func_307" }, - { 0x308, "_func_308" }, - { 0x309, "_func_309" }, - { 0x30A, "_func_30A" }, -}}; - -const std::array, 1415> method_list -{{ - { 0x8000, "thermaldrawdisable" }, - { 0x8001, "setturretdismountorg" }, - { 0x8002, "setdamagestage" }, - { 0x8003, "playsoundtoteam" }, - { 0x8004, "playsoundtoplayer" }, - { 0x8005, "playerhide" }, - { 0x8006, "playershow" }, - { 0x8007, "showtoplayer" }, - { 0x8008, "threatdetectedtoplayer" }, - { 0x8009, "clearthreatdetected" }, - { 0x800A, "enableplayeruse" }, - { 0x800B, "disableplayeruse" }, - { 0x800C, "enableammogeneration" }, - { 0x800D, "disableammogeneration" }, - { 0x800E, "makescrambler" }, - { 0x800F, "makeportableradar" }, - { 0x8010, "clearscrambler" }, - { 0x8011, "clearportableradar" }, - { 0x8012, "placespawnpoint" }, - { 0x8013, "setteamfortrigger" }, - { 0x8014, "clientclaimtrigger" }, - { 0x8015, "clientreleasetrigger" }, - { 0x8016, "releaseclaimedtrigger" }, - { 0x8017, "isusingonlinedataoffline" }, - { 0x8018, "getrestedtime" }, - { 0x8019, "sendleaderboards" }, - { 0x801A, "isonladder" }, - { 0x801B, "getcorpseanim" }, - { 0x801C, "playerforcedeathanim" }, - { 0x801D, "attach" }, - { 0x801E, "getlightfovinner" }, - { 0x801F, "getlightfovouter" }, - { 0x8020, "setlightfovrange" }, - { 0x8021, "getlightexponent" }, - { 0x8022, "setlightexponent" }, - { 0x8023, "startragdoll" }, - { 0x8024, "startragdollfromimpact" }, - { 0x8025, "queryshouldearlyragdoll" }, - { 0x8026, "logstring" }, - { 0x8027, "laserhidefromclient" }, - { 0x8028, "stopsounddspbus" }, - { 0x8029, "thermaldrawenable" }, - { 0x802A, "detach" }, - { 0x802B, "detachall" }, - { 0x802C, "getattachsize" }, - { 0x802D, "getattachmodelname" }, - { 0x802E, "getattachtagname" }, - { 0x802F, "setturretcanaidetach" }, - { 0x8030, "setturretfov" }, - { 0x8031, "setplayerturretfov" }, - { 0x8032, "lerpfov" }, - { 0x8033, "lerpfovscale" }, - { 0x8034, "getvalidcoverpeekouts" }, - { 0x8035, "gethighestnodestance" }, - { 0x8036, "doesnodeallowstance" }, - { 0x8037, "doesnodeforcecombat" }, - { 0x8038, "getgunangles" }, - { 0x8039, "magicgrenade" }, - { 0x803A, "magicgrenademanual" }, - { 0x803B, "getentnum" }, - { 0x803C, "launch" }, - { 0x803D, "setsoundblend" }, - { 0x803E, "makefakeai" }, - { 0x803F, "spawndrone" }, - { 0x8040, "setcorpseremovetimer" }, - { 0x8041, "setlookattext" }, - { 0x8042, "setspawnerteam" }, - { 0x8043, "addaieventlistener" }, - { 0x8044, "removeaieventlistener" }, - { 0x8045, "getlightcolor" }, - { 0x8046, "setlightcolor" }, - { 0x8047, "getlightradius" }, - { 0x8048, "setlightradius" }, - { 0x8049, "getattachignorecollision" }, - { 0x804A, "hidepart" }, - { 0x804B, "hidepart_allinstances" }, - { 0x804C, "hideallparts" }, - { 0x804D, "showpart" }, - { 0x804E, "showallparts" }, - { 0x804F, "linkto" }, - { 0x8050, "linktoblendtotag" }, - { 0x8051, "unlink" }, - { 0x8052, "setnormalhealth" }, - { 0x8053, "dodamage" }, - { 0x8054, "kill" }, - { 0x8055, "show" }, - { 0x8056, "hide" }, - { 0x8057, "showonclient" }, - { 0x8058, "hideonclient" }, - { 0x8059, "disconnectpaths" }, - { 0x805A, "connectpaths" }, - { 0x805B, "disconnectnode" }, - { 0x805C, "connectnode" }, - { 0x805D, "startusingheroonlylighting" }, - { 0x805E, "stopusingheroonlylighting" }, - { 0x805F, "startusinglessfrequentlighting" }, - { 0x8060, "stopusinglessfrequentlighting" }, - { 0x8061, "setmovingplatformplayerturnrate" }, - { 0x8062, "setthermalfog" }, - { 0x8063, "setnightvisionfog" }, - { 0x8064, "clearthermalfog" }, - { 0x8065, "clearnightvisionfog" }, - { 0x8066, "digitaldistortsetparams" }, - { 0x8067, "setmode" }, - { 0x8068, "getmode" }, - { 0x8069, "setturretignoregoals" }, - { 0x806A, "islinked" }, - { 0x806B, "enablelinkto" }, - { 0x806C, "playsoundatviewheight" }, - { 0x806D, "prefetchsound" }, - { 0x806E, "setpitch" }, - { 0x806F, "scalepitch" }, - { 0x8070, "setvolume" }, - { 0x8071, "scalevolume" }, - { 0x8072, "enableportalgroup" }, - { 0x8073, "setspeakermapmonotostereo" }, - { 0x8074, "setspeakermapmonoto51" }, - { 0x8075, "setdistributed2dsound" }, - { 0x8076, "playsoundasmaster" }, - { 0x8077, "playloopsound" }, - { 0x8078, "eqon" }, - { 0x8079, "eqoff" }, - { 0x807A, "haseq" }, - { 0x807B, "iswaitingonsound" }, - { 0x807C, "playfoley" }, - { 0x807D, "getnormalhealth" }, - { 0x807E, "playerlinkto" }, - { 0x807F, "playerlinktodelta" }, - { 0x8080, "playerlinkweaponviewtodelta" }, - { 0x8081, "playerlinktoabsolute" }, - { 0x8082, "playerlinktoblend" }, - { 0x8083, "playerlinkedoffsetenable" }, - { 0x8084, "setwaypointedgestyle_secondaryarrow" }, - { 0x8085, "setwaypointiconoffscreenonly" }, - { 0x8086, "fadeovertime" }, - { 0x8087, "scaleovertime" }, - { 0x8088, "moveovertime" }, - { 0x8089, "reset" }, - { 0x808A, "destroy" }, - { 0x808B, "setpulsefx" }, - { 0x808C, "setplayernamestring" }, - { 0x808D, "changefontscaleovertime" }, - { 0x808E, "startignoringspotlight" }, - { 0x808F, "stopignoringspotlight" }, - { 0x8090, "dontcastshadows" }, - { 0x8091, "castshadows" }, - { 0x8092, "setstablemissile" }, - { 0x8093, "playersetgroundreferenceent" }, - { 0x8094, "dontinterpolate" }, - { 0x8095, "dospawn" }, - { 0x8096, "stalingradspawn" }, - { 0x8097, "getorigin" }, - { 0x8098, "getcentroid" }, - { 0x8099, "getshootatpos" }, - { 0x809A, "getdebugeye" }, - { 0x809B, "useby" }, - { 0x809C, "playsound" }, - { 0x809D, "playsoundevent" }, - { 0x809E, "getsoundeventplayingonentity" }, - { 0x809F, "setsoundeventparameter" }, - { 0x80A0, "stopsoundevent" }, - { 0x80A1, "playerlinkedoffsetdisable" }, - { 0x80A2, "playerlinkedsetviewznear" }, - { 0x80A3, "playerlinkedsetusebaseangleforviewclamp" }, - { 0x80A4, "lerpviewangleclamp" }, - { 0x80A5, "setviewangleresistance" }, - { 0x80A6, "springcamenabled" }, - { 0x80A7, "springcamdisabled" }, - { 0x80A8, "linktoplayerview" }, - { 0x80A9, "unlinkfromplayerview" }, - { 0x80AA, "geteye" }, - { 0x80AB, "istouching" }, - { 0x80AC, "getistouchingentities" }, - { 0x80AD, "stoploopsound" }, - { 0x80AE, "stopsounds" }, - { 0x80AF, "playrumbleonentity" }, - { 0x80B0, "playrumblelooponentity" }, - { 0x80B1, "stoprumble" }, - { 0x80B2, "delete" }, - { 0x80B3, "setmodel" }, - { 0x80B4, "laseron" }, - { 0x80B5, "laseroff" }, - { 0x80B6, "laseraltviewon" }, - { 0x80B7, "laseraltviewoff" }, - { 0x80B8, "thermalvisionon" }, - { 0x80B9, "thermalvisionoff" }, - { 0x80BA, "thermalvisionfofoverlayon" }, - { 0x80BB, "thermalvisionfofoverlayoff" }, - { 0x80BC, "autospotoverlayon" }, - { 0x80BD, "autospotoverlayoff" }, - { 0x80BE, "seteyesonuplinkenabled" }, - { 0x80BF, "setdamagefeedback" }, - { 0x80C0, "setcontents" }, - { 0x80C1, "makeusable" }, - { 0x80C2, "makeunusable" }, - { 0x80C3, "makeglobalusable" }, - { 0x80C4, "makeglobalunusable" }, - { 0x80C5, "setwhizbyprobabilities" }, - { 0x80C6, "visionsetnakedforplayer_lerp" }, - { 0x80C7, "setwaitnode" }, - { 0x80C8, "returnplayercontrol" }, - { 0x80C9, "vehphys_starttrack" }, - { 0x80CA, "vehphys_clearautodisable" }, - { 0x80CB, "vehicleusealtblendedaudio" }, - { 0x80CC, "settext" }, - { 0x80CD, "clearalltextafterhudelem" }, - { 0x80CE, "setshader" }, - { 0x80CF, "settargetent" }, - { 0x80D0, "cleartargetent" }, - { 0x80D1, "settimer" }, - { 0x80D2, "settimerup" }, - { 0x80D3, "settimerstatic" }, - { 0x80D4, "settenthstimer" }, - { 0x80D5, "settenthstimerup" }, - { 0x80D6, "settenthstimerstatic" }, - { 0x80D7, "setclock" }, - { 0x80D8, "setclockup" }, - { 0x80D9, "setvalue" }, - { 0x80DA, "setwaypoint" }, - { 0x80DB, "setwaypointedgestyle_rotatingicon" }, - { 0x80DC, "setcursorhint" }, - { 0x80DD, "sethintstring" }, - { 0x80DE, "setsecondaryhintstring" }, - { 0x80DF, "forceusehinton" }, - { 0x80E0, "forceusehintoff" }, - { 0x80E1, "makesoft" }, - { 0x80E2, "makehard" }, - { 0x80E3, "willneverchange" }, - { 0x80E4, "startfiring" }, - { 0x80E5, "stopfiring" }, - { 0x80E6, "isfiringturret" }, - { 0x80E7, "startbarrelspin" }, - { 0x80E8, "stopbarrelspin" }, - { 0x80E9, "getbarrelspinrate" }, - { 0x80EA, "remotecontrolturret" }, - { 0x80EB, "remotecontrolturretoff" }, - { 0x80EC, "shootturret" }, - { 0x80ED, "getturretowner" }, - { 0x80EE, "enabledeathshield" }, - { 0x80EF, "nightvisiongogglesforceon" }, - { 0x80F0, "nightvisiongogglesforceoff" }, - { 0x80F1, "enableinvulnerability" }, - { 0x80F2, "disableinvulnerability" }, - { 0x80F3, "enablebreaching" }, - { 0x80F4, "disablebreaching" }, - { 0x80F5, "forceviewmodelanimation" }, - { 0x80F6, "disableturretdismount" }, - { 0x80F7, "enableturretdismount" }, - { 0x80F8, "uploadscore" }, - { 0x80F9, "uploadtime" }, - { 0x80FA, "uploadleaderboards" }, - { 0x80FB, "giveachievement" }, - { 0x80FC, "hidehud" }, - { 0x80FD, "showhud" }, - { 0x80FE, "mountvehicle" }, - { 0x80FF, "dismountvehicle" }, - { 0x8100, "enableslowaim" }, - { 0x8101, "disableslowaim" }, - { 0x8102, "usehintsinvehicle" }, - { 0x8103, "vehicleattackbuttonpressed" }, - { 0x8104, "setwhizbyoffset" }, - { 0x8105, "setsentryowner" }, - { 0x8106, "setsentrycarrier" }, - { 0x8107, "setturretminimapvisible" }, - { 0x8108, "settargetentity" }, - { 0x8109, "snaptotargetentity" }, - { 0x810A, "cleartargetentity" }, - { 0x810B, "getturrettarget" }, - { 0x810C, "setplayerspread" }, - { 0x810D, "setaispread" }, - { 0x810E, "setsuppressiontime" }, - { 0x810F, "setflaggedanimknobrestart" }, - { 0x8110, "setflaggedanimknoblimitedrestart" }, - { 0x8111, "setflaggedanimknoball" }, - { 0x8112, "setflaggedanimknoballrestart" }, - { 0x8113, "setflaggedanim" }, - { 0x8114, "setflaggedanimlimited" }, - { 0x8115, "setflaggedanimrestart" }, - { 0x8116, "setflaggedanimlimitedrestart" }, - { 0x8117, "useanimtree" }, - { 0x8118, "stopuseanimtree" }, - { 0x8119, "setanimtime" }, - { 0x811A, "allowstand" }, - { 0x811B, "allowcrouch" }, - { 0x811C, "allowprone" }, - { 0x811D, "allowlean" }, - { 0x811E, "allowswim" }, - { 0x811F, "setocclusion" }, - { 0x8120, "_meth_8120" }, - { 0x8121, "deactivateocclusion" }, - { 0x8122, "deactivateallocclusion" }, - { 0x8123, "isocclusionenabled" }, - { 0x8124, "_meth_8124" }, - { 0x8125, "_meth_8125" }, - { 0x8126, "_meth_8126" }, - { 0x8127, "_meth_8127" }, - { 0x8128, "iseqenabled" }, - { 0x8129, "seteq" }, - { 0x812A, "seteqbands" }, - { 0x812B, "deactivateeq" }, - { 0x812C, "seteqlerp" }, - { 0x812D, "islookingat" }, - { 0x812E, "isthrowinggrenade" }, - { 0x812F, "isfiring" }, - { 0x8130, "ismeleeing" }, - { 0x8131, "setautopickup" }, - { 0x8132, "allowmelee" }, - { 0x8133, "allowfire" }, - { 0x8134, "enablehealthshield" }, - { 0x8135, "setconvergencetime" }, - { 0x8136, "setconvergenceheightpercent" }, - { 0x8137, "setturretteam" }, - { 0x8138, "maketurretsolid" }, - { 0x8139, "maketurretoperable" }, - { 0x813A, "maketurretinoperable" }, - { 0x813B, "makeentitysentient" }, - { 0x813C, "freeentitysentient" }, - { 0x813D, "isindoor" }, - { 0x813E, "getdroptofloorposition" }, - { 0x813F, "isbadguy" }, - { 0x8140, "animscripted" }, - { 0x8141, "animscriptedthirdperson" }, - { 0x8142, "animrelative" }, - { 0x8143, "stopanimscripted" }, - { 0x8144, "clearanim" }, - { 0x8145, "setanimknob" }, - { 0x8146, "setanimknoblimited" }, - { 0x8147, "setanimknobrestart" }, - { 0x8148, "setanimknoblimitedrestart" }, - { 0x8149, "setanimknoball" }, - { 0x814A, "setanimknoballlimited" }, - { 0x814B, "setanimknoballrestart" }, - { 0x814C, "setanimknoballlimitedrestart" }, - { 0x814D, "setanim" }, - { 0x814E, "setanimlimited" }, - { 0x814F, "setanimrestart" }, - { 0x8150, "setanimlimitedrestart" }, - { 0x8151, "getanimtime" }, - { 0x8152, "getanimweight" }, - { 0x8153, "getanimassettype" }, - { 0x8154, "setflaggedanimknob" }, - { 0x8155, "setflaggedanimknoblimited" }, - { 0x8156, "setturretaccuracy" }, - { 0x8157, "setrightarc" }, - { 0x8158, "setleftarc" }, - { 0x8159, "settoparc" }, - { 0x815A, "setbottomarc" }, - { 0x815B, "setautorotationdelay" }, - { 0x815C, "setdefaultdroppitch" }, - { 0x815D, "restoredefaultdroppitch" }, - { 0x815E, "turretfiredisable" }, - { 0x815F, "getfixednodesafevolume" }, - { 0x8160, "clearfixednodesafevolume" }, - { 0x8161, "isingoal" }, - { 0x8162, "setruntopos" }, - { 0x8163, "nearnode" }, - { 0x8164, "nearclaimnode" }, - { 0x8165, "nearclaimnodeandangle" }, - { 0x8166, "atdangerousnode" }, - { 0x8167, "getisforcedincombat" }, - { 0x8168, "setisforcedincombat" }, - { 0x8169, "getenemyinfo" }, - { 0x816A, "clearenemy" }, - { 0x816B, "setentitytarget" }, - { 0x816C, "clearentitytarget" }, - { 0x816D, "setpotentialthreat" }, - { 0x816E, "clearpotentialthreat" }, - { 0x816F, "setflashbanged" }, - { 0x8170, "setengagementmindist" }, - { 0x8171, "setengagementmaxdist" }, - { 0x8172, "isknownenemyinradius" }, - { 0x8173, "isknownenemyinvolume" }, - { 0x8174, "settalktospecies" }, - { 0x8175, "invisiblenotsolid" }, - { 0x8176, "visiblesolid" }, - { 0x8177, "setdefaultaimlimits" }, - { 0x8178, "initriotshieldhealth" }, - { 0x8179, "getenemysqdist" }, - { 0x817A, "getclosestenemysqdist" }, - { 0x817B, "setthreatbiasgroup" }, - { 0x817C, "getthreatbiasgroup" }, - { 0x817D, "turretfireenable" }, - { 0x817E, "setturretmodechangewait" }, - { 0x817F, "usetriggerrequirelookat" }, - { 0x8180, "getstance" }, - { 0x8181, "setstance" }, - { 0x8182, "itemweaponsetammo" }, - { 0x8183, "getammocount" }, - { 0x8184, "gettagorigin" }, - { 0x8185, "gettagangles" }, - { 0x8186, "shellshock" }, - { 0x8187, "stunplayer" }, - { 0x8188, "stopshellshock" }, - { 0x8189, "fadeoutshellshock" }, - { 0x818A, "setdepthoffield" }, - { 0x818B, "setviewmodeldepthoffield" }, - { 0x818C, "setmotionblurmovescale" }, - { 0x818D, "pickupgrenade" }, - { 0x818E, "useturret" }, - { 0x818F, "stopuseturret" }, - { 0x8190, "canuseturret" }, - { 0x8191, "traversemode" }, - { 0x8192, "animmode" }, - { 0x8193, "orientmode" }, - { 0x8194, "getmotionangle" }, - { 0x8195, "shouldfacemotion" }, - { 0x8196, "getanglestolikelyenemypath" }, - { 0x8197, "setturretanim" }, - { 0x8198, "getturret" }, - { 0x8199, "getgroundenttype" }, - { 0x819A, "forcestartnegotiation" }, - { 0x819B, "setalienjumpcostscale" }, - { 0x819C, "setalienruncostscale" }, - { 0x819D, "setalientraversecostscale" }, - { 0x819E, "animcustom" }, - { 0x819F, "isinscriptedstate" }, - { 0x81A0, "canattackenemynode" }, - { 0x81A1, "getnegotiationstartnode" }, - { 0x81A2, "getnegotiationendnode" }, - { 0x81A3, "getnegotiationnextnode" }, - { 0x81A4, "getdoorpathnode" }, - { 0x81A5, "comparenodedirtopathdir" }, - { 0x81A6, "checkprone" }, - { 0x81A7, "pushplayer" }, - { 0x81A8, "checkgrenadethrowpos" }, - { 0x81A9, "setgoalnode" }, - { 0x81AA, "setgoalpos" }, - { 0x81AB, "setgoalentity" }, - { 0x81AC, "setgoalvolume" }, - { 0x81AD, "setgoalvolumeauto" }, - { 0x81AE, "getgoalvolume" }, - { 0x81AF, "cleargoalvolume" }, - { 0x81B0, "setfixednodesafevolume" }, - { 0x81B1, "setmotionblurturnscale" }, - { 0x81B2, "setmotionblurzoomscale" }, - { 0x81B3, "viewkick" }, - { 0x81B4, "localtoworldcoords" }, - { 0x81B5, "getentitynumber" }, - { 0x81B6, "getentityvelocity" }, - { 0x81B7, "enablegrenadetouchdamage" }, - { 0x81B8, "disablegrenadetouchdamage" }, - { 0x81B9, "enableaimassist" }, - { 0x81BA, "_meth_81BA" }, - { 0x81BB, "stoplookat" }, - { 0x81BC, "getmuzzlepos" }, - { 0x81BD, "getmuzzleangle" }, - { 0x81BE, "getmuzzlesideoffsetpos" }, - { 0x81BF, "getaimangle" }, - { 0x81C0, "canshoot" }, - { 0x81C1, "canshootenemy" }, - { 0x81C2, "cansee" }, - { 0x81C3, "seerecently" }, - { 0x81C4, "lastknowntime" }, - { 0x81C5, "lastknownpos" }, - { 0x81C6, "dropweapon" }, - { 0x81C7, "maymovetopoint" }, - { 0x81C8, "maymovefrompointtopoint" }, - { 0x81C9, "teleport" }, - { 0x81CA, "forceteleport" }, - { 0x81CB, "safeteleport" }, - { 0x81CC, "withinapproxpathdist" }, - { 0x81CD, "ispathdirect" }, - { 0x81CE, "allowedstances" }, - { 0x81CF, "isstanceallowed" }, - { 0x81D0, "issuppressionwaiting" }, - { 0x81D1, "issuppressed" }, - { 0x81D2, "ismovesuppressed" }, - { 0x81D3, "checkgrenadethrow" }, - { 0x81D4, "checkgrenadelaunch" }, - { 0x81D5, "checkgrenadelaunchpos" }, - { 0x81D6, "throwgrenade" }, - { 0x81D7, "disableaimassist" }, - { 0x81D8, "radiusdamage" }, - { 0x81D9, "detonate" }, - { 0x81DA, "damageconetrace" }, - { 0x81DB, "sightconetrace" }, - { 0x81DC, "missile_settargetent" }, - { 0x81DD, "missile_settargetpos" }, - { 0x81DE, "missile_cleartarget" }, - { 0x81DF, "missile_setflightmodedirect" }, - { 0x81E0, "missile_setflightmodetop" }, - { 0x81E1, "getlightintensity" }, - { 0x81E2, "setlightintensity" }, - { 0x81E3, "isragdoll" }, - { 0x81E4, "setmovespeedscale" }, - { 0x81E5, "cameralinkto" }, - { 0x81E6, "cameraunlink" }, - { 0x81E7, "startcoverarrival" }, - { 0x81E8, "starttraversearrival" }, - { 0x81E9, "checkcoverexitposwithpath" }, - { 0x81EA, "shoot" }, - { 0x81EB, "shootblank" }, - { 0x81EC, "melee" }, - { 0x81ED, "updateplayersightaccuracy" }, - { 0x81EE, "findshufflecovernode" }, - { 0x81EF, "findnearbycovernode" }, - { 0x81F0, "findcovernode" }, - { 0x81F1, "findbestcovernode" }, - { 0x81F2, "getcovernode" }, - { 0x81F3, "usecovernode" }, - { 0x81F4, "iscovervalidagainstenemy" }, - { 0x81F5, "reacquirestep" }, - { 0x81F6, "findreacquiredirectpath" }, - { 0x81F7, "trimpathtoattack" }, - { 0x81F8, "reacquiremove" }, - { 0x81F9, "findreacquireproximatepath" }, - { 0x81FA, "flagenemyunattackable" }, - { 0x81FB, "enterprone" }, - { 0x81FC, "exitprone" }, - { 0x81FD, "setproneanimnodes" }, - { 0x81FE, "updateprone" }, - { 0x81FF, "clearpitchorient" }, - { 0x8200, "setlookatanimnodes" }, - { 0x8201, "setlookat" }, - { 0x8202, "setlookatentity" }, - { 0x8203, "setlookatyawlimits" }, - { 0x8204, "controlslinkto" }, - { 0x8205, "controlsunlink" }, - { 0x8206, "makevehiclesolidcapsule" }, - { 0x8207, "teleportentityrelative" }, - { 0x8208, "makevehiclesolidsphere" }, - { 0x8209, "makevehiclesolid" }, - { 0x820A, "remotecontrolvehicle" }, - { 0x820B, "remotecontrolvehicleoff" }, - { 0x820C, "isfiringvehicleturret" }, - { 0x820D, "remotecontrolvehicletarget" }, - { 0x820E, "remotecontrolvehicletargetoff" }, - { 0x820F, "drivevehicleandcontrolturret" }, - { 0x8210, "drivevehicleandcontrolturretoff" }, - { 0x8211, "getplayersetting" }, - { 0x8212, "getlocalplayerprofiledata" }, - { 0x8213, "setlocalplayerprofiledata" }, - { 0x8214, "remotecamerasoundscapeon" }, - { 0x8215, "remotecamerasoundscapeoff" }, - { 0x8216, "setmotiontrackervisible" }, - { 0x8217, "getmotiontrackervisible" }, - { 0x8218, "worldpointinreticle_circle" }, - { 0x8219, "worldpointinreticle_rect" }, - { 0x821A, "getpointinbounds" }, - { 0x821B, "transfermarkstonewscriptmodel" }, - { 0x821C, "setwatersheeting" }, - { 0x821D, "addontoviewmodel" }, - { 0x821E, "clearviewmodeladdons" }, - { 0x821F, "setweaponhudiconoverride" }, - { 0x8220, "getweaponhudiconoverride" }, - { 0x8221, "setempjammed" }, - { 0x8222, "playersetexpfog" }, - { 0x8223, "playersetexpfogext" }, - { 0x8224, "playersetatmosfog" }, - { 0x8225, "isitemunlocked" }, - { 0x8226, "getplayerdata" }, - { 0x8227, "vehicleturretcontroloff" }, - { 0x8228, "isturretready" }, - { 0x8229, "vehicledriveto" }, - { 0x822A, "vehicle_dospawn" }, - { 0x822B, "vehicle_isphysveh" }, - { 0x822C, "vehphys_crash" }, - { 0x822D, "vehphys_launch" }, - { 0x822E, "vehphys_disablecrashing" }, - { 0x822F, "vehphys_enablecrashing" }, - { 0x8230, "vehphys_setspeed" }, - { 0x8231, "vehphys_setconveyorbelt" }, - { 0x8232, "freehelicopter" }, - { 0x8233, "playerlinkedturretanglesenable" }, - { 0x8234, "playerlinkedturretanglesdisable" }, - { 0x8235, "playerlinkedvehicleanglesenable" }, - { 0x8236, "playerlinkedvehicleanglesdisable" }, - { 0x8237, "playersetstreamorigin" }, - { 0x8238, "playerclearstreamorigin" }, - { 0x8239, "nightvisionviewon" }, - { 0x823A, "nightvisionviewoff" }, - { 0x823B, "painvisionon" }, - { 0x823C, "painvisionoff" }, - { 0x823D, "getplayerintelisfound" }, - { 0x823E, "setplayerintelfound" }, - { 0x823F, "newpip" }, - { 0x8240, "sethuddynlight" }, - { 0x8241, "startscriptedanim" }, - { 0x8242, "startcoverbehavior" }, - { 0x8243, "setplayerdata" }, - { 0x8244, "getcacplayerdata" }, - { 0x8245, "setcacplayerdata" }, - { 0x8246, "trackerupdate" }, - { 0x8247, "pingplayer" }, - { 0x8248, "buttonpressed" }, - { 0x8249, "sayteam" }, - { 0x824A, "sayall" }, - { 0x824B, "setspawnweapon" }, - { 0x824C, "dropitem" }, - { 0x824D, "dropscavengerbag" }, - { 0x824E, "setjitterparams" }, - { 0x824F, "sethoverparams" }, - { 0x8250, "joltbody" }, - { 0x8251, "freevehicle" }, - { 0x8252, "getwheelsurface" }, - { 0x8253, "getvehicleowner" }, - { 0x8254, "setvehiclelookattext" }, - { 0x8255, "setvehicleteam" }, - { 0x8256, "setneargoalnotifydist" }, - { 0x8257, "setvehgoalpos" }, - { 0x8258, "setgoalyaw" }, - { 0x8259, "cleargoalyaw" }, - { 0x825A, "settargetyaw" }, - { 0x825B, "cleartargetyaw" }, - { 0x825C, "vehicle_helisetai" }, - { 0x825D, "setturrettargetvec" }, - { 0x825E, "setturrettargetent" }, - { 0x825F, "clearturrettarget" }, - { 0x8260, "vehicle_canturrettargetpoint" }, - { 0x8261, "setlookatent" }, - { 0x8262, "clearlookatent" }, - { 0x8263, "setvehweapon" }, - { 0x8264, "fireweapon" }, - { 0x8265, "vehicleturretcontrolon" }, - { 0x8266, "finishplayerdamage" }, - { 0x8267, "suicide" }, - { 0x8268, "closeingamemenu" }, - { 0x8269, "iprintln" }, - { 0x826A, "iprintlnbold" }, - { 0x826B, "spawn" }, - { 0x826C, "setentertime" }, - { 0x826D, "cloneplayer" }, - { 0x826E, "istalking" }, - { 0x826F, "allowspectateteam" }, - { 0x8270, "forcespectatepov" }, - { 0x8271, "getguid" }, - { 0x8272, "physicslaunchserver" }, - { 0x8273, "physicslaunchserveritem" }, - { 0x8274, "clonebrushmodeltoscriptmodel" }, - { 0x8275, "scriptmodelplayanim" }, - { 0x8276, "scriptmodelclearanim" }, - { 0x8277, "scriptmodelplayanimdeltamotion" }, - { 0x8278, "vehicle_teleport" }, - { 0x8279, "attachpath" }, - { 0x827A, "getattachpos" }, - { 0x827B, "startpath" }, - { 0x827C, "setswitchnode" }, - { 0x827D, "setwaitspeed" }, - { 0x827E, "vehicle_finishdamage" }, - { 0x827F, "vehicle_setspeed" }, - { 0x8280, "vehicle_setspeedimmediate" }, - { 0x8281, "vehicle_rotateyaw" }, - { 0x8282, "vehicle_getspeed" }, - { 0x8283, "vehicle_getvelocity" }, - { 0x8284, "vehicle_getbodyvelocity" }, - { 0x8285, "vehicle_getsteering" }, - { 0x8286, "vehicle_getthrottle" }, - { 0x8287, "vehicle_turnengineoff" }, - { 0x8288, "vehicle_turnengineon" }, - { 0x8289, "vehicle_orientto" }, - { 0x828A, "getgoalspeedmph" }, - { 0x828B, "setacceleration" }, - { 0x828C, "setdeceleration" }, - { 0x828D, "resumespeed" }, - { 0x828E, "setyawspeed" }, - { 0x828F, "setyawspeedbyname" }, - { 0x8290, "setmaxpitchroll" }, - { 0x8291, "setairresistance" }, - { 0x8292, "setturningability" }, - { 0x8293, "getxuid" }, - { 0x8294, "getucdidhigh" }, - { 0x8295, "getucdidlow" }, - { 0x8296, "getclanidhigh" }, - { 0x8297, "getclanidlow" }, - { 0x8298, "ishost" }, - { 0x8299, "getspectatingplayer" }, - { 0x829A, "predictstreampos" }, - { 0x829B, "updatescores" }, - { 0x829C, "updatedmscores" }, - { 0x829D, "setrank" }, - { 0x829E, "setcardtitle" }, - { 0x829F, "weaponlocknoclearance" }, - { 0x82A0, "visionsyncwithplayer" }, - { 0x82A1, "showhudsplash" }, - { 0x82A2, "setperk" }, - { 0x82A3, "hasperk" }, - { 0x82A4, "clearperks" }, - { 0x82A5, "unsetperk" }, - { 0x82A6, "registerparty" }, - { 0x82A7, "getfireteammembers" }, - { 0x82A8, "noclip" }, - { 0x82A9, "ufo" }, - { 0x82AA, "moveto" }, - { 0x82AB, "movex" }, - { 0x82AC, "movey" }, - { 0x82AD, "movez" }, - { 0x82AE, "movegravity" }, - { 0x82AF, "moveslide" }, - { 0x82B0, "stopmoveslide" }, - { 0x82B1, "rotateto" }, - { 0x82B2, "rotatepitch" }, - { 0x82B3, "rotateyaw" }, - { 0x82B4, "rotateroll" }, - { 0x82B5, "addpitch" }, - { 0x82B6, "addyaw" }, - { 0x82B7, "addroll" }, - { 0x82B8, "vibrate" }, - { 0x82B9, "rotatevelocity" }, - { 0x82BA, "solid" }, - { 0x82BB, "notsolid" }, - { 0x82BC, "setcandamage" }, - { 0x82BD, "setcanradiusdamage" }, - { 0x82BE, "physicslaunchclient" }, - { 0x82BF, "setcardicon" }, - { 0x82C0, "setcardnameplate" }, - { 0x82C1, "setcarddisplayslot" }, - { 0x82C2, "kc_regweaponforfxremoval" }, - { 0x82C3, "laststandrevive" }, - { 0x82C4, "startlaststand" }, - { 0x82C5, "setspectatedefaults" }, - { 0x82C6, "getthirdpersoncrosshairoffset" }, - { 0x82C7, "disableweaponpickup" }, - { 0x82C8, "enableweaponpickup" }, - { 0x82C9, "weaponpickupenabled" }, - { 0x82CA, "issplitscreenplayer" }, - { 0x82CB, "getweaponslistoffhands" }, - { 0x82CC, "getweaponslistitems" }, - { 0x82CD, "getweaponslistexclusives" }, - { 0x82CE, "getweaponslist" }, - { 0x82CF, "canplayerplacesentry" }, - { 0x82D0, "canplayerplacetank" }, - { 0x82D1, "visionsetnakedforplayer" }, - { 0x82D2, "visionsetnightforplayer" }, - { 0x82D3, "visionsetmissilecamforplayer" }, - { 0x82D4, "visionsetthermalforplayer" }, - { 0x82D5, "visionsetpainforplayer" }, - { 0x82D6, "setblurforplayer" }, - { 0x82D7, "getplayerweaponmodel" }, - { 0x82D8, "getplayerknifemodel" }, - { 0x82D9, "updateentitywithweapons" }, - { 0x82DA, "notifyonplayercommand" }, - { 0x82DB, "canmantle" }, - { 0x82DC, "forcemantle" }, - { 0x82DD, "ismantling" }, - { 0x82DE, "playfx" }, - { 0x82DF, "player_recoilscaleon" }, - { 0x82E0, "player_recoilscaleoff" }, - { 0x82E1, "weaponlockstart" }, - { 0x82E2, "weaponlockfinalize" }, - { 0x82E3, "weaponlockfree" }, - { 0x82E4, "weaponlocktargettooclose" }, - { 0x82E5, "issplitscreenplayerprimary" }, - { 0x82E6, "markforeyeson" }, - { 0x82E7, "issighted" }, - { 0x82E8, "getsightedplayers" }, - { 0x82E9, "getplayerssightingme" }, - { 0x82EA, "getviewmodel" }, - { 0x82EB, "fragbuttonpressed" }, - { 0x82EC, "secondaryoffhandbuttonpressed" }, - { 0x82ED, "getcurrentweaponclipammo" }, - { 0x82EE, "setvelocity" }, - { 0x82EF, "getplayerviewheight" }, - { 0x82F0, "getnormalizedmovement" }, - { 0x82F1, "playlocalsound" }, - { 0x82F2, "stoplocalsound" }, - { 0x82F3, "setweaponammoclip" }, - { 0x82F4, "setweaponammostock" }, - { 0x82F5, "getweaponammoclip" }, - { 0x82F6, "getweaponammostock" }, - { 0x82F7, "anyammoforweaponmodes" }, - { 0x82F8, "setclientomnvar" }, - { 0x82F9, "setclientdvar" }, - { 0x82FA, "setclientdvars" }, - { 0x82FB, "setclientspawnsighttraces" }, - { 0x82FC, "clientspawnsighttracepassed" }, - { 0x82FD, "allowads" }, - { 0x82FE, "allowjump" }, - { 0x82FF, "allowladder" }, - { 0x8300, "allowmantle" }, - { 0x8301, "allowsprint" }, - { 0x8302, "setspreadoverride" }, - { 0x8303, "resetspreadoverride" }, - { 0x8304, "setaimspreadmovementscale" }, - { 0x8305, "setactionslot" }, - { 0x8306, "setviewkickscale" }, - { 0x8307, "getviewkickscale" }, - { 0x8308, "getweaponslistall" }, - { 0x8309, "getweaponslistprimaries" }, - { 0x830A, "getnormalizedcameramovement" }, - { 0x830B, "giveweapon" }, - { 0x830C, "takeweapon" }, - { 0x830D, "takeallweapons" }, - { 0x830E, "getcurrentweapon" }, - { 0x830F, "getcurrentprimaryweapon" }, - { 0x8310, "getcurrentoffhand" }, - { 0x8311, "hasweapon" }, - { 0x8312, "switchtoweapon" }, - { 0x8313, "switchtoweaponimmediate" }, - { 0x8314, "gethybridsightenabled" }, - { 0x8315, "switchtooffhand" }, - { 0x8316, "settacticalweapon" }, - { 0x8317, "gettacticalweapon" }, - { 0x8318, "beginlocationselection" }, - { 0x8319, "endlocationselection" }, - { 0x831A, "disableweapons" }, - { 0x831B, "enableweapons" }, - { 0x831C, "disableoffhandweapons" }, - { 0x831D, "enableoffhandweapons" }, - { 0x831E, "disableweaponswitch" }, - { 0x831F, "enableweaponswitch" }, - { 0x8320, "openpopupmenu" }, - { 0x8321, "openpopupmenunomouse" }, - { 0x8322, "closepopupmenu" }, - { 0x8323, "openmenu" }, - { 0x8324, "closemenu" }, - { 0x8325, "savematchrulestohistory" }, - { 0x8326, "freezecontrols" }, - { 0x8327, "disableusability" }, - { 0x8328, "enableusability" }, - { 0x8329, "setwhizbyspreads" }, - { 0x832A, "setwhizbyradii" }, - { 0x832B, "setreverb" }, - { 0x832C, "deactivatereverb" }, - { 0x832D, "setvolmod" }, - { 0x832E, "givestartammo" }, - { 0x832F, "givemaxammo" }, - { 0x8330, "getfractionstartammo" }, - { 0x8331, "getfractionmaxammo" }, - { 0x8332, "isdualwielding" }, - { 0x8333, "isreloading" }, - { 0x8334, "isswitchingweapon" }, - { 0x8335, "setorigin" }, - { 0x8336, "getvelocity" }, - { 0x8337, "setplayerangles" }, - { 0x8338, "getplayerangles" }, - { 0x8339, "usebuttonpressed" }, - { 0x833A, "attackbuttonpressed" }, - { 0x833B, "adsbuttonpressed" }, - { 0x833C, "meleebuttonpressed" }, - { 0x833D, "playerads" }, - { 0x833E, "isonground" }, - { 0x833F, "isusingturret" }, - { 0x8340, "setviewmodel" }, - { 0x8341, "setlethalweapon" }, - { 0x8342, "getlethalweapon" }, - { 0x8343, "enablefocus" }, - { 0x8344, "disablefocus" }, - { 0x8345, "enableaudiozoom" }, - { 0x8346, "disableaudiozoom" }, - { 0x8347, "_meth_8347" }, - { 0x8348, "startac130" }, - { 0x8349, "stopac130" }, - { 0x834A, "enablemousesteer" }, - { 0x834B, "setscriptmoverkillcam" }, - { 0x834C, "usinggamepad" }, - { 0x834D, "forcethirdpersonwhenfollowing" }, - { 0x834E, "disableforcethirdpersonwhenfollowing" }, - { 0x834F, "botsetflag" }, - { 0x8350, "botsetstance" }, - { 0x8351, "botsetscriptmove" }, - { 0x8352, "botsetscriptgoal" }, - { 0x8353, "botsetscriptgoalnode" }, - { 0x8354, "botclearscriptgoal" }, - { 0x8355, "botsetscriptenemy" }, - { 0x8356, "botclearscriptenemy" }, - { 0x8357, "botsetattacker" }, - { 0x8358, "botgetscriptgoal" }, - { 0x8359, "botgetscriptgoalradius" }, - { 0x835A, "botgetscriptgoalyaw" }, - { 0x835B, "botgetscriptgoaltype" }, - { 0x835C, "botgetentrancepoint" }, - { 0x835D, "botgetworldsize" }, - { 0x835E, "botnodeavailable" }, - { 0x835F, "botfindnoderandom" }, - { 0x8360, "botmemoryevent" }, - { 0x8361, "botmemoryselectpos" }, - { 0x8362, "botnodepick" }, - { 0x8363, "bothasscriptgoal" }, - { 0x8364, "botgetpersonality" }, - { 0x8365, "botthrowgrenade" }, - { 0x8366, "botgetmemoryevents" }, - { 0x8367, "botsetpersonality" }, - { 0x8368, "botsetdifficulty" }, - { 0x8369, "botgetdifficulty" }, - { 0x836A, "botgetworldclosestedge" }, - { 0x836B, "botlookatpoint" }, - { 0x836C, "botpredictseepoint" }, - { 0x836D, "botcanseeentity" }, - { 0x836E, "botgetnodesonpath" }, - { 0x836F, "botnodepickmultiple" }, - { 0x8370, "botgetnearestnode" }, - { 0x8371, "botgetfovdot" }, - { 0x8372, "botsetawareness" }, - { 0x8373, "botpursuingscriptgoal" }, - { 0x8374, "botgetscriptgoalnode" }, - { 0x8375, "botgetimperfectenemyinfo" }, - { 0x8376, "botflagmemoryevents" }, - { 0x8377, "botsetpathingstyle" }, - { 0x8378, "botsetdifficultysetting" }, - { 0x8379, "botgetdifficultysetting" }, - { 0x837A, "botgetpathdist" }, - { 0x837B, "botisrandomized" }, - { 0x837C, "botpressbutton" }, - { 0x837D, "botclearbutton" }, - { 0x837E, "botnodescoremultiple" }, - { 0x837F, "getnodenumber" }, - { 0x8380, "setclientowner" }, - { 0x8381, "setotherent" }, - { 0x8382, "setaisightlinevisible" }, - { 0x8383, "setentityowner" }, - { 0x8384, "nodeisdisconnected" }, - { 0x8385, "getnearestnode" }, - { 0x8386, "makeentitynomeleetarget" }, - { 0x8387, "isagent" }, - { 0x8388, "spawnagent" }, - { 0x8389, "finishagentdamage" }, - { 0x838A, "setagentattacker" }, - { 0x838B, "cloneagent" }, - { 0x838C, "agentcanseesentient" }, - { 0x838D, "scragentsetwaypoint" }, - { 0x838E, "scragentsetgoalpos" }, - { 0x838F, "scragentgetgoalpos" }, - { 0x8390, "scragentsetgoalnode" }, - { 0x8391, "scragentsetgoalentity" }, - { 0x8392, "scragentsetgoalradius" }, - { 0x8393, "scragentsetanimscale" }, - { 0x8394, "scragentsetorientmode" }, - { 0x8395, "scragentsetanimmode" }, - { 0x8396, "scragentsetphysicsmode" }, - { 0x8397, "scragentsetclipmode" }, - { 0x8398, "scragentsetmaxturnspeed" }, - { 0x8399, "scragentgetmaxturnspeed" }, - { 0x839A, "scragentbeginmelee" }, - { 0x839B, "scragentsetscripted" }, - { 0x839C, "scragentdotrajectory" }, - { 0x839D, "scragentdoanimlerp" }, - { 0x839E, "scragentsetviewheight" }, - { 0x839F, "scragentclaimnode" }, - { 0x83A0, "scragentrelinquishclaimednode" }, - { 0x83A1, "setradarping" }, - { 0x83A2, "setradarhighlight" }, - { 0x83A3, "setsonarvision" }, - { 0x83A4, "setharmonicbreach" }, - { 0x83A5, "setmaterialscriptparam" }, - { 0x83A6, "getaimassistdeltas" }, - { 0x83A7, "getaimassisttargetangles" }, - { 0x83A8, "getchargetime" }, - { 0x83A9, "overridereflectionprobe" }, - { 0x83AA, "defaultreflectionprobe" }, - { 0x83AB, "isholdinggrenade" }, - { 0x83AC, "isswitchinggrenade" }, - { 0x83AD, "ispreparinggrenade" }, - { 0x83AE, "setstencilstateoverride" }, - { 0x83AF, "clearstencilstateoverride" }, - { 0x83B0, "allowhighjump" }, - { 0x83B1, "isjumping" }, - { 0x83B2, "ishighjumping" }, - { 0x83B3, "vehicle_setvelocity" }, - { 0x83B4, "vehicle_addvelocity" }, - { 0x83B5, "getbraggingright" }, - { 0x83B6, "getmodelfromentity" }, - { 0x83B7, "getweaponheatlevel" }, - { 0x83B8, "isweaponoverheated" }, - { 0x83B9, "sprintbuttonpressed" }, - { 0x83BA, "vehicle_planethrottleoverride" }, - { 0x83BB, "vehicle_planethrottlereturncontrol" }, - { 0x83BC, "vehicle_planecrash" }, - { 0x83BD, "copyanimtreestate" }, - { 0x83BE, "lightsetforplayer" }, - { 0x83BF, "lightsetoverrideenableforplayer" }, - { 0x83C0, "lightsetoverridedisableforplayer" }, - { 0x83C1, "physicslaunchclientwithimpulse" }, - { 0x83C2, "setorcaavoidance" }, - { 0x83C3, "iswheelslipping" }, - { 0x83C4, "killnotification" }, - { 0x83C5, "setanimrate" }, - { 0x83C6, "setdoghandler" }, - { 0x83C7, "setdogcommand" }, - { 0x83C8, "setdogattackradius" }, - { 0x83C9, "isdogfollowinghandler" }, - { 0x83CA, "setdogmaxdrivespeed" }, - { 0x83CB, "isdogbeingdriven" }, - { 0x83CC, "setdogautoattackwhendriven" }, - { 0x83CD, "getdogattackbeginnode" }, - { 0x83CE, "setanimclass" }, - { 0x83CF, "enableanimstate" }, - { 0x83D0, "setanimstate" }, - { 0x83D1, "getanimentry" }, - { 0x83D2, "getanimentryname" }, - { 0x83D3, "getanimentryalias" }, - { 0x83D4, "getanimentrycount" }, - { 0x83D5, "pushplayervector" }, - { 0x83D6, "issprinting" }, - { 0x83D7, "playerlinkeduselinkedvelocity" }, - { 0x83D8, "shootstopsound" }, - { 0x83D9, "setclothtype" }, - { 0x83DA, "getclothmovesound" }, - { 0x83DB, "getequipmovesound" }, - { 0x83DC, "jumpbuttonpressed" }, - { 0x83DD, "rotateby" }, - { 0x83DE, "getlookaheaddir" }, - { 0x83DF, "getpathgoalpos" }, - { 0x83E0, "setrocketcorpse" }, - { 0x83E1, "setcorpsefalling" }, - { 0x83E2, "setsurfacetype" }, - { 0x83E3, "aiphysicstrace" }, - { 0x83E4, "aiphysicstracepassed" }, - { 0x83E5, "setdevtext" }, - { 0x83E6, "forcemovingplatformentity" }, - { 0x83E7, "setmovingplatformtrigger" }, - { 0x83E8, "visionsetstage" }, - { 0x83E9, "linkwaypointtotargetwithoffset" }, - { 0x83EA, "getlinkedparent" }, - { 0x83EB, "getmovingplatformparent" }, - { 0x83EC, "setnameplatematerial" }, - { 0x83ED, "retargetscriptmodellighting" }, - { 0x83EE, "setmantlesoundflavor" }, - { 0x83EF, "clearclienttriggeraudiozone" }, - { 0x83F0, "setclienttriggeraudiozone" }, - { 0x83F1, "makevehiclenotcollidewithplayers" }, - { 0x83F2, "getbobrate" }, - { 0x83F3, "setbobrate" }, - { 0x83F4, "setscriptablepartstate" }, - { 0x83F5, "stopsliding" }, - { 0x83F6, "cancelrocketcorpse" }, - { 0x83F7, "setdronegoalpos" }, - { 0x83F8, "hudoutlineenable" }, - { 0x83F9, "hudoutlinedisable" }, - { 0x83FA, "motionblurhqenable" }, - { 0x83FB, "motionblurhqdisable" }, - { 0x83FC, "screenshakeonentity" }, - { 0x83FD, "setpitchorient" }, - { 0x83FE, "worldpointtoscreenpos" }, - { 0x83FF, "linktoplayerviewignoreparentrot" }, - { 0x8400, "shouldplaymeleedeathanim" }, - { 0x8401, "botfirstavailablegrenade" }, - { 0x8402, "visionsetwaterforplayer" }, - { 0x8403, "setwatersurfacetransitionfx" }, - { 0x8404, "linktoplayerviewfollowwatersurface" }, - { 0x8405, "linktoplayerviewattachwatersurfacetransitioneffects" }, - { 0x8406, "playersetwaterfog" }, - { 0x8407, "emissiveblend" }, - { 0x8408, "enableforceviewmodeldof" }, - { 0x8409, "disableforceviewmodeldof" }, - { 0x840A, "setviewmodeldepth" }, - { 0x840B, "isenemyaware" }, - { 0x840C, "hasenemybeenseen" }, - { 0x840D, "physicssetmaxlinvel" }, - { 0x840E, "physicssetmaxangvel" }, - { 0x840F, "physicsgetlinvel" }, - { 0x8410, "physicsgetlinspeed" }, - { 0x8411, "physicsgetangvel" }, - { 0x8412, "physicsgetangspeed" }, - { 0x8413, "disablemissileboosting" }, - { 0x8414, "enablemissileboosting" }, - { 0x8415, "canspawntestclient" }, - { 0x8416, "spawntestclient" }, - { 0x8417, "setgrenadethrowscale" }, - { 0x8418, "setgrenadecookscale" }, - { 0x8419, "setplanesplineid" }, - { 0x841A, "hudoutlineenableforclient" }, - { 0x841B, "hudoutlinedisableforclient" }, - { 0x841C, "hudoutlineenableforclients" }, - { 0x841D, "hudoutlinedisableforclients" }, - { 0x841E, "turretsetbarrelspinenabled" }, - { 0x841F, "loadcustomizationplayerview" }, - { 0x8420, "hasloadedcustomizationplayerview" }, - { 0x8421, "setclienttriggeraudiozonelerp" }, - { 0x8422, "setclienttriggeraudiozonepartial" }, - { 0x8423, "scragentdoanimrelative" }, - { 0x8424, "rotatetolinked" }, - { 0x8425, "rotatebylinked" }, - { 0x8426, "setlinkedangles" }, - { 0x8427, "getcorpseentity" }, - { 0x8428, "removefrommovingplatformsystem" }, - { 0x8429, "logmatchdatalife" }, - { 0x842A, "logmatchdatadeath" }, - { 0x842B, "queuedialogforplayer" }, - { 0x842C, "setmlgcameradefaults" }, - { 0x842D, "ismlgspectator" }, - { 0x842E, "disableautoreload" }, - { 0x842F, "enableautoreload" }, - { 0x8430, "issprintsliding" }, - { 0x8431, "getlinkedchildren" }, - { 0x8432, "botpredictenemycampspots" }, - { 0x8433, "playsoundonmovingent" }, - { 0x8434, "cancelmantle" }, - { 0x8435, "hasfemalecustomizationmodel" }, - { 0x8436, "loadviewweapons" }, - { 0x8437, "setscriptabledamageowner" }, - { 0x8438, "getscriptabletypeforentity" }, - { 0x8439, "setfxkilldefondelete" }, - { 0x843A, "getdogavoident" }, - { 0x843B, "enabledogavoidance" }, - { 0x843C, "enablehybridsight" }, - { 0x843D, "lastknownreason" }, - { 0x843E, "gettagindex" }, - { 0x843F, "challengenotification" }, - { 0x8440, "cancelaimove" }, - { 0x8441, "vehicle_jetbikesethoverforcescale" }, - { 0x8442, "linktosynchronizedparent" }, - { 0x8443, "getclientomnvar" }, - { 0x8444, "drawpostresolve" }, - { 0x8445, "drawpostresolveoff" }, - { 0x8446, "getcacplayerdataforgroup" }, - { 0x8447, "cloakingenable" }, - { 0x8448, "cloakingdisable" }, - { 0x8449, "getunnormalizedcameramovement" }, - { 0x844A, "getturretheat" }, - { 0x844B, "isturretoverheated" }, - { 0x844C, "vehicle_jetbikegetthrustfraction" }, - { 0x844D, "vehicle_jetbikegetdragfraction" }, - { 0x844E, "vehicle_jetbikegetantislipfraction" }, - { 0x844F, "vehicle_jetbikegettotalrepulsorfraction" }, - { 0x8450, "vehicle_assignbrushmodelcollision" }, - { 0x8451, "vehicle_removebrushmodelcollision" }, - { 0x8452, "vehicle_hovertanksethoverforcescale" }, - { 0x8453, "forcesprint" }, - { 0x8454, "forceads" }, - { 0x8455, "forcedeathfall" }, - { 0x8456, "gethybridscopestate" }, - { 0x8457, "sethybridscopestate" }, - { 0x8458, "getvieworigin" }, - { 0x8459, "setweaponmodelvariant" }, - { 0x845A, "ridevehicle" }, - { 0x845B, "stopridingvehicle" }, - { 0x845C, "getmantlesound" }, - { 0x845D, "autoboltmissileeffects" }, - { 0x845E, "disablemissilestick" }, - { 0x845F, "enablemissilestick" }, - { 0x8460, "setmissileminimapvisible" }, - { 0x8461, "isoffhandweaponreadytothrow" }, - { 0x8462, "isleaning" }, - { 0x8463, "makecollidewithitemclip" }, - { 0x8464, "ismovementfromgamepad" }, - { 0x8465, "visionsetpostapplyforplayer" }, - { 0x8466, "setlookattarget" }, - { 0x8467, "clearlookattarget" }, - { 0x8468, "overridematerial" }, - { 0x8469, "overridematerialreset" }, - { 0x846A, "overridetexture" }, - { 0x846B, "overrideviewmodelmaterial" }, - { 0x846C, "overrideviewmodelmaterialreset" }, - { 0x846D, "enemyincrosshairs" }, - { 0x846E, "setviewmodelmaterialscriptparam" }, - { 0x846F, "vehicle_hovertankgetthrottleforce" }, - { 0x8470, "vehicle_hovertankgetrepulsorforces" }, - { 0x8471, "vehicle_hovertankgetantislipforce" }, - { 0x8472, "vehicle_hovertankgetuprightingforce" }, - { 0x8473, "vehicle_hovertankgetautoyawforce" }, - { 0x8474, "getturretyawrate" }, - { 0x8475, "getturretpitchrate" }, - { 0x8476, "setclienttriggervisionset" }, - { 0x8477, "overridelightingorigin" }, - { 0x8478, "defaultlightingorigin" }, - { 0x8479, "playdynamicambience" }, - { 0x847A, "stopdynamicambience" }, - { 0x847B, "isusinghandbrake" }, - { 0x847C, "isusingboost" }, - { 0x847D, "showviewmodel" }, - { 0x847E, "hideviewmodel" }, - { 0x847F, "setpickupweapon" }, - { 0x8480, "playerlinkedmantleenable" }, - { 0x8481, "allowpowerslide" }, - { 0x8482, "allowhighjumpdrop" }, - { 0x8483, "despawnagent" }, - { 0x8484, "vehicle_setfakespeed" }, - { 0x8485, "vehicle_jetbikesetthrustscale" }, - { 0x8486, "agentclearscriptvars" }, - { 0x8487, "scriptmodelplayanimdeltamotionfrompos" }, - { 0x8488, "drawfacingentity" }, - { 0x8489, "allowdodge" }, - { 0x848A, "setcanspawnvehicleson" }, - { 0x848B, "vehicle_setminimapvisible" }, - { 0x848C, "setclutforplayer" }, - { 0x848D, "setclutoverrideenableforplayer" }, - { 0x848E, "setclutoverridedisableforplayer" }, - { 0x848F, "setpainvisioneq" }, - { 0x8490, "setplayermech" }, - { 0x8491, "setdamagecallbackon" }, - { 0x8492, "finishentitydamage" }, - { 0x8493, "getlightshadowstate" }, - { 0x8494, "setlightshadowstate" }, - { 0x8495, "forceviewmodelanimationclear" }, - { 0x8496, "designatefoftarget" }, - { 0x8497, "sethintstringvisibleonlytoowner" }, - { 0x8498, "notifyonplayercommandremove" }, - { 0x8499, "canmantleex" }, - { 0x849A, "allowboostjump" }, - { 0x849B, "batterydischargebegin" }, - { 0x849C, "batterydischargeend" }, - { 0x849D, "batterydischargeonce" }, - { 0x849E, "batterygetcharge" }, - { 0x849F, "batterysetcharge" }, - { 0x84A0, "batteryfullrecharge" }, - { 0x84A1, "batterygetsize" }, - { 0x84A2, "batterysetdischargescale" }, - { 0x84A3, "batterygetdischargerate" }, - { 0x84A4, "batteryisinuse" }, - { 0x84A5, "enablephysicaldepthoffieldscripting" }, - { 0x84A6, "disablephysicaldepthoffieldscripting" }, - { 0x84A7, "setphysicaldepthoffield" }, - { 0x84A8, "setadsphysicaldepthoffield" }, - { 0x84A9, "vehicle_gettopspeed" }, - { 0x84AA, "gettoparc" }, - { 0x84AB, "getbottomarc" }, - { 0x84AC, "forcejump" }, - { 0x84AD, "vehicle_helicoptersetmaxangularvelocity" }, - { 0x84AE, "vehicle_helicoptersetmaxangularacceleration" }, - { 0x84AF, "setdemigod" }, - { 0x84B0, "attachnobuilddobj" }, - { 0x84B1, "setviewmodelanim" }, - { 0x84B2, "setviewmodelanimtime" }, - { 0x84B3, "pauseviewmodelanim" }, - { 0x84B4, "setadditiveviewmodelanim" }, - { 0x84B5, "activityfeedwriteingamepost" }, - { 0x84B6, "setcostumemodels" }, - { 0x84B7, "vehicle_getcurrentnode" }, - { 0x84B8, "setphysicalviewmodeldepthoffield" }, - { 0x84B9, "scriptmodelpauseanim" }, - { 0x84BA, "digitaldistortsetmaterial" }, - { 0x84BB, "disableoffhandsecondaryweapons" }, - { 0x84BC, "enableoffhandsecondaryweapons" }, - { 0x84BD, "canplaceriotshield" }, - { 0x84BE, "setriotshieldfailhint" }, - { 0x84BF, "enabledetonate" }, - { 0x84C0, "getdetonateenabled" }, - { 0x84C1, "playergetuseent" }, - { 0x84C2, "refreshshieldmodels" }, - { 0x84C3, "vehicle_diveboatissubmerged" }, - { 0x84C4, "scragentusemodelcollisionbounds" }, - { 0x84C5, "scragentsetwallruncost" }, - { 0x84C6, "getgravity" }, - { 0x84C7, "setgravityoverride" }, - { 0x84C8, "resetgravityoverride" }, - { 0x84C9, "vehphys_getvelocity" }, - { 0x84CA, "vehphys_isoffground" }, - { 0x84CB, "getjointype" }, - { 0x84CC, "vehicle_diveboatdive" }, - { 0x84CD, "addsoundmutedevice" }, - { 0x84CE, "removesoundmutedevice" }, - { 0x84CF, "clientaddsoundsubmix" }, - { 0x84D0, "clientclearsoundsubmix" }, - { 0x84D1, "clientclearallsubmixes" }, - { 0x84D2, "clientblendsoundsubmix" }, - { 0x84D3, "clientmakesoundsubmixsticky" }, - { 0x84D4, "clientmakesoundsubmixunsticky" }, - { 0x84D5, "clientenablesoundcontextoverride" }, - { 0x84D6, "clientdisablesoundcontextoverride" }, - { 0x84D7, "getthreatsightdelay" }, - { 0x84D8, "isusingoffhand" }, - { 0x84D9, "physicsstop" }, - { 0x84DA, "setremotehelicopterthrottlescale" }, - { 0x84DB, "actorusemodelcollisionbounds" }, - { 0x84DC, "setaxialmove" }, - { 0x84DD, "pathabilityadd" }, - { 0x84DE, "pathabilityremove" }, - { 0x84DF, "evaluatetrajectorydelta" }, - { 0x84E0, "rotateovertime" }, - { 0x84E1, "vehicle_diveboatenabledive" }, - { 0x84E2, "initwaterclienttrigger" }, - { 0x84E3, "getplayerweaponviewmodel" }, - { 0x84E4, "setturretheatwhenoverheating" }, - { 0x84E5, "setthreatdetection" }, - { 0x84E6, "loadcostumemodels" }, - { 0x84E7, "crouchbuttonpressed" }, - { 0x84E8, "disablealternatemelee" }, - { 0x84E9, "enablealternatemelee" }, - { 0x84EA, "hasblendshapes" }, - { 0x84EB, "getactiveanimations" }, - { 0x84EC, "hidepartviewmodel" }, - { 0x84ED, "luiopenmenu" }, - { 0x84EE, "screenpostoworldpoint" }, - { 0x84EF, "iscloaked" }, - { 0x84F0, "vehicleget3pcameraoffset" }, - { 0x84F1, "vehicleget3ppitchclamp" }, - { 0x84F2, "setstompbreakthrough" }, - { 0x84F3, "getstompbreakthrough" }, - { 0x84F4, "selfieaccessselfievalidflaginplayerdef" }, - { 0x84F5, "selfieaccessselfiecustomassetsarestreamed" }, - { 0x84F6, "selfieupdateselfieviewparameters" }, - { 0x84F7, "selfieinitializeselfieupdate" }, - { 0x84F8, "selfiescreenshottaken" }, - { 0x84F9, "selfieuploadcompleted" }, - { 0x84FA, "selfierestorebufferswaps" }, - { 0x84FB, "getsystemtimesp" }, - { 0x84FC, "setmissilecoasting" }, - { 0x84FD, "setmlgspectator" }, - { 0x84FE, "gettotalmpxp" }, - { 0x84FF, "turretsetgroundaimentity" }, - { 0x8500, "hideweapontags" }, - { 0x8501, "getweapondamagelocationmultiplier" }, - { 0x8502, "setorbiterents" }, - { 0x8503, "enablereload" }, - { 0x8504, "isgroundentoverwater" }, - { 0x8505, "setballpassallowed" }, - { 0x8506, "consumereinforcement" }, - { 0x8507, "ghost" }, - { 0x8508, "loadweapons" }, - { 0x8509, "playscheduledcinematicsound" }, - { 0x850A, "setopaqueunlitforplayer" }, - { 0x850B, "setwaypointiconfadeatcenter" }, - { 0x850C, "setreinforcementhintstrings" }, - { 0x850D, "enablecustomweaponcontext" }, - { 0x850E, "disablecustomweaponcontext" }, - { 0x850F, "setshadowrendering" }, - { 0x8510, "playlocalannouncersound" }, - { 0x8511, "setmissilespecialclipmask" }, - { 0x8512, "vehicle_diveboatgetthrottleforce" }, - { 0x8513, "vehicle_diveboatgetdragforce" }, - { 0x8514, "isdodging" }, - { 0x8515, "ispowersliding" }, - { 0x8516, "getusableentity" }, - { 0x8517, "getcurrentping" }, - { 0x8518, "sethidetrigger" }, - { 0x8519, "detonatebydoubletap" }, - { 0x851A, "getnormalizedflick" }, - { 0x851B, "getdwid" }, - { 0x851C, "setplayerinfospmatchdata" }, - { 0x851D, "physicsisactive" }, - { 0x851E, "hasanimtree" }, - { 0x851F, "isgod" }, - { 0x8520, "setagentcostumeindex" }, - { 0x8521, "visionsetoverdriveforplayer" }, - { 0x8522, "issplitscreenotherplayerenemy" }, - { 0x8523, "setowneroriginal" }, - { 0x8524, "getlinkedtagname" }, - { 0x8525, "forcefirstpersonwhenfollowed" }, - { 0x8526, "disableforcefirstpersonwhenfollowed" }, - { 0x8527, "setwaypointaerialtargeting" }, - { 0x8528, "worldweaponsloaded" }, - { 0x8529, "enablegrenadethrowback" }, - { 0x852A, "usetriggertouchcheckstance" }, - { 0x852B, "onlystreamactiveweapon" }, - { 0x852C, "precachekillcamiconforweapon" }, - { 0x852D, "selfierequestupdate" }, - { 0x852E, "getclanwarsbonus" }, - { 0x852F, "scragentsetspecies" }, - { 0x8530, "scragentallowboost" }, - { 0x8531, "scragentsetnopenetrate" }, - { 0x8532, "finishplayerdamage_impactfx" }, - { 0x8533, "finishagentdamage_impactfx" }, - { 0x8534, "scragentsetorienttoground" }, - { 0x8535, "scragentsetallowragdoll" }, - { 0x8536, "scragentsetobstacleavoid" }, - { 0x8537, "scragentsetlateralcodemove" }, - { 0x8538, "scragentsetpathteamspread" }, - { 0x8539, "isnotarget" }, - { 0x853A, "setmovingplatformjitter" }, - { 0x853B, "agentusescragentclipmask" }, - { 0x853C, "setmeleechargevalid" }, - { 0x853D, "ishighjumpallowed" }, - { 0x853E, "setprestigemastery" }, - { 0x853F, "agentsetfavoriteenemy" }, - { 0x8540, "getpointinmodelbounds" }, - { 0x8541, "setexomeleechargevalid" }, - { 0x8542, "setdivision" }, - { 0x8543, "setgrapplinghooktarget" }, - { 0x8544, "scragentgetnodesonpath" }, - { 0x8545, "addzmexploderbloodfx" }, - { 0x8546, "sethighjumpresetallowed" }, - { 0x8547, "scragentsetzombietype" }, - { 0x8548, "getgroundentity" }, - { 0x8549, "isnoclip" }, - { 0x854A, "deleteonhostmigration" }, - { 0x854B, "scragentgetphysicsmode" }, - { 0x854C, "deathdropgrenade" }, - { 0x854D, "stopsound" }, - { 0x854E, "scragentsettraversenoderadius" }, - { 0x854F, "scragentgettraversenoderadius" }, - { 0x8550, "_meth_8550" }, // not allowriotshieldplant, something to do with lighting - { 0x8551, "setstatic" }, - { 0x8552, "scragentsynchronizeanims" }, - { 0x8553, "settertiaryhintstring" }, - { 0x8554, "scragentclearpath" }, - { 0x8555, "scragenttrimpath" }, - { 0x8556, "getsnapshotindexforclient" }, - { 0x8557, "getsnapshotacknowledgedindexforclient" }, - { 0x8558, "hasanimstate" }, - { 0x8559, "movecomparison_enable" }, - { 0x855A, "movecomparison_setbuttonpressed" }, - { 0x855B, "movecomparison_setstickvalue" }, - { 0x855C, "cloneclientasscriptmodel" }, - { 0x855D, "disablerootmotion" }, - { 0x855E, "playerlinktodeltablendviewangle" }, - { 0x855F, "startweaponinspection" }, - { 0x8560, "isinspectingweapon" }, - { 0x8561, "luinotifyevent" }, - { 0x8562, "luinotifyeventtospectators" }, - { 0x8563, "enablequatinterpolationrotation" }, - { 0x8564, "doesnodeforceidle" }, - { 0x8565, "setisignoringgrenades" }, - { 0x8566, "_meth_8566" }, - { 0x8567, "_meth_8567" }, - { 0x8568, "_meth_8568" }, - { 0x8569, "_meth_8569" }, - { 0x856A, "_meth_856A" }, - { 0x856B, "_meth_856B" }, - { 0x856C, "_meth_856C" }, - { 0x856D, "_meth_856D" }, - { 0x856E, "_meth_856E" }, - { 0x856F, "_meth_856F" }, - { 0x8570, "_meth_8570" }, - { 0x8571, "_meth_8571" }, - { 0x8572, "_meth_8572" }, - { 0x8573, "_meth_8573" }, - { 0x8574, "_meth_8574" }, - { 0x8575, "_meth_8575" }, - { 0x8576, "_meth_8576" }, - { 0x8577, "_meth_8577" }, - { 0x8578, "_meth_8578" }, - { 0x8579, "_meth_8579" }, // luinotifyeventto whom? - { 0x857A, "_meth_857A" }, - { 0x857B, "_meth_857B" }, - { 0x857C, "_meth_857C" }, - { 0x857D, "_meth_857D" }, - { 0x857E, "_meth_857E" }, - { 0x857F, "_meth_857F" }, - { 0x8580, "_meth_8580" }, - { 0x8581, "_meth_8581" }, - { 0x8582, "_meth_8582" }, - { 0x8583, "_meth_8583" }, - { 0x8584, "_meth_8584" }, - { 0x8585, "_meth_8585" }, - { 0x8586, "_meth_8586" }, -}}; - -const std::array, 42947> token_list +extern std::array, token_count> const token_list {{ { 0x0000, "" }, { 0x0001, "pl#" }, @@ -45666,53 +43002,4 @@ const std::array, 42947> token_list // { 0xA7ED, "" }, }}; -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()); - function_map.reserve(function_list.size()); - function_map_rev.reserve(function_list.size()); - method_map.reserve(method_list.size()); - method_map_rev.reserve(method_list.size()); - token_map.reserve(token_list.size()); - token_map_rev.reserve(token_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 : function_list) - { - function_map.insert({ entry.first, entry.second }); - function_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : method_list) - { - method_map.insert({ entry.first, entry.second }); - method_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : token_list) - { - token_map.insert({ entry.first, entry.second }); - token_map_rev.insert({ entry.second, entry.first }); - } - } -}; - -__init__ _; - } // namespace xsk::gsc::h1 - -#ifdef _MSC_VER -#pragma warning(pop) -#endif diff --git a/src/h1/stdafx.cpp b/src/h1/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/h1/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/h1/stdafx.hpp b/src/h1/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/h1/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/h1/xsk/assembler.cpp b/src/h1/xsk/assembler.cpp deleted file mode 100644 index 5aa9b38f..00000000 --- a/src/h1/xsk/assembler.cpp +++ /dev/null @@ -1,555 +0,0 @@ -// 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 "h1.hpp" - -namespace xsk::gsc::h1 -{ - -auto assembler::output_script() -> std::vector -{ - std::vector script; - - if (script_ == nullptr) return script; - - script.resize(script_->pos()); - std::memcpy(script.data(), script_->buffer().data(), script.size()); - - return script; -} - -auto assembler::output_stack() -> std::vector -{ - std::vector stack; - - if (stack_ == nullptr) return stack; - - stack.resize(stack_->pos()); - std::memcpy(stack.data(), stack_->buffer().data(), stack.size()); - - return stack; -} - -void assembler::assemble(const std::string& file, std::vector& data) -{ - std::vector assembly = utils::string::clean_buffer_lines(data); - std::vector functions; - function::ptr func = nullptr; - std::uint32_t index = 1; - std::uint16_t switchnum = 0; - - for (auto& line : assembly) - { - if (line == "" || line.substr(0, 2) == "//") - { - continue; - } - else if (line.substr(0, 4) == "sub_") - { - func = std::make_unique(); - func->index = index; - func->name = line.substr(4); - } - else if (line.substr(0, 4) == "end_") - { - if (func != nullptr) - { - func->size = index - func->index; - functions.push_back(std::move(func)); - } - } - else if (line.substr(0, 4) == "loc_") - { - func->labels[index] = line; - } - else - { - auto opdata = utils::string::parse_code(line); - - if (switchnum) - { - if (opdata[0] == "case" || opdata[0] == "default") - { - for (auto& entry : opdata) - { - func->instructions.back()->data.push_back(entry); - } - switchnum--; - continue; - } - - throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); - } - else - { - auto inst = std::make_unique(); - inst->index = index; - inst->opcode = resolver::opcode_id(opdata[0]); - inst->size = opcode_size(inst->opcode); - opdata.erase(opdata.begin()); - inst->data = std::move(opdata); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = inst->data[0].substr(4); - break; - case opcode::OP_endswitch: - switchnum = static_cast(std::stoi(inst->data[0])); - inst->size += 7 * switchnum; - break; - default: - break; - } - - index += inst->size; - func->instructions.push_back(std::move(inst)); - } - } - } - - assemble(file, functions); -} - -void assembler::assemble(const std::string& file, std::vector& funcs) -{ - script_ = std::make_unique(0x100000); - stack_ = std::make_unique(0x100000); - filename_ = file; - functions_ = std::move(funcs); - - script_->write(static_cast(opcode::OP_End)); - - for (const auto& func : functions_) - { - assemble_function(func); - } -} - -void assembler::assemble_function(const function::ptr& func) -{ - labels_ = func->labels; - - func->id = resolver::token_id(func->name); - - stack_->write(func->size); - stack_->write(static_cast(func->id)); - - if (func->id == 0) - { - stack_->write_c_string(func->name); - } - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->write(std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->write(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - 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(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_GetAnimation: - script_->write(0); - script_->write(0); - stack_->write_c_string(inst->data[0]); - stack_->write_c_string(inst->data[1]); - break; - case opcode::OP_GetAnimTree: - script_->write(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_waittillmatch: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - assemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - assemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - assemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - assemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - assemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - assemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - assemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - assemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - assemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - assemble_jump(inst, false, true); - break; - case opcode::OP_jump: - assemble_jump(inst, false, false); - break; - case opcode::OP_switch: - assemble_switch(inst); - break; - case opcode::OP_endswitch: - assemble_end_switch(inst); - break; - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } - - const auto id = method ? resolver::method_id(inst->data[0]) : resolver::function_id(inst->data[0]); - - script_->write(id); -} - -void assembler::assemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto addr = resolve_function(inst->data[0]); - const auto offset = static_cast(addr - inst->index - 1); - - assemble_offset(offset); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } -} - -void assembler::assemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->write(0); - script_->write(0); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[2]))); - } - - const auto file_id = resolver::token_id(inst->data[0]); - const auto func_id = resolver::token_id(inst->data[1]); - - stack_->write(file_id); - if (file_id == 0) stack_->write_c_string(inst->data[0]); - stack_->write(func_id); - if (func_id == 0) stack_->write_c_string(inst->data[1]); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const auto addr = resolve_label(inst->data[0]); - - script_->write(addr - inst->index - 4); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - - script_->write(static_cast(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); - stack_->write_c_string(inst->data[1 + (3 * i) + 1]); - } - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 2]); - - assemble_offset(addr - index); - - index += 3; - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write(0); - stack_->write_c_string("\x01"); - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 1]); - - assemble_offset(addr - index); - - index += 3; - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::assemble_field_variable(const instruction::ptr& inst) -{ - auto id = resolver::token_id(inst->data[0]); - - if (id == 0) id = 0xFFFF; - - script_->write(id); - - if (id > max_string_id) - { - stack_->write(0); - stack_->write_c_string(inst->data[0]); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - const auto addr = resolve_label(inst->data[0]); - - if (expr) - { - script_->write(static_cast(addr - inst->index - 3)); - } - else if (back) - { - script_->write(static_cast((inst->index + 3) - addr)); - } - else - { - script_->write(static_cast(addr - inst->index - 5)); - } -} - -void assembler::assemble_offset(std::int32_t offset) -{ - std::array bytes = {}; - - offset = (offset << 10) >> 8; - - *reinterpret_cast(bytes.data()) = offset; - - script_->write(bytes[0]); - script_->write(bytes[1]); - script_->write(bytes[2]); -} - -auto assembler::resolve_function(const std::string& name) -> std::int32_t -{ - for (const auto& entry : functions_) - { - if (entry->name == name) - { - return entry->index; - } - } - - throw asm_error("couldn't resolve local function address of '" + name + "'!"); -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/assembler.hpp b/src/h1/xsk/assembler.hpp deleted file mode 100644 index 6556e2bd..00000000 --- a/src/h1/xsk/assembler.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::h1 -{ - -class assembler : public gsc::assembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output_script() -> std::vector; - auto output_stack() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, std::vector& funcs); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void assemble_local_call(const instruction::ptr& inst, bool thread); - void assemble_far_call(const instruction::ptr& inst, bool thread); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void assemble_field_variable(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst, bool expr, bool back); - void assemble_offset(std::int32_t offset); - auto resolve_function(const std::string& name) -> std::int32_t; - auto resolve_label(const std::string& name) -> std::int32_t; -}; - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/compiler.cpp b/src/h1/xsk/compiler.cpp deleted file mode 100644 index b7ce4216..00000000 --- a/src/h1/xsk/compiler.cpp +++ /dev/null @@ -1,2971 +0,0 @@ -// 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 "h1.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -namespace xsk::gsc::h1 -{ - -auto compiler::output() -> std::vector -{ - return std::move(assembly_); -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "an unknown error ocurred while parsing gsc file"); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_.clear(); - includes_.clear(); - animtrees_.clear(); - constants_.clear(); - local_functions_.clear(); - index_ = 1; - 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& inc : includes_) - { - if (inc.name == path) - { - throw comp_error(include->loc(), "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(), "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 developer block comment"); - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) -{ - const auto itr = constants_.find(constant->name->value); - - if (itr != constants_.end()) - throw comp_error(constant->loc(), "duplicated constant '" + constant->name->value + "'"); - - 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; - - auto blk = std::make_unique(); - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - break_blks_.clear(); - continue_blks_.clear(); - - process_thread(thread, blk); - - emit_expr_parameters(thread->params, blk); - emit_stmt_list(thread->stmt, blk, true); - emit_opcode(opcode::OP_End); - - function_->size = index_ - function_->index; - assembly_.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list, blk, last); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev, blk, last); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend, blk); - break; - case ast::kind::stmt_waitframe: - emit_stmt_waitframe(stmt.as_waitframe, blk); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if, blk, last); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse, blk, last); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case, blk); - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default, blk); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return, blk); - break; - case ast::kind::stmt_breakpoint: - emit_stmt_breakpoint(stmt.as_breakpoint, blk); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin, blk); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end, blk); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last) -{ - for (const auto& entry : stmt->list) - { - bool last_ = (&entry == &stmt->list.back() && last) ? true : false; - emit_stmt(entry, blk, last_); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last) -{ - emit_stmt_list(stmt->list, blk, last); -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - 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, const block::ptr& blk) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, blk, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, blk, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_endon); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } - - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->time, blk); - emit_opcode(opcode::OP_wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittill); - - for (const auto& entry : stmt->args->list) - { - variable_create(entry.as_identifier, blk); - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(entry.as_identifier, blk)); - } - - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - emit_expr_arguments(stmt->args, blk); - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_waittillmatch2); - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waittillFrameEnd); -} - -void compiler::emit_stmt_waitframe(const ast::stmt_waitframe::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waitFrame); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - blk->transfer(stmt->blk); - - emit_stmt(stmt->stmt, stmt->blk, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last) -{ - std::vector childs; - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - blk->transfer(stmt->blk_if); - - emit_stmt(stmt->stmt_if, stmt->blk_if, last); - - emit_remove_local_vars(stmt->blk_if); - - if (stmt->blk_if->abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - - last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - - blk->transfer(stmt->blk_else); - - emit_stmt(stmt->stmt_else, stmt->blk_else, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk_else); - - if (stmt->blk_else->abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - - insert_label(end_loc); - - blk->init_from_child(childs); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_stmt(stmt->init, blk, false); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->blk_iter); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - can_break_ = true; - can_continue_ = true; - - emit_stmt(stmt->stmt, stmt->blk, false); - - if (stmt->blk->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->blk.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->blk_iter->init_from_child(continue_blks_); - - emit_stmt(stmt->iter, stmt->blk_iter, false); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_expr(stmt->array_expr, blk); - emit_expr_variable_ref(stmt->array, blk, true); - emit_expr_variable(stmt->array, blk); - emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); - emit_expr_variable_ref(stmt->key_expr, blk, true); - - blk->transfer(stmt->ctx); - stmt->ctx->loc_break = break_loc; - stmt->ctx->loc_continue = continue_loc; - - emit_create_local_vars(stmt->ctx); - - blk->local_vars_create_count = stmt->ctx->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->ctx_post); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr, blk); - emit_opcode(opcode::OP_CallBuiltin1, "isdefined"); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr, stmt->ctx); - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->array.as_identifier, stmt->ctx)); - emit_expr_variable_ref(stmt->value_expr, stmt->ctx, true); - emit_stmt(stmt->stmt, stmt->ctx, false); - - if (stmt->ctx->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->ctx.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->ctx_post->init_from_child(continue_blks_); - - emit_expr_variable(stmt->key_expr, stmt->ctx_post); - emit_expr_variable(stmt->array, stmt->ctx_post); - emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); - emit_expr_variable_ref(stmt->key_expr, stmt->ctx_post, true); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - emit_expr_clear_local(stmt->array.as_identifier, blk); - if (!stmt->use_key) emit_expr_clear_local(stmt->key_expr.as_identifier, blk); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_break = can_break_; - break_blks_.clear(); - can_break_ = false; - - auto jmptable_loc = create_label(); - auto break_loc = create_label(); - - emit_expr(stmt->test, blk); - 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; - block* default_ctx = nullptr; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - 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"); - } - - blk->transfer(case_->blk); - case_->blk->loc_break = break_loc; - emit_stmt_list(case_->stmt, case_->blk, false); - if (case_->stmt->list.size() > 0) - emit_remove_local_vars(case_->blk); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - - has_default = true; - default_ctx = entry.as_default->blk.get(); - - blk->transfer(entry.as_default->blk); - entry.as_default->blk->loc_break = break_loc; - emit_stmt_list(entry.as_default->stmt, entry.as_default->blk, false); - if (entry.as_default->stmt->list.size() > 0) - emit_remove_local_vars(entry.as_default->blk); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - } - blk->init_from_child(break_blks_); - } - - insert_label(jmptable_loc); - - emit_opcode(opcode::OP_endswitch, data); - - auto offset = static_cast(7 * stmt->stmt->list.size()); - function_->instructions.back()->size += offset; - index_ += offset; - - insert_label(break_loc); - - can_break_ = old_break; - break_blks_ = old_breaks; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) -{ - if (!can_break_ || blk->abort != abort_t::abort_none || blk->loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - break_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_break; - emit_opcode(opcode::OP_jump, blk->loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) -{ - if (!can_continue_ || blk->abort != abort_t::abort_none || blk->loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - continue_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_continue; - emit_opcode(opcode::OP_jump, blk->loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - blk->abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr, blk); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child, blk); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate, blk); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference, blk); - break; - case ast::kind::expr_add_array: - emit_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_thisthread: - emit_opcode(opcode::OP_GetThisthread); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - 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, blk); - 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, const block::ptr& blk) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue, blk); - } - else if (expr->lvalue == ast::kind::expr_tuple) - { - emit_expr(expr->rvalue, blk); - emit_expr_tuple(expr->lvalue.as_tuple, blk); - } - else - { - emit_expr(expr->rvalue, blk); - emit_expr_variable_ref(expr->lvalue, blk, true); - } - - return; - } - - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - 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_mod); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_ex_or); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, blk, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key, blk); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, blk, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj, blk); - 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, blk, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk) -{ - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); - else - emit_opcode(opcode::OP_ClearLocalVariableFieldCached, variable_access_index(expr, blk)); -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_inc); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_dec); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr, blk); - emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr, blk); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_equality); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_inequality); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_less); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_greater); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_less_equal); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_greater_equal); - 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_ex_or); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_mod); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt && mode_ == gsc::build::prod) - { - const auto& name = expr->name->value; - if (name == "assert" || name == "assertex" || name == "assertmsg") return; - } - - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal && expr->args->list.size() > 0) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptLocalFunctionCall, expr->name->value); - else - emit_opcode(opcode::OP_ScriptLocalFunctionCall2, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptFarFunctionCall, { expr->path->value, expr->name->value }); - else - emit_opcode(opcode::OP_ScriptFarFunctionCall2, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltin0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltin1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltin2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltin3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltin4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltin5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltin, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptLocalMethodCall, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFarMethodCall, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltinMethod0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltinMethod1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltinMethod2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltinMethod3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltinMethod4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltinMethod5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltinMethod, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_EmptyArray); - - for (const auto& arg : expr->args->list) - { - emit_expr(arg, blk); - emit_opcode(opcode::OP_AddArray); - } -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) -{ - for (const auto& entry : expr->list) - { - variable_initialize(entry, blk); - emit_opcode(opcode::OP_SafeCreateVariableFieldCached, variable_create_index(entry, blk)); - } - - emit_opcode(opcode::OP_checkclearparams); -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry, blk); - } -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) -{ - bool method = false; - auto type = resolve_reference_type(expr, method); - - switch (type) - { - case ast::call::type::local: - emit_opcode(opcode::OP_GetLocalFunction, expr->name->value); - break; - case ast::call::type::far: - emit_opcode(opcode::OP_GetFarFunction, { expr->path->value, expr->name->value }); - break; - case ast::call::type::builtin: - if (method) - emit_opcode(opcode::OP_GetBuiltinMethod, expr->name->value); - else - emit_opcode(opcode::OP_GetBuiltinFunction, expr->name->value); - break; - } -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_size); -} - -void compiler::emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - emit_expr_variable_ref(expr->temp, blk, true); - - auto index = 0; - - for (const auto& entry : expr->list) - { - if (index == 0) - emit_opcode(opcode::OP_GetZero); - else - emit_opcode(opcode::OP_GetByte, utils::string::va("%d", index)); - - index++; - - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->temp.as_identifier, blk)); - - emit_expr_variable_ref(entry, blk, true); - } - - emit_expr_clear_local(expr->temp.as_identifier, blk); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, blk, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, blk, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, blk, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set) -{ - emit_expr(expr->key, blk); - - 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, blk, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - { - if (!variable_initialized(expr->obj.as_identifier, blk)) - { - variable_initialize(expr->obj.as_identifier, blk); - emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(expr->obj.as_identifier, blk)); - - if (!set) throw comp_error(expr->loc(), "INTERNAL: VAR CREATED BUT NOT SET!"); - } - else if (variable_stack_index(expr->obj.as_identifier, blk) == 0) - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached0); - } - else - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access_index(expr->obj.as_identifier, blk)); - } - - 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, const block::ptr& blk, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); - break; - case ast::kind::expr_anim: - set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); - break; - case ast::kind::expr_self: - set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - 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, blk); - 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_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, 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 + "'"); - } - - if (set) - { - if (!variable_initialized(expr, blk)) - { - variable_initialize(expr, blk); - emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(expr, blk)); - } - else if (variable_stack_index(expr, blk) == 0) - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached0); - } - else - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached, variable_access_index(expr, blk)); - } - } - else - { - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_EvalLocalVariableRefCached0); - else - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access_index(expr, blk)); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->key, blk); - - if (expr->obj == ast::kind::expr_identifier) - { - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->obj.as_identifier, blk)); - } - else - { - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_EvalArray); - } -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_EvalLevelFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_EvalAnimFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_EvalSelfFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, const block::ptr& blk) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - emit_expr(itr->second, blk); - return; - } - - // is local var - auto index = variable_stack_index(expr, blk); - - switch (index) - { - case 0: - emit_opcode(opcode::OP_EvalLocalVariableCached0); - break; - case 1: - emit_opcode(opcode::OP_EvalLocalVariableCached1); - break; - case 2: - emit_opcode(opcode::OP_EvalLocalVariableCached2); - break; - case 3: - emit_opcode(opcode::OP_EvalLocalVariableCached3); - break; - case 4: - emit_opcode(opcode::OP_EvalLocalVariableCached4); - break; - case 5: - emit_opcode(opcode::OP_EvalLocalVariableCached5); - break; - default: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access_index(expr, blk)); - break; - } -} - -void compiler::emit_expr_object(const ast::expr& expr, const block::ptr& blk) -{ - 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, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr.as_identifier, blk)); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk) -{ - std::vector data; - - bool isexpr = false; - - 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, blk); - emit_expr(expr->y, blk); - emit_expr(expr->x, blk); - 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(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimation, { "", expr->value }); - } - else - { - emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); - tree.loaded = true; - } -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error(expr->loc(), "trying to use animtree without specified using animtree"); - } - - auto& tree = animtrees_.back(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimTree, ""); - } - else - { - emit_opcode(opcode::OP_GetAnimTree, tree.name); - tree.loaded = true; - } -} - -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_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_create_local_vars(const block::ptr& blk) -{ - if (blk->local_vars_create_count != blk->local_vars_public_count) - { - for (auto i = blk->local_vars_create_count; i < blk->local_vars_public_count; i++) - { - auto data = utils::string::va("%d", blk->local_vars.at(i).create); - emit_opcode(opcode::OP_CreateLocalVariable, data); - blk->local_vars.at(i).init = true; - } - - blk->local_vars_create_count = blk->local_vars_public_count; - } -} - -void compiler::emit_remove_local_vars(const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - auto count = blk->local_vars_create_count - blk->local_vars_public_count; - - if (count > 0) - { - auto data = utils::string::va("%d", count); - emit_opcode(opcode::OP_RemoveLocalVariables, data); - } - } -} - -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, const block::ptr& blk) -{ - process_expr_parameters(decl->params, blk); - process_stmt_list(decl->stmt, blk); -} - -void compiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - 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_waitframe: - case ast::kind::stmt_case: - case ast::kind::stmt_default: - 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, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk) -{ - process_stmt_list(stmt->list, blk); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - 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, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - blk->merge(childs); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - stmt->blk_if = std::make_unique(); - stmt->blk_else = std::make_unique(); - - blk->copy(stmt->blk_if); - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - blk->copy(stmt->blk_else); - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - blk->merge(childs); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - stmt->blk = std::make_unique(); - stmt->blk_iter = std::make_unique(); - - process_stmt(stmt->init, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->blk); - blk->copy(stmt->blk_iter); - - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_stmt(stmt->iter, stmt->blk_iter); - - blk->append({ stmt->blk_iter.get() }); - blk->merge({ stmt->blk_iter.get() }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto array_name = utils::string::va("_temp_%d", ++label_idx_); - auto key_name = utils::string::va("_temp_%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; - - // calculate variables - - stmt->ctx = std::make_unique(); - stmt->ctx_post = std::make_unique(); - - // calculate pre_expr variables - process_expr(stmt->array, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->ctx); - blk->copy(stmt->ctx_post); - - // calculate stmt variables & add missing array access as first stmt - process_expr(stmt->value_expr, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - continue_blks_.push_back(stmt->ctx.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_expr(stmt->key_expr, stmt->ctx_post); - - blk->append({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - // calculate variables - stmt->ctx = std::make_unique(); - std::vector childs; - auto abort = abort_t::abort_return; - bool has_default = false; - block* default_ctx = nullptr; - auto old_breaks = break_blks_; - break_blks_.clear(); - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->copy(entry.as_case->blk); - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort != abort_t::abort_none) - { - if (entry.as_case->blk->abort == abort_t::abort_break ) - { - entry.as_case->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_case->blk.get()); - } - else if (entry.as_case->blk->abort <= abort ) - { - abort = entry.as_case->blk->abort; - } - } - } - else if (entry == ast::kind::stmt_default) - { - entry.as_default->blk = std::make_unique(); - blk->copy(entry.as_default->blk); - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - has_default = true; - default_ctx = entry.as_default->blk.get(); - - if (entry.as_default->blk->abort != abort_t::abort_none) - { - if (entry.as_default->blk->abort == abort_t::abort_break ) - { - entry.as_default->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_default->blk.get()); - } - else if (entry.as_default->blk->abort <= abort ) - { - abort = entry.as_default->blk->abort; - } - } - } - } - - stmt->stmt =std::move(stmt_list); - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - } - - blk->append(break_blks_); - blk->merge(childs); - } - - break_blks_ = old_breaks; -} - -void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - break_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_break; - } -} - -void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - continue_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_continue; - } -} - -void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } -} - -void compiler::process_expr(const ast::expr& expr, const block::ptr& blk) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value, blk); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj, blk); - } - else if (expr == ast::kind::expr_tuple) - { - process_expr_tuple(expr.as_tuple, blk); - } -} - -void compiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - auto array = utils::string::va("_temp_%d", ++label_idx_); - expr->temp = ast::expr(std::make_unique(expr->loc(), array)); - - process_expr(expr->temp, blk); - - for (const auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk) -{ - for (const auto& entry : decl->list) - { - variable_register(entry->value, blk); - } -} - -void compiler::variable_register(const std::string& name, const block::ptr& blk) -{ - auto it = std::find_if(blk->local_vars.begin(), blk->local_vars.end(), - [&](const gsc::local_var& v) { return v.name == name; }); - - if (it == blk->local_vars.end()) - { - auto found = false; - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - blk->local_vars.push_back({ name, static_cast(i), false }); - found = true; - break; - } - } - - if (!found) - { - blk->local_vars.push_back({ name, stack_idx_, false }); - local_stack_.push_back(name); - stack_idx_++; - } - } -} - -void compiler::variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::uint32_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (!blk->local_vars[i].init) - { - for (std::uint32_t j = 0; j < i; j++) - { - if (!blk->local_vars[j].init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", blk->local_vars[j].create)); - blk->local_vars[j].init = true; - } - } - blk->local_vars[i].init = true; - blk->local_vars_create_count = i + 1; - return; - } - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -void compiler::variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - auto& var = blk->local_vars.at(i); - if (var.name == name->value) - { - if (!var.init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); - var.init = true; - blk->local_vars_create_count++; - } - return; - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return static_cast(blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - return utils::string::va("%d", blk->local_vars[i].create); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return utils::string::va("%d", blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - return blk->local_vars.at(i).init; - } - } - - 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_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jump: - case opcode::OP_jumpback: - case opcode::OP_switch: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_endswitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - -auto compiler::map_known_includes(const std::string&) -> bool -{ - return false; -} - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/compiler.hpp b/src/h1/xsk/compiler.hpp deleted file mode 100644 index 6b5fcec3..00000000 --- a/src/h1/xsk/compiler.hpp +++ /dev/null @@ -1,160 +0,0 @@ -// 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::gsc::h1 -{ - -enum class opcode : std::uint8_t; - -class compiler : public gsc::compiler -{ - build mode_; - std::string filename_; - std::vector assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector break_blks_; - std::vector continue_blks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - -public: - auto output() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_constant(const ast::decl_constant::ptr& constant); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last); - void emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void emit_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt, const block::ptr& blk); - void emit_stmt_waitframe(const ast::stmt_waitframe::ptr& stmt, const block::ptr& blk); - void emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk); - void emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk); - void emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk); - void emit_expr(const ast::expr& expr, const block::ptr& blk); - void emit_expr_assign(const ast::expr_assign::ptr& expr, const block::ptr& blk); - void emit_expr_clear(const ast::expr& expr, const block::ptr& blk); - void emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk); - void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk); - void emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_variable(const ast::expr& expr, const block::ptr& blk); - void emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void emit_expr_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_object(const ast::expr& expr, const block::ptr& blk); - void emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_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_create_local_vars(const block::ptr& blk); - void emit_remove_local_vars(const block::ptr& blk); - 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, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(const ast::expr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk); - void variable_register(const std::string& name, const block::ptr& blk); - void variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk); - void variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk); - auto variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t; - auto variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool; - 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; -}; - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/context.cpp b/src/h1/xsk/context.cpp deleted file mode 100644 index d287166d..00000000 --- a/src/h1/xsk/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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 "h1.hpp" - -namespace xsk::gsc::h1 -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/context.hpp b/src/h1/xsk/context.hpp deleted file mode 100644 index f04e1799..00000000 --- a/src/h1/xsk/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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::gsc::h1 -{ - -class context : public gsc::context -{ - h1::assembler assembler_; - h1::disassembler disassembler_; - h1::compiler compiler_; - h1::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { return assembler_; } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { return compiler_; } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::iw5 diff --git a/src/h1/xsk/decompiler.cpp b/src/h1/xsk/decompiler.cpp deleted file mode 100644 index 71d8a6ed..00000000 --- a/src/h1/xsk/decompiler.cpp +++ /dev/null @@ -1,3442 +0,0 @@ -// 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 "h1.hpp" - -namespace xsk::gsc::h1 -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// H1 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetLocalFunction: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalFunctionCall2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - 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_ScriptLocalFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalMethodCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto expr = std::make_unique(loc, std::move(call)); - stack_.push(std::move(expr)); - break; - } - case opcode::OP_ScriptLocalMethodThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodChildThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall2: - { - 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 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_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin1: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin3: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin4: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin5: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod1: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod2: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod3: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod4: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod5: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_waitFrame: - { - auto stmt = ast::stmt(std::make_unique(loc)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_waittill: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto args = std::make_unique(loc); - auto node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(expr), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(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_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // continue is at jumpback, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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 - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - auto use_key = true; - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - use_key = false; - } - - 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)), use_key)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(std::stoi(entry->value.substr(4))), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - auto var = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - auto var1 = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); - blk->local_vars_create_count++; - } - - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/decompiler.hpp b/src/h1/xsk/decompiler.hpp deleted file mode 100644 index c3e5f53c..00000000 --- a/src/h1/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::h1 -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/disassembler.cpp b/src/h1/xsk/disassembler.cpp deleted file mode 100644 index 509e9cfe..00000000 --- a/src/h1/xsk/disassembler.cpp +++ /dev/null @@ -1,575 +0,0 @@ -// 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 "h1.hpp" - -namespace xsk::gsc::h1 -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// H1 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read(); - func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - 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->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetVector: - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(4); - inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); - break; - case opcode::OP_GetAnimation: - script_->seek(8); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - disassemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto id = script_->read(); - const auto name = method ? resolver::method_name(id) : resolver::function_name(id); - inst->data.emplace(inst->data.begin(), name); -} - -void disassembler::disassemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto offset = disassemble_offset(); - - inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(3); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto file_id = stack_->read(); - const auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::token_name(file_id); - const auto func_id = stack_->read(); - const auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); - - inst->data.emplace(inst->data.begin(), func_name); - inst->data.emplace(inst->data.begin(), file_name); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read(); - 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) -{ - const auto count = script_->read(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read(); - - if (value < 0x40000) - { - const auto data = stack_->read_c_string(); - - if (data.data()[0] != 0x01) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(data, false)); - } - else - inst->data.push_back("default"); - } - else - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - index += 4; - - const auto addr = disassemble_offset() + index; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 3; - inst->size += 7; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - const auto id = script_->read(); - std::string name; - - if (id > max_string_id) - { - auto temp = stack_->read(); - name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); - } - else - { - name = resolver::token_name(id); - } - - inst->data.push_back(name); -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read(); - } - else if (back) - { - addr = inst->index + 3 - script_->read(); - } - else - { - addr = inst->index + 5 + script_->read(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -auto disassembler::disassemble_offset() -> std::int32_t -{ - std::array bytes = {}; - - for (auto i = 0; i < 3; i++) - { - bytes[i] = script_->read(); - } - - auto offset = *reinterpret_cast(bytes.data()); - - offset = (offset << 8) >> 10; - - return offset; -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = resolve_function(inst->data[0]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s\n", func->name.data())); - - 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())); - } - - print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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; - } - if (casenum != totalcase - 1) - { - output_->write_string("\n"); - } - } - } - break; - default: - for (auto& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - break; - } - - output_->write_string("\n"); -} - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/disassembler.hpp b/src/h1/xsk/disassembler.hpp deleted file mode 100644 index 6e9df738..00000000 --- a/src/h1/xsk/disassembler.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc::h1 -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_local_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - auto disassemble_offset() -> std::int32_t; - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/h1.cpp b/src/h1/xsk/h1.cpp deleted file mode 100644 index 1ffef108..00000000 --- a/src/h1/xsk/h1.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// 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 "h1.hpp" - -namespace xsk::gsc::h1 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - return 1; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_GetAnimTree: - case opcode::OP_GetNegByte: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_GetByte: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_waittillmatch: - return 2; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_GetUnsignedShort: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_jumpback: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - case opcode::OP_JumpOnFalse: - case opcode::OP_endswitch: - return 3; - case opcode::OP_CallBuiltin: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_GetLocalFunction: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarMethodCall: - return 4; - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_GetFloat: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_switch: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - case opcode::OP_jump: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_GetInteger: - case opcode::OP_GetString: - case opcode::OP_GetIString: - return 5; - case opcode::OP_GetAnimation: - return 9; - case opcode::OP_GetVector: - return 13; - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/h1.hpp b/src/h1/xsk/h1.hpp deleted file mode 100644 index 4a37b392..00000000 --- a/src/h1/xsk/h1.hpp +++ /dev/null @@ -1,183 +0,0 @@ -// 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 "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::h1 -{ - -constexpr std::uint16_t max_string_id = 0xA7ED; - -enum class opcode : std::uint8_t -{ - OP_SetNewLocalVariableFieldCached0 = 0x17, - OP_EvalSelfFieldVariable = 0x18, - OP_Return = 0x19, - OP_CallBuiltin0 = 0x1A, - OP_CallBuiltin1 = 0x1B, - OP_CallBuiltin2 = 0x1C, - OP_CallBuiltin3 = 0x1D, - OP_CallBuiltin4 = 0x1E, - OP_CallBuiltin5 = 0x1F, - OP_CallBuiltin = 0x20, - OP_BoolNot = 0x21, - OP_ScriptFarMethodThreadCall = 0x22, - OP_JumpOnTrueExpr = 0x23, - OP_SetLevelFieldVariableField = 0x24, - OP_CastBool = 0x25, - OP_EvalNewLocalArrayRefCached0 = 0x26, - OP_CallBuiltinPointer = 0x27, - OP_inequality = 0x28, - OP_GetThisthread = 0x29, - OP_ClearFieldVariable = 0x2A, - OP_GetFloat = 0x2B, - OP_SafeCreateVariableFieldCached = 0x2C, - OP_ScriptFarFunctionCall2 = 0x2D, - OP_ScriptFarFunctionCall = 0x2E, - OP_ScriptFarChildThreadCall = 0x2F, - OP_ClearLocalVariableFieldCached0 = 0x30, - OP_ClearLocalVariableFieldCached = 0x31, - OP_checkclearparams = 0x32, - OP_CastFieldObject = 0x33, - OP_End = 0x34, - OP_size = 0x35, - OP_EmptyArray = 0x36, - OP_bit_and = 0x37, - OP_less_equal = 0x38, - OP_voidCodepos = 0x39, - OP_ScriptMethodThreadCallPointer = 0x3A, - OP_endswitch = 0x3B, - OP_ClearVariableField = 0x3C, - OP_divide = 0x3D, - OP_ScriptFarMethodChildThreadCall = 0x3E, - OP_GetUnsignedShort = 0x3F, - OP_JumpOnTrue = 0x40, - OP_GetSelf = 0x41, - OP_ScriptFarThreadCall = 0x42, - OP_ScriptLocalThreadCall = 0x43, - OP_SetLocalVariableFieldCached0 = 0x44, - OP_SetLocalVariableFieldCached = 0x45, - OP_plus = 0x46, - OP_BoolComplement = 0x47, - OP_ScriptMethodCallPointer = 0x48, - OP_inc = 0x49, - OP_RemoveLocalVariables = 0x4A, - OP_JumpOnFalseExpr = 0x4B, - OP_switch = 0x4C, - OP_clearparams = 0x4D, - OP_EvalLocalVariableRefCached0 = 0x4E, - OP_EvalLocalVariableRefCached = 0x4F, - OP_ScriptLocalMethodCall = 0x50, - OP_EvalFieldVariable = 0x51, - OP_EvalFieldVariableRef = 0x52, - OP_GetString = 0x53, - OP_ScriptFunctionCallPointer = 0x54, - OP_EvalLevelFieldVariable = 0x55, - OP_GetVector = 0x56, - OP_endon = 0x57, - OP_greater_equal = 0x58, - OP_GetSelfObject = 0x59, - OP_SetAnimFieldVariableField = 0x5A, - OP_SetVariableField = 0x5B, - OP_ScriptLocalFunctionCall2 = 0x5C, - OP_ScriptLocalFunctionCall = 0x5D, - OP_EvalLocalArrayRefCached0 = 0x5E, - OP_EvalLocalArrayRefCached = 0x5F, - OP_GetFarFunction = 0x60, - OP_less = 0x61, - OP_GetGameRef = 0x62, - OP_waittillFrameEnd = 0x63, - OP_waitFrame = 0x64, - OP_SafeSetVariableFieldCached0 = 0x65, - OP_SafeSetVariableFieldCached = 0x66, - OP_ScriptMethodChildThreadCallPointer = 0x67, - OP_GetLevel = 0x68, - OP_notify = 0x69, - OP_DecTop = 0x6A, - OP_shift_left = 0x6B, - OP_ScriptLocalMethodThreadCall = 0x6C, - OP_ScriptLocalMethodChildThreadCall = 0x6D, - OP_greater = 0x6E, - OP_EvalLocalVariableCached0 = 0x6F, - OP_EvalLocalVariableCached1 = 0x70, - OP_EvalLocalVariableCached2 = 0x71, - OP_EvalLocalVariableCached3 = 0x72, - OP_EvalLocalVariableCached4 = 0x73, - OP_EvalLocalVariableCached5 = 0x74, - OP_EvalLocalVariableCached = 0x75, - OP_SafeSetWaittillVariableFieldCached = 0x76, - OP_jump = 0x77, - OP_ScriptThreadCallPointer = 0x78, - OP_GetZero = 0x79, - OP_wait = 0x7A, - OP_minus = 0x7B, - OP_SetSelfFieldVariableField = 0x7C, - OP_EvalNewLocalVariableRefCached0 = 0x7D, - OP_multiply = 0x7E, - OP_CreateLocalVariable = 0x7F, - OP_ScriptLocalChildThreadCall = 0x80, - OP_GetInteger = 0x81, - OP_mod = 0x82, - OP_EvalAnimFieldVariableRef = 0x83, - OP_GetBuiltinFunction = 0x84, - OP_GetGame = 0x85, - OP_waittill = 0x86, - OP_dec = 0x87, - OP_EvalLocalVariableObjectCached = 0x88, - OP_PreScriptCall = 0x89, - OP_GetAnim = 0x8A, - OP_GetUndefined = 0x8B, - OP_EvalLevelFieldVariableRef = 0x8C, - OP_GetAnimObject = 0x8D, - OP_GetLevelObject = 0x8E, - OP_bit_ex_or = 0x8F, - OP_equality = 0x90, - OP_ClearArray = 0x91, - OP_jumpback = 0x92, - OP_GetAnimation = 0x93, - OP_EvalAnimFieldVariable = 0x94, - OP_GetAnimTree = 0x95, - OP_GetIString = 0x96, - OP_EvalArrayRef = 0x97, - OP_EvalSelfFieldVariableRef = 0x98, - OP_GetNegByte = 0x99, - OP_GetBuiltinMethod = 0x9A, - OP_CallBuiltinMethodPointer = 0x9B, - OP_EvalArray = 0x9C, - OP_vector = 0x9D, - OP_ScriptFarMethodCall = 0x9E, - OP_EvalLocalArrayCached = 0x9F, - OP_GetByte = 0xA0, - OP_ScriptChildThreadCallPointer = 0xA1, - OP_bit_or = 0xA2, - OP_AddArray = 0xA3, - OP_waittillmatch2 = 0xA4, - OP_waittillmatch = 0xA5, - OP_GetLocalFunction = 0xA6, - OP_GetNegUnsignedShort = 0xA7, - OP_shift_right = 0xA8, - OP_CallBuiltinMethod0 = 0xA9, - OP_CallBuiltinMethod1 = 0xAA, - OP_CallBuiltinMethod2 = 0xAB, - OP_CallBuiltinMethod3 = 0xAC, - OP_CallBuiltinMethod4 = 0xAD, - OP_CallBuiltinMethod5 = 0xAE, - OP_CallBuiltinMethod = 0xAF, - OP_JumpOnFalse = 0xB0, - OP_Count = 0xB1, -}; - -auto opcode_size(std::uint8_t op) -> std::uint32_t; - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/lexer.cpp b/src/h1/xsk/lexer.cpp deleted file mode 100644 index 4cc5335b..00000000 --- a/src/h1/xsk/lexer.cpp +++ /dev/null @@ -1,849 +0,0 @@ -// 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 "h1.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -xsk::gsc::h1::parser::symbol_type H1lex(xsk::gsc::h1::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::gsc::h1 -{ - -const std::unordered_map keyword_map -{{ - { "#define", parser::token::SH_DEFINE }, - { "#undef", parser::token::SH_UNDEF }, - { "#ifdef", parser::token::SH_IFDEF }, - { "#ifndef", parser::token::SH_IFNDEF }, - { "#if", parser::token::SH_IF }, - { "#elif", parser::token::SH_ELIF }, - { "#else", parser::token::SH_ELSE }, - { "#endif", parser::token::SH_ENDIF }, - { "#inline", parser::token::INLINE }, - { "#include", parser::token::INCLUDE }, - { "#using_animtree", parser::token::USINGTREE }, - { "#animtree", parser::token::ANIMTREE }, - { "endon", parser::token::ENDON }, - { "notify", parser::token::NOTIFY }, - { "wait", parser::token::WAIT }, - { "waittill", parser::token::WAITTILL }, - { "waittillmatch", parser::token::WAITTILLMATCH }, - { "waittillframeend", parser::token::WAITTILLFRAMEEND }, - { "waitframe", parser::token::WAITFRAME }, - { "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 }, - { "childthread", parser::token::CHILDTHREAD }, - { "thisthread", parser::token::THISTHREAD }, - { "call", parser::token::CALL }, - { "true", parser::token::TRUE }, - { "false", parser::token::FALSE }, - { "undefined", parser::token::UNDEFINED }, - { "size", parser::token::SIZE }, - { "game", parser::token::GAME }, - { "self", parser::token::SELF }, - { "anim", parser::token::ANIM }, - { "level", parser::token::LEVEL }, -}}; - -buffer::buffer() : length(0) -{ - data = static_cast(std::malloc(max_buf_size)); -} - -buffer::~buffer() -{ - if (data) std::free(data); -} - -bool buffer::push(char c) -{ - if (length >= max_buf_size) - return false; - - data[length++] = c; - return true; -} - -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) -{ - -} - -void reader::init(const char* data, size_t size) -{ - if (data && size) - { - state = reader::ok; - buffer_pos = data; - bytes_remaining = static_cast(size); - last_byte = 0; - current_byte = *data; - } - else - { - state = reader::end; - buffer_pos = 0; - bytes_remaining = 0; - last_byte = 0; - current_byte = 0; - } -} - -void reader::advance() -{ - ++buffer_pos; - - if (bytes_remaining-- == 1) - { - state = reader::end; - bytes_remaining = 0; - last_byte = current_byte; - current_byte = 0; - } - else - { - last_byte = current_byte; - current_byte = *buffer_pos; - } -} - -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) -{ - reader_.init(data, size); -} - -void lexer::push_header(const std::string& file) -{ - try - { - if (header_top_++ >= 10) - throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - - auto data = resolver::file_data(file + ".gsh"); - - readers_.push(reader_); - locs_.push(loc_); - loc_.initialize(std::get<0>(data)); - reader_.init(std::get<1>(data), std::get<2>(data)); - clean_ = true; - } - catch (const std::exception& e) - { - throw error("parsing header file '" + file + "': " + e.what()); - } -} - -void lexer::pop_header() -{ - header_top_--; - loc_ = locs_.top(); - locs_.pop(); - reader_ = readers_.top(); - readers_.pop(); -} - -void lexer::ban_header(const location& loc) -{ - if (header_top_ > 0) - { - throw comp_error(loc, "not allowed inside a gsh file"); - } -} - -auto lexer::lex() -> parser::symbol_type -{ - buffer_.length = 0; - state_ = state::start; - - while (true) - { - const auto& state = reader_.state; - auto& last = reader_.last_byte; - auto& curr = reader_.current_byte; - auto path = false; - loc_.step(); - - if (state == reader::end) - { - if (indev_) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (header_top_ > 0) - pop_header(); - else - return parser::make_H1EOF(loc_); - } - - if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') - clean_ = false; - - advance(); - - switch (last) - { - case ' ': - case '\t': - case '\r': - loc_.step(); - continue; - case '\n': - loc_.lines(); - loc_.step(); - clean_ = true; - continue; - case '\\': - throw comp_error(loc_, "invalid token ('\\')"); - case '/': - if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') - return parser::make_DIV(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_DIV(loc_); - - if (last == '#') - { - if (indev_) - throw comp_error(loc_, "cannot recurse devblock ('/#')"); - - if (mode_ == build::dev) - { - indev_ = true; - return parser::make_DEVBEGIN(loc_); - } - else - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '#' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - } - else if (last == '@') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched script doc comment start ('/@')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '@' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '*') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched multiline comment start ('/*')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '*' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '/') - { - while (true) - { - if (state == reader::end) - break; - - if (curr == '\n') - break; - - advance(); - } - } - continue; - case '#': - if (curr == '/') - { - if (!indev_) - throw comp_error(loc_, "unmatched devblock end ('#/')"); - - advance(); - indev_ = false; - return parser::make_DEVEND(loc_); - } - - buffer_.push(last); - advance(); - - while (state == reader::ok) - { - if (last != ' ' || last != '\t') - break; - - advance(); - } - - if (state == reader::end || !((last > 64 && last < 91) || (last > 96 && last < 123))) - throw comp_error(loc_, "invalid preprocessor directive ('#')"); - - state_ = state::preprocessor; - goto lex_name; - case '*': - if (curr != '=' && curr != '/') - return parser::make_MUL(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_MUL(loc_); - - throw comp_error(loc_, "unmatched multiline comment end ('*/')"); - case '"': - state_ = state::string; - goto lex_string; - case '.': - if (curr < '0' || curr > '9') - return parser::make_DOT(loc_); - goto lex_number; - case '(': - return parser::make_LPAREN(loc_); - case ')': - return parser::make_RPAREN(loc_); - case '{': - return parser::make_LBRACE(loc_); - case '}': - return parser::make_RBRACE(loc_); - case '[': - return parser::make_LBRACKET(loc_); - case ']': - return parser::make_RBRACKET(loc_); - case ',': - return parser::make_COMMA(loc_); - case ';': - return parser::make_SEMICOLON(loc_); - case ':': - if (curr != ':') - return parser::make_COLON(loc_); - - advance(); - return parser::make_DOUBLECOLON(loc_); - case '?': - return parser::make_QMARK(loc_); - case '=': - if (curr != '=') - return parser::make_ASSIGN(loc_); - - advance(); - return parser::make_EQUALITY(loc_); - case '+': - if (curr != '+' && curr != '=') - return parser::make_ADD(loc_); - - advance(); - - if (last == '+') - return parser::make_INCREMENT(loc_); - - return parser::make_ASSIGN_ADD(loc_); - case '-': - if (curr != '-' && curr != '=') - return parser::make_SUB(loc_); - - advance(); - - if (last == '-') - return parser::make_DECREMENT(loc_); - - return parser::make_ASSIGN_SUB(loc_); - case '%': - if (curr != '=') - return parser::make_MOD(loc_); - - advance(); - - return parser::make_ASSIGN_MOD(loc_); - case '|': - if (curr != '|' && curr != '=') - return parser::make_BITWISE_OR(loc_); - - advance(); - - if (last == '|') - return parser::make_OR(loc_); - - return parser::make_ASSIGN_BW_OR(loc_); - case '&': - if (curr != '&' && curr != '=' && curr != '"') - return parser::make_BITWISE_AND(loc_); - - advance(); - - if (last == '&') - return parser::make_AND(loc_); - - if (last == '=') - return parser::make_ASSIGN_BW_AND(loc_); - - state_ = state::localize; - goto lex_string; - case '^': - if (curr != '=') - return parser::make_BITWISE_EXOR(loc_); - - advance(); - return parser::make_ASSIGN_BW_EXOR(loc_); - case '!': - if (curr != '=') - return parser::make_NOT(loc_); - - advance(); - return parser::make_INEQUALITY(loc_); - case '~': - return parser::make_COMPLEMENT(loc_); - case '<': - if (curr != '<' && curr != '=') - return parser::make_LESS(loc_); - - advance(); - if (last == '=') - return parser::make_LESS_EQUAL(loc_); - - if (curr != '=') - return parser::make_LSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_LSHIFT(loc_); - case '>': - if (curr != '>' && curr != '=') - return parser::make_GREATER(loc_); - - advance(); - - if (last == '=') - return parser::make_GREATER_EQUAL(loc_); - - if (curr != '=') - return parser::make_RSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_RSHIFT(loc_); - default: - if (last >= '0' && last <= '9') - goto lex_number; - else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) - goto lex_name; - - throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); - } - -lex_string: - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched string start ('\"')"); - - if (curr == '"') - { - advance(); - break; - } - - if (curr == '\n') - throw comp_error(loc_, "unterminated string literal"); - - if (curr == '\\') - { - advance(); - - if (state == reader::end) - throw comp_error(loc_, "invalid token ('\')"); - - char c = curr; - switch (curr) - { - case 't': c = '\t'; break; - case 'r': c = '\r'; break; - case 'n': c = '\n'; break; - case '"': c = '\"'; break; - case '\\': c = '\\'; break; - default: break; - } - - if (!buffer_.push(c)) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); - -lex_name: - buffer_.push(last); - - while (true) - { - if (state == reader::end) - break; - - if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) - break; - - if (curr == '\\') - { - if (last == '\\') - throw comp_error(loc_, "invalid path '\\\\'"); - - path = true; - if (!buffer_.push('/')) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::preprocessor) - { - auto token = parser::token::H1UNDEF; - - if (buffer_.length < 16) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - { - if (itr->second > parser::token::SH_ENDIF) - return parser::symbol_type(itr->second, loc_); - - token = itr->second; - } - } - - preprocessor_run(token); - - state_ = state::start; - continue; - } - else - { - 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_); - } - - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - -lex_number: - if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) - { - buffer_.push(last); - - auto dot = last == '.' ? 1 : 0; - auto flt = 0; - - while (true) - { - if (state == reader::end) - break; - - if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) - throw comp_error(loc_, "invalid number literal"); - - if ((curr == '.' || curr == 'f') && last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr == 'f') - flt++; - else if (curr == '.') - dot++; - else if (!(curr > 47 && curr < 58)) - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f')) - throw comp_error(loc_, "invalid number literal"); - - if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); - } - else if (curr == 'o') - { - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) - throw comp_error(loc_, "invalid octal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!(curr > 47 && curr < 56)) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length <= 0) - throw comp_error(loc_, "invalid octal literal"); - - return parser::make_INTEGER(utils::string::oct_to_dec(buffer_.data), loc_); - } - else if (curr == 'b') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) - throw comp_error(loc_, "invalid binary literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr != '0' && curr != '1') - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid binary literal"); - - return parser::make_INTEGER(utils::string::bin_to_dec(buffer_.data), loc_); - } - else if (curr == 'x') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) - throw comp_error(loc_, "invalid hexadecimal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid hexadecimal literal"); - - return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); - } - - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); - } -} - -void lexer::advance() -{ - reader_.advance(); - loc_.end.column++; - - if (reader_.current_byte == '\\') [[unlikely]] - preprocessor_wrap(); -} - -void lexer::preprocessor_wrap() -{ - while (reader_.current_byte == '\\') - { - if (reader_.bytes_remaining == 1) - throw comp_error(loc_, "invalid token ('\\')"); - - if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') - break; - - if (reader_.buffer_pos[1] == '\r') - { - if (reader_.bytes_remaining <= 3 || reader_.buffer_pos[2] != '\n') - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 3; - reader_.bytes_remaining -= 3; - } - - if ((reader_.buffer_pos[1] == '\n')) - { - if (reader_.bytes_remaining == 2) - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 2; - reader_.bytes_remaining -= 2; - } - - if (reader_.bytes_remaining == 0) - { - reader_.state = reader::end; - reader_.current_byte = 0; - } - else - { - reader_.current_byte = *reader_.buffer_pos; - } - - loc_.lines(); - loc_.step(); - } -} - -void lexer::preprocessor_run(parser::token::token_kind_type token) -{ - if (!clean_) - throw comp_error(loc_, "invalid token ('#')"); - - switch (token) - { - case parser::token::SH_DEFINE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_UNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELSE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ENDIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - default: - throw comp_error(loc_, "unknown preprocessor directive"); - } -} - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/lexer.hpp b/src/h1/xsk/lexer.hpp deleted file mode 100644 index 2fc108c8..00000000 --- a/src/h1/xsk/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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::gsc::h1 -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/parser.cpp b/src/h1/xsk/parser.cpp deleted file mode 100644 index 54bf41c2..00000000 --- a/src/h1/xsk/parser.cpp +++ /dev/null @@ -1,4733 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::h1::parser::symbol_type H1lex(xsk::gsc::h1::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex H1lex - - - -#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 H1DEBUG - -// 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 // !H1DEBUG - -# 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 // !H1DEBUG - -#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 gsc { namespace h1 { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::gsc::h1::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg) -#if H1DEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - 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_add_array: // expr_add_array - value.YY_MOVE_OR_COPY< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.YY_MOVE_OR_COPY< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.YY_MOVE_OR_COPY< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.YY_MOVE_OR_COPY< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.YY_MOVE_OR_COPY< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.YY_MOVE_OR_COPY< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.YY_MOVE_OR_COPY< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.YY_MOVE_OR_COPY< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.copy< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.copy< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.copy< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.copy< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 H1DEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if H1DEBUG - 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 // H1DEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - yylhs.value.emplace< ast::expr_add_array::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - yylhs.value.emplace< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - yylhs.value.emplace< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - yylhs.value.emplace< ast::stmt_waitframe::ptr > (); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - yylhs.value.emplace< ast::stmt_waittill::ptr > (); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - yylhs.value.emplace< ast::stmt_waittillframeend::ptr > (); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - yylhs.value.emplace< ast::stmt_waittillmatch::ptr > (); - break; - - case symbol_kind::S_stmt_while: // stmt_while - yylhs.value.emplace< ast::stmt_while::ptr > (); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 263 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2040 "parser.cpp" - break; - - case 3: // root: %empty -#line 264 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2046 "parser.cpp" - break; - - case 4: // program: program inline -#line 269 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2052 "parser.cpp" - break; - - case 5: // program: program include -#line 271 "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 2058 "parser.cpp" - break; - - case 6: // program: program declaration -#line 273 "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 2064 "parser.cpp" - break; - - case 7: // program: inline -#line 275 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2070 "parser.cpp" - break; - - case 8: // program: include -#line 277 "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 2076 "parser.cpp" - break; - - case 9: // program: declaration -#line 279 "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 2082 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 283 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2088 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 288 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2094 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 292 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2100 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 293 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2106 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 294 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2112 "parser.cpp" - break; - - case 15: // declaration: decl_constant -#line 295 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } -#line 2118 "parser.cpp" - break; - - case 16: // declaration: decl_thread -#line 296 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2124 "parser.cpp" - break; - - case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 301 "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 2130 "parser.cpp" - break; - - case 18: // decl_constant: expr_identifier "=" expr ";" -#line 306 "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 2136 "parser.cpp" - break; - - case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 311 "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 2142 "parser.cpp" - break; - - case 20: // stmt: stmt_block -#line 315 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2148 "parser.cpp" - break; - - case 21: // stmt: stmt_call -#line 316 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2154 "parser.cpp" - break; - - case 22: // stmt: stmt_assign -#line 317 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2160 "parser.cpp" - break; - - case 23: // stmt: stmt_endon -#line 318 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2166 "parser.cpp" - break; - - case 24: // stmt: stmt_notify -#line 319 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2172 "parser.cpp" - break; - - case 25: // stmt: stmt_wait -#line 320 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2178 "parser.cpp" - break; - - case 26: // stmt: stmt_waittill -#line 321 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2184 "parser.cpp" - break; - - case 27: // stmt: stmt_waittillmatch -#line 322 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2190 "parser.cpp" - break; - - case 28: // stmt: stmt_waittillframeend -#line 323 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2196 "parser.cpp" - break; - - case 29: // stmt: stmt_waitframe -#line 324 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } -#line 2202 "parser.cpp" - break; - - case 30: // stmt: stmt_if -#line 325 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2208 "parser.cpp" - break; - - case 31: // stmt: stmt_ifelse -#line 326 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2214 "parser.cpp" - break; - - case 32: // stmt: stmt_while -#line 327 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2220 "parser.cpp" - break; - - case 33: // stmt: stmt_dowhile -#line 328 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2226 "parser.cpp" - break; - - case 34: // stmt: stmt_for -#line 329 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2232 "parser.cpp" - break; - - case 35: // stmt: stmt_foreach -#line 330 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2238 "parser.cpp" - break; - - case 36: // stmt: stmt_switch -#line 331 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2244 "parser.cpp" - break; - - case 37: // stmt: stmt_case -#line 332 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2250 "parser.cpp" - break; - - case 38: // stmt: stmt_default -#line 333 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2256 "parser.cpp" - break; - - case 39: // stmt: stmt_break -#line 334 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2262 "parser.cpp" - break; - - case 40: // stmt: stmt_continue -#line 335 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2268 "parser.cpp" - break; - - case 41: // stmt: stmt_return -#line 336 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2274 "parser.cpp" - break; - - case 42: // stmt: stmt_breakpoint -#line 337 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } -#line 2280 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_begin -#line 338 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2286 "parser.cpp" - break; - - case 44: // stmt: stmt_prof_end -#line 339 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2292 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt -#line 343 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2298 "parser.cpp" - break; - - case 46: // stmt_or_dev: stmt_dev -#line 344 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2304 "parser.cpp" - break; - - case 47: // stmt_list: stmt_list stmt -#line 349 "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 2310 "parser.cpp" - break; - - case 48: // stmt_list: stmt -#line 351 "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 2316 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 356 "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 2322 "parser.cpp" - break; - - case 50: // stmt_or_dev_list: stmt_or_dev -#line 358 "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 2328 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" stmt_list "#/" -#line 362 "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 2334 "parser.cpp" - break; - - case 52: // stmt_dev: "/#" "#/" -#line 363 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2340 "parser.cpp" - break; - - case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 367 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2346 "parser.cpp" - break; - - case 54: // stmt_block: "{" "}" -#line 368 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2352 "parser.cpp" - break; - - case 55: // stmt_expr: expr_assign -#line 373 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2358 "parser.cpp" - break; - - case 56: // stmt_expr: expr_increment -#line 375 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2364 "parser.cpp" - break; - - case 57: // stmt_expr: expr_decrement -#line 377 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2370 "parser.cpp" - break; - - case 58: // stmt_expr: %empty -#line 379 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2376 "parser.cpp" - break; - - case 59: // stmt_call: expr_call ";" -#line 384 "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 2382 "parser.cpp" - break; - - case 60: // stmt_call: expr_method ";" -#line 386 "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 2388 "parser.cpp" - break; - - case 61: // stmt_assign: expr_assign ";" -#line 391 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2394 "parser.cpp" - break; - - case 62: // stmt_assign: expr_increment ";" -#line 393 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2400 "parser.cpp" - break; - - case 63: // stmt_assign: expr_decrement ";" -#line 395 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2406 "parser.cpp" - break; - - case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 400 "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 2412 "parser.cpp" - break; - - case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 405 "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 2418 "parser.cpp" - break; - - case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 407 "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 2424 "parser.cpp" - break; - - case 67: // stmt_wait: "wait" expr ";" -#line 412 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2430 "parser.cpp" - break; - - case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 417 "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 2436 "parser.cpp" - break; - - case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 419 "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 2442 "parser.cpp" - break; - - case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 424 "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 2448 "parser.cpp" - break; - - case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 426 "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 2454 "parser.cpp" - break; - - case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 431 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2460 "parser.cpp" - break; - - case 73: // stmt_waitframe: "waitframe" ";" -#line 436 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2466 "parser.cpp" - break; - - case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 438 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2472 "parser.cpp" - break; - - case 75: // stmt_if: "if" "(" expr ")" stmt -#line 443 "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 2478 "parser.cpp" - break; - - case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 448 "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 2484 "parser.cpp" - break; - - case 77: // stmt_while: "while" "(" expr ")" stmt -#line 453 "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 2490 "parser.cpp" - break; - - case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 458 "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 2496 "parser.cpp" - break; - - case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 463 "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 2502 "parser.cpp" - break; - - case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 468 "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 2508 "parser.cpp" - break; - - case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 470 "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 2514 "parser.cpp" - break; - - case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 475 "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 2520 "parser.cpp" - break; - - case 83: // stmt_case: "case" expr_integer ":" -#line 480 "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 2526 "parser.cpp" - break; - - case 84: // stmt_case: "case" expr_string ":" -#line 482 "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 2532 "parser.cpp" - break; - - case 85: // stmt_default: "default" ":" -#line 487 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2538 "parser.cpp" - break; - - case 86: // stmt_break: "break" ";" -#line 492 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2544 "parser.cpp" - break; - - case 87: // stmt_continue: "continue" ";" -#line 497 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2550 "parser.cpp" - break; - - case 88: // stmt_return: "return" expr ";" -#line 502 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2556 "parser.cpp" - break; - - case 89: // stmt_return: "return" ";" -#line 504 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2562 "parser.cpp" - break; - - case 90: // stmt_breakpoint: "breakpoint" ";" -#line 509 "parser.ypp" - { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } -#line 2568 "parser.cpp" - break; - - case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 514 "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 2574 "parser.cpp" - break; - - case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 519 "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 2580 "parser.cpp" - break; - - case 93: // expr: expr_ternary -#line 523 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2586 "parser.cpp" - break; - - case 94: // expr: expr_binary -#line 524 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2592 "parser.cpp" - break; - - case 95: // expr: expr_primitive -#line 525 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2598 "parser.cpp" - break; - - case 96: // expr_or_empty: expr -#line 529 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2604 "parser.cpp" - break; - - case 97: // expr_or_empty: %empty -#line 530 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2610 "parser.cpp" - break; - - case 98: // expr_assign: expr_tuple "=" expr -#line 535 "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 2616 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "=" expr -#line 537 "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 2622 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "|=" expr -#line 539 "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 2628 "parser.cpp" - break; - - case 101: // expr_assign: expr_object "&=" expr -#line 541 "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 2634 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "^=" expr -#line 543 "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 2640 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "<<=" expr -#line 545 "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 2646 "parser.cpp" - break; - - case 104: // expr_assign: expr_object ">>=" expr -#line 547 "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 2652 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "+=" expr -#line 549 "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 2658 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "-=" expr -#line 551 "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 2664 "parser.cpp" - break; - - case 107: // expr_assign: expr_object "*=" expr -#line 553 "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 2670 "parser.cpp" - break; - - case 108: // expr_assign: expr_object "/=" expr -#line 555 "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 2676 "parser.cpp" - break; - - case 109: // expr_assign: expr_object "%=" expr -#line 557 "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 2682 "parser.cpp" - break; - - case 110: // expr_increment: "++" expr_object -#line 562 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2688 "parser.cpp" - break; - - case 111: // expr_increment: expr_object "++" -#line 564 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2694 "parser.cpp" - break; - - case 112: // expr_decrement: "--" expr_object -#line 569 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2700 "parser.cpp" - break; - - case 113: // expr_decrement: expr_object "--" -#line 571 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2706 "parser.cpp" - break; - - case 114: // expr_ternary: expr "?" expr ":" expr -#line 576 "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 2712 "parser.cpp" - break; - - case 115: // expr_binary: expr "||" expr -#line 581 "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 2718 "parser.cpp" - break; - - case 116: // expr_binary: expr "&&" expr -#line 583 "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 2724 "parser.cpp" - break; - - case 117: // expr_binary: expr "==" expr -#line 585 "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 2730 "parser.cpp" - break; - - case 118: // expr_binary: expr "!=" expr -#line 587 "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 2736 "parser.cpp" - break; - - case 119: // expr_binary: expr "<=" expr -#line 589 "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 2742 "parser.cpp" - break; - - case 120: // expr_binary: expr ">=" expr -#line 591 "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 2748 "parser.cpp" - break; - - case 121: // expr_binary: expr "<" expr -#line 593 "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 2754 "parser.cpp" - break; - - case 122: // expr_binary: expr ">" expr -#line 595 "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 2760 "parser.cpp" - break; - - case 123: // expr_binary: expr "|" expr -#line 597 "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 2766 "parser.cpp" - break; - - case 124: // expr_binary: expr "&" expr -#line 599 "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 2772 "parser.cpp" - break; - - case 125: // expr_binary: expr "^" expr -#line 601 "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 2778 "parser.cpp" - break; - - case 126: // expr_binary: expr "<<" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2784 "parser.cpp" - break; - - case 127: // expr_binary: expr ">>" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2790 "parser.cpp" - break; - - case 128: // expr_binary: expr "+" expr -#line 607 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2796 "parser.cpp" - break; - - case 129: // expr_binary: expr "-" expr -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2802 "parser.cpp" - break; - - case 130: // expr_binary: expr "*" expr -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2808 "parser.cpp" - break; - - case 131: // expr_binary: expr "/" expr -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2814 "parser.cpp" - break; - - case 132: // expr_binary: expr "%" expr -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2820 "parser.cpp" - break; - - case 133: // expr_primitive: expr_complement -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 2826 "parser.cpp" - break; - - case 134: // expr_primitive: expr_negate -#line 620 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 2832 "parser.cpp" - break; - - case 135: // expr_primitive: expr_not -#line 621 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 2838 "parser.cpp" - break; - - case 136: // expr_primitive: expr_call -#line 622 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 2844 "parser.cpp" - break; - - case 137: // expr_primitive: expr_method -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 2850 "parser.cpp" - break; - - case 138: // expr_primitive: expr_add_array -#line 624 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } -#line 2856 "parser.cpp" - break; - - case 139: // expr_primitive: expr_reference -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 2862 "parser.cpp" - break; - - case 140: // expr_primitive: expr_array -#line 626 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 2868 "parser.cpp" - break; - - case 141: // expr_primitive: expr_field -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 2874 "parser.cpp" - break; - - case 142: // expr_primitive: expr_size -#line 628 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 2880 "parser.cpp" - break; - - case 143: // expr_primitive: expr_paren -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 2886 "parser.cpp" - break; - - case 144: // expr_primitive: expr_thisthread -#line 630 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } -#line 2892 "parser.cpp" - break; - - case 145: // expr_primitive: expr_empty_array -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 2898 "parser.cpp" - break; - - case 146: // expr_primitive: expr_undefined -#line 632 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 2904 "parser.cpp" - break; - - case 147: // expr_primitive: expr_game -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 2910 "parser.cpp" - break; - - case 148: // expr_primitive: expr_self -#line 634 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 2916 "parser.cpp" - break; - - case 149: // expr_primitive: expr_anim -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 2922 "parser.cpp" - break; - - case 150: // expr_primitive: expr_level -#line 636 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 2928 "parser.cpp" - break; - - case 151: // expr_primitive: expr_animation -#line 637 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 2934 "parser.cpp" - break; - - case 152: // expr_primitive: expr_animtree -#line 638 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 2940 "parser.cpp" - break; - - case 153: // expr_primitive: expr_identifier -#line 639 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 2946 "parser.cpp" - break; - - case 154: // expr_primitive: expr_istring -#line 640 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 2952 "parser.cpp" - break; - - case 155: // expr_primitive: expr_string -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 2958 "parser.cpp" - break; - - case 156: // expr_primitive: expr_vector -#line 642 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 2964 "parser.cpp" - break; - - case 157: // expr_primitive: expr_float -#line 643 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 2970 "parser.cpp" - break; - - case 158: // expr_primitive: expr_integer -#line 644 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 2976 "parser.cpp" - break; - - case 159: // expr_primitive: expr_false -#line 645 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 2982 "parser.cpp" - break; - - case 160: // expr_primitive: expr_true -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 2988 "parser.cpp" - break; - - case 161: // expr_complement: "~" expr -#line 651 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2994 "parser.cpp" - break; - - case 162: // expr_negate: "-" expr_identifier -#line 656 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 3000 "parser.cpp" - break; - - case 163: // expr_negate: "-" expr_paren -#line 658 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 3006 "parser.cpp" - break; - - case 164: // expr_negate: "-" expr_array -#line 660 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 3012 "parser.cpp" - break; - - case 165: // expr_negate: "-" expr_field -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 3018 "parser.cpp" - break; - - case 166: // expr_not: "!" expr -#line 667 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3024 "parser.cpp" - break; - - case 167: // expr_call: expr_function -#line 671 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3030 "parser.cpp" - break; - - case 168: // expr_call: expr_pointer -#line 672 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3036 "parser.cpp" - break; - - case 169: // expr_method: expr_object expr_function -#line 675 "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 3042 "parser.cpp" - break; - - case 170: // expr_method: expr_object expr_pointer -#line 676 "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 3048 "parser.cpp" - break; - - case 171: // expr_function: expr_identifier "(" expr_arguments ")" -#line 681 "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 3054 "parser.cpp" - break; - - case 172: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 683 "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 3060 "parser.cpp" - break; - - case 173: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 685 "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 3066 "parser.cpp" - break; - - case 174: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 687 "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 3072 "parser.cpp" - break; - - case 175: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 689 "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::childthread); } -#line 3078 "parser.cpp" - break; - - case 176: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 691 "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::childthread); } -#line 3084 "parser.cpp" - break; - - case 177: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 696 "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 3090 "parser.cpp" - break; - - case 178: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 698 "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 3096 "parser.cpp" - break; - - case 179: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 700 "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::childthread); } -#line 3102 "parser.cpp" - break; - - case 180: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 702 "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::builtin); } -#line 3108 "parser.cpp" - break; - - case 181: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 707 "parser.ypp" - { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } -#line 3114 "parser.cpp" - break; - - case 182: // expr_parameters: expr_parameters "," expr_identifier -#line 712 "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 3120 "parser.cpp" - break; - - case 183: // expr_parameters: expr_identifier -#line 714 "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 3126 "parser.cpp" - break; - - case 184: // expr_parameters: %empty -#line 716 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3132 "parser.cpp" - break; - - case 185: // expr_arguments: expr_arguments_no_empty -#line 721 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3138 "parser.cpp" - break; - - case 186: // expr_arguments: %empty -#line 723 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3144 "parser.cpp" - break; - - case 187: // expr_arguments_no_empty: expr_arguments "," expr -#line 728 "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 3150 "parser.cpp" - break; - - case 188: // expr_arguments_no_empty: expr -#line 730 "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 3156 "parser.cpp" - break; - - case 189: // expr_reference: "::" expr_identifier -#line 735 "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 3162 "parser.cpp" - break; - - case 190: // expr_reference: expr_path "::" expr_identifier -#line 737 "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 3168 "parser.cpp" - break; - - case 191: // expr_tuple: "[" expr_tuple_arguments "]" -#line 742 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[1].value.as < ast::expr_tuple::ptr > ()); } -#line 3174 "parser.cpp" - break; - - case 192: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types -#line 747 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::move(yystack_[2].value.as < ast::expr_tuple::ptr > ()); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3180 "parser.cpp" - break; - - case 193: // expr_tuple_arguments: expr_tuple_types -#line 749 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3186 "parser.cpp" - break; - - case 194: // expr_tuple_types: expr_array -#line 753 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3192 "parser.cpp" - break; - - case 195: // expr_tuple_types: expr_field -#line 754 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3198 "parser.cpp" - break; - - case 196: // expr_tuple_types: expr_identifier -#line 755 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3204 "parser.cpp" - break; - - case 197: // expr_array: expr_object "[" expr "]" -#line 760 "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 3210 "parser.cpp" - break; - - case 198: // expr_field: expr_object "." expr_identifier_nosize -#line 765 "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 3216 "parser.cpp" - break; - - case 199: // expr_size: expr_object "." "size" -#line 770 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3222 "parser.cpp" - break; - - case 200: // expr_paren: "(" expr ")" -#line 775 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3228 "parser.cpp" - break; - - case 201: // expr_object: expr_call -#line 779 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3234 "parser.cpp" - break; - - case 202: // expr_object: expr_method -#line 780 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3240 "parser.cpp" - break; - - case 203: // expr_object: expr_array -#line 781 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3246 "parser.cpp" - break; - - case 204: // expr_object: expr_field -#line 782 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3252 "parser.cpp" - break; - - case 205: // expr_object: expr_game -#line 783 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3258 "parser.cpp" - break; - - case 206: // expr_object: expr_self -#line 784 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3264 "parser.cpp" - break; - - case 207: // expr_object: expr_anim -#line 785 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3270 "parser.cpp" - break; - - case 208: // expr_object: expr_level -#line 786 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3276 "parser.cpp" - break; - - case 209: // expr_object: expr_identifier -#line 787 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3282 "parser.cpp" - break; - - case 210: // expr_thisthread: "thisthread" -#line 792 "parser.ypp" - { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } -#line 3288 "parser.cpp" - break; - - case 211: // expr_empty_array: "[" "]" -#line 797 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3294 "parser.cpp" - break; - - case 212: // expr_undefined: "undefined" -#line 802 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3300 "parser.cpp" - break; - - case 213: // expr_game: "game" -#line 807 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3306 "parser.cpp" - break; - - case 214: // expr_self: "self" -#line 812 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3312 "parser.cpp" - break; - - case 215: // expr_anim: "anim" -#line 817 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3318 "parser.cpp" - break; - - case 216: // expr_level: "level" -#line 822 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3324 "parser.cpp" - break; - - case 217: // expr_animation: "%" "identifier" -#line 827 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3330 "parser.cpp" - break; - - case 218: // expr_animtree: "#animtree" -#line 832 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3336 "parser.cpp" - break; - - case 219: // expr_identifier_nosize: "identifier" -#line 837 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3342 "parser.cpp" - break; - - case 220: // expr_identifier: "identifier" -#line 842 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3348 "parser.cpp" - break; - - case 221: // expr_identifier: "size" -#line 844 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3354 "parser.cpp" - break; - - case 222: // expr_path: "identifier" -#line 849 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3360 "parser.cpp" - break; - - case 223: // expr_path: "path" -#line 851 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3366 "parser.cpp" - break; - - case 224: // expr_istring: "localized string" -#line 856 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3372 "parser.cpp" - break; - - case 225: // expr_string: "string literal" -#line 861 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3378 "parser.cpp" - break; - - case 226: // expr_vector: "(" expr "," expr "," expr ")" -#line 866 "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 3384 "parser.cpp" - break; - - case 227: // expr_float: "-" "float" -#line 871 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3390 "parser.cpp" - break; - - case 228: // expr_float: "float" -#line 873 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3396 "parser.cpp" - break; - - case 229: // expr_integer: "-" "integer" -#line 878 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3402 "parser.cpp" - break; - - case 230: // expr_integer: "integer" -#line 880 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3408 "parser.cpp" - break; - - case 231: // expr_false: "false" -#line 885 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3414 "parser.cpp" - break; - - case 232: // expr_true: "true" -#line 890 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3420 "parser.cpp" - break; - - -#line 3424 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "endon", "notify", "wait", - "waittill", "waittillmatch", "waittillframeend", "waitframe", "if", - "else", "do", "while", "for", "foreach", "in", "switch", "case", - "default", "break", "continue", "return", "breakpoint", "prof_begin", - "prof_end", "thread", "childthread", "thisthread", "call", "true", - "false", "undefined", "size", "game", "self", "anim", "level", "(", ")", - "{", "}", "[", "]", ",", ".", "::", ":", ";", "?", "++", "--", "<<", - ">>", "||", "&&", "==", "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", - "-=", "*=", "/=", "%=", "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", - "+", "-", "*", "/", "%", "path", "identifier", "string literal", - "localized string", "float", "integer", "SIZEOF", "ADD_ARRAY", "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_waitframe", "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_negate", - "expr_not", "expr_call", "expr_method", "expr_function", "expr_pointer", - "expr_add_array", "expr_parameters", "expr_arguments", - "expr_arguments_no_empty", "expr_reference", "expr_tuple", - "expr_tuple_arguments", "expr_tuple_types", "expr_array", "expr_field", - "expr_size", "expr_paren", "expr_object", "expr_thisthread", - "expr_empty_array", "expr_undefined", "expr_game", "expr_self", - "expr_anim", "expr_level", "expr_animation", "expr_animtree", - "expr_identifier_nosize", "expr_identifier", "expr_path", "expr_istring", - "expr_string", "expr_vector", "expr_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 H1DEBUG - // 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 H1DEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if H1DEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -287; - - const short parser::yytable_ninf_ = -223; - - const short - parser::yypact_[] = - { - 6, -287, -287, 5, 5, -24, -287, -287, 37, 6, - -287, -287, -287, -287, -287, -287, -8, -287, -287, -13, - -10, -54, -287, -287, -287, -287, -23, 1223, -287, -287, - -287, 11, -12, -287, -287, -42, 3, -287, 17, -287, - -287, -287, -287, -287, -287, -287, 1223, 821, -23, 1223, - 1223, -18, -36, 26, -287, -287, -287, 2187, -287, -287, - -287, -287, -287, -287, 413, 667, -287, -287, -287, -287, - 699, 729, -287, -287, 1012, -287, -287, -287, 1089, 1187, - 1247, 1317, -287, -287, 574, 39, -287, -287, -287, -287, - -287, -287, -287, 15, 96, -23, 49, 75, 81, 114, - 100, 124, 129, 1439, 821, -287, 2270, 134, 136, -287, - -287, -287, 1223, 142, -287, -287, -287, -287, 699, 729, - -287, 1406, -287, -287, -287, -287, 574, 140, -287, -287, - 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, - 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1286, - -20, -287, -287, 152, 1223, -23, -287, 928, -287, -287, - 1223, 1223, -23, 1223, 1223, -23, 1223, -287, 1223, 1917, - 1223, -287, 1605, 1223, 107, -23, 2152, 179, 179, 2301, - 2311, 2383, 2383, 30, 30, 30, 30, 2342, 728, 2352, - 73, 73, -287, -287, -287, 1957, -287, -287, -287, 35, - -287, 154, 1057, 1223, 146, -5, 161, 1370, 165, 166, - 167, 168, -17, 163, 169, 172, 1160, 183, 173, 175, - -287, 139, 548, 548, -287, -287, 980, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, 184, 185, 188, 191, 192, 177, -287, - -287, 51, 152, 1997, 53, 205, 2037, 56, 206, 2077, - 2116, 203, 2270, 1917, 154, 1223, -287, -287, 1223, -287, - -287, 1134, 2222, -287, 209, -287, 1223, 236, 1223, 639, - -23, 1223, 164, 208, 215, -287, -287, -287, -287, 2257, - -287, 1223, 1223, 1286, 32, -287, 62, 86, 8, 1406, - 1406, -287, -287, -287, -287, -287, -287, -287, 1223, 225, - 227, 228, 230, -287, -287, 1223, 1223, 1223, 1223, 1223, - 1223, 1223, 1223, 1223, 1223, 1223, 210, -287, 1223, 226, - -287, 1223, 229, 1223, 232, 2270, 59, -287, -287, -287, - 223, 1639, 235, 1673, 233, -287, -287, -287, 1396, 9, - 1707, -287, -287, -287, 60, 87, -287, 548, 2270, 1223, - 1223, 1223, 1223, 2270, 2270, 2270, 2270, 2270, 2270, 2270, - 2270, 2270, 2270, 2270, 240, 89, 242, 101, 245, 1741, - 1223, -287, -287, 1370, 1223, 1370, 1223, 1223, -23, 96, - 237, 241, -287, 1775, 1483, 1527, 1571, 1223, -287, 1223, - -287, 1223, -287, 103, 273, 1809, -287, 2270, 243, 1843, - 272, -287, -287, -287, 246, 249, 1223, 250, 1223, 251, - 1223, 113, 123, 125, -287, 1370, 252, 639, 1370, 1223, - -287, -287, 254, -287, 262, -287, 286, -287, -287, -287, - -287, -287, 287, -287, 1877, 279, 280, 281, 1370, 1370, - -287, -287, -287, -287, -287 - }; - - const unsigned char - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 221, 220, 0, 2, - 7, 8, 9, 14, 15, 16, 0, 223, 222, 0, - 0, 0, 1, 4, 5, 6, 184, 0, 10, 11, - 225, 0, 0, 183, 218, 0, 0, 210, 0, 232, - 231, 212, 213, 214, 215, 216, 0, 186, 0, 0, - 0, 0, 0, 220, 224, 228, 230, 0, 93, 94, - 95, 133, 134, 135, 136, 137, 167, 168, 138, 139, - 140, 141, 142, 143, 0, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 0, 154, 155, 156, 157, - 158, 159, 160, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 186, 211, 188, 0, 185, 189, - 166, 161, 0, 0, 227, 229, 201, 202, 164, 165, - 163, 0, 205, 206, 207, 208, 162, 0, 217, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 169, 170, 0, 186, 0, 17, 0, 19, 182, - 0, 186, 0, 0, 186, 0, 0, 200, 0, 188, - 0, 181, 0, 0, 0, 0, 0, 126, 127, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 128, 129, 130, 131, 132, 0, 199, 219, 198, 0, - 185, 190, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 54, 0, 0, 0, 45, 50, 0, 46, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 0, 0, 0, 201, 202, 0, 203, - 204, 0, 209, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 187, 0, 0, 0, 197, 171, 186, 52, - 48, 0, 0, 72, 0, 73, 0, 0, 0, 58, - 0, 0, 0, 0, 0, 85, 86, 87, 89, 0, - 90, 186, 186, 0, 0, 193, 203, 204, 209, 110, - 112, 53, 49, 61, 62, 63, 59, 60, 0, 0, - 0, 0, 0, 111, 113, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 173, 186, 0, - 175, 186, 0, 0, 0, 114, 0, 51, 47, 67, - 0, 0, 0, 0, 0, 55, 56, 57, 0, 0, - 0, 84, 83, 88, 0, 0, 191, 0, 98, 0, - 0, 0, 0, 99, 105, 106, 107, 108, 109, 100, - 101, 102, 104, 103, 0, 0, 0, 0, 0, 0, - 186, 172, 74, 0, 0, 0, 97, 0, 0, 0, - 0, 0, 192, 0, 0, 0, 0, 186, 174, 186, - 176, 186, 226, 0, 75, 0, 77, 96, 0, 0, - 0, 82, 91, 92, 0, 0, 186, 0, 186, 0, - 186, 0, 0, 0, 177, 0, 0, 58, 0, 0, - 64, 66, 185, 69, 185, 71, 185, 178, 179, 180, - 76, 78, 0, 80, 0, 0, 0, 0, 0, 0, - 65, 68, 70, 79, 81 - }; - - const short - parser::yypgoto_[] = - { - -287, -287, -287, 295, 336, 338, -287, -287, -287, -194, - 122, -287, -287, -287, -93, -87, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - 189, -287, -286, -277, -274, -287, -287, -287, -287, -287, - -287, -49, -11, -67, -58, -287, -287, 95, -43, -287, - -287, -287, -16, 197, 324, -287, 302, 355, -287, -287, - -287, 380, 417, 452, 490, -287, -287, -287, 0, 7, - -287, -15, -287, -287, 148, -287, -287 - }; - - const short - parser::yydefgoto_[] = - { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 224, - 225, 281, 226, 227, 228, 354, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 106, 418, 253, 254, 255, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 32, 107, 200, 69, - 258, 304, 305, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 198, 84, 85, - 86, 87, 88, 89, 90, 91, 92 - }; - - const short - parser::yytable_[] = - { - 16, 158, 116, 355, 108, 6, 31, 151, 280, 16, - 19, 20, 356, 287, 96, 357, 152, 1, 2, 3, - 4, 5, 35, 36, 6, 38, 33, 196, 21, 6, - 42, 43, 44, 45, 112, 97, 100, 22, 113, 397, - 117, 94, 98, 101, 26, 30, 95, 284, 109, 28, - 6, 126, 29, 6, 151, 17, 53, 285, 127, 99, - 154, 108, 128, 152, 93, -196, -196, 398, 319, 320, - 27, 321, 322, 102, 153, 7, 292, 156, 197, 17, - 53, 127, 30, 114, 115, 56, -222, 348, 277, 366, - 367, 35, 36, 170, 38, 159, 131, 132, 6, 155, - 17, 53, 17, 18, 7, 160, 337, 149, 256, 340, - 174, 170, 391, 400, 170, 323, 324, 170, 170, -194, - -194, 153, 144, 145, 146, 147, 148, 161, 127, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 401, 162, 408, -195, -195, 170, 257, 170, 17, 53, - 157, 355, 164, 256, 410, 201, 434, 262, 256, 170, - 356, 170, 265, 357, 127, 268, 447, 146, 147, 148, - 163, 170, 116, 116, 116, 274, 448, 256, 449, 35, - 36, 170, 38, 170, 165, 166, 6, 42, 43, 44, - 45, 257, 170, 171, 151, 303, 257, 293, 173, 414, - 175, 416, 262, 152, 154, 197, 278, 262, 283, 127, - 117, 117, 117, 286, 127, 257, 57, 288, 289, 290, - 291, 308, 262, 262, 295, 301, 262, 302, 127, 127, - 127, 296, 256, 127, 297, 103, 17, 53, 110, 111, - 116, 450, 151, 151, 453, 300, 313, 314, 118, 199, - 315, 152, 152, 316, 317, 318, 264, 338, 341, 267, - 344, 153, 350, 352, 463, 464, 115, 384, 127, 361, - 257, 144, 145, 146, 147, 148, 362, 369, 117, 370, - 371, 262, 372, 386, 390, 392, 388, 394, 127, 262, - 359, 151, 407, 169, 409, 396, 127, 411, 435, 422, - 152, 172, 439, 423, 23, 437, 421, 455, 440, 153, - 153, 441, 443, 445, 451, 456, 127, 127, 116, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 457, - 458, 460, 461, 462, 256, 24, 256, 25, 312, 263, - 452, 402, 266, 120, 259, 269, 117, 270, 153, 272, - 294, 0, 273, 0, 0, 127, 0, 308, 0, 0, - 0, 0, 0, 346, 127, 119, 0, 0, 0, 0, - 0, 0, 257, 442, 257, 444, 256, 446, 116, 256, - 0, 0, 282, 262, 0, 262, 364, 365, 420, 259, - 127, 0, 127, 0, 259, 299, 121, 0, 0, 256, - 256, 0, 0, 0, 0, 0, 0, 0, 306, 259, - 259, 0, 0, 259, 257, 0, 117, 257, 0, 0, - 0, 122, 0, 385, 0, 262, 387, 262, 262, 0, - 0, 0, 127, 0, 127, 127, 0, 257, 257, 0, - 0, 0, 0, -201, -201, 0, -201, 0, 262, 262, - -201, 0, 0, 0, 345, 127, 127, 0, 123, -201, - 0, 0, -201, 0, 0, 351, 0, 353, 259, 0, - 360, 260, 0, 0, 0, 413, 259, 0, 0, 0, - 0, 0, 273, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 431, 124, 432, 0, 433, 368, 0, 0, - -201, -201, 261, 0, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 260, 0, 0, 0, - 0, 260, 389, 0, 0, 0, 0, 122, 0, 0, - 0, 125, 0, 0, 0, 307, 260, 260, 0, 0, - 260, 0, 0, 0, 0, 0, 0, 261, 403, 404, - 405, 406, 261, 0, 306, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 123, 0, 121, 309, 310, 0, - 0, 261, 122, 415, 0, 417, 419, 122, 35, 36, - 259, 38, 259, 0, 0, 6, 42, 43, 44, 45, - 0, 122, 122, 122, 113, 260, 122, 0, 0, 124, - 0, 0, 0, 260, -209, -209, 0, -209, 0, 123, - 0, -209, 0, 0, 123, 0, 154, 0, 454, 0, - -209, 0, 259, -209, 259, 259, 261, 0, 123, 123, - 123, 0, 0, 123, 358, 17, 53, 125, 0, 0, - 0, 0, 0, 0, 124, 259, 259, 0, 0, 124, - 0, 122, 0, 0, 0, 0, 0, 0, 0, 122, - 0, -209, -209, 124, 124, 124, 0, 0, 124, 35, - 36, 0, 38, 0, 0, 0, 6, 42, 43, 44, - 45, 307, 125, 0, 0, 221, 0, 125, 123, 0, - 0, 0, 0, 222, 223, 0, 123, -202, -202, 0, - -202, 125, 125, 125, -202, 0, 125, 260, 0, 260, - 0, 0, 121, -202, 0, 0, -202, 0, 0, 0, - 0, 0, 0, 124, 0, 0, 17, 53, 0, -203, - -203, 124, -203, 0, 0, 0, -203, 122, 261, 0, - 261, 0, 0, 0, 0, -203, 0, 0, -203, 260, - 0, 260, 260, 0, -202, -202, 0, 0, 0, -204, - -204, 125, -204, 122, 0, 122, -204, 0, 0, 125, - 0, 0, 260, 260, 123, -204, 0, 0, -204, 0, - 261, 0, 358, 261, 131, 132, -203, -203, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 123, 0, 123, 261, 261, 122, 0, 122, 122, 124, - 144, 145, 146, 147, 148, 0, -204, -204, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 34, 122, 122, - 0, 0, 0, 0, 0, 124, 0, 124, 0, 0, - 0, 0, 123, 0, 123, 123, 0, 125, 0, 0, - 0, 35, 36, 37, 38, 39, 40, 41, 6, 42, - 43, 44, 45, 46, 0, 123, 123, 104, 105, 0, - 0, 48, 0, 125, 0, 125, 0, 124, 0, 124, - 124, 0, 0, 0, 0, 0, 0, 49, 50, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 124, 124, 0, 0, 51, 0, 0, 52, 17, 53, - 30, 54, 55, 56, 0, 125, 0, 125, 125, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, - 0, 0, 0, 0, 0, 0, 0, 203, 125, 125, - 204, 205, 206, 0, 207, 208, 209, 210, 0, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 35, 36, - 0, 38, 0, 0, 0, 6, 42, 43, 44, 45, - 0, 0, 157, 220, 221, 0, 0, 0, 0, 0, - 0, 202, 222, 223, 0, 0, 0, 0, 0, 203, - 0, 0, 204, 205, 206, 0, 207, 208, 209, 210, - 0, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 35, 36, 0, 38, 0, 17, 53, 6, 42, 43, - 44, 45, 0, 0, 157, 311, 221, 0, 0, 0, - 0, 0, 0, 0, 222, 223, 0, 0, 0, 0, - 0, 0, 35, 36, 0, 38, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 149, 279, - 0, 150, 0, 0, 0, 0, 203, 17, 53, 204, - 205, 206, 0, 207, 208, 209, 210, 0, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 35, 36, 0, - 38, 0, 0, 0, 6, 42, 43, 44, 45, 17, - 53, 157, 0, 221, 0, 0, 0, 0, 0, 0, - 0, 222, 223, 0, 0, 0, 0, 0, 0, -205, - -205, 0, -205, 0, 0, 0, -205, 0, 0, 0, - 0, 0, 0, 0, 0, -205, 347, 0, -205, 0, - 0, 0, 0, 203, 17, 53, 204, 205, 206, 0, - 207, 208, 209, 210, 0, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 35, 36, 34, 38, 0, 0, - 0, 6, 42, 43, 44, 45, -205, -205, 157, 0, - 221, 0, 0, 0, 0, 0, 0, 0, 222, 223, - 35, 36, 37, 38, 39, 40, 41, 6, 42, 43, - 44, 45, 46, 0, 0, 0, 47, 0, 0, 0, - 48, 0, 298, 0, 0, 0, 0, -206, -206, 0, - -206, 17, 53, 0, -206, 0, 49, 50, 0, 34, - 0, 0, 0, -206, 0, 0, -206, 0, 0, 0, - 0, 0, 0, 51, 0, 0, 52, 17, 53, 30, - 54, 55, 56, 35, 36, 37, 38, 39, 40, 41, - 6, 42, 43, 44, 45, 46, 0, 0, 0, 47, - 0, 0, 0, 48, -206, -206, 0, -207, -207, 0, - -207, 0, 0, 0, -207, 0, 0, 0, 0, 49, - 50, 0, 34, -207, 0, 0, -207, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 51, 0, 0, 52, - 17, 53, 30, 54, 55, 56, 35, 36, 37, 38, - 39, 40, 41, 6, 42, 43, 44, 45, 46, 0, - 0, 0, 104, 0, -207, -207, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -208, -208, 0, - -208, 0, 49, 50, -208, 0, 0, 0, 0, 0, - 0, 0, 0, -208, 0, 0, -208, 0, 0, 51, - 0, 0, 52, 17, 53, 30, 54, 55, 56, 203, - 0, 0, 204, 205, 206, 0, 207, 208, 209, 210, - 0, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 35, 36, 0, 38, -208, -208, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 0, 221, 0, 0, 0, - 0, 0, 0, 0, 222, 223, 35, 36, 0, 38, - 0, 0, 0, 6, 0, 0, 35, 36, 0, 38, - 0, 0, 149, 6, 0, 174, 0, 0, 0, 0, - 323, 324, 149, 0, 0, 174, 0, 17, 53, 0, - 0, 0, 0, 0, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 0, 0, 0, 0, 0, - 0, 0, 167, 17, 53, 0, 0, 168, 0, 0, - 0, 0, 130, 17, 53, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 425, 0, 0, 0, - 0, 426, 0, 0, 0, 0, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 427, 0, 0, 0, 0, 428, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 429, 0, 0, 0, 0, 430, - 0, 0, 0, 0, 130, 0, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 167, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 393, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 395, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 399, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 412, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 130, 0, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 424, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 436, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 438, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 459, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 271, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 276, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 336, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 339, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 342, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 343, 0, 0, 0, 0, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 275, 0, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 129, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 349, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 363, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 131, 132, 0, - 134, 135, 136, 137, 138, 139, 140, 131, 132, 0, - 0, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 0, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 131, 132, - 0, 0, 135, 136, 137, 138, 139, 140, 131, 132, - 0, 0, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 142, 143, 144, 145, 146, 147, 148, 0, - 0, 0, 142, 0, 144, 145, 146, 147, 148, 131, - 132, 0, 0, 0, 0, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 144, 145, 146, 147, 148 - }; - - const short - parser::yycheck_[] = - { - 0, 94, 51, 289, 47, 47, 21, 74, 202, 9, - 3, 4, 289, 207, 56, 289, 74, 11, 12, 13, - 14, 15, 40, 41, 47, 43, 26, 47, 52, 47, - 48, 49, 50, 51, 52, 35, 36, 0, 56, 30, - 51, 53, 35, 36, 52, 99, 58, 52, 48, 62, - 47, 51, 62, 47, 121, 97, 98, 62, 51, 56, - 52, 104, 98, 121, 53, 57, 58, 58, 17, 18, - 78, 20, 21, 56, 74, 98, 93, 62, 98, 97, - 98, 74, 99, 101, 102, 102, 60, 281, 53, 57, - 58, 40, 41, 58, 43, 95, 66, 67, 47, 60, - 97, 98, 97, 98, 98, 56, 53, 56, 157, 53, - 59, 58, 53, 53, 58, 64, 65, 58, 58, 57, - 58, 121, 92, 93, 94, 95, 96, 52, 121, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 53, 60, 53, 57, 58, 58, 157, 58, 97, 98, - 54, 437, 52, 202, 53, 155, 53, 157, 207, 58, - 437, 58, 162, 437, 157, 165, 53, 94, 95, 96, - 56, 58, 221, 222, 223, 175, 53, 226, 53, 40, - 41, 58, 43, 58, 60, 56, 47, 48, 49, 50, - 51, 202, 58, 57, 261, 56, 207, 212, 56, 393, - 60, 395, 202, 261, 52, 98, 52, 207, 62, 202, - 221, 222, 223, 52, 207, 226, 27, 52, 52, 52, - 52, 221, 222, 223, 61, 52, 226, 52, 221, 222, - 223, 62, 281, 226, 62, 46, 97, 98, 49, 50, - 289, 435, 309, 310, 438, 62, 62, 62, 51, 154, - 62, 309, 310, 62, 62, 78, 161, 52, 52, 164, - 57, 261, 53, 27, 458, 459, 102, 57, 261, 61, - 281, 92, 93, 94, 95, 96, 61, 52, 289, 52, - 52, 281, 52, 57, 52, 62, 57, 52, 281, 289, - 290, 358, 52, 104, 52, 62, 289, 52, 25, 62, - 358, 112, 30, 62, 9, 62, 399, 53, 62, 309, - 310, 62, 62, 62, 62, 53, 309, 310, 367, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 53, - 53, 62, 62, 62, 393, 9, 395, 9, 226, 160, - 437, 367, 163, 51, 157, 166, 367, 168, 358, 170, - 212, -1, 173, -1, -1, 358, -1, 367, -1, -1, - -1, -1, -1, 278, 367, 51, -1, -1, -1, -1, - -1, -1, 393, 426, 395, 428, 435, 430, 437, 438, - -1, -1, 203, 393, -1, 395, 301, 302, 398, 202, - 393, -1, 395, -1, 207, 216, 51, -1, -1, 458, - 459, -1, -1, -1, -1, -1, -1, -1, 221, 222, - 223, -1, -1, 226, 435, -1, 437, 438, -1, -1, - -1, 51, -1, 338, -1, 435, 341, 437, 438, -1, - -1, -1, 435, -1, 437, 438, -1, 458, 459, -1, - -1, -1, -1, 40, 41, -1, 43, -1, 458, 459, - 47, -1, -1, -1, 275, 458, 459, -1, 51, 56, - -1, -1, 59, -1, -1, 286, -1, 288, 281, -1, - 291, 157, -1, -1, -1, 390, 289, -1, -1, -1, - -1, -1, 303, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 407, 51, 409, -1, 411, 318, -1, -1, - 97, 98, 157, -1, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, -1, 202, -1, -1, -1, - -1, 207, 343, -1, -1, -1, -1, 157, -1, -1, - -1, 51, -1, -1, -1, 221, 222, 223, -1, -1, - 226, -1, -1, -1, -1, -1, -1, 202, 369, 370, - 371, 372, 207, -1, 367, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 157, -1, 221, 222, 223, -1, - -1, 226, 202, 394, -1, 396, 397, 207, 40, 41, - 393, 43, 395, -1, -1, 47, 48, 49, 50, 51, - -1, 221, 222, 223, 56, 281, 226, -1, -1, 157, - -1, -1, -1, 289, 40, 41, -1, 43, -1, 202, - -1, 47, -1, -1, 207, -1, 52, -1, 439, -1, - 56, -1, 435, 59, 437, 438, 281, -1, 221, 222, - 223, -1, -1, 226, 289, 97, 98, 157, -1, -1, - -1, -1, -1, -1, 202, 458, 459, -1, -1, 207, - -1, 281, -1, -1, -1, -1, -1, -1, -1, 289, - -1, 97, 98, 221, 222, 223, -1, -1, 226, 40, - 41, -1, 43, -1, -1, -1, 47, 48, 49, 50, - 51, 367, 202, -1, -1, 56, -1, 207, 281, -1, - -1, -1, -1, 64, 65, -1, 289, 40, 41, -1, - 43, 221, 222, 223, 47, -1, 226, 393, -1, 395, - -1, -1, 367, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, 281, -1, -1, 97, 98, -1, 40, - 41, 289, 43, -1, -1, -1, 47, 367, 393, -1, - 395, -1, -1, -1, -1, 56, -1, -1, 59, 435, - -1, 437, 438, -1, 97, 98, -1, -1, -1, 40, - 41, 281, 43, 393, -1, 395, 47, -1, -1, 289, - -1, -1, 458, 459, 367, 56, -1, -1, 59, -1, - 435, -1, 437, 438, 66, 67, 97, 98, 70, 71, - 72, 73, 74, 75, -1, -1, -1, -1, -1, -1, - 393, -1, 395, 458, 459, 435, -1, 437, 438, 367, - 92, 93, 94, 95, 96, -1, 97, 98, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 16, 458, 459, - -1, -1, -1, -1, -1, 393, -1, 395, -1, -1, - -1, -1, 435, -1, 437, 438, -1, 367, -1, -1, - -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, -1, 458, 459, 56, 57, -1, - -1, 60, -1, 393, -1, 395, -1, 435, -1, 437, - 438, -1, -1, -1, -1, -1, -1, 76, 77, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 458, 459, -1, -1, 93, -1, -1, 96, 97, 98, - 99, 100, 101, 102, -1, 435, -1, 437, 438, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, - -1, -1, -1, -1, -1, -1, -1, 19, 458, 459, - 22, 23, 24, -1, 26, 27, 28, 29, -1, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - -1, 43, -1, -1, -1, 47, 48, 49, 50, 51, - -1, -1, 54, 55, 56, -1, -1, -1, -1, -1, - -1, 11, 64, 65, -1, -1, -1, -1, -1, 19, - -1, -1, 22, 23, 24, -1, 26, 27, 28, 29, - -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, -1, 43, -1, 97, 98, 47, 48, 49, - 50, 51, -1, -1, 54, 55, 56, -1, -1, -1, - -1, -1, -1, -1, 64, 65, -1, -1, -1, -1, - -1, -1, 40, 41, -1, 43, -1, -1, -1, 47, - -1, -1, -1, -1, -1, -1, -1, -1, 56, 12, - -1, 59, -1, -1, -1, -1, 19, 97, 98, 22, - 23, 24, -1, 26, 27, 28, 29, -1, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, -1, - 43, -1, -1, -1, 47, 48, 49, 50, 51, 97, - 98, 54, -1, 56, -1, -1, -1, -1, -1, -1, - -1, 64, 65, -1, -1, -1, -1, -1, -1, 40, - 41, -1, 43, -1, -1, -1, 47, -1, -1, -1, - -1, -1, -1, -1, -1, 56, 12, -1, 59, -1, - -1, -1, -1, 19, 97, 98, 22, 23, 24, -1, - 26, 27, 28, 29, -1, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 16, 43, -1, -1, - -1, 47, 48, 49, 50, 51, 97, 98, 54, -1, - 56, -1, -1, -1, -1, -1, -1, -1, 64, 65, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, -1, -1, -1, 56, -1, -1, -1, - 60, -1, 62, -1, -1, -1, -1, 40, 41, -1, - 43, 97, 98, -1, 47, -1, 76, 77, -1, 16, - -1, -1, -1, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, 93, -1, -1, 96, 97, 98, 99, - 100, 101, 102, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, -1, -1, -1, 56, - -1, -1, -1, 60, 97, 98, -1, 40, 41, -1, - 43, -1, -1, -1, 47, -1, -1, -1, -1, 76, - 77, -1, 16, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 93, -1, -1, 96, - 97, 98, 99, 100, 101, 102, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, - -1, -1, 56, -1, 97, 98, 60, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, - 43, -1, 76, 77, 47, -1, -1, -1, -1, -1, - -1, -1, -1, 56, -1, -1, 59, -1, -1, 93, - -1, -1, 96, 97, 98, 99, 100, 101, 102, 19, - -1, -1, 22, 23, 24, -1, 26, 27, 28, 29, - -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, -1, 43, 97, 98, -1, 47, 48, 49, - 50, 51, -1, -1, 54, -1, 56, -1, -1, -1, - -1, -1, -1, -1, 64, 65, 40, 41, -1, 43, - -1, -1, -1, 47, -1, -1, 40, 41, -1, 43, - -1, -1, 56, 47, -1, 59, -1, -1, -1, -1, - 64, 65, 56, -1, -1, 59, -1, 97, 98, -1, - -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, -1, -1, -1, -1, -1, - -1, -1, 53, 97, 98, -1, -1, 58, -1, -1, - -1, -1, 63, 97, 98, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 53, -1, -1, -1, - -1, 58, -1, -1, -1, -1, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 53, -1, -1, -1, -1, 58, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 53, -1, -1, -1, -1, 58, - -1, -1, -1, -1, 63, -1, -1, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 63, -1, - -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 53, -1, 89, 90, 91, 92, 93, 94, - 95, 96, 63, -1, -1, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 53, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 53, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 53, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 63, -1, -1, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 63, -1, - -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 53, -1, 89, 90, 91, 92, 93, 94, - 95, 96, 63, -1, -1, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 53, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 53, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 58, -1, -1, -1, -1, 63, - -1, -1, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 89, 90, 91, 92, 93, - 94, 95, 96, 61, -1, 63, -1, -1, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 89, 90, 91, 92, 93, 94, 95, 96, 62, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 62, 63, -1, -1, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 89, 90, 91, 92, 93, 94, 95, 96, 62, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 63, -1, -1, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 89, 90, 91, 92, - 93, 94, 95, 96, -1, -1, -1, -1, -1, 89, - 90, 91, 92, 93, 94, 95, 96, 66, 67, -1, - 69, 70, 71, 72, 73, 74, 75, 66, 67, -1, - -1, 70, 71, 72, 73, 74, 75, -1, -1, -1, - 89, 90, 91, 92, 93, 94, 95, 96, -1, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 66, 67, - -1, -1, 70, 71, 72, 73, 74, 75, 66, 67, - -1, -1, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, 90, 91, 92, 93, 94, 95, 96, -1, - -1, -1, 90, -1, 92, 93, 94, 95, 96, 66, - 67, -1, -1, -1, -1, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 92, 93, 94, 95, 96 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 47, 98, 114, 115, - 116, 117, 118, 119, 120, 121, 191, 97, 98, 192, - 192, 52, 0, 116, 117, 118, 52, 78, 62, 62, - 99, 194, 169, 191, 16, 40, 41, 42, 43, 44, - 45, 46, 48, 49, 50, 51, 52, 56, 60, 76, - 77, 93, 96, 98, 100, 101, 102, 153, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 172, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 53, 53, 58, 56, 191, 192, 56, - 191, 192, 56, 153, 56, 57, 153, 170, 171, 191, - 153, 153, 52, 56, 101, 102, 164, 165, 176, 177, - 179, 180, 184, 185, 186, 187, 191, 192, 98, 62, - 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 89, 90, 91, 92, 93, 94, 95, 96, 56, - 59, 166, 167, 191, 52, 60, 62, 54, 127, 191, - 56, 52, 60, 56, 52, 60, 56, 53, 58, 153, - 58, 57, 153, 56, 59, 60, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 47, 98, 190, 170, - 171, 191, 11, 19, 22, 23, 24, 26, 27, 28, - 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 55, 56, 64, 65, 122, 123, 125, 126, 127, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 155, 156, 157, 164, 165, 173, 176, - 177, 180, 191, 153, 170, 191, 153, 170, 191, 153, - 153, 57, 153, 153, 191, 61, 57, 53, 52, 12, - 122, 124, 153, 62, 52, 62, 52, 122, 52, 52, - 52, 52, 93, 194, 197, 61, 62, 62, 62, 153, - 62, 52, 52, 56, 174, 175, 176, 177, 191, 180, - 180, 55, 123, 62, 62, 62, 62, 62, 78, 17, - 18, 20, 21, 64, 65, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 57, 53, 52, 57, - 53, 52, 57, 58, 57, 153, 170, 12, 122, 62, - 53, 153, 27, 153, 128, 155, 156, 157, 180, 191, - 153, 61, 61, 62, 170, 170, 57, 58, 153, 52, - 52, 52, 52, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 57, 170, 57, 170, 57, 153, - 52, 53, 62, 53, 52, 53, 62, 30, 58, 53, - 53, 53, 175, 153, 153, 153, 153, 52, 53, 52, - 53, 52, 53, 170, 122, 153, 122, 153, 154, 153, - 191, 127, 62, 62, 53, 53, 58, 53, 58, 53, - 58, 170, 170, 170, 53, 25, 53, 62, 53, 30, - 62, 62, 171, 62, 171, 62, 171, 53, 53, 53, - 122, 62, 128, 122, 153, 53, 53, 53, 53, 53, - 62, 62, 62, 122, 122 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 113, 114, 114, 115, 115, 115, 115, 115, 115, - 116, 117, 118, 118, 118, 118, 118, 119, 120, 121, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 123, 123, 124, 124, 125, - 125, 126, 126, 127, 127, 128, 128, 128, 128, 129, - 129, 130, 130, 130, 131, 132, 132, 133, 134, 134, - 135, 135, 136, 137, 137, 138, 139, 140, 141, 142, - 143, 143, 144, 145, 145, 146, 147, 148, 149, 149, - 150, 151, 152, 153, 153, 153, 154, 154, 155, 155, - 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, - 156, 156, 157, 157, 158, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 161, 162, 162, 162, 162, 163, 164, 164, 165, - 165, 166, 166, 166, 166, 166, 166, 167, 167, 167, - 167, 168, 169, 169, 169, 170, 170, 171, 171, 172, - 172, 173, 174, 174, 175, 175, 175, 176, 177, 178, - 179, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 191, 192, 192, 193, 194, 195, 196, 196, 197, - 197, 198, 199 - }; - - 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, 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, 2, 4, 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, 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, 2, 2, 2, 2, 2, 2, 1, 1, 2, - 2, 4, 6, 5, 7, 5, 7, 8, 9, 9, - 9, 3, 3, 1, 0, 1, 0, 3, 1, 2, - 3, 3, 3, 1, 1, 1, 1, 4, 3, 3, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 2, 1, 2, - 1, 1, 1 - }; - - - - -#if H1DEBUG - const short - parser::yyrline_[] = - { - 0, 263, 263, 264, 268, 270, 272, 274, 276, 278, - 283, 287, 292, 293, 294, 295, 296, 300, 305, 310, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 343, 344, 348, 350, 355, - 357, 362, 363, 367, 368, 372, 374, 376, 379, 383, - 385, 390, 392, 394, 399, 404, 406, 411, 416, 418, - 423, 425, 430, 435, 437, 442, 447, 452, 457, 462, - 467, 469, 474, 479, 481, 486, 491, 496, 501, 503, - 508, 513, 518, 523, 524, 525, 529, 530, 534, 536, - 538, 540, 542, 544, 546, 548, 550, 552, 554, 556, - 561, 563, 568, 570, 575, 580, 582, 584, 586, 588, - 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, - 610, 612, 614, 619, 620, 621, 622, 623, 624, 625, - 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, - 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, - 646, 650, 655, 657, 659, 661, 666, 671, 672, 675, - 676, 680, 682, 684, 686, 688, 690, 695, 697, 699, - 701, 706, 711, 713, 716, 720, 723, 727, 729, 734, - 736, 741, 746, 748, 753, 754, 755, 759, 764, 769, - 774, 779, 780, 781, 782, 783, 784, 785, 786, 787, - 791, 796, 801, 806, 811, 816, 821, 826, 831, 836, - 841, 843, 848, 850, 855, 860, 865, 870, 872, 877, - 879, 884, 889 - }; - - 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 // H1DEBUG - - -#line 13 "parser.ypp" -} } } // xsk::gsc::h1 -#line 4726 "parser.cpp" - -#line 893 "parser.ypp" - - -void xsk::gsc::h1::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/src/h1/xsk/parser.hpp b/src/h1/xsk/parser.hpp deleted file mode 100644 index da713a56..00000000 --- a/src/h1/xsk/parser.hpp +++ /dev/null @@ -1,5601 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// 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::gsc::h1::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_H1_PARSER_HPP_INCLUDED -# define YY_H1_PARSER_HPP_INCLUDED -// "%code requires" blocks. -#line 28 "parser.ypp" - -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "h1.hpp" -namespace xsk::gsc::h1 { class lexer; } - -#line 58 "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 H1_ASSERT -# include -# define H1_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 - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# 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 H1DEBUG -# if defined YYDEBUG -#if YYDEBUG -# define H1DEBUG 1 -# else -# define H1DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define H1DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined H1DEBUG */ - -#line 13 "parser.ypp" -namespace xsk { namespace gsc { namespace h1 { -#line 207 "parser.hpp" - - - - - /// A Bison parser. - class parser - { - public: -#ifdef H1STYPE -# ifdef __GNUC__ -# pragma GCC message "bison: do not #define H1STYPE in C++, use %define api.value.type" -# endif - typedef H1STYPE value_type; -#else - /// 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 value_type - { - public: - /// Type of *this. - typedef value_type self_type; - - /// Empty construction. - value_type () YY_NOEXCEPT - : yyraw_ () - , yytypeid_ (YY_NULLPTR) - {} - - /// Construct and fill. - template - value_type (YY_RVREF (T) t) - : yytypeid_ (&typeid (T)) - { - H1_ASSERT (sizeof (T) <= size); - new (yyas_ ()) T (YY_MOVE (t)); - } - -#if 201103L <= YY_CPLUSPLUS - /// Non copyable. - value_type (const self_type&) = delete; - /// Non copyable. - self_type& operator= (const self_type&) = delete; -#endif - - /// Destruction, allowed only if empty. - ~value_type () YY_NOEXCEPT - { - H1_ASSERT (!yytypeid_); - } - -# if 201103L <= YY_CPLUSPLUS - /// Instantiate a \a T in here from \a t. - template - T& - emplace (U&&... u) - { - H1_ASSERT (!yytypeid_); - H1_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 () - { - H1_ASSERT (!yytypeid_); - H1_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) - { - H1_ASSERT (!yytypeid_); - H1_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 - { - H1_ASSERT (yytypeid_); - H1_ASSERT (*yytypeid_ == typeid (T)); - H1_ASSERT (sizeof (T) <= size); - return *yyas_ (); - } - - /// Const accessor to a built \a T (for %printer). - template - const T& - as () const YY_NOEXCEPT - { - H1_ASSERT (yytypeid_); - H1_ASSERT (*yytypeid_ == typeid (T)); - H1_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 - { - H1_ASSERT (yytypeid_); - H1_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. - value_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 = yyraw_; - return static_cast (yyp); - } - - /// Const accessor to raw memory as \a T. - template - const T* - yyas_ () const YY_NOEXCEPT - { - const void *yyp = 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_tuple - // expr_tuple_types - // expr_object - char dummy6[sizeof (ast::expr)]; - - // expr_add_array - char dummy7[sizeof (ast::expr_add_array::ptr)]; - - // expr_anim - char dummy8[sizeof (ast::expr_anim::ptr)]; - - // expr_animation - char dummy9[sizeof (ast::expr_animation::ptr)]; - - // expr_animtree - char dummy10[sizeof (ast::expr_animtree::ptr)]; - - // expr_arguments - // expr_arguments_no_empty - char dummy11[sizeof (ast::expr_arguments::ptr)]; - - // expr_array - char dummy12[sizeof (ast::expr_array::ptr)]; - - // expr_call - char dummy13[sizeof (ast::expr_call::ptr)]; - - // expr_complement - char dummy14[sizeof (ast::expr_complement::ptr)]; - - // expr_empty_array - char dummy15[sizeof (ast::expr_empty_array::ptr)]; - - // expr_false - char dummy16[sizeof (ast::expr_false::ptr)]; - - // expr_field - char dummy17[sizeof (ast::expr_field::ptr)]; - - // expr_float - char dummy18[sizeof (ast::expr_float::ptr)]; - - // expr_game - char dummy19[sizeof (ast::expr_game::ptr)]; - - // expr_identifier_nosize - // expr_identifier - char dummy20[sizeof (ast::expr_identifier::ptr)]; - - // expr_integer - char dummy21[sizeof (ast::expr_integer::ptr)]; - - // expr_istring - char dummy22[sizeof (ast::expr_istring::ptr)]; - - // expr_level - char dummy23[sizeof (ast::expr_level::ptr)]; - - // expr_method - char dummy24[sizeof (ast::expr_method::ptr)]; - - // expr_negate - char dummy25[sizeof (ast::expr_negate::ptr)]; - - // expr_not - char dummy26[sizeof (ast::expr_not::ptr)]; - - // expr_parameters - char dummy27[sizeof (ast::expr_parameters::ptr)]; - - // expr_paren - char dummy28[sizeof (ast::expr_paren::ptr)]; - - // expr_path - char dummy29[sizeof (ast::expr_path::ptr)]; - - // expr_reference - char dummy30[sizeof (ast::expr_reference::ptr)]; - - // expr_self - char dummy31[sizeof (ast::expr_self::ptr)]; - - // expr_size - char dummy32[sizeof (ast::expr_size::ptr)]; - - // expr_string - char dummy33[sizeof (ast::expr_string::ptr)]; - - // expr_thisthread - char dummy34[sizeof (ast::expr_thisthread::ptr)]; - - // expr_true - char dummy35[sizeof (ast::expr_true::ptr)]; - - // expr_tuple_arguments - char dummy36[sizeof (ast::expr_tuple::ptr)]; - - // expr_undefined - char dummy37[sizeof (ast::expr_undefined::ptr)]; - - // expr_vector - char dummy38[sizeof (ast::expr_vector::ptr)]; - - // include - char dummy39[sizeof (ast::include::ptr)]; - - // program - char dummy40[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy41[sizeof (ast::stmt)]; - - // stmt_assign - char dummy42[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy43[sizeof (ast::stmt_break::ptr)]; - - // stmt_breakpoint - char dummy44[sizeof (ast::stmt_breakpoint::ptr)]; - - // stmt_call - char dummy45[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy46[sizeof (ast::stmt_case::ptr)]; - - // stmt_continue - char dummy47[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy48[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy49[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy50[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy51[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy52[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy53[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy54[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy55[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy56[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy57[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy58[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy59[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy60[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy61[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy62[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy63[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waitframe - char dummy64[sizeof (ast::stmt_waitframe::ptr)]; - - // stmt_waittill - char dummy65[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy66[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy67[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy68[sizeof (ast::stmt_while::ptr)]; - - // "path" - // "identifier" - // "string literal" - // "localized string" - // "float" - // "integer" - char dummy69[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]; - }; - - /// Whether the content is built: if defined, the name of the stored type. - const std::type_info *yytypeid_; - }; - -#endif - /// Backward compatibility (Bison 3.8). - typedef value_type semantic_type; - - /// Symbol locations. - typedef xsk::gsc::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 - { - H1EMPTY = -2, - H1EOF = 0, // "end of file" - H1error = 1, // error - H1UNDEF = 2, // "invalid token" - SH_DEFINE = 3, // "#define" - SH_UNDEF = 4, // "#undef" - SH_IFDEF = 5, // "#ifdef" - SH_IFNDEF = 6, // "#ifndef" - SH_IF = 7, // "#if" - SH_ELIF = 8, // "#elif" - SH_ELSE = 9, // "#else" - SH_ENDIF = 10, // "#endif" - DEVBEGIN = 11, // "/#" - DEVEND = 12, // "#/" - INLINE = 13, // "#inline" - INCLUDE = 14, // "#include" - USINGTREE = 15, // "#using_animtree" - ANIMTREE = 16, // "#animtree" - ENDON = 17, // "endon" - NOTIFY = 18, // "notify" - WAIT = 19, // "wait" - WAITTILL = 20, // "waittill" - WAITTILLMATCH = 21, // "waittillmatch" - WAITTILLFRAMEEND = 22, // "waittillframeend" - WAITFRAME = 23, // "waitframe" - IF = 24, // "if" - ELSE = 25, // "else" - DO = 26, // "do" - WHILE = 27, // "while" - FOR = 28, // "for" - FOREACH = 29, // "foreach" - IN = 30, // "in" - SWITCH = 31, // "switch" - CASE = 32, // "case" - DEFAULT = 33, // "default" - BREAK = 34, // "break" - CONTINUE = 35, // "continue" - RETURN = 36, // "return" - BREAKPOINT = 37, // "breakpoint" - PROFBEGIN = 38, // "prof_begin" - PROFEND = 39, // "prof_end" - THREAD = 40, // "thread" - CHILDTHREAD = 41, // "childthread" - THISTHREAD = 42, // "thisthread" - CALL = 43, // "call" - TRUE = 44, // "true" - FALSE = 45, // "false" - UNDEFINED = 46, // "undefined" - SIZE = 47, // "size" - GAME = 48, // "game" - SELF = 49, // "self" - ANIM = 50, // "anim" - LEVEL = 51, // "level" - LPAREN = 52, // "(" - RPAREN = 53, // ")" - LBRACE = 54, // "{" - RBRACE = 55, // "}" - LBRACKET = 56, // "[" - RBRACKET = 57, // "]" - COMMA = 58, // "," - DOT = 59, // "." - DOUBLECOLON = 60, // "::" - COLON = 61, // ":" - SEMICOLON = 62, // ";" - QMARK = 63, // "?" - INCREMENT = 64, // "++" - DECREMENT = 65, // "--" - LSHIFT = 66, // "<<" - RSHIFT = 67, // ">>" - OR = 68, // "||" - AND = 69, // "&&" - EQUALITY = 70, // "==" - INEQUALITY = 71, // "!=" - LESS_EQUAL = 72, // "<=" - GREATER_EQUAL = 73, // ">=" - LESS = 74, // "<" - GREATER = 75, // ">" - NOT = 76, // "!" - COMPLEMENT = 77, // "~" - ASSIGN = 78, // "=" - ASSIGN_ADD = 79, // "+=" - ASSIGN_SUB = 80, // "-=" - ASSIGN_MUL = 81, // "*=" - ASSIGN_DIV = 82, // "/=" - ASSIGN_MOD = 83, // "%=" - ASSIGN_BW_OR = 84, // "|=" - ASSIGN_BW_AND = 85, // "&=" - ASSIGN_BW_EXOR = 86, // "^=" - ASSIGN_RSHIFT = 87, // ">>=" - ASSIGN_LSHIFT = 88, // "<<=" - BITWISE_OR = 89, // "|" - BITWISE_AND = 90, // "&" - BITWISE_EXOR = 91, // "^" - ADD = 92, // "+" - SUB = 93, // "-" - MUL = 94, // "*" - DIV = 95, // "/" - MOD = 96, // "%" - PATH = 97, // "path" - IDENTIFIER = 98, // "identifier" - STRING = 99, // "string literal" - ISTRING = 100, // "localized string" - FLOAT = 101, // "float" - INTEGER = 102, // "integer" - SIZEOF = 103, // SIZEOF - ADD_ARRAY = 104, // ADD_ARRAY - THEN = 105, // THEN - TERN = 106, // TERN - NEG = 107, // NEG - ANIMREF = 108, // ANIMREF - PREINC = 109, // PREINC - PREDEC = 110, // PREDEC - POSTINC = 111, // POSTINC - POSTDEC = 112 // POSTDEC - }; - /// Backward compatibility alias (Bison 3.6). - typedef token_kind_type yytokentype; - }; - - /// Token kind, as returned by yylex. - typedef token::token_kind_type 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 = 113, ///< Number of tokens. - S_YYEMPTY = -2, - S_YYEOF = 0, // "end of file" - S_YYerror = 1, // error - S_YYUNDEF = 2, // "invalid token" - S_SH_DEFINE = 3, // "#define" - S_SH_UNDEF = 4, // "#undef" - S_SH_IFDEF = 5, // "#ifdef" - S_SH_IFNDEF = 6, // "#ifndef" - S_SH_IF = 7, // "#if" - S_SH_ELIF = 8, // "#elif" - S_SH_ELSE = 9, // "#else" - S_SH_ENDIF = 10, // "#endif" - S_DEVBEGIN = 11, // "/#" - S_DEVEND = 12, // "#/" - S_INLINE = 13, // "#inline" - S_INCLUDE = 14, // "#include" - S_USINGTREE = 15, // "#using_animtree" - S_ANIMTREE = 16, // "#animtree" - S_ENDON = 17, // "endon" - S_NOTIFY = 18, // "notify" - S_WAIT = 19, // "wait" - S_WAITTILL = 20, // "waittill" - S_WAITTILLMATCH = 21, // "waittillmatch" - S_WAITTILLFRAMEEND = 22, // "waittillframeend" - S_WAITFRAME = 23, // "waitframe" - S_IF = 24, // "if" - S_ELSE = 25, // "else" - S_DO = 26, // "do" - S_WHILE = 27, // "while" - S_FOR = 28, // "for" - S_FOREACH = 29, // "foreach" - S_IN = 30, // "in" - S_SWITCH = 31, // "switch" - S_CASE = 32, // "case" - S_DEFAULT = 33, // "default" - S_BREAK = 34, // "break" - S_CONTINUE = 35, // "continue" - S_RETURN = 36, // "return" - S_BREAKPOINT = 37, // "breakpoint" - S_PROFBEGIN = 38, // "prof_begin" - S_PROFEND = 39, // "prof_end" - S_THREAD = 40, // "thread" - S_CHILDTHREAD = 41, // "childthread" - S_THISTHREAD = 42, // "thisthread" - S_CALL = 43, // "call" - S_TRUE = 44, // "true" - S_FALSE = 45, // "false" - S_UNDEFINED = 46, // "undefined" - S_SIZE = 47, // "size" - S_GAME = 48, // "game" - S_SELF = 49, // "self" - S_ANIM = 50, // "anim" - S_LEVEL = 51, // "level" - S_LPAREN = 52, // "(" - S_RPAREN = 53, // ")" - S_LBRACE = 54, // "{" - S_RBRACE = 55, // "}" - S_LBRACKET = 56, // "[" - S_RBRACKET = 57, // "]" - S_COMMA = 58, // "," - S_DOT = 59, // "." - S_DOUBLECOLON = 60, // "::" - S_COLON = 61, // ":" - S_SEMICOLON = 62, // ";" - S_QMARK = 63, // "?" - S_INCREMENT = 64, // "++" - S_DECREMENT = 65, // "--" - S_LSHIFT = 66, // "<<" - S_RSHIFT = 67, // ">>" - S_OR = 68, // "||" - S_AND = 69, // "&&" - S_EQUALITY = 70, // "==" - S_INEQUALITY = 71, // "!=" - S_LESS_EQUAL = 72, // "<=" - S_GREATER_EQUAL = 73, // ">=" - S_LESS = 74, // "<" - S_GREATER = 75, // ">" - S_NOT = 76, // "!" - S_COMPLEMENT = 77, // "~" - S_ASSIGN = 78, // "=" - S_ASSIGN_ADD = 79, // "+=" - S_ASSIGN_SUB = 80, // "-=" - S_ASSIGN_MUL = 81, // "*=" - S_ASSIGN_DIV = 82, // "/=" - S_ASSIGN_MOD = 83, // "%=" - S_ASSIGN_BW_OR = 84, // "|=" - S_ASSIGN_BW_AND = 85, // "&=" - S_ASSIGN_BW_EXOR = 86, // "^=" - S_ASSIGN_RSHIFT = 87, // ">>=" - S_ASSIGN_LSHIFT = 88, // "<<=" - S_BITWISE_OR = 89, // "|" - S_BITWISE_AND = 90, // "&" - S_BITWISE_EXOR = 91, // "^" - S_ADD = 92, // "+" - S_SUB = 93, // "-" - S_MUL = 94, // "*" - S_DIV = 95, // "/" - S_MOD = 96, // "%" - S_PATH = 97, // "path" - S_IDENTIFIER = 98, // "identifier" - S_STRING = 99, // "string literal" - S_ISTRING = 100, // "localized string" - S_FLOAT = 101, // "float" - S_INTEGER = 102, // "integer" - S_SIZEOF = 103, // SIZEOF - S_ADD_ARRAY = 104, // ADD_ARRAY - S_THEN = 105, // THEN - S_TERN = 106, // TERN - S_NEG = 107, // NEG - S_ANIMREF = 108, // ANIMREF - S_PREINC = 109, // PREINC - S_PREDEC = 110, // PREDEC - S_POSTINC = 111, // POSTINC - S_POSTDEC = 112, // POSTDEC - S_YYACCEPT = 113, // $accept - S_root = 114, // root - S_program = 115, // program - S_inline = 116, // inline - S_include = 117, // include - S_declaration = 118, // declaration - S_decl_usingtree = 119, // decl_usingtree - S_decl_constant = 120, // decl_constant - S_decl_thread = 121, // decl_thread - S_stmt = 122, // stmt - S_stmt_or_dev = 123, // stmt_or_dev - S_stmt_list = 124, // stmt_list - S_stmt_or_dev_list = 125, // stmt_or_dev_list - S_stmt_dev = 126, // stmt_dev - S_stmt_block = 127, // stmt_block - S_stmt_expr = 128, // stmt_expr - S_stmt_call = 129, // stmt_call - S_stmt_assign = 130, // stmt_assign - S_stmt_endon = 131, // stmt_endon - S_stmt_notify = 132, // stmt_notify - S_stmt_wait = 133, // stmt_wait - S_stmt_waittill = 134, // stmt_waittill - S_stmt_waittillmatch = 135, // stmt_waittillmatch - S_stmt_waittillframeend = 136, // stmt_waittillframeend - S_stmt_waitframe = 137, // stmt_waitframe - S_stmt_if = 138, // stmt_if - S_stmt_ifelse = 139, // stmt_ifelse - S_stmt_while = 140, // stmt_while - S_stmt_dowhile = 141, // stmt_dowhile - S_stmt_for = 142, // stmt_for - S_stmt_foreach = 143, // stmt_foreach - S_stmt_switch = 144, // stmt_switch - S_stmt_case = 145, // stmt_case - S_stmt_default = 146, // stmt_default - S_stmt_break = 147, // stmt_break - S_stmt_continue = 148, // stmt_continue - S_stmt_return = 149, // stmt_return - S_stmt_breakpoint = 150, // stmt_breakpoint - S_stmt_prof_begin = 151, // stmt_prof_begin - S_stmt_prof_end = 152, // stmt_prof_end - S_expr = 153, // expr - S_expr_or_empty = 154, // expr_or_empty - S_expr_assign = 155, // expr_assign - S_expr_increment = 156, // expr_increment - S_expr_decrement = 157, // expr_decrement - S_expr_ternary = 158, // expr_ternary - S_expr_binary = 159, // expr_binary - S_expr_primitive = 160, // expr_primitive - S_expr_complement = 161, // expr_complement - S_expr_negate = 162, // expr_negate - S_expr_not = 163, // expr_not - S_expr_call = 164, // expr_call - S_expr_method = 165, // expr_method - S_expr_function = 166, // expr_function - S_expr_pointer = 167, // expr_pointer - S_expr_add_array = 168, // expr_add_array - S_expr_parameters = 169, // expr_parameters - S_expr_arguments = 170, // expr_arguments - S_expr_arguments_no_empty = 171, // expr_arguments_no_empty - S_expr_reference = 172, // expr_reference - S_expr_tuple = 173, // expr_tuple - S_expr_tuple_arguments = 174, // expr_tuple_arguments - S_expr_tuple_types = 175, // expr_tuple_types - S_expr_array = 176, // expr_array - S_expr_field = 177, // expr_field - S_expr_size = 178, // expr_size - S_expr_paren = 179, // expr_paren - S_expr_object = 180, // expr_object - S_expr_thisthread = 181, // expr_thisthread - S_expr_empty_array = 182, // expr_empty_array - S_expr_undefined = 183, // expr_undefined - S_expr_game = 184, // expr_game - S_expr_self = 185, // expr_self - S_expr_anim = 186, // expr_anim - S_expr_level = 187, // expr_level - S_expr_animation = 188, // expr_animation - S_expr_animtree = 189, // expr_animtree - S_expr_identifier_nosize = 190, // expr_identifier_nosize - S_expr_identifier = 191, // expr_identifier - S_expr_path = 192, // expr_path - S_expr_istring = 193, // expr_istring - S_expr_string = 194, // expr_string - S_expr_vector = 195, // expr_vector - S_expr_float = 196, // expr_float - S_expr_integer = 197, // expr_integer - S_expr_false = 198, // expr_false - S_expr_true = 199 // 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 () YY_NOEXCEPT - : 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::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_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_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_add_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_add_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_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_animtree::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_animtree::ptr& v, const location_type& l) - : 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_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_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_negate::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l) - : 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_thisthread::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_thisthread::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_tuple::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_tuple::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::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_waitframe::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_waitframe::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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.template destroy< ast::expr_add_array::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_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.template destroy< ast::expr_negate::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_thisthread: // expr_thisthread - value.template destroy< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.template destroy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.template destroy< ast::stmt_waitframe::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_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_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. - value_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 - { - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; - - /// Default constructor. - by_kind () YY_NOEXCEPT; - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that) YY_NOEXCEPT; -#endif - - /// Copy constructor. - by_kind (const by_kind& that) YY_NOEXCEPT; - - /// Constructor from (external) token numbers. - by_kind (kind_type t) YY_NOEXCEPT; - - - - /// 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 () YY_NOEXCEPT {} - - /// Constructor for valueless symbols, and symbols from each type. -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, location_type l) - : super_type (token_kind_type (tok), std::move (l)) -#else - symbol_type (int tok, const location_type& l) - : super_type (token_kind_type (tok), l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - H1_ASSERT (tok == token::H1EOF - || (token::H1error <= tok && tok <= token::MOD) - || (token::SIZEOF <= tok && tok <= token::POSTDEC)); -#endif - } -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, std::string v, location_type l) - : super_type (token_kind_type (tok), std::move (v), std::move (l)) -#else - symbol_type (int tok, const std::string& v, const location_type& l) - : super_type (token_kind_type (tok), v, l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - H1_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); -#endif - } - }; - - /// Build a parser object. - parser (xsk::gsc::h1::lexer& lexer_yyarg, xsk::gsc::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 H1DEBUG - /// 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 token kind. -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_H1EOF (location_type l) - { - return symbol_type (token::H1EOF, std::move (l)); - } -#else - static - symbol_type - make_H1EOF (const location_type& l) - { - return symbol_type (token::H1EOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_H1error (location_type l) - { - return symbol_type (token::H1error, std::move (l)); - } -#else - static - symbol_type - make_H1error (const location_type& l) - { - return symbol_type (token::H1error, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_H1UNDEF (location_type l) - { - return symbol_type (token::H1UNDEF, std::move (l)); - } -#else - static - symbol_type - make_H1UNDEF (const location_type& l) - { - return symbol_type (token::H1UNDEF, 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_ANIMTREE (location_type l) - { - return symbol_type (token::ANIMTREE, std::move (l)); - } -#else - static - symbol_type - make_ANIMTREE (const location_type& l) - { - return symbol_type (token::ANIMTREE, 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_WAITFRAME (location_type l) - { - return symbol_type (token::WAITFRAME, std::move (l)); - } -#else - static - symbol_type - make_WAITFRAME (const location_type& l) - { - return symbol_type (token::WAITFRAME, 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_CHILDTHREAD (location_type l) - { - return symbol_type (token::CHILDTHREAD, std::move (l)); - } -#else - static - symbol_type - make_CHILDTHREAD (const location_type& l) - { - return symbol_type (token::CHILDTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_THISTHREAD (location_type l) - { - return symbol_type (token::THISTHREAD, std::move (l)); - } -#else - static - symbol_type - make_THISTHREAD (const location_type& l) - { - return symbol_type (token::THISTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_CALL (location_type l) - { - return symbol_type (token::CALL, std::move (l)); - } -#else - static - symbol_type - make_CALL (const location_type& l) - { - return symbol_type (token::CALL, 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_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_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_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_SIZEOF (location_type l) - { - return symbol_type (token::SIZEOF, std::move (l)); - } -#else - static - symbol_type - make_SIZEOF (const location_type& l) - { - return symbol_type (token::SIZEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_ADD_ARRAY (location_type l) - { - return symbol_type (token::ADD_ARRAY, std::move (l)); - } -#else - static - symbol_type - make_ADD_ARRAY (const location_type& l) - { - return symbol_type (token::ADD_ARRAY, 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) YY_NOEXCEPT; - - /// 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) YY_NOEXCEPT; - - 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_kind_type enum. - static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; - - - - // 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 symbol kind of the accessing symbol of - // state STATE-NUM. - static const unsigned char yystos_[]; - - // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. - static const unsigned char yyr1_[]; - - // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. - static const signed char yyr2_[]; - - -#if H1DEBUG - // 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT; - - /// Constants. - enum - { - yylast_ = 2479, ///< Last index in yytable_. - yynnts_ = 87, ///< Number of nonterminal symbols. - yyfinal_ = 22 ///< Termination state number. - }; - - - // User arguments. - xsk::gsc::h1::lexer& lexer; - xsk::gsc::ast::program::ptr& ast; - - }; - - inline - parser::symbol_kind_type - parser::yytranslate_ (int t) YY_NOEXCEPT - { - 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::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_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); - 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_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::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_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_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 () YY_NOEXCEPT - : kind_ (symbol_kind::S_YYEMPTY) - {} - -#if 201103L <= YY_CPLUSPLUS - inline - parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT - : kind_ (that.kind_) - { - that.clear (); - } -#endif - - inline - parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT - : kind_ (that.kind_) - {} - - inline - parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT - : 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::gsc::h1 -#line 5597 "parser.hpp" - - - - -#endif // !YY_H1_PARSER_HPP_INCLUDED diff --git a/src/h1/xsk/resolver.hpp b/src/h1/xsk/resolver.hpp deleted file mode 100644 index 2e19b6ed..00000000 --- a/src/h1/xsk/resolver.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::h1 -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint16_t; - static auto token_name(std::uint16_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::gsc::h1 diff --git a/src/h2/h2.cpp b/src/h2/h2.cpp new file mode 100644 index 00000000..509bb789 --- /dev/null +++ b/src/h2/h2.cpp @@ -0,0 +1,52 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "h2.hpp" + +namespace xsk::gsc::h2 +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::str4 | props::waitframe | props::offs8, engine::h2, endian::little, system::pc, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::h2 diff --git a/src/h2/h2.hpp b/src/h2/h2.hpp new file mode 100644 index 00000000..1b92460a --- /dev/null +++ b/src/h2/h2.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::h2 +{ +// H2 PC 1.0.1280159 +constexpr usize code_count = 154; +constexpr usize func_count = 800; +constexpr usize meth_count = 1491; +constexpr usize token_count = 42524; +constexpr u32 max_string_id = 54743; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::h2 diff --git a/src/h2/h2_code.cpp b/src/h2/h2_code.cpp new file mode 100644 index 00000000..4c7f5440 --- /dev/null +++ b/src/h2/h2_code.cpp @@ -0,0 +1,169 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "h2.hpp" + +namespace xsk::gsc::h2 +{ + +extern std::array, code_count> const code_list +{{ + { 0x17, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x18, opcode::OP_EvalSelfFieldVariable }, + { 0x19, opcode::OP_Return }, + { 0x1A, opcode::OP_CallBuiltin0 }, + { 0x1B, opcode::OP_CallBuiltin1 }, + { 0x1C, opcode::OP_CallBuiltin2 }, + { 0x1D, opcode::OP_CallBuiltin3 }, + { 0x1E, opcode::OP_CallBuiltin4 }, + { 0x1F, opcode::OP_CallBuiltin5 }, + { 0x20, opcode::OP_CallBuiltin }, + { 0x21, opcode::OP_BoolNot }, + { 0x22, opcode::OP_ScriptFarMethodThreadCall }, + { 0x23, opcode::OP_JumpOnTrueExpr }, + { 0x24, opcode::OP_SetLevelFieldVariableField }, + { 0x25, opcode::OP_CastBool }, + { 0x26, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x27, opcode::OP_CallBuiltinPointer }, + { 0x28, opcode::OP_inequality }, + { 0x29, opcode::OP_GetThisthread }, + { 0x2A, opcode::OP_ClearFieldVariable }, + { 0x2B, opcode::OP_GetFloat }, + { 0x2C, opcode::OP_SafeCreateVariableFieldCached }, + { 0x2D, opcode::OP_ScriptFarFunctionCall2 }, + { 0x2E, opcode::OP_ScriptFarFunctionCall }, + { 0x2F, opcode::OP_ScriptFarChildThreadCall }, + { 0x30, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x31, opcode::OP_ClearLocalVariableFieldCached }, + { 0x32, opcode::OP_checkclearparams }, + { 0x33, opcode::OP_CastFieldObject }, + { 0x34, opcode::OP_End }, + { 0x35, opcode::OP_size }, + { 0x36, opcode::OP_EmptyArray }, + { 0x37, opcode::OP_bit_and }, + { 0x38, opcode::OP_less_equal }, + { 0x39, opcode::OP_voidCodepos }, + { 0x3A, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3B, opcode::OP_endswitch }, + { 0x3C, opcode::OP_ClearVariableField }, + { 0x3D, opcode::OP_divide }, + { 0x3E, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x3F, opcode::OP_GetUnsignedShort }, + { 0x40, opcode::OP_JumpOnTrue }, + { 0x41, opcode::OP_GetSelf }, + { 0x42, opcode::OP_ScriptFarThreadCall }, + { 0x43, opcode::OP_ScriptLocalThreadCall }, + { 0x44, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x45, opcode::OP_SetLocalVariableFieldCached }, + { 0x46, opcode::OP_plus }, + { 0x47, opcode::OP_BoolComplement }, + { 0x48, opcode::OP_ScriptMethodCallPointer }, + { 0x49, opcode::OP_inc }, + { 0x4A, opcode::OP_RemoveLocalVariables }, + { 0x4B, opcode::OP_JumpOnFalseExpr }, + { 0x4C, opcode::OP_switch }, + { 0x4D, opcode::OP_clearparams }, + { 0x4E, opcode::OP_EvalLocalVariableRefCached0 }, + { 0x4F, opcode::OP_EvalLocalVariableRefCached }, + { 0x50, opcode::OP_ScriptLocalMethodCall }, + { 0x51, opcode::OP_EvalFieldVariable }, + { 0x52, opcode::OP_EvalFieldVariableRef }, + { 0x53, opcode::OP_GetString }, + { 0x54, opcode::OP_ScriptFunctionCallPointer }, + { 0x55, opcode::OP_EvalLevelFieldVariable }, + { 0x56, opcode::OP_GetVector }, + { 0x57, opcode::OP_endon }, + { 0x58, opcode::OP_greater_equal }, + { 0x59, opcode::OP_GetSelfObject }, + { 0x5A, opcode::OP_SetAnimFieldVariableField }, + { 0x5B, opcode::OP_SetVariableField }, + { 0x5C, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x5D, opcode::OP_ScriptLocalFunctionCall }, + { 0x5E, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x5F, opcode::OP_EvalLocalArrayRefCached }, + { 0x60, opcode::OP_GetFarFunction }, + { 0x61, opcode::OP_less }, + { 0x62, opcode::OP_GetGameRef }, + { 0x63, opcode::OP_waittillFrameEnd }, + { 0x64, opcode::OP_waitframe }, + { 0x65, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x66, opcode::OP_SafeSetVariableFieldCached }, + { 0x67, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x68, opcode::OP_GetLevel }, + { 0x69, opcode::OP_notify }, + { 0x6A, opcode::OP_DecTop }, + { 0x6B, opcode::OP_shift_left }, + { 0x6C, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x6D, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x6E, opcode::OP_greater }, + { 0x6F, opcode::OP_EvalLocalVariableCached0 }, + { 0x70, opcode::OP_EvalLocalVariableCached1 }, + { 0x71, opcode::OP_EvalLocalVariableCached2 }, + { 0x72, opcode::OP_EvalLocalVariableCached3 }, + { 0x73, opcode::OP_EvalLocalVariableCached4 }, + { 0x74, opcode::OP_EvalLocalVariableCached5 }, + { 0x75, opcode::OP_EvalLocalVariableCached }, + { 0x76, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x77, opcode::OP_jump }, + { 0x78, opcode::OP_ScriptThreadCallPointer }, + { 0x79, opcode::OP_GetZero }, + { 0x7A, opcode::OP_wait }, + { 0x7B, opcode::OP_minus }, + { 0x7C, opcode::OP_SetSelfFieldVariableField }, + { 0x7D, opcode::OP_EvalNewLocalVariableRefCached0 }, + { 0x7E, opcode::OP_multiply }, + { 0x7F, opcode::OP_CreateLocalVariable }, + { 0x80, opcode::OP_ScriptLocalChildThreadCall }, + { 0x81, opcode::OP_GetInteger }, + { 0x82, opcode::OP_mod }, + { 0x83, opcode::OP_EvalAnimFieldVariableRef }, + { 0x84, opcode::OP_GetBuiltinFunction }, + { 0x85, opcode::OP_GetGame }, + { 0x86, opcode::OP_waittill }, + { 0x87, opcode::OP_dec }, + { 0x88, opcode::OP_EvalLocalVariableObjectCached }, + { 0x89, opcode::OP_PreScriptCall }, + { 0x8A, opcode::OP_GetAnim }, + { 0x8B, opcode::OP_GetUndefined }, + { 0x8C, opcode::OP_EvalLevelFieldVariableRef }, + { 0x8D, opcode::OP_GetAnimObject }, + { 0x8E, opcode::OP_GetLevelObject }, + { 0x8F, opcode::OP_bit_ex_or }, + { 0x90, opcode::OP_equality }, + { 0x91, opcode::OP_ClearArray }, + { 0x92, opcode::OP_jumpback }, + { 0x93, opcode::OP_GetAnimation }, + { 0x94, opcode::OP_EvalAnimFieldVariable }, + { 0x95, opcode::OP_GetAnimTree }, + { 0x96, opcode::OP_GetIString }, + { 0x97, opcode::OP_EvalArrayRef }, + { 0x98, opcode::OP_EvalSelfFieldVariableRef }, + { 0x99, opcode::OP_GetNegByte }, + { 0x9A, opcode::OP_GetBuiltinMethod }, + { 0x9B, opcode::OP_CallBuiltinMethodPointer }, + { 0x9C, opcode::OP_EvalArray }, + { 0x9D, opcode::OP_vector }, + { 0x9E, opcode::OP_ScriptFarMethodCall }, + { 0x9F, opcode::OP_EvalLocalArrayCached }, + { 0xA0, opcode::OP_GetByte }, + { 0xA1, opcode::OP_ScriptChildThreadCallPointer }, + { 0xA2, opcode::OP_bit_or }, + { 0xA3, opcode::OP_AddArray }, + { 0xA4, opcode::OP_waittillmatch2 }, + { 0xA5, opcode::OP_waittillmatch }, + { 0xA6, opcode::OP_GetLocalFunction }, + { 0xA7, opcode::OP_GetNegUnsignedShort }, + { 0xA8, opcode::OP_shift_right }, + { 0xA9, opcode::OP_CallBuiltinMethod0 }, + { 0xAA, opcode::OP_CallBuiltinMethod1 }, + { 0xAB, opcode::OP_CallBuiltinMethod2 }, + { 0xAC, opcode::OP_CallBuiltinMethod3 }, + { 0xAD, opcode::OP_CallBuiltinMethod4 }, + { 0xAE, opcode::OP_CallBuiltinMethod5 }, + { 0xAF, opcode::OP_CallBuiltinMethod }, + { 0xB0, opcode::OP_JumpOnFalse }, +}}; + +} // namespace xsk::gsc::h2 diff --git a/src/h2/h2_func.cpp b/src/h2/h2_func.cpp new file mode 100644 index 00000000..5b06ab1c --- /dev/null +++ b/src/h2/h2_func.cpp @@ -0,0 +1,815 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "h2.hpp" + +namespace xsk::gsc::h2 +{ + +extern std::array, func_count> const func_list +{{ + { 0x001, "precacheturret" }, + { 0x002, "getweaponarray" }, + { 0x003, "createprintchannel" }, + { 0x004, "updategamerprofileall" }, + { 0x005, "clearlocalizedstrings" }, + { 0x006, "setphysicsgravitydir" }, + { 0x007, "gettimescale" }, + { 0x008, "settimescale" }, + { 0x009, "setslowmotionview" }, + { 0x00A, "teleportscene" }, + { 0x00B, "forcesharedammo" }, + { 0x00C, "refreshhudcompass" }, + { 0x00D, "refreshhudammocounter" }, + { 0x00E, "notifyoncommand" }, + { 0x00F, "setprintchannel" }, + { 0x010, "_func_10" }, + { 0x011, "_func_11" }, + { 0x012, "_func_12" }, + { 0x013, "_func_13" }, + { 0x014, "print" }, + { 0x015, "println" }, + { 0x016, "print3d" }, + { 0x017, "line" }, + { 0x018, "spawnturret" }, + { 0x019, "canspawnturret" }, + { 0x01A, "assert" }, + { 0x01B, "pausecinematicingame" }, + { 0x01C, "drawcompassfriendlies" }, + { 0x01D, "bulletspread" }, + { 0x01E, "bullettracer" }, + { 0x01F, "badplace_delete" }, + { 0x020, "badplace_cylinder" }, + { 0x021, "badplace_arc" }, + { 0x022, "badplace_brush" }, + { 0x023, "clearallcorpses" }, + { 0x024, "setturretnode" }, + { 0x025, "unsetturretnode" }, + { 0x026, "setnodepriority" }, + { 0x027, "isnodeoccupied" }, + { 0x028, "_func_028" }, + { 0x029, "_func_029" }, + { 0x02A, "setdebugorigin" }, + { 0x02B, "setdebugangles" }, + { 0x02C, "updategamerprofile" }, + { 0x02D, "assertex" }, + { 0x02E, "assertmsg" }, + { 0x02F, "isdefined" }, + { 0x030, "isvalidmissile" }, + { 0x031, "isstring" }, + { 0x032, "setomnvar" }, + { 0x033, "getomnvar" }, + { 0x034, "setdvar" }, + { 0x035, "_func_035" }, + { 0x036, "setdynamicdvar" }, + { 0x037, "setdvarifuninitialized" }, + { 0x038, "setdevdvar" }, + { 0x039, "getdvar" }, + { 0x03A, "getdvarint" }, + { 0x03B, "getdvarfloat" }, + { 0x03C, "getdvarvector" }, + { 0x03D, "gettime" }, + { 0x03E, "gettimeutc" }, + { 0x03F, "getculldist" }, + { 0x040, "getentbynum" }, + { 0x041, "getscreenwidth" }, + { 0x042, "getscreenheight" }, + { 0x043, "getweaponmodel" }, + { 0x044, "_func_44" }, + { 0x045, "_func_45" }, + { 0x046, "_func_46" }, + { 0x047, "_func_47" }, + { 0x048, "_func_48" }, + { 0x049, "setsunlight" }, + { 0x04A, "resetsunlight" }, + { 0x04B, "getmapsundirection" }, + { 0x04C, "getmapsunangles" }, + { 0x04D, "setsundirection" }, + { 0x04E, "lerpsundirection" }, + { 0x04F, "lerpsunangles" }, + { 0x050, "resetsundirection" }, + { 0x051, "enableforcedsunshadows" }, + { 0x052, "enableforcednosunshadows" }, + { 0x053, "disableforcedsunshadows" }, + { 0x054, "enableouterspacemodellighting" }, + { 0x055, "disableouterspacemodellighting" }, + { 0x056, "remapstage" }, + { 0x057, "changelevel" }, + { 0x058, "missionsuccess" }, + { 0x059, "missionfailed" }, + { 0x05A, "cinematic" }, + { 0x05B, "cinematicingame" }, + { 0x05C, "cinematicingamesync" }, + { 0x05D, "cinematicingameloop" }, + { 0x05E, "cinematicingameloopresident" }, + { 0x05F, "iscinematicplaying" }, + { 0x060, "stopcinematicingame" }, + { 0x061, "getweapondisplayname" }, + { 0x062, "getweaponbasename" }, + { 0x063, "getweaponattachments" }, + { 0x064, "getweaponattachmentdisplaynames" }, + { 0x065, "getweaponcamoname" }, + { 0x066, "getweaponreticlename" }, + { 0x067, "getanimlength" }, + { 0x068, "animhasnotetrack" }, + { 0x069, "getnotetracktimes" }, + { 0x06A, "spawn" }, + { 0x06B, "spawnloopsound" }, + { 0x06C, "spawnloopingsound" }, + { 0x06D, "bullettrace" }, + { 0x06E, "target_setmaxsize" }, + { 0x06F, "target_setcolor" }, + { 0x070, "target_setdelay" }, + { 0x071, "getstartorigin" }, + { 0x072, "getstartangles" }, + { 0x073, "getcycleoriginoffset" }, + { 0x074, "magicgrenade" }, + { 0x075, "magicgrenademanual" }, + { 0x076, "setblur" }, + { 0x077, "musicplay" }, + { 0x078, "musicstop" }, + { 0x079, "soundfade" }, + { 0x07A, "addsubmix" }, + { 0x07B, "clearsubmix" }, + { 0x07C, "clearallsubmixes" }, + { 0x07D, "blendsubmix" }, + { 0x07E, "makestickysubmix" }, + { 0x07F, "makeunstickysubmix" }, + { 0x080, "soundtime" }, + { 0x081, "soundtimereset" }, + { 0x082, "levelsoundfade" }, + { 0x083, "precachenightvisioncodeassets" }, + { 0x084, "_func_084" }, + { 0x085, "precachedigitaldistortcodeassets" }, + { 0x086, "precacheminimapsentrycodeassets" }, + { 0x087, "savegame" }, + { 0x088, "issavesuccessful" }, + { 0x089, "issaverecentlyloaded" }, + { 0x08A, "savegamenocommit" }, + { 0x08B, "commitsave" }, + { 0x08C, "commitwouldbevalid" }, + { 0x08D, "getfxvisibility" }, + { 0x08E, "setculldist" }, + { 0x08F, "bullettracepassed" }, + { 0x090, "sighttracepassed" }, + { 0x091, "physicstrace" }, + { 0x092, "playerphysicstrace" }, + { 0x093, "getgroundposition" }, + { 0x094, "getangledelta" }, + { 0x095, "getmovedelta" }, + { 0x096, "getnorthyaw" }, + { 0x097, "getcommandfromkey" }, + { 0x098, "getsticksconfig" }, + { 0x099, "_func_99" }, + { 0x09A, "_func_9A" }, + { 0x09B, "_func_9B" }, + { 0x09C, "weaponfightdist" }, + { 0x09D, "weaponmaxdist" }, + { 0x09E, "isturretactive" }, + { 0x09F, "getstarttime" }, + { 0x0A0, "target_alloc" }, + { 0x0A1, "target_flush" }, + { 0x0A2, "target_set" }, + { 0x0A3, "target_remove" }, + { 0x0A4, "target_setshader" }, + { 0x0A5, "target_setoffscreenshader" }, + { 0x0A6, "target_isinrect" }, + { 0x0A7, "target_isincircle" }, + { 0x0A8, "target_startreticlelockon" }, + { 0x0A9, "target_clearreticlelockon" }, + { 0x0AA, "target_getarray" }, + { 0x0AB, "target_istarget" }, + { 0x0AC, "target_setattackmode" }, + { 0x0AD, "target_setjavelinonly" }, + { 0x0AE, "target_hidefromplayer" }, + { 0x0AF, "target_showtoplayer" }, + { 0x0B0, "target_setscaledrendermode" }, + { 0x0B1, "target_drawcornersonly" }, + { 0x0B2, "target_drawsquare" }, + { 0x0B3, "target_drawsingle" }, + { 0x0B4, "target_setminsize" }, + { 0x0B5, "setnorthyaw" }, + { 0x0B6, "setslowmotion" }, + { 0x0B7, "randomint" }, + { 0x0B8, "randomfloat" }, + { 0x0B9, "randomintrange" }, + { 0x0BA, "randomfloatrange" }, + { 0x0BB, "sin" }, + { 0x0BC, "cos" }, + { 0x0BD, "tan" }, + { 0x0BE, "asin" }, + { 0x0BF, "acos" }, + { 0x0C0, "atan" }, + { 0x0C1, "int" }, + { 0x0C2, "float" }, + { 0x0C3, "abs" }, + { 0x0C4, "min" }, + { 0x0C5, "objective_additionalcurrent" }, + { 0x0C6, "objective_ring" }, + { 0x0C7, "objective_setpointertextoverride" }, + { 0x0C8, "getnode" }, + { 0x0C9, "getnodearray" }, + { 0x0CA, "getallnodes" }, + { 0x0CB, "getnodesinradius" }, + { 0x0CC, "getnodesinradiussorted" }, + { 0x0CD, "getclosestnodeinsight" }, + { 0x0CE, "getreflectionlocs" }, + { 0x0CF, "getreflectionreferencelocs" }, + { 0x0D0, "getvehicletracksegment" }, + { 0x0D1, "getvehicletracksegmentarray" }, + { 0x0D2, "getallvehicletracksegments" }, + { 0x0D3, "isarray" }, + { 0x0D4, "isai" }, + { 0x0D5, "getindexforluincstring" }, + { 0x0D6, "issentient" }, + { 0x0D7, "isgodmode" }, + { 0x0D8, "getdebugdvar" }, + { 0x0D9, "getdebugdvarint" }, + { 0x0DA, "getdebugdvarfloat" }, + { 0x0DB, "setsaveddvar" }, + { 0x0DC, "getfreeaicount" }, + { 0x0DD, "getaicount" }, + { 0x0DE, "getaiarray" }, + { 0x0DF, "getaispeciesarray" }, + { 0x0E0, "getspawnerarray" }, + { 0x0E1, "getcorpsearray" }, + { 0x0E2, "getspawnerteamarray" }, + { 0x0E3, "getweaponclipmodel" }, + { 0x0E4, "getbrushmodelcenter" }, + { 0x0E5, "getkeybinding" }, + { 0x0E6, "max" }, + { 0x0E7, "floor" }, + { 0x0E8, "ceil" }, + { 0x0E9, "round" }, + { 0x0EA, "exp" }, + { 0x0EB, "log" }, + { 0x0EC, "sqrt" }, + { 0x0ED, "squared" }, + { 0x0EE, "clamp" }, + { 0x0EF, "angleclamp" }, + { 0x0F0, "angleclamp180" }, + { 0x0F1, "vectorfromlinetopoint" }, + { 0x0F2, "pointonsegmentnearesttopoint" }, + { 0x0F3, "distance" }, + { 0x0F4, "distance2d" }, + { 0x0F5, "distancesquared" }, + { 0x0F6, "length" }, + { 0x0F7, "length2d" }, + { 0x0F8, "lengthsquared" }, + { 0x0F9, "length2dsquared" }, + { 0x0FA, "closer" }, + { 0x0FB, "vectordot" }, + { 0x0FC, "vectorcross" }, + { 0x0FD, "axistoangles" }, + { 0x0FE, "visionsetthermal" }, + { 0x0FF, "visionsetpain" }, + { 0x100, "_func_100" }, + { 0x101, "_func_101" }, + { 0x102, "_func_102" }, + { 0x103, "_func_103" }, + { 0x104, "incrementcounter" }, + { 0x105, "getcountertotal" }, + { 0x106, "getlevelticks" }, + { 0x107, "perlinnoise2d" }, + { 0x108, "calcrockingangles" }, + { 0x109, "reconevent" }, + { 0x10A, "reconspatialevent" }, + { 0x10B, "setsunflareposition" }, + { 0x10C, "createthreatbiasgroup" }, + { 0x10D, "threatbiasgroupexists" }, + { 0x10E, "getthreatbias" }, + { 0x10F, "setthreatbias" }, + { 0x110, "setthreatbiasagainstall" }, + { 0x111, "setignoremegroup" }, + { 0x112, "isenemyteam" }, + { 0x113, "objective_additionalentity" }, + { 0x114, "objective_state_nomessage" }, + { 0x115, "objective_string" }, + { 0x116, "objective_string_nomessage" }, + { 0x117, "objective_additionalposition" }, + { 0x118, "objective_current_nomessage" }, + { 0x119, "vectornormalize" }, + { 0x11A, "vectortoangles" }, + { 0x11B, "vectortoyaw" }, + { 0x11C, "vectorlerp" }, + { 0x11D, "anglestoup" }, + { 0x11E, "anglestoright" }, + { 0x11F, "anglestoforward" }, + { 0x120, "anglesdelta" }, + { 0x121, "combineangles" }, + { 0x122, "transformmove" }, + { 0x123, "rotatevector" }, + { 0x124, "rotatepointaroundvector" }, + { 0x125, "issubstr" }, + { 0x126, "isendstr" }, + { 0x127, "getsubstr" }, + { 0x128, "tolower" }, + { 0x129, "strtok" }, + { 0x12A, "stricmp" }, + { 0x12B, "ambientplay" }, + { 0x12C, "_func_12C" }, + { 0x12D, "_func_12D" }, + { 0x12E, "_func_12E" }, + { 0x12F, "_func_12F" }, + { 0x130, "_func_130" }, + { 0x131, "_func_131" }, + { 0x132, "_func_132" }, + { 0x133, "_func_133" }, + { 0x134, "_func_134" }, + { 0x135, "_func_135" }, + { 0x136, "_func_136" }, + { 0x137, "_func_137" }, + { 0x138, "_func_138" }, + { 0x139, "_func_139" }, + { 0x13A, "_func_13A" }, + { 0x13B, "_func_13B" }, + { 0x13C, "_func_13C" }, + { 0x13D, "_func_13D" }, + { 0x13E, "_func_13E" }, + { 0x13F, "_func_13F" }, + { 0x140, "_func_140" }, + { 0x141, "_func_141" }, + { 0x142, "_func_142" }, + { 0x143, "_func_143" }, + { 0x144, "_func_144" }, + { 0x145, "_func_145" }, + { 0x146, "_func_146" }, + { 0x147, "_func_147" }, + { 0x148, "visionsetnaked" }, + { 0x149, "visionsetnight" }, + { 0x14A, "visionsetmissilecam" }, + { 0x14B, "ambientstop" }, + { 0x14C, "precachemodel" }, + { 0x14D, "precacheshellshock" }, + { 0x14E, "precacheitem" }, + { 0x14F, "precacheshader" }, + { 0x150, "precachestring" }, + { 0x151, "precachemenu" }, + { 0x152, "precacherumble" }, + { 0x153, "precachelocationselector" }, + { 0x154, "precacheleaderboards" }, + { 0x155, "loadfx" }, + { 0x156, "playfx" }, + { 0x157, "playfxontag" }, + { 0x158, "stopfxontag" }, + { 0x159, "killfxontag" }, + { 0x15A, "playloopedfx" }, + { 0x15B, "spawnfx" }, + { 0x15C, "triggerfx" }, + { 0x15D, "playfxontagforclients" }, + { 0x15E, "_func_15E" }, + { 0x15F, "_func_15F" }, + { 0x160, "_func_160" }, + { 0x161, "_func_161" }, + { 0x162, "_func_162" }, + { 0x163, "_func_163" }, + { 0x164, "_func_164" }, + { 0x165, "_func_165" }, + { 0x166, "_func_166" }, + { 0x167, "_func_167" }, + { 0x168, "_func_168" }, + { 0x169, "_func_169" }, + { 0x16A, "_func_16A" }, + { 0x16B, "_func_16B" }, + { 0x16C, "_func_16C" }, + { 0x16D, "_func_16D" }, + { 0x16E, "_func_16E" }, + { 0x16F, "_func_16F" }, + { 0x170, "precacheheadicon" }, + { 0x171, "_func_171" }, + { 0x172, "_func_172" }, + { 0x173, "_func_173" }, + { 0x174, "_func_174" }, + { 0x175, "_func_175" }, + { 0x176, "_func_176" }, + { 0x177, "_func_177" }, + { 0x178, "_func_178" }, + { 0x179, "_func_179" }, + { 0x17A, "_func_17A" }, + { 0x17B, "_func_17B" }, + { 0x17C, "_func_17C" }, + { 0x17D, "_func_17D" }, + { 0x17E, "_func_17E" }, + { 0x17F, "_func_17F" }, + { 0x180, "_func_180" }, + { 0x181, "_func_181" }, + { 0x182, "_func_182" }, + { 0x183, "_func_183" }, + { 0x184, "physicsexplosionsphere" }, + { 0x185, "physicsexplosioncylinder" }, + { 0x186, "physicsjolt" }, + { 0x187, "physicsjitter" }, + { 0x188, "setexpfog" }, + { 0x189, "setexpfogext" }, + { 0x18A, "setexpfogdvarsonly" }, + { 0x18B, "setexpfogextdvarsonly" }, + { 0x18C, "setatmosfog" }, + { 0x18D, "setatmosfogdvarsonly" }, + { 0x18E, "isexplosivedamagemod" }, + { 0x18F, "radiusdamage" }, + { 0x190, "setplayerignoreradiusdamage" }, + { 0x191, "glassradiusdamage" }, + { 0x192, "earthquake" }, + { 0x193, "getnumparts" }, + { 0x194, "objective_onentity" }, + { 0x195, "_func_195" }, + { 0x196, "_func_196" }, + { 0x197, "_func_197" }, + { 0x198, "_func_198" }, + { 0x199, "_func_199" }, + { 0x19A, "_func_19A" }, + { 0x19B, "_func_19B" }, + { 0x19C, "_func_19C" }, + { 0x19D, "_func_19D" }, + { 0x19E, "iprintln" }, + { 0x19F, "iprintlnbold" }, + { 0x1A0, "logstring" }, + { 0x1A1, "getent" }, + { 0x1A2, "getentarray" }, + { 0x1A3, "_func_1A3" }, + { 0x1A4, "_func_1A4" }, + { 0x1A5, "spawnstruct" }, + { 0x1A6, "_func_1A6" }, + { 0x1A7, "isalive" }, + { 0x1A8, "isspawner" }, + { 0x1A9, "missile_createattractorent" }, + { 0x1AA, "missile_createattractororigin" }, + { 0x1AB, "missile_createrepulsorent" }, + { 0x1AC, "missile_createrepulsororigin" }, + { 0x1AD, "missile_deleteattractor" }, + { 0x1AE, "_func_1AE" }, + { 0x1AF, "newhudelem" }, + { 0x1B0, "newclienthudelem" }, + { 0x1B1, "_func_1B1" }, + { 0x1B2, "resettimeout" }, + { 0x1B3, "isplayer" }, + { 0x1B4, "_func_1B4" }, + { 0x1B5, "getpartname" }, + { 0x1B6, "weaponfiretime" }, + { 0x1B7, "weaponclipsize" }, + { 0x1B8, "weaponisauto" }, + { 0x1B9, "weaponissemiauto" }, + { 0x1BA, "weaponisboltaction" }, + { 0x1BB, "weaponinheritsperks" }, + { 0x1BC, "weaponburstcount" }, + { 0x1BD, "weapontype" }, + { 0x1BE, "weaponclass" }, + { 0x1BF, "getnextarraykey" }, + { 0x1C0, "sortbydistance" }, + { 0x1C1, "tablelookup" }, + { 0x1C2, "tablelookupbyrow" }, + { 0x1C3, "tablelookupistring" }, + { 0x1C4, "tablelookupistringbyrow" }, + { 0x1C5, "tablelookuprownum" }, + { 0x1C6, "tableexists" }, + { 0x1C7, "getmissileowner" }, + { 0x1C8, "magicbullet" }, + { 0x1C9, "getweaponflashtagname" }, + { 0x1CA, "averagepoint" }, + { 0x1CB, "averagenormal" }, + { 0x1CC, "vehicle_getspawnerarray" }, + { 0x1CD, "playrumbleonposition" }, + { 0x1CE, "playrumblelooponposition" }, + { 0x1CF, "stopallrumbles" }, + { 0x1D0, "soundexists" }, + { 0x1D1, "openfile" }, + { 0x1D2, "closefile" }, + { 0x1D3, "fprintln" }, + { 0x1D4, "fprintfields" }, + { 0x1D5, "freadln" }, + { 0x1D6, "fgetarg" }, + { 0x1D7, "setminimap" }, + { 0x1D8, "setthermalbodymaterial" }, + { 0x1D9, "getarraykeys" }, + { 0x1DA, "getfirstarraykey" }, + { 0x1DB, "getglass" }, + { 0x1DC, "getglassarray" }, + { 0x1DD, "getglassorigin" }, + { 0x1DE, "isglassdestroyed" }, + { 0x1DF, "destroyglass" }, + { 0x1E0, "deleteglass" }, + { 0x1E1, "getentchannelscount" }, + { 0x1E2, "getentchannelname" }, + { 0x1E3, "objective_add" }, + { 0x1E4, "objective_delete" }, + { 0x1E5, "objective_state" }, + { 0x1E6, "objective_icon" }, + { 0x1E7, "_func_1E7" }, + { 0x1E8, "objective_position" }, + { 0x1E9, "objective_current" }, + { 0x1EA, "weaponinventorytype" }, + { 0x1EB, "weaponstartammo" }, + { 0x1EC, "weaponmaxammo" }, + { 0x1ED, "weaponaltweaponname" }, + { 0x1EE, "isweaponcliponly" }, + { 0x1EF, "isweapondetonationtimed" }, + { 0x1F0, "weaponhasthermalscope" }, + { 0x1F1, "weaponhasexplosivedamage" }, + { 0x1F2, "getvehiclenode" }, + { 0x1F3, "getvehiclenodearray" }, + { 0x1F4, "getallvehiclenodes" }, + { 0x1F5, "getnumvehicles" }, + { 0x1F6, "precachevehicle" }, + { 0x1F7, "spawnvehicle" }, + { 0x1F8, "vehicle_getarray" }, + { 0x1F9, "pow" }, + { 0x1FA, "_func_1FA" }, + { 0x1FB, "_func_1FB" }, + { 0x1FC, "_func_1FC" }, + { 0x1FD, "_func_1FD" }, + { 0x1FE, "_func_1FE" }, + { 0x1FF, "_func_1FF" }, + { 0x200, "_func_200" }, + { 0x201, "_func_201" }, + { 0x202, "_func_202" }, + { 0x203, "_func_203" }, + { 0x204, "_func_204" }, + { 0x205, "_func_205" }, + { 0x206, "_func_206" }, + { 0x207, "_func_207" }, + { 0x208, "_func_208" }, + { 0x209, "_func_209" }, + { 0x20A, "_func_20A" }, + { 0x20B, "_func_20B" }, + { 0x20C, "_func_20C" }, + { 0x20D, "_func_20D" }, + { 0x20E, "_func_20E" }, + { 0x20F, "_func_20F" }, + { 0x210, "_func_210" }, + { 0x211, "_func_211" }, + { 0x212, "_func_212" }, + { 0x213, "_func_213" }, + { 0x214, "_func_214" }, + { 0x215, "_func_215" }, + { 0x216, "_func_216" }, + { 0x217, "_func_217" }, + { 0x218, "_func_218" }, + { 0x219, "_func_219" }, + { 0x21A, "_func_21A" }, + { 0x21B, "_func_21B" }, + { 0x21C, "_func_21C" }, + { 0x21D, "getlinkednodes" }, + { 0x21E, "disconnectnodepair" }, + { 0x21F, "connectnodepair" }, + { 0x220, "_func_220" }, + { 0x221, "_func_221" }, + { 0x222, "_func_222" }, + { 0x223, "_func_223" }, + { 0x224, "_func_224" }, + { 0x225, "loadtransient" }, + { 0x226, "unloadtransient" }, + { 0x227, "unloadalltransients" }, + { 0x228, "synctransients" }, + { 0x229, "istransientqueued" }, + { 0x22A, "istransientloaded" }, + { 0x22B, "loadstartpointtransient" }, + { 0x22C, "_func_22C" }, + { 0x22D, "distance2dsquared" }, + { 0x22E, "getangledelta3d" }, + { 0x22F, "_func_22F" }, + { 0x230, "trajectorycalculateinitialvelocity" }, + { 0x231, "trajectorycalculateminimumvelocity" }, + { 0x232, "trajectorycalculateexitangle" }, + { 0x233, "trajectorycomputedeltaheightattime" }, + { 0x234, "trajectorycanattemptaccuratejump" }, + { 0x235, "_func_235" }, + { 0x236, "_func_236" }, + { 0x237, "ispointinvolume" }, + { 0x238, "cinematicgettimeinmsec" }, + { 0x239, "cinematicgetframe" }, + { 0x23A, "iscinematicloaded" }, + { 0x23B, "_func_23B" }, + { 0x23C, "bbprint" }, + { 0x23D, "_func_23D" }, + { 0x23E, "getscriptablearray" }, + { 0x23F, "clearfog" }, + { 0x240, "setleveldopplerpreset" }, + { 0x241, "screenshake" }, + { 0x242, "_func_242" }, + { 0x243, "_func_243" }, + { 0x244, "_func_244" }, + { 0x245, "_func_245" }, + { 0x246, "_func_246" }, + { 0x247, "_func_247" }, + { 0x248, "_func_248" }, + { 0x249, "_func_249" }, + { 0x24A, "_func_24A" }, + { 0x24B, "_func_24B" }, + { 0x24C, "_func_24C" }, + { 0x24D, "luinotifyevent" }, + { 0x24E, "_func_24E" }, + { 0x24F, "_func_24F" }, + { 0x250, "_func_250" }, + { 0x251, "_func_251" }, + { 0x252, "physwakeup" }, + { 0x253, "ragdollwakeup" }, + { 0x254, "_func_254" }, + { 0x255, "_func_255" }, + { 0x256, "anglestoaxis" }, + { 0x257, "visionsetwater" }, + { 0x258, "sendscriptusageanalysisdata" }, + { 0x259, "resetscriptusageanalysisdata" }, + { 0x25A, "instantlylogusageanalysisdata" }, + { 0x25B, "invertangles" }, + { 0x25C, "rotatevectorinverted" }, + { 0x25D, "_func_25D" }, + { 0x25E, "_func_25E" }, + { 0x25F, "_func_25F" }, + { 0x260, "_func_260" }, + { 0x261, "_func_261" }, + { 0x262, "getcsplinecount" }, + { 0x263, "getcsplinepointcount" }, + { 0x264, "getcsplinelength" }, + { 0x265, "getcsplinepointid" }, + { 0x266, "getcsplinepointlabel" }, + { 0x267, "getcsplinepointtension" }, + { 0x268, "getcsplinepointposition" }, + { 0x269, "getcsplinepointcorridordims" }, + { 0x26A, "getcsplinepointtangent" }, + { 0x26B, "getcsplinepointdisttonextpoint" }, + { 0x26C, "calccsplinetangent" }, + { 0x26D, "calccsplinecorridor" }, + { 0x26E, "calccsplinecorridor" }, + { 0x26F, "setnojipscore" }, + { 0x270, "setnojiptime" }, + { 0x271, "_func_271" }, + { 0x272, "getpredictedentityposition" }, + { 0x273, "gamedvrprohibitrecording" }, + { 0x274, "gamedvrstartrecording" }, + { 0x275, "gamedvrstoprecording" }, + { 0x276, "gamedvrsetvideometadata" }, + { 0x277, "gamedvrprohibitscreenshots" }, + { 0x278, "_func_278" }, + { 0x279, "gamedvrsetscreenshotmetadata" }, + { 0x27A, "queuedialog" }, + { 0x27B, "speechenablegrammar" }, + { 0x27C, "speechenable" }, + { 0x27D, "livestreamingenable" }, + { 0x27E, "livestreamingsetbitrate" }, + { 0x27F, "_func_27F" }, + { 0x280, "_func_280" }, + { 0x281, "_func_281" }, + { 0x282, "_func_282" }, + { 0x283, "_func_283" }, + { 0x284, "triggerportableradarping" }, + { 0x285, "setglaregrimematerial" }, + { 0x286, "botgetteamlimit" }, + { 0x287, "spawnfxforclient" }, + { 0x288, "botgetteamdifficulty" }, + { 0x289, "getsquadassaultelo" }, + { 0x28A, "loadluifile" }, + { 0x28B, "_func_28B" }, + { 0x28C, "_func_28C" }, + { 0x28D, "_func_28D" }, + { 0x28E, "_func_28E" }, + { 0x28F, "_func_28F" }, + { 0x290, "_func_290" }, + { 0x291, "_func_291" }, + { 0x292, "_func_292" }, + { 0x293, "_func_293" }, + { 0x294, "_func_294" }, + { 0x295, "_func_295" }, + { 0x296, "_func_296" }, + { 0x297, "_func_297" }, + { 0x298, "_func_298" }, + { 0x299, "_func_299" }, + { 0x29A, "enablecontext" }, + { 0x29B, "disablecontext" }, + { 0x29C, "_func_29C" }, + { 0x29D, "_func_29D" }, + { 0x29E, "_func_29E" }, + { 0x29F, "_func_29F" }, + { 0x2A0, "_func_2A0" }, + { 0x2A1, "_func_2A1" }, + { 0x2A2, "_func_2A2" }, + { 0x2A3, "_func_2A3" }, + { 0x2A4, "_func_2A4" }, + { 0x2A5, "_func_2A5" }, + { 0x2A6, "_func_2A6" }, + { 0x2A7, "_func_2A7" }, + { 0x2A8, "_func_2A8" }, + { 0x2A9, "_func_2A9" }, + { 0x2AA, "_func_2AA" }, + { 0x2AB, "_func_2AB" }, + { 0x2AC, "_func_2AC" }, + { 0x2AD, "_func_2AD" }, + { 0x2AE, "_func_2AE" }, + { 0x2AF, "_func_2AF" }, + { 0x2B0, "_func_2B0" }, + { 0x2B1, "_func_2B1" }, + { 0x2B2, "_func_2B2" }, + { 0x2B3, "_func_2B3" }, + { 0x2B4, "_func_2B4" }, + { 0x2B5, "_func_2B5" }, + { 0x2B6, "_func_2B6" }, + { 0x2B7, "_func_2B7" }, + { 0x2B8, "_func_2B8" }, + { 0x2B9, "_func_2B9" }, + { 0x2BA, "_func_2BA" }, + { 0x2BB, "_func_2BB" }, + { 0x2BC, "_func_2BC" }, + { 0x2BD, "_func_2BD" }, + { 0x2BE, "_func_2BE" }, + { 0x2BF, "_func_2BF" }, + { 0x2C0, "challengemessage" }, + { 0x2C1, "_func_2C1" }, + { 0x2C2, "_func_2C2" }, + { 0x2C3, "_func_2C3" }, + { 0x2C4, "_func_2C4" }, + { 0x2C5, "_func_2C5" }, + { 0x2C6, "_func_2C6" }, + { 0x2C7, "_func_2C7" }, + { 0x2C8, "_func_2C8" }, + { 0x2C9, "_func_2C9" }, + { 0x2CA, "_func_2CA" }, + { 0x2CB, "_func_2CB" }, + { 0x2CC, "_func_2CC" }, + { 0x2CD, "_func_2CD" }, + { 0x2CE, "_func_2CE" }, + { 0x2CF, "_func_2CF" }, + { 0x2D0, "_func_2D0" }, + { 0x2D1, "_func_2D1" }, + { 0x2D2, "_func_2D2" }, + { 0x2D3, "_func_2D3" }, + { 0x2D4, "_func_2D4" }, + { 0x2D5, "_func_2D5" }, + { 0x2D6, "_func_2D6" }, + { 0x2D7, "_func_2D7" }, + { 0x2D8, "_func_2D8" }, + { 0x2D9, "_func_2D9" }, + { 0x2DA, "_func_2DA" }, + { 0x2DB, "_func_2DB" }, + { 0x2DC, "_func_2DC" }, + { 0x2DD, "_func_2DD" }, + { 0x2DE, "_func_2DE" }, + { 0x2DF, "_func_2DF" }, + { 0x2E0, "_func_2E0" }, + { 0x2E1, "_func_2E1" }, + { 0x2E2, "_func_2E2" }, + { 0x2E3, "_func_2E3" }, + { 0x2E4, "_func_2E4" }, + { 0x2E5, "_func_2E5" }, + { 0x2E6, "_func_2E6" }, + { 0x2E7, "_func_2E7" }, + { 0x2E8, "_func_2E8" }, + { 0x2E9, "_func_2E9" }, + { 0x2EA, "_func_2EA" }, + { 0x2EB, "_func_2EB" }, + { 0x2EC, "_func_2EC" }, + { 0x2ED, "_func_2ED" }, + { 0x2EE, "_func_2EE" }, + { 0x2EF, "_func_2EF" }, + { 0x2F0, "_func_2F0" }, + { 0x2F1, "_func_2F1" }, + { 0x2F2, "_func_2F2" }, + { 0x2F3, "_func_2F3" }, + { 0x2F4, "_func_2F4" }, + { 0x2F5, "_func_2F5" }, + { 0x2F6, "_func_2F6" }, + { 0x2F7, "_func_2F7" }, + { 0x2F8, "_func_2F8" }, + { 0x2F9, "_func_2F9" }, + { 0x2FA, "_func_2FA" }, + { 0x2FB, "_func_2FB" }, + { 0x2FC, "_func_2FC" }, + { 0x2FD, "_func_2FD" }, + { 0x2FE, "_func_2FE" }, + { 0x2FF, "_func_2FF" }, + { 0x300, "_func_300" }, + { 0x301, "_func_301" }, + { 0x302, "_func_302" }, + { 0x303, "_func_303" }, + { 0x304, "_func_304" }, + { 0x305, "_func_305" }, + { 0x306, "_func_306" }, + { 0x307, "_func_307" }, + { 0x308, "_func_308" }, + { 0x309, "_func_309" }, + { 0x30A, "_func_30A" }, + { 0x30B, "_func_30B" }, + { 0x30C, "_func_30C" }, + { 0x30D, "_func_30D" }, + { 0x30E, "_func_30E" }, + { 0x30F, "_func_30F" }, + { 0x310, "_func_310" }, + { 0x311, "_func_311" }, + { 0x312, "_func_312" }, + { 0x313, "_func_313" }, + { 0x314, "_func_314" }, + { 0x315, "_func_315" }, + { 0x316, "fast_restart" }, + { 0x317, "_func_317" }, + { 0x318, "_func_318" }, + { 0x319, "_func_319" }, + { 0x31A, "enablepg" }, + { 0x31B, "_func_31B" }, + { 0x31C, "_func_31C" }, + { 0x31D, "_func_31D" }, + { 0x31E, "_func_31E" }, + { 0x31F, "_func_31F" }, + { 0x320, "_func_320" }, +}}; + +} // namespace xsk::gsc::h2 diff --git a/src/h2/h2_meth.cpp b/src/h2/h2_meth.cpp new file mode 100644 index 00000000..f558a362 --- /dev/null +++ b/src/h2/h2_meth.cpp @@ -0,0 +1,1506 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "h2.hpp" + +namespace xsk::gsc::h2 +{ + +extern std::array, meth_count> const meth_list +{{ + { 0x8000, "thermaldrawdisable" }, + { 0x8001, "playerforcedeathanim" }, + { 0x8002, "_meth_8002" }, + { 0x8003, "_meth_8003" }, + { 0x8004, "_meth_8004" }, + { 0x8005, "_meth_8005" }, + { 0x8006, "_meth_8006" }, + { 0x8007, "_meth_8007" }, + { 0x8008, "_meth_8008" }, + { 0x8009, "_meth_8009" }, + { 0x800A, "_meth_800A" }, + { 0x800B, "_meth_800B" }, + { 0x800C, "_meth_800C" }, + { 0x800D, "_meth_800D" }, + { 0x800E, "_meth_800E" }, + { 0x800F, "_meth_800F" }, + { 0x8010, "_meth_8010" }, + { 0x8011, "_meth_8011" }, + { 0x8012, "_meth_8012" }, + { 0x8013, "_meth_8013" }, + { 0x8014, "_meth_8014" }, + { 0x8015, "_meth_8015" }, + { 0x8016, "_meth_8016" }, + { 0x8017, "_meth_8017" }, + { 0x8018, "_meth_8018" }, + { 0x8019, "_meth_8019" }, + { 0x801A, "isonladder" }, + { 0x801B, "_meth_801B" }, + { 0x801C, "_meth_801C" }, + { 0x801D, "attach" }, + { 0x801E, "getlightfovinner" }, + { 0x801F, "getlightfovouter" }, + { 0x8020, "setlightfovrange" }, + { 0x8021, "getlightexponent" }, + { 0x8022, "setlightexponent" }, + { 0x8023, "startragdoll" }, + { 0x8024, "startragdollfromimpact" }, + { 0x8025, "_meth_8025" }, + { 0x8026, "_meth_8026" }, + { 0x8027, "_meth_8027" }, + { 0x8028, "_meth_8028" }, + { 0x8029, "thermaldrawenable" }, + { 0x802A, "detach" }, + { 0x802B, "detachall" }, + { 0x802C, "getattachsize" }, + { 0x802D, "getattachmodelname" }, + { 0x802E, "getattachtagname" }, + { 0x802F, "setturretcanaidetach" }, + { 0x8030, "setturretfov" }, + { 0x8031, "setturretfov2" }, + { 0x8032, "lerpfov" }, + { 0x8033, "lerpfovscale" }, + { 0x8034, "getvalidcoverpeekouts" }, + { 0x8035, "gethighestnodestance" }, + { 0x8036, "doesnodeallowstance" }, + { 0x8037, "_meth_8037" }, + { 0x8038, "getgunangles" }, + { 0x8039, "magicgrenade" }, + { 0x803A, "magicgrenademanual" }, + { 0x803B, "getentnum" }, + { 0x803C, "launch" }, + { 0x803D, "setsoundblend" }, + { 0x803E, "makefakeai" }, + { 0x803F, "spawndrone" }, + { 0x8040, "setcorpseremovetimer" }, + { 0x8041, "setlookattext" }, + { 0x8042, "setspawnerteam" }, + { 0x8043, "addaieventlistener" }, + { 0x8044, "removeaieventlistener" }, + { 0x8045, "getlightcolor" }, + { 0x8046, "setlightcolor" }, + { 0x8047, "_meth_8047" }, + { 0x8048, "_meth_8048" }, + { 0x8049, "_meth_8049" }, + { 0x804A, "_meth_804A" }, + { 0x804B, "getlightradius" }, + { 0x804C, "setlightradius" }, + { 0x804D, "getattachignorecollision" }, + { 0x804E, "hidepart" }, + { 0x804F, "hidepartallinstances" }, + { 0x8050, "hideallparts" }, + { 0x8051, "showpart" }, + { 0x8052, "showallparts" }, + { 0x8053, "linkto" }, + { 0x8054, "linktoblendtotag" }, + { 0x8055, "unlink" }, + { 0x8056, "setnormalhealth" }, + { 0x8057, "dodamage" }, + { 0x8058, "kill" }, + { 0x8059, "show" }, + { 0x805A, "hide" }, + { 0x805B, "_meth_805B" }, + { 0x805C, "laserforceon" }, + { 0x805D, "laserforceoff" }, + { 0x805E, "disconnectpaths" }, + { 0x805F, "connectpaths" }, + { 0x8060, "disconnectnode" }, + { 0x8061, "connectnode" }, + { 0x8062, "startusingheroonlylighting" }, + { 0x8063, "stopusingheroonlylighting" }, + { 0x8064, "startusinglessfrequentlighting" }, + { 0x8065, "stopusinglessfrequentlighting" }, + { 0x8066, "setmovingplatformplayerturnrate" }, + { 0x8067, "setthermalfog" }, + { 0x8068, "setnightvisionfog" }, + { 0x8069, "clearthermalfog" }, + { 0x806A, "clearnightvisionfog" }, + { 0x806B, "_meth_806B" }, + { 0x806C, "setmode" }, + { 0x806D, "getmode" }, + { 0x806E, "setturretignoregoals" }, + { 0x806F, "islinked" }, + { 0x8070, "enablelinkto" }, + { 0x8071, "playsoundatviewheight" }, + { 0x8072, "_meth_8072" }, + { 0x8073, "prefetchsound" }, + { 0x8074, "setpitch" }, + { 0x8075, "scalepitch" }, + { 0x8076, "setvolume" }, + { 0x8077, "scalevolume" }, + { 0x8078, "setspeakermapmonotostereo" }, + { 0x8079, "setspeakermapmonoto51" }, + { 0x807A, "setdistributed2dsound" }, + { 0x807B, "playsoundasmaster" }, + { 0x807C, "playloopsound" }, + { 0x807D, "eqon" }, + { 0x807E, "eqoff" }, + { 0x807F, "haseq" }, + { 0x8080, "iswaitingonsound" }, + { 0x8081, "foley" }, + { 0x8082, "getnormalhealth" }, + { 0x8083, "playerlinkto" }, + { 0x8084, "playerlinktodelta" }, + { 0x8085, "playerlinkweaponviewtodelta" }, + { 0x8086, "playerlinktoabsolute" }, + { 0x8087, "playerlinktoblend" }, + { 0x8088, "playerlinkedoffsetenable" }, + { 0x8089, "setwaypointedgestyle_secondaryarrow" }, + { 0x808A, "setwaypointiconoffscreenonly" }, + { 0x808B, "fadeovertime" }, + { 0x808C, "scaleovertime" }, + { 0x808D, "moveovertime" }, + { 0x808E, "reset" }, + { 0x808F, "destroy" }, + { 0x8090, "setpulsefx" }, + { 0x8091, "setplayernamestring" }, + { 0x8092, "changefontscaleovertime" }, + { 0x8093, "startignoringspotlight" }, + { 0x8094, "stopignoringspotlight" }, + { 0x8095, "dontcastshadows" }, + { 0x8096, "castshadows" }, + { 0x8097, "setstablemissile" }, + { 0x8098, "playersetgroundreferenceent" }, + { 0x8099, "dontinterpolate" }, + { 0x809A, "dospawn" }, + { 0x809B, "stalingradspawn" }, + { 0x809C, "getorigin" }, + { 0x809D, "getcentroid" }, + { 0x809E, "getshootatpos" }, + { 0x809F, "getdebugeye" }, + { 0x80A0, "useby" }, + { 0x80A1, "playsound" }, + { 0x80A2, "_meth_80A2" }, + { 0x80A3, "_meth_80A3" }, + { 0x80A4, "_meth_80A4" }, + { 0x80A5, "_meth_80A5" }, + { 0x80A6, "playerlinkedoffsetdisable" }, + { 0x80A7, "playerlinkedsetviewznear" }, + { 0x80A8, "playerlinkedsetusebaseangleforviewclamp" }, + { 0x80A9, "lerpviewangleclamp" }, + { 0x80AA, "setviewangleresistance" }, + { 0x80AB, "springcamenabled" }, + { 0x80AC, "springcamdisabled" }, + { 0x80AD, "linktoplayerview" }, + { 0x80AE, "unlinkfromplayerview" }, + { 0x80AF, "geteye" }, + { 0x80B0, "istouching" }, + { 0x80B1, "stoploopsound" }, + { 0x80B2, "stopsounds" }, + { 0x80B3, "playrumbleonentity" }, + { 0x80B4, "playrumblelooponentity" }, + { 0x80B5, "_meth_80B5" }, + { 0x80B6, "_meth_80B6" }, + { 0x80B7, "delete" }, + { 0x80B8, "setmodel" }, + { 0x80B9, "laseron" }, + { 0x80BA, "laseroff" }, + { 0x80BB, "_meth_80BB" }, + { 0x80BC, "_meth_80BC" }, + { 0x80BD, "laseraltviewon" }, + { 0x80BE, "laseraltviewoff" }, + { 0x80BF, "thermalvisionon" }, + { 0x80C0, "thermalvisiononshadowoff" }, + { 0x80C1, "_meth_80C1" }, + { 0x80C2, "_meth_80C2" }, + { 0x80C3, "_meth_80C3" }, + { 0x80C4, "_meth_80C4" }, + { 0x80C5, "setcontents" }, + { 0x80C6, "makeusable" }, + { 0x80C7, "makeunusable" }, + { 0x80C8, "_meth_80C8" }, + { 0x80C9, "_meth_80C9" }, + { 0x80CA, "setwhizbyprobabilities" }, + { 0x80CB, "visionsetnakedforplayer_lerp" }, + { 0x80CC, "setwaitnode" }, + { 0x80CD, "returnplayercontrol" }, + { 0x80CE, "vehphys_starttrack" }, + { 0x80CF, "vehphys_clearautodisable" }, + { 0x80D0, "vehicleusealtblendedaudio" }, + { 0x80D1, "settext" }, + { 0x80D2, "clearalltextafterhudelem" }, + { 0x80D3, "setshader" }, + { 0x80D4, "settargetent" }, + { 0x80D5, "cleartargetent" }, + { 0x80D6, "settimer" }, + { 0x80D7, "settimerup" }, + { 0x80D8, "settimerstatic" }, + { 0x80D9, "settenthstimer" }, + { 0x80DA, "settenthstimerup" }, + { 0x80DB, "settenthstimerstatic" }, + { 0x80DC, "setclock" }, + { 0x80DD, "setclockup" }, + { 0x80DE, "setvalue" }, + { 0x80DF, "setwaypoint" }, + { 0x80E0, "setwaypointedgestyle_rotatingicon" }, + { 0x80E1, "setcursorhint" }, + { 0x80E2, "sethintstring" }, + { 0x80E3, "_meth_80E3" }, + { 0x80E4, "forceusehinton" }, + { 0x80E5, "forceusehintoff" }, + { 0x80E6, "makesoft" }, + { 0x80E7, "makehard" }, + { 0x80E8, "willneverchange" }, + { 0x80E9, "startfiring" }, + { 0x80EA, "stopfiring" }, + { 0x80EB, "isfiringturret" }, + { 0x80EC, "startbarrelspin" }, + { 0x80ED, "stopbarrelspin" }, + { 0x80EE, "getbarrelspinrate" }, + { 0x80EF, "_meth_80EF" }, + { 0x80F0, "_meth_80F0" }, + { 0x80F1, "shootturret" }, + { 0x80F2, "getturretowner" }, + { 0x80F3, "enabledeathshield" }, + { 0x80F4, "nightvisiongogglesforceon" }, + { 0x80F5, "nightvisiongogglesforceoff" }, + { 0x80F6, "enableinvulnerability" }, + { 0x80F7, "disableinvulnerability" }, + { 0x80F8, "forceviewmodelanimation" }, + { 0x80F9, "_meth_80F9" }, + { 0x80FA, "_meth_80FA" }, + { 0x80FB, "disableturretdismount" }, + { 0x80FC, "enableturretdismount" }, + { 0x80FD, "uploadscore" }, + { 0x80FE, "uploadtime" }, + { 0x80FF, "uploadleaderboards" }, + { 0x8100, "giveachievement" }, + { 0x8101, "hidehud" }, + { 0x8102, "showhud" }, + { 0x8103, "mountvehicle" }, + { 0x8104, "dismountvehicle" }, + { 0x8105, "enableslowaim" }, + { 0x8106, "disableslowaim" }, + { 0x8107, "_meth_8107" }, + { 0x8108, "_meth_8108" }, + { 0x8109, "_meth_8109" }, + { 0x810A, "vehicleattackbuttonpressed" }, + { 0x810B, "setwhizbyoffset" }, + { 0x810C, "setsentryowner" }, + { 0x810D, "setsentrycarrier" }, + { 0x810E, "setturretminimapvisible" }, + { 0x810F, "settargetentity" }, + { 0x8110, "snaptotargetentity" }, + { 0x8111, "cleartargetentity" }, + { 0x8112, "getturrettarget" }, + { 0x8113, "setplayerspread" }, + { 0x8114, "setaispread" }, + { 0x8115, "setsuppressiontime" }, + { 0x8116, "setflaggedanimknobrestart" }, + { 0x8117, "setflaggedanimknoblimitedrestart" }, + { 0x8118, "setflaggedanimknoball" }, + { 0x8119, "setflaggedanimknoballrestart" }, + { 0x811A, "setflaggedanim" }, + { 0x811B, "setflaggedanimlimited" }, + { 0x811C, "setflaggedanimrestart" }, + { 0x811D, "setflaggedanimlimitedrestart" }, + { 0x811E, "useanimtree" }, + { 0x811F, "stopuseanimtree" }, + { 0x8120, "setanimtime" }, + { 0x8121, "allowstand" }, + { 0x8122, "allowcrouch" }, + { 0x8123, "allowprone" }, + { 0x8124, "allowlean" }, + { 0x8125, "allowswim" }, + { 0x8126, "setocclusion" }, + { 0x8127, "_meth_8127" }, + { 0x8128, "deactivateocclusion" }, + { 0x8129, "deactivateallocclusion" }, + { 0x812A, "isocclusionenabled" }, + { 0x812B, "_meth_812B" }, + { 0x812C, "_meth_812C" }, + { 0x812D, "_meth_812D" }, + { 0x812E, "_meth_812E" }, + { 0x812F, "iseqenabled" }, + { 0x8130, "seteq" }, + { 0x8131, "seteqbands" }, + { 0x8132, "deactivateeq" }, + { 0x8133, "seteqlerp" }, + { 0x8134, "islookingat" }, + { 0x8135, "isthrowinggrenade" }, + { 0x8136, "isfiring" }, + { 0x8137, "ismeleeing" }, + { 0x8138, "setautopickup" }, + { 0x8139, "allowmelee" }, + { 0x813A, "allowfire" }, + { 0x813B, "enablehealthshield" }, + { 0x813C, "setconvergencetime" }, + { 0x813D, "setconvergenceheightpercent" }, + { 0x813E, "setturretteam" }, + { 0x813F, "maketurretsolid" }, + { 0x8140, "_meth_8140" }, + { 0x8141, "maketurretoperable" }, + { 0x8142, "maketurretinoperable" }, + { 0x8143, "makeentitysentient" }, + { 0x8144, "freeentitysentient" }, + { 0x8145, "isindoor" }, + { 0x8146, "getdroptofloorposition" }, + { 0x8147, "isbadguy" }, + { 0x8148, "animscripted" }, + { 0x8149, "_meth_8149" }, + { 0x814A, "animrelative" }, + { 0x814B, "stopanimscripted" }, + { 0x814C, "clearanim" }, + { 0x814D, "setanimknob" }, + { 0x814E, "setanimknoblimited" }, + { 0x814F, "setanimknobrestart" }, + { 0x8150, "setanimknoblimitedrestart" }, + { 0x8151, "setanimknoball" }, + { 0x8152, "setanimknoballlimited" }, + { 0x8153, "setanimknoballrestart" }, + { 0x8154, "setanimknoballlimitedrestart" }, + { 0x8155, "setanim" }, + { 0x8156, "setanimlimited" }, + { 0x8157, "setanimrestart" }, + { 0x8158, "setanimlimitedrestart" }, + { 0x8159, "getanimtime" }, + { 0x815A, "getanimweight" }, + { 0x815B, "getanimassettype" }, + { 0x815C, "setflaggedanimknob" }, + { 0x815D, "setflaggedanimknoblimited" }, + { 0x815E, "setturretaccuracy" }, + { 0x815F, "setrightarc" }, + { 0x8160, "setleftarc" }, + { 0x8161, "settoparc" }, + { 0x8162, "setbottomarc" }, + { 0x8163, "setautorotationdelay" }, + { 0x8164, "setdefaultdroppitch" }, + { 0x8165, "restoredefaultdroppitch" }, + { 0x8166, "turretfiredisable" }, + { 0x8167, "getfixednodesafevolume" }, + { 0x8168, "clearfixednodesafevolume" }, + { 0x8169, "isingoal" }, + { 0x816A, "setruntopos" }, + { 0x816B, "nearnode" }, + { 0x816C, "nearclaimnode" }, + { 0x816D, "nearclaimnodeandangle" }, + { 0x816E, "atdangerousnode" }, + { 0x816F, "_meth_816F" }, + { 0x8170, "_meth_8170" }, + { 0x8171, "getenemyinfo" }, + { 0x8172, "clearenemy" }, + { 0x8173, "setentitytarget" }, + { 0x8174, "clearentitytarget" }, + { 0x8175, "setpotentialthreat" }, + { 0x8176, "clearpotentialthreat" }, + { 0x8177, "setflashbanged" }, + { 0x8178, "setengagementmindist" }, + { 0x8179, "setengagementmaxdist" }, + { 0x817A, "isknownenemyinradius" }, + { 0x817B, "isknownenemyinvolume" }, + { 0x817C, "settalktospecies" }, + { 0x817D, "invisiblenotsolid" }, + { 0x817E, "visiblesolid" }, + { 0x817F, "setdefaultaimlimits" }, + { 0x8180, "initriotshieldhealth" }, + { 0x8181, "getenemysqdist" }, + { 0x8182, "getclosestenemysqdist" }, + { 0x8183, "setthreatbiasgroup" }, + { 0x8184, "getthreatbiasgroup" }, + { 0x8185, "turretfireenable" }, + { 0x8186, "setturretmodechangewait" }, + { 0x8187, "usetriggerrequirelookat" }, + { 0x8188, "getstance" }, + { 0x8189, "setstance" }, + { 0x818A, "itemweaponsetammo" }, + { 0x818B, "getammocount" }, + { 0x818C, "gettagorigin" }, + { 0x818D, "gettagangles" }, + { 0x818E, "shellshock" }, + { 0x818F, "stunplayer" }, + { 0x8190, "stopshellshock" }, + { 0x8191, "fadeoutshellshock" }, + { 0x8192, "setdepthoffield" }, + { 0x8193, "setviewmodeldepthoffield" }, + { 0x8194, "setmotionblurmovescale" }, + { 0x8195, "pickupgrenade" }, + { 0x8196, "useturret" }, + { 0x8197, "stopuseturret" }, + { 0x8198, "canuseturret" }, + { 0x8199, "traversemode" }, + { 0x819A, "animmode" }, + { 0x819B, "orientmode" }, + { 0x819C, "getmotionangle" }, + { 0x819D, "shouldfacemotion" }, + { 0x819E, "getanglestolikelyenemypath" }, + { 0x819F, "setturretanim" }, + { 0x81A0, "getturret" }, + { 0x81A1, "getgroundenttype" }, + { 0x81A2, "_meth_81A2" }, + { 0x81A3, "_meth_81A3" }, + { 0x81A4, "_meth_81A4" }, + { 0x81A5, "_meth_81A5" }, + { 0x81A6, "animcustom" }, + { 0x81A7, "isinscriptedstate" }, + { 0x81A8, "canattackenemynode" }, + { 0x81A9, "getnegotiationstartnode" }, + { 0x81AA, "getnegotiationendnode" }, + { 0x81AB, "getnegotiationnextnode" }, + { 0x81AC, "getdoorpathnode" }, + { 0x81AD, "comparenodedirtopathdir" }, + { 0x81AE, "checkprone" }, + { 0x81AF, "pushplayer" }, + { 0x81B0, "checkgrenadethrowpos" }, + { 0x81B1, "setgoalnode" }, + { 0x81B2, "setgoalpos" }, + { 0x81B3, "setgoalentity" }, + { 0x81B4, "setgoalvolume" }, + { 0x81B5, "setgoalvolumeauto" }, + { 0x81B6, "getgoalvolume" }, + { 0x81B7, "cleargoalvolume" }, + { 0x81B8, "setfixednodesafevolume" }, + { 0x81B9, "setmotionblurturnscale" }, + { 0x81BA, "setmotionblurzoomscale" }, + { 0x81BB, "viewkick" }, + { 0x81BC, "localtoworldcoords" }, + { 0x81BD, "getentitynumber" }, + { 0x81BE, "getentityvelocity" }, + { 0x81BF, "enablegrenadetouchdamage" }, + { 0x81C0, "disablegrenadetouchdamage" }, + { 0x81C1, "enableaimassist" }, + { 0x81C2, "setlookatyawlimits" }, + { 0x81C3, "stoplookat" }, + { 0x81C4, "getmuzzlepos" }, + { 0x81C5, "getmuzzleangle" }, + { 0x81C6, "getmuzzlesideoffsetpos" }, + { 0x81C7, "getaimangle" }, + { 0x81C8, "canshoot" }, + { 0x81C9, "canshootenemy" }, + { 0x81CA, "cansee" }, + { 0x81CB, "seerecently" }, + { 0x81CC, "lastknowntime" }, + { 0x81CD, "lastknownpos" }, + { 0x81CE, "dropweapon" }, + { 0x81CF, "maymovetopoint" }, + { 0x81D0, "maymovefrompointtopoint" }, + { 0x81D1, "teleport" }, + { 0x81D2, "forceteleport" }, + { 0x81D3, "safeteleport" }, + { 0x81D4, "withinapproxpathdist" }, + { 0x81D5, "ispathdirect" }, + { 0x81D6, "allowedstances" }, + { 0x81D7, "isstanceallowed" }, + { 0x81D8, "issuppressionwaiting" }, + { 0x81D9, "issuppressed" }, + { 0x81DA, "ismovesuppressed" }, + { 0x81DB, "isgrenadepossafe" }, + { 0x81DC, "checkgrenadethrow" }, + { 0x81DD, "checkgrenadelaunch" }, + { 0x81DE, "checkgrenadelaunchpos" }, + { 0x81DF, "throwgrenade" }, + { 0x81E0, "disableaimassist" }, + { 0x81E1, "radiusdamage" }, + { 0x81E2, "detonate" }, + { 0x81E3, "damageconetrace" }, + { 0x81E4, "sightconetrace" }, + { 0x81E5, "missile_settargetent" }, + { 0x81E6, "missile_settargetpos" }, + { 0x81E7, "missile_cleartarget" }, + { 0x81E8, "missile_setflightmodedirect" }, + { 0x81E9, "missile_setflightmodetop" }, + { 0x81EA, "getlightintensity" }, + { 0x81EB, "setlightintensity" }, + { 0x81EC, "_meth_81EC" }, + { 0x81ED, "_meth_81ED" }, + { 0x81EE, "_meth_81EE" }, + { 0x81EF, "_meth_81EF" }, + { 0x81F0, "isragdoll" }, + { 0x81F1, "setmovespeedscale" }, + { 0x81F2, "cameralinkto" }, + { 0x81F3, "cameraunlink" }, + { 0x81F4, "startcoverarrival" }, + { 0x81F5, "starttraversearrival" }, + { 0x81F6, "checkcoverexitposwithpath" }, + { 0x81F7, "shoot" }, + { 0x81F8, "shootblank" }, + { 0x81F9, "melee" }, + { 0x81FA, "updateplayersightaccuracy" }, + { 0x81FB, "findshufflecovernode" }, + { 0x81FC, "findnearbycovernode" }, + { 0x81FD, "findcovernode" }, + { 0x81FE, "findbestcovernode" }, + { 0x81FF, "getcovernode" }, + { 0x8200, "usecovernode" }, + { 0x8201, "iscovervalidagainstenemy" }, + { 0x8202, "reacquirestep" }, + { 0x8203, "findreacquiredirectpath" }, + { 0x8204, "trimpathtoattack" }, + { 0x8205, "reacquiremove" }, + { 0x8206, "findreacquireproximatepath" }, + { 0x8207, "flagenemyunattackable" }, + { 0x8208, "enterprone" }, + { 0x8209, "exitprone" }, + { 0x820A, "setproneanimnodes" }, + { 0x820B, "updateprone" }, + { 0x820C, "clearpitchorient" }, + { 0x820D, "setlookatanimnodes" }, + { 0x820E, "setlookat" }, + { 0x820F, "setlookatentity" }, + { 0x8210, "controlslinkto" }, + { 0x8211, "controlsunlink" }, + { 0x8212, "makevehiclesolidcapsule" }, + { 0x8213, "_meth_8213" }, + { 0x8214, "teleportentityrelative" }, + { 0x8215, "_meth_8215" }, + { 0x8216, "_meth_8216" }, + { 0x8217, "_meth_8217" }, + { 0x8218, "_meth_8218" }, + { 0x8219, "_meth_8219" }, + { 0x821A, "_meth_821A" }, + { 0x821B, "_meth_821B" }, + { 0x821C, "drivevehicleandcontrolturret" }, + { 0x821D, "drivevehicleandcontrolturretoff" }, + { 0x821E, "getplayersetting" }, + { 0x821F, "getlocalplayerprofiledata" }, + { 0x8220, "setlocalplayerprofiledata" }, + { 0x8221, "remotecamerasoundscapeon" }, + { 0x8222, "remotecamerasoundscapeoff" }, + { 0x8223, "setmotiontrackervisible" }, + { 0x8224, "getmotiontrackervisible" }, + { 0x8225, "worldpointinreticle_circle" }, + { 0x8226, "worldpointinreticle_rect" }, + { 0x8227, "getpointinbounds" }, + { 0x8228, "transfermarkstonewscriptmodel" }, + { 0x8229, "setwatersheeting" }, + { 0x822A, "_meth_822A" }, + { 0x822B, "_meth_822B" }, + { 0x822C, "setweaponhudiconoverride" }, + { 0x822D, "getweaponhudiconoverride" }, + { 0x822E, "setempjammed" }, + { 0x822F, "playersetexpfogext" }, + { 0x8230, "playersetexpfog" }, + { 0x8231, "playersetatmosfog" }, + { 0x8232, "isitemunlocked" }, + { 0x8233, "getplayerdata" }, + { 0x8234, "vehicleturretcontroloff" }, + { 0x8235, "isturretready" }, + { 0x8236, "vehicledriveto" }, + { 0x8237, "vehicle_dospawn" }, + { 0x8238, "vehicle_isphysveh" }, + { 0x8239, "vehphys_crash" }, + { 0x823A, "_meth_823A" }, + { 0x823B, "vehphys_launch" }, + { 0x823C, "vehphys_disablecrashing" }, + { 0x823D, "vehphys_enablecrashing" }, + { 0x823E, "vehphys_setspeed" }, + { 0x823F, "vehphys_setconveyorbelt" }, + { 0x8240, "_meth_8240" }, + { 0x8241, "playerlinkedturretanglesenable" }, + { 0x8242, "playerlinkedturretanglesdisable" }, + { 0x8243, "_meth_8243" }, + { 0x8244, "_meth_8244" }, + { 0x8245, "playersetstreamorigin" }, + { 0x8246, "playerclearstreamorigin" }, + { 0x8247, "nightvisionviewon" }, + { 0x8248, "nightvisionviewoff" }, + { 0x8249, "painvisionon" }, + { 0x824A, "painvisionoff" }, + { 0x824B, "getplayerintelisfound" }, + { 0x824C, "setplayerintelfound" }, + { 0x824D, "_meth_824D" }, + { 0x824E, "sethuddynlight" }, + { 0x824F, "startscriptedanim" }, + { 0x8250, "startcoverbehavior" }, + { 0x8251, "setplayerdata" }, + { 0x8252, "getcacplayerdata" }, + { 0x8253, "setcacplayerdata" }, + { 0x8254, "trackerupdate" }, + { 0x8255, "_meth_8255" }, + { 0x8256, "buttonpressed" }, + { 0x8257, "_meth_8257" }, + { 0x8258, "_meth_8258" }, + { 0x8259, "_meth_8259" }, + { 0x825A, "dropitem" }, + { 0x825B, "_meth_825B" }, + { 0x825C, "setjitterparams" }, + { 0x825D, "sethoverparams" }, + { 0x825E, "joltbody" }, + { 0x825F, "freevehicle" }, + { 0x8260, "getwheelsurface" }, + { 0x8261, "getvehicleowner" }, + { 0x8262, "setvehiclelookattext" }, + { 0x8263, "setvehicleteam" }, + { 0x8264, "neargoalnotifydist" }, + { 0x8265, "setvehgoalpos" }, + { 0x8266, "setgoalyaw" }, + { 0x8267, "cleargoalyaw" }, + { 0x8268, "settargetyaw" }, + { 0x8269, "cleartargetyaw" }, + { 0x826A, "vehicle_helisetai" }, + { 0x826B, "setturrettargetvec" }, + { 0x826C, "setturrettargetent" }, + { 0x826D, "clearturrettargetent" }, + { 0x826E, "vehicle_canturrettargetpoint" }, + { 0x826F, "setlookatent" }, + { 0x8270, "clearlookatent" }, + { 0x8271, "setvehweapon" }, + { 0x8272, "fireweapon" }, + { 0x8273, "vehicleturretcontrolon" }, + { 0x8274, "_meth_8274" }, + { 0x8275, "_meth_8275" }, + { 0x8276, "_meth_8276" }, + { 0x8277, "_meth_8277" }, + { 0x8278, "_meth_8278" }, + { 0x8279, "_meth_8279" }, + { 0x827A, "_meth_827A" }, + { 0x827B, "_meth_827B" }, + { 0x827C, "_meth_827C" }, + { 0x827D, "_meth_827D" }, + { 0x827E, "_meth_827E" }, + { 0x827F, "_meth_827F" }, + { 0x8280, "physicslaunchserver" }, + { 0x8281, "physicslaunchserveritem" }, + { 0x8282, "clonebrushmodeltoscriptmodel" }, + { 0x8283, "_meth_8283" }, + { 0x8284, "_meth_8284" }, + { 0x8285, "_meth_8285" }, + { 0x8286, "vehicle_teleport" }, + { 0x8287, "attachpath" }, + { 0x8288, "getattachpos" }, + { 0x8289, "startpath" }, + { 0x828A, "setswitchnode" }, + { 0x828B, "setwaitspeed" }, + { 0x828C, "_meth_828C" }, + { 0x828D, "vehicle_setspeed" }, + { 0x828E, "vehicle_setspeedimmediate" }, + { 0x828F, "vehicle_rotateyaw" }, + { 0x8290, "vehicle_getspeed" }, + { 0x8291, "vehicle_getvelocity" }, + { 0x8292, "vehicle_getbodyvelocity" }, + { 0x8293, "vehicle_getsteering" }, + { 0x8294, "vehicle_getthrottle" }, + { 0x8295, "vehicle_turnengineoff" }, + { 0x8296, "vehicle_turnengineon" }, + { 0x8297, "vehicle_orientto" }, + { 0x8298, "getgoalspeedmph" }, + { 0x8299, "setacceleration" }, + { 0x829A, "setdeceleration" }, + { 0x829B, "resumespeed" }, + { 0x829C, "setyawspeed" }, + { 0x829D, "setyawspeedbyname" }, + { 0x829E, "setmaxpitchroll" }, + { 0x829F, "setairresitance" }, + { 0x82A0, "setturningability" }, + { 0x82A1, "_meth_82A1" }, + { 0x82A2, "_meth_82A2" }, + { 0x82A3, "_meth_82A3" }, + { 0x82A4, "_meth_82A4" }, + { 0x82A5, "_meth_82A5" }, + { 0x82A6, "_meth_82A6" }, + { 0x82A7, "_meth_82A7" }, + { 0x82A8, "_meth_82A8" }, + { 0x82A9, "_meth_82A9" }, + { 0x82AA, "_meth_82AA" }, + { 0x82AB, "_meth_82AB" }, + { 0x82AC, "_meth_82AC" }, + { 0x82AD, "weaponlocknoclearance" }, + { 0x82AE, "_meth_82AE" }, + { 0x82AF, "showhudsplash" }, + { 0x82B0, "setperk" }, + { 0x82B1, "hasperk" }, + { 0x82B2, "clearperks" }, + { 0x82B3, "unsetperk" }, + { 0x82B4, "_meth_82B4" }, + { 0x82B5, "_meth_82B5" }, + { 0x82B6, "noclip" }, + { 0x82B7, "ufo" }, + { 0x82B8, "moveto" }, + { 0x82B9, "movex" }, + { 0x82BA, "movey" }, + { 0x82BB, "movez" }, + { 0x82BC, "movegravity" }, + { 0x82BD, "moveslide" }, + { 0x82BE, "stopmoveslide" }, + { 0x82BF, "rotateto" }, + { 0x82C0, "rotatepitch" }, + { 0x82C1, "rotateyaw" }, + { 0x82C2, "rotateroll" }, + { 0x82C3, "addpitch" }, + { 0x82C4, "addyaw" }, + { 0x82C5, "addroll" }, + { 0x82C6, "vibrate" }, + { 0x82C7, "rotatevelocity" }, + { 0x82C8, "solid" }, + { 0x82C9, "notsolid" }, + { 0x82CA, "setcandamage" }, + { 0x82CB, "setcanradiusdamage" }, + { 0x82CC, "physicslaunchclient" }, + { 0x82CD, "_meth_82CD" }, + { 0x82CE, "_meth_82CE" }, + { 0x82CF, "_meth_82CF" }, + { 0x82D0, "_meth_82D0" }, + { 0x82D1, "_meth_82D1" }, + { 0x82D2, "_meth_82D2" }, + { 0x82D3, "_meth_82D3" }, + { 0x82D4, "_meth_82D4" }, + { 0x82D5, "disableweaponpickup" }, + { 0x82D6, "enableweaponpickup" }, + { 0x82D7, "issplitscreenplayer" }, + { 0x82D8, "_meth_82D8" }, + { 0x82D9, "getweaponslistoffhands" }, + { 0x82DA, "getweaponslistitems" }, + { 0x82DB, "getweaponslistexclusives" }, + { 0x82DC, "getweaponslist" }, + { 0x82DD, "canplayerplacesentry" }, + { 0x82DE, "canplayerplacetank" }, + { 0x82DF, "_meth_82DF" }, + { 0x82E0, "visionsetnakedforplayer" }, + { 0x82E1, "visionsetnightforplayer" }, + { 0x82E2, "visionsetmissilecamforplayer" }, + { 0x82E3, "visionsetthermalforplayer" }, + { 0x82E4, "setblurforplayer" }, + { 0x82E5, "getplayerweaponmodel" }, + { 0x82E6, "getplayerknifemodel" }, + { 0x82E7, "updateplayermodelwithweapons" }, + { 0x82E8, "notifyonplayercommand" }, + { 0x82E9, "canmantle" }, + { 0x82EA, "forcemantle" }, + { 0x82EB, "ismantling" }, + { 0x82EC, "playfx" }, + { 0x82ED, "player_recoilscaleon" }, + { 0x82EE, "player_recoilscaleoff" }, + { 0x82EF, "weaponlockstart" }, + { 0x82F0, "weaponlockfinalize" }, + { 0x82F1, "weaponlockfree" }, + { 0x82F2, "weaponlocktargettooclose" }, + { 0x82F3, "_meth_82F3" }, + { 0x82F4, "_meth_82F4" }, + { 0x82F5, "_meth_82F5" }, + { 0x82F6, "_meth_82F6" }, + { 0x82F7, "_meth_82F7" }, + { 0x82F8, "getviewmodel" }, + { 0x82F9, "fragbuttonpressed" }, + { 0x82FA, "secondaryoffhandbuttonpressed" }, + { 0x82FB, "getcurrentweaponclipammo" }, + { 0x82FC, "setvelocity" }, + { 0x82FD, "getplayerviewheight" }, + { 0x82FE, "getnormalizedmovement" }, + { 0x82FF, "playlocalsound" }, + { 0x8300, "stoplocalsound" }, + { 0x8301, "setweaponammoclip" }, + { 0x8302, "setweaponammostock" }, + { 0x8303, "getweaponammoclip" }, + { 0x8304, "getweaponammostock" }, + { 0x8305, "hasreloadmultipleanim" }, + { 0x8306, "regweaponforfxremoval" }, + { 0x8307, "setclientdvar" }, + { 0x8308, "setclientdvars" }, + { 0x8309, "_meth_8309" }, + { 0x830A, "_meth_830A" }, + { 0x830B, "allowads" }, + { 0x830C, "allowjump" }, + { 0x830D, "allowsprint" }, + { 0x830E, "_meth_830E" }, + { 0x830F, "_meth_830F" }, + { 0x8310, "setspreadoverride" }, + { 0x8311, "resetspreadoverride" }, + { 0x8312, "setaimspreadmovementscale" }, + { 0x8313, "setactionslot" }, + { 0x8314, "setviewkickscale" }, + { 0x8315, "getviewkickscale" }, + { 0x8316, "getweaponslistall" }, + { 0x8317, "getweaponslistprimaries" }, + { 0x8318, "getnormalizedcameramovement" }, + { 0x8319, "giveweapon" }, + { 0x831A, "takeweapon" }, + { 0x831B, "takeallweapons" }, + { 0x831C, "getcurrentweapon" }, + { 0x831D, "getcurrentprimaryweapon" }, + { 0x831E, "getcurrentoffhand" }, + { 0x831F, "hasweapon" }, + { 0x8320, "switchtoweapon" }, + { 0x8321, "switchtoweaponimmediate" }, + { 0x8322, "_meth_8322" }, + { 0x8323, "switchtooffhand" }, + { 0x8324, "setoffhandsecondaryclass" }, + { 0x8325, "getoffhandsecondaryclass" }, + { 0x8326, "beginlocationselection" }, + { 0x8327, "endlocationselection" }, + { 0x8328, "disableweapons" }, + { 0x8329, "enableweapons" }, + { 0x832A, "disableoffhandweapons" }, + { 0x832B, "enableoffhandweapons" }, + { 0x832C, "disableweaponswitch" }, + { 0x832D, "enableweaponswitch" }, + { 0x832E, "openpopupmenu" }, + { 0x832F, "openpopupmenunomouse" }, + { 0x8330, "closepopupmenu" }, + { 0x8331, "openmenu" }, + { 0x8332, "closemenu" }, + { 0x8333, "_meth_8333" }, + { 0x8334, "freezecontrols" }, + { 0x8335, "disableusability" }, + { 0x8336, "enableusability" }, + { 0x8337, "setwhizbyspreads" }, + { 0x8338, "setwhizbyradii" }, + { 0x8339, "setreverb" }, + { 0x833A, "deactivatereverb" }, + { 0x833B, "setvolmod" }, + { 0x833C, "givestartammo" }, + { 0x833D, "givemaxammo" }, + { 0x833E, "getfractionstartammo" }, + { 0x833F, "getfractionmaxammo" }, + { 0x8340, "isdualwielding" }, + { 0x8341, "isreloading" }, + { 0x8342, "isswitchingweapon" }, + { 0x8343, "setorigin" }, + { 0x8344, "getvelocity" }, + { 0x8345, "setplayerangles" }, + { 0x8346, "getplayerangles" }, + { 0x8347, "usebuttonpressed" }, + { 0x8348, "attackbuttonpressed" }, + { 0x8349, "adsbuttonpressed" }, + { 0x834A, "meleebuttonpressed" }, + { 0x834B, "playerads" }, + { 0x834C, "isonground" }, + { 0x834D, "isusingturret" }, + { 0x834E, "setviewmodel" }, + { 0x834F, "setoffhandprimaryclass" }, + { 0x8350, "getoffhandprimaryclass" }, + { 0x8351, "enablefocus" }, + { 0x8352, "disablefocus" }, + { 0x8353, "enablezoom" }, + { 0x8354, "disablezoom" }, + { 0x8355, "_meth_8355" }, + { 0x8356, "_meth_8356" }, + { 0x8357, "_meth_8357" }, + { 0x8358, "_meth_8358" }, + { 0x8359, "_meth_8359" }, + { 0x835A, "_meth_835A" }, + { 0x835B, "_meth_835B" }, + { 0x835C, "_meth_835C" }, + { 0x835D, "_meth_835D" }, + { 0x835E, "_meth_835E" }, + { 0x835F, "_meth_835F" }, + { 0x8360, "_meth_8360" }, + { 0x8361, "_meth_8361" }, + { 0x8362, "_meth_8362" }, + { 0x8363, "_meth_8363" }, + { 0x8364, "_meth_8364" }, + { 0x8365, "_meth_8365" }, + { 0x8366, "_meth_8366" }, + { 0x8367, "_meth_8367" }, + { 0x8368, "_meth_8368" }, + { 0x8369, "_meth_8369" }, + { 0x836A, "_meth_836A" }, + { 0x836B, "_meth_836B" }, + { 0x836C, "_meth_836C" }, + { 0x836D, "_meth_836D" }, + { 0x836E, "_meth_836E" }, + { 0x836F, "_meth_836F" }, + { 0x8370, "_meth_8370" }, + { 0x8371, "_meth_8371" }, + { 0x8372, "_meth_8372" }, + { 0x8373, "_meth_8373" }, + { 0x8374, "_meth_8374" }, + { 0x8375, "_meth_8375" }, + { 0x8376, "_meth_8376" }, + { 0x8377, "_meth_8377" }, + { 0x8378, "_meth_8378" }, + { 0x8379, "_meth_8379" }, + { 0x837A, "_meth_837A" }, + { 0x837B, "_meth_837B" }, + { 0x837C, "_meth_837C" }, + { 0x837D, "_meth_837D" }, + { 0x837E, "_meth_837E" }, + { 0x837F, "_meth_837F" }, + { 0x8380, "_meth_8380" }, + { 0x8381, "_meth_8381" }, + { 0x8382, "_meth_8382" }, + { 0x8383, "_meth_8383" }, + { 0x8384, "_meth_8384" }, + { 0x8385, "_meth_8385" }, + { 0x8386, "_meth_8386" }, + { 0x8387, "_meth_8387" }, + { 0x8388, "_meth_8388" }, + { 0x8389, "_meth_8389" }, + { 0x838A, "_meth_838A" }, + { 0x838B, "_meth_838B" }, + { 0x838C, "_meth_838C" }, + { 0x838D, "_meth_838D" }, + { 0x838E, "_meth_838E" }, + { 0x838F, "_meth_838F" }, + { 0x8390, "_meth_8390" }, + { 0x8391, "_meth_8391" }, + { 0x8392, "_meth_8392" }, + { 0x8393, "_meth_8393" }, + { 0x8394, "_meth_8394" }, + { 0x8395, "_meth_8395" }, + { 0x8396, "_meth_8396" }, + { 0x8397, "_meth_8397" }, + { 0x8398, "_meth_8398" }, + { 0x8399, "_meth_8399" }, + { 0x839A, "_meth_839A" }, + { 0x839B, "_meth_839B" }, + { 0x839C, "_meth_839C" }, + { 0x839D, "_meth_839D" }, + { 0x839E, "_meth_839E" }, + { 0x839F, "_meth_839F" }, + { 0x83A0, "_meth_83A0" }, + { 0x83A1, "_meth_83A1" }, + { 0x83A2, "_meth_83A2" }, + { 0x83A3, "_meth_83A3" }, + { 0x83A4, "_meth_83A4" }, + { 0x83A5, "_meth_83A5" }, + { 0x83A6, "_meth_83A6" }, + { 0x83A7, "_meth_83A7" }, + { 0x83A8, "_meth_83A8" }, + { 0x83A9, "_meth_83A9" }, + { 0x83AA, "_meth_83AA" }, + { 0x83AB, "_meth_83AB" }, + { 0x83AC, "_meth_83AC" }, + { 0x83AD, "_meth_83AD" }, + { 0x83AE, "_meth_83AE" }, + { 0x83AF, "_meth_83AF" }, + { 0x83B0, "_meth_83B0" }, + { 0x83B1, "_meth_83B1" }, + { 0x83B2, "_meth_83B2" }, + { 0x83B3, "_meth_83B3" }, + { 0x83B4, "_meth_83B4" }, + { 0x83B5, "_meth_83B5" }, + { 0x83B6, "_meth_83B6" }, + { 0x83B7, "_meth_83B7" }, + { 0x83B8, "_meth_83B8" }, + { 0x83B9, "_meth_83B9" }, + { 0x83BA, "_meth_83BA" }, + { 0x83BB, "_meth_83BB" }, + { 0x83BC, "_meth_83BC" }, + { 0x83BD, "_meth_83BD" }, + { 0x83BE, "_meth_83BE" }, + { 0x83BF, "_meth_83BF" }, + { 0x83C0, "_meth_83C0" }, + { 0x83C1, "_meth_83C1" }, + { 0x83C2, "_meth_83C2" }, + { 0x83C3, "_meth_83C3" }, + { 0x83C4, "_meth_83C4" }, + { 0x83C5, "_meth_83C5" }, + { 0x83C6, "_meth_83C6" }, + { 0x83C7, "_meth_83C7" }, + { 0x83C8, "_meth_83C8" }, + { 0x83C9, "_meth_83C9" }, + { 0x83CA, "_meth_83CA" }, + { 0x83CB, "_meth_83CB" }, + { 0x83CC, "_meth_83CC" }, + { 0x83CD, "lightset" }, + { 0x83CE, "lightset2" }, + { 0x83CF, "lightset3" }, + { 0x83D0, "_meth_83D0" }, + { 0x83D1, "_meth_83D1" }, + { 0x83D2, "_meth_83D2" }, + { 0x83D3, "_meth_83D3" }, + { 0x83D4, "_meth_83D4" }, + { 0x83D5, "setdoghandler" }, + { 0x83D6, "setdogcommand" }, + { 0x83D7, "setdogattackradius" }, + { 0x83D8, "isdogfollowinghandler" }, + { 0x83D9, "setdogmaxdrivespeed" }, + { 0x83DA, "isdogbeingdriven" }, + { 0x83DB, "setdogautoattackwhendriven" }, + { 0x83DC, "getdogattackbeginnode" }, + { 0x83DD, "_meth_83DD" }, + { 0x83DE, "_meth_83DE" }, + { 0x83DF, "_meth_83DF" }, + { 0x83E0, "_meth_83E0" }, + { 0x83E1, "_meth_83E1" }, + { 0x83E2, "_meth_83E2" }, + { 0x83E3, "_meth_83E3" }, + { 0x83E4, "pushplayervector" }, + { 0x83E5, "issprinting" }, + { 0x83E6, "playerlinkeduselinkedvelocity" }, + { 0x83E7, "shootstopsound" }, + { 0x83E8, "setclothtype" }, + { 0x83E9, "getclothmovesound" }, + { 0x83EA, "getequipmovesound" }, + { 0x83EB, "jumpbuttonpressed" }, + { 0x83EC, "rotateby" }, + { 0x83ED, "_meth_83ED" }, + { 0x83EE, "_meth_83EE" }, + { 0x83EF, "_meth_83EF" }, + { 0x83F0, "_meth_83F0" }, + { 0x83F1, "setsurfacetype" }, + { 0x83F2, "aiphysicstrace" }, + { 0x83F3, "aiphysicstracepassed" }, + { 0x83F4, "setdevtext" }, + { 0x83F5, "forcemovingplatformentity" }, + { 0x83F6, "setmovingplatformtrigger" }, + { 0x83F7, "visionsetstage" }, + { 0x83F8, "linkwaypointtotargetwithoffset" }, + { 0x83F9, "getlinkedparent" }, + { 0x83FA, "getmovingplatformparent" }, + { 0x83FB, "_meth_83FB" }, + { 0x83FC, "retargetscriptmodellighting" }, + { 0x83FD, "_meth_83FD" }, + { 0x83FE, "clearclienttriggeraudiozone" }, + { 0x83FF, "setclienttriggeraudiozone" }, + { 0x8400, "makevehiclenotcollidewithplayers" }, + { 0x8401, "getbobrate" }, + { 0x8402, "setbobrate" }, + { 0x8403, "setscriptablepartstate" }, + { 0x8404, "stopsliding" }, + { 0x8405, "cancelrocketcorpse" }, + { 0x8406, "setdronegoalpos" }, + { 0x8407, "hudoutlineenable" }, + { 0x8408, "hudoutlinedisable" }, + { 0x8409, "motionblurhqenable" }, + { 0x840A, "motionblurhqdisable" }, + { 0x840B, "screenshakeonentity" }, + { 0x840C, "_meth_840C" }, + { 0x840D, "_meth_840D" }, + { 0x840E, "worldpointtoscreenpos" }, + { 0x840F, "_meth_840F" }, + { 0x8410, "shouldplaymeleedeathanim" }, + { 0x8411, "_meth_8411" }, + { 0x8412, "visionsetwaterforplayer" }, + { 0x8413, "setwatersurfacetransitionfx" }, + { 0x8414, "linktoplayerviewfollowwatersurface" }, + { 0x8415, "linktoplayerviewattachwatersurfacetransitioneffects" }, + { 0x8416, "playersetwaterfog" }, + { 0x8417, "_meth_8417" }, + { 0x8418, "enableforceviewmodeldof" }, + { 0x8419, "disableforceviewmodeldof" }, + { 0x841A, "_meth_841A" }, + { 0x841B, "isenemyaware" }, + { 0x841C, "hasenemybeenseen" }, + { 0x841D, "physicssetmaxlinvel" }, + { 0x841E, "physicssetmaxangvel" }, + { 0x841F, "physicsgetlinvel" }, + { 0x8420, "physicsgetlinspeed" }, + { 0x8421, "physicsgetangvel" }, + { 0x8422, "physicsgetangspeed" }, + { 0x8423, "_meth_8423" }, + { 0x8424, "_meth_8424" }, + { 0x8425, "_meth_8425" }, + { 0x8426, "_meth_8426" }, + { 0x8427, "_meth_8427" }, + { 0x8428, "_meth_8428" }, + { 0x8429, "_meth_8429" }, + { 0x842A, "disablemissileboosting" }, + { 0x842B, "enablemissileboosting" }, + { 0x842C, "canspawntestclient" }, + { 0x842D, "spawntestclient" }, + { 0x842E, "turretsetbarrelspinenabled" }, + { 0x842F, "_meth_842F" }, + { 0x8430, "_meth_8430" }, + { 0x8431, "setclienttriggeraudiozonelerp" }, + { 0x8432, "setclienttriggeraudiozonepartial" }, + { 0x8433, "_meth_8433" }, + { 0x8434, "rotatetolinked" }, + { 0x8435, "rotatebylinked" }, + { 0x8436, "setlinkedangles" }, + { 0x8437, "_meth_8437" }, + { 0x8438, "_meth_8438" }, + { 0x8439, "_meth_8439" }, + { 0x843A, "_meth_843A" }, + { 0x843B, "_meth_843B" }, + { 0x843C, "_meth_843C" }, + { 0x843D, "_meth_843D" }, + { 0x843E, "disableautoreload" }, + { 0x843F, "enableautoreload" }, + { 0x8440, "_meth_8440" }, + { 0x8441, "_meth_8441" }, + { 0x8442, "getlinkedchildren" }, + { 0x8443, "_meth_8443" }, + { 0x8444, "_meth_8444" }, + { 0x8445, "cancelmantle" }, + { 0x8446, "_meth_8446" }, + { 0x8447, "_meth_8447" }, + { 0x8448, "setscriptabledamageowner" }, + { 0x8449, "_meth_8449" }, + { 0x844A, "_meth_844A" }, + { 0x844B, "_meth_844B" }, + { 0x844C, "_meth_844C" }, + { 0x844D, "_meth_844D" }, + { 0x844E, "_meth_844E" }, + { 0x844F, "_meth_844F" }, + { 0x8450, "_meth_8450" }, + { 0x8451, "_meth_8451" }, + { 0x8452, "_meth_8452" }, + { 0x8453, "_meth_8453" }, + { 0x8454, "_meth_8454" }, + { 0x8455, "_meth_8455" }, + { 0x8456, "_meth_8456" }, + { 0x8457, "_meth_8457" }, + { 0x8458, "_meth_8458" }, + { 0x8459, "_meth_8459" }, + { 0x845A, "_meth_845A" }, + { 0x845B, "_meth_845B" }, + { 0x845C, "_meth_845C" }, + { 0x845D, "_meth_845D" }, + { 0x845E, "_meth_845E" }, + { 0x845F, "_meth_845F" }, + { 0x8460, "_meth_8460" }, + { 0x8461, "_meth_8461" }, + { 0x8462, "_meth_8462" }, + { 0x8463, "_meth_8463" }, + { 0x8464, "_meth_8464" }, + { 0x8465, "_meth_8465" }, + { 0x8466, "_meth_8466" }, + { 0x8467, "_meth_8467" }, + { 0x8468, "_meth_8468" }, + { 0x8469, "_meth_8469" }, + { 0x846A, "_meth_846A" }, + { 0x846B, "_meth_846B" }, + { 0x846C, "_meth_846C" }, + { 0x846D, "_meth_846D" }, + { 0x846E, "_meth_846E" }, + { 0x846F, "_meth_846F" }, + { 0x8470, "_meth_8470" }, + { 0x8471, "_meth_8471" }, + { 0x8472, "_meth_8472" }, + { 0x8473, "_meth_8473" }, + { 0x8474, "_meth_8474" }, + { 0x8475, "_meth_8475" }, + { 0x8476, "_meth_8476" }, + { 0x8477, "_meth_8477" }, + { 0x8478, "_meth_8478" }, + { 0x8479, "_meth_8479" }, + { 0x847A, "_meth_847A" }, + { 0x847B, "_meth_847B" }, + { 0x847C, "_meth_847C" }, + { 0x847D, "_meth_847D" }, + { 0x847E, "_meth_847E" }, + { 0x847F, "_meth_847F" }, + { 0x8480, "_meth_8480" }, + { 0x8481, "_meth_8481" }, + { 0x8482, "_meth_8482" }, + { 0x8483, "_meth_8483" }, + { 0x8484, "_meth_8484" }, + { 0x8485, "_meth_8485" }, + { 0x8486, "_meth_8486" }, + { 0x8487, "_meth_8487" }, + { 0x8488, "_meth_8488" }, + { 0x8489, "_meth_8489" }, + { 0x848A, "_meth_848A" }, + { 0x848B, "_meth_848B" }, + { 0x848C, "_meth_848C" }, + { 0x848D, "_meth_848D" }, + { 0x848E, "_meth_848E" }, + { 0x848F, "_meth_848F" }, + { 0x8490, "_meth_8490" }, + { 0x8491, "_meth_8491" }, + { 0x8492, "_meth_8492" }, + { 0x8493, "_meth_8493" }, + { 0x8494, "_meth_8494" }, + { 0x8495, "_meth_8495" }, + { 0x8496, "_meth_8496" }, + { 0x8497, "_meth_8497" }, + { 0x8498, "_meth_8498" }, + { 0x8499, "_meth_8499" }, + { 0x849A, "_meth_849A" }, + { 0x849B, "_meth_849B" }, + { 0x849C, "_meth_849C" }, + { 0x849D, "_meth_849D" }, + { 0x849E, "_meth_849E" }, + { 0x849F, "_meth_849F" }, + { 0x84A0, "_meth_84A0" }, + { 0x84A1, "_meth_84A1" }, + { 0x84A2, "_meth_84A2" }, + { 0x84A3, "_meth_84A3" }, + { 0x84A4, "_meth_84A4" }, + { 0x84A5, "_meth_84A5" }, + { 0x84A6, "_meth_84A6" }, + { 0x84A7, "_meth_84A7" }, + { 0x84A8, "_meth_84A8" }, + { 0x84A9, "_meth_84A9" }, + { 0x84AA, "_meth_84AA" }, + { 0x84AB, "_meth_84AB" }, + { 0x84AC, "_meth_84AC" }, + { 0x84AD, "_meth_84AD" }, + { 0x84AE, "_meth_84AE" }, + { 0x84AF, "_meth_84AF" }, + { 0x84B0, "_meth_84B0" }, + { 0x84B1, "_meth_84B1" }, + { 0x84B2, "_meth_84B2" }, + { 0x84B3, "_meth_84B3" }, + { 0x84B4, "_meth_84B4" }, + { 0x84B5, "_meth_84B5" }, + { 0x84B6, "_meth_84B6" }, + { 0x84B7, "_meth_84B7" }, + { 0x84B8, "_meth_84B8" }, + { 0x84B9, "_meth_84B9" }, + { 0x84BA, "_meth_84BA" }, + { 0x84BB, "_meth_84BB" }, + { 0x84BC, "_meth_84BC" }, + { 0x84BD, "_meth_84BD" }, + { 0x84BE, "_meth_84BE" }, + { 0x84BF, "_meth_84BF" }, + { 0x84C0, "_meth_84C0" }, + { 0x84C1, "_meth_84C1" }, + { 0x84C2, "_meth_84C2" }, + { 0x84C3, "_meth_84C3" }, + { 0x84C4, "_meth_84C4" }, + { 0x84C5, "_meth_84C5" }, + { 0x84C6, "_meth_84C6" }, + { 0x84C7, "_meth_84C7" }, + { 0x84C8, "_meth_84C8" }, + { 0x84C9, "_meth_84C9" }, + { 0x84CA, "_meth_84CA" }, + { 0x84CB, "_meth_84CB" }, + { 0x84CC, "_meth_84CC" }, + { 0x84CD, "_meth_84CD" }, + { 0x84CE, "_meth_84CE" }, + { 0x84CF, "_meth_84CF" }, + { 0x84D0, "_meth_84D0" }, + { 0x84D1, "_meth_84D1" }, + { 0x84D2, "_meth_84D2" }, + { 0x84D3, "_meth_84D3" }, + { 0x84D4, "_meth_84D4" }, + { 0x84D5, "_meth_84D5" }, + { 0x84D6, "_meth_84D6" }, + { 0x84D7, "_meth_84D7" }, + { 0x84D8, "_meth_84D8" }, + { 0x84D9, "_meth_84D9" }, + { 0x84DA, "_meth_84DA" }, + { 0x84DB, "_meth_84DB" }, + { 0x84DC, "_meth_84DC" }, + { 0x84DD, "_meth_84DD" }, + { 0x84DE, "_meth_84DE" }, + { 0x84DF, "_meth_84DF" }, + { 0x84E0, "_meth_84E0" }, + { 0x84E1, "_meth_84E1" }, + { 0x84E2, "_meth_84E2" }, + { 0x84E3, "_meth_84E3" }, + { 0x84E4, "_meth_84E4" }, + { 0x84E5, "_meth_84E5" }, + { 0x84E6, "_meth_84E6" }, + { 0x84E7, "_meth_84E7" }, + { 0x84E8, "_meth_84E8" }, + { 0x84E9, "_meth_84E9" }, + { 0x84EA, "_meth_84EA" }, + { 0x84EB, "_meth_84EB" }, + { 0x84EC, "_meth_84EC" }, + { 0x84ED, "_meth_84ED" }, + { 0x84EE, "_meth_84EE" }, + { 0x84EF, "_meth_84EF" }, + { 0x84F0, "_meth_84F0" }, + { 0x84F1, "_meth_84F1" }, + { 0x84F2, "_meth_84F2" }, + { 0x84F3, "_meth_84F3" }, + { 0x84F4, "_meth_84F4" }, + { 0x84F5, "_meth_84F5" }, + { 0x84F6, "_meth_84F6" }, + { 0x84F7, "_meth_84F7" }, + { 0x84F8, "_meth_84F8" }, + { 0x84F9, "_meth_84F9" }, + { 0x84FA, "_meth_84FA" }, + { 0x84FB, "_meth_84FB" }, + { 0x84FC, "_meth_84FC" }, + { 0x84FD, "_meth_84FD" }, + { 0x84FE, "_meth_84FE" }, + { 0x84FF, "hidepartvm" }, + { 0x8500, "openluimenu" }, + { 0x8501, "_meth_8501" }, + { 0x8502, "_meth_8502" }, + { 0x8503, "_meth_8503" }, + { 0x8504, "_meth_8504" }, + { 0x8505, "_meth_8505" }, + { 0x8506, "_meth_8506" }, + { 0x8507, "_meth_8507" }, + { 0x8508, "_meth_8508" }, + { 0x8509, "_meth_8509" }, + { 0x850A, "_meth_850A" }, + { 0x850B, "_meth_850B" }, + { 0x850C, "_meth_850C" }, + { 0x850D, "_meth_850D" }, + { 0x850E, "_meth_850E" }, + { 0x850F, "_meth_850F" }, + { 0x8510, "_meth_8510" }, + { 0x8511, "_meth_8511" }, + { 0x8512, "_meth_8512" }, + { 0x8513, "_meth_8513" }, + { 0x8514, "_meth_8514" }, + { 0x8515, "_meth_8515" }, + { 0x8516, "_meth_8516" }, + { 0x8517, "_meth_8517" }, + { 0x8518, "_meth_8518" }, + { 0x8519, "_meth_8519" }, + { 0x851A, "_meth_851A" }, + { 0x851B, "_meth_851B" }, + { 0x851C, "_meth_851C" }, + { 0x851D, "_meth_851D" }, + { 0x851E, "_meth_851E" }, + { 0x851F, "_meth_851F" }, + { 0x8520, "_meth_8520" }, + { 0x8521, "_meth_8521" }, + { 0x8522, "_meth_8522" }, + { 0x8523, "_meth_8523" }, + { 0x8524, "_meth_8524" }, + { 0x8525, "_meth_8525" }, + { 0x8526, "_meth_8526" }, + { 0x8527, "_meth_8527" }, + { 0x8528, "_meth_8528" }, + { 0x8529, "_meth_8529" }, + { 0x852A, "_meth_852A" }, + { 0x852B, "_meth_852B" }, + { 0x852C, "_meth_852C" }, + { 0x852D, "_meth_852D" }, + { 0x852E, "_meth_852E" }, + { 0x852F, "_meth_852F" }, + { 0x8530, "_meth_8530" }, + { 0x8531, "_meth_8531" }, + { 0x8532, "_meth_8532" }, + { 0x8533, "_meth_8533" }, + { 0x8534, "_meth_8534" }, + { 0x8535, "_meth_8535" }, + { 0x8536, "_meth_8536" }, + { 0x8537, "_meth_8537" }, + { 0x8538, "_meth_8538" }, + { 0x8539, "_meth_8539" }, + { 0x853A, "_meth_853A" }, + { 0x853B, "_meth_853B" }, + { 0x853C, "_meth_853C" }, + { 0x853D, "_meth_853D" }, + { 0x853E, "_meth_853E" }, + { 0x853F, "_meth_853F" }, + { 0x8540, "_meth_8540" }, + { 0x8541, "_meth_8541" }, + { 0x8542, "_meth_8542" }, + { 0x8543, "_meth_8543" }, + { 0x8544, "_meth_8544" }, + { 0x8545, "_meth_8545" }, + { 0x8546, "_meth_8546" }, + { 0x8547, "_meth_8547" }, + { 0x8548, "_meth_8548" }, + { 0x8549, "_meth_8549" }, + { 0x854A, "_meth_854A" }, + { 0x854B, "_meth_854B" }, + { 0x854C, "_meth_854C" }, + { 0x854D, "_meth_854D" }, + { 0x854E, "_meth_854E" }, + { 0x854F, "_meth_854F" }, + { 0x8550, "_meth_8550" }, + { 0x8551, "_meth_8551" }, + { 0x8552, "_meth_8552" }, + { 0x8553, "_meth_8553" }, + { 0x8554, "_meth_8554" }, + { 0x8555, "_meth_8555" }, + { 0x8556, "_meth_8556" }, + { 0x8557, "_meth_8557" }, + { 0x8558, "_meth_8558" }, + { 0x8559, "_meth_8559" }, + { 0x855A, "_meth_855A" }, + { 0x855B, "_meth_855B" }, + { 0x855C, "_meth_855C" }, + { 0x855D, "_meth_855D" }, + { 0x855E, "_meth_855E" }, + { 0x855F, "_meth_855F" }, + { 0x8560, "_meth_8560" }, + { 0x8561, "_meth_8561" }, + { 0x8562, "_meth_8562" }, + { 0x8563, "_meth_8563" }, + { 0x8564, "_meth_8564" }, + { 0x8565, "_meth_8565" }, + { 0x8566, "_meth_8566" }, + { 0x8567, "_meth_8567" }, + { 0x8568, "_meth_8568" }, + { 0x8569, "_meth_8569" }, + { 0x856A, "_meth_856A" }, + { 0x856B, "_meth_856B" }, + { 0x856C, "_meth_856C" }, + { 0x856D, "_meth_856D" }, + { 0x856E, "_meth_856E" }, + { 0x856F, "_meth_856F" }, + { 0x8570, "_meth_8570" }, + { 0x8571, "_meth_8571" }, + { 0x8572, "_meth_8572" }, + { 0x8573, "_meth_8573" }, + { 0x8574, "_meth_8574" }, + { 0x8575, "_meth_8575" }, + { 0x8576, "_meth_8576" }, + { 0x8577, "_meth_8577" }, + { 0x8578, "_meth_8578" }, + { 0x8579, "_meth_8579" }, + { 0x857A, "_meth_857A" }, + { 0x857B, "_meth_857B" }, + { 0x857C, "_meth_857C" }, + { 0x857D, "_meth_857D" }, + { 0x857E, "_meth_857E" }, + { 0x857F, "_meth_857F" }, + { 0x8580, "_meth_8580" }, + { 0x8581, "_meth_8581" }, + { 0x8582, "_meth_8582" }, + { 0x8583, "_meth_8583" }, + { 0x8584, "_meth_8584" }, + { 0x8585, "_meth_8585" }, + { 0x8586, "_meth_8586" }, + { 0x8587, "_meth_8587" }, + { 0x8588, "_meth_8588" }, + { 0x8589, "_meth_8589" }, + { 0x858A, "_meth_858A" }, + { 0x858B, "_meth_858B" }, + { 0x858C, "_meth_858C" }, + { 0x858D, "_meth_858D" }, + { 0x858E, "_meth_858E" }, + { 0x858F, "_meth_858F" }, + { 0x8590, "_meth_8590" }, + { 0x8591, "_meth_8591" }, + { 0x8592, "_meth_8592" }, + { 0x8593, "_meth_8593" }, + { 0x8594, "_meth_8594" }, + { 0x8595, "_meth_8595" }, + { 0x8596, "_meth_8596" }, + { 0x8597, "_meth_8597" }, + { 0x8598, "_meth_8598" }, + { 0x8599, "_meth_8599" }, + { 0x859A, "_meth_859A" }, + { 0x859B, "_meth_859B" }, + { 0x859C, "_meth_859C" }, + { 0x859D, "_meth_859D" }, + { 0x859E, "_meth_859E" }, + { 0x859F, "_meth_859F" }, + { 0x85A0, "_meth_85A0" }, + { 0x85A1, "_meth_85A1" }, + { 0x85A2, "_meth_85A2" }, + { 0x85A3, "_meth_85A3" }, + { 0x85A4, "_meth_85A4" }, + { 0x85A5, "_meth_85A5" }, + { 0x85A6, "_meth_85A6" }, + { 0x85A7, "_meth_85A7" }, + { 0x85A8, "_meth_85A8" }, + { 0x85A9, "_meth_85A9" }, + { 0x85AA, "_meth_85AA" }, + { 0x85AB, "_meth_85AB" }, + { 0x85AC, "_meth_85AC" }, + { 0x85AD, "_meth_85AD" }, + { 0x85AE, "_meth_85AE" }, + { 0x85AF, "_meth_85AF" }, + { 0x85B0, "_meth_85B0" }, + { 0x85B1, "_meth_85B1" }, + { 0x85B2, "_meth_85B2" }, + { 0x85B3, "_meth_85B3" }, + { 0x85B4, "_meth_85B4" }, + { 0x85B5, "_meth_85B5" }, + { 0x85B6, "_meth_85B6" }, + { 0x85B7, "_meth_85B7" }, + { 0x85B8, "_meth_85B8" }, + { 0x85B9, "_meth_85B9" }, + { 0x85BA, "_meth_85BA" }, + { 0x85BB, "_meth_85BB" }, + { 0x85BC, "_meth_85BC" }, + { 0x85BD, "_meth_85BD" }, + { 0x85BE, "_meth_85BE" }, + { 0x85BF, "_meth_85BF" }, + { 0x85C0, "_meth_85C0" }, + { 0x85C1, "_meth_85C1" }, + { 0x85C2, "_meth_85C2" }, + { 0x85C3, "_meth_85C3" }, + { 0x85C4, "_meth_85C4" }, + { 0x85C5, "_meth_85C5" }, + { 0x85C6, "_meth_85C6" }, + { 0x85C7, "_meth_85C7" }, + { 0x85C8, "_meth_85C8" }, + { 0x85C9, "_meth_85C9" }, + { 0x85CA, "_meth_85CA" }, + { 0x85CB, "_meth_85CB" }, + { 0x85CC, "_meth_85CC" }, + { 0x85CD, "_meth_85CD" }, + { 0x85CE, "_meth_85CE" }, + { 0x85CF, "_meth_85CF" }, + { 0x85D0, "_meth_85D0" }, + { 0x85D1, "_meth_85D1" }, + { 0x85D2, "_meth_85D2" }, +}}; + +} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/resolver.cpp b/src/h2/h2_token.cpp similarity index 95% rename from src/h2/xsk/resolver.cpp rename to src/h2/h2_token.cpp index 7ca5b404..b81665d9 100644 --- a/src/h2/xsk/resolver.cpp +++ b/src/h2/h2_token.cpp @@ -1,2758 +1,14 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" #include "h2.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - namespace xsk::gsc::h2 { -std::unordered_map opcode_map; -std::unordered_map function_map; -std::unordered_map method_map; -std::unordered_map token_map; -std::unordered_map opcode_map_rev; -std::unordered_map function_map_rev; -std::unordered_map method_map_rev; -std::unordered_map token_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_func_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - const auto itr = function_map.find(id); - - if (itr != function_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_meth_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - const auto itr = method_map.find(id); - - if (itr != method_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_id_")) - { - return static_cast(std::stoul(name.substr(4), nullptr, 16)); - } - - const auto itr = token_map_rev.find(name); - - if (itr != token_map_rev.end()) - { - return itr->second; - } - - return 0; -} - -auto resolver::token_name(std::uint16_t id) -> std::string -{ - const auto itr = token_map.find(id); - - if (itr != token_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - } - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - } - - return false; -} - -void resolver::add_function(const std::string& name, std::uint16_t id) -{ - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - throw error(utils::string::va("builtin function '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - function_map.insert({ id, *str }); - function_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - function_map.insert({ id, *ins.first }); - function_map_rev.insert({ *ins.first, id }); - } - } -} - -void resolver::add_method(const std::string& name, std::uint16_t id) -{ - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - throw error(utils::string::va("builtin method '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - method_map.insert({ id, *str }); - method_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - method_map.insert({ id, *ins.first }); - method_map_rev.insert({ *ins.first, 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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -const std::array, 154> opcode_list -{{ - { 0x17, "OP_SetNewLocalVariableFieldCached0" }, - { 0x18, "OP_EvalSelfFieldVariable" }, - { 0x19, "OP_Return" }, - { 0x1A, "OP_CallBuiltin0" }, - { 0x1B, "OP_CallBuiltin1" }, - { 0x1C, "OP_CallBuiltin2" }, - { 0x1D, "OP_CallBuiltin3" }, - { 0x1E, "OP_CallBuiltin4" }, - { 0x1F, "OP_CallBuiltin5" }, - { 0x20, "OP_CallBuiltin" }, - { 0x21, "OP_BoolNot" }, - { 0x22, "OP_ScriptFarMethodThreadCall" }, - { 0x23, "OP_JumpOnTrueExpr" }, - { 0x24, "OP_SetLevelFieldVariableField" }, - { 0x25, "OP_CastBool" }, - { 0x26, "OP_EvalNewLocalArrayRefCached0" }, - { 0x27, "OP_CallBuiltinPointer" }, - { 0x28, "OP_inequality" }, - { 0x29, "OP_GetThisthread" }, - { 0x2A, "OP_ClearFieldVariable" }, - { 0x2B, "OP_GetFloat" }, - { 0x2C, "OP_SafeCreateVariableFieldCached" }, - { 0x2D, "OP_ScriptFarFunctionCall2" }, - { 0x2E, "OP_ScriptFarFunctionCall" }, - { 0x2F, "OP_ScriptFarChildThreadCall" }, - { 0x30, "OP_ClearLocalVariableFieldCached0" }, - { 0x31, "OP_ClearLocalVariableFieldCached" }, - { 0x32, "OP_checkclearparams" }, - { 0x33, "OP_CastFieldObject" }, - { 0x34, "OP_End" }, - { 0x35, "OP_size" }, - { 0x36, "OP_EmptyArray" }, - { 0x37, "OP_bit_and" }, - { 0x38, "OP_less_equal" }, - { 0x39, "OP_voidCodepos" }, - { 0x3A, "OP_ScriptMethodThreadCallPointer" }, - { 0x3B, "OP_endswitch" }, - { 0x3C, "OP_ClearVariableField" }, - { 0x3D, "OP_divide" }, - { 0x3E, "OP_ScriptFarMethodChildThreadCall" }, - { 0x3F, "OP_GetUnsignedShort" }, - { 0x40, "OP_JumpOnTrue" }, - { 0x41, "OP_GetSelf" }, - { 0x42, "OP_ScriptFarThreadCall" }, - { 0x43, "OP_ScriptLocalThreadCall" }, - { 0x44, "OP_SetLocalVariableFieldCached0" }, - { 0x45, "OP_SetLocalVariableFieldCached" }, - { 0x46, "OP_plus" }, - { 0x47, "OP_BoolComplement" }, - { 0x48, "OP_ScriptMethodCallPointer" }, - { 0x49, "OP_inc" }, - { 0x4A, "OP_RemoveLocalVariables" }, - { 0x4B, "OP_JumpOnFalseExpr" }, - { 0x4C, "OP_switch" }, - { 0x4D, "OP_clearparams" }, - { 0x4E, "OP_EvalLocalVariableRefCached0" }, - { 0x4F, "OP_EvalLocalVariableRefCached" }, - { 0x50, "OP_ScriptLocalMethodCall" }, - { 0x51, "OP_EvalFieldVariable" }, - { 0x52, "OP_EvalFieldVariableRef" }, - { 0x53, "OP_GetString" }, - { 0x54, "OP_ScriptFunctionCallPointer" }, - { 0x55, "OP_EvalLevelFieldVariable" }, - { 0x56, "OP_GetVector" }, - { 0x57, "OP_endon" }, - { 0x58, "OP_greater_equal" }, - { 0x59, "OP_GetSelfObject" }, - { 0x5A, "OP_SetAnimFieldVariableField" }, - { 0x5B, "OP_SetVariableField" }, - { 0x5C, "OP_ScriptLocalFunctionCall2" }, - { 0x5D, "OP_ScriptLocalFunctionCall" }, - { 0x5E, "OP_EvalLocalArrayRefCached0" }, - { 0x5F, "OP_EvalLocalArrayRefCached" }, - { 0x60, "OP_GetFarFunction" }, - { 0x61, "OP_less" }, - { 0x62, "OP_GetGameRef" }, - { 0x63, "OP_waittillFrameEnd" }, - { 0x64, "OP_waitFrame" }, - { 0x65, "OP_SafeSetVariableFieldCached0" }, - { 0x66, "OP_SafeSetVariableFieldCached" }, - { 0x67, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x68, "OP_GetLevel" }, - { 0x69, "OP_notify" }, - { 0x6A, "OP_DecTop" }, - { 0x6B, "OP_shift_left" }, - { 0x6C, "OP_ScriptLocalMethodThreadCall" }, - { 0x6D, "OP_ScriptLocalMethodChildThreadCall" }, - { 0x6E, "OP_greater" }, - { 0x6F, "OP_EvalLocalVariableCached0" }, - { 0x70, "OP_EvalLocalVariableCached1" }, - { 0x71, "OP_EvalLocalVariableCached2" }, - { 0x72, "OP_EvalLocalVariableCached3" }, - { 0x73, "OP_EvalLocalVariableCached4" }, - { 0x74, "OP_EvalLocalVariableCached5" }, - { 0x75, "OP_EvalLocalVariableCached" }, - { 0x76, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x77, "OP_jump" }, - { 0x78, "OP_ScriptThreadCallPointer" }, - { 0x79, "OP_GetZero" }, - { 0x7A, "OP_wait" }, - { 0x7B, "OP_minus" }, - { 0x7C, "OP_SetSelfFieldVariableField" }, - { 0x7D, "OP_EvalNewLocalVariableRefCached0" }, - { 0x7E, "OP_multiply" }, - { 0x7F, "OP_CreateLocalVariable" }, - { 0x80, "OP_ScriptLocalChildThreadCall" }, - { 0x81, "OP_GetInteger" }, - { 0x82, "OP_mod" }, - { 0x83, "OP_EvalAnimFieldVariableRef" }, - { 0x84, "OP_GetBuiltinFunction" }, - { 0x85, "OP_GetGame" }, - { 0x86, "OP_waittill" }, - { 0x87, "OP_dec" }, - { 0x88, "OP_EvalLocalVariableObjectCached" }, - { 0x89, "OP_PreScriptCall" }, - { 0x8A, "OP_GetAnim" }, - { 0x8B, "OP_GetUndefined" }, - { 0x8C, "OP_EvalLevelFieldVariableRef" }, - { 0x8D, "OP_GetAnimObject" }, - { 0x8E, "OP_GetLevelObject" }, - { 0x8F, "OP_bit_ex_or" }, - { 0x90, "OP_equality" }, - { 0x91, "OP_ClearArray" }, - { 0x92, "OP_jumpback" }, - { 0x93, "OP_GetAnimation" }, - { 0x94, "OP_EvalAnimFieldVariable" }, - { 0x95, "OP_GetAnimTree" }, - { 0x96, "OP_GetIString" }, - { 0x97, "OP_EvalArrayRef" }, - { 0x98, "OP_EvalSelfFieldVariableRef" }, - { 0x99, "OP_GetNegByte" }, - { 0x9A, "OP_GetBuiltinMethod" }, - { 0x9B, "OP_CallBuiltinMethodPointer" }, - { 0x9C, "OP_EvalArray" }, - { 0x9D, "OP_vector" }, - { 0x9E, "OP_ScriptFarMethodCall" }, - { 0x9F, "OP_EvalLocalArrayCached" }, - { 0xA0, "OP_GetByte" }, - { 0xA1, "OP_ScriptChildThreadCallPointer" }, - { 0xA2, "OP_bit_or" }, - { 0xA3, "OP_AddArray" }, - { 0xA4, "OP_waittillmatch2" }, - { 0xA5, "OP_waittillmatch" }, - { 0xA6, "OP_GetLocalFunction" }, - { 0xA7, "OP_GetNegUnsignedShort" }, - { 0xA8, "OP_shift_right" }, - { 0xA9, "OP_CallBuiltinMethod0" }, - { 0xAA, "OP_CallBuiltinMethod1" }, - { 0xAB, "OP_CallBuiltinMethod2" }, - { 0xAC, "OP_CallBuiltinMethod3" }, - { 0xAD, "OP_CallBuiltinMethod4" }, - { 0xAE, "OP_CallBuiltinMethod5" }, - { 0xAF, "OP_CallBuiltinMethod" }, - { 0xB0, "OP_JumpOnFalse" }, -}}; - -const std::array, 800> function_list -{{ - { 0x001, "precacheturret" }, - { 0x002, "getweaponarray" }, - { 0x003, "createprintchannel" }, - { 0x004, "updategamerprofileall" }, - { 0x005, "clearlocalizedstrings" }, - { 0x006, "setphysicsgravitydir" }, - { 0x007, "gettimescale" }, - { 0x008, "settimescale" }, - { 0x009, "setslowmotionview" }, - { 0x00A, "teleportscene" }, - { 0x00B, "forcesharedammo" }, - { 0x00C, "refreshhudcompass" }, - { 0x00D, "refreshhudammocounter" }, - { 0x00E, "notifyoncommand" }, - { 0x00F, "setprintchannel" }, - { 0x010, "_func_10" }, - { 0x011, "_func_11" }, - { 0x012, "_func_12" }, - { 0x013, "_func_13" }, - { 0x014, "print" }, - { 0x015, "println" }, - { 0x016, "print3d" }, - { 0x017, "line" }, - { 0x018, "spawnturret" }, - { 0x019, "canspawnturret" }, - { 0x01A, "assert" }, - { 0x01B, "pausecinematicingame" }, - { 0x01C, "drawcompassfriendlies" }, - { 0x01D, "bulletspread" }, - { 0x01E, "bullettracer" }, - { 0x01F, "badplace_delete" }, - { 0x020, "badplace_cylinder" }, - { 0x021, "badplace_arc" }, - { 0x022, "badplace_brush" }, - { 0x023, "clearallcorpses" }, - { 0x024, "setturretnode" }, - { 0x025, "unsetturretnode" }, - { 0x026, "setnodepriority" }, - { 0x027, "isnodeoccupied" }, - { 0x028, "_func_028" }, - { 0x029, "_func_029" }, - { 0x02A, "setdebugorigin" }, - { 0x02B, "setdebugangles" }, - { 0x02C, "updategamerprofile" }, - { 0x02D, "assertex" }, - { 0x02E, "assertmsg" }, - { 0x02F, "isdefined" }, - { 0x030, "isvalidmissile" }, - { 0x031, "isstring" }, - { 0x032, "setomnvar" }, - { 0x033, "getomnvar" }, - { 0x034, "setdvar" }, - { 0x035, "_func_035" }, - { 0x036, "setdynamicdvar" }, - { 0x037, "setdvarifuninitialized" }, - { 0x038, "setdevdvar" }, - { 0x039, "getdvar" }, - { 0x03A, "getdvarint" }, - { 0x03B, "getdvarfloat" }, - { 0x03C, "getdvarvector" }, - { 0x03D, "gettime" }, - { 0x03E, "gettimeutc" }, - { 0x03F, "getculldist" }, - { 0x040, "getentbynum" }, - { 0x041, "getscreenwidth" }, - { 0x042, "getscreenheight" }, - { 0x043, "getweaponmodel" }, - { 0x044, "_func_44" }, - { 0x045, "_func_45" }, - { 0x046, "_func_46" }, - { 0x047, "_func_47" }, - { 0x048, "_func_48" }, - { 0x049, "setsunlight" }, - { 0x04A, "resetsunlight" }, - { 0x04B, "getmapsundirection" }, - { 0x04C, "getmapsunangles" }, - { 0x04D, "setsundirection" }, - { 0x04E, "lerpsundirection" }, - { 0x04F, "lerpsunangles" }, - { 0x050, "resetsundirection" }, - { 0x051, "enableforcedsunshadows" }, - { 0x052, "enableforcednosunshadows" }, - { 0x053, "disableforcedsunshadows" }, - { 0x054, "enableouterspacemodellighting" }, - { 0x055, "disableouterspacemodellighting" }, - { 0x056, "remapstage" }, - { 0x057, "changelevel" }, - { 0x058, "missionsuccess" }, - { 0x059, "missionfailed" }, - { 0x05A, "cinematic" }, - { 0x05B, "cinematicingame" }, - { 0x05C, "cinematicingamesync" }, - { 0x05D, "cinematicingameloop" }, - { 0x05E, "cinematicingameloopresident" }, - { 0x05F, "iscinematicplaying" }, - { 0x060, "stopcinematicingame" }, - { 0x061, "getweapondisplayname" }, - { 0x062, "getweaponbasename" }, - { 0x063, "getweaponattachments" }, - { 0x064, "getweaponattachmentdisplaynames" }, - { 0x065, "getweaponcamoname" }, - { 0x066, "getweaponreticlename" }, - { 0x067, "getanimlength" }, - { 0x068, "animhasnotetrack" }, - { 0x069, "getnotetracktimes" }, - { 0x06A, "spawn" }, - { 0x06B, "spawnloopsound" }, - { 0x06C, "spawnloopingsound" }, - { 0x06D, "bullettrace" }, - { 0x06E, "target_setmaxsize" }, - { 0x06F, "target_setcolor" }, - { 0x070, "target_setdelay" }, - { 0x071, "getstartorigin" }, - { 0x072, "getstartangles" }, - { 0x073, "getcycleoriginoffset" }, - { 0x074, "magicgrenade" }, - { 0x075, "magicgrenademanual" }, - { 0x076, "setblur" }, - { 0x077, "musicplay" }, - { 0x078, "musicstop" }, - { 0x079, "soundfade" }, - { 0x07A, "addsubmix" }, - { 0x07B, "clearsubmix" }, - { 0x07C, "clearallsubmixes" }, - { 0x07D, "blendsubmix" }, - { 0x07E, "makestickysubmix" }, - { 0x07F, "makeunstickysubmix" }, - { 0x080, "soundtime" }, - { 0x081, "soundtimereset" }, - { 0x082, "levelsoundfade" }, - { 0x083, "precachenightvisioncodeassets" }, - { 0x084, "_func_084" }, - { 0x085, "precachedigitaldistortcodeassets" }, - { 0x086, "precacheminimapsentrycodeassets" }, - { 0x087, "savegame" }, - { 0x088, "issavesuccessful" }, - { 0x089, "issaverecentlyloaded" }, - { 0x08A, "savegamenocommit" }, - { 0x08B, "commitsave" }, - { 0x08C, "commitwouldbevalid" }, - { 0x08D, "getfxvisibility" }, - { 0x08E, "setculldist" }, - { 0x08F, "bullettracepassed" }, - { 0x090, "sighttracepassed" }, - { 0x091, "physicstrace" }, - { 0x092, "playerphysicstrace" }, - { 0x093, "getgroundposition" }, - { 0x094, "getangledelta" }, - { 0x095, "getmovedelta" }, - { 0x096, "getnorthyaw" }, - { 0x097, "getcommandfromkey" }, - { 0x098, "getsticksconfig" }, - { 0x099, "_func_99" }, - { 0x09A, "_func_9A" }, - { 0x09B, "_func_9B" }, - { 0x09C, "weaponfightdist" }, - { 0x09D, "weaponmaxdist" }, - { 0x09E, "isturretactive" }, - { 0x09F, "getstarttime" }, - { 0x0A0, "target_alloc" }, - { 0x0A1, "target_flush" }, - { 0x0A2, "target_set" }, - { 0x0A3, "target_remove" }, - { 0x0A4, "target_setshader" }, - { 0x0A5, "target_setoffscreenshader" }, - { 0x0A6, "target_isinrect" }, - { 0x0A7, "target_isincircle" }, - { 0x0A8, "target_startreticlelockon" }, - { 0x0A9, "target_clearreticlelockon" }, - { 0x0AA, "target_getarray" }, - { 0x0AB, "target_istarget" }, - { 0x0AC, "target_setattackmode" }, - { 0x0AD, "target_setjavelinonly" }, - { 0x0AE, "target_hidefromplayer" }, - { 0x0AF, "target_showtoplayer" }, - { 0x0B0, "target_setscaledrendermode" }, - { 0x0B1, "target_drawcornersonly" }, - { 0x0B2, "target_drawsquare" }, - { 0x0B3, "target_drawsingle" }, - { 0x0B4, "target_setminsize" }, - { 0x0B5, "setnorthyaw" }, - { 0x0B6, "setslowmotion" }, - { 0x0B7, "randomint" }, - { 0x0B8, "randomfloat" }, - { 0x0B9, "randomintrange" }, - { 0x0BA, "randomfloatrange" }, - { 0x0BB, "sin" }, - { 0x0BC, "cos" }, - { 0x0BD, "tan" }, - { 0x0BE, "asin" }, - { 0x0BF, "acos" }, - { 0x0C0, "atan" }, - { 0x0C1, "int" }, - { 0x0C2, "float" }, - { 0x0C3, "abs" }, - { 0x0C4, "min" }, - { 0x0C5, "objective_additionalcurrent" }, - { 0x0C6, "objective_ring" }, - { 0x0C7, "objective_setpointertextoverride" }, - { 0x0C8, "getnode" }, - { 0x0C9, "getnodearray" }, - { 0x0CA, "getallnodes" }, - { 0x0CB, "getnodesinradius" }, - { 0x0CC, "getnodesinradiussorted" }, - { 0x0CD, "getclosestnodeinsight" }, - { 0x0CE, "getreflectionlocs" }, - { 0x0CF, "getreflectionreferencelocs" }, - { 0x0D0, "getvehicletracksegment" }, - { 0x0D1, "getvehicletracksegmentarray" }, - { 0x0D2, "getallvehicletracksegments" }, - { 0x0D3, "isarray" }, - { 0x0D4, "isai" }, - { 0x0D5, "getindexforluincstring" }, - { 0x0D6, "issentient" }, - { 0x0D7, "isgodmode" }, - { 0x0D8, "getdebugdvar" }, - { 0x0D9, "getdebugdvarint" }, - { 0x0DA, "getdebugdvarfloat" }, - { 0x0DB, "setsaveddvar" }, - { 0x0DC, "getfreeaicount" }, - { 0x0DD, "getaicount" }, - { 0x0DE, "getaiarray" }, - { 0x0DF, "getaispeciesarray" }, - { 0x0E0, "getspawnerarray" }, - { 0x0E1, "getcorpsearray" }, - { 0x0E2, "getspawnerteamarray" }, - { 0x0E3, "getweaponclipmodel" }, - { 0x0E4, "getbrushmodelcenter" }, - { 0x0E5, "getkeybinding" }, - { 0x0E6, "max" }, - { 0x0E7, "floor" }, - { 0x0E8, "ceil" }, - { 0x0E9, "round" }, - { 0x0EA, "exp" }, - { 0x0EB, "log" }, - { 0x0EC, "sqrt" }, - { 0x0ED, "squared" }, - { 0x0EE, "clamp" }, - { 0x0EF, "angleclamp" }, - { 0x0F0, "angleclamp180" }, - { 0x0F1, "vectorfromlinetopoint" }, - { 0x0F2, "pointonsegmentnearesttopoint" }, - { 0x0F3, "distance" }, - { 0x0F4, "distance2d" }, - { 0x0F5, "distancesquared" }, - { 0x0F6, "length" }, - { 0x0F7, "length2d" }, - { 0x0F8, "lengthsquared" }, - { 0x0F9, "length2dsquared" }, - { 0x0FA, "closer" }, - { 0x0FB, "vectordot" }, - { 0x0FC, "vectorcross" }, - { 0x0FD, "axistoangles" }, - { 0x0FE, "visionsetthermal" }, - { 0x0FF, "visionsetpain" }, - { 0x100, "_func_100" }, - { 0x101, "_func_101" }, - { 0x102, "_func_102" }, - { 0x103, "_func_103" }, - { 0x104, "incrementcounter" }, - { 0x105, "getcountertotal" }, - { 0x106, "getlevelticks" }, - { 0x107, "perlinnoise2d" }, - { 0x108, "calcrockingangles" }, - { 0x109, "reconevent" }, - { 0x10A, "reconspatialevent" }, - { 0x10B, "setsunflareposition" }, - { 0x10C, "createthreatbiasgroup" }, - { 0x10D, "threatbiasgroupexists" }, - { 0x10E, "getthreatbias" }, - { 0x10F, "setthreatbias" }, - { 0x110, "setthreatbiasagainstall" }, - { 0x111, "setignoremegroup" }, - { 0x112, "isenemyteam" }, - { 0x113, "objective_additionalentity" }, - { 0x114, "objective_state_nomessage" }, - { 0x115, "objective_string" }, - { 0x116, "objective_string_nomessage" }, - { 0x117, "objective_additionalposition" }, - { 0x118, "objective_current_nomessage" }, - { 0x119, "vectornormalize" }, - { 0x11A, "vectortoangles" }, - { 0x11B, "vectortoyaw" }, - { 0x11C, "vectorlerp" }, - { 0x11D, "anglestoup" }, - { 0x11E, "anglestoright" }, - { 0x11F, "anglestoforward" }, - { 0x120, "anglesdelta" }, - { 0x121, "combineangles" }, - { 0x122, "transformmove" }, - { 0x123, "rotatevector" }, - { 0x124, "rotatepointaroundvector" }, - { 0x125, "issubstr" }, - { 0x126, "isendstr" }, - { 0x127, "getsubstr" }, - { 0x128, "tolower" }, - { 0x129, "strtok" }, - { 0x12A, "stricmp" }, - { 0x12B, "ambientplay" }, - { 0x12C, "_func_12C" }, - { 0x12D, "_func_12D" }, - { 0x12E, "_func_12E" }, - { 0x12F, "_func_12F" }, - { 0x130, "_func_130" }, - { 0x131, "_func_131" }, - { 0x132, "_func_132" }, - { 0x133, "_func_133" }, - { 0x134, "_func_134" }, - { 0x135, "_func_135" }, - { 0x136, "_func_136" }, - { 0x137, "_func_137" }, - { 0x138, "_func_138" }, - { 0x139, "_func_139" }, - { 0x13A, "_func_13A" }, - { 0x13B, "_func_13B" }, - { 0x13C, "_func_13C" }, - { 0x13D, "_func_13D" }, - { 0x13E, "_func_13E" }, - { 0x13F, "_func_13F" }, - { 0x140, "_func_140" }, - { 0x141, "_func_141" }, - { 0x142, "_func_142" }, - { 0x143, "_func_143" }, - { 0x144, "_func_144" }, - { 0x145, "_func_145" }, - { 0x146, "_func_146" }, - { 0x147, "_func_147" }, - { 0x148, "visionsetnaked" }, - { 0x149, "visionsetnight" }, - { 0x14A, "visionsetmissilecam" }, - { 0x14B, "ambientstop" }, - { 0x14C, "precachemodel" }, - { 0x14D, "precacheshellshock" }, - { 0x14E, "precacheitem" }, - { 0x14F, "precacheshader" }, - { 0x150, "precachestring" }, - { 0x151, "precachemenu" }, - { 0x152, "precacherumble" }, - { 0x153, "precachelocationselector" }, - { 0x154, "precacheleaderboards" }, - { 0x155, "loadfx" }, - { 0x156, "playfx" }, - { 0x157, "playfxontag" }, - { 0x158, "stopfxontag" }, - { 0x159, "killfxontag" }, - { 0x15A, "playloopedfx" }, - { 0x15B, "spawnfx" }, - { 0x15C, "triggerfx" }, - { 0x15D, "playfxontagforclients" }, - { 0x15E, "_func_15E" }, - { 0x15F, "_func_15F" }, - { 0x160, "_func_160" }, - { 0x161, "_func_161" }, - { 0x162, "_func_162" }, - { 0x163, "_func_163" }, - { 0x164, "_func_164" }, - { 0x165, "_func_165" }, - { 0x166, "_func_166" }, - { 0x167, "_func_167" }, - { 0x168, "_func_168" }, - { 0x169, "_func_169" }, - { 0x16A, "_func_16A" }, - { 0x16B, "_func_16B" }, - { 0x16C, "_func_16C" }, - { 0x16D, "_func_16D" }, - { 0x16E, "_func_16E" }, - { 0x16F, "_func_16F" }, - { 0x170, "precacheheadicon" }, - { 0x171, "_func_171" }, - { 0x172, "_func_172" }, - { 0x173, "_func_173" }, - { 0x174, "_func_174" }, - { 0x175, "_func_175" }, - { 0x176, "_func_176" }, - { 0x177, "_func_177" }, - { 0x178, "_func_178" }, - { 0x179, "_func_179" }, - { 0x17A, "_func_17A" }, - { 0x17B, "_func_17B" }, - { 0x17C, "_func_17C" }, - { 0x17D, "_func_17D" }, - { 0x17E, "_func_17E" }, - { 0x17F, "_func_17F" }, - { 0x180, "_func_180" }, - { 0x181, "_func_181" }, - { 0x182, "_func_182" }, - { 0x183, "_func_183" }, - { 0x184, "physicsexplosionsphere" }, - { 0x185, "physicsexplosioncylinder" }, - { 0x186, "physicsjolt" }, - { 0x187, "physicsjitter" }, - { 0x188, "setexpfog" }, - { 0x189, "setexpfogext" }, - { 0x18A, "setexpfogdvarsonly" }, - { 0x18B, "setexpfogextdvarsonly" }, - { 0x18C, "setatmosfog" }, - { 0x18D, "setatmosfogdvarsonly" }, - { 0x18E, "isexplosivedamagemod" }, - { 0x18F, "radiusdamage" }, - { 0x190, "setplayerignoreradiusdamage" }, - { 0x191, "glassradiusdamage" }, - { 0x192, "earthquake" }, - { 0x193, "getnumparts" }, - { 0x194, "objective_onentity" }, - { 0x195, "_func_195" }, - { 0x196, "_func_196" }, - { 0x197, "_func_197" }, - { 0x198, "_func_198" }, - { 0x199, "_func_199" }, - { 0x19A, "_func_19A" }, - { 0x19B, "_func_19B" }, - { 0x19C, "_func_19C" }, - { 0x19D, "_func_19D" }, - { 0x19E, "iprintln" }, - { 0x19F, "iprintlnbold" }, - { 0x1A0, "logstring" }, - { 0x1A1, "getent" }, - { 0x1A2, "getentarray" }, - { 0x1A3, "_func_1A3" }, - { 0x1A4, "_func_1A4" }, - { 0x1A5, "spawnstruct" }, - { 0x1A6, "_func_1A6" }, - { 0x1A7, "isalive" }, - { 0x1A8, "isspawner" }, - { 0x1A9, "missile_createattractorent" }, - { 0x1AA, "missile_createattractororigin" }, - { 0x1AB, "missile_createrepulsorent" }, - { 0x1AC, "missile_createrepulsororigin" }, - { 0x1AD, "missile_deleteattractor" }, - { 0x1AE, "_func_1AE" }, - { 0x1AF, "newhudelem" }, - { 0x1B0, "newclienthudelem" }, - { 0x1B1, "_func_1B1" }, - { 0x1B2, "resettimeout" }, - { 0x1B3, "isplayer" }, - { 0x1B4, "_func_1B4" }, - { 0x1B5, "getpartname" }, - { 0x1B6, "weaponfiretime" }, - { 0x1B7, "weaponclipsize" }, - { 0x1B8, "weaponisauto" }, - { 0x1B9, "weaponissemiauto" }, - { 0x1BA, "weaponisboltaction" }, - { 0x1BB, "weaponinheritsperks" }, - { 0x1BC, "weaponburstcount" }, - { 0x1BD, "weapontype" }, - { 0x1BE, "weaponclass" }, - { 0x1BF, "getnextarraykey" }, - { 0x1C0, "sortbydistance" }, - { 0x1C1, "tablelookup" }, - { 0x1C2, "tablelookupbyrow" }, - { 0x1C3, "tablelookupistring" }, - { 0x1C4, "tablelookupistringbyrow" }, - { 0x1C5, "tablelookuprownum" }, - { 0x1C6, "tableexists" }, - { 0x1C7, "getmissileowner" }, - { 0x1C8, "magicbullet" }, - { 0x1C9, "getweaponflashtagname" }, - { 0x1CA, "averagepoint" }, - { 0x1CB, "averagenormal" }, - { 0x1CC, "vehicle_getspawnerarray" }, - { 0x1CD, "playrumbleonposition" }, - { 0x1CE, "playrumblelooponposition" }, - { 0x1CF, "stopallrumbles" }, - { 0x1D0, "soundexists" }, - { 0x1D1, "openfile" }, - { 0x1D2, "closefile" }, - { 0x1D3, "fprintln" }, - { 0x1D4, "fprintfields" }, - { 0x1D5, "freadln" }, - { 0x1D6, "fgetarg" }, - { 0x1D7, "setminimap" }, - { 0x1D8, "setthermalbodymaterial" }, - { 0x1D9, "getarraykeys" }, - { 0x1DA, "getfirstarraykey" }, - { 0x1DB, "getglass" }, - { 0x1DC, "getglassarray" }, - { 0x1DD, "getglassorigin" }, - { 0x1DE, "isglassdestroyed" }, - { 0x1DF, "destroyglass" }, - { 0x1E0, "deleteglass" }, - { 0x1E1, "getentchannelscount" }, - { 0x1E2, "getentchannelname" }, - { 0x1E3, "objective_add" }, - { 0x1E4, "objective_delete" }, - { 0x1E5, "objective_state" }, - { 0x1E6, "objective_icon" }, - { 0x1E7, "_func_1E7" }, - { 0x1E8, "objective_position" }, - { 0x1E9, "objective_current" }, - { 0x1EA, "weaponinventorytype" }, - { 0x1EB, "weaponstartammo" }, - { 0x1EC, "weaponmaxammo" }, - { 0x1ED, "weaponaltweaponname" }, - { 0x1EE, "isweaponcliponly" }, - { 0x1EF, "isweapondetonationtimed" }, - { 0x1F0, "weaponhasthermalscope" }, - { 0x1F1, "weaponhasexplosivedamage" }, - { 0x1F2, "getvehiclenode" }, - { 0x1F3, "getvehiclenodearray" }, - { 0x1F4, "getallvehiclenodes" }, - { 0x1F5, "getnumvehicles" }, - { 0x1F6, "precachevehicle" }, - { 0x1F7, "spawnvehicle" }, - { 0x1F8, "vehicle_getarray" }, - { 0x1F9, "pow" }, - { 0x1FA, "_func_1FA" }, - { 0x1FB, "_func_1FB" }, - { 0x1FC, "_func_1FC" }, - { 0x1FD, "_func_1FD" }, - { 0x1FE, "_func_1FE" }, - { 0x1FF, "_func_1FF" }, - { 0x200, "_func_200" }, - { 0x201, "_func_201" }, - { 0x202, "_func_202" }, - { 0x203, "_func_203" }, - { 0x204, "_func_204" }, - { 0x205, "_func_205" }, - { 0x206, "_func_206" }, - { 0x207, "_func_207" }, - { 0x208, "_func_208" }, - { 0x209, "_func_209" }, - { 0x20A, "_func_20A" }, - { 0x20B, "_func_20B" }, - { 0x20C, "_func_20C" }, - { 0x20D, "_func_20D" }, - { 0x20E, "_func_20E" }, - { 0x20F, "_func_20F" }, - { 0x210, "_func_210" }, - { 0x211, "_func_211" }, - { 0x212, "_func_212" }, - { 0x213, "_func_213" }, - { 0x214, "_func_214" }, - { 0x215, "_func_215" }, - { 0x216, "_func_216" }, - { 0x217, "_func_217" }, - { 0x218, "_func_218" }, - { 0x219, "_func_219" }, - { 0x21A, "_func_21A" }, - { 0x21B, "_func_21B" }, - { 0x21C, "_func_21C" }, - { 0x21D, "getlinkednodes" }, - { 0x21E, "disconnectnodepair" }, - { 0x21F, "connectnodepair" }, - { 0x220, "_func_220" }, - { 0x221, "_func_221" }, - { 0x222, "_func_222" }, - { 0x223, "_func_223" }, - { 0x224, "_func_224" }, - { 0x225, "loadtransient" }, - { 0x226, "unloadtransient" }, - { 0x227, "unloadalltransients" }, - { 0x228, "synctransients" }, - { 0x229, "istransientqueued" }, - { 0x22A, "istransientloaded" }, - { 0x22B, "loadstartpointtransient" }, - { 0x22C, "_func_22C" }, - { 0x22D, "distance2dsquared" }, - { 0x22E, "getangledelta3d" }, - { 0x22F, "_func_22F" }, - { 0x230, "trajectorycalculateinitialvelocity" }, - { 0x231, "trajectorycalculateminimumvelocity" }, - { 0x232, "trajectorycalculateexitangle" }, - { 0x233, "trajectorycomputedeltaheightattime" }, - { 0x234, "trajectorycanattemptaccuratejump" }, - { 0x235, "_func_235" }, - { 0x236, "_func_236" }, - { 0x237, "ispointinvolume" }, - { 0x238, "cinematicgettimeinmsec" }, - { 0x239, "cinematicgetframe" }, - { 0x23A, "iscinematicloaded" }, - { 0x23B, "_func_23B" }, - { 0x23C, "bbprint" }, - { 0x23D, "_func_23D" }, - { 0x23E, "getscriptablearray" }, - { 0x23F, "clearfog" }, - { 0x240, "setleveldopplerpreset" }, - { 0x241, "screenshake" }, - { 0x242, "_func_242" }, - { 0x243, "_func_243" }, - { 0x244, "_func_244" }, - { 0x245, "_func_245" }, - { 0x246, "_func_246" }, - { 0x247, "_func_247" }, - { 0x248, "_func_248" }, - { 0x249, "_func_249" }, - { 0x24A, "_func_24A" }, - { 0x24B, "_func_24B" }, - { 0x24C, "_func_24C" }, - { 0x24D, "luinotifyevent" }, - { 0x24E, "_func_24E" }, - { 0x24F, "_func_24F" }, - { 0x250, "_func_250" }, - { 0x251, "_func_251" }, - { 0x252, "physwakeup" }, - { 0x253, "ragdollwakeup" }, - { 0x254, "_func_254" }, - { 0x255, "_func_255" }, - { 0x256, "anglestoaxis" }, - { 0x257, "visionsetwater" }, - { 0x258, "sendscriptusageanalysisdata" }, - { 0x259, "resetscriptusageanalysisdata" }, - { 0x25A, "instantlylogusageanalysisdata" }, - { 0x25B, "invertangles" }, - { 0x25C, "rotatevectorinverted" }, - { 0x25D, "_func_25D" }, - { 0x25E, "_func_25E" }, - { 0x25F, "_func_25F" }, - { 0x260, "_func_260" }, - { 0x261, "_func_261" }, - { 0x262, "getcsplinecount" }, - { 0x263, "getcsplinepointcount" }, - { 0x264, "getcsplinelength" }, - { 0x265, "getcsplinepointid" }, - { 0x266, "getcsplinepointlabel" }, - { 0x267, "getcsplinepointtension" }, - { 0x268, "getcsplinepointposition" }, - { 0x269, "getcsplinepointcorridordims" }, - { 0x26A, "getcsplinepointtangent" }, - { 0x26B, "getcsplinepointdisttonextpoint" }, - { 0x26C, "calccsplinetangent" }, - { 0x26D, "calccsplinecorridor" }, - { 0x26E, "calccsplinecorridor" }, - { 0x26F, "setnojipscore" }, - { 0x270, "setnojiptime" }, - { 0x271, "_func_271" }, - { 0x272, "getpredictedentityposition" }, - { 0x273, "gamedvrprohibitrecording" }, - { 0x274, "gamedvrstartrecording" }, - { 0x275, "gamedvrstoprecording" }, - { 0x276, "gamedvrsetvideometadata" }, - { 0x277, "gamedvrprohibitscreenshots" }, - { 0x278, "_func_278" }, - { 0x279, "gamedvrsetscreenshotmetadata" }, - { 0x27A, "queuedialog" }, - { 0x27B, "speechenablegrammar" }, - { 0x27C, "speechenable" }, - { 0x27D, "livestreamingenable" }, - { 0x27E, "livestreamingsetbitrate" }, - { 0x27F, "_func_27F" }, - { 0x280, "_func_280" }, - { 0x281, "_func_281" }, - { 0x282, "_func_282" }, - { 0x283, "_func_283" }, - { 0x284, "triggerportableradarping" }, - { 0x285, "setglaregrimematerial" }, - { 0x286, "botgetteamlimit" }, - { 0x287, "spawnfxforclient" }, - { 0x288, "botgetteamdifficulty" }, - { 0x289, "getsquadassaultelo" }, - { 0x28A, "loadluifile" }, - { 0x28B, "_func_28B" }, - { 0x28C, "_func_28C" }, - { 0x28D, "_func_28D" }, - { 0x28E, "_func_28E" }, - { 0x28F, "_func_28F" }, - { 0x290, "_func_290" }, - { 0x291, "_func_291" }, - { 0x292, "_func_292" }, - { 0x293, "_func_293" }, - { 0x294, "_func_294" }, - { 0x295, "_func_295" }, - { 0x296, "_func_296" }, - { 0x297, "_func_297" }, - { 0x298, "_func_298" }, - { 0x299, "_func_299" }, - { 0x29A, "enablecontext" }, - { 0x29B, "disablecontext" }, - { 0x29C, "_func_29C" }, - { 0x29D, "_func_29D" }, - { 0x29E, "_func_29E" }, - { 0x29F, "_func_29F" }, - { 0x2A0, "_func_2A0" }, - { 0x2A1, "_func_2A1" }, - { 0x2A2, "_func_2A2" }, - { 0x2A3, "_func_2A3" }, - { 0x2A4, "_func_2A4" }, - { 0x2A5, "_func_2A5" }, - { 0x2A6, "_func_2A6" }, - { 0x2A7, "_func_2A7" }, - { 0x2A8, "_func_2A8" }, - { 0x2A9, "_func_2A9" }, - { 0x2AA, "_func_2AA" }, - { 0x2AB, "_func_2AB" }, - { 0x2AC, "_func_2AC" }, - { 0x2AD, "_func_2AD" }, - { 0x2AE, "_func_2AE" }, - { 0x2AF, "_func_2AF" }, - { 0x2B0, "_func_2B0" }, - { 0x2B1, "_func_2B1" }, - { 0x2B2, "_func_2B2" }, - { 0x2B3, "_func_2B3" }, - { 0x2B4, "_func_2B4" }, - { 0x2B5, "_func_2B5" }, - { 0x2B6, "_func_2B6" }, - { 0x2B7, "_func_2B7" }, - { 0x2B8, "_func_2B8" }, - { 0x2B9, "_func_2B9" }, - { 0x2BA, "_func_2BA" }, - { 0x2BB, "_func_2BB" }, - { 0x2BC, "_func_2BC" }, - { 0x2BD, "_func_2BD" }, - { 0x2BE, "_func_2BE" }, - { 0x2BF, "_func_2BF" }, - { 0x2C0, "challengemessage" }, - { 0x2C1, "_func_2C1" }, - { 0x2C2, "_func_2C2" }, - { 0x2C3, "_func_2C3" }, - { 0x2C4, "_func_2C4" }, - { 0x2C5, "_func_2C5" }, - { 0x2C6, "_func_2C6" }, - { 0x2C7, "_func_2C7" }, - { 0x2C8, "_func_2C8" }, - { 0x2C9, "_func_2C9" }, - { 0x2CA, "_func_2CA" }, - { 0x2CB, "_func_2CB" }, - { 0x2CC, "_func_2CC" }, - { 0x2CD, "_func_2CD" }, - { 0x2CE, "_func_2CE" }, - { 0x2CF, "_func_2CF" }, - { 0x2D0, "_func_2D0" }, - { 0x2D1, "_func_2D1" }, - { 0x2D2, "_func_2D2" }, - { 0x2D3, "_func_2D3" }, - { 0x2D4, "_func_2D4" }, - { 0x2D5, "_func_2D5" }, - { 0x2D6, "_func_2D6" }, - { 0x2D7, "_func_2D7" }, - { 0x2D8, "_func_2D8" }, - { 0x2D9, "_func_2D9" }, - { 0x2DA, "_func_2DA" }, - { 0x2DB, "_func_2DB" }, - { 0x2DC, "_func_2DC" }, - { 0x2DD, "_func_2DD" }, - { 0x2DE, "_func_2DE" }, - { 0x2DF, "_func_2DF" }, - { 0x2E0, "_func_2E0" }, - { 0x2E1, "_func_2E1" }, - { 0x2E2, "_func_2E2" }, - { 0x2E3, "_func_2E3" }, - { 0x2E4, "_func_2E4" }, - { 0x2E5, "_func_2E5" }, - { 0x2E6, "_func_2E6" }, - { 0x2E7, "_func_2E7" }, - { 0x2E8, "_func_2E8" }, - { 0x2E9, "_func_2E9" }, - { 0x2EA, "_func_2EA" }, - { 0x2EB, "_func_2EB" }, - { 0x2EC, "_func_2EC" }, - { 0x2ED, "_func_2ED" }, - { 0x2EE, "_func_2EE" }, - { 0x2EF, "_func_2EF" }, - { 0x2F0, "_func_2F0" }, - { 0x2F1, "_func_2F1" }, - { 0x2F2, "_func_2F2" }, - { 0x2F3, "_func_2F3" }, - { 0x2F4, "_func_2F4" }, - { 0x2F5, "_func_2F5" }, - { 0x2F6, "_func_2F6" }, - { 0x2F7, "_func_2F7" }, - { 0x2F8, "_func_2F8" }, - { 0x2F9, "_func_2F9" }, - { 0x2FA, "_func_2FA" }, - { 0x2FB, "_func_2FB" }, - { 0x2FC, "_func_2FC" }, - { 0x2FD, "_func_2FD" }, - { 0x2FE, "_func_2FE" }, - { 0x2FF, "_func_2FF" }, - { 0x300, "_func_300" }, - { 0x301, "_func_301" }, - { 0x302, "_func_302" }, - { 0x303, "_func_303" }, - { 0x304, "_func_304" }, - { 0x305, "_func_305" }, - { 0x306, "_func_306" }, - { 0x307, "_func_307" }, - { 0x308, "_func_308" }, - { 0x309, "_func_309" }, - { 0x30A, "_func_30A" }, - { 0x30B, "_func_30B" }, - { 0x30C, "_func_30C" }, - { 0x30D, "_func_30D" }, - { 0x30E, "_func_30E" }, - { 0x30F, "_func_30F" }, - { 0x310, "_func_310" }, - { 0x311, "_func_311" }, - { 0x312, "_func_312" }, - { 0x313, "_func_313" }, - { 0x314, "_func_314" }, - { 0x315, "_func_315" }, - { 0x316, "fast_restart" }, - { 0x317, "_func_317" }, - { 0x318, "_func_318" }, - { 0x319, "_func_319" }, - { 0x31A, "enablepg" }, - { 0x31B, "_func_31B" }, - { 0x31C, "_func_31C" }, - { 0x31D, "_func_31D" }, - { 0x31E, "_func_31E" }, - { 0x31F, "_func_31F" }, - { 0x320, "_func_320" }, -}}; - -const std::array, 1491> method_list -{{ - { 0x8000, "thermaldrawdisable" }, - { 0x8001, "playerforcedeathanim" }, - { 0x8002, "_meth_8002" }, - { 0x8003, "_meth_8003" }, - { 0x8004, "_meth_8004" }, - { 0x8005, "_meth_8005" }, - { 0x8006, "_meth_8006" }, - { 0x8007, "_meth_8007" }, - { 0x8008, "_meth_8008" }, - { 0x8009, "_meth_8009" }, - { 0x800A, "_meth_800A" }, - { 0x800B, "_meth_800B" }, - { 0x800C, "_meth_800C" }, - { 0x800D, "_meth_800D" }, - { 0x800E, "_meth_800E" }, - { 0x800F, "_meth_800F" }, - { 0x8010, "_meth_8010" }, - { 0x8011, "_meth_8011" }, - { 0x8012, "_meth_8012" }, - { 0x8013, "_meth_8013" }, - { 0x8014, "_meth_8014" }, - { 0x8015, "_meth_8015" }, - { 0x8016, "_meth_8016" }, - { 0x8017, "_meth_8017" }, - { 0x8018, "_meth_8018" }, - { 0x8019, "_meth_8019" }, - { 0x801A, "isonladder" }, - { 0x801B, "_meth_801B" }, - { 0x801C, "_meth_801C" }, - { 0x801D, "attach" }, - { 0x801E, "getlightfovinner" }, - { 0x801F, "getlightfovouter" }, - { 0x8020, "setlightfovrange" }, - { 0x8021, "getlightexponent" }, - { 0x8022, "setlightexponent" }, - { 0x8023, "startragdoll" }, - { 0x8024, "startragdollfromimpact" }, - { 0x8025, "_meth_8025" }, - { 0x8026, "_meth_8026" }, - { 0x8027, "_meth_8027" }, - { 0x8028, "_meth_8028" }, - { 0x8029, "thermaldrawenable" }, - { 0x802A, "detach" }, - { 0x802B, "detachall" }, - { 0x802C, "getattachsize" }, - { 0x802D, "getattachmodelname" }, - { 0x802E, "getattachtagname" }, - { 0x802F, "setturretcanaidetach" }, - { 0x8030, "setturretfov" }, - { 0x8031, "setturretfov2" }, - { 0x8032, "lerpfov" }, - { 0x8033, "lerpfovscale" }, - { 0x8034, "getvalidcoverpeekouts" }, - { 0x8035, "gethighestnodestance" }, - { 0x8036, "doesnodeallowstance" }, - { 0x8037, "_meth_8037" }, - { 0x8038, "getgunangles" }, - { 0x8039, "magicgrenade" }, - { 0x803A, "magicgrenademanual" }, - { 0x803B, "getentnum" }, - { 0x803C, "launch" }, - { 0x803D, "setsoundblend" }, - { 0x803E, "makefakeai" }, - { 0x803F, "spawndrone" }, - { 0x8040, "setcorpseremovetimer" }, - { 0x8041, "setlookattext" }, - { 0x8042, "setspawnerteam" }, - { 0x8043, "addaieventlistener" }, - { 0x8044, "removeaieventlistener" }, - { 0x8045, "getlightcolor" }, - { 0x8046, "setlightcolor" }, - { 0x8047, "_meth_8047" }, - { 0x8048, "_meth_8048" }, - { 0x8049, "_meth_8049" }, - { 0x804A, "_meth_804A" }, - { 0x804B, "getlightradius" }, - { 0x804C, "setlightradius" }, - { 0x804D, "getattachignorecollision" }, - { 0x804E, "hidepart" }, - { 0x804F, "hidepartallinstances" }, - { 0x8050, "hideallparts" }, - { 0x8051, "showpart" }, - { 0x8052, "showallparts" }, - { 0x8053, "linkto" }, - { 0x8054, "linktoblendtotag" }, - { 0x8055, "unlink" }, - { 0x8056, "setnormalhealth" }, - { 0x8057, "dodamage" }, - { 0x8058, "kill" }, - { 0x8059, "show" }, - { 0x805A, "hide" }, - { 0x805B, "_meth_805B" }, - { 0x805C, "laserforceon" }, - { 0x805D, "laserforceoff" }, - { 0x805E, "disconnectpaths" }, - { 0x805F, "connectpaths" }, - { 0x8060, "disconnectnode" }, - { 0x8061, "connectnode" }, - { 0x8062, "startusingheroonlylighting" }, - { 0x8063, "stopusingheroonlylighting" }, - { 0x8064, "startusinglessfrequentlighting" }, - { 0x8065, "stopusinglessfrequentlighting" }, - { 0x8066, "setmovingplatformplayerturnrate" }, - { 0x8067, "setthermalfog" }, - { 0x8068, "setnightvisionfog" }, - { 0x8069, "clearthermalfog" }, - { 0x806A, "clearnightvisionfog" }, - { 0x806B, "_meth_806B" }, - { 0x806C, "setmode" }, - { 0x806D, "getmode" }, - { 0x806E, "setturretignoregoals" }, - { 0x806F, "islinked" }, - { 0x8070, "enablelinkto" }, - { 0x8071, "playsoundatviewheight" }, - { 0x8072, "_meth_8072" }, - { 0x8073, "prefetchsound" }, - { 0x8074, "setpitch" }, - { 0x8075, "scalepitch" }, - { 0x8076, "setvolume" }, - { 0x8077, "scalevolume" }, - { 0x8078, "setspeakermapmonotostereo" }, - { 0x8079, "setspeakermapmonoto51" }, - { 0x807A, "setdistributed2dsound" }, - { 0x807B, "playsoundasmaster" }, - { 0x807C, "playloopsound" }, - { 0x807D, "eqon" }, - { 0x807E, "eqoff" }, - { 0x807F, "haseq" }, - { 0x8080, "iswaitingonsound" }, - { 0x8081, "foley" }, - { 0x8082, "getnormalhealth" }, - { 0x8083, "playerlinkto" }, - { 0x8084, "playerlinktodelta" }, - { 0x8085, "playerlinkweaponviewtodelta" }, - { 0x8086, "playerlinktoabsolute" }, - { 0x8087, "playerlinktoblend" }, - { 0x8088, "playerlinkedoffsetenable" }, - { 0x8089, "setwaypointedgestyle_secondaryarrow" }, - { 0x808A, "setwaypointiconoffscreenonly" }, - { 0x808B, "fadeovertime" }, - { 0x808C, "scaleovertime" }, - { 0x808D, "moveovertime" }, - { 0x808E, "reset" }, - { 0x808F, "destroy" }, - { 0x8090, "setpulsefx" }, - { 0x8091, "setplayernamestring" }, - { 0x8092, "changefontscaleovertime" }, - { 0x8093, "startignoringspotlight" }, - { 0x8094, "stopignoringspotlight" }, - { 0x8095, "dontcastshadows" }, - { 0x8096, "castshadows" }, - { 0x8097, "setstablemissile" }, - { 0x8098, "playersetgroundreferenceent" }, - { 0x8099, "dontinterpolate" }, - { 0x809A, "dospawn" }, - { 0x809B, "stalingradspawn" }, - { 0x809C, "getorigin" }, - { 0x809D, "getcentroid" }, - { 0x809E, "getshootatpos" }, - { 0x809F, "getdebugeye" }, - { 0x80A0, "useby" }, - { 0x80A1, "playsound" }, - { 0x80A2, "_meth_80A2" }, - { 0x80A3, "_meth_80A3" }, - { 0x80A4, "_meth_80A4" }, - { 0x80A5, "_meth_80A5" }, - { 0x80A6, "playerlinkedoffsetdisable" }, - { 0x80A7, "playerlinkedsetviewznear" }, - { 0x80A8, "playerlinkedsetusebaseangleforviewclamp" }, - { 0x80A9, "lerpviewangleclamp" }, - { 0x80AA, "setviewangleresistance" }, - { 0x80AB, "springcamenabled" }, - { 0x80AC, "springcamdisabled" }, - { 0x80AD, "linktoplayerview" }, - { 0x80AE, "unlinkfromplayerview" }, - { 0x80AF, "geteye" }, - { 0x80B0, "istouching" }, - { 0x80B1, "stoploopsound" }, - { 0x80B2, "stopsounds" }, - { 0x80B3, "playrumbleonentity" }, - { 0x80B4, "playrumblelooponentity" }, - { 0x80B5, "_meth_80B5" }, - { 0x80B6, "_meth_80B6" }, - { 0x80B7, "delete" }, - { 0x80B8, "setmodel" }, - { 0x80B9, "laseron" }, - { 0x80BA, "laseroff" }, - { 0x80BB, "_meth_80BB" }, - { 0x80BC, "_meth_80BC" }, - { 0x80BD, "laseraltviewon" }, - { 0x80BE, "laseraltviewoff" }, - { 0x80BF, "thermalvisionon" }, - { 0x80C0, "thermalvisiononshadowoff" }, - { 0x80C1, "_meth_80C1" }, - { 0x80C2, "_meth_80C2" }, - { 0x80C3, "_meth_80C3" }, - { 0x80C4, "_meth_80C4" }, - { 0x80C5, "setcontents" }, - { 0x80C6, "makeusable" }, - { 0x80C7, "makeunusable" }, - { 0x80C8, "_meth_80C8" }, - { 0x80C9, "_meth_80C9" }, - { 0x80CA, "setwhizbyprobabilities" }, - { 0x80CB, "visionsetnakedforplayer_lerp" }, - { 0x80CC, "setwaitnode" }, - { 0x80CD, "returnplayercontrol" }, - { 0x80CE, "vehphys_starttrack" }, - { 0x80CF, "vehphys_clearautodisable" }, - { 0x80D0, "vehicleusealtblendedaudio" }, - { 0x80D1, "settext" }, - { 0x80D2, "clearalltextafterhudelem" }, - { 0x80D3, "setshader" }, - { 0x80D4, "settargetent" }, - { 0x80D5, "cleartargetent" }, - { 0x80D6, "settimer" }, - { 0x80D7, "settimerup" }, - { 0x80D8, "settimerstatic" }, - { 0x80D9, "settenthstimer" }, - { 0x80DA, "settenthstimerup" }, - { 0x80DB, "settenthstimerstatic" }, - { 0x80DC, "setclock" }, - { 0x80DD, "setclockup" }, - { 0x80DE, "setvalue" }, - { 0x80DF, "setwaypoint" }, - { 0x80E0, "setwaypointedgestyle_rotatingicon" }, - { 0x80E1, "setcursorhint" }, - { 0x80E2, "sethintstring" }, - { 0x80E3, "_meth_80E3" }, - { 0x80E4, "forceusehinton" }, - { 0x80E5, "forceusehintoff" }, - { 0x80E6, "makesoft" }, - { 0x80E7, "makehard" }, - { 0x80E8, "willneverchange" }, - { 0x80E9, "startfiring" }, - { 0x80EA, "stopfiring" }, - { 0x80EB, "isfiringturret" }, - { 0x80EC, "startbarrelspin" }, - { 0x80ED, "stopbarrelspin" }, - { 0x80EE, "getbarrelspinrate" }, - { 0x80EF, "_meth_80EF" }, - { 0x80F0, "_meth_80F0" }, - { 0x80F1, "shootturret" }, - { 0x80F2, "getturretowner" }, - { 0x80F3, "enabledeathshield" }, - { 0x80F4, "nightvisiongogglesforceon" }, - { 0x80F5, "nightvisiongogglesforceoff" }, - { 0x80F6, "enableinvulnerability" }, - { 0x80F7, "disableinvulnerability" }, - { 0x80F8, "forceviewmodelanimation" }, - { 0x80F9, "_meth_80F9" }, - { 0x80FA, "_meth_80FA" }, - { 0x80FB, "disableturretdismount" }, - { 0x80FC, "enableturretdismount" }, - { 0x80FD, "uploadscore" }, - { 0x80FE, "uploadtime" }, - { 0x80FF, "uploadleaderboards" }, - { 0x8100, "giveachievement" }, - { 0x8101, "hidehud" }, - { 0x8102, "showhud" }, - { 0x8103, "mountvehicle" }, - { 0x8104, "dismountvehicle" }, - { 0x8105, "enableslowaim" }, - { 0x8106, "disableslowaim" }, - { 0x8107, "_meth_8107" }, - { 0x8108, "_meth_8108" }, - { 0x8109, "_meth_8109" }, - { 0x810A, "vehicleattackbuttonpressed" }, - { 0x810B, "setwhizbyoffset" }, - { 0x810C, "setsentryowner" }, - { 0x810D, "setsentrycarrier" }, - { 0x810E, "setturretminimapvisible" }, - { 0x810F, "settargetentity" }, - { 0x8110, "snaptotargetentity" }, - { 0x8111, "cleartargetentity" }, - { 0x8112, "getturrettarget" }, - { 0x8113, "setplayerspread" }, - { 0x8114, "setaispread" }, - { 0x8115, "setsuppressiontime" }, - { 0x8116, "setflaggedanimknobrestart" }, - { 0x8117, "setflaggedanimknoblimitedrestart" }, - { 0x8118, "setflaggedanimknoball" }, - { 0x8119, "setflaggedanimknoballrestart" }, - { 0x811A, "setflaggedanim" }, - { 0x811B, "setflaggedanimlimited" }, - { 0x811C, "setflaggedanimrestart" }, - { 0x811D, "setflaggedanimlimitedrestart" }, - { 0x811E, "useanimtree" }, - { 0x811F, "stopuseanimtree" }, - { 0x8120, "setanimtime" }, - { 0x8121, "allowstand" }, - { 0x8122, "allowcrouch" }, - { 0x8123, "allowprone" }, - { 0x8124, "allowlean" }, - { 0x8125, "allowswim" }, - { 0x8126, "setocclusion" }, - { 0x8127, "_meth_8127" }, - { 0x8128, "deactivateocclusion" }, - { 0x8129, "deactivateallocclusion" }, - { 0x812A, "isocclusionenabled" }, - { 0x812B, "_meth_812B" }, - { 0x812C, "_meth_812C" }, - { 0x812D, "_meth_812D" }, - { 0x812E, "_meth_812E" }, - { 0x812F, "iseqenabled" }, - { 0x8130, "seteq" }, - { 0x8131, "seteqbands" }, - { 0x8132, "deactivateeq" }, - { 0x8133, "seteqlerp" }, - { 0x8134, "islookingat" }, - { 0x8135, "isthrowinggrenade" }, - { 0x8136, "isfiring" }, - { 0x8137, "ismeleeing" }, - { 0x8138, "setautopickup" }, - { 0x8139, "allowmelee" }, - { 0x813A, "allowfire" }, - { 0x813B, "enablehealthshield" }, - { 0x813C, "setconvergencetime" }, - { 0x813D, "setconvergenceheightpercent" }, - { 0x813E, "setturretteam" }, - { 0x813F, "maketurretsolid" }, - { 0x8140, "_meth_8140" }, - { 0x8141, "maketurretoperable" }, - { 0x8142, "maketurretinoperable" }, - { 0x8143, "makeentitysentient" }, - { 0x8144, "freeentitysentient" }, - { 0x8145, "isindoor" }, - { 0x8146, "getdroptofloorposition" }, - { 0x8147, "isbadguy" }, - { 0x8148, "animscripted" }, - { 0x8149, "_meth_8149" }, - { 0x814A, "animrelative" }, - { 0x814B, "stopanimscripted" }, - { 0x814C, "clearanim" }, - { 0x814D, "setanimknob" }, - { 0x814E, "setanimknoblimited" }, - { 0x814F, "setanimknobrestart" }, - { 0x8150, "setanimknoblimitedrestart" }, - { 0x8151, "setanimknoball" }, - { 0x8152, "setanimknoballlimited" }, - { 0x8153, "setanimknoballrestart" }, - { 0x8154, "setanimknoballlimitedrestart" }, - { 0x8155, "setanim" }, - { 0x8156, "setanimlimited" }, - { 0x8157, "setanimrestart" }, - { 0x8158, "setanimlimitedrestart" }, - { 0x8159, "getanimtime" }, - { 0x815A, "getanimweight" }, - { 0x815B, "getanimassettype" }, - { 0x815C, "setflaggedanimknob" }, - { 0x815D, "setflaggedanimknoblimited" }, - { 0x815E, "setturretaccuracy" }, - { 0x815F, "setrightarc" }, - { 0x8160, "setleftarc" }, - { 0x8161, "settoparc" }, - { 0x8162, "setbottomarc" }, - { 0x8163, "setautorotationdelay" }, - { 0x8164, "setdefaultdroppitch" }, - { 0x8165, "restoredefaultdroppitch" }, - { 0x8166, "turretfiredisable" }, - { 0x8167, "getfixednodesafevolume" }, - { 0x8168, "clearfixednodesafevolume" }, - { 0x8169, "isingoal" }, - { 0x816A, "setruntopos" }, - { 0x816B, "nearnode" }, - { 0x816C, "nearclaimnode" }, - { 0x816D, "nearclaimnodeandangle" }, - { 0x816E, "atdangerousnode" }, - { 0x816F, "_meth_816F" }, - { 0x8170, "_meth_8170" }, - { 0x8171, "getenemyinfo" }, - { 0x8172, "clearenemy" }, - { 0x8173, "setentitytarget" }, - { 0x8174, "clearentitytarget" }, - { 0x8175, "setpotentialthreat" }, - { 0x8176, "clearpotentialthreat" }, - { 0x8177, "setflashbanged" }, - { 0x8178, "setengagementmindist" }, - { 0x8179, "setengagementmaxdist" }, - { 0x817A, "isknownenemyinradius" }, - { 0x817B, "isknownenemyinvolume" }, - { 0x817C, "settalktospecies" }, - { 0x817D, "invisiblenotsolid" }, - { 0x817E, "visiblesolid" }, - { 0x817F, "setdefaultaimlimits" }, - { 0x8180, "initriotshieldhealth" }, - { 0x8181, "getenemysqdist" }, - { 0x8182, "getclosestenemysqdist" }, - { 0x8183, "setthreatbiasgroup" }, - { 0x8184, "getthreatbiasgroup" }, - { 0x8185, "turretfireenable" }, - { 0x8186, "setturretmodechangewait" }, - { 0x8187, "usetriggerrequirelookat" }, - { 0x8188, "getstance" }, - { 0x8189, "setstance" }, - { 0x818A, "itemweaponsetammo" }, - { 0x818B, "getammocount" }, - { 0x818C, "gettagorigin" }, - { 0x818D, "gettagangles" }, - { 0x818E, "shellshock" }, - { 0x818F, "stunplayer" }, - { 0x8190, "stopshellshock" }, - { 0x8191, "fadeoutshellshock" }, - { 0x8192, "setdepthoffield" }, - { 0x8193, "setviewmodeldepthoffield" }, - { 0x8194, "setmotionblurmovescale" }, - { 0x8195, "pickupgrenade" }, - { 0x8196, "useturret" }, - { 0x8197, "stopuseturret" }, - { 0x8198, "canuseturret" }, - { 0x8199, "traversemode" }, - { 0x819A, "animmode" }, - { 0x819B, "orientmode" }, - { 0x819C, "getmotionangle" }, - { 0x819D, "shouldfacemotion" }, - { 0x819E, "getanglestolikelyenemypath" }, - { 0x819F, "setturretanim" }, - { 0x81A0, "getturret" }, - { 0x81A1, "getgroundenttype" }, - { 0x81A2, "_meth_81A2" }, - { 0x81A3, "_meth_81A3" }, - { 0x81A4, "_meth_81A4" }, - { 0x81A5, "_meth_81A5" }, - { 0x81A6, "animcustom" }, - { 0x81A7, "isinscriptedstate" }, - { 0x81A8, "canattackenemynode" }, - { 0x81A9, "getnegotiationstartnode" }, - { 0x81AA, "getnegotiationendnode" }, - { 0x81AB, "getnegotiationnextnode" }, - { 0x81AC, "getdoorpathnode" }, - { 0x81AD, "comparenodedirtopathdir" }, - { 0x81AE, "checkprone" }, - { 0x81AF, "pushplayer" }, - { 0x81B0, "checkgrenadethrowpos" }, - { 0x81B1, "setgoalnode" }, - { 0x81B2, "setgoalpos" }, - { 0x81B3, "setgoalentity" }, - { 0x81B4, "setgoalvolume" }, - { 0x81B5, "setgoalvolumeauto" }, - { 0x81B6, "getgoalvolume" }, - { 0x81B7, "cleargoalvolume" }, - { 0x81B8, "setfixednodesafevolume" }, - { 0x81B9, "setmotionblurturnscale" }, - { 0x81BA, "setmotionblurzoomscale" }, - { 0x81BB, "viewkick" }, - { 0x81BC, "localtoworldcoords" }, - { 0x81BD, "getentitynumber" }, - { 0x81BE, "getentityvelocity" }, - { 0x81BF, "enablegrenadetouchdamage" }, - { 0x81C0, "disablegrenadetouchdamage" }, - { 0x81C1, "enableaimassist" }, - { 0x81C2, "setlookatyawlimits" }, - { 0x81C3, "stoplookat" }, - { 0x81C4, "getmuzzlepos" }, - { 0x81C5, "getmuzzleangle" }, - { 0x81C6, "getmuzzlesideoffsetpos" }, - { 0x81C7, "getaimangle" }, - { 0x81C8, "canshoot" }, - { 0x81C9, "canshootenemy" }, - { 0x81CA, "cansee" }, - { 0x81CB, "seerecently" }, - { 0x81CC, "lastknowntime" }, - { 0x81CD, "lastknownpos" }, - { 0x81CE, "dropweapon" }, - { 0x81CF, "maymovetopoint" }, - { 0x81D0, "maymovefrompointtopoint" }, - { 0x81D1, "teleport" }, - { 0x81D2, "forceteleport" }, - { 0x81D3, "safeteleport" }, - { 0x81D4, "withinapproxpathdist" }, - { 0x81D5, "ispathdirect" }, - { 0x81D6, "allowedstances" }, - { 0x81D7, "isstanceallowed" }, - { 0x81D8, "issuppressionwaiting" }, - { 0x81D9, "issuppressed" }, - { 0x81DA, "ismovesuppressed" }, - { 0x81DB, "isgrenadepossafe" }, - { 0x81DC, "checkgrenadethrow" }, - { 0x81DD, "checkgrenadelaunch" }, - { 0x81DE, "checkgrenadelaunchpos" }, - { 0x81DF, "throwgrenade" }, - { 0x81E0, "disableaimassist" }, - { 0x81E1, "radiusdamage" }, - { 0x81E2, "detonate" }, - { 0x81E3, "damageconetrace" }, - { 0x81E4, "sightconetrace" }, - { 0x81E5, "missile_settargetent" }, - { 0x81E6, "missile_settargetpos" }, - { 0x81E7, "missile_cleartarget" }, - { 0x81E8, "missile_setflightmodedirect" }, - { 0x81E9, "missile_setflightmodetop" }, - { 0x81EA, "getlightintensity" }, - { 0x81EB, "setlightintensity" }, - { 0x81EC, "_meth_81EC" }, - { 0x81ED, "_meth_81ED" }, - { 0x81EE, "_meth_81EE" }, - { 0x81EF, "_meth_81EF" }, - { 0x81F0, "isragdoll" }, - { 0x81F1, "setmovespeedscale" }, - { 0x81F2, "cameralinkto" }, - { 0x81F3, "cameraunlink" }, - { 0x81F4, "startcoverarrival" }, - { 0x81F5, "starttraversearrival" }, - { 0x81F6, "checkcoverexitposwithpath" }, - { 0x81F7, "shoot" }, - { 0x81F8, "shootblank" }, - { 0x81F9, "melee" }, - { 0x81FA, "updateplayersightaccuracy" }, - { 0x81FB, "findshufflecovernode" }, - { 0x81FC, "findnearbycovernode" }, - { 0x81FD, "findcovernode" }, - { 0x81FE, "findbestcovernode" }, - { 0x81FF, "getcovernode" }, - { 0x8200, "usecovernode" }, - { 0x8201, "iscovervalidagainstenemy" }, - { 0x8202, "reacquirestep" }, - { 0x8203, "findreacquiredirectpath" }, - { 0x8204, "trimpathtoattack" }, - { 0x8205, "reacquiremove" }, - { 0x8206, "findreacquireproximatepath" }, - { 0x8207, "flagenemyunattackable" }, - { 0x8208, "enterprone" }, - { 0x8209, "exitprone" }, - { 0x820A, "setproneanimnodes" }, - { 0x820B, "updateprone" }, - { 0x820C, "clearpitchorient" }, - { 0x820D, "setlookatanimnodes" }, - { 0x820E, "setlookat" }, - { 0x820F, "setlookatentity" }, - { 0x8210, "controlslinkto" }, - { 0x8211, "controlsunlink" }, - { 0x8212, "makevehiclesolidcapsule" }, - { 0x8213, "_meth_8213" }, - { 0x8214, "teleportentityrelative" }, - { 0x8215, "_meth_8215" }, - { 0x8216, "_meth_8216" }, - { 0x8217, "_meth_8217" }, - { 0x8218, "_meth_8218" }, - { 0x8219, "_meth_8219" }, - { 0x821A, "_meth_821A" }, - { 0x821B, "_meth_821B" }, - { 0x821C, "drivevehicleandcontrolturret" }, - { 0x821D, "drivevehicleandcontrolturretoff" }, - { 0x821E, "getplayersetting" }, - { 0x821F, "getlocalplayerprofiledata" }, - { 0x8220, "setlocalplayerprofiledata" }, - { 0x8221, "remotecamerasoundscapeon" }, - { 0x8222, "remotecamerasoundscapeoff" }, - { 0x8223, "setmotiontrackervisible" }, - { 0x8224, "getmotiontrackervisible" }, - { 0x8225, "worldpointinreticle_circle" }, - { 0x8226, "worldpointinreticle_rect" }, - { 0x8227, "getpointinbounds" }, - { 0x8228, "transfermarkstonewscriptmodel" }, - { 0x8229, "setwatersheeting" }, - { 0x822A, "_meth_822A" }, - { 0x822B, "_meth_822B" }, - { 0x822C, "setweaponhudiconoverride" }, - { 0x822D, "getweaponhudiconoverride" }, - { 0x822E, "setempjammed" }, - { 0x822F, "playersetexpfogext" }, - { 0x8230, "playersetexpfog" }, - { 0x8231, "playersetatmosfog" }, - { 0x8232, "isitemunlocked" }, - { 0x8233, "getplayerdata" }, - { 0x8234, "vehicleturretcontroloff" }, - { 0x8235, "isturretready" }, - { 0x8236, "vehicledriveto" }, - { 0x8237, "vehicle_dospawn" }, - { 0x8238, "vehicle_isphysveh" }, - { 0x8239, "vehphys_crash" }, - { 0x823A, "_meth_823A" }, - { 0x823B, "vehphys_launch" }, - { 0x823C, "vehphys_disablecrashing" }, - { 0x823D, "vehphys_enablecrashing" }, - { 0x823E, "vehphys_setspeed" }, - { 0x823F, "vehphys_setconveyorbelt" }, - { 0x8240, "_meth_8240" }, - { 0x8241, "playerlinkedturretanglesenable" }, - { 0x8242, "playerlinkedturretanglesdisable" }, - { 0x8243, "_meth_8243" }, - { 0x8244, "_meth_8244" }, - { 0x8245, "playersetstreamorigin" }, - { 0x8246, "playerclearstreamorigin" }, - { 0x8247, "nightvisionviewon" }, - { 0x8248, "nightvisionviewoff" }, - { 0x8249, "painvisionon" }, - { 0x824A, "painvisionoff" }, - { 0x824B, "getplayerintelisfound" }, - { 0x824C, "setplayerintelfound" }, - { 0x824D, "_meth_824D" }, - { 0x824E, "sethuddynlight" }, - { 0x824F, "startscriptedanim" }, - { 0x8250, "startcoverbehavior" }, - { 0x8251, "setplayerdata" }, - { 0x8252, "getcacplayerdata" }, - { 0x8253, "setcacplayerdata" }, - { 0x8254, "trackerupdate" }, - { 0x8255, "_meth_8255" }, - { 0x8256, "buttonpressed" }, - { 0x8257, "_meth_8257" }, - { 0x8258, "_meth_8258" }, - { 0x8259, "_meth_8259" }, - { 0x825A, "dropitem" }, - { 0x825B, "_meth_825B" }, - { 0x825C, "setjitterparams" }, - { 0x825D, "sethoverparams" }, - { 0x825E, "joltbody" }, - { 0x825F, "freevehicle" }, - { 0x8260, "getwheelsurface" }, - { 0x8261, "getvehicleowner" }, - { 0x8262, "setvehiclelookattext" }, - { 0x8263, "setvehicleteam" }, - { 0x8264, "neargoalnotifydist" }, - { 0x8265, "setvehgoalpos" }, - { 0x8266, "setgoalyaw" }, - { 0x8267, "cleargoalyaw" }, - { 0x8268, "settargetyaw" }, - { 0x8269, "cleartargetyaw" }, - { 0x826A, "vehicle_helisetai" }, - { 0x826B, "setturrettargetvec" }, - { 0x826C, "setturrettargetent" }, - { 0x826D, "clearturrettargetent" }, - { 0x826E, "vehicle_canturrettargetpoint" }, - { 0x826F, "setlookatent" }, - { 0x8270, "clearlookatent" }, - { 0x8271, "setvehweapon" }, - { 0x8272, "fireweapon" }, - { 0x8273, "vehicleturretcontrolon" }, - { 0x8274, "_meth_8274" }, - { 0x8275, "_meth_8275" }, - { 0x8276, "_meth_8276" }, - { 0x8277, "_meth_8277" }, - { 0x8278, "_meth_8278" }, - { 0x8279, "_meth_8279" }, - { 0x827A, "_meth_827A" }, - { 0x827B, "_meth_827B" }, - { 0x827C, "_meth_827C" }, - { 0x827D, "_meth_827D" }, - { 0x827E, "_meth_827E" }, - { 0x827F, "_meth_827F" }, - { 0x8280, "physicslaunchserver" }, - { 0x8281, "physicslaunchserveritem" }, - { 0x8282, "clonebrushmodeltoscriptmodel" }, - { 0x8283, "_meth_8283" }, - { 0x8284, "_meth_8284" }, - { 0x8285, "_meth_8285" }, - { 0x8286, "vehicle_teleport" }, - { 0x8287, "attachpath" }, - { 0x8288, "getattachpos" }, - { 0x8289, "startpath" }, - { 0x828A, "setswitchnode" }, - { 0x828B, "setwaitspeed" }, - { 0x828C, "_meth_828C" }, - { 0x828D, "vehicle_setspeed" }, - { 0x828E, "vehicle_setspeedimmediate" }, - { 0x828F, "vehicle_rotateyaw" }, - { 0x8290, "vehicle_getspeed" }, - { 0x8291, "vehicle_getvelocity" }, - { 0x8292, "vehicle_getbodyvelocity" }, - { 0x8293, "vehicle_getsteering" }, - { 0x8294, "vehicle_getthrottle" }, - { 0x8295, "vehicle_turnengineoff" }, - { 0x8296, "vehicle_turnengineon" }, - { 0x8297, "vehicle_orientto" }, - { 0x8298, "getgoalspeedmph" }, - { 0x8299, "setacceleration" }, - { 0x829A, "setdeceleration" }, - { 0x829B, "resumespeed" }, - { 0x829C, "setyawspeed" }, - { 0x829D, "setyawspeedbyname" }, - { 0x829E, "setmaxpitchroll" }, - { 0x829F, "setairresitance" }, - { 0x82A0, "setturningability" }, - { 0x82A1, "_meth_82A1" }, - { 0x82A2, "_meth_82A2" }, - { 0x82A3, "_meth_82A3" }, - { 0x82A4, "_meth_82A4" }, - { 0x82A5, "_meth_82A5" }, - { 0x82A6, "_meth_82A6" }, - { 0x82A7, "_meth_82A7" }, - { 0x82A8, "_meth_82A8" }, - { 0x82A9, "_meth_82A9" }, - { 0x82AA, "_meth_82AA" }, - { 0x82AB, "_meth_82AB" }, - { 0x82AC, "_meth_82AC" }, - { 0x82AD, "weaponlocknoclearance" }, - { 0x82AE, "_meth_82AE" }, - { 0x82AF, "showhudsplash" }, - { 0x82B0, "setperk" }, - { 0x82B1, "hasperk" }, - { 0x82B2, "clearperks" }, - { 0x82B3, "unsetperk" }, - { 0x82B4, "_meth_82B4" }, - { 0x82B5, "_meth_82B5" }, - { 0x82B6, "noclip" }, - { 0x82B7, "ufo" }, - { 0x82B8, "moveto" }, - { 0x82B9, "movex" }, - { 0x82BA, "movey" }, - { 0x82BB, "movez" }, - { 0x82BC, "movegravity" }, - { 0x82BD, "moveslide" }, - { 0x82BE, "stopmoveslide" }, - { 0x82BF, "rotateto" }, - { 0x82C0, "rotatepitch" }, - { 0x82C1, "rotateyaw" }, - { 0x82C2, "rotateroll" }, - { 0x82C3, "addpitch" }, - { 0x82C4, "addyaw" }, - { 0x82C5, "addroll" }, - { 0x82C6, "vibrate" }, - { 0x82C7, "rotatevelocity" }, - { 0x82C8, "solid" }, - { 0x82C9, "notsolid" }, - { 0x82CA, "setcandamage" }, - { 0x82CB, "setcanradiusdamage" }, - { 0x82CC, "physicslaunchclient" }, - { 0x82CD, "_meth_82CD" }, - { 0x82CE, "_meth_82CE" }, - { 0x82CF, "_meth_82CF" }, - { 0x82D0, "_meth_82D0" }, - { 0x82D1, "_meth_82D1" }, - { 0x82D2, "_meth_82D2" }, - { 0x82D3, "_meth_82D3" }, - { 0x82D4, "_meth_82D4" }, - { 0x82D5, "disableweaponpickup" }, - { 0x82D6, "enableweaponpickup" }, - { 0x82D7, "issplitscreenplayer" }, - { 0x82D8, "_meth_82D8" }, - { 0x82D9, "getweaponslistoffhands" }, - { 0x82DA, "getweaponslistitems" }, - { 0x82DB, "getweaponslistexclusives" }, - { 0x82DC, "getweaponslist" }, - { 0x82DD, "canplayerplacesentry" }, - { 0x82DE, "canplayerplacetank" }, - { 0x82DF, "_meth_82DF" }, - { 0x82E0, "visionsetnakedforplayer" }, - { 0x82E1, "visionsetnightforplayer" }, - { 0x82E2, "visionsetmissilecamforplayer" }, - { 0x82E3, "visionsetthermalforplayer" }, - { 0x82E4, "setblurforplayer" }, - { 0x82E5, "getplayerweaponmodel" }, - { 0x82E6, "getplayerknifemodel" }, - { 0x82E7, "updateplayermodelwithweapons" }, - { 0x82E8, "notifyonplayercommand" }, - { 0x82E9, "canmantle" }, - { 0x82EA, "forcemantle" }, - { 0x82EB, "ismantling" }, - { 0x82EC, "playfx" }, - { 0x82ED, "player_recoilscaleon" }, - { 0x82EE, "player_recoilscaleoff" }, - { 0x82EF, "weaponlockstart" }, - { 0x82F0, "weaponlockfinalize" }, - { 0x82F1, "weaponlockfree" }, - { 0x82F2, "weaponlocktargettooclose" }, - { 0x82F3, "_meth_82F3" }, - { 0x82F4, "_meth_82F4" }, - { 0x82F5, "_meth_82F5" }, - { 0x82F6, "_meth_82F6" }, - { 0x82F7, "_meth_82F7" }, - { 0x82F8, "getviewmodel" }, - { 0x82F9, "fragbuttonpressed" }, - { 0x82FA, "secondaryoffhandbuttonpressed" }, - { 0x82FB, "getcurrentweaponclipammo" }, - { 0x82FC, "setvelocity" }, - { 0x82FD, "getplayerviewheight" }, - { 0x82FE, "getnormalizedmovement" }, - { 0x82FF, "playlocalsound" }, - { 0x8300, "stoplocalsound" }, - { 0x8301, "setweaponammoclip" }, - { 0x8302, "setweaponammostock" }, - { 0x8303, "getweaponammoclip" }, - { 0x8304, "getweaponammostock" }, - { 0x8305, "hasreloadmultipleanim" }, - { 0x8306, "regweaponforfxremoval" }, - { 0x8307, "setclientdvar" }, - { 0x8308, "setclientdvars" }, - { 0x8309, "_meth_8309" }, - { 0x830A, "_meth_830A" }, - { 0x830B, "allowads" }, - { 0x830C, "allowjump" }, - { 0x830D, "allowsprint" }, - { 0x830E, "_meth_830E" }, - { 0x830F, "_meth_830F" }, - { 0x8310, "setspreadoverride" }, - { 0x8311, "resetspreadoverride" }, - { 0x8312, "setaimspreadmovementscale" }, - { 0x8313, "setactionslot" }, - { 0x8314, "setviewkickscale" }, - { 0x8315, "getviewkickscale" }, - { 0x8316, "getweaponslistall" }, - { 0x8317, "getweaponslistprimaries" }, - { 0x8318, "getnormalizedcameramovement" }, - { 0x8319, "giveweapon" }, - { 0x831A, "takeweapon" }, - { 0x831B, "takeallweapons" }, - { 0x831C, "getcurrentweapon" }, - { 0x831D, "getcurrentprimaryweapon" }, - { 0x831E, "getcurrentoffhand" }, - { 0x831F, "hasweapon" }, - { 0x8320, "switchtoweapon" }, - { 0x8321, "switchtoweaponimmediate" }, - { 0x8322, "_meth_8322" }, - { 0x8323, "switchtooffhand" }, - { 0x8324, "setoffhandsecondaryclass" }, - { 0x8325, "getoffhandsecondaryclass" }, - { 0x8326, "beginlocationselection" }, - { 0x8327, "endlocationselection" }, - { 0x8328, "disableweapons" }, - { 0x8329, "enableweapons" }, - { 0x832A, "disableoffhandweapons" }, - { 0x832B, "enableoffhandweapons" }, - { 0x832C, "disableweaponswitch" }, - { 0x832D, "enableweaponswitch" }, - { 0x832E, "openpopupmenu" }, - { 0x832F, "openpopupmenunomouse" }, - { 0x8330, "closepopupmenu" }, - { 0x8331, "openmenu" }, - { 0x8332, "closemenu" }, - { 0x8333, "_meth_8333" }, - { 0x8334, "freezecontrols" }, - { 0x8335, "disableusability" }, - { 0x8336, "enableusability" }, - { 0x8337, "setwhizbyspreads" }, - { 0x8338, "setwhizbyradii" }, - { 0x8339, "setreverb" }, - { 0x833A, "deactivatereverb" }, - { 0x833B, "setvolmod" }, - { 0x833C, "givestartammo" }, - { 0x833D, "givemaxammo" }, - { 0x833E, "getfractionstartammo" }, - { 0x833F, "getfractionmaxammo" }, - { 0x8340, "isdualwielding" }, - { 0x8341, "isreloading" }, - { 0x8342, "isswitchingweapon" }, - { 0x8343, "setorigin" }, - { 0x8344, "getvelocity" }, - { 0x8345, "setplayerangles" }, - { 0x8346, "getplayerangles" }, - { 0x8347, "usebuttonpressed" }, - { 0x8348, "attackbuttonpressed" }, - { 0x8349, "adsbuttonpressed" }, - { 0x834A, "meleebuttonpressed" }, - { 0x834B, "playerads" }, - { 0x834C, "isonground" }, - { 0x834D, "isusingturret" }, - { 0x834E, "setviewmodel" }, - { 0x834F, "setoffhandprimaryclass" }, - { 0x8350, "getoffhandprimaryclass" }, - { 0x8351, "enablefocus" }, - { 0x8352, "disablefocus" }, - { 0x8353, "enablezoom" }, - { 0x8354, "disablezoom" }, - { 0x8355, "_meth_8355" }, - { 0x8356, "_meth_8356" }, - { 0x8357, "_meth_8357" }, - { 0x8358, "_meth_8358" }, - { 0x8359, "_meth_8359" }, - { 0x835A, "_meth_835A" }, - { 0x835B, "_meth_835B" }, - { 0x835C, "_meth_835C" }, - { 0x835D, "_meth_835D" }, - { 0x835E, "_meth_835E" }, - { 0x835F, "_meth_835F" }, - { 0x8360, "_meth_8360" }, - { 0x8361, "_meth_8361" }, - { 0x8362, "_meth_8362" }, - { 0x8363, "_meth_8363" }, - { 0x8364, "_meth_8364" }, - { 0x8365, "_meth_8365" }, - { 0x8366, "_meth_8366" }, - { 0x8367, "_meth_8367" }, - { 0x8368, "_meth_8368" }, - { 0x8369, "_meth_8369" }, - { 0x836A, "_meth_836A" }, - { 0x836B, "_meth_836B" }, - { 0x836C, "_meth_836C" }, - { 0x836D, "_meth_836D" }, - { 0x836E, "_meth_836E" }, - { 0x836F, "_meth_836F" }, - { 0x8370, "_meth_8370" }, - { 0x8371, "_meth_8371" }, - { 0x8372, "_meth_8372" }, - { 0x8373, "_meth_8373" }, - { 0x8374, "_meth_8374" }, - { 0x8375, "_meth_8375" }, - { 0x8376, "_meth_8376" }, - { 0x8377, "_meth_8377" }, - { 0x8378, "_meth_8378" }, - { 0x8379, "_meth_8379" }, - { 0x837A, "_meth_837A" }, - { 0x837B, "_meth_837B" }, - { 0x837C, "_meth_837C" }, - { 0x837D, "_meth_837D" }, - { 0x837E, "_meth_837E" }, - { 0x837F, "_meth_837F" }, - { 0x8380, "_meth_8380" }, - { 0x8381, "_meth_8381" }, - { 0x8382, "_meth_8382" }, - { 0x8383, "_meth_8383" }, - { 0x8384, "_meth_8384" }, - { 0x8385, "_meth_8385" }, - { 0x8386, "_meth_8386" }, - { 0x8387, "_meth_8387" }, - { 0x8388, "_meth_8388" }, - { 0x8389, "_meth_8389" }, - { 0x838A, "_meth_838A" }, - { 0x838B, "_meth_838B" }, - { 0x838C, "_meth_838C" }, - { 0x838D, "_meth_838D" }, - { 0x838E, "_meth_838E" }, - { 0x838F, "_meth_838F" }, - { 0x8390, "_meth_8390" }, - { 0x8391, "_meth_8391" }, - { 0x8392, "_meth_8392" }, - { 0x8393, "_meth_8393" }, - { 0x8394, "_meth_8394" }, - { 0x8395, "_meth_8395" }, - { 0x8396, "_meth_8396" }, - { 0x8397, "_meth_8397" }, - { 0x8398, "_meth_8398" }, - { 0x8399, "_meth_8399" }, - { 0x839A, "_meth_839A" }, - { 0x839B, "_meth_839B" }, - { 0x839C, "_meth_839C" }, - { 0x839D, "_meth_839D" }, - { 0x839E, "_meth_839E" }, - { 0x839F, "_meth_839F" }, - { 0x83A0, "_meth_83A0" }, - { 0x83A1, "_meth_83A1" }, - { 0x83A2, "_meth_83A2" }, - { 0x83A3, "_meth_83A3" }, - { 0x83A4, "_meth_83A4" }, - { 0x83A5, "_meth_83A5" }, - { 0x83A6, "_meth_83A6" }, - { 0x83A7, "_meth_83A7" }, - { 0x83A8, "_meth_83A8" }, - { 0x83A9, "_meth_83A9" }, - { 0x83AA, "_meth_83AA" }, - { 0x83AB, "_meth_83AB" }, - { 0x83AC, "_meth_83AC" }, - { 0x83AD, "_meth_83AD" }, - { 0x83AE, "_meth_83AE" }, - { 0x83AF, "_meth_83AF" }, - { 0x83B0, "_meth_83B0" }, - { 0x83B1, "_meth_83B1" }, - { 0x83B2, "_meth_83B2" }, - { 0x83B3, "_meth_83B3" }, - { 0x83B4, "_meth_83B4" }, - { 0x83B5, "_meth_83B5" }, - { 0x83B6, "_meth_83B6" }, - { 0x83B7, "_meth_83B7" }, - { 0x83B8, "_meth_83B8" }, - { 0x83B9, "_meth_83B9" }, - { 0x83BA, "_meth_83BA" }, - { 0x83BB, "_meth_83BB" }, - { 0x83BC, "_meth_83BC" }, - { 0x83BD, "_meth_83BD" }, - { 0x83BE, "_meth_83BE" }, - { 0x83BF, "_meth_83BF" }, - { 0x83C0, "_meth_83C0" }, - { 0x83C1, "_meth_83C1" }, - { 0x83C2, "_meth_83C2" }, - { 0x83C3, "_meth_83C3" }, - { 0x83C4, "_meth_83C4" }, - { 0x83C5, "_meth_83C5" }, - { 0x83C6, "_meth_83C6" }, - { 0x83C7, "_meth_83C7" }, - { 0x83C8, "_meth_83C8" }, - { 0x83C9, "_meth_83C9" }, - { 0x83CA, "_meth_83CA" }, - { 0x83CB, "_meth_83CB" }, - { 0x83CC, "_meth_83CC" }, - { 0x83CD, "lightset" }, - { 0x83CE, "lightset2" }, - { 0x83CF, "lightset3" }, - { 0x83D0, "_meth_83D0" }, - { 0x83D1, "_meth_83D1" }, - { 0x83D2, "_meth_83D2" }, - { 0x83D3, "_meth_83D3" }, - { 0x83D4, "_meth_83D4" }, - { 0x83D5, "setdoghandler" }, - { 0x83D6, "setdogcommand" }, - { 0x83D7, "setdogattackradius" }, - { 0x83D8, "isdogfollowinghandler" }, - { 0x83D9, "setdogmaxdrivespeed" }, - { 0x83DA, "isdogbeingdriven" }, - { 0x83DB, "setdogautoattackwhendriven" }, - { 0x83DC, "getdogattackbeginnode" }, - { 0x83DD, "_meth_83DD" }, - { 0x83DE, "_meth_83DE" }, - { 0x83DF, "_meth_83DF" }, - { 0x83E0, "_meth_83E0" }, - { 0x83E1, "_meth_83E1" }, - { 0x83E2, "_meth_83E2" }, - { 0x83E3, "_meth_83E3" }, - { 0x83E4, "pushplayervector" }, - { 0x83E5, "issprinting" }, - { 0x83E6, "playerlinkeduselinkedvelocity" }, - { 0x83E7, "shootstopsound" }, - { 0x83E8, "setclothtype" }, - { 0x83E9, "getclothmovesound" }, - { 0x83EA, "getequipmovesound" }, - { 0x83EB, "jumpbuttonpressed" }, - { 0x83EC, "rotateby" }, - { 0x83ED, "_meth_83ED" }, - { 0x83EE, "_meth_83EE" }, - { 0x83EF, "_meth_83EF" }, - { 0x83F0, "_meth_83F0" }, - { 0x83F1, "setsurfacetype" }, - { 0x83F2, "aiphysicstrace" }, - { 0x83F3, "aiphysicstracepassed" }, - { 0x83F4, "setdevtext" }, - { 0x83F5, "forcemovingplatformentity" }, - { 0x83F6, "setmovingplatformtrigger" }, - { 0x83F7, "visionsetstage" }, - { 0x83F8, "linkwaypointtotargetwithoffset" }, - { 0x83F9, "getlinkedparent" }, - { 0x83FA, "getmovingplatformparent" }, - { 0x83FB, "_meth_83FB" }, - { 0x83FC, "retargetscriptmodellighting" }, - { 0x83FD, "_meth_83FD" }, - { 0x83FE, "clearclienttriggeraudiozone" }, - { 0x83FF, "setclienttriggeraudiozone" }, - { 0x8400, "makevehiclenotcollidewithplayers" }, - { 0x8401, "getbobrate" }, - { 0x8402, "setbobrate" }, - { 0x8403, "setscriptablepartstate" }, - { 0x8404, "stopsliding" }, - { 0x8405, "cancelrocketcorpse" }, - { 0x8406, "setdronegoalpos" }, - { 0x8407, "hudoutlineenable" }, - { 0x8408, "hudoutlinedisable" }, - { 0x8409, "motionblurhqenable" }, - { 0x840A, "motionblurhqdisable" }, - { 0x840B, "screenshakeonentity" }, - { 0x840C, "_meth_840C" }, - { 0x840D, "_meth_840D" }, - { 0x840E, "worldpointtoscreenpos" }, - { 0x840F, "_meth_840F" }, - { 0x8410, "shouldplaymeleedeathanim" }, - { 0x8411, "_meth_8411" }, - { 0x8412, "visionsetwaterforplayer" }, - { 0x8413, "setwatersurfacetransitionfx" }, - { 0x8414, "linktoplayerviewfollowwatersurface" }, - { 0x8415, "linktoplayerviewattachwatersurfacetransitioneffects" }, - { 0x8416, "playersetwaterfog" }, - { 0x8417, "_meth_8417" }, - { 0x8418, "enableforceviewmodeldof" }, - { 0x8419, "disableforceviewmodeldof" }, - { 0x841A, "_meth_841A" }, - { 0x841B, "isenemyaware" }, - { 0x841C, "hasenemybeenseen" }, - { 0x841D, "physicssetmaxlinvel" }, - { 0x841E, "physicssetmaxangvel" }, - { 0x841F, "physicsgetlinvel" }, - { 0x8420, "physicsgetlinspeed" }, - { 0x8421, "physicsgetangvel" }, - { 0x8422, "physicsgetangspeed" }, - { 0x8423, "_meth_8423" }, - { 0x8424, "_meth_8424" }, - { 0x8425, "_meth_8425" }, - { 0x8426, "_meth_8426" }, - { 0x8427, "_meth_8427" }, - { 0x8428, "_meth_8428" }, - { 0x8429, "_meth_8429" }, - { 0x842A, "disablemissileboosting" }, - { 0x842B, "enablemissileboosting" }, - { 0x842C, "canspawntestclient" }, - { 0x842D, "spawntestclient" }, - { 0x842E, "turretsetbarrelspinenabled" }, - { 0x842F, "_meth_842F" }, - { 0x8430, "_meth_8430" }, - { 0x8431, "setclienttriggeraudiozonelerp" }, - { 0x8432, "setclienttriggeraudiozonepartial" }, - { 0x8433, "_meth_8433" }, - { 0x8434, "rotatetolinked" }, - { 0x8435, "rotatebylinked" }, - { 0x8436, "setlinkedangles" }, - { 0x8437, "_meth_8437" }, - { 0x8438, "_meth_8438" }, - { 0x8439, "_meth_8439" }, - { 0x843A, "_meth_843A" }, - { 0x843B, "_meth_843B" }, - { 0x843C, "_meth_843C" }, - { 0x843D, "_meth_843D" }, - { 0x843E, "disableautoreload" }, - { 0x843F, "enableautoreload" }, - { 0x8440, "_meth_8440" }, - { 0x8441, "_meth_8441" }, - { 0x8442, "getlinkedchildren" }, - { 0x8443, "_meth_8443" }, - { 0x8444, "_meth_8444" }, - { 0x8445, "cancelmantle" }, - { 0x8446, "_meth_8446" }, - { 0x8447, "_meth_8447" }, - { 0x8448, "setscriptabledamageowner" }, - { 0x8449, "_meth_8449" }, - { 0x844A, "_meth_844A" }, - { 0x844B, "_meth_844B" }, - { 0x844C, "_meth_844C" }, - { 0x844D, "_meth_844D" }, - { 0x844E, "_meth_844E" }, - { 0x844F, "_meth_844F" }, - { 0x8450, "_meth_8450" }, - { 0x8451, "_meth_8451" }, - { 0x8452, "_meth_8452" }, - { 0x8453, "_meth_8453" }, - { 0x8454, "_meth_8454" }, - { 0x8455, "_meth_8455" }, - { 0x8456, "_meth_8456" }, - { 0x8457, "_meth_8457" }, - { 0x8458, "_meth_8458" }, - { 0x8459, "_meth_8459" }, - { 0x845A, "_meth_845A" }, - { 0x845B, "_meth_845B" }, - { 0x845C, "_meth_845C" }, - { 0x845D, "_meth_845D" }, - { 0x845E, "_meth_845E" }, - { 0x845F, "_meth_845F" }, - { 0x8460, "_meth_8460" }, - { 0x8461, "_meth_8461" }, - { 0x8462, "_meth_8462" }, - { 0x8463, "_meth_8463" }, - { 0x8464, "_meth_8464" }, - { 0x8465, "_meth_8465" }, - { 0x8466, "_meth_8466" }, - { 0x8467, "_meth_8467" }, - { 0x8468, "_meth_8468" }, - { 0x8469, "_meth_8469" }, - { 0x846A, "_meth_846A" }, - { 0x846B, "_meth_846B" }, - { 0x846C, "_meth_846C" }, - { 0x846D, "_meth_846D" }, - { 0x846E, "_meth_846E" }, - { 0x846F, "_meth_846F" }, - { 0x8470, "_meth_8470" }, - { 0x8471, "_meth_8471" }, - { 0x8472, "_meth_8472" }, - { 0x8473, "_meth_8473" }, - { 0x8474, "_meth_8474" }, - { 0x8475, "_meth_8475" }, - { 0x8476, "_meth_8476" }, - { 0x8477, "_meth_8477" }, - { 0x8478, "_meth_8478" }, - { 0x8479, "_meth_8479" }, - { 0x847A, "_meth_847A" }, - { 0x847B, "_meth_847B" }, - { 0x847C, "_meth_847C" }, - { 0x847D, "_meth_847D" }, - { 0x847E, "_meth_847E" }, - { 0x847F, "_meth_847F" }, - { 0x8480, "_meth_8480" }, - { 0x8481, "_meth_8481" }, - { 0x8482, "_meth_8482" }, - { 0x8483, "_meth_8483" }, - { 0x8484, "_meth_8484" }, - { 0x8485, "_meth_8485" }, - { 0x8486, "_meth_8486" }, - { 0x8487, "_meth_8487" }, - { 0x8488, "_meth_8488" }, - { 0x8489, "_meth_8489" }, - { 0x848A, "_meth_848A" }, - { 0x848B, "_meth_848B" }, - { 0x848C, "_meth_848C" }, - { 0x848D, "_meth_848D" }, - { 0x848E, "_meth_848E" }, - { 0x848F, "_meth_848F" }, - { 0x8490, "_meth_8490" }, - { 0x8491, "_meth_8491" }, - { 0x8492, "_meth_8492" }, - { 0x8493, "_meth_8493" }, - { 0x8494, "_meth_8494" }, - { 0x8495, "_meth_8495" }, - { 0x8496, "_meth_8496" }, - { 0x8497, "_meth_8497" }, - { 0x8498, "_meth_8498" }, - { 0x8499, "_meth_8499" }, - { 0x849A, "_meth_849A" }, - { 0x849B, "_meth_849B" }, - { 0x849C, "_meth_849C" }, - { 0x849D, "_meth_849D" }, - { 0x849E, "_meth_849E" }, - { 0x849F, "_meth_849F" }, - { 0x84A0, "_meth_84A0" }, - { 0x84A1, "_meth_84A1" }, - { 0x84A2, "_meth_84A2" }, - { 0x84A3, "_meth_84A3" }, - { 0x84A4, "_meth_84A4" }, - { 0x84A5, "_meth_84A5" }, - { 0x84A6, "_meth_84A6" }, - { 0x84A7, "_meth_84A7" }, - { 0x84A8, "_meth_84A8" }, - { 0x84A9, "_meth_84A9" }, - { 0x84AA, "_meth_84AA" }, - { 0x84AB, "_meth_84AB" }, - { 0x84AC, "_meth_84AC" }, - { 0x84AD, "_meth_84AD" }, - { 0x84AE, "_meth_84AE" }, - { 0x84AF, "_meth_84AF" }, - { 0x84B0, "_meth_84B0" }, - { 0x84B1, "_meth_84B1" }, - { 0x84B2, "_meth_84B2" }, - { 0x84B3, "_meth_84B3" }, - { 0x84B4, "_meth_84B4" }, - { 0x84B5, "_meth_84B5" }, - { 0x84B6, "_meth_84B6" }, - { 0x84B7, "_meth_84B7" }, - { 0x84B8, "_meth_84B8" }, - { 0x84B9, "_meth_84B9" }, - { 0x84BA, "_meth_84BA" }, - { 0x84BB, "_meth_84BB" }, - { 0x84BC, "_meth_84BC" }, - { 0x84BD, "_meth_84BD" }, - { 0x84BE, "_meth_84BE" }, - { 0x84BF, "_meth_84BF" }, - { 0x84C0, "_meth_84C0" }, - { 0x84C1, "_meth_84C1" }, - { 0x84C2, "_meth_84C2" }, - { 0x84C3, "_meth_84C3" }, - { 0x84C4, "_meth_84C4" }, - { 0x84C5, "_meth_84C5" }, - { 0x84C6, "_meth_84C6" }, - { 0x84C7, "_meth_84C7" }, - { 0x84C8, "_meth_84C8" }, - { 0x84C9, "_meth_84C9" }, - { 0x84CA, "_meth_84CA" }, - { 0x84CB, "_meth_84CB" }, - { 0x84CC, "_meth_84CC" }, - { 0x84CD, "_meth_84CD" }, - { 0x84CE, "_meth_84CE" }, - { 0x84CF, "_meth_84CF" }, - { 0x84D0, "_meth_84D0" }, - { 0x84D1, "_meth_84D1" }, - { 0x84D2, "_meth_84D2" }, - { 0x84D3, "_meth_84D3" }, - { 0x84D4, "_meth_84D4" }, - { 0x84D5, "_meth_84D5" }, - { 0x84D6, "_meth_84D6" }, - { 0x84D7, "_meth_84D7" }, - { 0x84D8, "_meth_84D8" }, - { 0x84D9, "_meth_84D9" }, - { 0x84DA, "_meth_84DA" }, - { 0x84DB, "_meth_84DB" }, - { 0x84DC, "_meth_84DC" }, - { 0x84DD, "_meth_84DD" }, - { 0x84DE, "_meth_84DE" }, - { 0x84DF, "_meth_84DF" }, - { 0x84E0, "_meth_84E0" }, - { 0x84E1, "_meth_84E1" }, - { 0x84E2, "_meth_84E2" }, - { 0x84E3, "_meth_84E3" }, - { 0x84E4, "_meth_84E4" }, - { 0x84E5, "_meth_84E5" }, - { 0x84E6, "_meth_84E6" }, - { 0x84E7, "_meth_84E7" }, - { 0x84E8, "_meth_84E8" }, - { 0x84E9, "_meth_84E9" }, - { 0x84EA, "_meth_84EA" }, - { 0x84EB, "_meth_84EB" }, - { 0x84EC, "_meth_84EC" }, - { 0x84ED, "_meth_84ED" }, - { 0x84EE, "_meth_84EE" }, - { 0x84EF, "_meth_84EF" }, - { 0x84F0, "_meth_84F0" }, - { 0x84F1, "_meth_84F1" }, - { 0x84F2, "_meth_84F2" }, - { 0x84F3, "_meth_84F3" }, - { 0x84F4, "_meth_84F4" }, - { 0x84F5, "_meth_84F5" }, - { 0x84F6, "_meth_84F6" }, - { 0x84F7, "_meth_84F7" }, - { 0x84F8, "_meth_84F8" }, - { 0x84F9, "_meth_84F9" }, - { 0x84FA, "_meth_84FA" }, - { 0x84FB, "_meth_84FB" }, - { 0x84FC, "_meth_84FC" }, - { 0x84FD, "_meth_84FD" }, - { 0x84FE, "_meth_84FE" }, - { 0x84FF, "hidepartvm" }, - { 0x8500, "openluimenu" }, - { 0x8501, "_meth_8501" }, - { 0x8502, "_meth_8502" }, - { 0x8503, "_meth_8503" }, - { 0x8504, "_meth_8504" }, - { 0x8505, "_meth_8505" }, - { 0x8506, "_meth_8506" }, - { 0x8507, "_meth_8507" }, - { 0x8508, "_meth_8508" }, - { 0x8509, "_meth_8509" }, - { 0x850A, "_meth_850A" }, - { 0x850B, "_meth_850B" }, - { 0x850C, "_meth_850C" }, - { 0x850D, "_meth_850D" }, - { 0x850E, "_meth_850E" }, - { 0x850F, "_meth_850F" }, - { 0x8510, "_meth_8510" }, - { 0x8511, "_meth_8511" }, - { 0x8512, "_meth_8512" }, - { 0x8513, "_meth_8513" }, - { 0x8514, "_meth_8514" }, - { 0x8515, "_meth_8515" }, - { 0x8516, "_meth_8516" }, - { 0x8517, "_meth_8517" }, - { 0x8518, "_meth_8518" }, - { 0x8519, "_meth_8519" }, - { 0x851A, "_meth_851A" }, - { 0x851B, "_meth_851B" }, - { 0x851C, "_meth_851C" }, - { 0x851D, "_meth_851D" }, - { 0x851E, "_meth_851E" }, - { 0x851F, "_meth_851F" }, - { 0x8520, "_meth_8520" }, - { 0x8521, "_meth_8521" }, - { 0x8522, "_meth_8522" }, - { 0x8523, "_meth_8523" }, - { 0x8524, "_meth_8524" }, - { 0x8525, "_meth_8525" }, - { 0x8526, "_meth_8526" }, - { 0x8527, "_meth_8527" }, - { 0x8528, "_meth_8528" }, - { 0x8529, "_meth_8529" }, - { 0x852A, "_meth_852A" }, - { 0x852B, "_meth_852B" }, - { 0x852C, "_meth_852C" }, - { 0x852D, "_meth_852D" }, - { 0x852E, "_meth_852E" }, - { 0x852F, "_meth_852F" }, - { 0x8530, "_meth_8530" }, - { 0x8531, "_meth_8531" }, - { 0x8532, "_meth_8532" }, - { 0x8533, "_meth_8533" }, - { 0x8534, "_meth_8534" }, - { 0x8535, "_meth_8535" }, - { 0x8536, "_meth_8536" }, - { 0x8537, "_meth_8537" }, - { 0x8538, "_meth_8538" }, - { 0x8539, "_meth_8539" }, - { 0x853A, "_meth_853A" }, - { 0x853B, "_meth_853B" }, - { 0x853C, "_meth_853C" }, - { 0x853D, "_meth_853D" }, - { 0x853E, "_meth_853E" }, - { 0x853F, "_meth_853F" }, - { 0x8540, "_meth_8540" }, - { 0x8541, "_meth_8541" }, - { 0x8542, "_meth_8542" }, - { 0x8543, "_meth_8543" }, - { 0x8544, "_meth_8544" }, - { 0x8545, "_meth_8545" }, - { 0x8546, "_meth_8546" }, - { 0x8547, "_meth_8547" }, - { 0x8548, "_meth_8548" }, - { 0x8549, "_meth_8549" }, - { 0x854A, "_meth_854A" }, - { 0x854B, "_meth_854B" }, - { 0x854C, "_meth_854C" }, - { 0x854D, "_meth_854D" }, - { 0x854E, "_meth_854E" }, - { 0x854F, "_meth_854F" }, - { 0x8550, "_meth_8550" }, - { 0x8551, "_meth_8551" }, - { 0x8552, "_meth_8552" }, - { 0x8553, "_meth_8553" }, - { 0x8554, "_meth_8554" }, - { 0x8555, "_meth_8555" }, - { 0x8556, "_meth_8556" }, - { 0x8557, "_meth_8557" }, - { 0x8558, "_meth_8558" }, - { 0x8559, "_meth_8559" }, - { 0x855A, "_meth_855A" }, - { 0x855B, "_meth_855B" }, - { 0x855C, "_meth_855C" }, - { 0x855D, "_meth_855D" }, - { 0x855E, "_meth_855E" }, - { 0x855F, "_meth_855F" }, - { 0x8560, "_meth_8560" }, - { 0x8561, "_meth_8561" }, - { 0x8562, "_meth_8562" }, - { 0x8563, "_meth_8563" }, - { 0x8564, "_meth_8564" }, - { 0x8565, "_meth_8565" }, - { 0x8566, "_meth_8566" }, - { 0x8567, "_meth_8567" }, - { 0x8568, "_meth_8568" }, - { 0x8569, "_meth_8569" }, - { 0x856A, "_meth_856A" }, - { 0x856B, "_meth_856B" }, - { 0x856C, "_meth_856C" }, - { 0x856D, "_meth_856D" }, - { 0x856E, "_meth_856E" }, - { 0x856F, "_meth_856F" }, - { 0x8570, "_meth_8570" }, - { 0x8571, "_meth_8571" }, - { 0x8572, "_meth_8572" }, - { 0x8573, "_meth_8573" }, - { 0x8574, "_meth_8574" }, - { 0x8575, "_meth_8575" }, - { 0x8576, "_meth_8576" }, - { 0x8577, "_meth_8577" }, - { 0x8578, "_meth_8578" }, - { 0x8579, "_meth_8579" }, - { 0x857A, "_meth_857A" }, - { 0x857B, "_meth_857B" }, - { 0x857C, "_meth_857C" }, - { 0x857D, "_meth_857D" }, - { 0x857E, "_meth_857E" }, - { 0x857F, "_meth_857F" }, - { 0x8580, "_meth_8580" }, - { 0x8581, "_meth_8581" }, - { 0x8582, "_meth_8582" }, - { 0x8583, "_meth_8583" }, - { 0x8584, "_meth_8584" }, - { 0x8585, "_meth_8585" }, - { 0x8586, "_meth_8586" }, - { 0x8587, "_meth_8587" }, - { 0x8588, "_meth_8588" }, - { 0x8589, "_meth_8589" }, - { 0x858A, "_meth_858A" }, - { 0x858B, "_meth_858B" }, - { 0x858C, "_meth_858C" }, - { 0x858D, "_meth_858D" }, - { 0x858E, "_meth_858E" }, - { 0x858F, "_meth_858F" }, - { 0x8590, "_meth_8590" }, - { 0x8591, "_meth_8591" }, - { 0x8592, "_meth_8592" }, - { 0x8593, "_meth_8593" }, - { 0x8594, "_meth_8594" }, - { 0x8595, "_meth_8595" }, - { 0x8596, "_meth_8596" }, - { 0x8597, "_meth_8597" }, - { 0x8598, "_meth_8598" }, - { 0x8599, "_meth_8599" }, - { 0x859A, "_meth_859A" }, - { 0x859B, "_meth_859B" }, - { 0x859C, "_meth_859C" }, - { 0x859D, "_meth_859D" }, - { 0x859E, "_meth_859E" }, - { 0x859F, "_meth_859F" }, - { 0x85A0, "_meth_85A0" }, - { 0x85A1, "_meth_85A1" }, - { 0x85A2, "_meth_85A2" }, - { 0x85A3, "_meth_85A3" }, - { 0x85A4, "_meth_85A4" }, - { 0x85A5, "_meth_85A5" }, - { 0x85A6, "_meth_85A6" }, - { 0x85A7, "_meth_85A7" }, - { 0x85A8, "_meth_85A8" }, - { 0x85A9, "_meth_85A9" }, - { 0x85AA, "_meth_85AA" }, - { 0x85AB, "_meth_85AB" }, - { 0x85AC, "_meth_85AC" }, - { 0x85AD, "_meth_85AD" }, - { 0x85AE, "_meth_85AE" }, - { 0x85AF, "_meth_85AF" }, - { 0x85B0, "_meth_85B0" }, - { 0x85B1, "_meth_85B1" }, - { 0x85B2, "_meth_85B2" }, - { 0x85B3, "_meth_85B3" }, - { 0x85B4, "_meth_85B4" }, - { 0x85B5, "_meth_85B5" }, - { 0x85B6, "_meth_85B6" }, - { 0x85B7, "_meth_85B7" }, - { 0x85B8, "_meth_85B8" }, - { 0x85B9, "_meth_85B9" }, - { 0x85BA, "_meth_85BA" }, - { 0x85BB, "_meth_85BB" }, - { 0x85BC, "_meth_85BC" }, - { 0x85BD, "_meth_85BD" }, - { 0x85BE, "_meth_85BE" }, - { 0x85BF, "_meth_85BF" }, - { 0x85C0, "_meth_85C0" }, - { 0x85C1, "_meth_85C1" }, - { 0x85C2, "_meth_85C2" }, - { 0x85C3, "_meth_85C3" }, - { 0x85C4, "_meth_85C4" }, - { 0x85C5, "_meth_85C5" }, - { 0x85C6, "_meth_85C6" }, - { 0x85C7, "_meth_85C7" }, - { 0x85C8, "_meth_85C8" }, - { 0x85C9, "_meth_85C9" }, - { 0x85CA, "_meth_85CA" }, - { 0x85CB, "_meth_85CB" }, - { 0x85CC, "_meth_85CC" }, - { 0x85CD, "_meth_85CD" }, - { 0x85CE, "_meth_85CE" }, - { 0x85CF, "_meth_85CF" }, - { 0x85D0, "_meth_85D0" }, - { 0x85D1, "_meth_85D1" }, - { 0x85D2, "_meth_85D2" }, -}}; - -const std::array, 42524> token_list +extern std::array, token_count> const token_list {{ { 0x0000, "" }, { 0x0001, "pl#" }, @@ -45742,53 +42998,4 @@ const std::array, 42524> token_list { 0xA7E9, "maps/mp/perks/_perks" }, }}; -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()); - function_map.reserve(function_list.size()); - function_map_rev.reserve(function_list.size()); - method_map.reserve(method_list.size()); - method_map_rev.reserve(method_list.size()); - token_map.reserve(token_list.size()); - token_map_rev.reserve(token_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 : function_list) - { - function_map.insert({ entry.first, entry.second }); - function_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : method_list) - { - method_map.insert({ entry.first, entry.second }); - method_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : token_list) - { - token_map.insert({ entry.first, entry.second }); - token_map_rev.insert({ entry.second, entry.first }); - } - } -}; - -__init__ _; - } // namespace xsk::gsc::h2 - -#ifdef _MSC_VER -#pragma warning(pop) -#endif diff --git a/src/h2/stdafx.cpp b/src/h2/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/h2/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/h2/stdafx.hpp b/src/h2/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/h2/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/h2/xsk/assembler.cpp b/src/h2/xsk/assembler.cpp deleted file mode 100644 index 5d2e0998..00000000 --- a/src/h2/xsk/assembler.cpp +++ /dev/null @@ -1,555 +0,0 @@ -// 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 "h2.hpp" - -namespace xsk::gsc::h2 -{ - -auto assembler::output_script() -> std::vector -{ - std::vector script; - - if (script_ == nullptr) return script; - - script.resize(script_->pos()); - std::memcpy(script.data(), script_->buffer().data(), script.size()); - - return script; -} - -auto assembler::output_stack() -> std::vector -{ - std::vector stack; - - if (stack_ == nullptr) return stack; - - stack.resize(stack_->pos()); - std::memcpy(stack.data(), stack_->buffer().data(), stack.size()); - - return stack; -} - -void assembler::assemble(const std::string& file, std::vector& data) -{ - std::vector assembly = utils::string::clean_buffer_lines(data); - std::vector functions; - function::ptr func = nullptr; - std::uint32_t index = 1; - std::uint16_t switchnum = 0; - - for (auto& line : assembly) - { - if (line == "" || line.substr(0, 2) == "//") - { - continue; - } - else if (line.substr(0, 4) == "sub_") - { - func = std::make_unique(); - func->index = index; - func->name = line.substr(4); - } - else if (line.substr(0, 4) == "end_") - { - if (func != nullptr) - { - func->size = index - func->index; - functions.push_back(std::move(func)); - } - } - else if (line.substr(0, 4) == "loc_") - { - func->labels[index] = line; - } - else - { - auto opdata = utils::string::parse_code(line); - - if (switchnum) - { - if (opdata[0] == "case" || opdata[0] == "default") - { - for (auto& entry : opdata) - { - func->instructions.back()->data.push_back(entry); - } - switchnum--; - continue; - } - - throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); - } - else - { - auto inst = std::make_unique(); - inst->index = index; - inst->opcode = resolver::opcode_id(opdata[0]); - inst->size = opcode_size(inst->opcode); - opdata.erase(opdata.begin()); - inst->data = std::move(opdata); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = inst->data[0].substr(4); - break; - case opcode::OP_endswitch: - switchnum = static_cast(std::stoi(inst->data[0])); - inst->size += 7 * switchnum; - break; - default: - break; - } - - index += inst->size; - func->instructions.push_back(std::move(inst)); - } - } - } - - assemble(file, functions); -} - -void assembler::assemble(const std::string& file, std::vector& funcs) -{ - script_ = std::make_unique(0x100000); - stack_ = std::make_unique(0x100000); - filename_ = file; - functions_ = std::move(funcs); - - script_->write(static_cast(opcode::OP_End)); - - for (const auto& func : functions_) - { - assemble_function(func); - } -} - -void assembler::assemble_function(const function::ptr& func) -{ - labels_ = func->labels; - - func->id = resolver::token_id(func->name); - - stack_->write(func->size); - stack_->write(static_cast(func->id)); - - if (func->id == 0) - { - stack_->write_c_string(func->name); - } - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->write(std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->write(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - 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(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_GetAnimation: - script_->write(0); - script_->write(0); - stack_->write_c_string(inst->data[0]); - stack_->write_c_string(inst->data[1]); - break; - case opcode::OP_GetAnimTree: - script_->write(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_waittillmatch: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - assemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - assemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - assemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - assemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - assemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - assemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - assemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - assemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - assemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - assemble_jump(inst, false, true); - break; - case opcode::OP_jump: - assemble_jump(inst, false, false); - break; - case opcode::OP_switch: - assemble_switch(inst); - break; - case opcode::OP_endswitch: - assemble_end_switch(inst); - break; - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } - - const auto id = method ? resolver::method_id(inst->data[0]) : resolver::function_id(inst->data[0]); - - script_->write(id); -} - -void assembler::assemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto addr = resolve_function(inst->data[0]); - const auto offset = static_cast(addr - inst->index - 1); - - assemble_offset(offset); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } -} - -void assembler::assemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->write(0); - script_->write(0); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[2]))); - } - - const auto file_id = resolver::token_id(inst->data[0]); - const auto func_id = resolver::token_id(inst->data[1]); - - stack_->write(file_id); - if (file_id == 0) stack_->write_c_string(inst->data[0]); - stack_->write(func_id); - if (func_id == 0) stack_->write_c_string(inst->data[1]); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const auto addr = resolve_label(inst->data[0]); - - script_->write(addr - inst->index - 4); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - - script_->write(static_cast(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); - stack_->write_c_string(inst->data[1 + (3 * i) + 1]); - } - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 2]); - - assemble_offset(addr - index); - - index += 3; - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write(0); - stack_->write_c_string("\x01"); - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 1]); - - assemble_offset(addr - index); - - index += 3; - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::assemble_field_variable(const instruction::ptr& inst) -{ - auto id = resolver::token_id(inst->data[0]); - - if (id == 0) id = 0xFFFF; - - script_->write(id); - - if (id > max_string_id) - { - stack_->write(0); - stack_->write_c_string(inst->data[0]); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - const auto addr = resolve_label(inst->data[0]); - - if (expr) - { - script_->write(static_cast(addr - inst->index - 3)); - } - else if (back) - { - script_->write(static_cast((inst->index + 3) - addr)); - } - else - { - script_->write(static_cast(addr - inst->index - 5)); - } -} - -void assembler::assemble_offset(std::int32_t offset) -{ - std::array bytes = {}; - - offset = (offset << 8) >> 8; - - *reinterpret_cast(bytes.data()) = offset; - - script_->write(bytes[0]); - script_->write(bytes[1]); - script_->write(bytes[2]); -} - -auto assembler::resolve_function(const std::string& name) -> std::int32_t -{ - for (const auto& entry : functions_) - { - if (entry->name == name) - { - return entry->index; - } - } - - throw asm_error("couldn't resolve local function address of '" + name + "'!"); -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/assembler.hpp b/src/h2/xsk/assembler.hpp deleted file mode 100644 index fd89bea1..00000000 --- a/src/h2/xsk/assembler.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::h2 -{ - -class assembler : public gsc::assembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output_script() -> std::vector; - auto output_stack() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, std::vector& funcs); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void assemble_local_call(const instruction::ptr& inst, bool thread); - void assemble_far_call(const instruction::ptr& inst, bool thread); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void assemble_field_variable(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst, bool expr, bool back); - void assemble_offset(std::int32_t offset); - auto resolve_function(const std::string& name) -> std::int32_t; - auto resolve_label(const std::string& name) -> std::int32_t; -}; - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/compiler.cpp b/src/h2/xsk/compiler.cpp deleted file mode 100644 index b750a4f7..00000000 --- a/src/h2/xsk/compiler.cpp +++ /dev/null @@ -1,2970 +0,0 @@ -// 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 "h2.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -namespace xsk::gsc::h2 -{ - -auto compiler::output() -> std::vector -{ - return std::move(assembly_); -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "an unknown error ocurred while parsing gsc file"); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_.clear(); - includes_.clear(); - animtrees_.clear(); - constants_.clear(); - local_functions_.clear(); - index_ = 1; - 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& inc : includes_) - { - if (inc.name == path) - { - throw comp_error(include->loc(), "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(), "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 developer block comment"); - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) -{ - const auto itr = constants_.find(constant->name->value); - - if (itr != constants_.end()) - throw comp_error(constant->loc(), "duplicated constant '" + constant->name->value + "'"); - - 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; - - auto blk = std::make_unique(); - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - break_blks_.clear(); - continue_blks_.clear(); - - process_thread(thread, blk); - - emit_expr_parameters(thread->params, blk); - emit_stmt_list(thread->stmt, blk, true); - emit_opcode(opcode::OP_End); - - function_->size = index_ - function_->index; - assembly_.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list, blk, last); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev, blk, last); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend, blk); - break; - case ast::kind::stmt_waitframe: - emit_stmt_waitframe(stmt.as_waitframe, blk); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if, blk, last); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse, blk, last); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case, blk); - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default, blk); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return, blk); - break; - case ast::kind::stmt_breakpoint: - emit_stmt_breakpoint(stmt.as_breakpoint, blk); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin, blk); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end, blk); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last) -{ - for (const auto& entry : stmt->list) - { - bool last_ = (&entry == &stmt->list.back() && last) ? true : false; - emit_stmt(entry, blk, last_); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last) -{ - emit_stmt_list(stmt->list, blk, last); -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - 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, const block::ptr& blk) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, blk, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, blk, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_endon); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } - - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->time, blk); - emit_opcode(opcode::OP_wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittill); - - for (const auto& entry : stmt->args->list) - { - variable_create(entry.as_identifier, blk); - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(entry.as_identifier, blk)); - } - - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - emit_expr_arguments(stmt->args, blk); - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_waittillmatch2); - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waittillFrameEnd); -} - -void compiler::emit_stmt_waitframe(const ast::stmt_waitframe::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waitFrame); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - blk->transfer(stmt->blk); - - emit_stmt(stmt->stmt, stmt->blk, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last) -{ - std::vector childs; - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - blk->transfer(stmt->blk_if); - - emit_stmt(stmt->stmt_if, stmt->blk_if, last); - - emit_remove_local_vars(stmt->blk_if); - - if (stmt->blk_if->abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - - last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - - blk->transfer(stmt->blk_else); - - emit_stmt(stmt->stmt_else, stmt->blk_else, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk_else); - - if (stmt->blk_else->abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - - insert_label(end_loc); - - blk->init_from_child(childs); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_stmt(stmt->init, blk, false); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->blk_iter); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - can_break_ = true; - can_continue_ = true; - - emit_stmt(stmt->stmt, stmt->blk, false); - - if (stmt->blk->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->blk.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->blk_iter->init_from_child(continue_blks_); - - emit_stmt(stmt->iter, stmt->blk_iter, false); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_expr(stmt->array_expr, blk); - emit_expr_variable_ref(stmt->array, blk, true); - emit_expr_variable(stmt->array, blk); - emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); - emit_expr_variable_ref(stmt->key_expr, blk, true); - - blk->transfer(stmt->ctx); - stmt->ctx->loc_break = break_loc; - stmt->ctx->loc_continue = continue_loc; - - emit_create_local_vars(stmt->ctx); - - blk->local_vars_create_count = stmt->ctx->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->ctx_post); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr, blk); - emit_opcode(opcode::OP_CallBuiltin1, "isdefined"); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr, stmt->ctx); - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->array.as_identifier, stmt->ctx)); - emit_expr_variable_ref(stmt->value_expr, stmt->ctx, true); - emit_stmt(stmt->stmt, stmt->ctx, false); - - if (stmt->ctx->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->ctx.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->ctx_post->init_from_child(continue_blks_); - - emit_expr_variable(stmt->key_expr, stmt->ctx_post); - emit_expr_variable(stmt->array, stmt->ctx_post); - emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); - emit_expr_variable_ref(stmt->key_expr, stmt->ctx_post, true); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - emit_expr_clear_local(stmt->array.as_identifier, blk); - if (!stmt->use_key) emit_expr_clear_local(stmt->key_expr.as_identifier, blk); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_break = can_break_; - break_blks_.clear(); - can_break_ = false; - - auto jmptable_loc = create_label(); - auto break_loc = create_label(); - - emit_expr(stmt->test, blk); - 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; - block* default_ctx = nullptr; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - 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"); - } - - blk->transfer(case_->blk); - case_->blk->loc_break = break_loc; - emit_stmt_list(case_->stmt, case_->blk, false); - if (case_->stmt->list.size() > 0) - emit_remove_local_vars(case_->blk); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - - has_default = true; - default_ctx = entry.as_default->blk.get(); - - blk->transfer(entry.as_default->blk); - entry.as_default->blk->loc_break = break_loc; - emit_stmt_list(entry.as_default->stmt, entry.as_default->blk, false); - if (entry.as_default->stmt->list.size() > 0) - emit_remove_local_vars(entry.as_default->blk); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - } - blk->init_from_child(break_blks_); - } - - insert_label(jmptable_loc); - - emit_opcode(opcode::OP_endswitch, data); - - auto offset = static_cast(7 * stmt->stmt->list.size()); - function_->instructions.back()->size += offset; - index_ += offset; - - insert_label(break_loc); - - can_break_ = old_break; - break_blks_ = old_breaks; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) -{ - if (!can_break_ || blk->abort != abort_t::abort_none || blk->loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - break_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_break; - emit_opcode(opcode::OP_jump, blk->loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) -{ - if (!can_continue_ || blk->abort != abort_t::abort_none || blk->loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - continue_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_continue; - emit_opcode(opcode::OP_jump, blk->loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - blk->abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr, blk); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child, blk); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate, blk); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference, blk); - break; - case ast::kind::expr_add_array: - emit_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_thisthread: - emit_opcode(opcode::OP_GetThisthread); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - 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, blk); - 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, const block::ptr& blk) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue, blk); - } - else if (expr->lvalue == ast::kind::expr_tuple) - { - emit_expr(expr->rvalue, blk); - emit_expr_tuple(expr->lvalue.as_tuple, blk); - } - else - { - emit_expr(expr->rvalue, blk); - emit_expr_variable_ref(expr->lvalue, blk, true); - } - - return; - } - - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - 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_mod); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_ex_or); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, blk, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key, blk); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, blk, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj, blk); - 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, blk, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk) -{ - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); - else - emit_opcode(opcode::OP_ClearLocalVariableFieldCached, variable_access_index(expr, blk)); -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_inc); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_dec); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr, blk); - emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr, blk); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_equality); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_inequality); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_less); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_greater); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_less_equal); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_greater_equal); - 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_ex_or); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_mod); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt && mode_ == gsc::build::prod) - { - const auto& name = expr->name->value; - if (name == "assert" || name == "assertex" || name == "assertmsg") return; - } - - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal && expr->args->list.size() > 0) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptLocalFunctionCall, expr->name->value); - else - emit_opcode(opcode::OP_ScriptLocalFunctionCall2, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptFarFunctionCall, { expr->path->value, expr->name->value }); - else - emit_opcode(opcode::OP_ScriptFarFunctionCall2, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltin0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltin1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltin2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltin3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltin4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltin5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltin, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptLocalMethodCall, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFarMethodCall, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltinMethod0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltinMethod1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltinMethod2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltinMethod3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltinMethod4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltinMethod5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltinMethod, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_EmptyArray); - - for (const auto& arg : expr->args->list) - { - emit_expr(arg, blk); - emit_opcode(opcode::OP_AddArray); - } -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) -{ - for (const auto& entry : expr->list) - { - variable_initialize(entry, blk); - emit_opcode(opcode::OP_SafeCreateVariableFieldCached, variable_create_index(entry, blk)); - } - - emit_opcode(opcode::OP_checkclearparams); -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry, blk); - } -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) -{ - bool method = false; - auto type = resolve_reference_type(expr, method); - - switch (type) - { - case ast::call::type::local: - emit_opcode(opcode::OP_GetLocalFunction, expr->name->value); - break; - case ast::call::type::far: - emit_opcode(opcode::OP_GetFarFunction, { expr->path->value, expr->name->value }); - break; - case ast::call::type::builtin: - if (method) - emit_opcode(opcode::OP_GetBuiltinMethod, expr->name->value); - else - emit_opcode(opcode::OP_GetBuiltinFunction, expr->name->value); - break; - } -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_size); -} - -void compiler::emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - emit_expr_variable_ref(expr->temp, blk, true); - - auto index = 0; - - for (const auto& entry : expr->list) - { - if (index == 0) - emit_opcode(opcode::OP_GetZero); - else - emit_opcode(opcode::OP_GetByte, utils::string::va("%d", index)); - - index++; - - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->temp.as_identifier, blk)); - - emit_expr_variable_ref(entry, blk, true); - } - - emit_expr_clear_local(expr->temp.as_identifier, blk); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, blk, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, blk, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, blk, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set) -{ - emit_expr(expr->key, blk); - - 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, blk, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - { - if (!variable_initialized(expr->obj.as_identifier, blk)) - { - variable_initialize(expr->obj.as_identifier, blk); - emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(expr->obj.as_identifier, blk)); - - if (!set) throw comp_error(expr->loc(), "INTERNAL: VAR CREATED BUT NOT SET!"); - } - else if (variable_stack_index(expr->obj.as_identifier, blk) == 0) - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached0); - } - else - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access_index(expr->obj.as_identifier, blk)); - } - - 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, const block::ptr& blk, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); - break; - case ast::kind::expr_anim: - set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); - break; - case ast::kind::expr_self: - set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - 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, blk); - 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_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, 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 + "'"); - } - - if (set) - { - if (!variable_initialized(expr, blk)) - { - variable_initialize(expr, blk); - emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(expr, blk)); - } - else if (variable_stack_index(expr, blk) == 0) - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached0); - } - else - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached, variable_access_index(expr, blk)); - } - } - else - { - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_EvalLocalVariableRefCached0); - else - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access_index(expr, blk)); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->key, blk); - - if (expr->obj == ast::kind::expr_identifier) - { - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->obj.as_identifier, blk)); - } - else - { - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_EvalArray); - } -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_EvalLevelFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_EvalAnimFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_EvalSelfFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, const block::ptr& blk) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - emit_expr(itr->second, blk); - return; - } - - // is local var - auto index = variable_stack_index(expr, blk); - - switch (index) - { - case 0: - emit_opcode(opcode::OP_EvalLocalVariableCached0); - break; - case 1: - emit_opcode(opcode::OP_EvalLocalVariableCached1); - break; - case 2: - emit_opcode(opcode::OP_EvalLocalVariableCached2); - break; - case 3: - emit_opcode(opcode::OP_EvalLocalVariableCached3); - break; - case 4: - emit_opcode(opcode::OP_EvalLocalVariableCached4); - break; - case 5: - emit_opcode(opcode::OP_EvalLocalVariableCached5); - break; - default: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access_index(expr, blk)); - break; - } -} - -void compiler::emit_expr_object(const ast::expr& expr, const block::ptr& blk) -{ - 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, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr.as_identifier, blk)); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk) -{ - std::vector data; - - bool isexpr = false; - - 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, blk); - emit_expr(expr->y, blk); - emit_expr(expr->x, blk); - 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(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimation, { "", expr->value }); - } - else - { - emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); - tree.loaded = true; - } -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error(expr->loc(), "trying to use animtree without specified using animtree"); - } - - auto& tree = animtrees_.back(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimTree, ""); - } - else - { - emit_opcode(opcode::OP_GetAnimTree, tree.name); - tree.loaded = true; - } -} - -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_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_create_local_vars(const block::ptr& blk) -{ - if (blk->local_vars_create_count != blk->local_vars_public_count) - { - for (auto i = blk->local_vars_create_count; i < blk->local_vars_public_count; i++) - { - auto data = utils::string::va("%d", blk->local_vars.at(i).create); - emit_opcode(opcode::OP_CreateLocalVariable, data); - blk->local_vars.at(i).init = true; - } - blk->local_vars_create_count = blk->local_vars_public_count; - } -} - -void compiler::emit_remove_local_vars(const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - auto count = blk->local_vars_create_count - blk->local_vars_public_count; - - if (count > 0) - { - auto data = utils::string::va("%d", count); - emit_opcode(opcode::OP_RemoveLocalVariables, data); - } - } -} - -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, const block::ptr& blk) -{ - process_expr_parameters(decl->params, blk); - process_stmt_list(decl->stmt, blk); -} - -void compiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - 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_waitframe: - case ast::kind::stmt_case: - case ast::kind::stmt_default: - 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, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk) -{ - process_stmt_list(stmt->list, blk); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - 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, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - blk->merge(childs); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - stmt->blk_if = std::make_unique(); - stmt->blk_else = std::make_unique(); - - blk->copy(stmt->blk_if); - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - blk->copy(stmt->blk_else); - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - blk->merge(childs); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - stmt->blk = std::make_unique(); - stmt->blk_iter = std::make_unique(); - - process_stmt(stmt->init, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->blk); - blk->copy(stmt->blk_iter); - - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_stmt(stmt->iter, stmt->blk_iter); - - blk->append({ stmt->blk_iter.get() }); - blk->merge({ stmt->blk_iter.get() }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get()} ); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto array_name = utils::string::va("_temp_%d", ++label_idx_); - auto key_name = utils::string::va("_temp_%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; - - // calculate variables - - stmt->ctx = std::make_unique(); - stmt->ctx_post = std::make_unique(); - - // calculate pre_expr variables - process_expr(stmt->array, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->ctx); - blk->copy(stmt->ctx_post); - - // calculate stmt variables & add missing array access as first stmt - process_expr(stmt->value_expr, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - continue_blks_.push_back(stmt->ctx.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_expr(stmt->key_expr, stmt->ctx_post); - - blk->append({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - // calculate variables - stmt->ctx = std::make_unique(); - std::vector childs; - auto abort = abort_t::abort_return; - bool has_default = false; - block* default_ctx = nullptr; - auto old_breaks = break_blks_; - break_blks_.clear(); - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->copy(entry.as_case->blk); - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort != abort_t::abort_none) - { - if (entry.as_case->blk->abort == abort_t::abort_break ) - { - entry.as_case->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_case->blk.get()); - } - else if (entry.as_case->blk->abort <= abort ) - { - abort = entry.as_case->blk->abort; - } - } - } - else if (entry == ast::kind::stmt_default) - { - entry.as_default->blk = std::make_unique(); - blk->copy(entry.as_default->blk); - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - has_default = true; - default_ctx = entry.as_default->blk.get(); - - if (entry.as_default->blk->abort != abort_t::abort_none) - { - if (entry.as_default->blk->abort == abort_t::abort_break ) - { - entry.as_default->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_default->blk.get()); - } - else if (entry.as_default->blk->abort <= abort ) - { - abort = entry.as_default->blk->abort; - } - } - } - } - - stmt->stmt =std::move(stmt_list); - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - } - - blk->append(break_blks_); - blk->merge(childs); - } - - break_blks_ = old_breaks; -} - -void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - break_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_break; - } -} - -void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - continue_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_continue; - } -} - -void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } -} - -void compiler::process_expr(const ast::expr& expr, const block::ptr& blk) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value, blk); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj, blk); - } - else if (expr == ast::kind::expr_tuple) - { - process_expr_tuple(expr.as_tuple, blk); - } -} - -void compiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - auto array = utils::string::va("_temp_%d", ++label_idx_); - expr->temp = ast::expr(std::make_unique(expr->loc(), array)); - - process_expr(expr->temp, blk); - - for (const auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk) -{ - for (const auto& entry : decl->list) - { - variable_register(entry->value, blk); - } -} - -void compiler::variable_register(const std::string& name, const block::ptr& blk) -{ - auto it = std::find_if (blk->local_vars.begin(), blk->local_vars.end(), - [&](const gsc::local_var& v) { return v.name == name; }); - - if (it == blk->local_vars.end()) - { - auto found = false; - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - blk->local_vars.push_back({ name, static_cast(i), false }); - found = true; - break; - } - } - - if (!found) - { - blk->local_vars.push_back({ name, stack_idx_, false }); - local_stack_.push_back(name); - stack_idx_++; - } - } -} - -void compiler::variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::uint32_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (!blk->local_vars[i].init) - { - for (std::uint32_t j = 0; j < i; j++) - { - if (!blk->local_vars[j].init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", blk->local_vars[j].create)); - blk->local_vars[j].init = true; - } - } - blk->local_vars[i].init = true; - blk->local_vars_create_count = i + 1; - return; - } - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -void compiler::variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - auto& var = blk->local_vars.at(i); - if (var.name == name->value) - { - if (!var.init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); - var.init = true; - blk->local_vars_create_count++; - } - return; - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return static_cast(blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - return utils::string::va("%d", blk->local_vars[i].create); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return utils::string::va("%d", blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - return blk->local_vars.at(i).init; - } - } - - 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_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jump: - case opcode::OP_jumpback: - case opcode::OP_switch: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_endswitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - -auto compiler::map_known_includes(const std::string&) -> bool -{ - return false; -} - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/compiler.hpp b/src/h2/xsk/compiler.hpp deleted file mode 100644 index 18ec681c..00000000 --- a/src/h2/xsk/compiler.hpp +++ /dev/null @@ -1,160 +0,0 @@ -// 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::gsc::h2 -{ - -enum class opcode : std::uint8_t; - -class compiler : public gsc::compiler -{ - build mode_; - std::string filename_; - std::vector assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector break_blks_; - std::vector continue_blks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - -public: - auto output() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_constant(const ast::decl_constant::ptr& constant); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last); - void emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void emit_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt, const block::ptr& blk); - void emit_stmt_waitframe(const ast::stmt_waitframe::ptr& stmt, const block::ptr& blk); - void emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk); - void emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk); - void emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk); - void emit_expr(const ast::expr& expr, const block::ptr& blk); - void emit_expr_assign(const ast::expr_assign::ptr& expr, const block::ptr& blk); - void emit_expr_clear(const ast::expr& expr, const block::ptr& blk); - void emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk); - void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk); - void emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_variable(const ast::expr& expr, const block::ptr& blk); - void emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void emit_expr_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_object(const ast::expr& expr, const block::ptr& blk); - void emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_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_create_local_vars(const block::ptr& blk); - void emit_remove_local_vars(const block::ptr& blk); - 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, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(const ast::expr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk); - void variable_register(const std::string& name, const block::ptr& blk); - void variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk); - void variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk); - auto variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t; - auto variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool; - 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; -}; - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/context.cpp b/src/h2/xsk/context.cpp deleted file mode 100644 index a1bf69bd..00000000 --- a/src/h2/xsk/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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 "h2.hpp" - -namespace xsk::gsc::h2 -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/context.hpp b/src/h2/xsk/context.hpp deleted file mode 100644 index 2b83d15f..00000000 --- a/src/h2/xsk/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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::gsc::h2 -{ - -class context : public gsc::context -{ - h2::assembler assembler_; - h2::disassembler disassembler_; - h2::compiler compiler_; - h2::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { return assembler_; } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { return compiler_; } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/decompiler.cpp b/src/h2/xsk/decompiler.cpp deleted file mode 100644 index e0916cee..00000000 --- a/src/h2/xsk/decompiler.cpp +++ /dev/null @@ -1,3442 +0,0 @@ -// 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 "h2.hpp" - -namespace xsk::gsc::h2 -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// H2 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetLocalFunction: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalFunctionCall2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - 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_ScriptLocalFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalMethodCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodChildThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall2: - { - 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 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_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin1: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin3: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin4: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin5: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod1: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod2: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod3: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod4: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod5: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_waitFrame: - { - auto stmt = ast::stmt(std::make_unique(loc)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_waittill: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto args = std::make_unique(loc); - auto node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // continue is at jumpback, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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 - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - auto use_key = true; - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - use_key = false; - } - - 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)), use_key)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(std::stoi(entry->value.substr(4))), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - auto var = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - auto var1 = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); - blk->local_vars_create_count++; - } - - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/decompiler.hpp b/src/h2/xsk/decompiler.hpp deleted file mode 100644 index b522f609..00000000 --- a/src/h2/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::h2 -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/disassembler.cpp b/src/h2/xsk/disassembler.cpp deleted file mode 100644 index e27727ef..00000000 --- a/src/h2/xsk/disassembler.cpp +++ /dev/null @@ -1,575 +0,0 @@ -// 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 "h2.hpp" - -namespace xsk::gsc::h2 -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// H2 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read(); - func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - 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->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetVector: - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(4); - inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); - break; - case opcode::OP_GetAnimation: - script_->seek(8); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - disassemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto id = script_->read(); - const auto name = method ? resolver::method_name(id) : resolver::function_name(id); - inst->data.emplace(inst->data.begin(), name); -} - -void disassembler::disassemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto offset = disassemble_offset(); - - inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(3); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto file_id = stack_->read(); - const auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::token_name(file_id); - const auto func_id = stack_->read(); - const auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); - - inst->data.emplace(inst->data.begin(), func_name); - inst->data.emplace(inst->data.begin(), file_name); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read(); - 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) -{ - const auto count = script_->read(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read(); - - if (value < 0x40000) - { - const auto data = stack_->read_c_string(); - - if (data.data()[0] != 0x01) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(data, false)); - } - else - inst->data.push_back("default"); - } - else - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - index += 4; - - const auto addr = disassemble_offset() + index; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 3; - inst->size += 7; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - const auto id = script_->read(); - std::string name; - - if (id > max_string_id) - { - auto temp = stack_->read(); - name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); - } - else - { - name = resolver::token_name(id); - } - - inst->data.push_back(name); -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read(); - } - else if (back) - { - addr = inst->index + 3 - script_->read(); - } - else - { - addr = inst->index + 5 + script_->read(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -auto disassembler::disassemble_offset() -> std::int32_t -{ - std::array bytes = {}; - - for (auto i = 0; i < 3; i++) - { - bytes[i] = script_->read(); - } - - auto offset = *reinterpret_cast(bytes.data()); - - offset = (offset << 8) >> 8; - - return offset; -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = resolve_function(inst->data[0]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s\n", func->name.data())); - - 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())); - } - - print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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; - } - if (casenum != totalcase - 1) - { - output_->write_string("\n"); - } - } - } - break; - default: - for (auto& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - break; - } - - output_->write_string("\n"); -} - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/disassembler.hpp b/src/h2/xsk/disassembler.hpp deleted file mode 100644 index 2c7989c5..00000000 --- a/src/h2/xsk/disassembler.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc::h2 -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_local_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - auto disassemble_offset() -> std::int32_t; - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/h2.cpp b/src/h2/xsk/h2.cpp deleted file mode 100644 index ae050959..00000000 --- a/src/h2/xsk/h2.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// 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 "h2.hpp" - -namespace xsk::gsc::h2 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - return 1; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_GetAnimTree: - case opcode::OP_GetNegByte: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_GetByte: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_waittillmatch: - return 2; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_GetUnsignedShort: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_jumpback: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - case opcode::OP_JumpOnFalse: - case opcode::OP_endswitch: - return 3; - case opcode::OP_CallBuiltin: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_GetLocalFunction: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarMethodCall: - return 4; - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_GetFloat: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_switch: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - case opcode::OP_jump: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_GetInteger: - case opcode::OP_GetString: - case opcode::OP_GetIString: - return 5; - case opcode::OP_GetAnimation: - return 9; - case opcode::OP_GetVector: - return 13; - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/h2.hpp b/src/h2/xsk/h2.hpp deleted file mode 100644 index 0d0cf256..00000000 --- a/src/h2/xsk/h2.hpp +++ /dev/null @@ -1,183 +0,0 @@ -// 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 "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::h2 -{ - -constexpr std::uint16_t max_string_id = 0xD5D7; - -enum class opcode : std::uint8_t -{ - OP_SetNewLocalVariableFieldCached0 = 0x17, - OP_EvalSelfFieldVariable = 0x18, - OP_Return = 0x19, - OP_CallBuiltin0 = 0x1A, - OP_CallBuiltin1 = 0x1B, - OP_CallBuiltin2 = 0x1C, - OP_CallBuiltin3 = 0x1D, - OP_CallBuiltin4 = 0x1E, - OP_CallBuiltin5 = 0x1F, - OP_CallBuiltin = 0x20, - OP_BoolNot = 0x21, - OP_ScriptFarMethodThreadCall = 0x22, - OP_JumpOnTrueExpr = 0x23, - OP_SetLevelFieldVariableField = 0x24, - OP_CastBool = 0x25, - OP_EvalNewLocalArrayRefCached0 = 0x26, - OP_CallBuiltinPointer = 0x27, - OP_inequality = 0x28, - OP_GetThisthread = 0x29, - OP_ClearFieldVariable = 0x2A, - OP_GetFloat = 0x2B, - OP_SafeCreateVariableFieldCached = 0x2C, - OP_ScriptFarFunctionCall2 = 0x2D, - OP_ScriptFarFunctionCall = 0x2E, - OP_ScriptFarChildThreadCall = 0x2F, - OP_ClearLocalVariableFieldCached0 = 0x30, - OP_ClearLocalVariableFieldCached = 0x31, - OP_checkclearparams = 0x32, - OP_CastFieldObject = 0x33, - OP_End = 0x34, - OP_size = 0x35, - OP_EmptyArray = 0x36, - OP_bit_and = 0x37, - OP_less_equal = 0x38, - OP_voidCodepos = 0x39, - OP_ScriptMethodThreadCallPointer = 0x3A, - OP_endswitch = 0x3B, - OP_ClearVariableField = 0x3C, - OP_divide = 0x3D, - OP_ScriptFarMethodChildThreadCall = 0x3E, - OP_GetUnsignedShort = 0x3F, - OP_JumpOnTrue = 0x40, - OP_GetSelf = 0x41, - OP_ScriptFarThreadCall = 0x42, - OP_ScriptLocalThreadCall = 0x43, - OP_SetLocalVariableFieldCached0 = 0x44, - OP_SetLocalVariableFieldCached = 0x45, - OP_plus = 0x46, - OP_BoolComplement = 0x47, - OP_ScriptMethodCallPointer = 0x48, - OP_inc = 0x49, - OP_RemoveLocalVariables = 0x4A, - OP_JumpOnFalseExpr = 0x4B, - OP_switch = 0x4C, - OP_clearparams = 0x4D, - OP_EvalLocalVariableRefCached0 = 0x4E, - OP_EvalLocalVariableRefCached = 0x4F, - OP_ScriptLocalMethodCall = 0x50, - OP_EvalFieldVariable = 0x51, - OP_EvalFieldVariableRef = 0x52, - OP_GetString = 0x53, - OP_ScriptFunctionCallPointer = 0x54, - OP_EvalLevelFieldVariable = 0x55, - OP_GetVector = 0x56, - OP_endon = 0x57, - OP_greater_equal = 0x58, - OP_GetSelfObject = 0x59, - OP_SetAnimFieldVariableField = 0x5A, - OP_SetVariableField = 0x5B, - OP_ScriptLocalFunctionCall2 = 0x5C, - OP_ScriptLocalFunctionCall = 0x5D, - OP_EvalLocalArrayRefCached0 = 0x5E, - OP_EvalLocalArrayRefCached = 0x5F, - OP_GetFarFunction = 0x60, - OP_less = 0x61, - OP_GetGameRef = 0x62, - OP_waittillFrameEnd = 0x63, - OP_waitFrame = 0x64, - OP_SafeSetVariableFieldCached0 = 0x65, - OP_SafeSetVariableFieldCached = 0x66, - OP_ScriptMethodChildThreadCallPointer = 0x67, - OP_GetLevel = 0x68, - OP_notify = 0x69, - OP_DecTop = 0x6A, - OP_shift_left = 0x6B, - OP_ScriptLocalMethodThreadCall = 0x6C, - OP_ScriptLocalMethodChildThreadCall = 0x6D, - OP_greater = 0x6E, - OP_EvalLocalVariableCached0 = 0x6F, - OP_EvalLocalVariableCached1 = 0x70, - OP_EvalLocalVariableCached2 = 0x71, - OP_EvalLocalVariableCached3 = 0x72, - OP_EvalLocalVariableCached4 = 0x73, - OP_EvalLocalVariableCached5 = 0x74, - OP_EvalLocalVariableCached = 0x75, - OP_SafeSetWaittillVariableFieldCached = 0x76, - OP_jump = 0x77, - OP_ScriptThreadCallPointer = 0x78, - OP_GetZero = 0x79, - OP_wait = 0x7A, - OP_minus = 0x7B, - OP_SetSelfFieldVariableField = 0x7C, - OP_EvalNewLocalVariableRefCached0 = 0x7D, - OP_multiply = 0x7E, - OP_CreateLocalVariable = 0x7F, - OP_ScriptLocalChildThreadCall = 0x80, - OP_GetInteger = 0x81, - OP_mod = 0x82, - OP_EvalAnimFieldVariableRef = 0x83, - OP_GetBuiltinFunction = 0x84, - OP_GetGame = 0x85, - OP_waittill = 0x86, - OP_dec = 0x87, - OP_EvalLocalVariableObjectCached = 0x88, - OP_PreScriptCall = 0x89, - OP_GetAnim = 0x8A, - OP_GetUndefined = 0x8B, - OP_EvalLevelFieldVariableRef = 0x8C, - OP_GetAnimObject = 0x8D, - OP_GetLevelObject = 0x8E, - OP_bit_ex_or = 0x8F, - OP_equality = 0x90, - OP_ClearArray = 0x91, - OP_jumpback = 0x92, - OP_GetAnimation = 0x93, - OP_EvalAnimFieldVariable = 0x94, - OP_GetAnimTree = 0x95, - OP_GetIString = 0x96, - OP_EvalArrayRef = 0x97, - OP_EvalSelfFieldVariableRef = 0x98, - OP_GetNegByte = 0x99, - OP_GetBuiltinMethod = 0x9A, - OP_CallBuiltinMethodPointer = 0x9B, - OP_EvalArray = 0x9C, - OP_vector = 0x9D, - OP_ScriptFarMethodCall = 0x9E, - OP_EvalLocalArrayCached = 0x9F, - OP_GetByte = 0xA0, - OP_ScriptChildThreadCallPointer = 0xA1, - OP_bit_or = 0xA2, - OP_AddArray = 0xA3, - OP_waittillmatch2 = 0xA4, - OP_waittillmatch = 0xA5, - OP_GetLocalFunction = 0xA6, - OP_GetNegUnsignedShort = 0xA7, - OP_shift_right = 0xA8, - OP_CallBuiltinMethod0 = 0xA9, - OP_CallBuiltinMethod1 = 0xAA, - OP_CallBuiltinMethod2 = 0xAB, - OP_CallBuiltinMethod3 = 0xAC, - OP_CallBuiltinMethod4 = 0xAD, - OP_CallBuiltinMethod5 = 0xAE, - OP_CallBuiltinMethod = 0xAF, - OP_JumpOnFalse = 0xB0, - OP_Count = 0xB1, -}; - -auto opcode_size(std::uint8_t op) -> std::uint32_t; - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/lexer.cpp b/src/h2/xsk/lexer.cpp deleted file mode 100644 index 9009c814..00000000 --- a/src/h2/xsk/lexer.cpp +++ /dev/null @@ -1,849 +0,0 @@ -// 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 "h2.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -xsk::gsc::h2::parser::symbol_type H2lex(xsk::gsc::h2::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::gsc::h2 -{ - -const std::unordered_map keyword_map -{{ - { "#define", parser::token::SH_DEFINE }, - { "#undef", parser::token::SH_UNDEF }, - { "#ifdef", parser::token::SH_IFDEF }, - { "#ifndef", parser::token::SH_IFNDEF }, - { "#if", parser::token::SH_IF }, - { "#elif", parser::token::SH_ELIF }, - { "#else", parser::token::SH_ELSE }, - { "#endif", parser::token::SH_ENDIF }, - { "#inline", parser::token::INLINE }, - { "#include", parser::token::INCLUDE }, - { "#using_animtree", parser::token::USINGTREE }, - { "#animtree", parser::token::ANIMTREE }, - { "endon", parser::token::ENDON }, - { "notify", parser::token::NOTIFY }, - { "wait", parser::token::WAIT }, - { "waittill", parser::token::WAITTILL }, - { "waittillmatch", parser::token::WAITTILLMATCH }, - { "waittillframeend", parser::token::WAITTILLFRAMEEND }, - { "waitframe", parser::token::WAITFRAME }, - { "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 }, - { "childthread", parser::token::CHILDTHREAD }, - { "thisthread", parser::token::THISTHREAD }, - { "call", parser::token::CALL }, - { "true", parser::token::TRUE }, - { "false", parser::token::FALSE }, - { "undefined", parser::token::UNDEFINED }, - { "size", parser::token::SIZE }, - { "game", parser::token::GAME }, - { "self", parser::token::SELF }, - { "anim", parser::token::ANIM }, - { "level", parser::token::LEVEL }, -}}; - -buffer::buffer() : length(0) -{ - data = static_cast(std::malloc(max_buf_size)); -} - -buffer::~buffer() -{ - if (data) std::free(data); -} - -bool buffer::push(char c) -{ - if (length >= max_buf_size) - return false; - - data[length++] = c; - return true; -} - -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) -{ - -} - -void reader::init(const char* data, size_t size) -{ - if (data && size) - { - state = reader::ok; - buffer_pos = data; - bytes_remaining = static_cast(size); - last_byte = 0; - current_byte = *data; - } - else - { - state = reader::end; - buffer_pos = 0; - bytes_remaining = 0; - last_byte = 0; - current_byte = 0; - } -} - -void reader::advance() -{ - ++buffer_pos; - - if (bytes_remaining-- == 1) - { - state = reader::end; - bytes_remaining = 0; - last_byte = current_byte; - current_byte = 0; - } - else - { - last_byte = current_byte; - current_byte = *buffer_pos; - } -} - -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) -{ - reader_.init(data, size); -} - -void lexer::push_header(const std::string& file) -{ - try - { - if (header_top_++ >= 10) - throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - - auto data = resolver::file_data(file + ".gsh"); - - readers_.push(reader_); - locs_.push(loc_); - loc_.initialize(std::get<0>(data)); - reader_.init(std::get<1>(data), std::get<2>(data)); - clean_ = true; - } - catch (const std::exception& e) - { - throw error("parsing header file '" + file + "': " + e.what()); - } -} - -void lexer::pop_header() -{ - header_top_--; - loc_ = locs_.top(); - locs_.pop(); - reader_ = readers_.top(); - readers_.pop(); -} - -void lexer::ban_header(const location& loc) -{ - if (header_top_ > 0) - { - throw comp_error(loc, "not allowed inside a gsh file"); - } -} - -auto lexer::lex() -> parser::symbol_type -{ - buffer_.length = 0; - state_ = state::start; - - while (true) - { - const auto& state = reader_.state; - auto& last = reader_.last_byte; - auto& curr = reader_.current_byte; - auto path = false; - loc_.step(); - - if (state == reader::end) - { - if (indev_) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (header_top_ > 0) - pop_header(); - else - return parser::make_H2EOF(loc_); - } - - if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') - clean_ = false; - - advance(); - - switch (last) - { - case ' ': - case '\t': - case '\r': - loc_.step(); - continue; - case '\n': - loc_.lines(); - loc_.step(); - clean_ = true; - continue; - case '\\': - throw comp_error(loc_, "invalid token ('\\')"); - case '/': - if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') - return parser::make_DIV(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_DIV(loc_); - - if (last == '#') - { - if (indev_) - throw comp_error(loc_, "cannot recurse devblock ('/#')"); - - if (mode_ == build::dev) - { - indev_ = true; - return parser::make_DEVBEGIN(loc_); - } - else - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '#' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - } - else if (last == '@') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched script doc comment start ('/@')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '@' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '*') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched multiline comment start ('/*')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '*' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '/') - { - while (true) - { - if (state == reader::end) - break; - - if (curr == '\n') - break; - - advance(); - } - } - continue; - case '#': - if (curr == '/') - { - if (!indev_) - throw comp_error(loc_, "unmatched devblock end ('#/')"); - - advance(); - indev_ = false; - return parser::make_DEVEND(loc_); - } - - buffer_.push(last); - advance(); - - while (state == reader::ok) - { - if (last != ' ' || last != '\t') - break; - - advance(); - } - - if (state == reader::end || !((last > 64 && last < 91) || (last > 96 && last < 123))) - throw comp_error(loc_, "invalid preprocessor directive ('#')"); - - state_ = state::preprocessor; - goto lex_name; - case '*': - if (curr != '=' && curr != '/') - return parser::make_MUL(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_MUL(loc_); - - throw comp_error(loc_, "unmatched multiline comment end ('*/')"); - case '"': - state_ = state::string; - goto lex_string; - case '.': - if (curr < '0' || curr > '9') - return parser::make_DOT(loc_); - goto lex_number; - case '(': - return parser::make_LPAREN(loc_); - case ')': - return parser::make_RPAREN(loc_); - case '{': - return parser::make_LBRACE(loc_); - case '}': - return parser::make_RBRACE(loc_); - case '[': - return parser::make_LBRACKET(loc_); - case ']': - return parser::make_RBRACKET(loc_); - case ',': - return parser::make_COMMA(loc_); - case ';': - return parser::make_SEMICOLON(loc_); - case ':': - if (curr != ':') - return parser::make_COLON(loc_); - - advance(); - return parser::make_DOUBLECOLON(loc_); - case '?': - return parser::make_QMARK(loc_); - case '=': - if (curr != '=') - return parser::make_ASSIGN(loc_); - - advance(); - return parser::make_EQUALITY(loc_); - case '+': - if (curr != '+' && curr != '=') - return parser::make_ADD(loc_); - - advance(); - - if (last == '+') - return parser::make_INCREMENT(loc_); - - return parser::make_ASSIGN_ADD(loc_); - case '-': - if (curr != '-' && curr != '=') - return parser::make_SUB(loc_); - - advance(); - - if (last == '-') - return parser::make_DECREMENT(loc_); - - return parser::make_ASSIGN_SUB(loc_); - case '%': - if (curr != '=') - return parser::make_MOD(loc_); - - advance(); - - return parser::make_ASSIGN_MOD(loc_); - case '|': - if (curr != '|' && curr != '=') - return parser::make_BITWISE_OR(loc_); - - advance(); - - if (last == '|') - return parser::make_OR(loc_); - - return parser::make_ASSIGN_BW_OR(loc_); - case '&': - if (curr != '&' && curr != '=' && curr != '"') - return parser::make_BITWISE_AND(loc_); - - advance(); - - if (last == '&') - return parser::make_AND(loc_); - - if (last == '=') - return parser::make_ASSIGN_BW_AND(loc_); - - state_ = state::localize; - goto lex_string; - case '^': - if (curr != '=') - return parser::make_BITWISE_EXOR(loc_); - - advance(); - return parser::make_ASSIGN_BW_EXOR(loc_); - case '!': - if (curr != '=') - return parser::make_NOT(loc_); - - advance(); - return parser::make_INEQUALITY(loc_); - case '~': - return parser::make_COMPLEMENT(loc_); - case '<': - if (curr != '<' && curr != '=') - return parser::make_LESS(loc_); - - advance(); - if (last == '=') - return parser::make_LESS_EQUAL(loc_); - - if (curr != '=') - return parser::make_LSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_LSHIFT(loc_); - case '>': - if (curr != '>' && curr != '=') - return parser::make_GREATER(loc_); - - advance(); - - if (last == '=') - return parser::make_GREATER_EQUAL(loc_); - - if (curr != '=') - return parser::make_RSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_RSHIFT(loc_); - default: - if (last >= '0' && last <= '9') - goto lex_number; - else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) - goto lex_name; - - throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); - } - -lex_string: - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched string start ('\"')"); - - if (curr == '"') - { - advance(); - break; - } - - if (curr == '\n') - throw comp_error(loc_, "unterminated string literal"); - - if (curr == '\\') - { - advance(); - - if (state == reader::end) - throw comp_error(loc_, "invalid token ('\')"); - - char c = curr; - switch (curr) - { - case 't': c = '\t'; break; - case 'r': c = '\r'; break; - case 'n': c = '\n'; break; - case '"': c = '\"'; break; - case '\\': c = '\\'; break; - default: break; - } - - if (!buffer_.push(c)) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); - -lex_name: - buffer_.push(last); - - while (true) - { - if (state == reader::end) - break; - - if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) - break; - - if (curr == '\\') - { - if (last == '\\') - throw comp_error(loc_, "invalid path '\\\\'"); - - path = true; - if (!buffer_.push('/')) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::preprocessor) - { - auto token = parser::token::H2UNDEF; - - if (buffer_.length < 16) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - { - if (itr->second > parser::token::SH_ENDIF) - return parser::symbol_type(itr->second, loc_); - - token = itr->second; - } - } - - preprocessor_run(token); - - state_ = state::start; - continue; - } - else - { - 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_); - } - - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - -lex_number: - if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) - { - buffer_.push(last); - - auto dot = last == '.' ? 1 : 0; - auto flt = 0; - - while (true) - { - if (state == reader::end) - break; - - if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) - throw comp_error(loc_, "invalid number literal"); - - if ((curr == '.' || curr == 'f') && last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr == 'f') - flt++; - else if (curr == '.') - dot++; - else if (!(curr > 47 && curr < 58)) - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f')) - throw comp_error(loc_, "invalid number literal"); - - if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); - } - else if (curr == 'o') - { - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) - throw comp_error(loc_, "invalid octal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!(curr > 47 && curr < 56)) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length <= 0) - throw comp_error(loc_, "invalid octal literal"); - - return parser::make_INTEGER(utils::string::oct_to_dec(buffer_.data), loc_); - } - else if (curr == 'b') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) - throw comp_error(loc_, "invalid binary literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr != '0' && curr != '1') - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid binary literal"); - - return parser::make_INTEGER(utils::string::bin_to_dec(buffer_.data), loc_); - } - else if (curr == 'x') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) - throw comp_error(loc_, "invalid hexadecimal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid hexadecimal literal"); - - return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); - } - - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); - } -} - -void lexer::advance() -{ - reader_.advance(); - loc_.end.column++; - - if (reader_.current_byte == '\\') [[unlikely]] - preprocessor_wrap(); -} - -void lexer::preprocessor_wrap() -{ - while (reader_.current_byte == '\\') - { - if (reader_.bytes_remaining == 1) - throw comp_error(loc_, "invalid token ('\\')"); - - if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') - break; - - if (reader_.buffer_pos[1] == '\r') - { - if (reader_.bytes_remaining <= 3 || reader_.buffer_pos[2] != '\n') - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 3; - reader_.bytes_remaining -= 3; - } - - if ((reader_.buffer_pos[1] == '\n')) - { - if (reader_.bytes_remaining == 2) - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 2; - reader_.bytes_remaining -= 2; - } - - if (reader_.bytes_remaining == 0) - { - reader_.state = reader::end; - reader_.current_byte = 0; - } - else - { - reader_.current_byte = *reader_.buffer_pos; - } - - loc_.lines(); - loc_.step(); - } -} - -void lexer::preprocessor_run(parser::token::token_kind_type token) -{ - if (!clean_) - throw comp_error(loc_, "invalid token ('#')"); - - switch (token) - { - case parser::token::SH_DEFINE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_UNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELSE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ENDIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - default: - throw comp_error(loc_, "unknown preprocessor directive"); - } -} - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/lexer.hpp b/src/h2/xsk/lexer.hpp deleted file mode 100644 index f9efcc7b..00000000 --- a/src/h2/xsk/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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::gsc::h2 -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/parser.cpp b/src/h2/xsk/parser.cpp deleted file mode 100644 index 71ba6e20..00000000 --- a/src/h2/xsk/parser.cpp +++ /dev/null @@ -1,4733 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::h2::parser::symbol_type H2lex(xsk::gsc::h2::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex H2lex - - - -#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 H2DEBUG - -// 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 // !H2DEBUG - -# 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 // !H2DEBUG - -#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 gsc { namespace h2 { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::gsc::h2::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg) -#if H2DEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - 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_add_array: // expr_add_array - value.YY_MOVE_OR_COPY< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.YY_MOVE_OR_COPY< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.YY_MOVE_OR_COPY< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.YY_MOVE_OR_COPY< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.YY_MOVE_OR_COPY< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.YY_MOVE_OR_COPY< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.YY_MOVE_OR_COPY< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.YY_MOVE_OR_COPY< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.copy< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.copy< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.copy< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.copy< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 H2DEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if H2DEBUG - 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 // H2DEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - yylhs.value.emplace< ast::expr_add_array::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - yylhs.value.emplace< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - yylhs.value.emplace< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - yylhs.value.emplace< ast::stmt_waitframe::ptr > (); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - yylhs.value.emplace< ast::stmt_waittill::ptr > (); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - yylhs.value.emplace< ast::stmt_waittillframeend::ptr > (); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - yylhs.value.emplace< ast::stmt_waittillmatch::ptr > (); - break; - - case symbol_kind::S_stmt_while: // stmt_while - yylhs.value.emplace< ast::stmt_while::ptr > (); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 263 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2040 "parser.cpp" - break; - - case 3: // root: %empty -#line 264 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2046 "parser.cpp" - break; - - case 4: // program: program inline -#line 269 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2052 "parser.cpp" - break; - - case 5: // program: program include -#line 271 "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 2058 "parser.cpp" - break; - - case 6: // program: program declaration -#line 273 "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 2064 "parser.cpp" - break; - - case 7: // program: inline -#line 275 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2070 "parser.cpp" - break; - - case 8: // program: include -#line 277 "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 2076 "parser.cpp" - break; - - case 9: // program: declaration -#line 279 "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 2082 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 283 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2088 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 288 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2094 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 292 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2100 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 293 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2106 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 294 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2112 "parser.cpp" - break; - - case 15: // declaration: decl_constant -#line 295 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } -#line 2118 "parser.cpp" - break; - - case 16: // declaration: decl_thread -#line 296 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2124 "parser.cpp" - break; - - case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 301 "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 2130 "parser.cpp" - break; - - case 18: // decl_constant: expr_identifier "=" expr ";" -#line 306 "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 2136 "parser.cpp" - break; - - case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 311 "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 2142 "parser.cpp" - break; - - case 20: // stmt: stmt_block -#line 315 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2148 "parser.cpp" - break; - - case 21: // stmt: stmt_call -#line 316 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2154 "parser.cpp" - break; - - case 22: // stmt: stmt_assign -#line 317 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2160 "parser.cpp" - break; - - case 23: // stmt: stmt_endon -#line 318 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2166 "parser.cpp" - break; - - case 24: // stmt: stmt_notify -#line 319 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2172 "parser.cpp" - break; - - case 25: // stmt: stmt_wait -#line 320 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2178 "parser.cpp" - break; - - case 26: // stmt: stmt_waittill -#line 321 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2184 "parser.cpp" - break; - - case 27: // stmt: stmt_waittillmatch -#line 322 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2190 "parser.cpp" - break; - - case 28: // stmt: stmt_waittillframeend -#line 323 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2196 "parser.cpp" - break; - - case 29: // stmt: stmt_waitframe -#line 324 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } -#line 2202 "parser.cpp" - break; - - case 30: // stmt: stmt_if -#line 325 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2208 "parser.cpp" - break; - - case 31: // stmt: stmt_ifelse -#line 326 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2214 "parser.cpp" - break; - - case 32: // stmt: stmt_while -#line 327 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2220 "parser.cpp" - break; - - case 33: // stmt: stmt_dowhile -#line 328 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2226 "parser.cpp" - break; - - case 34: // stmt: stmt_for -#line 329 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2232 "parser.cpp" - break; - - case 35: // stmt: stmt_foreach -#line 330 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2238 "parser.cpp" - break; - - case 36: // stmt: stmt_switch -#line 331 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2244 "parser.cpp" - break; - - case 37: // stmt: stmt_case -#line 332 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2250 "parser.cpp" - break; - - case 38: // stmt: stmt_default -#line 333 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2256 "parser.cpp" - break; - - case 39: // stmt: stmt_break -#line 334 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2262 "parser.cpp" - break; - - case 40: // stmt: stmt_continue -#line 335 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2268 "parser.cpp" - break; - - case 41: // stmt: stmt_return -#line 336 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2274 "parser.cpp" - break; - - case 42: // stmt: stmt_breakpoint -#line 337 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } -#line 2280 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_begin -#line 338 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2286 "parser.cpp" - break; - - case 44: // stmt: stmt_prof_end -#line 339 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2292 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt -#line 343 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2298 "parser.cpp" - break; - - case 46: // stmt_or_dev: stmt_dev -#line 344 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2304 "parser.cpp" - break; - - case 47: // stmt_list: stmt_list stmt -#line 349 "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 2310 "parser.cpp" - break; - - case 48: // stmt_list: stmt -#line 351 "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 2316 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 356 "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 2322 "parser.cpp" - break; - - case 50: // stmt_or_dev_list: stmt_or_dev -#line 358 "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 2328 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" stmt_list "#/" -#line 362 "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 2334 "parser.cpp" - break; - - case 52: // stmt_dev: "/#" "#/" -#line 363 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2340 "parser.cpp" - break; - - case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 367 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2346 "parser.cpp" - break; - - case 54: // stmt_block: "{" "}" -#line 368 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2352 "parser.cpp" - break; - - case 55: // stmt_expr: expr_assign -#line 373 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2358 "parser.cpp" - break; - - case 56: // stmt_expr: expr_increment -#line 375 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2364 "parser.cpp" - break; - - case 57: // stmt_expr: expr_decrement -#line 377 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2370 "parser.cpp" - break; - - case 58: // stmt_expr: %empty -#line 379 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2376 "parser.cpp" - break; - - case 59: // stmt_call: expr_call ";" -#line 384 "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 2382 "parser.cpp" - break; - - case 60: // stmt_call: expr_method ";" -#line 386 "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 2388 "parser.cpp" - break; - - case 61: // stmt_assign: expr_assign ";" -#line 391 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2394 "parser.cpp" - break; - - case 62: // stmt_assign: expr_increment ";" -#line 393 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2400 "parser.cpp" - break; - - case 63: // stmt_assign: expr_decrement ";" -#line 395 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2406 "parser.cpp" - break; - - case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 400 "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 2412 "parser.cpp" - break; - - case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 405 "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 2418 "parser.cpp" - break; - - case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 407 "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 2424 "parser.cpp" - break; - - case 67: // stmt_wait: "wait" expr ";" -#line 412 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2430 "parser.cpp" - break; - - case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 417 "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 2436 "parser.cpp" - break; - - case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 419 "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 2442 "parser.cpp" - break; - - case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 424 "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 2448 "parser.cpp" - break; - - case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 426 "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 2454 "parser.cpp" - break; - - case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 431 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2460 "parser.cpp" - break; - - case 73: // stmt_waitframe: "waitframe" ";" -#line 436 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2466 "parser.cpp" - break; - - case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 438 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2472 "parser.cpp" - break; - - case 75: // stmt_if: "if" "(" expr ")" stmt -#line 443 "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 2478 "parser.cpp" - break; - - case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 448 "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 2484 "parser.cpp" - break; - - case 77: // stmt_while: "while" "(" expr ")" stmt -#line 453 "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 2490 "parser.cpp" - break; - - case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 458 "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 2496 "parser.cpp" - break; - - case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 463 "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 2502 "parser.cpp" - break; - - case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 468 "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 2508 "parser.cpp" - break; - - case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 470 "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 2514 "parser.cpp" - break; - - case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 475 "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 2520 "parser.cpp" - break; - - case 83: // stmt_case: "case" expr_integer ":" -#line 480 "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 2526 "parser.cpp" - break; - - case 84: // stmt_case: "case" expr_string ":" -#line 482 "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 2532 "parser.cpp" - break; - - case 85: // stmt_default: "default" ":" -#line 487 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2538 "parser.cpp" - break; - - case 86: // stmt_break: "break" ";" -#line 492 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2544 "parser.cpp" - break; - - case 87: // stmt_continue: "continue" ";" -#line 497 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2550 "parser.cpp" - break; - - case 88: // stmt_return: "return" expr ";" -#line 502 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2556 "parser.cpp" - break; - - case 89: // stmt_return: "return" ";" -#line 504 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2562 "parser.cpp" - break; - - case 90: // stmt_breakpoint: "breakpoint" ";" -#line 509 "parser.ypp" - { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } -#line 2568 "parser.cpp" - break; - - case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 514 "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 2574 "parser.cpp" - break; - - case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 519 "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 2580 "parser.cpp" - break; - - case 93: // expr: expr_ternary -#line 523 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2586 "parser.cpp" - break; - - case 94: // expr: expr_binary -#line 524 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2592 "parser.cpp" - break; - - case 95: // expr: expr_primitive -#line 525 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2598 "parser.cpp" - break; - - case 96: // expr_or_empty: expr -#line 529 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2604 "parser.cpp" - break; - - case 97: // expr_or_empty: %empty -#line 530 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2610 "parser.cpp" - break; - - case 98: // expr_assign: expr_tuple "=" expr -#line 535 "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 2616 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "=" expr -#line 537 "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 2622 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "|=" expr -#line 539 "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 2628 "parser.cpp" - break; - - case 101: // expr_assign: expr_object "&=" expr -#line 541 "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 2634 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "^=" expr -#line 543 "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 2640 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "<<=" expr -#line 545 "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 2646 "parser.cpp" - break; - - case 104: // expr_assign: expr_object ">>=" expr -#line 547 "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 2652 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "+=" expr -#line 549 "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 2658 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "-=" expr -#line 551 "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 2664 "parser.cpp" - break; - - case 107: // expr_assign: expr_object "*=" expr -#line 553 "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 2670 "parser.cpp" - break; - - case 108: // expr_assign: expr_object "/=" expr -#line 555 "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 2676 "parser.cpp" - break; - - case 109: // expr_assign: expr_object "%=" expr -#line 557 "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 2682 "parser.cpp" - break; - - case 110: // expr_increment: "++" expr_object -#line 562 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2688 "parser.cpp" - break; - - case 111: // expr_increment: expr_object "++" -#line 564 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2694 "parser.cpp" - break; - - case 112: // expr_decrement: "--" expr_object -#line 569 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2700 "parser.cpp" - break; - - case 113: // expr_decrement: expr_object "--" -#line 571 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2706 "parser.cpp" - break; - - case 114: // expr_ternary: expr "?" expr ":" expr -#line 576 "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 2712 "parser.cpp" - break; - - case 115: // expr_binary: expr "||" expr -#line 581 "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 2718 "parser.cpp" - break; - - case 116: // expr_binary: expr "&&" expr -#line 583 "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 2724 "parser.cpp" - break; - - case 117: // expr_binary: expr "==" expr -#line 585 "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 2730 "parser.cpp" - break; - - case 118: // expr_binary: expr "!=" expr -#line 587 "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 2736 "parser.cpp" - break; - - case 119: // expr_binary: expr "<=" expr -#line 589 "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 2742 "parser.cpp" - break; - - case 120: // expr_binary: expr ">=" expr -#line 591 "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 2748 "parser.cpp" - break; - - case 121: // expr_binary: expr "<" expr -#line 593 "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 2754 "parser.cpp" - break; - - case 122: // expr_binary: expr ">" expr -#line 595 "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 2760 "parser.cpp" - break; - - case 123: // expr_binary: expr "|" expr -#line 597 "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 2766 "parser.cpp" - break; - - case 124: // expr_binary: expr "&" expr -#line 599 "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 2772 "parser.cpp" - break; - - case 125: // expr_binary: expr "^" expr -#line 601 "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 2778 "parser.cpp" - break; - - case 126: // expr_binary: expr "<<" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2784 "parser.cpp" - break; - - case 127: // expr_binary: expr ">>" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2790 "parser.cpp" - break; - - case 128: // expr_binary: expr "+" expr -#line 607 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2796 "parser.cpp" - break; - - case 129: // expr_binary: expr "-" expr -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2802 "parser.cpp" - break; - - case 130: // expr_binary: expr "*" expr -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2808 "parser.cpp" - break; - - case 131: // expr_binary: expr "/" expr -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2814 "parser.cpp" - break; - - case 132: // expr_binary: expr "%" expr -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2820 "parser.cpp" - break; - - case 133: // expr_primitive: expr_complement -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 2826 "parser.cpp" - break; - - case 134: // expr_primitive: expr_negate -#line 620 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 2832 "parser.cpp" - break; - - case 135: // expr_primitive: expr_not -#line 621 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 2838 "parser.cpp" - break; - - case 136: // expr_primitive: expr_call -#line 622 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 2844 "parser.cpp" - break; - - case 137: // expr_primitive: expr_method -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 2850 "parser.cpp" - break; - - case 138: // expr_primitive: expr_add_array -#line 624 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } -#line 2856 "parser.cpp" - break; - - case 139: // expr_primitive: expr_reference -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 2862 "parser.cpp" - break; - - case 140: // expr_primitive: expr_array -#line 626 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 2868 "parser.cpp" - break; - - case 141: // expr_primitive: expr_field -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 2874 "parser.cpp" - break; - - case 142: // expr_primitive: expr_size -#line 628 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 2880 "parser.cpp" - break; - - case 143: // expr_primitive: expr_paren -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 2886 "parser.cpp" - break; - - case 144: // expr_primitive: expr_thisthread -#line 630 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } -#line 2892 "parser.cpp" - break; - - case 145: // expr_primitive: expr_empty_array -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 2898 "parser.cpp" - break; - - case 146: // expr_primitive: expr_undefined -#line 632 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 2904 "parser.cpp" - break; - - case 147: // expr_primitive: expr_game -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 2910 "parser.cpp" - break; - - case 148: // expr_primitive: expr_self -#line 634 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 2916 "parser.cpp" - break; - - case 149: // expr_primitive: expr_anim -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 2922 "parser.cpp" - break; - - case 150: // expr_primitive: expr_level -#line 636 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 2928 "parser.cpp" - break; - - case 151: // expr_primitive: expr_animation -#line 637 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 2934 "parser.cpp" - break; - - case 152: // expr_primitive: expr_animtree -#line 638 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 2940 "parser.cpp" - break; - - case 153: // expr_primitive: expr_identifier -#line 639 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 2946 "parser.cpp" - break; - - case 154: // expr_primitive: expr_istring -#line 640 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 2952 "parser.cpp" - break; - - case 155: // expr_primitive: expr_string -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 2958 "parser.cpp" - break; - - case 156: // expr_primitive: expr_vector -#line 642 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 2964 "parser.cpp" - break; - - case 157: // expr_primitive: expr_float -#line 643 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 2970 "parser.cpp" - break; - - case 158: // expr_primitive: expr_integer -#line 644 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 2976 "parser.cpp" - break; - - case 159: // expr_primitive: expr_false -#line 645 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 2982 "parser.cpp" - break; - - case 160: // expr_primitive: expr_true -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 2988 "parser.cpp" - break; - - case 161: // expr_complement: "~" expr -#line 651 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2994 "parser.cpp" - break; - - case 162: // expr_negate: "-" expr_identifier -#line 656 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 3000 "parser.cpp" - break; - - case 163: // expr_negate: "-" expr_paren -#line 658 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 3006 "parser.cpp" - break; - - case 164: // expr_negate: "-" expr_array -#line 660 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 3012 "parser.cpp" - break; - - case 165: // expr_negate: "-" expr_field -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 3018 "parser.cpp" - break; - - case 166: // expr_not: "!" expr -#line 667 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3024 "parser.cpp" - break; - - case 167: // expr_call: expr_function -#line 671 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3030 "parser.cpp" - break; - - case 168: // expr_call: expr_pointer -#line 672 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3036 "parser.cpp" - break; - - case 169: // expr_method: expr_object expr_function -#line 675 "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 3042 "parser.cpp" - break; - - case 170: // expr_method: expr_object expr_pointer -#line 676 "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 3048 "parser.cpp" - break; - - case 171: // expr_function: expr_identifier "(" expr_arguments ")" -#line 681 "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 3054 "parser.cpp" - break; - - case 172: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 683 "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 3060 "parser.cpp" - break; - - case 173: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 685 "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 3066 "parser.cpp" - break; - - case 174: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 687 "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 3072 "parser.cpp" - break; - - case 175: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 689 "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::childthread); } -#line 3078 "parser.cpp" - break; - - case 176: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 691 "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::childthread); } -#line 3084 "parser.cpp" - break; - - case 177: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 696 "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 3090 "parser.cpp" - break; - - case 178: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 698 "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 3096 "parser.cpp" - break; - - case 179: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 700 "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::childthread); } -#line 3102 "parser.cpp" - break; - - case 180: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 702 "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::builtin); } -#line 3108 "parser.cpp" - break; - - case 181: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 707 "parser.ypp" - { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } -#line 3114 "parser.cpp" - break; - - case 182: // expr_parameters: expr_parameters "," expr_identifier -#line 712 "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 3120 "parser.cpp" - break; - - case 183: // expr_parameters: expr_identifier -#line 714 "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 3126 "parser.cpp" - break; - - case 184: // expr_parameters: %empty -#line 716 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3132 "parser.cpp" - break; - - case 185: // expr_arguments: expr_arguments_no_empty -#line 721 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3138 "parser.cpp" - break; - - case 186: // expr_arguments: %empty -#line 723 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3144 "parser.cpp" - break; - - case 187: // expr_arguments_no_empty: expr_arguments "," expr -#line 728 "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 3150 "parser.cpp" - break; - - case 188: // expr_arguments_no_empty: expr -#line 730 "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 3156 "parser.cpp" - break; - - case 189: // expr_reference: "::" expr_identifier -#line 735 "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 3162 "parser.cpp" - break; - - case 190: // expr_reference: expr_path "::" expr_identifier -#line 737 "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 3168 "parser.cpp" - break; - - case 191: // expr_tuple: "[" expr_tuple_arguments "]" -#line 742 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[1].value.as < ast::expr_tuple::ptr > ()); } -#line 3174 "parser.cpp" - break; - - case 192: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types -#line 747 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::move(yystack_[2].value.as < ast::expr_tuple::ptr > ()); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3180 "parser.cpp" - break; - - case 193: // expr_tuple_arguments: expr_tuple_types -#line 749 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3186 "parser.cpp" - break; - - case 194: // expr_tuple_types: expr_array -#line 753 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3192 "parser.cpp" - break; - - case 195: // expr_tuple_types: expr_field -#line 754 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3198 "parser.cpp" - break; - - case 196: // expr_tuple_types: expr_identifier -#line 755 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3204 "parser.cpp" - break; - - case 197: // expr_array: expr_object "[" expr "]" -#line 760 "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 3210 "parser.cpp" - break; - - case 198: // expr_field: expr_object "." expr_identifier_nosize -#line 765 "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 3216 "parser.cpp" - break; - - case 199: // expr_size: expr_object "." "size" -#line 770 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3222 "parser.cpp" - break; - - case 200: // expr_paren: "(" expr ")" -#line 775 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3228 "parser.cpp" - break; - - case 201: // expr_object: expr_call -#line 779 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3234 "parser.cpp" - break; - - case 202: // expr_object: expr_method -#line 780 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3240 "parser.cpp" - break; - - case 203: // expr_object: expr_array -#line 781 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3246 "parser.cpp" - break; - - case 204: // expr_object: expr_field -#line 782 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3252 "parser.cpp" - break; - - case 205: // expr_object: expr_game -#line 783 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3258 "parser.cpp" - break; - - case 206: // expr_object: expr_self -#line 784 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3264 "parser.cpp" - break; - - case 207: // expr_object: expr_anim -#line 785 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3270 "parser.cpp" - break; - - case 208: // expr_object: expr_level -#line 786 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3276 "parser.cpp" - break; - - case 209: // expr_object: expr_identifier -#line 787 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3282 "parser.cpp" - break; - - case 210: // expr_thisthread: "thisthread" -#line 792 "parser.ypp" - { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } -#line 3288 "parser.cpp" - break; - - case 211: // expr_empty_array: "[" "]" -#line 797 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3294 "parser.cpp" - break; - - case 212: // expr_undefined: "undefined" -#line 802 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3300 "parser.cpp" - break; - - case 213: // expr_game: "game" -#line 807 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3306 "parser.cpp" - break; - - case 214: // expr_self: "self" -#line 812 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3312 "parser.cpp" - break; - - case 215: // expr_anim: "anim" -#line 817 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3318 "parser.cpp" - break; - - case 216: // expr_level: "level" -#line 822 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3324 "parser.cpp" - break; - - case 217: // expr_animation: "%" "identifier" -#line 827 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3330 "parser.cpp" - break; - - case 218: // expr_animtree: "#animtree" -#line 832 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3336 "parser.cpp" - break; - - case 219: // expr_identifier_nosize: "identifier" -#line 837 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3342 "parser.cpp" - break; - - case 220: // expr_identifier: "identifier" -#line 842 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3348 "parser.cpp" - break; - - case 221: // expr_identifier: "size" -#line 844 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3354 "parser.cpp" - break; - - case 222: // expr_path: "identifier" -#line 849 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3360 "parser.cpp" - break; - - case 223: // expr_path: "path" -#line 851 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3366 "parser.cpp" - break; - - case 224: // expr_istring: "localized string" -#line 856 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3372 "parser.cpp" - break; - - case 225: // expr_string: "string literal" -#line 861 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3378 "parser.cpp" - break; - - case 226: // expr_vector: "(" expr "," expr "," expr ")" -#line 866 "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 3384 "parser.cpp" - break; - - case 227: // expr_float: "-" "float" -#line 871 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3390 "parser.cpp" - break; - - case 228: // expr_float: "float" -#line 873 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3396 "parser.cpp" - break; - - case 229: // expr_integer: "-" "integer" -#line 878 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3402 "parser.cpp" - break; - - case 230: // expr_integer: "integer" -#line 880 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3408 "parser.cpp" - break; - - case 231: // expr_false: "false" -#line 885 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3414 "parser.cpp" - break; - - case 232: // expr_true: "true" -#line 890 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3420 "parser.cpp" - break; - - -#line 3424 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "endon", "notify", "wait", - "waittill", "waittillmatch", "waittillframeend", "waitframe", "if", - "else", "do", "while", "for", "foreach", "in", "switch", "case", - "default", "break", "continue", "return", "breakpoint", "prof_begin", - "prof_end", "thread", "childthread", "thisthread", "call", "true", - "false", "undefined", "size", "game", "self", "anim", "level", "(", ")", - "{", "}", "[", "]", ",", ".", "::", ":", ";", "?", "++", "--", "<<", - ">>", "||", "&&", "==", "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", - "-=", "*=", "/=", "%=", "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", - "+", "-", "*", "/", "%", "path", "identifier", "string literal", - "localized string", "float", "integer", "SIZEOF", "ADD_ARRAY", "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_waitframe", "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_negate", - "expr_not", "expr_call", "expr_method", "expr_function", "expr_pointer", - "expr_add_array", "expr_parameters", "expr_arguments", - "expr_arguments_no_empty", "expr_reference", "expr_tuple", - "expr_tuple_arguments", "expr_tuple_types", "expr_array", "expr_field", - "expr_size", "expr_paren", "expr_object", "expr_thisthread", - "expr_empty_array", "expr_undefined", "expr_game", "expr_self", - "expr_anim", "expr_level", "expr_animation", "expr_animtree", - "expr_identifier_nosize", "expr_identifier", "expr_path", "expr_istring", - "expr_string", "expr_vector", "expr_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 H2DEBUG - // 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 H2DEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if H2DEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -287; - - const short parser::yytable_ninf_ = -223; - - const short - parser::yypact_[] = - { - 6, -287, -287, 5, 5, -24, -287, -287, 37, 6, - -287, -287, -287, -287, -287, -287, -8, -287, -287, -13, - -10, -54, -287, -287, -287, -287, -23, 1223, -287, -287, - -287, 11, -12, -287, -287, -42, 3, -287, 17, -287, - -287, -287, -287, -287, -287, -287, 1223, 821, -23, 1223, - 1223, -18, -36, 26, -287, -287, -287, 2187, -287, -287, - -287, -287, -287, -287, 413, 667, -287, -287, -287, -287, - 699, 729, -287, -287, 1012, -287, -287, -287, 1089, 1187, - 1247, 1317, -287, -287, 574, 39, -287, -287, -287, -287, - -287, -287, -287, 15, 96, -23, 49, 75, 81, 114, - 100, 124, 129, 1439, 821, -287, 2270, 134, 136, -287, - -287, -287, 1223, 142, -287, -287, -287, -287, 699, 729, - -287, 1406, -287, -287, -287, -287, 574, 140, -287, -287, - 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, - 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1286, - -20, -287, -287, 152, 1223, -23, -287, 928, -287, -287, - 1223, 1223, -23, 1223, 1223, -23, 1223, -287, 1223, 1917, - 1223, -287, 1605, 1223, 107, -23, 2152, 179, 179, 2301, - 2311, 2383, 2383, 30, 30, 30, 30, 2342, 728, 2352, - 73, 73, -287, -287, -287, 1957, -287, -287, -287, 35, - -287, 154, 1057, 1223, 146, -5, 161, 1370, 165, 166, - 167, 168, -17, 163, 169, 172, 1160, 183, 173, 175, - -287, 139, 548, 548, -287, -287, 980, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, 184, 185, 188, 191, 192, 177, -287, - -287, 51, 152, 1997, 53, 205, 2037, 56, 206, 2077, - 2116, 203, 2270, 1917, 154, 1223, -287, -287, 1223, -287, - -287, 1134, 2222, -287, 209, -287, 1223, 236, 1223, 639, - -23, 1223, 164, 208, 215, -287, -287, -287, -287, 2257, - -287, 1223, 1223, 1286, 32, -287, 62, 86, 8, 1406, - 1406, -287, -287, -287, -287, -287, -287, -287, 1223, 225, - 227, 228, 230, -287, -287, 1223, 1223, 1223, 1223, 1223, - 1223, 1223, 1223, 1223, 1223, 1223, 210, -287, 1223, 226, - -287, 1223, 229, 1223, 232, 2270, 59, -287, -287, -287, - 223, 1639, 235, 1673, 233, -287, -287, -287, 1396, 9, - 1707, -287, -287, -287, 60, 87, -287, 548, 2270, 1223, - 1223, 1223, 1223, 2270, 2270, 2270, 2270, 2270, 2270, 2270, - 2270, 2270, 2270, 2270, 240, 89, 242, 101, 245, 1741, - 1223, -287, -287, 1370, 1223, 1370, 1223, 1223, -23, 96, - 237, 241, -287, 1775, 1483, 1527, 1571, 1223, -287, 1223, - -287, 1223, -287, 103, 273, 1809, -287, 2270, 243, 1843, - 272, -287, -287, -287, 246, 249, 1223, 250, 1223, 251, - 1223, 113, 123, 125, -287, 1370, 252, 639, 1370, 1223, - -287, -287, 254, -287, 262, -287, 286, -287, -287, -287, - -287, -287, 287, -287, 1877, 279, 280, 281, 1370, 1370, - -287, -287, -287, -287, -287 - }; - - const unsigned char - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 221, 220, 0, 2, - 7, 8, 9, 14, 15, 16, 0, 223, 222, 0, - 0, 0, 1, 4, 5, 6, 184, 0, 10, 11, - 225, 0, 0, 183, 218, 0, 0, 210, 0, 232, - 231, 212, 213, 214, 215, 216, 0, 186, 0, 0, - 0, 0, 0, 220, 224, 228, 230, 0, 93, 94, - 95, 133, 134, 135, 136, 137, 167, 168, 138, 139, - 140, 141, 142, 143, 0, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 0, 154, 155, 156, 157, - 158, 159, 160, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 186, 211, 188, 0, 185, 189, - 166, 161, 0, 0, 227, 229, 201, 202, 164, 165, - 163, 0, 205, 206, 207, 208, 162, 0, 217, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 169, 170, 0, 186, 0, 17, 0, 19, 182, - 0, 186, 0, 0, 186, 0, 0, 200, 0, 188, - 0, 181, 0, 0, 0, 0, 0, 126, 127, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 128, 129, 130, 131, 132, 0, 199, 219, 198, 0, - 185, 190, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 54, 0, 0, 0, 45, 50, 0, 46, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 0, 0, 0, 201, 202, 0, 203, - 204, 0, 209, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 187, 0, 0, 0, 197, 171, 186, 52, - 48, 0, 0, 72, 0, 73, 0, 0, 0, 58, - 0, 0, 0, 0, 0, 85, 86, 87, 89, 0, - 90, 186, 186, 0, 0, 193, 203, 204, 209, 110, - 112, 53, 49, 61, 62, 63, 59, 60, 0, 0, - 0, 0, 0, 111, 113, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 173, 186, 0, - 175, 186, 0, 0, 0, 114, 0, 51, 47, 67, - 0, 0, 0, 0, 0, 55, 56, 57, 0, 0, - 0, 84, 83, 88, 0, 0, 191, 0, 98, 0, - 0, 0, 0, 99, 105, 106, 107, 108, 109, 100, - 101, 102, 104, 103, 0, 0, 0, 0, 0, 0, - 186, 172, 74, 0, 0, 0, 97, 0, 0, 0, - 0, 0, 192, 0, 0, 0, 0, 186, 174, 186, - 176, 186, 226, 0, 75, 0, 77, 96, 0, 0, - 0, 82, 91, 92, 0, 0, 186, 0, 186, 0, - 186, 0, 0, 0, 177, 0, 0, 58, 0, 0, - 64, 66, 185, 69, 185, 71, 185, 178, 179, 180, - 76, 78, 0, 80, 0, 0, 0, 0, 0, 0, - 65, 68, 70, 79, 81 - }; - - const short - parser::yypgoto_[] = - { - -287, -287, -287, 295, 336, 338, -287, -287, -287, -194, - 122, -287, -287, -287, -93, -87, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - 189, -287, -286, -277, -274, -287, -287, -287, -287, -287, - -287, -49, -11, -67, -58, -287, -287, 95, -43, -287, - -287, -287, -16, 197, 324, -287, 302, 355, -287, -287, - -287, 380, 417, 452, 490, -287, -287, -287, 0, 7, - -287, -15, -287, -287, 148, -287, -287 - }; - - const short - parser::yydefgoto_[] = - { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 224, - 225, 281, 226, 227, 228, 354, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 106, 418, 253, 254, 255, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 32, 107, 200, 69, - 258, 304, 305, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 198, 84, 85, - 86, 87, 88, 89, 90, 91, 92 - }; - - const short - parser::yytable_[] = - { - 16, 158, 116, 355, 108, 6, 31, 151, 280, 16, - 19, 20, 356, 287, 96, 357, 152, 1, 2, 3, - 4, 5, 35, 36, 6, 38, 33, 196, 21, 6, - 42, 43, 44, 45, 112, 97, 100, 22, 113, 397, - 117, 94, 98, 101, 26, 30, 95, 284, 109, 28, - 6, 126, 29, 6, 151, 17, 53, 285, 127, 99, - 154, 108, 128, 152, 93, -196, -196, 398, 319, 320, - 27, 321, 322, 102, 153, 7, 292, 156, 197, 17, - 53, 127, 30, 114, 115, 56, -222, 348, 277, 366, - 367, 35, 36, 170, 38, 159, 131, 132, 6, 155, - 17, 53, 17, 18, 7, 160, 337, 149, 256, 340, - 174, 170, 391, 400, 170, 323, 324, 170, 170, -194, - -194, 153, 144, 145, 146, 147, 148, 161, 127, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 401, 162, 408, -195, -195, 170, 257, 170, 17, 53, - 157, 355, 164, 256, 410, 201, 434, 262, 256, 170, - 356, 170, 265, 357, 127, 268, 447, 146, 147, 148, - 163, 170, 116, 116, 116, 274, 448, 256, 449, 35, - 36, 170, 38, 170, 165, 166, 6, 42, 43, 44, - 45, 257, 170, 171, 151, 303, 257, 293, 173, 414, - 175, 416, 262, 152, 154, 197, 278, 262, 283, 127, - 117, 117, 117, 286, 127, 257, 57, 288, 289, 290, - 291, 308, 262, 262, 295, 301, 262, 302, 127, 127, - 127, 296, 256, 127, 297, 103, 17, 53, 110, 111, - 116, 450, 151, 151, 453, 300, 313, 314, 118, 199, - 315, 152, 152, 316, 317, 318, 264, 338, 341, 267, - 344, 153, 350, 352, 463, 464, 115, 384, 127, 361, - 257, 144, 145, 146, 147, 148, 362, 369, 117, 370, - 371, 262, 372, 386, 390, 392, 388, 394, 127, 262, - 359, 151, 407, 169, 409, 396, 127, 411, 435, 422, - 152, 172, 439, 423, 23, 437, 421, 455, 440, 153, - 153, 441, 443, 445, 451, 456, 127, 127, 116, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 457, - 458, 460, 461, 462, 256, 24, 256, 25, 312, 263, - 452, 402, 266, 120, 259, 269, 117, 270, 153, 272, - 294, 0, 273, 0, 0, 127, 0, 308, 0, 0, - 0, 0, 0, 346, 127, 119, 0, 0, 0, 0, - 0, 0, 257, 442, 257, 444, 256, 446, 116, 256, - 0, 0, 282, 262, 0, 262, 364, 365, 420, 259, - 127, 0, 127, 0, 259, 299, 121, 0, 0, 256, - 256, 0, 0, 0, 0, 0, 0, 0, 306, 259, - 259, 0, 0, 259, 257, 0, 117, 257, 0, 0, - 0, 122, 0, 385, 0, 262, 387, 262, 262, 0, - 0, 0, 127, 0, 127, 127, 0, 257, 257, 0, - 0, 0, 0, -201, -201, 0, -201, 0, 262, 262, - -201, 0, 0, 0, 345, 127, 127, 0, 123, -201, - 0, 0, -201, 0, 0, 351, 0, 353, 259, 0, - 360, 260, 0, 0, 0, 413, 259, 0, 0, 0, - 0, 0, 273, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 431, 124, 432, 0, 433, 368, 0, 0, - -201, -201, 261, 0, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 260, 0, 0, 0, - 0, 260, 389, 0, 0, 0, 0, 122, 0, 0, - 0, 125, 0, 0, 0, 307, 260, 260, 0, 0, - 260, 0, 0, 0, 0, 0, 0, 261, 403, 404, - 405, 406, 261, 0, 306, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 123, 0, 121, 309, 310, 0, - 0, 261, 122, 415, 0, 417, 419, 122, 35, 36, - 259, 38, 259, 0, 0, 6, 42, 43, 44, 45, - 0, 122, 122, 122, 113, 260, 122, 0, 0, 124, - 0, 0, 0, 260, -209, -209, 0, -209, 0, 123, - 0, -209, 0, 0, 123, 0, 154, 0, 454, 0, - -209, 0, 259, -209, 259, 259, 261, 0, 123, 123, - 123, 0, 0, 123, 358, 17, 53, 125, 0, 0, - 0, 0, 0, 0, 124, 259, 259, 0, 0, 124, - 0, 122, 0, 0, 0, 0, 0, 0, 0, 122, - 0, -209, -209, 124, 124, 124, 0, 0, 124, 35, - 36, 0, 38, 0, 0, 0, 6, 42, 43, 44, - 45, 307, 125, 0, 0, 221, 0, 125, 123, 0, - 0, 0, 0, 222, 223, 0, 123, -202, -202, 0, - -202, 125, 125, 125, -202, 0, 125, 260, 0, 260, - 0, 0, 121, -202, 0, 0, -202, 0, 0, 0, - 0, 0, 0, 124, 0, 0, 17, 53, 0, -203, - -203, 124, -203, 0, 0, 0, -203, 122, 261, 0, - 261, 0, 0, 0, 0, -203, 0, 0, -203, 260, - 0, 260, 260, 0, -202, -202, 0, 0, 0, -204, - -204, 125, -204, 122, 0, 122, -204, 0, 0, 125, - 0, 0, 260, 260, 123, -204, 0, 0, -204, 0, - 261, 0, 358, 261, 131, 132, -203, -203, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 123, 0, 123, 261, 261, 122, 0, 122, 122, 124, - 144, 145, 146, 147, 148, 0, -204, -204, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 34, 122, 122, - 0, 0, 0, 0, 0, 124, 0, 124, 0, 0, - 0, 0, 123, 0, 123, 123, 0, 125, 0, 0, - 0, 35, 36, 37, 38, 39, 40, 41, 6, 42, - 43, 44, 45, 46, 0, 123, 123, 104, 105, 0, - 0, 48, 0, 125, 0, 125, 0, 124, 0, 124, - 124, 0, 0, 0, 0, 0, 0, 49, 50, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 124, 124, 0, 0, 51, 0, 0, 52, 17, 53, - 30, 54, 55, 56, 0, 125, 0, 125, 125, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, - 0, 0, 0, 0, 0, 0, 0, 203, 125, 125, - 204, 205, 206, 0, 207, 208, 209, 210, 0, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 35, 36, - 0, 38, 0, 0, 0, 6, 42, 43, 44, 45, - 0, 0, 157, 220, 221, 0, 0, 0, 0, 0, - 0, 202, 222, 223, 0, 0, 0, 0, 0, 203, - 0, 0, 204, 205, 206, 0, 207, 208, 209, 210, - 0, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 35, 36, 0, 38, 0, 17, 53, 6, 42, 43, - 44, 45, 0, 0, 157, 311, 221, 0, 0, 0, - 0, 0, 0, 0, 222, 223, 0, 0, 0, 0, - 0, 0, 35, 36, 0, 38, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 149, 279, - 0, 150, 0, 0, 0, 0, 203, 17, 53, 204, - 205, 206, 0, 207, 208, 209, 210, 0, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 35, 36, 0, - 38, 0, 0, 0, 6, 42, 43, 44, 45, 17, - 53, 157, 0, 221, 0, 0, 0, 0, 0, 0, - 0, 222, 223, 0, 0, 0, 0, 0, 0, -205, - -205, 0, -205, 0, 0, 0, -205, 0, 0, 0, - 0, 0, 0, 0, 0, -205, 347, 0, -205, 0, - 0, 0, 0, 203, 17, 53, 204, 205, 206, 0, - 207, 208, 209, 210, 0, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 35, 36, 34, 38, 0, 0, - 0, 6, 42, 43, 44, 45, -205, -205, 157, 0, - 221, 0, 0, 0, 0, 0, 0, 0, 222, 223, - 35, 36, 37, 38, 39, 40, 41, 6, 42, 43, - 44, 45, 46, 0, 0, 0, 47, 0, 0, 0, - 48, 0, 298, 0, 0, 0, 0, -206, -206, 0, - -206, 17, 53, 0, -206, 0, 49, 50, 0, 34, - 0, 0, 0, -206, 0, 0, -206, 0, 0, 0, - 0, 0, 0, 51, 0, 0, 52, 17, 53, 30, - 54, 55, 56, 35, 36, 37, 38, 39, 40, 41, - 6, 42, 43, 44, 45, 46, 0, 0, 0, 47, - 0, 0, 0, 48, -206, -206, 0, -207, -207, 0, - -207, 0, 0, 0, -207, 0, 0, 0, 0, 49, - 50, 0, 34, -207, 0, 0, -207, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 51, 0, 0, 52, - 17, 53, 30, 54, 55, 56, 35, 36, 37, 38, - 39, 40, 41, 6, 42, 43, 44, 45, 46, 0, - 0, 0, 104, 0, -207, -207, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -208, -208, 0, - -208, 0, 49, 50, -208, 0, 0, 0, 0, 0, - 0, 0, 0, -208, 0, 0, -208, 0, 0, 51, - 0, 0, 52, 17, 53, 30, 54, 55, 56, 203, - 0, 0, 204, 205, 206, 0, 207, 208, 209, 210, - 0, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 35, 36, 0, 38, -208, -208, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 0, 221, 0, 0, 0, - 0, 0, 0, 0, 222, 223, 35, 36, 0, 38, - 0, 0, 0, 6, 0, 0, 35, 36, 0, 38, - 0, 0, 149, 6, 0, 174, 0, 0, 0, 0, - 323, 324, 149, 0, 0, 174, 0, 17, 53, 0, - 0, 0, 0, 0, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 0, 0, 0, 0, 0, - 0, 0, 167, 17, 53, 0, 0, 168, 0, 0, - 0, 0, 130, 17, 53, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 425, 0, 0, 0, - 0, 426, 0, 0, 0, 0, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 427, 0, 0, 0, 0, 428, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 429, 0, 0, 0, 0, 430, - 0, 0, 0, 0, 130, 0, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 167, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 393, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 395, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 399, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 412, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 130, 0, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 424, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 436, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 438, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 459, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 271, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 276, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 336, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 339, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 342, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 343, 0, 0, 0, 0, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 275, 0, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 129, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 349, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 363, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 131, 132, 0, - 134, 135, 136, 137, 138, 139, 140, 131, 132, 0, - 0, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 0, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 131, 132, - 0, 0, 135, 136, 137, 138, 139, 140, 131, 132, - 0, 0, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 142, 143, 144, 145, 146, 147, 148, 0, - 0, 0, 142, 0, 144, 145, 146, 147, 148, 131, - 132, 0, 0, 0, 0, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 144, 145, 146, 147, 148 - }; - - const short - parser::yycheck_[] = - { - 0, 94, 51, 289, 47, 47, 21, 74, 202, 9, - 3, 4, 289, 207, 56, 289, 74, 11, 12, 13, - 14, 15, 40, 41, 47, 43, 26, 47, 52, 47, - 48, 49, 50, 51, 52, 35, 36, 0, 56, 30, - 51, 53, 35, 36, 52, 99, 58, 52, 48, 62, - 47, 51, 62, 47, 121, 97, 98, 62, 51, 56, - 52, 104, 98, 121, 53, 57, 58, 58, 17, 18, - 78, 20, 21, 56, 74, 98, 93, 62, 98, 97, - 98, 74, 99, 101, 102, 102, 60, 281, 53, 57, - 58, 40, 41, 58, 43, 95, 66, 67, 47, 60, - 97, 98, 97, 98, 98, 56, 53, 56, 157, 53, - 59, 58, 53, 53, 58, 64, 65, 58, 58, 57, - 58, 121, 92, 93, 94, 95, 96, 52, 121, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 53, 60, 53, 57, 58, 58, 157, 58, 97, 98, - 54, 437, 52, 202, 53, 155, 53, 157, 207, 58, - 437, 58, 162, 437, 157, 165, 53, 94, 95, 96, - 56, 58, 221, 222, 223, 175, 53, 226, 53, 40, - 41, 58, 43, 58, 60, 56, 47, 48, 49, 50, - 51, 202, 58, 57, 261, 56, 207, 212, 56, 393, - 60, 395, 202, 261, 52, 98, 52, 207, 62, 202, - 221, 222, 223, 52, 207, 226, 27, 52, 52, 52, - 52, 221, 222, 223, 61, 52, 226, 52, 221, 222, - 223, 62, 281, 226, 62, 46, 97, 98, 49, 50, - 289, 435, 309, 310, 438, 62, 62, 62, 51, 154, - 62, 309, 310, 62, 62, 78, 161, 52, 52, 164, - 57, 261, 53, 27, 458, 459, 102, 57, 261, 61, - 281, 92, 93, 94, 95, 96, 61, 52, 289, 52, - 52, 281, 52, 57, 52, 62, 57, 52, 281, 289, - 290, 358, 52, 104, 52, 62, 289, 52, 25, 62, - 358, 112, 30, 62, 9, 62, 399, 53, 62, 309, - 310, 62, 62, 62, 62, 53, 309, 310, 367, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 53, - 53, 62, 62, 62, 393, 9, 395, 9, 226, 160, - 437, 367, 163, 51, 157, 166, 367, 168, 358, 170, - 212, -1, 173, -1, -1, 358, -1, 367, -1, -1, - -1, -1, -1, 278, 367, 51, -1, -1, -1, -1, - -1, -1, 393, 426, 395, 428, 435, 430, 437, 438, - -1, -1, 203, 393, -1, 395, 301, 302, 398, 202, - 393, -1, 395, -1, 207, 216, 51, -1, -1, 458, - 459, -1, -1, -1, -1, -1, -1, -1, 221, 222, - 223, -1, -1, 226, 435, -1, 437, 438, -1, -1, - -1, 51, -1, 338, -1, 435, 341, 437, 438, -1, - -1, -1, 435, -1, 437, 438, -1, 458, 459, -1, - -1, -1, -1, 40, 41, -1, 43, -1, 458, 459, - 47, -1, -1, -1, 275, 458, 459, -1, 51, 56, - -1, -1, 59, -1, -1, 286, -1, 288, 281, -1, - 291, 157, -1, -1, -1, 390, 289, -1, -1, -1, - -1, -1, 303, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 407, 51, 409, -1, 411, 318, -1, -1, - 97, 98, 157, -1, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, -1, 202, -1, -1, -1, - -1, 207, 343, -1, -1, -1, -1, 157, -1, -1, - -1, 51, -1, -1, -1, 221, 222, 223, -1, -1, - 226, -1, -1, -1, -1, -1, -1, 202, 369, 370, - 371, 372, 207, -1, 367, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 157, -1, 221, 222, 223, -1, - -1, 226, 202, 394, -1, 396, 397, 207, 40, 41, - 393, 43, 395, -1, -1, 47, 48, 49, 50, 51, - -1, 221, 222, 223, 56, 281, 226, -1, -1, 157, - -1, -1, -1, 289, 40, 41, -1, 43, -1, 202, - -1, 47, -1, -1, 207, -1, 52, -1, 439, -1, - 56, -1, 435, 59, 437, 438, 281, -1, 221, 222, - 223, -1, -1, 226, 289, 97, 98, 157, -1, -1, - -1, -1, -1, -1, 202, 458, 459, -1, -1, 207, - -1, 281, -1, -1, -1, -1, -1, -1, -1, 289, - -1, 97, 98, 221, 222, 223, -1, -1, 226, 40, - 41, -1, 43, -1, -1, -1, 47, 48, 49, 50, - 51, 367, 202, -1, -1, 56, -1, 207, 281, -1, - -1, -1, -1, 64, 65, -1, 289, 40, 41, -1, - 43, 221, 222, 223, 47, -1, 226, 393, -1, 395, - -1, -1, 367, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, 281, -1, -1, 97, 98, -1, 40, - 41, 289, 43, -1, -1, -1, 47, 367, 393, -1, - 395, -1, -1, -1, -1, 56, -1, -1, 59, 435, - -1, 437, 438, -1, 97, 98, -1, -1, -1, 40, - 41, 281, 43, 393, -1, 395, 47, -1, -1, 289, - -1, -1, 458, 459, 367, 56, -1, -1, 59, -1, - 435, -1, 437, 438, 66, 67, 97, 98, 70, 71, - 72, 73, 74, 75, -1, -1, -1, -1, -1, -1, - 393, -1, 395, 458, 459, 435, -1, 437, 438, 367, - 92, 93, 94, 95, 96, -1, 97, 98, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 16, 458, 459, - -1, -1, -1, -1, -1, 393, -1, 395, -1, -1, - -1, -1, 435, -1, 437, 438, -1, 367, -1, -1, - -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, -1, 458, 459, 56, 57, -1, - -1, 60, -1, 393, -1, 395, -1, 435, -1, 437, - 438, -1, -1, -1, -1, -1, -1, 76, 77, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 458, 459, -1, -1, 93, -1, -1, 96, 97, 98, - 99, 100, 101, 102, -1, 435, -1, 437, 438, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, - -1, -1, -1, -1, -1, -1, -1, 19, 458, 459, - 22, 23, 24, -1, 26, 27, 28, 29, -1, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - -1, 43, -1, -1, -1, 47, 48, 49, 50, 51, - -1, -1, 54, 55, 56, -1, -1, -1, -1, -1, - -1, 11, 64, 65, -1, -1, -1, -1, -1, 19, - -1, -1, 22, 23, 24, -1, 26, 27, 28, 29, - -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, -1, 43, -1, 97, 98, 47, 48, 49, - 50, 51, -1, -1, 54, 55, 56, -1, -1, -1, - -1, -1, -1, -1, 64, 65, -1, -1, -1, -1, - -1, -1, 40, 41, -1, 43, -1, -1, -1, 47, - -1, -1, -1, -1, -1, -1, -1, -1, 56, 12, - -1, 59, -1, -1, -1, -1, 19, 97, 98, 22, - 23, 24, -1, 26, 27, 28, 29, -1, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, -1, - 43, -1, -1, -1, 47, 48, 49, 50, 51, 97, - 98, 54, -1, 56, -1, -1, -1, -1, -1, -1, - -1, 64, 65, -1, -1, -1, -1, -1, -1, 40, - 41, -1, 43, -1, -1, -1, 47, -1, -1, -1, - -1, -1, -1, -1, -1, 56, 12, -1, 59, -1, - -1, -1, -1, 19, 97, 98, 22, 23, 24, -1, - 26, 27, 28, 29, -1, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 16, 43, -1, -1, - -1, 47, 48, 49, 50, 51, 97, 98, 54, -1, - 56, -1, -1, -1, -1, -1, -1, -1, 64, 65, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, -1, -1, -1, 56, -1, -1, -1, - 60, -1, 62, -1, -1, -1, -1, 40, 41, -1, - 43, 97, 98, -1, 47, -1, 76, 77, -1, 16, - -1, -1, -1, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, 93, -1, -1, 96, 97, 98, 99, - 100, 101, 102, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, -1, -1, -1, 56, - -1, -1, -1, 60, 97, 98, -1, 40, 41, -1, - 43, -1, -1, -1, 47, -1, -1, -1, -1, 76, - 77, -1, 16, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 93, -1, -1, 96, - 97, 98, 99, 100, 101, 102, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, - -1, -1, 56, -1, 97, 98, 60, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, - 43, -1, 76, 77, 47, -1, -1, -1, -1, -1, - -1, -1, -1, 56, -1, -1, 59, -1, -1, 93, - -1, -1, 96, 97, 98, 99, 100, 101, 102, 19, - -1, -1, 22, 23, 24, -1, 26, 27, 28, 29, - -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, -1, 43, 97, 98, -1, 47, 48, 49, - 50, 51, -1, -1, 54, -1, 56, -1, -1, -1, - -1, -1, -1, -1, 64, 65, 40, 41, -1, 43, - -1, -1, -1, 47, -1, -1, 40, 41, -1, 43, - -1, -1, 56, 47, -1, 59, -1, -1, -1, -1, - 64, 65, 56, -1, -1, 59, -1, 97, 98, -1, - -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, -1, -1, -1, -1, -1, - -1, -1, 53, 97, 98, -1, -1, 58, -1, -1, - -1, -1, 63, 97, 98, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 53, -1, -1, -1, - -1, 58, -1, -1, -1, -1, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 53, -1, -1, -1, -1, 58, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 53, -1, -1, -1, -1, 58, - -1, -1, -1, -1, 63, -1, -1, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 63, -1, - -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 53, -1, 89, 90, 91, 92, 93, 94, - 95, 96, 63, -1, -1, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 53, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 53, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 53, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 63, -1, -1, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 63, -1, - -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 53, -1, 89, 90, 91, 92, 93, 94, - 95, 96, 63, -1, -1, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 53, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 53, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 58, -1, -1, -1, -1, 63, - -1, -1, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 89, 90, 91, 92, 93, - 94, 95, 96, 61, -1, 63, -1, -1, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 89, 90, 91, 92, 93, 94, 95, 96, 62, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 62, 63, -1, -1, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 89, 90, 91, 92, 93, 94, 95, 96, 62, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 63, -1, -1, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 89, 90, 91, 92, - 93, 94, 95, 96, -1, -1, -1, -1, -1, 89, - 90, 91, 92, 93, 94, 95, 96, 66, 67, -1, - 69, 70, 71, 72, 73, 74, 75, 66, 67, -1, - -1, 70, 71, 72, 73, 74, 75, -1, -1, -1, - 89, 90, 91, 92, 93, 94, 95, 96, -1, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 66, 67, - -1, -1, 70, 71, 72, 73, 74, 75, 66, 67, - -1, -1, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, 90, 91, 92, 93, 94, 95, 96, -1, - -1, -1, 90, -1, 92, 93, 94, 95, 96, 66, - 67, -1, -1, -1, -1, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 92, 93, 94, 95, 96 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 47, 98, 114, 115, - 116, 117, 118, 119, 120, 121, 191, 97, 98, 192, - 192, 52, 0, 116, 117, 118, 52, 78, 62, 62, - 99, 194, 169, 191, 16, 40, 41, 42, 43, 44, - 45, 46, 48, 49, 50, 51, 52, 56, 60, 76, - 77, 93, 96, 98, 100, 101, 102, 153, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 172, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 53, 53, 58, 56, 191, 192, 56, - 191, 192, 56, 153, 56, 57, 153, 170, 171, 191, - 153, 153, 52, 56, 101, 102, 164, 165, 176, 177, - 179, 180, 184, 185, 186, 187, 191, 192, 98, 62, - 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 89, 90, 91, 92, 93, 94, 95, 96, 56, - 59, 166, 167, 191, 52, 60, 62, 54, 127, 191, - 56, 52, 60, 56, 52, 60, 56, 53, 58, 153, - 58, 57, 153, 56, 59, 60, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 47, 98, 190, 170, - 171, 191, 11, 19, 22, 23, 24, 26, 27, 28, - 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 55, 56, 64, 65, 122, 123, 125, 126, 127, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 155, 156, 157, 164, 165, 173, 176, - 177, 180, 191, 153, 170, 191, 153, 170, 191, 153, - 153, 57, 153, 153, 191, 61, 57, 53, 52, 12, - 122, 124, 153, 62, 52, 62, 52, 122, 52, 52, - 52, 52, 93, 194, 197, 61, 62, 62, 62, 153, - 62, 52, 52, 56, 174, 175, 176, 177, 191, 180, - 180, 55, 123, 62, 62, 62, 62, 62, 78, 17, - 18, 20, 21, 64, 65, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 57, 53, 52, 57, - 53, 52, 57, 58, 57, 153, 170, 12, 122, 62, - 53, 153, 27, 153, 128, 155, 156, 157, 180, 191, - 153, 61, 61, 62, 170, 170, 57, 58, 153, 52, - 52, 52, 52, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 57, 170, 57, 170, 57, 153, - 52, 53, 62, 53, 52, 53, 62, 30, 58, 53, - 53, 53, 175, 153, 153, 153, 153, 52, 53, 52, - 53, 52, 53, 170, 122, 153, 122, 153, 154, 153, - 191, 127, 62, 62, 53, 53, 58, 53, 58, 53, - 58, 170, 170, 170, 53, 25, 53, 62, 53, 30, - 62, 62, 171, 62, 171, 62, 171, 53, 53, 53, - 122, 62, 128, 122, 153, 53, 53, 53, 53, 53, - 62, 62, 62, 122, 122 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 113, 114, 114, 115, 115, 115, 115, 115, 115, - 116, 117, 118, 118, 118, 118, 118, 119, 120, 121, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 123, 123, 124, 124, 125, - 125, 126, 126, 127, 127, 128, 128, 128, 128, 129, - 129, 130, 130, 130, 131, 132, 132, 133, 134, 134, - 135, 135, 136, 137, 137, 138, 139, 140, 141, 142, - 143, 143, 144, 145, 145, 146, 147, 148, 149, 149, - 150, 151, 152, 153, 153, 153, 154, 154, 155, 155, - 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, - 156, 156, 157, 157, 158, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 161, 162, 162, 162, 162, 163, 164, 164, 165, - 165, 166, 166, 166, 166, 166, 166, 167, 167, 167, - 167, 168, 169, 169, 169, 170, 170, 171, 171, 172, - 172, 173, 174, 174, 175, 175, 175, 176, 177, 178, - 179, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 191, 192, 192, 193, 194, 195, 196, 196, 197, - 197, 198, 199 - }; - - 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, 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, 2, 4, 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, 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, 2, 2, 2, 2, 2, 2, 1, 1, 2, - 2, 4, 6, 5, 7, 5, 7, 8, 9, 9, - 9, 3, 3, 1, 0, 1, 0, 3, 1, 2, - 3, 3, 3, 1, 1, 1, 1, 4, 3, 3, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 2, 1, 2, - 1, 1, 1 - }; - - - - -#if H2DEBUG - const short - parser::yyrline_[] = - { - 0, 263, 263, 264, 268, 270, 272, 274, 276, 278, - 283, 287, 292, 293, 294, 295, 296, 300, 305, 310, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 343, 344, 348, 350, 355, - 357, 362, 363, 367, 368, 372, 374, 376, 379, 383, - 385, 390, 392, 394, 399, 404, 406, 411, 416, 418, - 423, 425, 430, 435, 437, 442, 447, 452, 457, 462, - 467, 469, 474, 479, 481, 486, 491, 496, 501, 503, - 508, 513, 518, 523, 524, 525, 529, 530, 534, 536, - 538, 540, 542, 544, 546, 548, 550, 552, 554, 556, - 561, 563, 568, 570, 575, 580, 582, 584, 586, 588, - 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, - 610, 612, 614, 619, 620, 621, 622, 623, 624, 625, - 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, - 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, - 646, 650, 655, 657, 659, 661, 666, 671, 672, 675, - 676, 680, 682, 684, 686, 688, 690, 695, 697, 699, - 701, 706, 711, 713, 716, 720, 723, 727, 729, 734, - 736, 741, 746, 748, 753, 754, 755, 759, 764, 769, - 774, 779, 780, 781, 782, 783, 784, 785, 786, 787, - 791, 796, 801, 806, 811, 816, 821, 826, 831, 836, - 841, 843, 848, 850, 855, 860, 865, 870, 872, 877, - 879, 884, 889 - }; - - 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 // H2DEBUG - - -#line 13 "parser.ypp" -} } } // xsk::gsc::h2 -#line 4726 "parser.cpp" - -#line 893 "parser.ypp" - - -void xsk::gsc::h2::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/src/h2/xsk/parser.hpp b/src/h2/xsk/parser.hpp deleted file mode 100644 index 42b36b42..00000000 --- a/src/h2/xsk/parser.hpp +++ /dev/null @@ -1,5601 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// 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::gsc::h2::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_H2_PARSER_HPP_INCLUDED -# define YY_H2_PARSER_HPP_INCLUDED -// "%code requires" blocks. -#line 28 "parser.ypp" - -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "h2.hpp" -namespace xsk::gsc::h2 { class lexer; } - -#line 58 "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 H2_ASSERT -# include -# define H2_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 - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# 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 H2DEBUG -# if defined YYDEBUG -#if YYDEBUG -# define H2DEBUG 1 -# else -# define H2DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define H2DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined H2DEBUG */ - -#line 13 "parser.ypp" -namespace xsk { namespace gsc { namespace h2 { -#line 207 "parser.hpp" - - - - - /// A Bison parser. - class parser - { - public: -#ifdef H2STYPE -# ifdef __GNUC__ -# pragma GCC message "bison: do not #define H2STYPE in C++, use %define api.value.type" -# endif - typedef H2STYPE value_type; -#else - /// 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 value_type - { - public: - /// Type of *this. - typedef value_type self_type; - - /// Empty construction. - value_type () YY_NOEXCEPT - : yyraw_ () - , yytypeid_ (YY_NULLPTR) - {} - - /// Construct and fill. - template - value_type (YY_RVREF (T) t) - : yytypeid_ (&typeid (T)) - { - H2_ASSERT (sizeof (T) <= size); - new (yyas_ ()) T (YY_MOVE (t)); - } - -#if 201103L <= YY_CPLUSPLUS - /// Non copyable. - value_type (const self_type&) = delete; - /// Non copyable. - self_type& operator= (const self_type&) = delete; -#endif - - /// Destruction, allowed only if empty. - ~value_type () YY_NOEXCEPT - { - H2_ASSERT (!yytypeid_); - } - -# if 201103L <= YY_CPLUSPLUS - /// Instantiate a \a T in here from \a t. - template - T& - emplace (U&&... u) - { - H2_ASSERT (!yytypeid_); - H2_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 () - { - H2_ASSERT (!yytypeid_); - H2_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) - { - H2_ASSERT (!yytypeid_); - H2_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 - { - H2_ASSERT (yytypeid_); - H2_ASSERT (*yytypeid_ == typeid (T)); - H2_ASSERT (sizeof (T) <= size); - return *yyas_ (); - } - - /// Const accessor to a built \a T (for %printer). - template - const T& - as () const YY_NOEXCEPT - { - H2_ASSERT (yytypeid_); - H2_ASSERT (*yytypeid_ == typeid (T)); - H2_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 - { - H2_ASSERT (yytypeid_); - H2_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. - value_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 = yyraw_; - return static_cast (yyp); - } - - /// Const accessor to raw memory as \a T. - template - const T* - yyas_ () const YY_NOEXCEPT - { - const void *yyp = 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_tuple - // expr_tuple_types - // expr_object - char dummy6[sizeof (ast::expr)]; - - // expr_add_array - char dummy7[sizeof (ast::expr_add_array::ptr)]; - - // expr_anim - char dummy8[sizeof (ast::expr_anim::ptr)]; - - // expr_animation - char dummy9[sizeof (ast::expr_animation::ptr)]; - - // expr_animtree - char dummy10[sizeof (ast::expr_animtree::ptr)]; - - // expr_arguments - // expr_arguments_no_empty - char dummy11[sizeof (ast::expr_arguments::ptr)]; - - // expr_array - char dummy12[sizeof (ast::expr_array::ptr)]; - - // expr_call - char dummy13[sizeof (ast::expr_call::ptr)]; - - // expr_complement - char dummy14[sizeof (ast::expr_complement::ptr)]; - - // expr_empty_array - char dummy15[sizeof (ast::expr_empty_array::ptr)]; - - // expr_false - char dummy16[sizeof (ast::expr_false::ptr)]; - - // expr_field - char dummy17[sizeof (ast::expr_field::ptr)]; - - // expr_float - char dummy18[sizeof (ast::expr_float::ptr)]; - - // expr_game - char dummy19[sizeof (ast::expr_game::ptr)]; - - // expr_identifier_nosize - // expr_identifier - char dummy20[sizeof (ast::expr_identifier::ptr)]; - - // expr_integer - char dummy21[sizeof (ast::expr_integer::ptr)]; - - // expr_istring - char dummy22[sizeof (ast::expr_istring::ptr)]; - - // expr_level - char dummy23[sizeof (ast::expr_level::ptr)]; - - // expr_method - char dummy24[sizeof (ast::expr_method::ptr)]; - - // expr_negate - char dummy25[sizeof (ast::expr_negate::ptr)]; - - // expr_not - char dummy26[sizeof (ast::expr_not::ptr)]; - - // expr_parameters - char dummy27[sizeof (ast::expr_parameters::ptr)]; - - // expr_paren - char dummy28[sizeof (ast::expr_paren::ptr)]; - - // expr_path - char dummy29[sizeof (ast::expr_path::ptr)]; - - // expr_reference - char dummy30[sizeof (ast::expr_reference::ptr)]; - - // expr_self - char dummy31[sizeof (ast::expr_self::ptr)]; - - // expr_size - char dummy32[sizeof (ast::expr_size::ptr)]; - - // expr_string - char dummy33[sizeof (ast::expr_string::ptr)]; - - // expr_thisthread - char dummy34[sizeof (ast::expr_thisthread::ptr)]; - - // expr_true - char dummy35[sizeof (ast::expr_true::ptr)]; - - // expr_tuple_arguments - char dummy36[sizeof (ast::expr_tuple::ptr)]; - - // expr_undefined - char dummy37[sizeof (ast::expr_undefined::ptr)]; - - // expr_vector - char dummy38[sizeof (ast::expr_vector::ptr)]; - - // include - char dummy39[sizeof (ast::include::ptr)]; - - // program - char dummy40[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy41[sizeof (ast::stmt)]; - - // stmt_assign - char dummy42[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy43[sizeof (ast::stmt_break::ptr)]; - - // stmt_breakpoint - char dummy44[sizeof (ast::stmt_breakpoint::ptr)]; - - // stmt_call - char dummy45[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy46[sizeof (ast::stmt_case::ptr)]; - - // stmt_continue - char dummy47[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy48[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy49[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy50[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy51[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy52[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy53[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy54[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy55[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy56[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy57[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy58[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy59[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy60[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy61[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy62[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy63[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waitframe - char dummy64[sizeof (ast::stmt_waitframe::ptr)]; - - // stmt_waittill - char dummy65[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy66[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy67[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy68[sizeof (ast::stmt_while::ptr)]; - - // "path" - // "identifier" - // "string literal" - // "localized string" - // "float" - // "integer" - char dummy69[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]; - }; - - /// Whether the content is built: if defined, the name of the stored type. - const std::type_info *yytypeid_; - }; - -#endif - /// Backward compatibility (Bison 3.8). - typedef value_type semantic_type; - - /// Symbol locations. - typedef xsk::gsc::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 - { - H2EMPTY = -2, - H2EOF = 0, // "end of file" - H2error = 1, // error - H2UNDEF = 2, // "invalid token" - SH_DEFINE = 3, // "#define" - SH_UNDEF = 4, // "#undef" - SH_IFDEF = 5, // "#ifdef" - SH_IFNDEF = 6, // "#ifndef" - SH_IF = 7, // "#if" - SH_ELIF = 8, // "#elif" - SH_ELSE = 9, // "#else" - SH_ENDIF = 10, // "#endif" - DEVBEGIN = 11, // "/#" - DEVEND = 12, // "#/" - INLINE = 13, // "#inline" - INCLUDE = 14, // "#include" - USINGTREE = 15, // "#using_animtree" - ANIMTREE = 16, // "#animtree" - ENDON = 17, // "endon" - NOTIFY = 18, // "notify" - WAIT = 19, // "wait" - WAITTILL = 20, // "waittill" - WAITTILLMATCH = 21, // "waittillmatch" - WAITTILLFRAMEEND = 22, // "waittillframeend" - WAITFRAME = 23, // "waitframe" - IF = 24, // "if" - ELSE = 25, // "else" - DO = 26, // "do" - WHILE = 27, // "while" - FOR = 28, // "for" - FOREACH = 29, // "foreach" - IN = 30, // "in" - SWITCH = 31, // "switch" - CASE = 32, // "case" - DEFAULT = 33, // "default" - BREAK = 34, // "break" - CONTINUE = 35, // "continue" - RETURN = 36, // "return" - BREAKPOINT = 37, // "breakpoint" - PROFBEGIN = 38, // "prof_begin" - PROFEND = 39, // "prof_end" - THREAD = 40, // "thread" - CHILDTHREAD = 41, // "childthread" - THISTHREAD = 42, // "thisthread" - CALL = 43, // "call" - TRUE = 44, // "true" - FALSE = 45, // "false" - UNDEFINED = 46, // "undefined" - SIZE = 47, // "size" - GAME = 48, // "game" - SELF = 49, // "self" - ANIM = 50, // "anim" - LEVEL = 51, // "level" - LPAREN = 52, // "(" - RPAREN = 53, // ")" - LBRACE = 54, // "{" - RBRACE = 55, // "}" - LBRACKET = 56, // "[" - RBRACKET = 57, // "]" - COMMA = 58, // "," - DOT = 59, // "." - DOUBLECOLON = 60, // "::" - COLON = 61, // ":" - SEMICOLON = 62, // ";" - QMARK = 63, // "?" - INCREMENT = 64, // "++" - DECREMENT = 65, // "--" - LSHIFT = 66, // "<<" - RSHIFT = 67, // ">>" - OR = 68, // "||" - AND = 69, // "&&" - EQUALITY = 70, // "==" - INEQUALITY = 71, // "!=" - LESS_EQUAL = 72, // "<=" - GREATER_EQUAL = 73, // ">=" - LESS = 74, // "<" - GREATER = 75, // ">" - NOT = 76, // "!" - COMPLEMENT = 77, // "~" - ASSIGN = 78, // "=" - ASSIGN_ADD = 79, // "+=" - ASSIGN_SUB = 80, // "-=" - ASSIGN_MUL = 81, // "*=" - ASSIGN_DIV = 82, // "/=" - ASSIGN_MOD = 83, // "%=" - ASSIGN_BW_OR = 84, // "|=" - ASSIGN_BW_AND = 85, // "&=" - ASSIGN_BW_EXOR = 86, // "^=" - ASSIGN_RSHIFT = 87, // ">>=" - ASSIGN_LSHIFT = 88, // "<<=" - BITWISE_OR = 89, // "|" - BITWISE_AND = 90, // "&" - BITWISE_EXOR = 91, // "^" - ADD = 92, // "+" - SUB = 93, // "-" - MUL = 94, // "*" - DIV = 95, // "/" - MOD = 96, // "%" - PATH = 97, // "path" - IDENTIFIER = 98, // "identifier" - STRING = 99, // "string literal" - ISTRING = 100, // "localized string" - FLOAT = 101, // "float" - INTEGER = 102, // "integer" - SIZEOF = 103, // SIZEOF - ADD_ARRAY = 104, // ADD_ARRAY - THEN = 105, // THEN - TERN = 106, // TERN - NEG = 107, // NEG - ANIMREF = 108, // ANIMREF - PREINC = 109, // PREINC - PREDEC = 110, // PREDEC - POSTINC = 111, // POSTINC - POSTDEC = 112 // POSTDEC - }; - /// Backward compatibility alias (Bison 3.6). - typedef token_kind_type yytokentype; - }; - - /// Token kind, as returned by yylex. - typedef token::token_kind_type 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 = 113, ///< Number of tokens. - S_YYEMPTY = -2, - S_YYEOF = 0, // "end of file" - S_YYerror = 1, // error - S_YYUNDEF = 2, // "invalid token" - S_SH_DEFINE = 3, // "#define" - S_SH_UNDEF = 4, // "#undef" - S_SH_IFDEF = 5, // "#ifdef" - S_SH_IFNDEF = 6, // "#ifndef" - S_SH_IF = 7, // "#if" - S_SH_ELIF = 8, // "#elif" - S_SH_ELSE = 9, // "#else" - S_SH_ENDIF = 10, // "#endif" - S_DEVBEGIN = 11, // "/#" - S_DEVEND = 12, // "#/" - S_INLINE = 13, // "#inline" - S_INCLUDE = 14, // "#include" - S_USINGTREE = 15, // "#using_animtree" - S_ANIMTREE = 16, // "#animtree" - S_ENDON = 17, // "endon" - S_NOTIFY = 18, // "notify" - S_WAIT = 19, // "wait" - S_WAITTILL = 20, // "waittill" - S_WAITTILLMATCH = 21, // "waittillmatch" - S_WAITTILLFRAMEEND = 22, // "waittillframeend" - S_WAITFRAME = 23, // "waitframe" - S_IF = 24, // "if" - S_ELSE = 25, // "else" - S_DO = 26, // "do" - S_WHILE = 27, // "while" - S_FOR = 28, // "for" - S_FOREACH = 29, // "foreach" - S_IN = 30, // "in" - S_SWITCH = 31, // "switch" - S_CASE = 32, // "case" - S_DEFAULT = 33, // "default" - S_BREAK = 34, // "break" - S_CONTINUE = 35, // "continue" - S_RETURN = 36, // "return" - S_BREAKPOINT = 37, // "breakpoint" - S_PROFBEGIN = 38, // "prof_begin" - S_PROFEND = 39, // "prof_end" - S_THREAD = 40, // "thread" - S_CHILDTHREAD = 41, // "childthread" - S_THISTHREAD = 42, // "thisthread" - S_CALL = 43, // "call" - S_TRUE = 44, // "true" - S_FALSE = 45, // "false" - S_UNDEFINED = 46, // "undefined" - S_SIZE = 47, // "size" - S_GAME = 48, // "game" - S_SELF = 49, // "self" - S_ANIM = 50, // "anim" - S_LEVEL = 51, // "level" - S_LPAREN = 52, // "(" - S_RPAREN = 53, // ")" - S_LBRACE = 54, // "{" - S_RBRACE = 55, // "}" - S_LBRACKET = 56, // "[" - S_RBRACKET = 57, // "]" - S_COMMA = 58, // "," - S_DOT = 59, // "." - S_DOUBLECOLON = 60, // "::" - S_COLON = 61, // ":" - S_SEMICOLON = 62, // ";" - S_QMARK = 63, // "?" - S_INCREMENT = 64, // "++" - S_DECREMENT = 65, // "--" - S_LSHIFT = 66, // "<<" - S_RSHIFT = 67, // ">>" - S_OR = 68, // "||" - S_AND = 69, // "&&" - S_EQUALITY = 70, // "==" - S_INEQUALITY = 71, // "!=" - S_LESS_EQUAL = 72, // "<=" - S_GREATER_EQUAL = 73, // ">=" - S_LESS = 74, // "<" - S_GREATER = 75, // ">" - S_NOT = 76, // "!" - S_COMPLEMENT = 77, // "~" - S_ASSIGN = 78, // "=" - S_ASSIGN_ADD = 79, // "+=" - S_ASSIGN_SUB = 80, // "-=" - S_ASSIGN_MUL = 81, // "*=" - S_ASSIGN_DIV = 82, // "/=" - S_ASSIGN_MOD = 83, // "%=" - S_ASSIGN_BW_OR = 84, // "|=" - S_ASSIGN_BW_AND = 85, // "&=" - S_ASSIGN_BW_EXOR = 86, // "^=" - S_ASSIGN_RSHIFT = 87, // ">>=" - S_ASSIGN_LSHIFT = 88, // "<<=" - S_BITWISE_OR = 89, // "|" - S_BITWISE_AND = 90, // "&" - S_BITWISE_EXOR = 91, // "^" - S_ADD = 92, // "+" - S_SUB = 93, // "-" - S_MUL = 94, // "*" - S_DIV = 95, // "/" - S_MOD = 96, // "%" - S_PATH = 97, // "path" - S_IDENTIFIER = 98, // "identifier" - S_STRING = 99, // "string literal" - S_ISTRING = 100, // "localized string" - S_FLOAT = 101, // "float" - S_INTEGER = 102, // "integer" - S_SIZEOF = 103, // SIZEOF - S_ADD_ARRAY = 104, // ADD_ARRAY - S_THEN = 105, // THEN - S_TERN = 106, // TERN - S_NEG = 107, // NEG - S_ANIMREF = 108, // ANIMREF - S_PREINC = 109, // PREINC - S_PREDEC = 110, // PREDEC - S_POSTINC = 111, // POSTINC - S_POSTDEC = 112, // POSTDEC - S_YYACCEPT = 113, // $accept - S_root = 114, // root - S_program = 115, // program - S_inline = 116, // inline - S_include = 117, // include - S_declaration = 118, // declaration - S_decl_usingtree = 119, // decl_usingtree - S_decl_constant = 120, // decl_constant - S_decl_thread = 121, // decl_thread - S_stmt = 122, // stmt - S_stmt_or_dev = 123, // stmt_or_dev - S_stmt_list = 124, // stmt_list - S_stmt_or_dev_list = 125, // stmt_or_dev_list - S_stmt_dev = 126, // stmt_dev - S_stmt_block = 127, // stmt_block - S_stmt_expr = 128, // stmt_expr - S_stmt_call = 129, // stmt_call - S_stmt_assign = 130, // stmt_assign - S_stmt_endon = 131, // stmt_endon - S_stmt_notify = 132, // stmt_notify - S_stmt_wait = 133, // stmt_wait - S_stmt_waittill = 134, // stmt_waittill - S_stmt_waittillmatch = 135, // stmt_waittillmatch - S_stmt_waittillframeend = 136, // stmt_waittillframeend - S_stmt_waitframe = 137, // stmt_waitframe - S_stmt_if = 138, // stmt_if - S_stmt_ifelse = 139, // stmt_ifelse - S_stmt_while = 140, // stmt_while - S_stmt_dowhile = 141, // stmt_dowhile - S_stmt_for = 142, // stmt_for - S_stmt_foreach = 143, // stmt_foreach - S_stmt_switch = 144, // stmt_switch - S_stmt_case = 145, // stmt_case - S_stmt_default = 146, // stmt_default - S_stmt_break = 147, // stmt_break - S_stmt_continue = 148, // stmt_continue - S_stmt_return = 149, // stmt_return - S_stmt_breakpoint = 150, // stmt_breakpoint - S_stmt_prof_begin = 151, // stmt_prof_begin - S_stmt_prof_end = 152, // stmt_prof_end - S_expr = 153, // expr - S_expr_or_empty = 154, // expr_or_empty - S_expr_assign = 155, // expr_assign - S_expr_increment = 156, // expr_increment - S_expr_decrement = 157, // expr_decrement - S_expr_ternary = 158, // expr_ternary - S_expr_binary = 159, // expr_binary - S_expr_primitive = 160, // expr_primitive - S_expr_complement = 161, // expr_complement - S_expr_negate = 162, // expr_negate - S_expr_not = 163, // expr_not - S_expr_call = 164, // expr_call - S_expr_method = 165, // expr_method - S_expr_function = 166, // expr_function - S_expr_pointer = 167, // expr_pointer - S_expr_add_array = 168, // expr_add_array - S_expr_parameters = 169, // expr_parameters - S_expr_arguments = 170, // expr_arguments - S_expr_arguments_no_empty = 171, // expr_arguments_no_empty - S_expr_reference = 172, // expr_reference - S_expr_tuple = 173, // expr_tuple - S_expr_tuple_arguments = 174, // expr_tuple_arguments - S_expr_tuple_types = 175, // expr_tuple_types - S_expr_array = 176, // expr_array - S_expr_field = 177, // expr_field - S_expr_size = 178, // expr_size - S_expr_paren = 179, // expr_paren - S_expr_object = 180, // expr_object - S_expr_thisthread = 181, // expr_thisthread - S_expr_empty_array = 182, // expr_empty_array - S_expr_undefined = 183, // expr_undefined - S_expr_game = 184, // expr_game - S_expr_self = 185, // expr_self - S_expr_anim = 186, // expr_anim - S_expr_level = 187, // expr_level - S_expr_animation = 188, // expr_animation - S_expr_animtree = 189, // expr_animtree - S_expr_identifier_nosize = 190, // expr_identifier_nosize - S_expr_identifier = 191, // expr_identifier - S_expr_path = 192, // expr_path - S_expr_istring = 193, // expr_istring - S_expr_string = 194, // expr_string - S_expr_vector = 195, // expr_vector - S_expr_float = 196, // expr_float - S_expr_integer = 197, // expr_integer - S_expr_false = 198, // expr_false - S_expr_true = 199 // 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 () YY_NOEXCEPT - : 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::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_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_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_add_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_add_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_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_animtree::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_animtree::ptr& v, const location_type& l) - : 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_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_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_negate::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l) - : 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_thisthread::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_thisthread::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_tuple::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_tuple::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::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_waitframe::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_waitframe::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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.template destroy< ast::expr_add_array::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_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.template destroy< ast::expr_negate::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_thisthread: // expr_thisthread - value.template destroy< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.template destroy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.template destroy< ast::stmt_waitframe::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_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_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. - value_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 - { - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; - - /// Default constructor. - by_kind () YY_NOEXCEPT; - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that) YY_NOEXCEPT; -#endif - - /// Copy constructor. - by_kind (const by_kind& that) YY_NOEXCEPT; - - /// Constructor from (external) token numbers. - by_kind (kind_type t) YY_NOEXCEPT; - - - - /// 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 () YY_NOEXCEPT {} - - /// Constructor for valueless symbols, and symbols from each type. -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, location_type l) - : super_type (token_kind_type (tok), std::move (l)) -#else - symbol_type (int tok, const location_type& l) - : super_type (token_kind_type (tok), l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - H2_ASSERT (tok == token::H2EOF - || (token::H2error <= tok && tok <= token::MOD) - || (token::SIZEOF <= tok && tok <= token::POSTDEC)); -#endif - } -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, std::string v, location_type l) - : super_type (token_kind_type (tok), std::move (v), std::move (l)) -#else - symbol_type (int tok, const std::string& v, const location_type& l) - : super_type (token_kind_type (tok), v, l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - H2_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); -#endif - } - }; - - /// Build a parser object. - parser (xsk::gsc::h2::lexer& lexer_yyarg, xsk::gsc::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 H2DEBUG - /// 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 token kind. -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_H2EOF (location_type l) - { - return symbol_type (token::H2EOF, std::move (l)); - } -#else - static - symbol_type - make_H2EOF (const location_type& l) - { - return symbol_type (token::H2EOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_H2error (location_type l) - { - return symbol_type (token::H2error, std::move (l)); - } -#else - static - symbol_type - make_H2error (const location_type& l) - { - return symbol_type (token::H2error, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_H2UNDEF (location_type l) - { - return symbol_type (token::H2UNDEF, std::move (l)); - } -#else - static - symbol_type - make_H2UNDEF (const location_type& l) - { - return symbol_type (token::H2UNDEF, 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_ANIMTREE (location_type l) - { - return symbol_type (token::ANIMTREE, std::move (l)); - } -#else - static - symbol_type - make_ANIMTREE (const location_type& l) - { - return symbol_type (token::ANIMTREE, 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_WAITFRAME (location_type l) - { - return symbol_type (token::WAITFRAME, std::move (l)); - } -#else - static - symbol_type - make_WAITFRAME (const location_type& l) - { - return symbol_type (token::WAITFRAME, 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_CHILDTHREAD (location_type l) - { - return symbol_type (token::CHILDTHREAD, std::move (l)); - } -#else - static - symbol_type - make_CHILDTHREAD (const location_type& l) - { - return symbol_type (token::CHILDTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_THISTHREAD (location_type l) - { - return symbol_type (token::THISTHREAD, std::move (l)); - } -#else - static - symbol_type - make_THISTHREAD (const location_type& l) - { - return symbol_type (token::THISTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_CALL (location_type l) - { - return symbol_type (token::CALL, std::move (l)); - } -#else - static - symbol_type - make_CALL (const location_type& l) - { - return symbol_type (token::CALL, 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_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_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_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_SIZEOF (location_type l) - { - return symbol_type (token::SIZEOF, std::move (l)); - } -#else - static - symbol_type - make_SIZEOF (const location_type& l) - { - return symbol_type (token::SIZEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_ADD_ARRAY (location_type l) - { - return symbol_type (token::ADD_ARRAY, std::move (l)); - } -#else - static - symbol_type - make_ADD_ARRAY (const location_type& l) - { - return symbol_type (token::ADD_ARRAY, 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) YY_NOEXCEPT; - - /// 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) YY_NOEXCEPT; - - 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_kind_type enum. - static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; - - - - // 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 symbol kind of the accessing symbol of - // state STATE-NUM. - static const unsigned char yystos_[]; - - // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. - static const unsigned char yyr1_[]; - - // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. - static const signed char yyr2_[]; - - -#if H2DEBUG - // 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT; - - /// Constants. - enum - { - yylast_ = 2479, ///< Last index in yytable_. - yynnts_ = 87, ///< Number of nonterminal symbols. - yyfinal_ = 22 ///< Termination state number. - }; - - - // User arguments. - xsk::gsc::h2::lexer& lexer; - xsk::gsc::ast::program::ptr& ast; - - }; - - inline - parser::symbol_kind_type - parser::yytranslate_ (int t) YY_NOEXCEPT - { - 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::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_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); - 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_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::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_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_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 () YY_NOEXCEPT - : kind_ (symbol_kind::S_YYEMPTY) - {} - -#if 201103L <= YY_CPLUSPLUS - inline - parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT - : kind_ (that.kind_) - { - that.clear (); - } -#endif - - inline - parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT - : kind_ (that.kind_) - {} - - inline - parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT - : 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::gsc::h2 -#line 5597 "parser.hpp" - - - - -#endif // !YY_H2_PARSER_HPP_INCLUDED diff --git a/src/h2/xsk/resolver.hpp b/src/h2/xsk/resolver.hpp deleted file mode 100644 index 14fc8980..00000000 --- a/src/h2/xsk/resolver.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// 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::gsc::h2 -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto file_id(const std::string& name) -> std::uint16_t; - static auto file_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint16_t; - static auto token_name(std::uint16_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::gsc::h2 diff --git a/src/iw5/iw5_pc.cpp b/src/iw5/iw5_pc.cpp new file mode 100644 index 00000000..6196f17a --- /dev/null +++ b/src/iw5/iw5_pc.cpp @@ -0,0 +1,52 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_pc.hpp" + +namespace xsk::gsc::iw5_pc +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::none, engine::iw5, endian::little, system::pc, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::iw5_pc diff --git a/src/iw5/iw5_pc.hpp b/src/iw5/iw5_pc.hpp new file mode 100644 index 00000000..bd7f7e7c --- /dev/null +++ b/src/iw5/iw5_pc.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::iw5_pc +{ +// IW5 PC 1.9.388110 +constexpr usize code_count = 153; +constexpr usize func_count = 455; +constexpr usize meth_count = 780; +constexpr usize token_count = 6306; +constexpr u32 max_string_id = 33386; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::iw5_pc diff --git a/src/iw5/iw5_pc_code.cpp b/src/iw5/iw5_pc_code.cpp new file mode 100644 index 00000000..1d3d6751 --- /dev/null +++ b/src/iw5/iw5_pc_code.cpp @@ -0,0 +1,168 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_pc.hpp" + +namespace xsk::gsc::iw5_pc +{ + +extern std::array, code_count> const code_list +{{ + { 0x00, opcode::OP_End }, + { 0x01, opcode::OP_Return }, + { 0x02, opcode::OP_GetByte }, + { 0x03, opcode::OP_GetNegByte }, + { 0x04, opcode::OP_GetUnsignedShort }, + { 0x05, opcode::OP_GetNegUnsignedShort }, + { 0x06, opcode::OP_GetInteger }, + { 0x07, opcode::OP_GetBuiltinFunction }, + { 0x08, opcode::OP_GetBuiltinMethod }, + { 0x09, opcode::OP_GetFloat }, + { 0x0A, opcode::OP_GetString }, + { 0x0B, opcode::OP_GetUndefined }, + { 0x0C, opcode::OP_GetZero }, + { 0x0D, opcode::OP_waittillFrameEnd }, + { 0x0E, opcode::OP_CreateLocalVariable }, + { 0x0F, opcode::OP_RemoveLocalVariables }, + { 0x10, opcode::OP_EvalLocalVariableCached0 }, + { 0x11, opcode::OP_EvalLocalVariableCached1 }, + { 0x12, opcode::OP_EvalLocalVariableCached2 }, + { 0x13, opcode::OP_EvalLocalVariableCached3 }, + { 0x14, opcode::OP_EvalLocalVariableCached4 }, + { 0x15, opcode::OP_EvalLocalVariableCached5 }, + { 0x16, opcode::OP_EvalLocalVariableCached }, + { 0x17, opcode::OP_EvalLocalArrayCached }, + { 0x18, opcode::OP_EvalArray }, + { 0x19, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x1A, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x1B, opcode::OP_EvalLocalArrayRefCached }, + { 0x1C, opcode::OP_EvalArrayRef }, + { 0x1D, opcode::OP_ClearArray }, + { 0x1E, opcode::OP_EmptyArray }, + { 0x1F, opcode::OP_AddArray }, + { 0x20, opcode::OP_PreScriptCall }, + { 0x21, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x22, opcode::OP_ScriptLocalFunctionCall }, + { 0x23, opcode::OP_ScriptLocalMethodCall }, + { 0x24, opcode::OP_ScriptLocalThreadCall }, + { 0x25, opcode::OP_ScriptLocalChildThreadCall }, + { 0x26, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x27, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x28, opcode::OP_ScriptFarFunctionCall2 }, + { 0x29, opcode::OP_ScriptFarFunctionCall }, + { 0x2A, opcode::OP_ScriptFarMethodCall }, + { 0x2B, opcode::OP_ScriptFarThreadCall }, + { 0x2C, opcode::OP_ScriptFarChildThreadCall }, + { 0x2D, opcode::OP_ScriptFarMethodThreadCall }, + { 0x2E, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x2F, opcode::OP_ScriptFunctionCallPointer }, + { 0x30, opcode::OP_ScriptMethodCallPointer }, + { 0x31, opcode::OP_ScriptThreadCallPointer }, + { 0x32, opcode::OP_ScriptChildThreadCallPointer }, + { 0x33, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x34, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x35, opcode::OP_CallBuiltinPointer }, + { 0x36, opcode::OP_CallBuiltinMethodPointer }, + { 0x37, opcode::OP_GetIString }, + { 0x38, opcode::OP_GetVector }, + { 0x39, opcode::OP_GetLevelObject }, + { 0x3A, opcode::OP_GetAnimObject }, + { 0x3B, opcode::OP_GetSelf }, + { 0x3C, opcode::OP_GetThisthread }, + { 0x3D, opcode::OP_GetLevel }, + { 0x3E, opcode::OP_GetGame }, + { 0x3F, opcode::OP_GetAnim }, + { 0x40, opcode::OP_GetAnimation }, + { 0x41, opcode::OP_GetGameRef }, + { 0x42, opcode::OP_inc }, + { 0x43, opcode::OP_dec }, + { 0x44, opcode::OP_bit_or }, + { 0x45, opcode::OP_JumpOnFalseExpr }, + { 0x46, opcode::OP_bit_ex_or }, + { 0x47, opcode::OP_bit_and }, + { 0x48, opcode::OP_equality }, + { 0x49, opcode::OP_inequality }, + { 0x4A, opcode::OP_less }, + { 0x4B, opcode::OP_greater }, + { 0x4C, opcode::OP_JumpOnTrueExpr }, + { 0x4D, opcode::OP_less_equal }, + { 0x4E, opcode::OP_jumpback }, + { 0x4F, opcode::OP_waittillmatch2 }, + { 0x50, opcode::OP_waittill }, + { 0x51, opcode::OP_notify }, + { 0x52, opcode::OP_endon }, + { 0x53, opcode::OP_voidCodepos }, + { 0x54, opcode::OP_switch }, + { 0x55, opcode::OP_endswitch }, + { 0x56, opcode::OP_vector }, + { 0x57, opcode::OP_JumpOnFalse }, + { 0x58, opcode::OP_greater_equal }, + { 0x59, opcode::OP_shift_left }, + { 0x5A, opcode::OP_shift_right }, + { 0x5B, opcode::OP_plus }, + { 0x5C, opcode::OP_jump }, + { 0x5D, opcode::OP_minus }, + { 0x5E, opcode::OP_multiply }, + { 0x5F, opcode::OP_divide }, + { 0x60, opcode::OP_mod }, + { 0x61, opcode::OP_JumpOnTrue }, + { 0x62, opcode::OP_size }, + { 0x63, opcode::OP_waittillmatch }, + { 0x64, opcode::OP_GetLocalFunction }, + { 0x65, opcode::OP_GetFarFunction }, + { 0x66, opcode::OP_GetSelfObject }, + { 0x67, opcode::OP_EvalLevelFieldVariable }, + { 0x68, opcode::OP_EvalAnimFieldVariable }, + { 0x69, opcode::OP_EvalSelfFieldVariable }, + { 0x6A, opcode::OP_EvalFieldVariable }, + { 0x6B, opcode::OP_EvalLevelFieldVariableRef }, + { 0x6C, opcode::OP_EvalAnimFieldVariableRef }, + { 0x6D, opcode::OP_EvalSelfFieldVariableRef }, + { 0x6E, opcode::OP_EvalFieldVariableRef }, + { 0x6F, opcode::OP_ClearFieldVariable }, + { 0x70, opcode::OP_SafeCreateVariableFieldCached }, + { 0x71, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x72, opcode::OP_SafeSetVariableFieldCached }, + { 0x73, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x74, opcode::OP_GetAnimTree }, + { 0x75, opcode::OP_clearparams }, + { 0x76, opcode::OP_checkclearparams }, + { 0x77, opcode::OP_EvalLocalVariableRefCached0 }, + { 0x78, opcode::OP_EvalNewLocalVariableRefCached0 }, + { 0x79, opcode::OP_EvalLocalVariableRefCached }, + { 0x7A, opcode::OP_SetLevelFieldVariableField }, + { 0x7B, opcode::OP_SetVariableField }, + { 0x7C, opcode::OP_ClearVariableField }, + { 0x7D, opcode::OP_SetAnimFieldVariableField }, + { 0x7E, opcode::OP_SetSelfFieldVariableField }, + { 0x7F, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x80, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x81, opcode::OP_SetLocalVariableFieldCached }, + { 0x82, opcode::OP_ClearLocalVariableFieldCached }, + { 0x83, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x84, opcode::OP_CallBuiltin0 }, + { 0x85, opcode::OP_CallBuiltin1 }, + { 0x86, opcode::OP_CallBuiltin2 }, + { 0x87, opcode::OP_CallBuiltin3 }, + { 0x88, opcode::OP_CallBuiltin4 }, + { 0x89, opcode::OP_CallBuiltin5 }, + { 0x8A, opcode::OP_CallBuiltin }, + { 0x8B, opcode::OP_CallBuiltinMethod0 }, + { 0x8C, opcode::OP_CallBuiltinMethod1 }, + { 0x8D, opcode::OP_CallBuiltinMethod2 }, + { 0x8E, opcode::OP_CallBuiltinMethod3 }, + { 0x8F, opcode::OP_CallBuiltinMethod4 }, + { 0x90, opcode::OP_CallBuiltinMethod5 }, + { 0x91, opcode::OP_CallBuiltinMethod }, + { 0x92, opcode::OP_wait }, + { 0x93, opcode::OP_DecTop }, + { 0x94, opcode::OP_CastFieldObject }, + { 0x95, opcode::OP_EvalLocalVariableObjectCached }, + { 0x96, opcode::OP_CastBool }, + { 0x97, opcode::OP_BoolNot }, + { 0x98, opcode::OP_BoolComplement }, +}}; + +} // namespace xsk::gsc::iw5_pc diff --git a/src/iw5/iw5_pc_func.cpp b/src/iw5/iw5_pc_func.cpp new file mode 100644 index 00000000..07b4c46f --- /dev/null +++ b/src/iw5/iw5_pc_func.cpp @@ -0,0 +1,470 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_pc.hpp" + +namespace xsk::gsc::iw5_pc +{ + +extern std::array, func_count> const func_list +{{ + { 0x001, "precacheturret" }, + { 0x002, "getweaponarray" }, + { 0x003, "createprintchannel" }, + { 0x004, "updategamerprofileall" }, + { 0x005, "clearlocalizedstrings" }, + { 0x006, "setphysicsgravitydir" }, + { 0x007, "gettimescale" }, + { 0x008, "settimescale" }, + { 0x009, "setslowmotionview" }, + { 0x00A, "forcesharedammo" }, + { 0x00B, "refreshhudcompass" }, + { 0x00C, "refreshhudammocounter" }, + { 0x00D, "notifyoncommand" }, + { 0x00E, "setprintchannel" }, + { 0x00F, "print" }, + { 0x010, "println" }, + { 0x011, "print3d" }, + { 0x012, "line" }, + { 0x013, "spawnturret" }, + { 0x014, "canspawnturret" }, + { 0x015, "assert" }, + { 0x016, "pausecinematicingame" }, + { 0x017, "drawcompassfriendlies" }, + { 0x018, "bulletspread" }, + { 0x019, "bullettracer" }, + { 0x01A, "badplace_delete" }, + { 0x01B, "badplace_cylinder" }, + { 0x01C, "badplace_arc" }, + { 0x01D, "badplace_brush" }, + { 0x01E, "clearallcorpses" }, + { 0x01F, "setturretnode" }, + { 0x020, "unsetturretnode" }, + { 0x021, "setnodepriority" }, + { 0x022, "isnodeoccupied" }, + { 0x023, "setdebugorigin" }, + { 0x024, "setdebugangles" }, + { 0x025, "updategamerprofile" }, + { 0x026, "assertex" }, + { 0x027, "assertmsg" }, + { 0x028, "isdefined" }, + { 0x029, "isstring" }, + { 0x02A, "setdvar" }, + { 0x02B, "setdynamicdvar" }, + { 0x02C, "setdvarifuninitialized" }, + { 0x02D, "setdevdvar" }, + { 0x02E, "setdevdvarifuninitialized" }, + { 0x02F, "getdvar" }, + { 0x030, "getdvarint" }, + { 0x031, "getdvarfloat" }, + { 0x032, "getdvarvector" }, + { 0x033, "gettime" }, + { 0x034, "getentbynum" }, + { 0x035, "getweaponmodel" }, + { 0x036, "getculldist" }, + { 0x037, "sethalfresparticles" }, + { 0x038, "getmapsunlight" }, + { 0x039, "setsunlight" }, + { 0x03A, "resetsunlight" }, + { 0x03B, "getmapsundirection" }, + { 0x03C, "getmapsunangles" }, + { 0x03D, "setsundirection" }, + { 0x03E, "lerpsundirection" }, + { 0x03F, "lerpsunangles" }, + { 0x040, "resetsundirection" }, + { 0x041, "enableforcedsunshadows" }, + { 0x042, "enableforcednosunshadows" }, + { 0x043, "disableforcedsunshadows" }, + { 0x044, "enableouterspacemodellighting" }, + { 0x045, "disableouterspacemodellighting" }, + { 0x046, "remapstage" }, + { 0x047, "changelevel" }, + { 0x048, "missionsuccess" }, + { 0x049, "missionfailed" }, + { 0x04A, "cinematic" }, + { 0x04B, "cinematicingame" }, + { 0x04C, "cinematicingamesync" }, + { 0x04D, "cinematicingameloop" }, + { 0x04E, "cinematicingameloopresident" }, + { 0x04F, "iscinematicplaying" }, + { 0x050, "stopcinematicingame" }, + { 0x051, "getweaponhidetags" }, + { 0x052, "getanimlength" }, + { 0x053, "animhasnotetrack" }, + { 0x054, "getnotetracktimes" }, + { 0x055, "spawn" }, + { 0x056, "spawnloopsound" }, + { 0x057, "spawnloopingsound" }, + { 0x058, "bullettrace" }, + { 0x059, "target_setmaxsize" }, + { 0x05A, "target_setcolor" }, + { 0x05B, "target_setdelay" }, + { 0x05C, "getstartorigin" }, + { 0x05D, "getstartangles" }, + { 0x05E, "getcycleoriginoffset" }, + { 0x05F, "magicgrenade" }, + { 0x060, "magicgrenademanual" }, + { 0x061, "setblur" }, + { 0x062, "musicplay" }, + { 0x063, "musicstop" }, + { 0x064, "soundfade" }, + { 0x065, "soundsettimescalefactor" }, + { 0x066, "soundresettimescale" }, + { 0x067, "setocclusionpreset" }, + { 0x068, "levelsoundfade" }, + { 0x069, "precachenightvisioncodeassets" }, + { 0x06A, "precachedigitaldistortcodeassets" }, + { 0x06B, "precacheminimapsentrycodeassets" }, + { 0x06C, "savegame" }, + { 0x06D, "issavesuccessful" }, + { 0x06E, "issaverecentlyloaded" }, + { 0x06F, "savegamenocommit" }, + { 0x070, "commitsave" }, + { 0x071, "commitwouldbevalid" }, + { 0x072, "getfxvisibility" }, + { 0x073, "setculldist" }, + { 0x074, "bullettracepassed" }, + { 0x075, "sighttracepassed" }, + { 0x076, "physicstrace" }, + { 0x077, "playerphysicstrace" }, + { 0x078, "getgroundposition" }, + { 0x079, "getmovedelta" }, + { 0x07A, "getangledelta" }, + { 0x07B, "getnorthyaw" }, + { 0x07C, "getcommandfromkey" }, + { 0x07D, "getsticksconfig" }, + { 0x07E, "weaponfightdist" }, + { 0x07F, "weaponmaxdist" }, + { 0x080, "isturretactive" }, + { 0x081, "target_alloc" }, + { 0x082, "target_flush" }, + { 0x083, "target_set" }, + { 0x084, "target_remove" }, + { 0x085, "target_setshader" }, + { 0x086, "target_setoffscreenshader" }, + { 0x087, "target_isinrect" }, + { 0x088, "target_isincircle" }, + { 0x089, "target_startreticlelockon" }, + { 0x08A, "target_clearreticlelockon" }, + { 0x08B, "target_getarray" }, + { 0x08C, "target_istarget" }, + { 0x08D, "target_setattackmode" }, + { 0x08E, "target_setjavelinonly" }, + { 0x08F, "target_hidefromplayer" }, + { 0x090, "target_showtoplayer" }, + { 0x091, "target_setscaledrendermode" }, + { 0x092, "target_drawcornersonly" }, + { 0x093, "target_drawsquare" }, + { 0x094, "target_drawsingle" }, + { 0x095, "target_setminsize" }, + { 0x096, "setnorthyaw" }, + { 0x097, "setslowmotion" }, + { 0x098, "randomint" }, + { 0x099, "randomfloat" }, + { 0x09A, "randomintrange" }, + { 0x09B, "randomfloatrange" }, + { 0x09C, "sin" }, + { 0x09D, "cos" }, + { 0x09E, "tan" }, + { 0x09F, "asin" }, + { 0x0A0, "acos" }, + { 0x0A1, "atan" }, + { 0x0A2, "int" }, + { 0x0A3, "float" }, + { 0x0A4, "abs" }, + { 0x0A5, "min" }, + { 0x0A6, "objective_additionalcurrent" }, + { 0x0A7, "objective_ring" }, + { 0x0A8, "objective_setpointertextoverride" }, + { 0x0A9, "getnode" }, + { 0x0AA, "getnodearray" }, + { 0x0AB, "getallnodes" }, + { 0x0AC, "getnodesinradius" }, + { 0x0AD, "getnodesinradiussorted" }, + { 0x0AE, "getclosestnodeinsight" }, + { 0x0AF, "getreflectionlocs" }, + { 0x0B0, "getreflectionreferencelocs" }, + { 0x0B1, "getvehicletracksegment" }, + { 0x0B2, "getvehicletracksegmentarray" }, + { 0x0B3, "getallvehicletracksegments" }, + { 0x0B4, "isarray" }, + { 0x0B5, "isai" }, + { 0x0B6, "issentient" }, + { 0x0B7, "isgodmode" }, + { 0x0B8, "getdebugdvar" }, + { 0x0B9, "getdebugdvarint" }, + { 0x0BA, "getdebugdvarfloat" }, + { 0x0BB, "setsaveddvar" }, + { 0x0BC, "getfreeaicount" }, + { 0x0BD, "getaicount" }, + { 0x0BE, "getaiarray" }, + { 0x0BF, "getaispeciesarray" }, + { 0x0C0, "getspawnerarray" }, + { 0x0C1, "getcorpsearray" }, + { 0x0C2, "getspawnerteamarray" }, + { 0x0C3, "getweaponclipmodel" }, + { 0x0C4, "getbrushmodelcenter" }, + { 0x0C5, "getkeybinding" }, + { 0x0C6, "max" }, + { 0x0C7, "floor" }, + { 0x0C8, "ceil" }, + { 0x0C9, "exp" }, + { 0x0CA, "log" }, + { 0x0CB, "sqrt" }, + { 0x0CC, "squared" }, + { 0x0CD, "clamp" }, + { 0x0CE, "angleclamp" }, + { 0x0CF, "angleclamp180" }, + { 0x0D0, "vectorfromlinetopoint" }, + { 0x0D1, "pointonsegmentnearesttopoint" }, + { 0x0D2, "distance" }, + { 0x0D3, "distance2d" }, + { 0x0D4, "distancesquared" }, + { 0x0D5, "length" }, + { 0x0D6, "lengthsquared" }, + { 0x0D7, "closer" }, + { 0x0D8, "vectordot" }, + { 0x0D9, "visionsetthermal" }, + { 0x0DA, "visionsetpain" }, + { 0x0DB, "endlobby" }, + { 0x0DC, "setac130ambience" }, + { 0x0DD, "getmapcustom" }, + { 0x0DE, "updateskill" }, + { 0x0DF, "spawnsighttrace" }, + { 0x0E0, "incrementcounter" }, + { 0x0E1, "getcountertotal" }, + { 0x0E2, "getlevelticks" }, + { 0x0E3, "perlinnoise2d" }, + { 0x0E4, "calcrockingangles" }, + { 0x0E5, "sethudlighting" }, + { 0x0E6, "reconevent" }, + { 0x0E7, "reconspatialevent" }, + { 0x0E8, "setsunflareposition" }, + { 0x0E9, "createthreatbiasgroup" }, + { 0x0EA, "threatbiasgroupexists" }, + { 0x0EB, "getthreatbias" }, + { 0x0EC, "setthreatbias" }, + { 0x0ED, "setthreatbiasagainstall" }, + { 0x0EE, "setignoremegroup" }, + { 0x0EF, "isenemyteam" }, + { 0x0F0, "objective_additionalentity" }, + { 0x0F1, "objective_state_nomessage" }, + { 0x0F2, "objective_string" }, + { 0x0F3, "objective_string_nomessage" }, + { 0x0F4, "objective_additionalposition" }, + { 0x0F5, "objective_current_nomessage" }, + { 0x0F6, "vectornormalize" }, + { 0x0F7, "vectortoangles" }, + { 0x0F8, "vectortoyaw" }, + { 0x0F9, "vectorlerp" }, + { 0x0FA, "anglestoup" }, + { 0x0FB, "anglestoright" }, + { 0x0FC, "anglestoforward" }, + { 0x0FD, "combineangles" }, + { 0x0FE, "transformmove" }, + { 0x0FF, "issubstr" }, + { 0x100, "isendstr" }, + { 0x101, "getsubstr" }, + { 0x102, "tolower" }, + { 0x103, "strtok" }, + { 0x104, "stricmp" }, + { 0x105, "ambientplay" }, + { 0x106, "getuavstrengthmax" }, + { 0x107, "getuavstrengthlevelneutral" }, + { 0x108, "getuavstrengthlevelshowenemyfastsweep" }, + { 0x109, "getuavstrengthlevelshowenemydirectional" }, + { 0x10A, "blockteamradar" }, + { 0x10B, "unblockteamradar" }, + { 0x10C, "isteamradarblocked" }, + { 0x10D, "getassignedteam" }, + { 0x10E, "setmatchdata" }, + { 0x10F, "getmatchdata" }, + { 0x110, "sendmatchdata" }, + { 0x111, "clearmatchdata" }, + { 0x112, "setmatchdatadef" }, + { 0x113, "setmatchclientip" }, + { 0x114, "setmatchdataid" }, + { 0x115, "setclientmatchdata" }, + { 0x116, "getclientmatchdata" }, + { 0x117, "setclientmatchdatadef" }, + { 0x118, "sendclientmatchdata" }, + { 0x119, "getbuildversion" }, + { 0x11A, "getbuildnumber" }, + { 0x11B, "getsystemtime" }, + { 0x11C, "getmatchrulesdata" }, + { 0x11D, "isusingmatchrulesdata" }, + { 0x11E, "kick" }, + { 0x11F, "issplitscreen" }, + { 0x120, "setmapcenter" }, + { 0x121, "setgameendtime" }, + { 0x122, "visionsetnaked" }, + { 0x123, "visionsetnight" }, + { 0x124, "visionsetmissilecam" }, + { 0x125, "ambientstop" }, + { 0x126, "precachemodel" }, + { 0x127, "precacheshellshock" }, + { 0x128, "precacheitem" }, + { 0x129, "precacheshader" }, + { 0x12A, "precachestring" }, + { 0x12B, "precachemenu" }, + { 0x12C, "precacherumble" }, + { 0x12D, "precachelocationselector" }, + { 0x12E, "precacheleaderboards" }, + { 0x12F, "loadfx" }, + { 0x130, "playfx" }, + { 0x131, "playfxontag" }, + { 0x132, "stopfxontag" }, + { 0x133, "playloopedfx" }, + { 0x134, "spawnfx" }, + { 0x135, "triggerfx" }, + { 0x136, "playfxontagforclients" }, + { 0x137, "setwinningteam" }, + { 0x138, "announcement" }, + { 0x139, "clientannouncement" }, + { 0x13A, "getteamscore" }, + { 0x13B, "setteamscore" }, + { 0x13C, "setclientnamemode" }, + { 0x13D, "updateclientnames" }, + { 0x13E, "getteamplayersalive" }, + { 0x13F, "logprint" }, + { 0x140, "worldentnumber" }, + { 0x141, "obituary" }, + { 0x142, "positionwouldtelefrag" }, + { 0x143, "canspawn" }, + { 0x144, "getstarttime" }, + { 0x145, "precachestatusicon" }, + { 0x146, "precacheheadicon" }, + { 0x147, "precacheminimapicon" }, + { 0x148, "precachempanim" }, + { 0x149, "map_restart" }, + { 0x14A, "exitlevel" }, + { 0x14B, "addtestclient" }, + { 0x14C, "makedvarserverinfo" }, + { 0x14D, "setarchive" }, + { 0x14E, "allclientsprint" }, + { 0x14F, "clientprint" }, + { 0x150, "mapexists" }, + { 0x151, "isvalidgametype" }, + { 0x152, "matchend" }, + { 0x153, "setplayerteamrank" }, + { 0x154, "endparty" }, + { 0x155, "setteamradar" }, + { 0x156, "getteamradar" }, + { 0x157, "setteamradarstrength" }, + { 0x158, "getteamradarstrength" }, + { 0x159, "getuavstrengthmin" }, + { 0x15A, "physicsexplosionsphere" }, + { 0x15B, "physicsexplosioncylinder" }, + { 0x15C, "physicsjolt" }, + { 0x15D, "physicsjitter" }, + { 0x15E, "setexpfog" }, + { 0x15F, "isexplosivedamagemod" }, + { 0x160, "radiusdamage" }, + { 0x161, "setplayerignoreradiusdamage" }, + { 0x162, "glassradiusdamage" }, + { 0x163, "earthquake" }, + { 0x164, "getnumparts" }, + { 0x165, "objective_onentity" }, + { 0x166, "objective_team" }, + { 0x167, "objective_player" }, + { 0x168, "objective_playerteam" }, + { 0x169, "objective_playerenemyteam" }, + { 0x16A, "iprintln" }, + { 0x16B, "iprintlnbold" }, + { 0x16C, "logstring" }, + { 0x16D, "getent" }, + { 0x16E, "getentarray" }, + { 0x16F, "spawnplane" }, + { 0x170, "spawnstruct" }, + { 0x171, "spawnhelicopter" }, + { 0x172, "isalive" }, + { 0x173, "isspawner" }, + { 0x174, "missile_createattractorent" }, + { 0x175, "missile_createattractororigin" }, + { 0x176, "missile_createrepulsorent" }, + { 0x177, "missile_createrepulsororigin" }, + { 0x178, "missile_deleteattractor" }, + { 0x179, "playsoundatpos" }, + { 0x17A, "newhudelem" }, + { 0x17B, "newclienthudelem" }, + { 0x17C, "newteamhudelem" }, + { 0x17D, "resettimeout" }, + { 0x17E, "precachefxteamthermal" }, + { 0x17F, "isplayer" }, + { 0x180, "isplayernumber" }, + { 0x181, "setwinningplayer" }, + { 0x182, "getpartname" }, + { 0x183, "weaponfiretime" }, + { 0x184, "weaponclipsize" }, + { 0x185, "weaponisauto" }, + { 0x186, "weaponissemiauto" }, + { 0x187, "weaponisboltaction" }, + { 0x188, "weaponinheritsperks" }, + { 0x189, "weaponburstcount" }, + { 0x18A, "weapontype" }, + { 0x18B, "weaponclass" }, + { 0x18C, "getnextarraykey" }, + { 0x18D, "sortbydistance" }, + { 0x18E, "tablelookup" }, + { 0x18F, "tablelookupbyrow" }, + { 0x190, "tablelookupistring" }, + { 0x191, "tablelookupistringbyrow" }, + { 0x192, "tablelookuprownum" }, + { 0x193, "getmissileowner" }, + { 0x194, "magicbullet" }, + { 0x195, "getweaponflashtagname" }, + { 0x196, "averagepoint" }, + { 0x197, "averagenormal" }, + { 0x198, "vehicle_getspawnerarray" }, + { 0x199, "playrumbleonposition" }, + { 0x19A, "playrumblelooponposition" }, + { 0x19B, "stopallrumbles" }, + { 0x19C, "soundexists" }, + { 0x19D, "openfile" }, + { 0x19E, "closefile" }, + { 0x19F, "fprintln" }, + { 0x1A0, "fprintfields" }, + { 0x1A1, "freadln" }, + { 0x1A2, "fgetarg" }, + { 0x1A3, "setminimap" }, + { 0x1A4, "setthermalbodymaterial" }, + { 0x1A5, "getarraykeys" }, + { 0x1A6, "getfirstarraykey" }, + { 0x1A7, "getglass" }, + { 0x1A8, "getglassarray" }, + { 0x1A9, "getglassorigin" }, + { 0x1AA, "isglassdestroyed" }, + { 0x1AB, "destroyglass" }, + { 0x1AC, "deleteglass" }, + { 0x1AD, "getentchannelscount" }, + { 0x1AE, "getentchannelname" }, + { 0x1AF, "objective_add" }, + { 0x1B0, "objective_delete" }, + { 0x1B1, "objective_state" }, + { 0x1B2, "objective_icon" }, + { 0x1B3, "objective_position" }, + { 0x1B4, "objective_current" }, + { 0x1B5, "weaponinventorytype" }, + { 0x1B6, "weaponstartammo" }, + { 0x1B7, "weaponmaxammo" }, + { 0x1B8, "weaponaltweaponname" }, + { 0x1B9, "isweaponcliponly" }, + { 0x1BA, "isweapondetonationtimed" }, + { 0x1BB, "weaponhasthermalscope" }, + { 0x1BC, "getvehiclenode" }, + { 0x1BD, "getvehiclenodearray" }, + { 0x1BE, "getallvehiclenodes" }, + { 0x1BF, "getnumvehicles" }, + { 0x1C0, "precachevehicle" }, + { 0x1C1, "spawnvehicle" }, + { 0x1C2, "vehicle_getarray" }, + { 0x1C3, "gettimesincelastpaused" }, + { 0x1C4, "setlasermaterial" }, + { 0x1C5, "precachefxontag" }, + { 0x1C6, "precachetag" }, + { 0x1C7, "precachesound" }, +}}; + +} // namespace xsk::gsc::iw5_pc diff --git a/src/iw5/iw5_pc_meth.cpp b/src/iw5/iw5_pc_meth.cpp new file mode 100644 index 00000000..e9a1e141 --- /dev/null +++ b/src/iw5/iw5_pc_meth.cpp @@ -0,0 +1,796 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_pc.hpp" + +namespace xsk::gsc::iw5_pc +{ + +extern std::array, meth_count> const meth_list +{{ + { 0x8000, "thermaldrawdisable" }, + { 0x8001, "setturretdismountorg" }, + { 0x8002, "setdamagestate" }, + { 0x8003, "playsoundtoteam" }, + { 0x8004, "playsoundtoplayer" }, + { 0x8005, "playerhide" }, + { 0x8006, "showtoplayer" }, + { 0x8007, "enableplayeruse" }, + { 0x8008, "disableplayeruse" }, + { 0x8009, "makescrambler" }, + { 0x800A, "makeportableradar" }, + { 0x800B, "maketrophysystem" }, + { 0x800C, "placespawnpoint" }, + { 0x800D, "setteamfortrigger" }, + { 0x800E, "clientclaimtrigger" }, + { 0x800F, "clientreleasetrigger" }, + { 0x8010, "releaseclaimedtrigger" }, + { 0x8011, "isusingonlinedataoffline" }, + { 0x8012, "getrestedtime" }, + { 0x8013, "sendleaderboards" }, + { 0x8014, "isonladder" }, + { 0x8015, "getcorpseanim" }, + { 0x8016, "playerforcedeathanim" }, + { 0x8017, "attach" }, + { 0x8018, "attachshieldmodel" }, + { 0x8019, "getlightfovinner" }, + { 0x801A, "getlightfovouter" }, + { 0x801B, "setlightfovrange" }, + { 0x801C, "getlightexponent" }, + { 0x801D, "setlightexponent" }, + { 0x801E, "startragdoll" }, + { 0x801F, "startragdollfromimpact" }, + { 0x8020, "logstring" }, + { 0x8021, "laserhidefromclient" }, + { 0x8022, "stopsoundchannel" }, + { 0x8023, "thermaldrawenable" }, + { 0x8024, "detach" }, + { 0x8025, "detachshieldmodel" }, + { 0x8026, "moveshieldmodel" }, + { 0x8027, "detachall" }, + { 0x8028, "getattachsize" }, + { 0x8029, "getattachmodelname" }, + { 0x802A, "getattachtagname" }, + { 0x802B, "setturretcanaidetach" }, + { 0x802C, "setturretfov" }, + { 0x802D, "lerpfov" }, + { 0x802E, "getvalidcoverpeekouts" }, + { 0x802F, "gethighestnodestance" }, + { 0x8030, "doesnodeallowstance" }, + { 0x8031, "getgunangles" }, + { 0x8032, "magicgrenade" }, + { 0x8033, "magicgrenademanual" }, + { 0x8034, "setfriendlychain" }, + { 0x8035, "getentnum" }, + { 0x8036, "launch" }, + { 0x8037, "setsoundblend" }, + { 0x8038, "makefakeai" }, + { 0x8039, "spawndrone" }, + { 0x803A, "setcorpseremovetimer" }, + { 0x803B, "setlookattext" }, + { 0x803C, "setspawnerteam" }, + { 0x803D, "addaieventlistener" }, + { 0x803E, "removeaieventlistener" }, + { 0x803F, "getlightcolor" }, + { 0x8040, "setlightcolor" }, + { 0x8041, "getlightradius" }, + { 0x8042, "setlightradius" }, + { 0x8043, "getattachignorecollision" }, + { 0x8044, "hidepart" }, + { 0x8045, "hidepart_allinstances" }, + { 0x8046, "hideallparts" }, + { 0x8047, "showpart" }, + { 0x8048, "showallparts" }, + { 0x8049, "linkto" }, + { 0x804A, "linktoblendtotag" }, + { 0x804B, "unlink" }, + { 0x804C, "setnormalhealth" }, + { 0x804D, "dodamage" }, + { 0x804E, "kill" }, + { 0x804F, "show" }, + { 0x8050, "hide" }, + { 0x8051, "showonclient" }, + { 0x8052, "hideonclient" }, + { 0x8053, "laserforceon" }, + { 0x8054, "laserforceoff" }, + { 0x8055, "disconnectpaths" }, + { 0x8056, "connectpaths" }, + { 0x8057, "startusingheroonlylighting" }, + { 0x8058, "stopusingheroonlylighting" }, + { 0x8059, "startusinglessfrequentlighting" }, + { 0x805A, "stopusinglessfrequentlighting" }, + { 0x805B, "setthermalfog" }, + { 0x805C, "setnightvisionfog" }, + { 0x805D, "clearthermalfog" }, + { 0x805E, "clearnightvisionfog" }, + { 0x805F, "digitaldistortsetparams" }, + { 0x8060, "setmode" }, + { 0x8061, "getmode" }, + { 0x8062, "setturretignoregoals" }, + { 0x8063, "islinked" }, + { 0x8064, "enablelinkto" }, + { 0x8065, "playsoundatviewheight" }, + { 0x8066, "prefetchsound" }, + { 0x8067, "setpitch" }, + { 0x8068, "scalepitch" }, + { 0x8069, "setvolume" }, + { 0x806A, "scalevolume" }, + { 0x806B, "setspeakermapmonotostereo" }, + { 0x806C, "setspeakermapmonoto51" }, + { 0x806D, "setdistributed2dsound" }, + { 0x806E, "playsoundasmaster" }, + { 0x806F, "playloopsound" }, + { 0x8070, "eqon" }, + { 0x8071, "eqoff" }, + { 0x8072, "haseq" }, + { 0x8073, "iswaitingonsound" }, + { 0x8074, "getnormalhealth" }, + { 0x8075, "playerlinkto" }, + { 0x8076, "playerlinktodelta" }, + { 0x8077, "playerlinkweaponviewtodelta" }, + { 0x8078, "playerlinktoabsolute" }, + { 0x8079, "playerlinktoblend" }, + { 0x807A, "playerlinkedoffsetenable" }, + { 0x807B, "setwaypointedgestyle_secondaryarrow" }, + { 0x807C, "setwaypointiconoffscreenonly" }, + { 0x807D, "fadeovertime" }, + { 0x807E, "scaleovertime" }, + { 0x807F, "moveovertime" }, + { 0x8080, "reset" }, + { 0x8081, "destroy" }, + { 0x8082, "setpulsefx" }, + { 0x8083, "setplayernamestring" }, + { 0x8084, "changefontscaleovertime" }, + { 0x8085, "startignoringspotlight" }, + { 0x8086, "stopignoringspotlight" }, + { 0x8087, "dontcastshadows" }, + { 0x8088, "castshadows" }, + { 0x8089, "setstablemissile" }, + { 0x808A, "playersetgroundreferenceent" }, + { 0x808B, "dontinterpolate" }, + { 0x808C, "dospawn" }, + { 0x808D, "stalingradspawn" }, + { 0x808E, "getorigin" }, + { 0x808F, "getcentroid" }, + { 0x8090, "getshootatpos" }, + { 0x8091, "getdebugeye" }, + { 0x8092, "useby" }, + { 0x8093, "playsound" }, + { 0x8094, "playerlinkedoffsetdisable" }, + { 0x8095, "playerlinkedsetviewznear" }, + { 0x8096, "playerlinkedsetusebaseangleforviewclamp" }, + { 0x8097, "lerpviewangleclamp" }, + { 0x8098, "setviewangleresistance" }, + { 0x8099, "geteye" }, + { 0x809A, "istouching" }, + { 0x809B, "stoploopsound" }, + { 0x809C, "stopsounds" }, + { 0x809D, "playrumbleonentity" }, + { 0x809E, "playrumblelooponentity" }, + { 0x809F, "stoprumble" }, + { 0x80A0, "delete" }, + { 0x80A1, "setmodel" }, + { 0x80A2, "laseron" }, + { 0x80A3, "laseroff" }, + { 0x80A4, "laseraltviewon" }, + { 0x80A5, "laseraltviewoff" }, + { 0x80A6, "thermalvisionon" }, + { 0x80A7, "thermalvisionoff" }, + { 0x80A8, "thermalvisionfofoverlayon" }, + { 0x80A9, "thermalvisionfofoverlayoff" }, + { 0x80AA, "autospotoverlayon" }, + { 0x80AB, "autospotoverlayoff" }, + { 0x80AC, "setcontents" }, + { 0x80AD, "makeusable" }, + { 0x80AE, "makeunusable" }, + { 0x80AF, "setwhizbyprobabilities" }, + { 0x80B0, "visionsetnakedforplayer_lerp" }, + { 0x80B1, "setwaitnode" }, + { 0x80B2, "returnplayercontrol" }, + { 0x80B3, "vehphys_starttrack" }, + { 0x80B4, "vehphys_clearautodisable" }, + { 0x80B5, "vehicleusealtblendedaudio" }, + { 0x80B6, "settext" }, + { 0x80B7, "clearalltextafterhudelem" }, + { 0x80B8, "setshader" }, + { 0x80B9, "settargetent" }, + { 0x80BA, "cleartargetent" }, + { 0x80BB, "settimer" }, + { 0x80BC, "settimerup" }, + { 0x80BD, "settimerstatic" }, + { 0x80BE, "settenthstimer" }, + { 0x80BF, "settenthstimerup" }, + { 0x80C0, "settenthstimerstatic" }, + { 0x80C1, "setclock" }, + { 0x80C2, "setclockup" }, + { 0x80C3, "setvalue" }, + { 0x80C4, "setwaypoint" }, + { 0x80C5, "setwaypointedgestyle_rotatingicon" }, + { 0x80C6, "setcursorhint" }, + { 0x80C7, "sethintstring" }, + { 0x80C8, "forceusehinton" }, + { 0x80C9, "forceusehintoff" }, + { 0x80CA, "makesoft" }, + { 0x80CB, "makehard" }, + { 0x80CC, "willneverchange" }, + { 0x80CD, "startfiring" }, + { 0x80CE, "stopfiring" }, + { 0x80CF, "isfiringturret" }, + { 0x80D0, "startbarrelspin" }, + { 0x80D1, "stopbarrelspin" }, + { 0x80D2, "getbarrelspinrate" }, + { 0x80D3, "remotecontrolturret" }, + { 0x80D4, "remotecontrolturretoff" }, + { 0x80D5, "shootturret" }, + { 0x80D6, "getturretowner" }, + { 0x80D7, "enabledeathshield" }, + { 0x80D8, "nightvisiongogglesforceon" }, + { 0x80D9, "nightvisiongogglesforceoff" }, + { 0x80DA, "enableinvulnerability" }, + { 0x80DB, "disableinvulnerability" }, + { 0x80DC, "enablebreaching" }, + { 0x80DD, "disablebreaching" }, + { 0x80DE, "forceviewmodelanimation" }, + { 0x80DF, "disableturretdismount" }, + { 0x80E0, "enableturretdismount" }, + { 0x80E1, "uploadscore" }, + { 0x80E2, "uploadtime" }, + { 0x80E3, "uploadleaderboards" }, + { 0x80E4, "giveachievement" }, + { 0x80E5, "hidehud" }, + { 0x80E6, "showhud" }, + { 0x80E7, "mountvehicle" }, + { 0x80E8, "dismountvehicle" }, + { 0x80E9, "enableslowaim" }, + { 0x80EA, "disableslowaim" }, + { 0x80EB, "usehintsinvehicle" }, + { 0x80EC, "vehicleattackbuttonpressed" }, + { 0x80ED, "setwhizbyoffset" }, + { 0x80EE, "setsentryowner" }, + { 0x80EF, "setsentrycarrier" }, + { 0x80F0, "setturretminimapvisible" }, + { 0x80F1, "settargetentity" }, + { 0x80F2, "snaptotargetentity" }, + { 0x80F3, "cleartargetentity" }, + { 0x80F4, "getturrettarget" }, + { 0x80F5, "setplayerspread" }, + { 0x80F6, "setaispread" }, + { 0x80F7, "setsuppressiontime" }, + { 0x80F8, "setflaggedanimknobrestart" }, + { 0x80F9, "setflaggedanimknoblimitedrestart" }, + { 0x80FA, "setflaggedanimknoball" }, + { 0x80FB, "setflaggedanimknoballrestart" }, + { 0x80FC, "setflaggedanim" }, + { 0x80FD, "setflaggedanimlimited" }, + { 0x80FE, "setflaggedanimrestart" }, + { 0x80FF, "setflaggedanimlimitedrestart" }, + { 0x8100, "useanimtree" }, + { 0x8101, "stopuseanimtree" }, + { 0x8102, "setanimtime" }, + { 0x8103, "showviewmodel" }, + { 0x8104, "hideviewmodel" }, + { 0x8105, "allowstand" }, + { 0x8106, "allowcrouch" }, + { 0x8107, "allowprone" }, + { 0x8108, "allowlean" }, + { 0x8109, "setocclusion" }, + { 0x810A, "deactivateocclusion" }, + { 0x810B, "isocclusionenabled" }, + { 0x810C, "iseqenabled" }, + { 0x810D, "seteq" }, + { 0x810E, "seteqbands" }, + { 0x810F, "deactivateeq" }, + { 0x8110, "seteqlerp" }, + { 0x8111, "islookingat" }, + { 0x8112, "isthrowinggrenade" }, + { 0x8113, "isfiring" }, + { 0x8114, "ismeleeing" }, + { 0x8115, "setautopickup" }, + { 0x8116, "allowmelee" }, + { 0x8117, "allowfire" }, + { 0x8118, "enablehealthshield" }, + { 0x8119, "setconvergencetime" }, + { 0x811A, "setconvergenceheightpercent" }, + { 0x811B, "setturretteam" }, + { 0x811C, "maketurretsolid" }, + { 0x811D, "maketurretoperable" }, + { 0x811E, "maketurretinoperable" }, + { 0x811F, "makeentitysentient" }, + { 0x8120, "freeentitysentient" }, + { 0x8121, "isindoor" }, + { 0x8122, "getdroptofloorposition" }, + { 0x8123, "isbadguy" }, + { 0x8124, "animscripted" }, + { 0x8125, "animscriptedthirdperson" }, + { 0x8126, "animrelative" }, + { 0x8127, "stopanimscripted" }, + { 0x8128, "clearanim" }, + { 0x8129, "setanimknob" }, + { 0x812A, "setanimknoblimited" }, + { 0x812B, "setanimknobrestart" }, + { 0x812C, "setanimknoblimitedrestart" }, + { 0x812D, "setanimknoball" }, + { 0x812E, "setanimknoballlimited" }, + { 0x812F, "setanimknoballrestart" }, + { 0x8130, "setanimknoballlimitedrestart" }, + { 0x8131, "setanim" }, + { 0x8132, "setanimlimited" }, + { 0x8133, "setanimrestart" }, + { 0x8134, "setanimlimitedrestart" }, + { 0x8135, "getanimtime" }, + { 0x8136, "getanimweight" }, + { 0x8137, "getanimassettype" }, + { 0x8138, "setflaggedanimknob" }, + { 0x8139, "setflaggedanimknoblimited" }, + { 0x813A, "setturretaccuracy" }, + { 0x813B, "setrightarc" }, + { 0x813C, "setleftarc" }, + { 0x813D, "settoparc" }, + { 0x813E, "setbottomarc" }, + { 0x813F, "setautorotationdelay" }, + { 0x8140, "setdefaultdroppitch" }, + { 0x8141, "restoredefaultdroppitch" }, + { 0x8142, "turretfiredisable" }, + { 0x8143, "getfixednodesafevolume" }, + { 0x8144, "clearfixednodesafevolume" }, + { 0x8145, "isingoal" }, + { 0x8146, "setruntopos" }, + { 0x8147, "nearnode" }, + { 0x8148, "nearclaimnode" }, + { 0x8149, "nearclaimnodeandangle" }, + { 0x814A, "atdangerousnode" }, + { 0x814B, "getenemyinfo" }, + { 0x814C, "clearenemy" }, + { 0x814D, "setentitytarget" }, + { 0x814E, "clearentitytarget" }, + { 0x814F, "setpotentialthreat" }, + { 0x8150, "clearpotentialthreat" }, + { 0x8151, "setflashbanged" }, + { 0x8152, "setengagementmindist" }, + { 0x8153, "setengagementmaxdist" }, + { 0x8154, "isknownenemyinradius" }, + { 0x8155, "isknownenemyinvolume" }, + { 0x8156, "settalktospecies" }, + { 0x8157, "laseralton" }, + { 0x8158, "laseraltoff" }, + { 0x8159, "invisiblenotsolid" }, + { 0x815A, "visiblesolid" }, + { 0x815B, "setdefaultaimlimits" }, + { 0x815C, "initriotshieldhealth" }, + { 0x815D, "getenemysqdist" }, + { 0x815E, "getclosestenemysqdist" }, + { 0x815F, "setthreatbiasgroup" }, + { 0x8160, "getthreatbiasgroup" }, + { 0x8161, "turretfireenable" }, + { 0x8162, "setturretmodechangewait" }, + { 0x8163, "usetriggerrequirelookat" }, + { 0x8164, "getstance" }, + { 0x8165, "setstance" }, + { 0x8166, "itemweaponsetammo" }, + { 0x8167, "getammocount" }, + { 0x8168, "gettagorigin" }, + { 0x8169, "gettagangles" }, + { 0x816A, "shellshock" }, + { 0x816B, "stunplayer" }, + { 0x816C, "stopshellshock" }, + { 0x816D, "fadeoutshellshock" }, + { 0x816E, "setdepthoffield" }, + { 0x816F, "setviewmodeldepthoffield" }, + { 0x8170, "setmotionblurmovescale" }, + { 0x8171, "pickupgrenade" }, + { 0x8172, "useturret" }, + { 0x8173, "stopuseturret" }, + { 0x8174, "canuseturret" }, + { 0x8175, "traversemode" }, + { 0x8176, "animmode" }, + { 0x8177, "orientmode" }, + { 0x8178, "getmotionangle" }, + { 0x8179, "shouldfacemotion" }, + { 0x817A, "getanglestolikelyenemypath" }, + { 0x817B, "setturretanim" }, + { 0x817C, "getturret" }, + { 0x817D, "getgroundenttype" }, + { 0x817E, "animcustom" }, + { 0x817F, "isinscriptedstate" }, + { 0x8180, "canattackenemynode" }, + { 0x8181, "getnegotiationstartnode" }, + { 0x8182, "getnegotiationendnode" }, + { 0x8183, "getdoorpathnode" }, + { 0x8184, "comparenodedirtopathdir" }, + { 0x8185, "checkprone" }, + { 0x8186, "pushplayer" }, + { 0x8187, "checkgrenadethrowpos" }, + { 0x8188, "setgoalnode" }, + { 0x8189, "setgoalpos" }, + { 0x818A, "setgoalentity" }, + { 0x818B, "setgoalvolume" }, + { 0x818C, "setgoalvolumeauto" }, + { 0x818D, "getgoalvolume" }, + { 0x818E, "cleargoalvolume" }, + { 0x818F, "setfixednodesafevolume" }, + { 0x8190, "setmotionblurturnscale" }, + { 0x8191, "setmotionblurzoomscale" }, + { 0x8192, "viewkick" }, + { 0x8193, "localtoworldcoords" }, + { 0x8194, "getentitynumber" }, + { 0x8195, "getentityvelocity" }, + { 0x8196, "enablegrenadetouchdamage" }, + { 0x8197, "disablegrenadetouchdamage" }, + { 0x8198, "enableaimassist" }, + { 0x8199, "setlookatyawlimits" }, + { 0x819A, "stoplookat" }, + { 0x819B, "getmuzzlepos" }, + { 0x819C, "getmuzzleangle" }, + { 0x819D, "getmuzzlesideoffsetpos" }, + { 0x819E, "getaimangle" }, + { 0x819F, "canshoot" }, + { 0x81A0, "canshootenemy" }, + { 0x81A1, "cansee" }, + { 0x81A2, "seerecently" }, + { 0x81A3, "lastknowntime" }, + { 0x81A4, "lastknownpos" }, + { 0x81A5, "dropweapon" }, + { 0x81A6, "maymovetopoint" }, + { 0x81A7, "maymovefrompointtopoint" }, + { 0x81A8, "teleport" }, + { 0x81A9, "forceteleport" }, + { 0x81AA, "safeteleport" }, + { 0x81AB, "withinapproxpathdist" }, + { 0x81AC, "ispathdirect" }, + { 0x81AD, "allowedstances" }, + { 0x81AE, "isstanceallowed" }, + { 0x81AF, "issuppressionwaiting" }, + { 0x81B0, "issuppressed" }, + { 0x81B1, "ismovesuppressed" }, + { 0x81B2, "isgrenadepossafe" }, + { 0x81B3, "checkgrenadethrow" }, + { 0x81B4, "checkgrenadelaunch" }, + { 0x81B5, "checkgrenadelaunchpos" }, + { 0x81B6, "throwgrenade" }, + { 0x81B7, "disableaimassist" }, + { 0x81B8, "radiusdamage" }, + { 0x81B9, "detonate" }, + { 0x81BA, "damageconetrace" }, + { 0x81BB, "sightconetrace" }, + { 0x81BC, "missile_settargetent" }, + { 0x81BD, "missile_settargetpos" }, + { 0x81BE, "missile_cleartarget" }, + { 0x81BF, "missile_setflightmodedirect" }, + { 0x81C0, "missile_setflightmodetop" }, + { 0x81C1, "getlightintensity" }, + { 0x81C2, "setlightintensity" }, + { 0x81C3, "isragdoll" }, + { 0x81C4, "setmovespeedscale" }, + { 0x81C5, "cameralinkto" }, + { 0x81C6, "cameraunlink" }, + { 0x81C7, "startcoverarrival" }, + { 0x81C8, "starttraversearrival" }, + { 0x81C9, "checkcoverexitposwithpath" }, + { 0x81CA, "shoot" }, + { 0x81CB, "shootblank" }, + { 0x81CC, "melee" }, + { 0x81CD, "updateplayersightaccuracy" }, + { 0x81CE, "findshufflecovernode" }, + { 0x81CF, "findnearbycovernode" }, + { 0x81D0, "findcovernode" }, + { 0x81D1, "findbestcovernode" }, + { 0x81D2, "getcovernode" }, + { 0x81D3, "usecovernode" }, + { 0x81D4, "iscovervalidagainstenemy" }, + { 0x81D5, "reacquirestep" }, + { 0x81D6, "findreacquiredirectpath" }, + { 0x81D7, "trimpathtoattack" }, + { 0x81D8, "reacquiremove" }, + { 0x81D9, "findreacquireproximatepath" }, + { 0x81DA, "flagenemyunattackable" }, + { 0x81DB, "enterprone" }, + { 0x81DC, "exitprone" }, + { 0x81DD, "setproneanimnodes" }, + { 0x81DE, "updateprone" }, + { 0x81DF, "clearpitchorient" }, + { 0x81E0, "setlookatanimnodes" }, + { 0x81E1, "setlookat" }, + { 0x81E2, "setlookatentity" }, + { 0x81E3, "controlslinkto" }, + { 0x81E4, "controlsunlink" }, + { 0x81E5, "makevehiclesolidcapsule" }, + { 0x81E6, "makevehiclesolidsphere" }, + { 0x81E7, "makevehiclesolid" }, + { 0x81E8, "remotecontrolvehicle" }, + { 0x81E9, "remotecontrolvehicleoff" }, + { 0x81EA, "isfiringvehicleturret" }, + { 0x81EB, "drivevehicleandcontrolturret" }, + { 0x81EC, "drivevehicleandcontrolturretoff" }, + { 0x81ED, "getplayersetting" }, + { 0x81EE, "getlocalplayerprofiledata" }, + { 0x81EF, "setlocalplayerprofiledata" }, + { 0x81F0, "remotecamerasoundscapeon" }, + { 0x81F1, "remotecamerasoundscapeoff" }, + { 0x81F2, "radarjamon" }, + { 0x81F3, "radarjamoff" }, + { 0x81F4, "setmotiontrackervisible" }, + { 0x81F5, "getmotiontrackervisible" }, + { 0x81F6, "worldpointinreticle_circle" }, + { 0x81F7, "getpointinbounds" }, + { 0x81F8, "transfermarkstonewscriptmodel" }, + { 0x81F9, "setwatersheeting" }, + { 0x81FA, "setweaponhudiconoverride" }, + { 0x81FB, "getweaponhudiconoverride" }, + { 0x81FC, "setempjammed" }, + { 0x81FD, "playersetexpfog" }, + { 0x81FE, "isitemunlocked" }, + { 0x81FF, "getplayerdata" }, + { 0x8200, "vehicleturretcontroloff" }, + { 0x8201, "isturretready" }, + { 0x8202, "vehicledriveto" }, + { 0x8203, "dospawn" }, + { 0x8204, "isphysveh" }, + { 0x8205, "phys_crash" }, + { 0x8206, "phys_launch" }, + { 0x8207, "phys_disablecrashing" }, + { 0x8208, "phys_enablecrashing" }, + { 0x8209, "phys_setspeed" }, + { 0x820A, "phys_setconveyerbelt" }, + { 0x820B, "freehelicopter" }, + { 0x820C, "playerlinkedturretanglesenable" }, + { 0x820D, "playerlinkedturretanglesdisable" }, + { 0x820E, "playersetstreamorigin" }, + { 0x820F, "playerclearstreamorigin" }, + { 0x8210, "nightvisionviewon" }, + { 0x8211, "nightvisionviewoff" }, + { 0x8212, "painvisionon" }, + { 0x8213, "painvisionoff" }, + { 0x8214, "getplayerintelisfound" }, + { 0x8215, "setplayerintelfound" }, + { 0x8216, "newpip" }, + { 0x8217, "sethuddynlight" }, + { 0x8218, "startscriptedanim" }, + { 0x8219, "startcoverbehavior" }, + { 0x821A, "setplayerdata" }, + { 0x821B, "trackerupdate" }, + { 0x821C, "pingplayer" }, + { 0x821D, "buttonpressed" }, + { 0x821E, "sayall" }, + { 0x821F, "sayteam" }, + { 0x8220, "showscoreboard" }, + { 0x8221, "setspawnweapon" }, + { 0x8222, "dropitem" }, + { 0x8223, "dropscavengerbag" }, + { 0x8224, "setjitterparams" }, + { 0x8225, "sethoverparams" }, + { 0x8226, "joltbody" }, + { 0x8227, "freevehicle" }, + { 0x8228, "getwheelsurface" }, + { 0x8229, "getvehicleowner" }, + { 0x822A, "setvehiclelookattext" }, + { 0x822B, "setvehicleteam" }, + { 0x822C, "setneargoalnotifydist" }, + { 0x822D, "setvehgoalpos" }, + { 0x822E, "setgoalyaw" }, + { 0x822F, "cleargoalyaw" }, + { 0x8230, "settargetyaw" }, + { 0x8231, "cleartargetyaw" }, + { 0x8232, "vehicle_helisetai" }, + { 0x8233, "setturrettargetvec" }, + { 0x8234, "setturrettargetent" }, + { 0x8235, "clearturrettarget" }, + { 0x8236, "vehicle_canturrettargetpoint" }, + { 0x8237, "setlookatent" }, + { 0x8238, "clearlookatent" }, + { 0x8239, "setvehweapon" }, + { 0x823A, "fireweapon" }, + { 0x823B, "vehicleturretcontrolon" }, + { 0x823C, "finishplayerdamage" }, + { 0x823D, "suicide" }, + { 0x823E, "closeingamemenu" }, + { 0x823F, "iprintln" }, + { 0x8240, "iprintlnbold" }, + { 0x8241, "spawn" }, + { 0x8242, "setentertime" }, + { 0x8243, "cloneplayer" }, + { 0x8244, "istalking" }, + { 0x8245, "allowspectateteam" }, + { 0x8246, "getguid" }, + { 0x8247, "physicslaunchserver" }, + { 0x8248, "physicslaunchserveritem" }, + { 0x8249, "clonebrushmodeltoscriptmodel" }, + { 0x824A, "scriptmodelplayanim" }, + { 0x824B, "scriptmodelclearanim" }, + { 0x824C, "vehicle_teleport" }, + { 0x824D, "attachpath" }, + { 0x824E, "getattachpos" }, + { 0x824F, "startpath" }, + { 0x8250, "setswitchnode" }, + { 0x8251, "setwaitspeed" }, + { 0x8252, "vehicle_finishdamage" }, + { 0x8253, "vehicle_setspeed" }, + { 0x8254, "vehicle_setspeedimmediate" }, + { 0x8255, "vehicle_rotateyaw" }, + { 0x8256, "vehicle_getspeed" }, + { 0x8257, "vehicle_getvelocity" }, + { 0x8258, "vehicle_getbodyvelocity" }, + { 0x8259, "vehicle_getsteering" }, + { 0x825A, "vehicle_getthrottle" }, + { 0x825B, "vehicle_turnengineoff" }, + { 0x825C, "vehicle_turnengineon" }, + { 0x825D, "getgoalspeedmph" }, + { 0x825E, "setacceleration" }, + { 0x825F, "setdeceleration" }, + { 0x8260, "resumespeed" }, + { 0x8261, "setyawspeed" }, + { 0x8262, "setyawspeedbyname" }, + { 0x8263, "setmaxpitchroll" }, + { 0x8264, "setairresistance" }, + { 0x8265, "setturningability" }, + { 0x8266, "getxuid" }, + { 0x8267, "ishost" }, + { 0x8268, "getspectatingplayer" }, + { 0x8269, "predictstreampos" }, + { 0x826A, "updatescores" }, + { 0x826B, "updatedmscores" }, + { 0x826C, "setrank" }, + { 0x826D, "setcardtitle" }, + { 0x826E, "weaponlocknoclearance" }, + { 0x826F, "visionsyncwithplayer" }, + { 0x8270, "showhudsplash" }, + { 0x8271, "setperk" }, + { 0x8272, "hasperk" }, + { 0x8273, "clearperks" }, + { 0x8274, "unsetperk" }, + { 0x8275, "noclip" }, + { 0x8276, "ufo" }, + { 0x8277, "moveto" }, + { 0x8278, "movex" }, + { 0x8279, "movey" }, + { 0x827A, "movez" }, + { 0x827B, "movegravity" }, + { 0x827C, "moveslide" }, + { 0x827D, "stopmoveslide" }, + { 0x827E, "rotateto" }, + { 0x827F, "rotatepitch" }, + { 0x8280, "rotateyaw" }, + { 0x8281, "rotateroll" }, + { 0x8282, "addpitch" }, + { 0x8283, "addyaw" }, + { 0x8284, "addroll" }, + { 0x8285, "vibrate" }, + { 0x8286, "rotatevelocity" }, + { 0x8287, "solid" }, + { 0x8288, "notsolid" }, + { 0x8289, "setcandamage" }, + { 0x828A, "setcanradiusdamage" }, + { 0x828B, "physicslaunchclient" }, + { 0x828C, "setcardicon" }, + { 0x828D, "setcardnameplate" }, + { 0x828E, "setcarddisplayslot" }, + { 0x828F, "kc_regweaponforfxremoval" }, + { 0x8290, "laststandrevive" }, + { 0x8291, "setspectatedefaults" }, + { 0x8292, "getthirdpersoncrosshairoffset" }, + { 0x8293, "disableweaponpickup" }, + { 0x8294, "enableweaponpickup" }, + { 0x8295, "issplitscreenplayer" }, + { 0x8296, "getweaponslistoffhands" }, + { 0x8297, "getweaponslistitems" }, + { 0x8298, "getweaponslistexclusives" }, + { 0x8299, "getweaponslist" }, + { 0x829A, "canplayerplacesentry" }, + { 0x829B, "canplayerplacetank" }, + { 0x829C, "visionsetnakedforplayer" }, + { 0x829D, "visionsetnightforplayer" }, + { 0x829E, "visionsetmissilecamforplayer" }, + { 0x829F, "visionsetthermalforplayer" }, + { 0x82A0, "visionsetpainforplayer" }, + { 0x82A1, "setblurforplayer" }, + { 0x82A2, "getplayerweaponmodel" }, + { 0x82A3, "getplayerknifemodel" }, + { 0x82A4, "updateplayermodelwithweapons" }, + { 0x82A5, "notifyonplayercommand" }, + { 0x82A6, "canmantle" }, + { 0x82A7, "forcemantle" }, + { 0x82A8, "ismantling" }, + { 0x82A9, "playfx" }, + { 0x82AA, "player_recoilscaleon" }, + { 0x82AB, "player_recoilscaleoff" }, + { 0x82AC, "weaponlockstart" }, + { 0x82AD, "weaponlockfinalize" }, + { 0x82AE, "weaponlockfree" }, + { 0x82AF, "weaponlocktargettooclose" }, + { 0x82B0, "issplitscreenplayerprimary" }, + { 0x82B1, "getviewmodel" }, + { 0x82B2, "fragbuttonpressed" }, + { 0x82B3, "secondaryoffhandbuttonpressed" }, + { 0x82B4, "getcurrentweaponclipammo" }, + { 0x82B5, "setvelocity" }, + { 0x82B6, "getplayerviewheight" }, + { 0x82B7, "getnormalizedmovement" }, + { 0x82B8, "setchannelvolumes" }, + { 0x82B9, "deactivatechannelvolumes" }, + { 0x82BA, "playlocalsound" }, + { 0x82BB, "stoplocalsound" }, + { 0x82BC, "setweaponammoclip" }, + { 0x82BD, "setweaponammostock" }, + { 0x82BE, "getweaponammoclip" }, + { 0x82BF, "getweaponammostock" }, + { 0x82C0, "anyammoforweaponmodes" }, + { 0x82C1, "setclientdvar" }, + { 0x82C2, "setclientdvars" }, + { 0x82C3, "allowads" }, + { 0x82C4, "allowjump" }, + { 0x82C5, "allowsprint" }, + { 0x82C6, "setspreadoverride" }, + { 0x82C7, "resetspreadoverride" }, + { 0x82C8, "setaimspreadmovementscale" }, + { 0x82C9, "setactionslot" }, + { 0x82CA, "setviewkickscale" }, + { 0x82CB, "getviewkickscale" }, + { 0x82CC, "getweaponslistall" }, + { 0x82CD, "getweaponslistprimaries" }, + { 0x82CE, "getnormalizedcameramovement" }, + { 0x82CF, "giveweapon" }, + { 0x82D0, "takeweapon" }, + { 0x82D1, "takeallweapons" }, + { 0x82D2, "getcurrentweapon" }, + { 0x82D3, "getcurrentprimaryweapon" }, + { 0x82D4, "getcurrentoffhand" }, + { 0x82D5, "hasweapon" }, + { 0x82D6, "switchtoweapon" }, + { 0x82D7, "switchtoweaponimmediate" }, + { 0x82D8, "switchtooffhand" }, + { 0x82D9, "setoffhandsecondaryclass" }, + { 0x82DA, "getoffhandsecondaryclass" }, + { 0x82DB, "beginlocationselection" }, + { 0x82DC, "endlocationselection" }, + { 0x82DD, "disableweapons" }, + { 0x82DE, "enableweapons" }, + { 0x82DF, "disableoffhandweapons" }, + { 0x82E0, "enableoffhandweapons" }, + { 0x82E1, "disableweaponswitch" }, + { 0x82E2, "enableweaponswitch" }, + { 0x82E3, "openpopupmenu" }, + { 0x82E4, "openpopupmenunomouse" }, + { 0x82E5, "closepopupmenu" }, + { 0x82E6, "openmenu" }, + { 0x82E7, "closemenu" }, +// { 0x82E8, "_meth_82E8" }, + { 0x82E9, "freezecontrols" }, + { 0x82EA, "disableusability" }, + { 0x82EB, "enableusability" }, + { 0x82EC, "setwhizbyspreads" }, + { 0x82ED, "setwhizbyradii" }, + { 0x82EE, "setreverb" }, + { 0x82EF, "deactivatereverb" }, + { 0x82F0, "setvolmod" }, + { 0x82F1, "setchannelvolume" }, + { 0x82F2, "givestartammo" }, + { 0x82F3, "givemaxammo" }, + { 0x82F4, "getfractionstartammo" }, + { 0x82F5, "getfractionmaxammo" }, + { 0x82F6, "isdualwielding" }, + { 0x82F7, "isreloading" }, + { 0x82F8, "isswitchingweapon" }, + { 0x82F9, "setorigin" }, + { 0x82FA, "getvelocity" }, + { 0x82FB, "setplayerangles" }, + { 0x82FC, "getplayerangles" }, + { 0x82FD, "usebuttonpressed" }, + { 0x82FE, "attackbuttonpressed" }, + { 0x82FF, "adsbuttonpressed" }, + { 0x8300, "meleebuttonpressed" }, + { 0x8301, "playerads" }, + { 0x8302, "isonground" }, + { 0x8303, "isusingturret" }, + { 0x8304, "setviewmodel" }, + { 0x8305, "setoffhandprimaryclass" }, + { 0x8306, "getoffhandprimaryclass" }, + { 0x8307, "startac130" }, + { 0x8308, "stopac130" }, + { 0x8309, "enablemousesteer" }, + { 0x830A, "setscriptmoverkillcam" }, + { 0x830B, "setmapnamestring" }, + { 0x830C, "setgametypestring" }, +}}; + +} // namespace xsk::gsc::iw5_pc diff --git a/src/iw5/xsk/resolver.cpp b/src/iw5/iw5_pc_token.cpp similarity index 91% rename from src/iw5/xsk/resolver.cpp rename to src/iw5/iw5_pc_token.cpp index 06b72d17..6c87d8a6 100644 --- a/src/iw5/xsk/resolver.cpp +++ b/src/iw5/iw5_pc_token.cpp @@ -1,1728 +1,14 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" -#include "iw5.hpp" +#include "iw5_pc.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - -namespace xsk::gsc::iw5 +namespace xsk::gsc::iw5_pc { -std::unordered_map opcode_map; -std::unordered_map function_map; -std::unordered_map method_map; -std::unordered_map token_map; -std::unordered_map opcode_map_rev; -std::unordered_map function_map_rev; -std::unordered_map method_map_rev; -std::unordered_map token_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_func_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - const auto itr = function_map.find(id); - - if (itr != function_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_meth_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - const auto itr = method_map.find(id); - - if (itr != method_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_id_")) - { - return static_cast(std::stoul(name.substr(4), nullptr, 16)); - } - - const auto itr = token_map_rev.find(name); - - if (itr != token_map_rev.end()) - { - return itr->second; - } - - return 0; -} - -auto resolver::token_name(std::uint16_t id) -> std::string -{ - const auto itr = token_map.find(id); - - if (itr != token_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - } - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - } - - return false; -} - -void resolver::add_function(const std::string& name, std::uint16_t id) -{ - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - throw error(utils::string::va("builtin function '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - function_map.insert({ id, *str }); - function_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - function_map.insert({ id, *ins.first }); - function_map_rev.insert({ *ins.first, id }); - } - } -} - -void resolver::add_method(const std::string& name, std::uint16_t id) -{ - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - throw error(utils::string::va("builtin method '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - method_map.insert({ id, *str }); - method_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - method_map.insert({ id, *ins.first }); - method_map_rev.insert({ *ins.first, 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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ - "aitype"sv, - "animscripts"sv, - "character"sv, - "codescripts"sv, - "common_scripts"sv, - "maps"sv, - "mptype"sv, - "vehicle_scripts"sv, - "xmodelalias"sv, - "animscripts/civilian"sv, - "animscripts/dog"sv, - "animscripts/hummer_turret"sv, - "animscripts/riotshield"sv, - "animscripts/saw"sv, - "animscripts/scripted"sv, - "animscripts/technical"sv, - "animscripts/traverse"sv, - "maps/animated_models"sv, - "maps/cinematic_setups"sv, - "maps/createart"sv, - "maps/createfx"sv, - "maps/gametypes"sv, - "maps/mp"sv, - "maps/mp/gametypes"sv, - "maps/mp/killstreaks"sv, - "maps/mp/perks"sv, -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -const std::array, 153> opcode_list -{{ - { 0x00, "OP_End" }, - { 0x01, "OP_Return" }, - { 0x02, "OP_GetByte" }, - { 0x03, "OP_GetNegByte" }, - { 0x04, "OP_GetUnsignedShort" }, - { 0x05, "OP_GetNegUnsignedShort" }, - { 0x06, "OP_GetInteger" }, - { 0x07, "OP_GetBuiltinFunction" }, - { 0x08, "OP_GetBuiltinMethod" }, - { 0x09, "OP_GetFloat" }, - { 0x0A, "OP_GetString" }, - { 0x0B, "OP_GetUndefined" }, - { 0x0C, "OP_GetZero" }, - { 0x0D, "OP_waittillFrameEnd" }, - { 0x0E, "OP_CreateLocalVariable" }, - { 0x0F, "OP_RemoveLocalVariables" }, - { 0x10, "OP_EvalLocalVariableCached0" }, - { 0x11, "OP_EvalLocalVariableCached1" }, - { 0x12, "OP_EvalLocalVariableCached2" }, - { 0x13, "OP_EvalLocalVariableCached3" }, - { 0x14, "OP_EvalLocalVariableCached4" }, - { 0x15, "OP_EvalLocalVariableCached5" }, - { 0x16, "OP_EvalLocalVariableCached" }, - { 0x17, "OP_EvalLocalArrayCached" }, - { 0x18, "OP_EvalArray" }, - { 0x19, "OP_EvalLocalArrayRefCached0" }, - { 0x1A, "OP_EvalNewLocalArrayRefCached0" }, - { 0x1B, "OP_EvalLocalArrayRefCached" }, - { 0x1C, "OP_EvalArrayRef" }, - { 0x1D, "OP_ClearArray" }, - { 0x1E, "OP_EmptyArray" }, - { 0x1F, "OP_AddArray" }, - { 0x20, "OP_PreScriptCall" }, - { 0x21, "OP_ScriptLocalFunctionCall2" }, - { 0x22, "OP_ScriptLocalFunctionCall" }, - { 0x23, "OP_ScriptLocalMethodCall" }, - { 0x24, "OP_ScriptLocalThreadCall" }, - { 0x25, "OP_ScriptLocalChildThreadCall" }, - { 0x26, "OP_ScriptLocalMethodThreadCall" }, - { 0x27, "OP_ScriptLocalMethodChildThreadCall" }, - { 0x28, "OP_ScriptFarFunctionCall2" }, - { 0x29, "OP_ScriptFarFunctionCall" }, - { 0x2A, "OP_ScriptFarMethodCall" }, - { 0x2B, "OP_ScriptFarThreadCall" }, - { 0x2C, "OP_ScriptFarChildThreadCall" }, - { 0x2D, "OP_ScriptFarMethodThreadCall" }, - { 0x2E, "OP_ScriptFarMethodChildThreadCall" }, - { 0x2F, "OP_ScriptFunctionCallPointer" }, - { 0x30, "OP_ScriptMethodCallPointer" }, - { 0x31, "OP_ScriptThreadCallPointer" }, - { 0x32, "OP_ScriptChildThreadCallPointer" }, - { 0x33, "OP_ScriptMethodThreadCallPointer" }, - { 0x34, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x35, "OP_CallBuiltinPointer" }, - { 0x36, "OP_CallBuiltinMethodPointer" }, - { 0x37, "OP_GetIString" }, - { 0x38, "OP_GetVector" }, - { 0x39, "OP_GetLevelObject" }, - { 0x3A, "OP_GetAnimObject" }, - { 0x3B, "OP_GetSelf" }, - { 0x3C, "OP_GetThisthread" }, - { 0x3D, "OP_GetLevel" }, - { 0x3E, "OP_GetGame" }, - { 0x3F, "OP_GetAnim" }, - { 0x40, "OP_GetAnimation" }, - { 0x41, "OP_GetGameRef" }, - { 0x42, "OP_inc" }, - { 0x43, "OP_dec" }, - { 0x44, "OP_bit_or" }, - { 0x45, "OP_JumpOnFalseExpr" }, - { 0x46, "OP_bit_ex_or" }, - { 0x47, "OP_bit_and" }, - { 0x48, "OP_equality" }, - { 0x49, "OP_inequality" }, - { 0x4A, "OP_less" }, - { 0x4B, "OP_greater" }, - { 0x4C, "OP_JumpOnTrueExpr" }, - { 0x4D, "OP_less_equal" }, - { 0x4E, "OP_jumpback" }, - { 0x4F, "OP_waittillmatch2" }, - { 0x50, "OP_waittill" }, - { 0x51, "OP_notify" }, - { 0x52, "OP_endon" }, - { 0x53, "OP_voidCodepos" }, - { 0x54, "OP_switch" }, - { 0x55, "OP_endswitch" }, - { 0x56, "OP_vector" }, - { 0x57, "OP_JumpOnFalse" }, - { 0x58, "OP_greater_equal" }, - { 0x59, "OP_shift_left" }, - { 0x5A, "OP_shift_right" }, - { 0x5B, "OP_plus" }, - { 0x5C, "OP_jump" }, - { 0x5D, "OP_minus" }, - { 0x5E, "OP_multiply" }, - { 0x5F, "OP_divide" }, - { 0x60, "OP_mod" }, - { 0x61, "OP_JumpOnTrue" }, - { 0x62, "OP_size" }, - { 0x63, "OP_waittillmatch" }, - { 0x64, "OP_GetLocalFunction" }, - { 0x65, "OP_GetFarFunction" }, - { 0x66, "OP_GetSelfObject" }, - { 0x67, "OP_EvalLevelFieldVariable" }, - { 0x68, "OP_EvalAnimFieldVariable" }, - { 0x69, "OP_EvalSelfFieldVariable" }, - { 0x6A, "OP_EvalFieldVariable" }, - { 0x6B, "OP_EvalLevelFieldVariableRef" }, - { 0x6C, "OP_EvalAnimFieldVariableRef" }, - { 0x6D, "OP_EvalSelfFieldVariableRef" }, - { 0x6E, "OP_EvalFieldVariableRef" }, - { 0x6F, "OP_ClearFieldVariable" }, - { 0x70, "OP_SafeCreateVariableFieldCached" }, - { 0x71, "OP_SafeSetVariableFieldCached0" }, - { 0x72, "OP_SafeSetVariableFieldCached" }, - { 0x73, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x74, "OP_GetAnimTree" }, - { 0x75, "OP_clearparams" }, - { 0x76, "OP_checkclearparams" }, - { 0x77, "OP_EvalLocalVariableRefCached0" }, - { 0x78, "OP_EvalNewLocalVariableRefCached0" }, - { 0x79, "OP_EvalLocalVariableRefCached" }, - { 0x7A, "OP_SetLevelFieldVariableField" }, - { 0x7B, "OP_SetVariableField" }, - { 0x7C, "OP_ClearVariableField" }, - { 0x7D, "OP_SetAnimFieldVariableField" }, - { 0x7E, "OP_SetSelfFieldVariableField" }, - { 0x7F, "OP_SetLocalVariableFieldCached0" }, - { 0x80, "OP_SetNewLocalVariableFieldCached0" }, - { 0x81, "OP_SetLocalVariableFieldCached" }, - { 0x82, "OP_ClearLocalVariableFieldCached" }, - { 0x83, "OP_ClearLocalVariableFieldCached0" }, - { 0x84, "OP_CallBuiltin0" }, - { 0x85, "OP_CallBuiltin1" }, - { 0x86, "OP_CallBuiltin2" }, - { 0x87, "OP_CallBuiltin3" }, - { 0x88, "OP_CallBuiltin4" }, - { 0x89, "OP_CallBuiltin5" }, - { 0x8A, "OP_CallBuiltin" }, - { 0x8B, "OP_CallBuiltinMethod0" }, - { 0x8C, "OP_CallBuiltinMethod1" }, - { 0x8D, "OP_CallBuiltinMethod2" }, - { 0x8E, "OP_CallBuiltinMethod3" }, - { 0x8F, "OP_CallBuiltinMethod4" }, - { 0x90, "OP_CallBuiltinMethod5" }, - { 0x91, "OP_CallBuiltinMethod" }, - { 0x92, "OP_wait" }, - { 0x93, "OP_DecTop" }, - { 0x94, "OP_CastFieldObject" }, - { 0x95, "OP_EvalLocalVariableObjectCached" }, - { 0x96, "OP_CastBool" }, - { 0x97, "OP_BoolNot" }, - { 0x98, "OP_BoolComplement" }, -}}; - -const std::array, 455> function_list -{{ - { 0x001, "precacheturret" }, - { 0x002, "getweaponarray" }, - { 0x003, "createprintchannel" }, - { 0x004, "updategamerprofileall" }, - { 0x005, "clearlocalizedstrings" }, - { 0x006, "setphysicsgravitydir" }, - { 0x007, "gettimescale" }, - { 0x008, "settimescale" }, - { 0x009, "setslowmotionview" }, - { 0x00A, "forcesharedammo" }, - { 0x00B, "refreshhudcompass" }, - { 0x00C, "refreshhudammocounter" }, - { 0x00D, "notifyoncommand" }, - { 0x00E, "setprintchannel" }, - { 0x00F, "print" }, - { 0x010, "println" }, - { 0x011, "print3d" }, - { 0x012, "line" }, - { 0x013, "spawnturret" }, - { 0x014, "canspawnturret" }, - { 0x015, "assert" }, - { 0x016, "pausecinematicingame" }, - { 0x017, "drawcompassfriendlies" }, - { 0x018, "bulletspread" }, - { 0x019, "bullettracer" }, - { 0x01A, "badplace_delete" }, - { 0x01B, "badplace_cylinder" }, - { 0x01C, "badplace_arc" }, - { 0x01D, "badplace_brush" }, - { 0x01E, "clearallcorpses" }, - { 0x01F, "setturretnode" }, - { 0x020, "unsetturretnode" }, - { 0x021, "setnodepriority" }, - { 0x022, "isnodeoccupied" }, - { 0x023, "setdebugorigin" }, - { 0x024, "setdebugangles" }, - { 0x025, "updategamerprofile" }, - { 0x026, "assertex" }, - { 0x027, "assertmsg" }, - { 0x028, "isdefined" }, - { 0x029, "isstring" }, - { 0x02A, "setdvar" }, - { 0x02B, "setdynamicdvar" }, - { 0x02C, "setdvarifuninitialized" }, - { 0x02D, "setdevdvar" }, - { 0x02E, "setdevdvarifuninitialized" }, - { 0x02F, "getdvar" }, - { 0x030, "getdvarint" }, - { 0x031, "getdvarfloat" }, - { 0x032, "getdvarvector" }, - { 0x033, "gettime" }, - { 0x034, "getentbynum" }, - { 0x035, "getweaponmodel" }, - { 0x036, "getculldist" }, - { 0x037, "sethalfresparticles" }, - { 0x038, "getmapsunlight" }, - { 0x039, "setsunlight" }, - { 0x03A, "resetsunlight" }, - { 0x03B, "getmapsundirection" }, - { 0x03C, "getmapsunangles" }, - { 0x03D, "setsundirection" }, - { 0x03E, "lerpsundirection" }, - { 0x03F, "lerpsunangles" }, - { 0x040, "resetsundirection" }, - { 0x041, "enableforcedsunshadows" }, - { 0x042, "enableforcednosunshadows" }, - { 0x043, "disableforcedsunshadows" }, - { 0x044, "enableouterspacemodellighting" }, - { 0x045, "disableouterspacemodellighting" }, - { 0x046, "remapstage" }, - { 0x047, "changelevel" }, - { 0x048, "missionsuccess" }, - { 0x049, "missionfailed" }, - { 0x04A, "cinematic" }, - { 0x04B, "cinematicingame" }, - { 0x04C, "cinematicingamesync" }, - { 0x04D, "cinematicingameloop" }, - { 0x04E, "cinematicingameloopresident" }, - { 0x04F, "iscinematicplaying" }, - { 0x050, "stopcinematicingame" }, - { 0x051, "getweaponhidetags" }, - { 0x052, "getanimlength" }, - { 0x053, "animhasnotetrack" }, - { 0x054, "getnotetracktimes" }, - { 0x055, "spawn" }, - { 0x056, "spawnloopsound" }, - { 0x057, "spawnloopingsound" }, - { 0x058, "bullettrace" }, - { 0x059, "target_setmaxsize" }, - { 0x05A, "target_setcolor" }, - { 0x05B, "target_setdelay" }, - { 0x05C, "getstartorigin" }, - { 0x05D, "getstartangles" }, - { 0x05E, "getcycleoriginoffset" }, - { 0x05F, "magicgrenade" }, - { 0x060, "magicgrenademanual" }, - { 0x061, "setblur" }, - { 0x062, "musicplay" }, - { 0x063, "musicstop" }, - { 0x064, "soundfade" }, - { 0x065, "soundsettimescalefactor" }, - { 0x066, "soundresettimescale" }, - { 0x067, "setocclusionpreset" }, - { 0x068, "levelsoundfade" }, - { 0x069, "precachenightvisioncodeassets" }, - { 0x06A, "precachedigitaldistortcodeassets" }, - { 0x06B, "precacheminimapsentrycodeassets" }, - { 0x06C, "savegame" }, - { 0x06D, "issavesuccessful" }, - { 0x06E, "issaverecentlyloaded" }, - { 0x06F, "savegamenocommit" }, - { 0x070, "commitsave" }, - { 0x071, "commitwouldbevalid" }, - { 0x072, "getfxvisibility" }, - { 0x073, "setculldist" }, - { 0x074, "bullettracepassed" }, - { 0x075, "sighttracepassed" }, - { 0x076, "physicstrace" }, - { 0x077, "playerphysicstrace" }, - { 0x078, "getgroundposition" }, - { 0x079, "getmovedelta" }, - { 0x07A, "getangledelta" }, - { 0x07B, "getnorthyaw" }, - { 0x07C, "getcommandfromkey" }, - { 0x07D, "getsticksconfig" }, - { 0x07E, "weaponfightdist" }, - { 0x07F, "weaponmaxdist" }, - { 0x080, "isturretactive" }, - { 0x081, "target_alloc" }, - { 0x082, "target_flush" }, - { 0x083, "target_set" }, - { 0x084, "target_remove" }, - { 0x085, "target_setshader" }, - { 0x086, "target_setoffscreenshader" }, - { 0x087, "target_isinrect" }, - { 0x088, "target_isincircle" }, - { 0x089, "target_startreticlelockon" }, - { 0x08A, "target_clearreticlelockon" }, - { 0x08B, "target_getarray" }, - { 0x08C, "target_istarget" }, - { 0x08D, "target_setattackmode" }, - { 0x08E, "target_setjavelinonly" }, - { 0x08F, "target_hidefromplayer" }, - { 0x090, "target_showtoplayer" }, - { 0x091, "target_setscaledrendermode" }, - { 0x092, "target_drawcornersonly" }, - { 0x093, "target_drawsquare" }, - { 0x094, "target_drawsingle" }, - { 0x095, "target_setminsize" }, - { 0x096, "setnorthyaw" }, - { 0x097, "setslowmotion" }, - { 0x098, "randomint" }, - { 0x099, "randomfloat" }, - { 0x09A, "randomintrange" }, - { 0x09B, "randomfloatrange" }, - { 0x09C, "sin" }, - { 0x09D, "cos" }, - { 0x09E, "tan" }, - { 0x09F, "asin" }, - { 0x0A0, "acos" }, - { 0x0A1, "atan" }, - { 0x0A2, "int" }, - { 0x0A3, "float" }, - { 0x0A4, "abs" }, - { 0x0A5, "min" }, - { 0x0A6, "objective_additionalcurrent" }, - { 0x0A7, "objective_ring" }, - { 0x0A8, "objective_setpointertextoverride" }, - { 0x0A9, "getnode" }, - { 0x0AA, "getnodearray" }, - { 0x0AB, "getallnodes" }, - { 0x0AC, "getnodesinradius" }, - { 0x0AD, "getnodesinradiussorted" }, - { 0x0AE, "getclosestnodeinsight" }, - { 0x0AF, "getreflectionlocs" }, - { 0x0B0, "getreflectionreferencelocs" }, - { 0x0B1, "getvehicletracksegment" }, - { 0x0B2, "getvehicletracksegmentarray" }, - { 0x0B3, "getallvehicletracksegments" }, - { 0x0B4, "isarray" }, - { 0x0B5, "isai" }, - { 0x0B6, "issentient" }, - { 0x0B7, "isgodmode" }, - { 0x0B8, "getdebugdvar" }, - { 0x0B9, "getdebugdvarint" }, - { 0x0BA, "getdebugdvarfloat" }, - { 0x0BB, "setsaveddvar" }, - { 0x0BC, "getfreeaicount" }, - { 0x0BD, "getaicount" }, - { 0x0BE, "getaiarray" }, - { 0x0BF, "getaispeciesarray" }, - { 0x0C0, "getspawnerarray" }, - { 0x0C1, "getcorpsearray" }, - { 0x0C2, "getspawnerteamarray" }, - { 0x0C3, "getweaponclipmodel" }, - { 0x0C4, "getbrushmodelcenter" }, - { 0x0C5, "getkeybinding" }, - { 0x0C6, "max" }, - { 0x0C7, "floor" }, - { 0x0C8, "ceil" }, - { 0x0C9, "exp" }, - { 0x0CA, "log" }, - { 0x0CB, "sqrt" }, - { 0x0CC, "squared" }, - { 0x0CD, "clamp" }, - { 0x0CE, "angleclamp" }, - { 0x0CF, "angleclamp180" }, - { 0x0D0, "vectorfromlinetopoint" }, - { 0x0D1, "pointonsegmentnearesttopoint" }, - { 0x0D2, "distance" }, - { 0x0D3, "distance2d" }, - { 0x0D4, "distancesquared" }, - { 0x0D5, "length" }, - { 0x0D6, "lengthsquared" }, - { 0x0D7, "closer" }, - { 0x0D8, "vectordot" }, - { 0x0D9, "visionsetthermal" }, - { 0x0DA, "visionsetpain" }, - { 0x0DB, "endlobby" }, - { 0x0DC, "setac130ambience" }, - { 0x0DD, "getmapcustom" }, - { 0x0DE, "updateskill" }, - { 0x0DF, "spawnsighttrace" }, - { 0x0E0, "incrementcounter" }, - { 0x0E1, "getcountertotal" }, - { 0x0E2, "getlevelticks" }, - { 0x0E3, "perlinnoise2d" }, - { 0x0E4, "calcrockingangles" }, - { 0x0E5, "sethudlighting" }, - { 0x0E6, "reconevent" }, - { 0x0E7, "reconspatialevent" }, - { 0x0E8, "setsunflareposition" }, - { 0x0E9, "createthreatbiasgroup" }, - { 0x0EA, "threatbiasgroupexists" }, - { 0x0EB, "getthreatbias" }, - { 0x0EC, "setthreatbias" }, - { 0x0ED, "setthreatbiasagainstall" }, - { 0x0EE, "setignoremegroup" }, - { 0x0EF, "isenemyteam" }, - { 0x0F0, "objective_additionalentity" }, - { 0x0F1, "objective_state_nomessage" }, - { 0x0F2, "objective_string" }, - { 0x0F3, "objective_string_nomessage" }, - { 0x0F4, "objective_additionalposition" }, - { 0x0F5, "objective_current_nomessage" }, - { 0x0F6, "vectornormalize" }, - { 0x0F7, "vectortoangles" }, - { 0x0F8, "vectortoyaw" }, - { 0x0F9, "vectorlerp" }, - { 0x0FA, "anglestoup" }, - { 0x0FB, "anglestoright" }, - { 0x0FC, "anglestoforward" }, - { 0x0FD, "combineangles" }, - { 0x0FE, "transformmove" }, - { 0x0FF, "issubstr" }, - { 0x100, "isendstr" }, - { 0x101, "getsubstr" }, - { 0x102, "tolower" }, - { 0x103, "strtok" }, - { 0x104, "stricmp" }, - { 0x105, "ambientplay" }, - { 0x106, "getuavstrengthmax" }, - { 0x107, "getuavstrengthlevelneutral" }, - { 0x108, "getuavstrengthlevelshowenemyfastsweep" }, - { 0x109, "getuavstrengthlevelshowenemydirectional" }, - { 0x10A, "blockteamradar" }, - { 0x10B, "unblockteamradar" }, - { 0x10C, "isteamradarblocked" }, - { 0x10D, "getassignedteam" }, - { 0x10E, "setmatchdata" }, - { 0x10F, "getmatchdata" }, - { 0x110, "sendmatchdata" }, - { 0x111, "clearmatchdata" }, - { 0x112, "setmatchdatadef" }, - { 0x113, "setmatchclientip" }, - { 0x114, "setmatchdataid" }, - { 0x115, "setclientmatchdata" }, - { 0x116, "getclientmatchdata" }, - { 0x117, "setclientmatchdatadef" }, - { 0x118, "sendclientmatchdata" }, - { 0x119, "getbuildversion" }, - { 0x11A, "getbuildnumber" }, - { 0x11B, "getsystemtime" }, - { 0x11C, "getmatchrulesdata" }, - { 0x11D, "isusingmatchrulesdata" }, - { 0x11E, "kick" }, - { 0x11F, "issplitscreen" }, - { 0x120, "setmapcenter" }, - { 0x121, "setgameendtime" }, - { 0x122, "visionsetnaked" }, - { 0x123, "visionsetnight" }, - { 0x124, "visionsetmissilecam" }, - { 0x125, "ambientstop" }, - { 0x126, "precachemodel" }, - { 0x127, "precacheshellshock" }, - { 0x128, "precacheitem" }, - { 0x129, "precacheshader" }, - { 0x12A, "precachestring" }, - { 0x12B, "precachemenu" }, - { 0x12C, "precacherumble" }, - { 0x12D, "precachelocationselector" }, - { 0x12E, "precacheleaderboards" }, - { 0x12F, "loadfx" }, - { 0x130, "playfx" }, - { 0x131, "playfxontag" }, - { 0x132, "stopfxontag" }, - { 0x133, "playloopedfx" }, - { 0x134, "spawnfx" }, - { 0x135, "triggerfx" }, - { 0x136, "playfxontagforclients" }, - { 0x137, "setwinningteam" }, - { 0x138, "announcement" }, - { 0x139, "clientannouncement" }, - { 0x13A, "getteamscore" }, - { 0x13B, "setteamscore" }, - { 0x13C, "setclientnamemode" }, - { 0x13D, "updateclientnames" }, - { 0x13E, "getteamplayersalive" }, - { 0x13F, "logprint" }, - { 0x140, "worldentnumber" }, - { 0x141, "obituary" }, - { 0x142, "positionwouldtelefrag" }, - { 0x143, "canspawn" }, - { 0x144, "getstarttime" }, - { 0x145, "precachestatusicon" }, - { 0x146, "precacheheadicon" }, - { 0x147, "precacheminimapicon" }, - { 0x148, "precachempanim" }, - { 0x149, "map_restart" }, - { 0x14A, "exitlevel" }, - { 0x14B, "addtestclient" }, - { 0x14C, "makedvarserverinfo" }, - { 0x14D, "setarchive" }, - { 0x14E, "allclientsprint" }, - { 0x14F, "clientprint" }, - { 0x150, "mapexists" }, - { 0x151, "isvalidgametype" }, - { 0x152, "matchend" }, - { 0x153, "setplayerteamrank" }, - { 0x154, "endparty" }, - { 0x155, "setteamradar" }, - { 0x156, "getteamradar" }, - { 0x157, "setteamradarstrength" }, - { 0x158, "getteamradarstrength" }, - { 0x159, "getuavstrengthmin" }, - { 0x15A, "physicsexplosionsphere" }, - { 0x15B, "physicsexplosioncylinder" }, - { 0x15C, "physicsjolt" }, - { 0x15D, "physicsjitter" }, - { 0x15E, "setexpfog" }, - { 0x15F, "isexplosivedamagemod" }, - { 0x160, "radiusdamage" }, - { 0x161, "setplayerignoreradiusdamage" }, - { 0x162, "glassradiusdamage" }, - { 0x163, "earthquake" }, - { 0x164, "getnumparts" }, - { 0x165, "objective_onentity" }, - { 0x166, "objective_team" }, - { 0x167, "objective_player" }, - { 0x168, "objective_playerteam" }, - { 0x169, "objective_playerenemyteam" }, - { 0x16A, "iprintln" }, - { 0x16B, "iprintlnbold" }, - { 0x16C, "logstring" }, - { 0x16D, "getent" }, - { 0x16E, "getentarray" }, - { 0x16F, "spawnplane" }, - { 0x170, "spawnstruct" }, - { 0x171, "spawnhelicopter" }, - { 0x172, "isalive" }, - { 0x173, "isspawner" }, - { 0x174, "missile_createattractorent" }, - { 0x175, "missile_createattractororigin" }, - { 0x176, "missile_createrepulsorent" }, - { 0x177, "missile_createrepulsororigin" }, - { 0x178, "missile_deleteattractor" }, - { 0x179, "playsoundatpos" }, - { 0x17A, "newhudelem" }, - { 0x17B, "newclienthudelem" }, - { 0x17C, "newteamhudelem" }, - { 0x17D, "resettimeout" }, - { 0x17E, "precachefxteamthermal" }, - { 0x17F, "isplayer" }, - { 0x180, "isplayernumber" }, - { 0x181, "setwinningplayer" }, - { 0x182, "getpartname" }, - { 0x183, "weaponfiretime" }, - { 0x184, "weaponclipsize" }, - { 0x185, "weaponisauto" }, - { 0x186, "weaponissemiauto" }, - { 0x187, "weaponisboltaction" }, - { 0x188, "weaponinheritsperks" }, - { 0x189, "weaponburstcount" }, - { 0x18A, "weapontype" }, - { 0x18B, "weaponclass" }, - { 0x18C, "getnextarraykey" }, - { 0x18D, "sortbydistance" }, - { 0x18E, "tablelookup" }, - { 0x18F, "tablelookupbyrow" }, - { 0x190, "tablelookupistring" }, - { 0x191, "tablelookupistringbyrow" }, - { 0x192, "tablelookuprownum" }, - { 0x193, "getmissileowner" }, - { 0x194, "magicbullet" }, - { 0x195, "getweaponflashtagname" }, - { 0x196, "averagepoint" }, - { 0x197, "averagenormal" }, - { 0x198, "vehicle_getspawnerarray" }, - { 0x199, "playrumbleonposition" }, - { 0x19A, "playrumblelooponposition" }, - { 0x19B, "stopallrumbles" }, - { 0x19C, "soundexists" }, - { 0x19D, "openfile" }, - { 0x19E, "closefile" }, - { 0x19F, "fprintln" }, - { 0x1A0, "fprintfields" }, - { 0x1A1, "freadln" }, - { 0x1A2, "fgetarg" }, - { 0x1A3, "setminimap" }, - { 0x1A4, "setthermalbodymaterial" }, - { 0x1A5, "getarraykeys" }, - { 0x1A6, "getfirstarraykey" }, - { 0x1A7, "getglass" }, - { 0x1A8, "getglassarray" }, - { 0x1A9, "getglassorigin" }, - { 0x1AA, "isglassdestroyed" }, - { 0x1AB, "destroyglass" }, - { 0x1AC, "deleteglass" }, - { 0x1AD, "getentchannelscount" }, - { 0x1AE, "getentchannelname" }, - { 0x1AF, "objective_add" }, - { 0x1B0, "objective_delete" }, - { 0x1B1, "objective_state" }, - { 0x1B2, "objective_icon" }, - { 0x1B3, "objective_position" }, - { 0x1B4, "objective_current" }, - { 0x1B5, "weaponinventorytype" }, - { 0x1B6, "weaponstartammo" }, - { 0x1B7, "weaponmaxammo" }, - { 0x1B8, "weaponaltweaponname" }, - { 0x1B9, "isweaponcliponly" }, - { 0x1BA, "isweapondetonationtimed" }, - { 0x1BB, "weaponhasthermalscope" }, - { 0x1BC, "getvehiclenode" }, - { 0x1BD, "getvehiclenodearray" }, - { 0x1BE, "getallvehiclenodes" }, - { 0x1BF, "getnumvehicles" }, - { 0x1C0, "precachevehicle" }, - { 0x1C1, "spawnvehicle" }, - { 0x1C2, "vehicle_getarray" }, - { 0x1C3, "gettimesincelastpaused" }, - { 0x1C4, "setlasermaterial" }, - { 0x1C5, "precachefxontag" }, - { 0x1C6, "precachetag" }, - { 0x1C7, "precachesound" }, -}}; - -const std::array, 780> method_list -{{ - { 0x8000, "thermaldrawdisable" }, - { 0x8001, "setturretdismountorg" }, - { 0x8002, "setdamagestate" }, - { 0x8003, "playsoundtoteam" }, - { 0x8004, "playsoundtoplayer" }, - { 0x8005, "playerhide" }, - { 0x8006, "showtoplayer" }, - { 0x8007, "enableplayeruse" }, - { 0x8008, "disableplayeruse" }, - { 0x8009, "makescrambler" }, - { 0x800A, "makeportableradar" }, - { 0x800B, "maketrophysystem" }, - { 0x800C, "placespawnpoint" }, - { 0x800D, "setteamfortrigger" }, - { 0x800E, "clientclaimtrigger" }, - { 0x800F, "clientreleasetrigger" }, - { 0x8010, "releaseclaimedtrigger" }, - { 0x8011, "isusingonlinedataoffline" }, - { 0x8012, "getrestedtime" }, - { 0x8013, "sendleaderboards" }, - { 0x8014, "isonladder" }, - { 0x8015, "getcorpseanim" }, - { 0x8016, "playerforcedeathanim" }, - { 0x8017, "attach" }, - { 0x8018, "attachshieldmodel" }, - { 0x8019, "getlightfovinner" }, - { 0x801A, "getlightfovouter" }, - { 0x801B, "setlightfovrange" }, - { 0x801C, "getlightexponent" }, - { 0x801D, "setlightexponent" }, - { 0x801E, "startragdoll" }, - { 0x801F, "startragdollfromimpact" }, - { 0x8020, "logstring" }, - { 0x8021, "laserhidefromclient" }, - { 0x8022, "stopsoundchannel" }, - { 0x8023, "thermaldrawenable" }, - { 0x8024, "detach" }, - { 0x8025, "detachshieldmodel" }, - { 0x8026, "moveshieldmodel" }, - { 0x8027, "detachall" }, - { 0x8028, "getattachsize" }, - { 0x8029, "getattachmodelname" }, - { 0x802A, "getattachtagname" }, - { 0x802B, "setturretcanaidetach" }, - { 0x802C, "setturretfov" }, - { 0x802D, "lerpfov" }, - { 0x802E, "getvalidcoverpeekouts" }, - { 0x802F, "gethighestnodestance" }, - { 0x8030, "doesnodeallowstance" }, - { 0x8031, "getgunangles" }, - { 0x8032, "magicgrenade" }, - { 0x8033, "magicgrenademanual" }, - { 0x8034, "setfriendlychain" }, - { 0x8035, "getentnum" }, - { 0x8036, "launch" }, - { 0x8037, "setsoundblend" }, - { 0x8038, "makefakeai" }, - { 0x8039, "spawndrone" }, - { 0x803A, "setcorpseremovetimer" }, - { 0x803B, "setlookattext" }, - { 0x803C, "setspawnerteam" }, - { 0x803D, "addaieventlistener" }, - { 0x803E, "removeaieventlistener" }, - { 0x803F, "getlightcolor" }, - { 0x8040, "setlightcolor" }, - { 0x8041, "getlightradius" }, - { 0x8042, "setlightradius" }, - { 0x8043, "getattachignorecollision" }, - { 0x8044, "hidepart" }, - { 0x8045, "hidepart_allinstances" }, - { 0x8046, "hideallparts" }, - { 0x8047, "showpart" }, - { 0x8048, "showallparts" }, - { 0x8049, "linkto" }, - { 0x804A, "linktoblendtotag" }, - { 0x804B, "unlink" }, - { 0x804C, "setnormalhealth" }, - { 0x804D, "dodamage" }, - { 0x804E, "kill" }, - { 0x804F, "show" }, - { 0x8050, "hide" }, - { 0x8051, "showonclient" }, - { 0x8052, "hideonclient" }, - { 0x8053, "laserforceon" }, - { 0x8054, "laserforceoff" }, - { 0x8055, "disconnectpaths" }, - { 0x8056, "connectpaths" }, - { 0x8057, "startusingheroonlylighting" }, - { 0x8058, "stopusingheroonlylighting" }, - { 0x8059, "startusinglessfrequentlighting" }, - { 0x805A, "stopusinglessfrequentlighting" }, - { 0x805B, "setthermalfog" }, - { 0x805C, "setnightvisionfog" }, - { 0x805D, "clearthermalfog" }, - { 0x805E, "clearnightvisionfog" }, - { 0x805F, "digitaldistortsetparams" }, - { 0x8060, "setmode" }, - { 0x8061, "getmode" }, - { 0x8062, "setturretignoregoals" }, - { 0x8063, "islinked" }, - { 0x8064, "enablelinkto" }, - { 0x8065, "playsoundatviewheight" }, - { 0x8066, "prefetchsound" }, - { 0x8067, "setpitch" }, - { 0x8068, "scalepitch" }, - { 0x8069, "setvolume" }, - { 0x806A, "scalevolume" }, - { 0x806B, "setspeakermapmonotostereo" }, - { 0x806C, "setspeakermapmonoto51" }, - { 0x806D, "setdistributed2dsound" }, - { 0x806E, "playsoundasmaster" }, - { 0x806F, "playloopsound" }, - { 0x8070, "eqon" }, - { 0x8071, "eqoff" }, - { 0x8072, "haseq" }, - { 0x8073, "iswaitingonsound" }, - { 0x8074, "getnormalhealth" }, - { 0x8075, "playerlinkto" }, - { 0x8076, "playerlinktodelta" }, - { 0x8077, "playerlinkweaponviewtodelta" }, - { 0x8078, "playerlinktoabsolute" }, - { 0x8079, "playerlinktoblend" }, - { 0x807A, "playerlinkedoffsetenable" }, - { 0x807B, "setwaypointedgestyle_secondaryarrow" }, - { 0x807C, "setwaypointiconoffscreenonly" }, - { 0x807D, "fadeovertime" }, - { 0x807E, "scaleovertime" }, - { 0x807F, "moveovertime" }, - { 0x8080, "reset" }, - { 0x8081, "destroy" }, - { 0x8082, "setpulsefx" }, - { 0x8083, "setplayernamestring" }, - { 0x8084, "changefontscaleovertime" }, - { 0x8085, "startignoringspotlight" }, - { 0x8086, "stopignoringspotlight" }, - { 0x8087, "dontcastshadows" }, - { 0x8088, "castshadows" }, - { 0x8089, "setstablemissile" }, - { 0x808A, "playersetgroundreferenceent" }, - { 0x808B, "dontinterpolate" }, - { 0x808C, "dospawn" }, - { 0x808D, "stalingradspawn" }, - { 0x808E, "getorigin" }, - { 0x808F, "getcentroid" }, - { 0x8090, "getshootatpos" }, - { 0x8091, "getdebugeye" }, - { 0x8092, "useby" }, - { 0x8093, "playsound" }, - { 0x8094, "playerlinkedoffsetdisable" }, - { 0x8095, "playerlinkedsetviewznear" }, - { 0x8096, "playerlinkedsetusebaseangleforviewclamp" }, - { 0x8097, "lerpviewangleclamp" }, - { 0x8098, "setviewangleresistance" }, - { 0x8099, "geteye" }, - { 0x809A, "istouching" }, - { 0x809B, "stoploopsound" }, - { 0x809C, "stopsounds" }, - { 0x809D, "playrumbleonentity" }, - { 0x809E, "playrumblelooponentity" }, - { 0x809F, "stoprumble" }, - { 0x80A0, "delete" }, - { 0x80A1, "setmodel" }, - { 0x80A2, "laseron" }, - { 0x80A3, "laseroff" }, - { 0x80A4, "laseraltviewon" }, - { 0x80A5, "laseraltviewoff" }, - { 0x80A6, "thermalvisionon" }, - { 0x80A7, "thermalvisionoff" }, - { 0x80A8, "thermalvisionfofoverlayon" }, - { 0x80A9, "thermalvisionfofoverlayoff" }, - { 0x80AA, "autospotoverlayon" }, - { 0x80AB, "autospotoverlayoff" }, - { 0x80AC, "setcontents" }, - { 0x80AD, "makeusable" }, - { 0x80AE, "makeunusable" }, - { 0x80AF, "setwhizbyprobabilities" }, - { 0x80B0, "visionsetnakedforplayer_lerp" }, - { 0x80B1, "setwaitnode" }, - { 0x80B2, "returnplayercontrol" }, - { 0x80B3, "vehphys_starttrack" }, - { 0x80B4, "vehphys_clearautodisable" }, - { 0x80B5, "vehicleusealtblendedaudio" }, - { 0x80B6, "settext" }, - { 0x80B7, "clearalltextafterhudelem" }, - { 0x80B8, "setshader" }, - { 0x80B9, "settargetent" }, - { 0x80BA, "cleartargetent" }, - { 0x80BB, "settimer" }, - { 0x80BC, "settimerup" }, - { 0x80BD, "settimerstatic" }, - { 0x80BE, "settenthstimer" }, - { 0x80BF, "settenthstimerup" }, - { 0x80C0, "settenthstimerstatic" }, - { 0x80C1, "setclock" }, - { 0x80C2, "setclockup" }, - { 0x80C3, "setvalue" }, - { 0x80C4, "setwaypoint" }, - { 0x80C5, "setwaypointedgestyle_rotatingicon" }, - { 0x80C6, "setcursorhint" }, - { 0x80C7, "sethintstring" }, - { 0x80C8, "forceusehinton" }, - { 0x80C9, "forceusehintoff" }, - { 0x80CA, "makesoft" }, - { 0x80CB, "makehard" }, - { 0x80CC, "willneverchange" }, - { 0x80CD, "startfiring" }, - { 0x80CE, "stopfiring" }, - { 0x80CF, "isfiringturret" }, - { 0x80D0, "startbarrelspin" }, - { 0x80D1, "stopbarrelspin" }, - { 0x80D2, "getbarrelspinrate" }, - { 0x80D3, "remotecontrolturret" }, - { 0x80D4, "remotecontrolturretoff" }, - { 0x80D5, "shootturret" }, - { 0x80D6, "getturretowner" }, - { 0x80D7, "enabledeathshield" }, - { 0x80D8, "nightvisiongogglesforceon" }, - { 0x80D9, "nightvisiongogglesforceoff" }, - { 0x80DA, "enableinvulnerability" }, - { 0x80DB, "disableinvulnerability" }, - { 0x80DC, "enablebreaching" }, - { 0x80DD, "disablebreaching" }, - { 0x80DE, "forceviewmodelanimation" }, - { 0x80DF, "disableturretdismount" }, - { 0x80E0, "enableturretdismount" }, - { 0x80E1, "uploadscore" }, - { 0x80E2, "uploadtime" }, - { 0x80E3, "uploadleaderboards" }, - { 0x80E4, "giveachievement" }, - { 0x80E5, "hidehud" }, - { 0x80E6, "showhud" }, - { 0x80E7, "mountvehicle" }, - { 0x80E8, "dismountvehicle" }, - { 0x80E9, "enableslowaim" }, - { 0x80EA, "disableslowaim" }, - { 0x80EB, "usehintsinvehicle" }, - { 0x80EC, "vehicleattackbuttonpressed" }, - { 0x80ED, "setwhizbyoffset" }, - { 0x80EE, "setsentryowner" }, - { 0x80EF, "setsentrycarrier" }, - { 0x80F0, "setturretminimapvisible" }, - { 0x80F1, "settargetentity" }, - { 0x80F2, "snaptotargetentity" }, - { 0x80F3, "cleartargetentity" }, - { 0x80F4, "getturrettarget" }, - { 0x80F5, "setplayerspread" }, - { 0x80F6, "setaispread" }, - { 0x80F7, "setsuppressiontime" }, - { 0x80F8, "setflaggedanimknobrestart" }, - { 0x80F9, "setflaggedanimknoblimitedrestart" }, - { 0x80FA, "setflaggedanimknoball" }, - { 0x80FB, "setflaggedanimknoballrestart" }, - { 0x80FC, "setflaggedanim" }, - { 0x80FD, "setflaggedanimlimited" }, - { 0x80FE, "setflaggedanimrestart" }, - { 0x80FF, "setflaggedanimlimitedrestart" }, - { 0x8100, "useanimtree" }, - { 0x8101, "stopuseanimtree" }, - { 0x8102, "setanimtime" }, - { 0x8103, "showviewmodel" }, - { 0x8104, "hideviewmodel" }, - { 0x8105, "allowstand" }, - { 0x8106, "allowcrouch" }, - { 0x8107, "allowprone" }, - { 0x8108, "allowlean" }, - { 0x8109, "setocclusion" }, - { 0x810A, "deactivateocclusion" }, - { 0x810B, "isocclusionenabled" }, - { 0x810C, "iseqenabled" }, - { 0x810D, "seteq" }, - { 0x810E, "seteqbands" }, - { 0x810F, "deactivateeq" }, - { 0x8110, "seteqlerp" }, - { 0x8111, "islookingat" }, - { 0x8112, "isthrowinggrenade" }, - { 0x8113, "isfiring" }, - { 0x8114, "ismeleeing" }, - { 0x8115, "setautopickup" }, - { 0x8116, "allowmelee" }, - { 0x8117, "allowfire" }, - { 0x8118, "enablehealthshield" }, - { 0x8119, "setconvergencetime" }, - { 0x811A, "setconvergenceheightpercent" }, - { 0x811B, "setturretteam" }, - { 0x811C, "maketurretsolid" }, - { 0x811D, "maketurretoperable" }, - { 0x811E, "maketurretinoperable" }, - { 0x811F, "makeentitysentient" }, - { 0x8120, "freeentitysentient" }, - { 0x8121, "isindoor" }, - { 0x8122, "getdroptofloorposition" }, - { 0x8123, "isbadguy" }, - { 0x8124, "animscripted" }, - { 0x8125, "animscriptedthirdperson" }, - { 0x8126, "animrelative" }, - { 0x8127, "stopanimscripted" }, - { 0x8128, "clearanim" }, - { 0x8129, "setanimknob" }, - { 0x812A, "setanimknoblimited" }, - { 0x812B, "setanimknobrestart" }, - { 0x812C, "setanimknoblimitedrestart" }, - { 0x812D, "setanimknoball" }, - { 0x812E, "setanimknoballlimited" }, - { 0x812F, "setanimknoballrestart" }, - { 0x8130, "setanimknoballlimitedrestart" }, - { 0x8131, "setanim" }, - { 0x8132, "setanimlimited" }, - { 0x8133, "setanimrestart" }, - { 0x8134, "setanimlimitedrestart" }, - { 0x8135, "getanimtime" }, - { 0x8136, "getanimweight" }, - { 0x8137, "getanimassettype" }, - { 0x8138, "setflaggedanimknob" }, - { 0x8139, "setflaggedanimknoblimited" }, - { 0x813A, "setturretaccuracy" }, - { 0x813B, "setrightarc" }, - { 0x813C, "setleftarc" }, - { 0x813D, "settoparc" }, - { 0x813E, "setbottomarc" }, - { 0x813F, "setautorotationdelay" }, - { 0x8140, "setdefaultdroppitch" }, - { 0x8141, "restoredefaultdroppitch" }, - { 0x8142, "turretfiredisable" }, - { 0x8143, "getfixednodesafevolume" }, - { 0x8144, "clearfixednodesafevolume" }, - { 0x8145, "isingoal" }, - { 0x8146, "setruntopos" }, - { 0x8147, "nearnode" }, - { 0x8148, "nearclaimnode" }, - { 0x8149, "nearclaimnodeandangle" }, - { 0x814A, "atdangerousnode" }, - { 0x814B, "getenemyinfo" }, - { 0x814C, "clearenemy" }, - { 0x814D, "setentitytarget" }, - { 0x814E, "clearentitytarget" }, - { 0x814F, "setpotentialthreat" }, - { 0x8150, "clearpotentialthreat" }, - { 0x8151, "setflashbanged" }, - { 0x8152, "setengagementmindist" }, - { 0x8153, "setengagementmaxdist" }, - { 0x8154, "isknownenemyinradius" }, - { 0x8155, "isknownenemyinvolume" }, - { 0x8156, "settalktospecies" }, - { 0x8157, "laseralton" }, - { 0x8158, "laseraltoff" }, - { 0x8159, "invisiblenotsolid" }, - { 0x815A, "visiblesolid" }, - { 0x815B, "setdefaultaimlimits" }, - { 0x815C, "initriotshieldhealth" }, - { 0x815D, "getenemysqdist" }, - { 0x815E, "getclosestenemysqdist" }, - { 0x815F, "setthreatbiasgroup" }, - { 0x8160, "getthreatbiasgroup" }, - { 0x8161, "turretfireenable" }, - { 0x8162, "setturretmodechangewait" }, - { 0x8163, "usetriggerrequirelookat" }, - { 0x8164, "getstance" }, - { 0x8165, "setstance" }, - { 0x8166, "itemweaponsetammo" }, - { 0x8167, "getammocount" }, - { 0x8168, "gettagorigin" }, - { 0x8169, "gettagangles" }, - { 0x816A, "shellshock" }, - { 0x816B, "stunplayer" }, - { 0x816C, "stopshellshock" }, - { 0x816D, "fadeoutshellshock" }, - { 0x816E, "setdepthoffield" }, - { 0x816F, "setviewmodeldepthoffield" }, - { 0x8170, "setmotionblurmovescale" }, - { 0x8171, "pickupgrenade" }, - { 0x8172, "useturret" }, - { 0x8173, "stopuseturret" }, - { 0x8174, "canuseturret" }, - { 0x8175, "traversemode" }, - { 0x8176, "animmode" }, - { 0x8177, "orientmode" }, - { 0x8178, "getmotionangle" }, - { 0x8179, "shouldfacemotion" }, - { 0x817A, "getanglestolikelyenemypath" }, - { 0x817B, "setturretanim" }, - { 0x817C, "getturret" }, - { 0x817D, "getgroundenttype" }, - { 0x817E, "animcustom" }, - { 0x817F, "isinscriptedstate" }, - { 0x8180, "canattackenemynode" }, - { 0x8181, "getnegotiationstartnode" }, - { 0x8182, "getnegotiationendnode" }, - { 0x8183, "getdoorpathnode" }, - { 0x8184, "comparenodedirtopathdir" }, - { 0x8185, "checkprone" }, - { 0x8186, "pushplayer" }, - { 0x8187, "checkgrenadethrowpos" }, - { 0x8188, "setgoalnode" }, - { 0x8189, "setgoalpos" }, - { 0x818A, "setgoalentity" }, - { 0x818B, "setgoalvolume" }, - { 0x818C, "setgoalvolumeauto" }, - { 0x818D, "getgoalvolume" }, - { 0x818E, "cleargoalvolume" }, - { 0x818F, "setfixednodesafevolume" }, - { 0x8190, "setmotionblurturnscale" }, - { 0x8191, "setmotionblurzoomscale" }, - { 0x8192, "viewkick" }, - { 0x8193, "localtoworldcoords" }, - { 0x8194, "getentitynumber" }, - { 0x8195, "getentityvelocity" }, - { 0x8196, "enablegrenadetouchdamage" }, - { 0x8197, "disablegrenadetouchdamage" }, - { 0x8198, "enableaimassist" }, - { 0x8199, "setlookatyawlimits" }, - { 0x819A, "stoplookat" }, - { 0x819B, "getmuzzlepos" }, - { 0x819C, "getmuzzleangle" }, - { 0x819D, "getmuzzlesideoffsetpos" }, - { 0x819E, "getaimangle" }, - { 0x819F, "canshoot" }, - { 0x81A0, "canshootenemy" }, - { 0x81A1, "cansee" }, - { 0x81A2, "seerecently" }, - { 0x81A3, "lastknowntime" }, - { 0x81A4, "lastknownpos" }, - { 0x81A5, "dropweapon" }, - { 0x81A6, "maymovetopoint" }, - { 0x81A7, "maymovefrompointtopoint" }, - { 0x81A8, "teleport" }, - { 0x81A9, "forceteleport" }, - { 0x81AA, "safeteleport" }, - { 0x81AB, "withinapproxpathdist" }, - { 0x81AC, "ispathdirect" }, - { 0x81AD, "allowedstances" }, - { 0x81AE, "isstanceallowed" }, - { 0x81AF, "issuppressionwaiting" }, - { 0x81B0, "issuppressed" }, - { 0x81B1, "ismovesuppressed" }, - { 0x81B2, "isgrenadepossafe" }, - { 0x81B3, "checkgrenadethrow" }, - { 0x81B4, "checkgrenadelaunch" }, - { 0x81B5, "checkgrenadelaunchpos" }, - { 0x81B6, "throwgrenade" }, - { 0x81B7, "disableaimassist" }, - { 0x81B8, "radiusdamage" }, - { 0x81B9, "detonate" }, - { 0x81BA, "damageconetrace" }, - { 0x81BB, "sightconetrace" }, - { 0x81BC, "missile_settargetent" }, - { 0x81BD, "missile_settargetpos" }, - { 0x81BE, "missile_cleartarget" }, - { 0x81BF, "missile_setflightmodedirect" }, - { 0x81C0, "missile_setflightmodetop" }, - { 0x81C1, "getlightintensity" }, - { 0x81C2, "setlightintensity" }, - { 0x81C3, "isragdoll" }, - { 0x81C4, "setmovespeedscale" }, - { 0x81C5, "cameralinkto" }, - { 0x81C6, "cameraunlink" }, - { 0x81C7, "startcoverarrival" }, - { 0x81C8, "starttraversearrival" }, - { 0x81C9, "checkcoverexitposwithpath" }, - { 0x81CA, "shoot" }, - { 0x81CB, "shootblank" }, - { 0x81CC, "melee" }, - { 0x81CD, "updateplayersightaccuracy" }, - { 0x81CE, "findshufflecovernode" }, - { 0x81CF, "findnearbycovernode" }, - { 0x81D0, "findcovernode" }, - { 0x81D1, "findbestcovernode" }, - { 0x81D2, "getcovernode" }, - { 0x81D3, "usecovernode" }, - { 0x81D4, "iscovervalidagainstenemy" }, - { 0x81D5, "reacquirestep" }, - { 0x81D6, "findreacquiredirectpath" }, - { 0x81D7, "trimpathtoattack" }, - { 0x81D8, "reacquiremove" }, - { 0x81D9, "findreacquireproximatepath" }, - { 0x81DA, "flagenemyunattackable" }, - { 0x81DB, "enterprone" }, - { 0x81DC, "exitprone" }, - { 0x81DD, "setproneanimnodes" }, - { 0x81DE, "updateprone" }, - { 0x81DF, "clearpitchorient" }, - { 0x81E0, "setlookatanimnodes" }, - { 0x81E1, "setlookat" }, - { 0x81E2, "setlookatentity" }, - { 0x81E3, "controlslinkto" }, - { 0x81E4, "controlsunlink" }, - { 0x81E5, "makevehiclesolidcapsule" }, - { 0x81E6, "makevehiclesolidsphere" }, - { 0x81E7, "makevehiclesolid" }, - { 0x81E8, "remotecontrolvehicle" }, - { 0x81E9, "remotecontrolvehicleoff" }, - { 0x81EA, "isfiringvehicleturret" }, - { 0x81EB, "drivevehicleandcontrolturret" }, - { 0x81EC, "drivevehicleandcontrolturretoff" }, - { 0x81ED, "getplayersetting" }, - { 0x81EE, "getlocalplayerprofiledata" }, - { 0x81EF, "setlocalplayerprofiledata" }, - { 0x81F0, "remotecamerasoundscapeon" }, - { 0x81F1, "remotecamerasoundscapeoff" }, - { 0x81F2, "radarjamon" }, - { 0x81F3, "radarjamoff" }, - { 0x81F4, "setmotiontrackervisible" }, - { 0x81F5, "getmotiontrackervisible" }, - { 0x81F6, "worldpointinreticle_circle" }, - { 0x81F7, "getpointinbounds" }, - { 0x81F8, "transfermarkstonewscriptmodel" }, - { 0x81F9, "setwatersheeting" }, - { 0x81FA, "setweaponhudiconoverride" }, - { 0x81FB, "getweaponhudiconoverride" }, - { 0x81FC, "setempjammed" }, - { 0x81FD, "playersetexpfog" }, - { 0x81FE, "isitemunlocked" }, - { 0x81FF, "getplayerdata" }, - { 0x8200, "vehicleturretcontroloff" }, - { 0x8201, "isturretready" }, - { 0x8202, "vehicledriveto" }, - { 0x8203, "dospawn" }, - { 0x8204, "isphysveh" }, - { 0x8205, "phys_crash" }, - { 0x8206, "phys_launch" }, - { 0x8207, "phys_disablecrashing" }, - { 0x8208, "phys_enablecrashing" }, - { 0x8209, "phys_setspeed" }, - { 0x820A, "phys_setconveyerbelt" }, - { 0x820B, "freehelicopter" }, - { 0x820C, "playerlinkedturretanglesenable" }, - { 0x820D, "playerlinkedturretanglesdisable" }, - { 0x820E, "playersetstreamorigin" }, - { 0x820F, "playerclearstreamorigin" }, - { 0x8210, "nightvisionviewon" }, - { 0x8211, "nightvisionviewoff" }, - { 0x8212, "painvisionon" }, - { 0x8213, "painvisionoff" }, - { 0x8214, "getplayerintelisfound" }, - { 0x8215, "setplayerintelfound" }, - { 0x8216, "newpip" }, - { 0x8217, "sethuddynlight" }, - { 0x8218, "startscriptedanim" }, - { 0x8219, "startcoverbehavior" }, - { 0x821A, "setplayerdata" }, - { 0x821B, "trackerupdate" }, - { 0x821C, "pingplayer" }, - { 0x821D, "buttonpressed" }, - { 0x821E, "sayall" }, - { 0x821F, "sayteam" }, - { 0x8220, "showscoreboard" }, - { 0x8221, "setspawnweapon" }, - { 0x8222, "dropitem" }, - { 0x8223, "dropscavengerbag" }, - { 0x8224, "setjitterparams" }, - { 0x8225, "sethoverparams" }, - { 0x8226, "joltbody" }, - { 0x8227, "freevehicle" }, - { 0x8228, "getwheelsurface" }, - { 0x8229, "getvehicleowner" }, - { 0x822A, "setvehiclelookattext" }, - { 0x822B, "setvehicleteam" }, - { 0x822C, "setneargoalnotifydist" }, - { 0x822D, "setvehgoalpos" }, - { 0x822E, "setgoalyaw" }, - { 0x822F, "cleargoalyaw" }, - { 0x8230, "settargetyaw" }, - { 0x8231, "cleartargetyaw" }, - { 0x8232, "vehicle_helisetai" }, - { 0x8233, "setturrettargetvec" }, - { 0x8234, "setturrettargetent" }, - { 0x8235, "clearturrettarget" }, - { 0x8236, "vehicle_canturrettargetpoint" }, - { 0x8237, "setlookatent" }, - { 0x8238, "clearlookatent" }, - { 0x8239, "setvehweapon" }, - { 0x823A, "fireweapon" }, - { 0x823B, "vehicleturretcontrolon" }, - { 0x823C, "finishplayerdamage" }, - { 0x823D, "suicide" }, - { 0x823E, "closeingamemenu" }, - { 0x823F, "iprintln" }, - { 0x8240, "iprintlnbold" }, - { 0x8241, "spawn" }, - { 0x8242, "setentertime" }, - { 0x8243, "cloneplayer" }, - { 0x8244, "istalking" }, - { 0x8245, "allowspectateteam" }, - { 0x8246, "getguid" }, - { 0x8247, "physicslaunchserver" }, - { 0x8248, "physicslaunchserveritem" }, - { 0x8249, "clonebrushmodeltoscriptmodel" }, - { 0x824A, "scriptmodelplayanim" }, - { 0x824B, "scriptmodelclearanim" }, - { 0x824C, "vehicle_teleport" }, - { 0x824D, "attachpath" }, - { 0x824E, "getattachpos" }, - { 0x824F, "startpath" }, - { 0x8250, "setswitchnode" }, - { 0x8251, "setwaitspeed" }, - { 0x8252, "vehicle_finishdamage" }, - { 0x8253, "vehicle_setspeed" }, - { 0x8254, "vehicle_setspeedimmediate" }, - { 0x8255, "vehicle_rotateyaw" }, - { 0x8256, "vehicle_getspeed" }, - { 0x8257, "vehicle_getvelocity" }, - { 0x8258, "vehicle_getbodyvelocity" }, - { 0x8259, "vehicle_getsteering" }, - { 0x825A, "vehicle_getthrottle" }, - { 0x825B, "vehicle_turnengineoff" }, - { 0x825C, "vehicle_turnengineon" }, - { 0x825D, "getgoalspeedmph" }, - { 0x825E, "setacceleration" }, - { 0x825F, "setdeceleration" }, - { 0x8260, "resumespeed" }, - { 0x8261, "setyawspeed" }, - { 0x8262, "setyawspeedbyname" }, - { 0x8263, "setmaxpitchroll" }, - { 0x8264, "setairresistance" }, - { 0x8265, "setturningability" }, - { 0x8266, "getxuid" }, - { 0x8267, "ishost" }, - { 0x8268, "getspectatingplayer" }, - { 0x8269, "predictstreampos" }, - { 0x826A, "updatescores" }, - { 0x826B, "updatedmscores" }, - { 0x826C, "setrank" }, - { 0x826D, "setcardtitle" }, - { 0x826E, "weaponlocknoclearance" }, - { 0x826F, "visionsyncwithplayer" }, - { 0x8270, "showhudsplash" }, - { 0x8271, "setperk" }, - { 0x8272, "hasperk" }, - { 0x8273, "clearperks" }, - { 0x8274, "unsetperk" }, - { 0x8275, "noclip" }, - { 0x8276, "ufo" }, - { 0x8277, "moveto" }, - { 0x8278, "movex" }, - { 0x8279, "movey" }, - { 0x827A, "movez" }, - { 0x827B, "movegravity" }, - { 0x827C, "moveslide" }, - { 0x827D, "stopmoveslide" }, - { 0x827E, "rotateto" }, - { 0x827F, "rotatepitch" }, - { 0x8280, "rotateyaw" }, - { 0x8281, "rotateroll" }, - { 0x8282, "addpitch" }, - { 0x8283, "addyaw" }, - { 0x8284, "addroll" }, - { 0x8285, "vibrate" }, - { 0x8286, "rotatevelocity" }, - { 0x8287, "solid" }, - { 0x8288, "notsolid" }, - { 0x8289, "setcandamage" }, - { 0x828A, "setcanradiusdamage" }, - { 0x828B, "physicslaunchclient" }, - { 0x828C, "setcardicon" }, - { 0x828D, "setcardnameplate" }, - { 0x828E, "setcarddisplayslot" }, - { 0x828F, "kc_regweaponforfxremoval" }, - { 0x8290, "laststandrevive" }, - { 0x8291, "setspectatedefaults" }, - { 0x8292, "getthirdpersoncrosshairoffset" }, - { 0x8293, "disableweaponpickup" }, - { 0x8294, "enableweaponpickup" }, - { 0x8295, "issplitscreenplayer" }, - { 0x8296, "getweaponslistoffhands" }, - { 0x8297, "getweaponslistitems" }, - { 0x8298, "getweaponslistexclusives" }, - { 0x8299, "getweaponslist" }, - { 0x829A, "canplayerplacesentry" }, - { 0x829B, "canplayerplacetank" }, - { 0x829C, "visionsetnakedforplayer" }, - { 0x829D, "visionsetnightforplayer" }, - { 0x829E, "visionsetmissilecamforplayer" }, - { 0x829F, "visionsetthermalforplayer" }, - { 0x82A0, "visionsetpainforplayer" }, - { 0x82A1, "setblurforplayer" }, - { 0x82A2, "getplayerweaponmodel" }, - { 0x82A3, "getplayerknifemodel" }, - { 0x82A4, "updateplayermodelwithweapons" }, - { 0x82A5, "notifyonplayercommand" }, - { 0x82A6, "canmantle" }, - { 0x82A7, "forcemantle" }, - { 0x82A8, "ismantling" }, - { 0x82A9, "playfx" }, - { 0x82AA, "player_recoilscaleon" }, - { 0x82AB, "player_recoilscaleoff" }, - { 0x82AC, "weaponlockstart" }, - { 0x82AD, "weaponlockfinalize" }, - { 0x82AE, "weaponlockfree" }, - { 0x82AF, "weaponlocktargettooclose" }, - { 0x82B0, "issplitscreenplayerprimary" }, - { 0x82B1, "getviewmodel" }, - { 0x82B2, "fragbuttonpressed" }, - { 0x82B3, "secondaryoffhandbuttonpressed" }, - { 0x82B4, "getcurrentweaponclipammo" }, - { 0x82B5, "setvelocity" }, - { 0x82B6, "getplayerviewheight" }, - { 0x82B7, "getnormalizedmovement" }, - { 0x82B8, "setchannelvolumes" }, - { 0x82B9, "deactivatechannelvolumes" }, - { 0x82BA, "playlocalsound" }, - { 0x82BB, "stoplocalsound" }, - { 0x82BC, "setweaponammoclip" }, - { 0x82BD, "setweaponammostock" }, - { 0x82BE, "getweaponammoclip" }, - { 0x82BF, "getweaponammostock" }, - { 0x82C0, "anyammoforweaponmodes" }, - { 0x82C1, "setclientdvar" }, - { 0x82C2, "setclientdvars" }, - { 0x82C3, "allowads" }, - { 0x82C4, "allowjump" }, - { 0x82C5, "allowsprint" }, - { 0x82C6, "setspreadoverride" }, - { 0x82C7, "resetspreadoverride" }, - { 0x82C8, "setaimspreadmovementscale" }, - { 0x82C9, "setactionslot" }, - { 0x82CA, "setviewkickscale" }, - { 0x82CB, "getviewkickscale" }, - { 0x82CC, "getweaponslistall" }, - { 0x82CD, "getweaponslistprimaries" }, - { 0x82CE, "getnormalizedcameramovement" }, - { 0x82CF, "giveweapon" }, - { 0x82D0, "takeweapon" }, - { 0x82D1, "takeallweapons" }, - { 0x82D2, "getcurrentweapon" }, - { 0x82D3, "getcurrentprimaryweapon" }, - { 0x82D4, "getcurrentoffhand" }, - { 0x82D5, "hasweapon" }, - { 0x82D6, "switchtoweapon" }, - { 0x82D7, "switchtoweaponimmediate" }, - { 0x82D8, "switchtooffhand" }, - { 0x82D9, "setoffhandsecondaryclass" }, - { 0x82DA, "getoffhandsecondaryclass" }, - { 0x82DB, "beginlocationselection" }, - { 0x82DC, "endlocationselection" }, - { 0x82DD, "disableweapons" }, - { 0x82DE, "enableweapons" }, - { 0x82DF, "disableoffhandweapons" }, - { 0x82E0, "enableoffhandweapons" }, - { 0x82E1, "disableweaponswitch" }, - { 0x82E2, "enableweaponswitch" }, - { 0x82E3, "openpopupmenu" }, - { 0x82E4, "openpopupmenunomouse" }, - { 0x82E5, "closepopupmenu" }, - { 0x82E6, "openmenu" }, - { 0x82E7, "closemenu" }, -// { 0x82E8, "_meth_82E8" }, - { 0x82E9, "freezecontrols" }, - { 0x82EA, "disableusability" }, - { 0x82EB, "enableusability" }, - { 0x82EC, "setwhizbyspreads" }, - { 0x82ED, "setwhizbyradii" }, - { 0x82EE, "setreverb" }, - { 0x82EF, "deactivatereverb" }, - { 0x82F0, "setvolmod" }, - { 0x82F1, "setchannelvolume" }, - { 0x82F2, "givestartammo" }, - { 0x82F3, "givemaxammo" }, - { 0x82F4, "getfractionstartammo" }, - { 0x82F5, "getfractionmaxammo" }, - { 0x82F6, "isdualwielding" }, - { 0x82F7, "isreloading" }, - { 0x82F8, "isswitchingweapon" }, - { 0x82F9, "setorigin" }, - { 0x82FA, "getvelocity" }, - { 0x82FB, "setplayerangles" }, - { 0x82FC, "getplayerangles" }, - { 0x82FD, "usebuttonpressed" }, - { 0x82FE, "attackbuttonpressed" }, - { 0x82FF, "adsbuttonpressed" }, - { 0x8300, "meleebuttonpressed" }, - { 0x8301, "playerads" }, - { 0x8302, "isonground" }, - { 0x8303, "isusingturret" }, - { 0x8304, "setviewmodel" }, - { 0x8305, "setoffhandprimaryclass" }, - { 0x8306, "getoffhandprimaryclass" }, - { 0x8307, "startac130" }, - { 0x8308, "stopac130" }, - { 0x8309, "enablemousesteer" }, - { 0x830A, "setscriptmoverkillcam" }, - { 0x830B, "setmapnamestring" }, - { 0x830C, "setgametypestring" }, -}}; - -const std::array, 6306> token_list +extern std::array, token_count> const token_list {{ { 0x0000, "" }, { 0x0001, "pl#" }, @@ -35113,436 +33399,4 @@ const std::array, 6306> token_list { 0x826A, "maps/so_survival_mp_park_precache" }, }}; -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()); - function_map.reserve(function_list.size()); - function_map_rev.reserve(function_list.size()); - method_map.reserve(method_list.size()); - method_map_rev.reserve(method_list.size()); - token_map.reserve(token_list.size()); - token_map_rev.reserve(token_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 : function_list) - { - function_map.insert({ entry.first, entry.second }); - function_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : method_list) - { - method_map.insert({ entry.first, entry.second }); - method_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : token_list) - { - token_map.insert({ entry.first, entry.second }); - token_map_rev.insert({ utils::string::to_lower(entry.second), entry.first }); - } - } -}; - -__init__ _; - -} // namespace xsk::gsc::iw5 - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -/* unmaped files */ - -// "character/character_mp_ally_juggernaut" -// "xmodelalias\\alias_us_army_heads" -// "character\\mp_character_us_army_assault_a" -// "character\\mp_character_us_army_assault_b" -// "character\\mp_character_us_army_assault_c" -// "character\\mp_character_us_army_lmg" -// "character\\mp_character_us_army_lmg_b" -// "character\\mp_character_us_army_lmg_c" -// "character\\mp_character_us_army_shotgun" -// "character\\mp_character_us_army_shotgun_b" -// "character\\mp_character_us_army_shotgun_c" -// "xmodelalias\\alias_us_army_riot" -// "character\\mp_character_us_army_riot" -// "character\\mp_character_us_army_smg" -// "character\\mp_character_us_army_smg_b" -// "character\\mp_character_us_army_smg_c" -// "character\\mp_character_us_army_sniper" -// "xmodelalias\\alias_opforce_arctic_heads" -// "character\\mp_character_opforce_arctic_assault_a" -// "character\\mp_character_opforce_arctic_assault_b" -// "character\\mp_character_opforce_arctic_assault_c" -// "character\\mp_character_opforce_arctic_lmg" -// "character\\mp_character_opforce_arctic_lmg_b" -// "character\\mp_character_opforce_arctic_lmg_c" -// "character\\mp_character_opforce_arctic_shotgun" -// "character\\mp_character_opforce_arctic_shotgun_b" -// "character\\mp_character_opforce_arctic_shotgun_c" -// "character\\mp_character_opforce_arctic_smg" -// "character\\mp_character_opforce_arctic_smg_b" -// "character\\mp_character_opforce_arctic_smg_c" -// "character\\mp_character_op_arctic_sniper" -// "character\\mp_character_op_arctic_riot" -// "xmodelalias\\alias_seal_udt_heads" -// "character\\mp_character_seal_udt_assault_a" -// "character\\mp_character_seal_udt_lmg" -// "character\\mp_character_seal_udt_assault_b" -// "character\\mp_character_seal_udt_smg" -// "character\\mp_character_seal_udt_sniper" -// "character\\mp_character_udt_riot" -// "xmodelalias\\alias_opforce_arab_heads" -// "character\\mp_character_composite_assault_a" -// "character\\mp_character_composite_lmg" -// "character\\mp_character_composite_shotgun" -// "character\\mp_character_composite_smg" -// "character\\mp_character_op_arab_sniper" -// "character\\mp_character_op_arab_riot" -// "xmodelalias\\alias_airborne_heads" -// "character\\mp_character_airborne_assault_a" -// "character\\mp_character_airborne_assault_b" -// "character\\mp_character_airborne_assault_c" -// "character\\mp_character_airborne_lmg" -// "character\\mp_character_airborne_lmg_b" -// "character\\mp_character_airborne_lmg_c" -// "character\\mp_character_airborne_shotgun" -// "character\\mp_character_airborne_shotgun_b" -// "character\\mp_character_airborne_shotgun_c" -// "character\\mp_character_airborne_smg" -// "character\\mp_character_airborne_smg_b" -// "character\\mp_character_airborne_smg_c" -// "character\\mp_character_op_airborne_sniper" -// "character\\mp_character_op_airborne_riot" -// "xmodelalias\\alias_opforce_militia_heads_blk" -// "xmodelalias\\alias_opforce_militia_heads_wht" -// "character\\mp_character_militia_assault_aa_blk" -// "character\\mp_character_militia_assault_aa_wht" -// "character\\mp_character_militia_assault_ab_blk" -// "character\\mp_character_militia_assault_ac_blk" -// "character\\mp_character_militia_lmg_aa_blk" -// "character\\mp_character_militia_lmg_ab_blk" -// "character\\mp_character_militia_lmg_ac_blk" -// "character\\mp_character_militia_shotgun_aa_blk" -// "character\\mp_character_militia_shotgun_aa_wht" -// "character\\mp_character_militia_smg_aa_blk" -// "character\\mp_character_militia_smg_aa_wht" -// "character\\mp_character_militia_smg_ab_blk" -// "character\\mp_character_militia_smg_ac_blk" -// "character\\mp_character_op_militia_sniper" -// "character\\mp_character_op_militia_riot" -// "xmodelalias\\alias_tf141_heads_arctic" -// "character\\mp_character_tf_141_arctic_assault_a" -// "character\\mp_character_tf_141_arctic_assault_b" -// "character\\mp_character_tf_141_arctic_lmg" -// "character\\mp_character_tf_141_arctic_shotgun" -// "character\\mp_character_tf_141_arctic_smg" -// "character\\mp_character_tf141_arctic_sniper" -// "character\\mp_character_tf141_arctic_riot" -// "xmodelalias\\alias_tf141_heads_desert" -// "character\\mp_character_tf_141_desert_assault_a" -// "character\\mp_character_tf_141_desert_assault_b" -// "character\\mp_character_tf_141_desert_lmg" -// "character\\mp_character_tf_141_desert_shotgun" -// "character\\mp_character_tf_141_desert_smg" -// "character\\mp_character_tf141_desert_sniper" -// "character\\mp_character_tf141_desert_riot" -// "xmodelalias\\alias_tf141_heads_forest" -// "character\\mp_character_tf_141_forest_assault_a" -// "character\\mp_character_tf_141_forest_assault_b" -// "character\\mp_character_tf_141_forest_lmg" -// "character\\mp_character_tf_141_forest_shotgun" -// "character\\mp_character_tf_141_forest_smg" -// "character\\mp_character_tf141_forest_sniper" -// "character\\mp_character_tf141_forest_riot" -// "xmodelalias\\alias_delta_heads" -// "xmodelalias\\alias_delta_heads_longsleeves" -// "character\\mp_character_delta_urban_assault_a" -// "character\\mp_character_delta_urban_assault_b" -// "character\\mp_character_delta_urban_lmg_a" -// "character\\mp_character_delta_urban_lmg_b" -// "character\\mp_character_delta_urban_shotgun" -// "character\\mp_character_delta_urban_smg_a" -// "character\\mp_character_delta_urban_smg_b" -// "character\\mp_character_delta_urban_smg_c" -// "character\\mp_character_delta_urban_riot" -// "mptype\\mptype_us_army_assault" -// "mptype\\mptype_us_army_lmg" -// "mptype\\mptype_us_army_shotgun" -// "mptype\\mptype_us_army_riot" -// "mptype\\mptype_us_army_smg" -// "mptype\\mptype_us_army_sniper" -// "mptype\\mptype_opforce_arctic_assault" -// "mptype\\mptype_opforce_arctic_lmg" -// "mptype\\mptype_opforce_arctic_shotgun" -// "mptype\\mptype_opforce_arctic_smg" -// "mptype\\mptype_opforce_arctic_sniper" -// "mptype\\mptype_opforce_arctic_riot" -// "mptype\\mptype_seal_udt_assault" -// "mptype\\mptype_seal_udt_lmg" -// "mptype\\mptype_seal_udt_shotgun" -// "mptype\\mptype_seal_udt_smg" -// "mptype\\mptype_seal_udt_sniper" -// "mptype\\mptype_seal_udt_riot" -// "mptype\\mptype_opforce_comp_assault" -// "mptype\\mptype_opforce_comp_lmg" -// "mptype\\mptype_opforce_comp_shotgun" -// "mptype\\mptype_opforce_comp_smg" -// "mptype\\mptype_opforce_comp_sniper" -// "mptype\\mptype_opforce_comp_riot" -// "character\\mp_character_composite_sniper" -// "mptype\\mptype_opforce_airborne_assault" -// "mptype\\mptype_opforce_airborne_lmg" -// "mptype\\mptype_opforce_airborne_shotgun" -// "mptype\\mptype_opforce_airborne_smg" -// "mptype\\mptype_opforce_airborne_sniper" -// "mptype\\mptype_opforce_airborne_riot" -// "mptype\\mptype_opforce_militia_assault" -// "mptype\\mptype_opforce_militia_lmg" -// "mptype\\mptype_opforce_militia_shotgun" -// "mptype\\mptype_opforce_militia_smg" -// "mptype\\mptype_opforce_militia_sniper" -// "mptype\\mptype_opforce_militia_riot" -// "mptype\\mptype_tf141_arctic_assault" -// "mptype\\mptype_tf141_arctic_lmg" -// "mptype\\mptype_tf141_arctic_shotgun" -// "mptype\\mptype_tf141_arctic_smg" -// "mptype\\mptype_tf141_arctic_sniper" -// "mptype\\mptype_tf141_arctic_riot" -// "mptype\\mptype_tf141_desert_assault" -// "mptype\\mptype_tf141_desert_lmg" -// "mptype\\mptype_tf141_desert_shotgun" -// "mptype\\mptype_tf141_desert_smg" -// "mptype\\mptype_tf141_desert_sniper" -// "mptype\\mptype_tf141_desert_riot" -// "mptype\\mptype_tf141_forest_assault" -// "mptype\\mptype_tf141_forest_lmg" -// "mptype\\mptype_tf141_forest_shotgun" -// "mptype\\mptype_tf141_forest_smg" -// "mptype\\mptype_tf141_forest_sniper" -// "mptype\\mptype_tf141_forest_riot" -// "mptype\\mptype_delta_ucp_assault" -// "mptype\\mptype_delta_ucp_lmg" -// "mptype\\mptype_delta_ucp_shotgun" -// "mptype\\mptype_delta_ucp_smg" -// "mptype\\mptype_delta_ucp_sniper" -// "mptype\\mptype_delta_ucp_riot" -// "character\\mp_character_delta_urban_assault_c" -// "vehicle_scripts\\_empty" -// "maps\\_breach" -// "maps\\_briefing" -// "maps\\_cagedchickens" -// "maps\\_carry_ai" -// "maps\\_deadbody" -// "maps\\_drone_ai" -// "maps\\_drone_civilian" -// "maps\\_flare" -// "maps\\_flashbang" -// "maps\\_float" -// "maps\\_heli_ride" -// "maps\\_hiding_door_anims" -// "maps\\_hud_weapons" -// "maps\\_inventory" -// "maps\\_leak" -// "maps\\_menus" -// "maps\\_shellshock" -// "maps\\_mortar" -// "maps\\_overheat" -// "maps\\_props" -// "maps\\_radiation" -// "maps\\_sea" -// "maps\\_stealth_utility" -// "maps\\_stealth_shared_utilities" -// "maps\\_stealth_animation_funcs" -// "maps\\_stealth_threat_enemy" -// "maps\\_stealth_visibility_enemy" -// "maps\\_stealth_visibility_friendly" -// "maps\\_stealth_behavior_friendly" -// "maps\\_stealth_behavior_enemy" -// "maps\\_stealth_corpse_enemy" -// "maps\\_stealth_corpse_system" -// "maps\\_stealth_event_enemy" -// "maps\\_stealth_color_friendly" -// "maps\\_stealth_accuracy_friendly" -// "maps\\_stealth_smartstance_friendly" -// "maps\\_stealth_visibility_system" -// "maps\\_stealth_vehicle" -// "maps\\_treeburst" -// "maps\\_vehicle_missile" -// "maps\\_vehicle_spline" -// "maps\\_vehicledrive" -// "maps\\_weather" -// "maps\\_wood" -// "maps\\_audio_presets_music" -// "maps\\_shg_common" -// "xmodelalias\\alias_so_martyrdom_smg_bodies" -// "character\\character_so_martyrdom" -// "xmodelalias\\alias_africa_militia_heads_a" -// "xmodelalias\\alias_africa_militia_hats_a" -// "xmodelalias\\alias_africa_militia_hats_b" -// "xmodelalias\\alias_africa_militia_hats_c" -// "character\\character_africa_militia_smg_a" -// "character\\character_africa_militia_smg_b" -// "character\\character_africa_militia_smg_c" -// "xmodelalias\\alias_so_regular_smg_heads" -// "character\\character_so_regular_smg" -// "maps\\_rambo" -// "xmodelalias\\alias_so_veteran_ar_heads" -// "character\\character_so_veteran_ar" -// "character\\character_sp_juggernaut" -// "maps\\_juggernaut" -// "character\\character_so_juggernaut_mid" -// "maps\\_riotshield" -// "character\\character_so_juggernaut_explosive" -// "character\\character_so_juggernaut_headshot" -// "xmodelalias\\alias_chemwar_russian_heads_masked" -// "character\\character_chemwar_russian_assault_a" -// "character\\character_chemwar_russian_assault_m_b" -// "character\\character_chemwar_russian_assault_m_c" -// "character\\character_chemwar_russian_assault_m_d" -// "character\\character_chemwar_russian_assault_m_e" -// "character\\character_chemwar_russian_assault_aa" -// "character\\character_chemwar_russian_assault_m_bb" -// "character\\character_chemwar_russian_assault_m_cc" -// "character\\character_chemwar_russian_assault_m_dd" -// "character\\character_chemwar_russian_assault_m_ee" -// "xmodelalias\\alias_so_russian_naval_bodies" -// "xmodelalias\\alias_russian_naval_heads" -// "character\\character_so_russian_naval_assault" -// "xmodelalias\\alias_chemwar_russian_heads_so" -// "character\\character_chemwar_m_d_so" -// "character\\character_chemwar_m_dd_so" -// "xmodelalias\\alias_so_hardened_ar_heads" -// "character\\character_so_hardened_ar" -// "character\\character_gign_paris_smg" -// "character\\character_gign_paris_assault" -// "character\\character_delta_elite_assault_aa" -// "character\\character_delta_elite_assault_ab" -// "character\\character_delta_elite_assault_ba" -// "character\\character_delta_elite_assault_bb" -// "character\\character_sp_german_sheperd_dog" -// "maps\\_utility_joec" -// "maps\\_squad_enemies" -// "maps\\_sp_killstreaks" -// "maps\\_remotemissile_utility" -// "maps\\_remotemissile" -// "maps\\_sp_airdrop" -// "maps\\_so_survival_perks" -// "common_scripts\\_sentry" -// "maps\\_sp_airstrike" -// "maps\\_so_survival_code" -// "maps\\_chopperboss" -// "maps\\_so_survival_loot" -// "maps\\_so_survival_ai" -// "vehicle_scripts\\_mi17_noai" -// "vehicle_scripts\\_littlebird" -// "vehicle_scripts\\_ucav" -// "vehicle_scripts\\_mi17" -// "vehicle_scripts\\_blackhawk" -// "maps\\_air_support_strobe" -// "maps\\_so_survival" -// "maps\\_so_survival_armory" -// "maps\\_so_survival_challenge" -// "maps\\_so_survival_dialog" -// "vehicle_scripts\\_littlebird_player" -// "maps\\_shg_fx" -// "maps\\createart\\ny_manhattan_fog" -// "maps\\createart\\ny_manhattan_art" -// SCR_OPAQUE_FILE3_maps_cinematic_setups_nym_hind_finale = 0x295, -// SCR_OPAQUE_FILE3_maps_cinematic_setups_nym_sewer_exit = 0x296, -// "maps\\_c4" -// "xmodelalias\\alias_russian_military_manhattan_heads" -// "character\\character_opforce_manhattan_assault_a" -// "character\\character_russian_military_rpg_a" -// "character\\character_opforce_manhattan_shgn_a" -// "character\\character_opforce_manhattan_lmg_a" -// "xmodelalias\\alias_rangers_heads" -// "character\\character_rangers_bdu_assault_a" -// "xmodelalias\\alias_air_crew_heads" -// "character\\character_air_crew_manhattan" -// "character\\character_opforce_manhattan_rpg_a" -// "character\\character_delta_elite_smg_a" -// "character\\character_delta_elite_smg_b" -// "maps\\_minigun_viewmodel" -// "maps\\_minigun" -// "maps\\createfx\\ny_manhattan_fx" -// "vehicle_scripts\\_gaz_dshk" -// "vehicle_scripts\\_hind" -// "vehicle_scripts\\_ss_n_12" -// "maps\\animated_models\\fence_tarp_108x76_med_01" -// "maps\\animated_models\\fence_tarp_132x82_med_01" -// "maps\\_predator2" -// "maps\\_xm25" -// "vehicle_scripts\\_blackhawk_minigun" -// "vehicle_scripts\\_stryker50cal" -// "character\\character_opforce_rushwood_assault_a" -// "maps\\createart\\so_survival_mp_dome_art" -// "character\\character_so_juggernaut_lite" -// "xmodelalias\\alias_russian_naval_bodies" -// "vehicle_scripts\\_submarine_sdv" -// "vehicle_scripts\\_super_dvora" -// "vehicle_scripts\\_zodiac" -// "maps\\_ocean" -// "vehicle_scripts\\_zubr" -// "character\\character_sp_opforce_e" -// "character\\character_sp_opforce_f" -// "character\\character_sp_opforce_derik" -// "character\\character_opforce_rushwood_ass_dust_a" -// "character\\character_opforce_rushwood_smg_dust_a" -// "maps\\createart\\berlin_fog" -// "xmodelalias\\alias_russian_military_gasmask_heads" -// "character\\character_opforce_paris_gasmask" -// "maps\\createart\\so_jeep_paris_b_fog" -// "maps\\createart\\so_jeep_paris_b_art" -// "vehicle_scripts\\_mig29" -// "vehicle_scripts\\_t72" -// "vehicle_scripts\\_btr80" -// "maps\\createfx\\prague_fx" -// "maps\\_stealth_anims" -// "maps\\_idle_lean_smoke" -// "maps\\_idle_sleep" -// "maps\\_idle_smoke_balcony" -// "vehicle_scripts\\_technical_aa" -// "vehicle_scripts\\_technical_payback" -// "maps\\animated_models\\highrise_fencetarp_03" -// "maps\\createart\\so_littlebird_payback_fog" -// "vehicle_scripts\\_uk_delivery_truck" -// "vehicle_scripts\\_uk_utility_truck" -// "maps\\createart\\london_art" -// "maps\\_nightvision" -// "maps\\createart\\so_timetrial_london_art" -// "character\\character_fso_vest_nopacks_alt" -// "maps\\createart\\hijack_art" -// "character\\character_africa_militia_assault_a" -// "character\\character_africa_militia_assault_b" -// "character\\character_africa_militia_rpg_a" -// "maps\\_stinger" -// "vehicle_scripts\\_cobra" -// "character\\character_opforce_rescue_assault_b" -// "character\\character_hero_delta_sandman" -// "character\\character_delta_elite_snow_assault_aa" -// "vehicle_scripts\\_bm21" -// "xmodelalias\\alias_henchmen_heads" -// "maps\\_javelin" -// "common_scripts\\_destructible_types_anim_prop_radar_maz" -// "character\\character_hero_africa_price" -// "maps\\_slowmo_breach_payback" -// "maps\\_underwater_debris" -// "character\\character_hero_delta_sandman_udt" -// "vehicle_scripts\\_russian_torpedo" -// "maps\\_credits" -// "maps\\createart\\paris_a_art" -// +} // namespace xsk::gsc::iw5_pc diff --git a/src/iw5/iw5_ps.cpp b/src/iw5/iw5_ps.cpp new file mode 100644 index 00000000..9693e695 --- /dev/null +++ b/src/iw5/iw5_ps.cpp @@ -0,0 +1,52 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_ps.hpp" + +namespace xsk::gsc::iw5_ps +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::none, engine::iw5, endian::big, system::ps3, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::iw5_ps diff --git a/src/iw5/iw5_ps.hpp b/src/iw5/iw5_ps.hpp new file mode 100644 index 00000000..d18e8434 --- /dev/null +++ b/src/iw5/iw5_ps.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::iw5_ps +{ +// IW5 PS +constexpr usize code_count = 153; +constexpr usize func_count = 452; +constexpr usize meth_count = 777; +constexpr usize token_count = 14221; +constexpr u32 max_string_id = 33360; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::iw5_ps diff --git a/src/iw5/iw5_ps_code.cpp b/src/iw5/iw5_ps_code.cpp new file mode 100644 index 00000000..3276f10b --- /dev/null +++ b/src/iw5/iw5_ps_code.cpp @@ -0,0 +1,168 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_ps.hpp" + +namespace xsk::gsc::iw5_ps +{ + +extern std::array, code_count> const code_list +{{ + { 0x00, opcode::OP_End }, + { 0x01, opcode::OP_Return }, + { 0x02, opcode::OP_GetUndefined }, + { 0x03, opcode::OP_GetZero }, + { 0x04, opcode::OP_GetByte }, + { 0x05, opcode::OP_GetAnimTree }, + { 0x06, opcode::OP_GetNegByte }, + { 0x07, opcode::OP_GetUnsignedShort }, + { 0x08, opcode::OP_GetNegUnsignedShort }, + { 0x09, opcode::OP_GetInteger }, + { 0x0A, opcode::OP_GetBuiltinFunction }, + { 0x0B, opcode::OP_GetBuiltinMethod }, + { 0x0C, opcode::OP_GetFloat }, + { 0x0D, opcode::OP_GetString }, + { 0x0E, opcode::OP_GetIString }, + { 0x0F, opcode::OP_GetVector }, + { 0x10, opcode::OP_GetLevelObject }, + { 0x11, opcode::OP_GetAnimObject }, + { 0x12, opcode::OP_GetSelf }, + { 0x13, opcode::OP_GetThisthread }, + { 0x14, opcode::OP_GetLevel }, + { 0x15, opcode::OP_GetGame }, + { 0x16, opcode::OP_GetAnim }, + { 0x17, opcode::OP_GetAnimation }, + { 0x18, opcode::OP_GetGameRef }, + { 0x1A, opcode::OP_GetLocalFunction }, + { 0x19, opcode::OP_GetFarFunction }, + { 0x1B, opcode::OP_CreateLocalVariable }, + { 0x1C, opcode::OP_RemoveLocalVariables }, + { 0x1D, opcode::OP_EvalLocalVariableCached0 }, + { 0x1E, opcode::OP_EvalLocalVariableCached1 }, + { 0x1F, opcode::OP_EvalLocalVariableCached2 }, + { 0x20, opcode::OP_EvalLocalVariableCached3 }, + { 0x21, opcode::OP_EvalLocalVariableCached4 }, + { 0x22, opcode::OP_EvalLocalVariableCached5 }, + { 0x23, opcode::OP_EvalLocalVariableCached }, + { 0x24, opcode::OP_EvalLocalArrayCached }, + { 0x25, opcode::OP_EvalArray }, + { 0x26, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x27, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x28, opcode::OP_EvalLocalArrayRefCached }, + { 0x29, opcode::OP_EvalArrayRef }, + { 0x2A, opcode::OP_ClearArray }, + { 0x2B, opcode::OP_EmptyArray }, + { 0x2C, opcode::OP_AddArray }, + { 0x2D, opcode::OP_GetSelfObject }, + { 0x2E, opcode::OP_EvalLevelFieldVariable }, + { 0x2F, opcode::OP_EvalAnimFieldVariable }, + { 0x30, opcode::OP_EvalSelfFieldVariable }, + { 0x31, opcode::OP_EvalFieldVariable }, + { 0x32, opcode::OP_EvalLevelFieldVariableRef }, + { 0x33, opcode::OP_EvalAnimFieldVariableRef }, + { 0x34, opcode::OP_EvalSelfFieldVariableRef }, + { 0x35, opcode::OP_EvalFieldVariableRef }, + { 0x36, opcode::OP_ClearFieldVariable }, + { 0x37, opcode::OP_SafeCreateVariableFieldCached }, + { 0x38, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x39, opcode::OP_SafeSetVariableFieldCached }, + { 0x3A, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3B, opcode::OP_clearparams }, + { 0x3C, opcode::OP_checkclearparams }, + { 0x3D, opcode::OP_EvalLocalVariableRefCached0 }, + { 0x3E, opcode::OP_EvalNewLocalVariableRefCached0 }, + { 0x3F, opcode::OP_EvalLocalVariableRefCached }, + { 0x40, opcode::OP_SetLevelFieldVariableField }, + { 0x41, opcode::OP_SetVariableField }, + { 0x42, opcode::OP_ClearVariableField }, + { 0x43, opcode::OP_SetAnimFieldVariableField }, + { 0x44, opcode::OP_SetSelfFieldVariableField }, + { 0x45, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x46, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x47, opcode::OP_SetLocalVariableFieldCached }, + { 0x48, opcode::OP_ClearLocalVariableFieldCached }, + { 0x49, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x4A, opcode::OP_CallBuiltin0 }, + { 0x4B, opcode::OP_CallBuiltin1 }, + { 0x4C, opcode::OP_CallBuiltin2 }, + { 0x4D, opcode::OP_CallBuiltin3 }, + { 0x4E, opcode::OP_CallBuiltin4 }, + { 0x4F, opcode::OP_CallBuiltin5 }, + { 0x50, opcode::OP_CallBuiltin }, + { 0x51, opcode::OP_CallBuiltinMethod0 }, + { 0x52, opcode::OP_CallBuiltinMethod1 }, + { 0x53, opcode::OP_CallBuiltinMethod2 }, + { 0x54, opcode::OP_CallBuiltinMethod3 }, + { 0x55, opcode::OP_CallBuiltinMethod4 }, + { 0x56, opcode::OP_CallBuiltinMethod5 }, + { 0x57, opcode::OP_CallBuiltinMethod }, + { 0x58, opcode::OP_wait }, + { 0x59, opcode::OP_waittillFrameEnd }, + { 0x5A, opcode::OP_PreScriptCall }, + { 0x5B, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x5C, opcode::OP_ScriptLocalFunctionCall }, + { 0x5D, opcode::OP_ScriptLocalMethodCall }, + { 0x5E, opcode::OP_ScriptLocalThreadCall }, + { 0x5F, opcode::OP_ScriptLocalChildThreadCall }, + { 0x60, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x61, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x62, opcode::OP_ScriptFarFunctionCall2 }, + { 0x63, opcode::OP_ScriptFarFunctionCall }, + { 0x64, opcode::OP_ScriptFarMethodCall }, + { 0x65, opcode::OP_ScriptFarThreadCall }, + { 0x66, opcode::OP_ScriptFarChildThreadCall }, + { 0x67, opcode::OP_ScriptFarMethodThreadCall }, + { 0x68, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x69, opcode::OP_ScriptFunctionCallPointer }, + { 0x6A, opcode::OP_ScriptMethodCallPointer }, + { 0x6B, opcode::OP_ScriptThreadCallPointer }, + { 0x6C, opcode::OP_ScriptChildThreadCallPointer }, + { 0x6D, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x6E, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x6F, opcode::OP_CallBuiltinPointer }, + { 0x70, opcode::OP_CallBuiltinMethodPointer }, + { 0x71, opcode::OP_DecTop }, + { 0x72, opcode::OP_CastFieldObject }, + { 0x73, opcode::OP_EvalLocalVariableObjectCached }, + { 0x74, opcode::OP_CastBool }, + { 0x75, opcode::OP_BoolNot }, + { 0x76, opcode::OP_BoolComplement }, + { 0x77, opcode::OP_JumpOnFalse }, + { 0x78, opcode::OP_JumpOnTrue }, + { 0x79, opcode::OP_JumpOnFalseExpr }, + { 0x7A, opcode::OP_JumpOnTrueExpr }, + { 0x7B, opcode::OP_jump }, + { 0x7C, opcode::OP_jumpback }, + { 0x7D, opcode::OP_inc }, + { 0x7E, opcode::OP_dec }, + { 0x7F, opcode::OP_bit_or }, + { 0x80, opcode::OP_bit_ex_or }, + { 0x81, opcode::OP_bit_and }, + { 0x82, opcode::OP_equality }, + { 0x83, opcode::OP_inequality }, + { 0x84, opcode::OP_less }, + { 0x85, opcode::OP_greater }, + { 0x86, opcode::OP_less_equal }, + { 0x87, opcode::OP_greater_equal }, + { 0x88, opcode::OP_shift_left }, + { 0x89, opcode::OP_shift_right }, + { 0x8A, opcode::OP_plus }, + { 0x8B, opcode::OP_minus }, + { 0x8C, opcode::OP_multiply }, + { 0x8D, opcode::OP_divide }, + { 0x8E, opcode::OP_mod }, + { 0x8F, opcode::OP_size }, + { 0x90, opcode::OP_waittillmatch }, + { 0x91, opcode::OP_waittillmatch2 }, + { 0x92, opcode::OP_waittill }, + { 0x93, opcode::OP_notify }, + { 0x94, opcode::OP_endon }, + { 0x95, opcode::OP_voidCodepos }, + { 0x96, opcode::OP_switch }, + { 0x97, opcode::OP_endswitch }, + { 0x98, opcode::OP_vector }, +}}; + +} // namespace xsk::gsc::iw5_ps diff --git a/src/iw5/iw5_ps_func.cpp b/src/iw5/iw5_ps_func.cpp new file mode 100644 index 00000000..9010def7 --- /dev/null +++ b/src/iw5/iw5_ps_func.cpp @@ -0,0 +1,467 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_ps.hpp" + +namespace xsk::gsc::iw5_ps +{ + +extern std::array, func_count> const func_list +{{ + { 0x001, "createprintchannel" }, + { 0x002, "setprintchannel" }, + { 0x003, "print" }, + { 0x004, "println" }, + { 0x005, "print3d" }, + { 0x006, "line" }, + { 0x007, "precacheturret" }, + { 0x008, "getweaponarray" }, + { 0x009, "spawnturret" }, + { 0x00A, "canspawnturret" }, + { 0x00B, "assert" }, + { 0x00C, "assertex" }, + { 0x00D, "assertmsg" }, + { 0x00E, "isdefined" }, + { 0x00F, "isstring" }, + { 0x010, "setdvar" }, + { 0x011, "setdynamicdvar" }, + { 0x012, "setdvarifuninitialized" }, + { 0x013, "setdevdvar" }, + { 0x014, "setdevdvarifuninitialized" }, + { 0x015, "getdvar" }, + { 0x016, "getdvarint" }, + { 0x017, "getdvarfloat" }, + { 0x018, "getdvarvector" }, + { 0x019, "gettime" }, + { 0x01A, "getentbynum" }, + { 0x01B, "getweaponmodel" }, + { 0x01C, "getweaponhidetags" }, + { 0x01D, "getanimlength" }, + { 0x01E, "animhasnotetrack" }, + { 0x01F, "getnotetracktimes" }, + { 0x020, "spawn" }, + { 0x021, "spawnloopsound" }, + { 0x022, "spawnloopingsound" }, + { 0x023, "bullettrace" }, + { 0x024, "bullettracepassed" }, + { 0x025, "sighttracepassed" }, + { 0x026, "physicstrace" }, + { 0x027, "playerphysicstrace" }, + { 0x028, "getgroundposition" }, + { 0x029, "getmovedelta" }, + { 0x02A, "getangledelta" }, + { 0x02B, "getnorthyaw" }, + { 0x02C, "setnorthyaw" }, + { 0x02D, "setslowmotion" }, + { 0x02E, "randomint" }, + { 0x02F, "randomfloat" }, + { 0x030, "randomintrange" }, + { 0x031, "randomfloatrange" }, + { 0x032, "sin" }, + { 0x033, "cos" }, + { 0x034, "tan" }, + { 0x035, "asin" }, + { 0x036, "acos" }, + { 0x037, "atan" }, + { 0x038, "int" }, + { 0x039, "float" }, + { 0x03A, "abs" }, + { 0x03B, "min" }, + { 0x03C, "max" }, + { 0x03D, "floor" }, + { 0x03E, "ceil" }, + { 0x03F, "exp" }, + { 0x040, "log" }, + { 0x041, "sqrt" }, + { 0x042, "squared" }, + { 0x043, "clamp" }, + { 0x044, "angleclamp" }, + { 0x045, "angleclamp180" }, + { 0x046, "vectorfromlinetopoint" }, + { 0x047, "pointonsegmentnearesttopoint" }, + { 0x048, "distance" }, + { 0x049, "distance2d" }, + { 0x04A, "distancesquared" }, + { 0x04B, "length" }, + { 0x04C, "lengthsquared" }, + { 0x04D, "closer" }, + { 0x04E, "vectordot" }, + { 0x04F, "vectornormalize" }, + { 0x050, "vectortoangles" }, + { 0x051, "vectortoyaw" }, + { 0x052, "vectorlerp" }, + { 0x053, "anglestoup" }, + { 0x054, "anglestoright" }, + { 0x055, "anglestoforward" }, + { 0x056, "combineangles" }, + { 0x057, "transformmove" }, + { 0x058, "issubstr" }, + { 0x059, "isendstr" }, + { 0x05A, "getsubstr" }, + { 0x05B, "tolower" }, + { 0x05C, "strtok" }, + { 0x05D, "stricmp" }, + { 0x05E, "ambientplay" }, + { 0x05F, "ambientstop" }, + { 0x060, "precachemodel" }, + { 0x061, "precacheshellshock" }, + { 0x062, "precacheitem" }, + { 0x063, "precacheshader" }, + { 0x064, "precachestring" }, + { 0x065, "precachemenu" }, + { 0x066, "precacherumble" }, + { 0x067, "precachelocationselector" }, + { 0x068, "precacheleaderboards" }, + { 0x069, "loadfx" }, + { 0x06A, "playfx" }, + { 0x06B, "playfxontag" }, + { 0x06C, "stopfxontag" }, + { 0x06D, "playloopedfx" }, + { 0x06E, "spawnfx" }, + { 0x06F, "triggerfx" }, + { 0x070, "playfxontagforclients" }, + { 0x071, "physicsexplosionsphere" }, + { 0x072, "physicsexplosioncylinder" }, + { 0x073, "physicsjolt" }, + { 0x074, "physicsjitter" }, + { 0x075, "setexpfog" }, + { 0x076, "isexplosivedamagemod" }, + { 0x077, "radiusdamage" }, + { 0x078, "setplayerignoreradiusdamage" }, + { 0x079, "glassradiusdamage" }, + { 0x07A, "earthquake" }, + { 0x07B, "getnumparts" }, + { 0x07C, "getpartname" }, + { 0x07D, "weaponfiretime" }, + { 0x07E, "weaponclipsize" }, + { 0x07F, "weaponisauto" }, + { 0x080, "weaponissemiauto" }, + { 0x081, "weaponisboltaction" }, + { 0x082, "weaponinheritsperks" }, + { 0x083, "weaponburstcount" }, + { 0x084, "weapontype" }, + { 0x085, "weaponclass" }, + { 0x086, "weaponinventorytype" }, + { 0x087, "weaponstartammo" }, + { 0x088, "weaponmaxammo" }, + { 0x089, "weaponaltweaponname" }, + { 0x08A, "isweaponcliponly" }, + { 0x08B, "isweapondetonationtimed" }, + { 0x08C, "weaponhasthermalscope" }, + { 0x08D, "getvehiclenode" }, + { 0x08E, "getvehiclenodearray" }, + { 0x08F, "getallvehiclenodes" }, + { 0x090, "getnumvehicles" }, + { 0x091, "precachevehicle" }, + { 0x092, "spawnvehicle" }, + { 0x093, "vehicle_getarray" }, + { 0x094, "vehicle_getspawnerarray" }, + { 0x095, "playrumbleonposition" }, + { 0x096, "playrumblelooponposition" }, + { 0x097, "stopallrumbles" }, + { 0x098, "soundexists" }, + { 0x099, "openfile" }, + { 0x09A, "closefile" }, + { 0x09B, "fprintln" }, + { 0x09C, "fprintfields" }, + { 0x09D, "freadln" }, + { 0x09E, "fgetarg" }, + { 0x09F, "setminimap" }, + { 0x0A0, "setthermalbodymaterial" }, + { 0x0A1, "getarraykeys" }, + { 0x0A2, "getfirstarraykey" }, + { 0x0A3, "getnextarraykey" }, + { 0x0A4, "sortbydistance" }, + { 0x0A5, "tablelookup" }, + { 0x0A6, "tablelookupbyrow" }, + { 0x0A7, "tablelookupistring" }, + { 0x0A8, "tablelookupistringbyrow" }, + { 0x0A9, "tablelookuprownum" }, + { 0x0AA, "getmissileowner" }, + { 0x0AB, "magicbullet" }, + { 0x0AC, "getweaponflashtagname" }, + { 0x0AD, "averagepoint" }, + { 0x0AE, "averagenormal" }, + { 0x0AF, "getglass" }, + { 0x0B0, "getglassarray" }, + { 0x0B1, "getglassorigin" }, + { 0x0B2, "isglassdestroyed" }, + { 0x0B3, "destroyglass" }, + { 0x0B4, "deleteglass" }, + { 0x0B5, "getentchannelscount" }, + { 0x0B6, "getentchannelname" }, + { 0x0B7, "objective_add" }, + { 0x0B8, "objective_delete" }, + { 0x0B9, "objective_state" }, + { 0x0BA, "objective_icon" }, + { 0x0BB, "objective_position" }, + { 0x0BC, "objective_current" }, + { 0x0BD, "objective_onentity" }, + { 0x0BE, "objective_team" }, + { 0x0BF, "objective_player" }, + { 0x0C0, "objective_playerteam" }, + { 0x0C1, "objective_playerenemyteam" }, + { 0x0C2, "iprintln" }, + { 0x0C3, "iprintlnbold" }, + { 0x0C4, "logstring" }, + { 0x0C5, "getent" }, + { 0x0C6, "getentarray" }, + { 0x0C7, "spawnplane" }, + { 0x0C8, "spawnstruct" }, + { 0x0C9, "spawnhelicopter" }, + { 0x0CA, "isalive" }, + { 0x0CB, "isspawner" }, + { 0x0CC, "missile_createattractorent" }, + { 0x0CD, "missile_createattractororigin" }, + { 0x0CE, "missile_createrepulsorent" }, + { 0x0CF, "missile_createrepulsororigin" }, + { 0x0D0, "missile_deleteattractor" }, + { 0x0D1, "playsoundatpos" }, + { 0x0D2, "newhudelem" }, + { 0x0D3, "newclienthudelem" }, + { 0x0D4, "newteamhudelem" }, + { 0x0D5, "resettimeout" }, + { 0x0D6, "precachefxteamthermal" }, + { 0x0D7, "isplayer" }, + { 0x0D8, "isplayernumber" }, + { 0x0D9, "setwinningplayer" }, + { 0x0DA, "setwinningteam" }, + { 0x0DB, "announcement" }, + { 0x0DC, "clientannouncement" }, + { 0x0DD, "getteamscore" }, + { 0x0DE, "setteamscore" }, + { 0x0DF, "setclientnamemode" }, + { 0x0E0, "updateclientnames" }, + { 0x0E1, "getteamplayersalive" }, + { 0x0E2, "logprint" }, + { 0x0E3, "worldentnumber" }, + { 0x0E4, "obituary" }, + { 0x0E5, "positionwouldtelefrag" }, + { 0x0E6, "canspawn" }, + { 0x0E7, "getstarttime" }, + { 0x0E8, "precachestatusicon" }, + { 0x0E9, "precacheheadicon" }, + { 0x0EA, "precacheminimapicon" }, + { 0x0EB, "precachempanim" }, + { 0x0EC, "map_restart" }, + { 0x0ED, "exitlevel" }, + { 0x0EE, "addtestclient" }, + { 0x0EF, "makedvarserverinfo" }, + { 0x0F0, "setarchive" }, + { 0x0F1, "allclientsprint" }, + { 0x0F2, "clientprint" }, + { 0x0F3, "mapexists" }, + { 0x0F4, "isvalidgametype" }, + { 0x0F5, "matchend" }, + { 0x0F6, "setplayerteamrank" }, + { 0x0F7, "endparty" }, + { 0x0F8, "setteamradar" }, + { 0x0F9, "getteamradar" }, + { 0x0FA, "setteamradarstrength" }, + { 0x0FB, "getteamradarstrength" }, + { 0x0FC, "getuavstrengthmin" }, + { 0x0FD, "getuavstrengthmax" }, + { 0x0FE, "getuavstrengthlevelneutral" }, + { 0x0FF, "getuavstrengthlevelshowenemyfastsweep" }, + { 0x100, "getuavstrengthlevelshowenemydirectional" }, + { 0x101, "blockteamradar" }, + { 0x102, "unblockteamradar" }, + { 0x103, "isteamradarblocked" }, + { 0x104, "getassignedteam" }, + { 0x105, "setmatchdata" }, + { 0x106, "getmatchdata" }, + { 0x107, "sendmatchdata" }, + { 0x108, "clearmatchdata" }, + { 0x109, "setmatchdatadef" }, + { 0x10A, "setmatchclientip" }, + { 0x10B, "setmatchdataid" }, + { 0x10C, "setclientmatchdata" }, + { 0x10D, "getclientmatchdata" }, + { 0x10E, "setclientmatchdatadef" }, + { 0x10F, "sendclientmatchdata" }, + { 0x110, "getbuildversion" }, + { 0x111, "getbuildnumber" }, + { 0x112, "getsystemtime" }, + { 0x113, "getmatchrulesdata" }, + { 0x114, "isusingmatchrulesdata" }, + { 0x115, "kick" }, + { 0x116, "issplitscreen" }, + { 0x117, "setmapcenter" }, + { 0x118, "setgameendtime" }, + { 0x119, "visionsetnaked" }, + { 0x11A, "visionsetnight" }, + { 0x11B, "visionsetmissilecam" }, + { 0x11C, "visionsetthermal" }, + { 0x11D, "visionsetpain" }, + { 0x11E, "endlobby" }, + { 0x11F, "setac130ambience" }, + { 0x120, "getmapcustom" }, + { 0x121, "updateskill" }, + { 0x122, "spawnsighttrace" }, + { 0x123, "incrementcounter" }, + { 0x124, "getcountertotal" }, + { 0x125, "getlevelticks" }, + { 0x126, "perlinnoise2d" }, + { 0x127, "calcrockingangles" }, + { 0x128, "sethudlighting" }, + { 0x129, "reconevent" }, + { 0x12A, "reconspatialevent" }, + { 0x12B, "setsunflareposition" }, + { 0x12C, "createthreatbiasgroup" }, + { 0x12D, "threatbiasgroupexists" }, + { 0x12E, "getthreatbias" }, + { 0x12F, "setthreatbias" }, + { 0x130, "setthreatbiasagainstall" }, + { 0x131, "setignoremegroup" }, + { 0x132, "isenemyteam" }, + { 0x133, "objective_additionalentity" }, + { 0x134, "objective_state_nomessage" }, + { 0x135, "objective_string" }, + { 0x136, "objective_string_nomessage" }, + { 0x137, "objective_additionalposition" }, + { 0x138, "objective_current_nomessage" }, + { 0x139, "objective_additionalcurrent" }, + { 0x13A, "objective_ring" }, + { 0x13B, "objective_setpointertextoverride" }, + { 0x13C, "getnode" }, + { 0x13D, "getnodearray" }, + { 0x13E, "getallnodes" }, + { 0x13F, "getnodesinradius" }, + { 0x140, "getnodesinradiussorted" }, + { 0x141, "getclosestnodeinsight" }, + { 0x142, "getreflectionlocs" }, + { 0x143, "getreflectionreferencelocs" }, + { 0x144, "getvehicletracksegment" }, + { 0x145, "getvehicletracksegmentarray" }, + { 0x146, "getallvehicletracksegments" }, + { 0x147, "isarray" }, + { 0x148, "isai" }, + { 0x149, "issentient" }, + { 0x14A, "isgodmode" }, + { 0x14B, "getdebugdvar" }, + { 0x14C, "getdebugdvarint" }, + { 0x14D, "getdebugdvarfloat" }, + { 0x14E, "setsaveddvar" }, + { 0x14F, "getfreeaicount" }, + { 0x150, "getaicount" }, + { 0x151, "getaiarray" }, + { 0x152, "getaispeciesarray" }, + { 0x153, "getspawnerarray" }, + { 0x154, "getcorpsearray" }, + { 0x155, "getspawnerteamarray" }, + { 0x156, "getweaponclipmodel" }, + { 0x157, "getbrushmodelcenter" }, + { 0x158, "getkeybinding" }, + { 0x159, "getcommandfromkey" }, + { 0x15A, "getsticksconfig" }, + { 0x15B, "weaponfightdist" }, + { 0x15C, "weaponmaxdist" }, + { 0x15D, "isturretactive" }, + { 0x15E, "target_alloc" }, + { 0x15F, "target_flush" }, + { 0x160, "target_set" }, + { 0x161, "target_remove" }, + { 0x162, "target_setshader" }, + { 0x163, "target_setoffscreenshader" }, + { 0x164, "target_isinrect" }, + { 0x165, "target_isincircle" }, + { 0x166, "target_startreticlelockon" }, + { 0x167, "target_clearreticlelockon" }, + { 0x168, "target_getarray" }, + { 0x169, "target_istarget" }, + { 0x16A, "target_setattackmode" }, + { 0x16B, "target_setjavelinonly" }, + { 0x16C, "target_hidefromplayer" }, + { 0x16D, "target_showtoplayer" }, + { 0x16E, "target_setscaledrendermode" }, + { 0x16F, "target_drawcornersonly" }, + { 0x170, "target_drawsquare" }, + { 0x171, "target_drawsingle" }, + { 0x172, "target_setminsize" }, + { 0x173, "target_setmaxsize" }, + { 0x174, "target_setcolor" }, + { 0x175, "target_setdelay" }, + { 0x176, "getstartorigin" }, + { 0x177, "getstartangles" }, + { 0x178, "getcycleoriginoffset" }, + { 0x179, "magicgrenade" }, + { 0x17A, "magicgrenademanual" }, + { 0x17B, "setblur" }, + { 0x17C, "musicplay" }, + { 0x17D, "musicstop" }, + { 0x17E, "soundfade" }, + { 0x17F, "soundsettimescalefactor" }, + { 0x180, "soundresettimescale" }, + { 0x181, "setocclusionpreset" }, + { 0x182, "levelsoundfade" }, + { 0x183, "precachenightvisioncodeassets" }, + { 0x184, "precachedigitaldistortcodeassets" }, + { 0x185, "precacheminimapsentrycodeassets" }, + { 0x186, "savegame" }, + { 0x187, "issavesuccessful" }, + { 0x188, "issaverecentlyloaded" }, + { 0x189, "savegamenocommit" }, + { 0x18A, "commitsave" }, + { 0x18B, "commitwouldbevalid" }, + { 0x18C, "getfxvisibility" }, + { 0x18D, "setculldist" }, + { 0x18E, "getculldist" }, + { 0x18F, "sethalfresparticles" }, + { 0x190, "getmapsunlight" }, + { 0x191, "setsunlight" }, + { 0x192, "resetsunlight" }, + { 0x193, "getmapsundirection" }, + { 0x194, "getmapsunangles" }, + { 0x195, "setsundirection" }, + { 0x196, "lerpsundirection" }, + { 0x197, "lerpsunangles" }, + { 0x198, "resetsundirection" }, + { 0x199, "enableforcedsunshadows" }, + { 0x19A, "enableforcednosunshadows" }, + { 0x19B, "disableforcedsunshadows" }, + { 0x19C, "enableouterspacemodellighting" }, + { 0x19D, "disableouterspacemodellighting" }, + { 0x19E, "remapstage" }, + { 0x19F, "changelevel" }, + { 0x1A0, "missionsuccess" }, + { 0x1A1, "missionfailed" }, + { 0x1A2, "cinematic" }, + { 0x1A3, "cinematicingame" }, + { 0x1A4, "cinematicingamesync" }, + { 0x1A5, "cinematicingameloop" }, + { 0x1A6, "cinematicingameloopresident" }, + { 0x1A7, "iscinematicplaying" }, + { 0x1A8, "stopcinematicingame" }, + { 0x1A9, "pausecinematicingame" }, + { 0x1AA, "drawcompassfriendlies" }, + { 0x1AB, "bulletspread" }, + { 0x1AC, "bullettracer" }, + { 0x1AD, "badplace_delete" }, + { 0x1AE, "badplace_cylinder" }, + { 0x1AF, "badplace_arc" }, + { 0x1B0, "badplace_brush" }, + { 0x1B1, "clearallcorpses" }, + { 0x1B2, "setturretnode" }, + { 0x1B3, "unsetturretnode" }, + { 0x1B4, "setnodepriority" }, + { 0x1B5, "isnodeoccupied" }, + { 0x1B6, "setdebugorigin" }, + { 0x1B7, "setdebugangles" }, + { 0x1B8, "updategamerprofile" }, + { 0x1B9, "updategamerprofileall" }, + { 0x1BA, "clearlocalizedstrings" }, + { 0x1BB, "setphysicsgravitydir" }, + { 0x1BC, "gettimescale" }, + { 0x1BD, "settimescale" }, + { 0x1BE, "setslowmotionview" }, + { 0x1BF, "forcesharedammo" }, + { 0x1C0, "refreshhudcompass" }, + { 0x1C1, "refreshhudammocounter" }, + { 0x1C2, "notifyoncommand" }, + { 0x1C3, "gettimesincelastpaused" }, + { 0x1C4, "setlasermaterial" }, +}}; + +} // namespace xsk::gsc::iw5_ps diff --git a/src/iw5/iw5_ps_meth.cpp b/src/iw5/iw5_ps_meth.cpp new file mode 100644 index 00000000..21a22e37 --- /dev/null +++ b/src/iw5/iw5_ps_meth.cpp @@ -0,0 +1,798 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_ps.hpp" + +namespace xsk::gsc::iw5_ps +{ + +extern std::array, meth_count> const meth_list +{{ + { 0x8000, "attach" }, + { 0x8001, "attachshieldmodel" }, + { 0x8002, "detach" }, + { 0x8003, "detachshieldmodel" }, + { 0x8004, "moveshieldmodel" }, + { 0x8005, "detachall" }, + { 0x8006, "getattachsize" }, + { 0x8007, "getattachmodelname" }, + { 0x8008, "getattachtagname" }, + { 0x8009, "getattachignorecollision" }, + { 0x800A, "hidepart" }, + { 0x800B, "hidepart_allinstances" }, + { 0x800C, "hideallparts" }, + { 0x800D, "showpart" }, + { 0x800E, "showallparts" }, + { 0x800F, "linkto" }, + { 0x8010, "linktoblendtotag" }, + { 0x8011, "unlink" }, + { 0x8012, "islinked" }, + { 0x8013, "enablelinkto" }, + { 0x8014, "playerlinkto" }, + { 0x8015, "playerlinktodelta" }, + { 0x8016, "playerlinkweaponviewtodelta" }, + { 0x8017, "playerlinktoabsolute" }, + { 0x8018, "playerlinktoblend" }, + { 0x8019, "playerlinkedoffsetenable" }, + { 0x801A, "playerlinkedoffsetdisable" }, + { 0x801B, "playerlinkedsetviewznear" }, + { 0x801C, "playerlinkedsetusebaseangleforviewclamp" }, + { 0x801D, "lerpviewangleclamp" }, + { 0x801E, "setviewangleresistance" }, + { 0x801F, "geteye" }, + { 0x8020, "istouching" }, + { 0x8021, "stoploopsound" }, + { 0x8022, "stopsounds" }, + { 0x8023, "playrumbleonentity" }, + { 0x8024, "playrumblelooponentity" }, + { 0x8025, "stoprumble" }, + { 0x8026, "delete" }, + { 0x8027, "setmodel" }, + { 0x8028, "laseron" }, + { 0x8029, "laseroff" }, + { 0x802A, "laseraltviewon" }, + { 0x802B, "laseraltviewoff" }, + { 0x802C, "thermalvisionon" }, + { 0x802D, "thermalvisionoff" }, + { 0x802E, "thermalvisionfofoverlayon" }, + { 0x802F, "thermalvisionfofoverlayoff" }, + { 0x8030, "autospotoverlayon" }, + { 0x8031, "autospotoverlayoff" }, + { 0x8032, "setcontents" }, + { 0x8033, "makeusable" }, + { 0x8034, "makeunusable" }, + { 0x8035, "setcursorhint" }, + { 0x8036, "sethintstring" }, + { 0x8037, "forceusehinton" }, + { 0x8038, "forceusehintoff" }, + { 0x8039, "makesoft" }, + { 0x803A, "makehard" }, + { 0x803B, "willneverchange" }, + { 0x803C, "startfiring" }, + { 0x803D, "stopfiring" }, + { 0x803E, "isfiringturret" }, + { 0x803F, "startbarrelspin" }, + { 0x8040, "stopbarrelspin" }, + { 0x8041, "getbarrelspinrate" }, + { 0x8042, "remotecontrolturret" }, + { 0x8043, "remotecontrolturretoff" }, + { 0x8044, "shootturret" }, + { 0x8045, "getturretowner" }, + { 0x8046, "setsentryowner" }, + { 0x8047, "setsentrycarrier" }, + { 0x8048, "setturretminimapvisible" }, + { 0x8049, "settargetentity" }, + { 0x804A, "snaptotargetentity" }, + { 0x804B, "cleartargetentity" }, + { 0x804C, "getturrettarget" }, + { 0x804D, "setplayerspread" }, + { 0x804E, "setaispread" }, + { 0x804F, "setsuppressiontime" }, + { 0x8050, "setconvergencetime" }, + { 0x8051, "setconvergenceheightpercent" }, + { 0x8052, "setturretteam" }, + { 0x8053, "maketurretsolid" }, + { 0x8054, "maketurretoperable" }, + { 0x8055, "maketurretinoperable" }, + { 0x8056, "setturretaccuracy" }, + { 0x8057, "setrightarc" }, + { 0x8058, "setleftarc" }, + { 0x8059, "settoparc" }, + { 0x805A, "setbottomarc" }, + { 0x805B, "setautorotationdelay" }, + { 0x805C, "setdefaultdroppitch" }, + { 0x805D, "restoredefaultdroppitch" }, + { 0x805E, "turretfiredisable" }, + { 0x805F, "turretfireenable" }, + { 0x8060, "setturretmodechangewait" }, + { 0x8061, "usetriggerrequirelookat" }, + { 0x8062, "getstance" }, + { 0x8063, "setstance" }, + { 0x8064, "itemweaponsetammo" }, + { 0x8065, "getammocount" }, + { 0x8066, "gettagorigin" }, + { 0x8067, "gettagangles" }, + { 0x8068, "shellshock" }, + { 0x8069, "stunplayer" }, + { 0x806A, "stopshellshock" }, + { 0x806B, "fadeoutshellshock" }, + { 0x806C, "setdepthoffield" }, + { 0x806D, "setviewmodeldepthoffield" }, + { 0x806E, "setmotionblurmovescale" }, + { 0x806F, "setmotionblurturnscale" }, + { 0x8070, "setmotionblurzoomscale" }, + { 0x8071, "viewkick" }, + { 0x8072, "localtoworldcoords" }, + { 0x8073, "getentitynumber" }, + { 0x8074, "getentityvelocity" }, + { 0x8075, "enablegrenadetouchdamage" }, + { 0x8076, "disablegrenadetouchdamage" }, + { 0x8077, "enableaimassist" }, + { 0x8078, "disableaimassist" }, + { 0x8079, "radiusdamage" }, + { 0x807A, "detonate" }, + { 0x807B, "damageconetrace" }, + { 0x807C, "sightconetrace" }, + { 0x807D, "missile_settargetent" }, + { 0x807E, "missile_settargetpos" }, + { 0x807F, "missile_cleartarget" }, + { 0x8080, "missile_setflightmodedirect" }, + { 0x8081, "missile_setflightmodetop" }, + { 0x8082, "getlightintensity" }, + { 0x8083, "setlightintensity" }, + { 0x8084, "isragdoll" }, + { 0x8085, "setmovespeedscale" }, + { 0x8086, "cameralinkto" }, + { 0x8087, "cameraunlink" }, + { 0x8088, "controlslinkto" }, + { 0x8089, "controlsunlink" }, + { 0x808A, "makevehiclesolidcapsule" }, + { 0x808B, "makevehiclesolidsphere" }, + { 0x808C, "makevehiclesolid" }, + { 0x808D, "remotecontrolvehicle" }, + { 0x808E, "remotecontrolvehicleoff" }, + { 0x808F, "isfiringvehicleturret" }, + { 0x8090, "drivevehicleandcontrolturret" }, + { 0x8091, "drivevehicleandcontrolturretoff" }, + { 0x8092, "getplayersetting" }, + { 0x8093, "getlocalplayerprofiledata" }, + { 0x8094, "setlocalplayerprofiledata" }, + { 0x8095, "remotecamerasoundscapeon" }, + { 0x8096, "remotecamerasoundscapeoff" }, + { 0x8097, "radarjamon" }, + { 0x8098, "radarjamoff" }, + { 0x8099, "setmotiontrackervisible" }, + { 0x809A, "getmotiontrackervisible" }, + { 0x809B, "worldpointinreticle_circle" }, + { 0x809C, "getpointinbounds" }, + { 0x809D, "transfermarkstonewscriptmodel" }, + { 0x809E, "setwatersheeting" }, + { 0x809F, "setweaponhudiconoverride" }, + { 0x80A0, "getweaponhudiconoverride" }, + { 0x80A1, "setempjammed" }, + { 0x80A2, "playersetexpfog" }, + { 0x80A3, "isitemunlocked" }, + { 0x80A4, "getplayerdata" }, + { 0x80A5, "setplayerdata" }, + { 0x80A6, "trackerupdate" }, + { 0x80A7, "pingplayer" }, + { 0x80A8, "buttonpressed" }, + { 0x80A9, "sayall" }, + { 0x80AA, "sayteam" }, + { 0x80AB, "showscoreboard" }, + { 0x80AC, "setspawnweapon" }, + { 0x80AD, "dropitem" }, + { 0x80AE, "dropscavengerbag" }, + { 0x80AF, "finishplayerdamage" }, + { 0x80B0, "suicide" }, + { 0x80B1, "closeingamemenu" }, + { 0x80B2, "iprintln" }, + { 0x80B3, "iprintlnbold" }, + { 0x80B4, "spawn" }, + { 0x80B5, "setentertime" }, + { 0x80B6, "cloneplayer" }, + { 0x80B7, "istalking" }, + { 0x80B8, "allowspectateteam" }, + { 0x80B9, "getguid" }, + { 0x80BA, "getxuid" }, + { 0x80BB, "ishost" }, + { 0x80BC, "getspectatingplayer" }, + { 0x80BD, "predictstreampos" }, + { 0x80BE, "updatescores" }, + { 0x80BF, "updatedmscores" }, + { 0x80C0, "setrank" }, + { 0x80C1, "setcardtitle" }, + { 0x80C2, "setcardicon" }, + { 0x80C3, "setcardnameplate" }, + { 0x80C4, "setcarddisplayslot" }, + { 0x80C5, "kc_regweaponforfxremoval" }, + { 0x80C6, "laststandrevive" }, + { 0x80C7, "setspectatedefaults" }, + { 0x80C8, "getthirdpersoncrosshairoffset" }, + { 0x80C9, "disableweaponpickup" }, + { 0x80CA, "enableweaponpickup" }, + { 0x80CB, "issplitscreenplayer" }, + { 0x80CC, "issplitscreenplayerprimary" }, + { 0x80CD, "getviewmodel" }, + { 0x80CE, "fragbuttonpressed" }, + { 0x80CF, "secondaryoffhandbuttonpressed" }, + { 0x80D0, "getcurrentweaponclipammo" }, + { 0x80D1, "setvelocity" }, + { 0x80D2, "getplayerviewheight" }, + { 0x80D3, "getnormalizedmovement" }, + { 0x80D4, "getnormalizedcameramovement" }, + { 0x80D5, "giveweapon" }, + { 0x80D6, "takeweapon" }, + { 0x80D7, "takeallweapons" }, + { 0x80D8, "getcurrentweapon" }, + { 0x80D9, "getcurrentprimaryweapon" }, + { 0x80DA, "getcurrentoffhand" }, + { 0x80DB, "hasweapon" }, + { 0x80DC, "switchtoweapon" }, + { 0x80DD, "switchtoweaponimmediate" }, + { 0x80DE, "switchtooffhand" }, + { 0x80DF, "givestartammo" }, + { 0x80E0, "givemaxammo" }, + { 0x80E1, "getfractionstartammo" }, + { 0x80E2, "getfractionmaxammo" }, + { 0x80E3, "isdualwielding" }, + { 0x80E4, "isreloading" }, + { 0x80E5, "isswitchingweapon" }, + { 0x80E6, "setorigin" }, + { 0x80E7, "getvelocity" }, + { 0x80E8, "setplayerangles" }, + { 0x80E9, "getplayerangles" }, + { 0x80EA, "usebuttonpressed" }, + { 0x80EB, "attackbuttonpressed" }, + { 0x80EC, "adsbuttonpressed" }, + { 0x80ED, "meleebuttonpressed" }, + { 0x80EE, "playerads" }, + { 0x80EF, "isonground" }, + { 0x80F0, "isusingturret" }, + { 0x80F1, "setviewmodel" }, + { 0x80F2, "setoffhandprimaryclass" }, + { 0x80F3, "getoffhandprimaryclass" }, + { 0x80F4, "setoffhandsecondaryclass" }, + { 0x80F5, "getoffhandsecondaryclass" }, + { 0x80F6, "beginlocationselection" }, + { 0x80F7, "endlocationselection" }, + { 0x80F8, "disableweapons" }, + { 0x80F9, "enableweapons" }, + { 0x80FA, "disableoffhandweapons" }, + { 0x80FB, "enableoffhandweapons" }, + { 0x80FC, "disableweaponswitch" }, + { 0x80FD, "enableweaponswitch" }, + { 0x80FE, "openpopupmenu" }, + { 0x80FF, "openpopupmenunomouse" }, + { 0x8100, "closepopupmenu" }, + { 0x8101, "openmenu" }, + { 0x8102, "closemenu" }, + { 0x8103, "savematchrulestohistory" }, + { 0x8104, "freezecontrols" }, + { 0x8105, "disableusability" }, + { 0x8106, "enableusability" }, + { 0x8107, "setwhizbyspreads" }, + { 0x8108, "setwhizbyradii" }, + { 0x8109, "setreverb" }, + { 0x810A, "deactivatereverb" }, + { 0x810B, "setvolmod" }, + { 0x810C, "setchannelvolume" }, + { 0x810D, "setchannelvolumes" }, + { 0x810E, "deactivatechannelvolumes" }, + { 0x810F, "playlocalsound" }, + { 0x8110, "stoplocalsound" }, + { 0x8111, "setweaponammoclip" }, + { 0x8112, "setweaponammostock" }, + { 0x8113, "getweaponammoclip" }, + { 0x8114, "getweaponammostock" }, + { 0x8115, "anyammoforweaponmodes" }, + { 0x8116, "setclientdvar" }, + { 0x8117, "setclientdvars" }, + { 0x8118, "allowads" }, + { 0x8119, "allowjump" }, + { 0x811A, "allowsprint" }, + { 0x811B, "setspreadoverride" }, + { 0x811C, "resetspreadoverride" }, + { 0x811D, "setaimspreadmovementscale" }, + { 0x811E, "setactionslot" }, + { 0x811F, "setviewkickscale" }, + { 0x8120, "getviewkickscale" }, + { 0x8121, "getweaponslistall" }, + { 0x8122, "getweaponslistprimaries" }, + { 0x8123, "getweaponslistoffhands" }, + { 0x8124, "getweaponslistitems" }, + { 0x8125, "getweaponslistexclusives" }, + { 0x8126, "getweaponslist" }, + { 0x8127, "canplayerplacesentry" }, + { 0x8128, "canplayerplacetank" }, + { 0x8129, "visionsetnakedforplayer" }, + { 0x812A, "visionsetnightforplayer" }, + { 0x812B, "visionsetmissilecamforplayer" }, + { 0x812C, "visionsetthermalforplayer" }, + { 0x812D, "visionsetpainforplayer" }, + { 0x812E, "setblurforplayer" }, + { 0x812F, "getplayerweaponmodel" }, + { 0x8130, "getplayerknifemodel" }, + { 0x8131, "updateplayermodelwithweapons" }, + { 0x8132, "notifyonplayercommand" }, + { 0x8133, "canmantle" }, + { 0x8134, "forcemantle" }, + { 0x8135, "ismantling" }, + { 0x8136, "playfx" }, + { 0x8137, "player_recoilscaleon" }, + { 0x8138, "player_recoilscaleoff" }, + { 0x8139, "weaponlockstart" }, + { 0x813A, "weaponlockfinalize" }, + { 0x813B, "weaponlockfree" }, + { 0x813C, "weaponlocktargettooclose" }, + { 0x813D, "weaponlocknoclearance" }, + { 0x813E, "visionsyncwithplayer" }, + { 0x813F, "showhudsplash" }, + { 0x8140, "setperk" }, + { 0x8141, "hasperk" }, + { 0x8142, "clearperks" }, + { 0x8143, "unsetperk" }, + { 0x8144, "noclip" }, + { 0x8145, "ufo" }, + { 0x8146, "moveto" }, + { 0x8147, "movex" }, + { 0x8148, "movey" }, + { 0x8149, "movez" }, + { 0x814A, "movegravity" }, + { 0x814B, "moveslide" }, + { 0x814C, "stopmoveslide" }, + { 0x814D, "rotateto" }, + { 0x814E, "rotatepitch" }, + { 0x814F, "rotateyaw" }, + { 0x8150, "rotateroll" }, + { 0x8151, "addpitch" }, + { 0x8152, "addyaw" }, + { 0x8153, "addroll" }, + { 0x8154, "vibrate" }, + { 0x8155, "rotatevelocity" }, + { 0x8156, "solid" }, + { 0x8157, "notsolid" }, + { 0x8158, "setcandamage" }, + { 0x8159, "setcanradiusdamage" }, + { 0x815A, "physicslaunchclient" }, + { 0x815B, "physicslaunchserver" }, + { 0x815C, "physicslaunchserveritem" }, + { 0x815D, "clonebrushmodeltoscriptmodel" }, + { 0x815E, "scriptmodelplayanim" }, + { 0x815F, "scriptmodelclearanim" }, + { 0x8160, "vehicle_teleport" }, + { 0x8161, "attachpath" }, + { 0x8162, "getattachpos" }, + { 0x8163, "startpath" }, + { 0x8164, "setswitchnode" }, + { 0x8165, "setwaitspeed" }, + { 0x8166, "vehicle_finishdamage" }, + { 0x8167, "vehicle_setspeed" }, + { 0x8168, "vehicle_setspeedimmediate" }, + { 0x8169, "vehicle_rotateyaw" }, + { 0x816A, "vehicle_getspeed" }, + { 0x816B, "vehicle_getvelocity" }, + { 0x816C, "vehicle_getbodyvelocity" }, + { 0x816D, "vehicle_getsteering" }, + { 0x816E, "vehicle_getthrottle" }, + { 0x816F, "vehicle_turnengineoff" }, + { 0x8170, "vehicle_turnengineon" }, + { 0x8171, "getgoalspeedmph" }, + { 0x8172, "setacceleration" }, + { 0x8173, "setdeceleration" }, + { 0x8174, "resumespeed" }, + { 0x8175, "setyawspeed" }, + { 0x8176, "setyawspeedbyname" }, + { 0x8177, "setmaxpitchroll" }, + { 0x8178, "setairresistance" }, + { 0x8179, "setturningability" }, + { 0x817A, "setjitterparams" }, + { 0x817B, "sethoverparams" }, + { 0x817C, "joltbody" }, + { 0x817D, "freevehicle" }, + { 0x817E, "getwheelsurface" }, + { 0x817F, "getvehicleowner" }, + { 0x8180, "setvehiclelookattext" }, + { 0x8181, "setvehicleteam" }, + { 0x8182, "setneargoalnotifydist" }, + { 0x8183, "setvehgoalpos" }, + { 0x8184, "setgoalyaw" }, + { 0x8185, "cleargoalyaw" }, + { 0x8186, "settargetyaw" }, + { 0x8187, "cleartargetyaw" }, + { 0x8188, "vehicle_helisetai" }, + { 0x8189, "setturrettargetvec" }, + { 0x818A, "setturrettargetent" }, + { 0x818B, "clearturrettarget" }, + { 0x818C, "vehicle_canturrettargetpoint" }, + { 0x818D, "setlookatent" }, + { 0x818E, "clearlookatent" }, + { 0x818F, "setvehweapon" }, + { 0x8190, "fireweapon" }, + { 0x8191, "vehicleturretcontrolon" }, + { 0x8192, "vehicleturretcontroloff" }, + { 0x8193, "isturretready" }, + { 0x8194, "vehicledriveto" }, + { 0x8195, "vehicle_dospawn" }, + { 0x8196, "vehicle_isphysveh" }, + { 0x8197, "vehphys_crash" }, + { 0x8198, "vehphys_launch" }, + { 0x8199, "vehphys_disablecrashing" }, + { 0x819A, "vehphys_enablecrashing" }, + { 0x819B, "vehphys_setspeed" }, + { 0x819C, "vehphys_setconveyorbelt" }, + { 0x819D, "freehelicopter" }, + { 0x819E, "playerlinkedturretanglesenable" }, + { 0x819F, "playerlinkedturretanglesdisable" }, + { 0x81A0, "playersetstreamorigin" }, + { 0x81A1, "playerclearstreamorigin" }, + { 0x81A2, "nightvisionviewon" }, + { 0x81A3, "nightvisionviewoff" }, + { 0x81A4, "painvisionon" }, + { 0x81A5, "painvisionoff" }, + { 0x81A6, "getplayerintelisfound" }, + { 0x81A7, "setplayerintelfound" }, + { 0x81A8, "newpip" }, + { 0x81A9, "sethuddynlight" }, + { 0x81AA, "startscriptedanim" }, + { 0x81AB, "startcoverbehavior" }, + { 0x81AC, "startcoverarrival" }, + { 0x81AD, "starttraversearrival" }, + { 0x81AE, "checkcoverexitposwithpath" }, + { 0x81AF, "shoot" }, + { 0x81B0, "shootblank" }, + { 0x81B1, "melee" }, + { 0x81B2, "updateplayersightaccuracy" }, + { 0x81B3, "findshufflecovernode" }, + { 0x81B4, "findnearbycovernode" }, + { 0x81B5, "findcovernode" }, + { 0x81B6, "findbestcovernode" }, + { 0x81B7, "getcovernode" }, + { 0x81B8, "usecovernode" }, + { 0x81B9, "iscovervalidagainstenemy" }, + { 0x81BA, "reacquirestep" }, + { 0x81BB, "findreacquiredirectpath" }, + { 0x81BC, "trimpathtoattack" }, + { 0x81BD, "reacquiremove" }, + { 0x81BE, "findreacquireproximatepath" }, + { 0x81BF, "flagenemyunattackable" }, + { 0x81C0, "enterprone" }, + { 0x81C1, "exitprone" }, + { 0x81C2, "setproneanimnodes" }, + { 0x81C3, "updateprone" }, + { 0x81C4, "clearpitchorient" }, + { 0x81C5, "setlookatanimnodes" }, + { 0x81C6, "setlookat" }, + { 0x81C7, "setlookatentity" }, + { 0x81C8, "setlookatyawlimits" }, + { 0x81C9, "stoplookat" }, + { 0x81CA, "getmuzzlepos" }, + { 0x81CB, "getmuzzleangle" }, + { 0x81CC, "getmuzzlesideoffsetpos" }, + { 0x81CD, "getaimangle" }, + { 0x81CE, "canshoot" }, + { 0x81CF, "canshootenemy" }, + { 0x81D0, "cansee" }, + { 0x81D1, "seerecently" }, + { 0x81D2, "lastknowntime" }, + { 0x81D3, "lastknownpos" }, + { 0x81D4, "dropweapon" }, + { 0x81D5, "maymovetopoint" }, + { 0x81D6, "maymovefrompointtopoint" }, + { 0x81D7, "teleport" }, + { 0x81D8, "forceteleport" }, + { 0x81D9, "safeteleport" }, + { 0x81DA, "withinapproxpathdist" }, + { 0x81DB, "ispathdirect" }, + { 0x81DC, "allowedstances" }, + { 0x81DD, "isstanceallowed" }, + { 0x81DE, "issuppressionwaiting" }, + { 0x81DF, "issuppressed" }, + { 0x81E0, "ismovesuppressed" }, + { 0x81E1, "isgrenadepossafe" }, + { 0x81E2, "checkgrenadethrow" }, + { 0x81E3, "checkgrenadelaunch" }, + { 0x81E4, "checkgrenadelaunchpos" }, + { 0x81E5, "throwgrenade" }, + { 0x81E6, "pickupgrenade" }, + { 0x81E7, "useturret" }, + { 0x81E8, "stopuseturret" }, + { 0x81E9, "canuseturret" }, + { 0x81EA, "traversemode" }, + { 0x81EB, "animmode" }, + { 0x81EC, "orientmode" }, + { 0x81ED, "getmotionangle" }, + { 0x81EE, "shouldfacemotion" }, + { 0x81EF, "getanglestolikelyenemypath" }, + { 0x81F0, "setturretanim" }, + { 0x81F1, "getturret" }, + { 0x81F2, "getgroundenttype" }, + { 0x81F3, "animcustom" }, + { 0x81F4, "isinscriptedstate" }, + { 0x81F5, "canattackenemynode" }, + { 0x81F6, "getnegotiationstartnode" }, + { 0x81F7, "getnegotiationendnode" }, + { 0x81F8, "getdoorpathnode" }, + { 0x81F9, "comparenodedirtopathdir" }, + { 0x81FA, "checkprone" }, + { 0x81FB, "pushplayer" }, + { 0x81FC, "checkgrenadethrowpos" }, + { 0x81FD, "setgoalnode" }, + { 0x81FE, "setgoalpos" }, + { 0x81FF, "setgoalentity" }, + { 0x8200, "setgoalvolume" }, + { 0x8201, "setgoalvolumeauto" }, + { 0x8202, "getgoalvolume" }, + { 0x8203, "cleargoalvolume" }, + { 0x8204, "setfixednodesafevolume" }, + { 0x8205, "getfixednodesafevolume" }, + { 0x8206, "clearfixednodesafevolume" }, + { 0x8207, "isingoal" }, + { 0x8208, "setruntopos" }, + { 0x8209, "nearnode" }, + { 0x820A, "nearclaimnode" }, + { 0x820B, "nearclaimnodeandangle" }, + { 0x820C, "atdangerousnode" }, + { 0x820D, "getenemyinfo" }, + { 0x820E, "clearenemy" }, + { 0x820F, "setentitytarget" }, + { 0x8210, "clearentitytarget" }, + { 0x8211, "setpotentialthreat" }, + { 0x8212, "clearpotentialthreat" }, + { 0x8213, "setflashbanged" }, + { 0x8214, "setengagementmindist" }, + { 0x8215, "setengagementmaxdist" }, + { 0x8216, "isknownenemyinradius" }, + { 0x8217, "isknownenemyinvolume" }, + { 0x8218, "settalktospecies" }, + { 0x8219, "laseralton" }, + { 0x821A, "laseraltoff" }, + { 0x821B, "invisiblenotsolid" }, + { 0x821C, "visiblesolid" }, + { 0x821D, "setdefaultaimlimits" }, + { 0x821E, "initriotshieldhealth" }, + { 0x821F, "getenemysqdist" }, + { 0x8220, "getclosestenemysqdist" }, + { 0x8221, "setthreatbiasgroup" }, + { 0x8222, "getthreatbiasgroup" }, + { 0x8223, "makeentitysentient" }, + { 0x8224, "freeentitysentient" }, + { 0x8225, "isindoor" }, + { 0x8226, "getdroptofloorposition" }, + { 0x8227, "isbadguy" }, + { 0x8228, "animscripted" }, + { 0x8229, "animscriptedthirdperson" }, + { 0x822A, "animrelative" }, + { 0x822B, "stopanimscripted" }, + { 0x822C, "clearanim" }, + { 0x822D, "setanimknob" }, + { 0x822E, "setanimknoblimited" }, + { 0x822F, "setanimknobrestart" }, + { 0x8230, "setanimknoblimitedrestart" }, + { 0x8231, "setanimknoball" }, + { 0x8232, "setanimknoballlimited" }, + { 0x8233, "setanimknoballrestart" }, + { 0x8234, "setanimknoballlimitedrestart" }, + { 0x8235, "setanim" }, + { 0x8236, "setanimlimited" }, + { 0x8237, "setanimrestart" }, + { 0x8238, "setanimlimitedrestart" }, + { 0x8239, "getanimtime" }, + { 0x823A, "getanimweight" }, + { 0x823B, "getanimassettype" }, + { 0x823C, "setflaggedanimknob" }, + { 0x823D, "setflaggedanimknoblimited" }, + { 0x823E, "setflaggedanimknobrestart" }, + { 0x823F, "setflaggedanimknoblimitedrestart" }, + { 0x8240, "setflaggedanimknoball" }, + { 0x8241, "setflaggedanimknoballrestart" }, + { 0x8242, "setflaggedanim" }, + { 0x8243, "setflaggedanimlimited" }, + { 0x8244, "setflaggedanimrestart" }, + { 0x8245, "setflaggedanimlimitedrestart" }, + { 0x8246, "useanimtree" }, + { 0x8247, "stopuseanimtree" }, + { 0x8248, "setanimtime" }, + { 0x8249, "showviewmodel" }, + { 0x824A, "hideviewmodel" }, + { 0x824B, "allowstand" }, + { 0x824C, "allowcrouch" }, + { 0x824D, "allowprone" }, + { 0x824E, "allowlean" }, + { 0x824F, "setocclusion" }, + { 0x8250, "deactivateocclusion" }, + { 0x8251, "isocclusionenabled" }, + { 0x8252, "iseqenabled" }, + { 0x8253, "seteq" }, + { 0x8254, "seteqbands" }, + { 0x8255, "deactivateeq" }, + { 0x8256, "seteqlerp" }, + { 0x8257, "islookingat" }, + { 0x8258, "isthrowinggrenade" }, + { 0x8259, "isfiring" }, + { 0x825A, "ismeleeing" }, + { 0x825B, "setautopickup" }, + { 0x825C, "allowmelee" }, + { 0x825D, "allowfire" }, + { 0x825E, "enablehealthshield" }, + { 0x825F, "enabledeathshield" }, + { 0x8260, "nightvisiongogglesforceon" }, + { 0x8261, "nightvisiongogglesforceoff" }, + { 0x8262, "enableinvulnerability" }, + { 0x8263, "disableinvulnerability" }, + { 0x8264, "enablebreaching" }, + { 0x8265, "disablebreaching" }, + { 0x8266, "forceviewmodelanimation" }, + { 0x8267, "disableturretdismount" }, + { 0x8268, "enableturretdismount" }, + { 0x8269, "uploadscore" }, + { 0x826A, "uploadtime" }, + { 0x826B, "uploadleaderboards" }, + { 0x826C, "giveachievement" }, + { 0x826D, "hidehud" }, + { 0x826E, "showhud" }, + { 0x826F, "mountvehicle" }, + { 0x8270, "dismountvehicle" }, + { 0x8271, "enableslowaim" }, + { 0x8272, "disableslowaim" }, + { 0x8273, "usehintsinvehicle" }, + { 0x8274, "vehicleattackbuttonpressed" }, + { 0x8275, "setwhizbyoffset" }, + { 0x8276, "setwhizbyprobabilities" }, + { 0x8277, "visionsetnakedforplayer_lerp" }, + { 0x8278, "setwaitnode" }, + { 0x8279, "returnplayercontrol" }, + { 0x827A, "vehphys_starttrack" }, + { 0x827B, "vehphys_clearautodisable" }, + { 0x827C, "vehicleusealtblendedaudio" }, + { 0x827D, "settext" }, + { 0x827E, "clearalltextafterhudelem" }, + { 0x827F, "setshader" }, + { 0x8280, "settargetent" }, + { 0x8281, "cleartargetent" }, + { 0x8282, "settimer" }, + { 0x8283, "settimerup" }, + { 0x8284, "settimerstatic" }, + { 0x8285, "settenthstimer" }, + { 0x8286, "settenthstimerup" }, + { 0x8287, "settenthstimerstatic" }, + { 0x8288, "setclock" }, + { 0x8289, "setclockup" }, + { 0x828A, "setvalue" }, + { 0x828B, "setwaypoint" }, + { 0x828C, "setwaypointedgestyle_rotatingicon" }, + { 0x828D, "setwaypointedgestyle_secondaryarrow" }, + { 0x828E, "setwaypointiconoffscreenonly" }, + { 0x828F, "fadeovertime" }, + { 0x8290, "scaleovertime" }, + { 0x8291, "moveovertime" }, + { 0x8292, "reset" }, + { 0x8293, "destroy" }, + { 0x8294, "setpulsefx" }, + { 0x8295, "setplayernamestring" }, + { 0x8296, "changefontscaleovertime" }, + { 0x8297, "startignoringspotlight" }, + { 0x8298, "stopignoringspotlight" }, + { 0x8299, "dontcastshadows" }, + { 0x829A, "castshadows" }, + { 0x829B, "setstablemissile" }, + { 0x829C, "playersetgroundreferenceent" }, + { 0x829D, "dontinterpolate" }, + { 0x829E, "dospawn" }, + { 0x829F, "stalingradspawn" }, + { 0x82A0, "getorigin" }, + { 0x82A1, "getcentroid" }, + { 0x82A2, "getshootatpos" }, + { 0x82A3, "getdebugeye" }, + { 0x82A4, "useby" }, + { 0x82A5, "playsound" }, + { 0x82A6, "playsoundatviewheight" }, + { 0x82A7, "prefetchsound" }, + { 0x82A8, "setpitch" }, + { 0x82A9, "scalepitch" }, + { 0x82AA, "setvolume" }, + { 0x82AB, "scalevolume" }, + { 0x82AC, "setspeakermapmonotostereo" }, + { 0x82AD, "setspeakermapmonoto51" }, + { 0x82AE, "setdistributed2dsound" }, + { 0x82AF, "playsoundasmaster" }, + { 0x82B0, "playloopsound" }, + { 0x82B1, "eqon" }, + { 0x82B2, "eqoff" }, + { 0x82B3, "haseq" }, + { 0x82B4, "iswaitingonsound" }, + { 0x82B5, "getnormalhealth" }, + { 0x82B6, "setnormalhealth" }, + { 0x82B7, "dodamage" }, + { 0x82B8, "kill" }, + { 0x82B9, "show" }, + { 0x82BA, "hide" }, + { 0x82BB, "showonclient" }, + { 0x82BC, "hideonclient" }, + { 0x82BD, "laserforceon" }, + { 0x82BE, "laserforceoff" }, + { 0x82BF, "disconnectpaths" }, + { 0x82C0, "connectpaths" }, + { 0x82C1, "startusingheroonlylighting" }, + { 0x82C2, "stopusingheroonlylighting" }, + { 0x82C3, "startusinglessfrequentlighting" }, + { 0x82C4, "stopusinglessfrequentlighting" }, + { 0x82C5, "setthermalfog" }, + { 0x82C6, "setnightvisionfog" }, + { 0x82C7, "clearthermalfog" }, + { 0x82C8, "clearnightvisionfog" }, + { 0x82C9, "digitaldistortsetparams" }, + { 0x82CA, "setmode" }, + { 0x82CB, "getmode" }, + { 0x82CC, "setturretignoregoals" }, + { 0x82CD, "setturretcanaidetach" }, + { 0x82CE, "setturretfov" }, + { 0x82CF, "lerpfov" }, + { 0x82D0, "getvalidcoverpeekouts" }, + { 0x82D1, "gethighestnodestance" }, + { 0x82D2, "doesnodeallowstance" }, + { 0x82D3, "getgunangles" }, + { 0x82D4, "magicgrenade" }, + { 0x82D5, "magicgrenademanual" }, + { 0x82D6, "setfriendlychain" }, + { 0x82D7, "getentnum" }, + { 0x82D8, "launch" }, + { 0x82D9, "setsoundblend" }, + { 0x82DA, "makefakeai" }, + { 0x82DB, "spawndrone" }, + { 0x82DC, "setcorpseremovetimer" }, + { 0x82DD, "setlookattext" }, + { 0x82DE, "setspawnerteam" }, + { 0x82DF, "addaieventlistener" }, + { 0x82E0, "removeaieventlistener" }, + { 0x82E1, "getlightcolor" }, + { 0x82E2, "setlightcolor" }, + { 0x82E3, "getlightradius" }, + { 0x82E4, "setlightradius" }, + { 0x82E5, "getlightfovinner" }, + { 0x82E6, "getlightfovouter" }, + { 0x82E7, "setlightfovrange" }, + { 0x82E8, "getlightexponent" }, + { 0x82E9, "setlightexponent" }, + { 0x82EA, "startragdoll" }, + { 0x82EB, "startragdollfromimpact" }, + { 0x82EC, "logstring" }, + { 0x82ED, "laserhidefromclient" }, + { 0x82EE, "stopsoundchannel" }, + { 0x82EF, "thermaldrawenable" }, + { 0x82F0, "thermaldrawdisable" }, + { 0x82F1, "setturretdismountorg" }, + { 0x82F2, "setdamagestage" }, + { 0x82F3, "playsoundtoteam" }, + { 0x82F4, "playsoundtoplayer" }, + { 0x82F5, "playerhide" }, + { 0x82F6, "showtoplayer" }, + { 0x82F7, "enableplayeruse" }, + { 0x82F8, "disableplayeruse" }, + { 0x82F9, "makescrambler" }, + { 0x82FA, "makeportableradar" }, + { 0x82FB, "maketrophysystem" }, + { 0x82FC, "placespawnpoint" }, + { 0x82FD, "setteamfortrigger" }, + { 0x82FE, "clientclaimtrigger" }, + { 0x82FF, "clientreleasetrigger" }, + { 0x8300, "releaseclaimedtrigger" }, + { 0x8301, "isusingonlinedataoffline" }, + { 0x8302, "getrestedtime" }, + { 0x8303, "sendleaderboards" }, + { 0x8304, "isonladder" }, + { 0x8305, "getcorpseanim" }, + { 0x8306, "playerforcedeathanim" }, + { 0x8307, "startac130" }, + { 0x8308, "stopac130" }, +/* + { 0x8309, "enablemousesteer" }, + { 0x830A, "setscriptmoverkillcam" }, + { 0x830B, "setmapnamestring" }, + { 0x830C, "setgametypestring" }, +*/ +}}; + +} // namespace xsk::gsc::iw5_ps diff --git a/src/experimental/iw5c/xsk/resolver.cpp b/src/iw5/iw5_ps_token.cpp similarity index 94% rename from src/experimental/iw5c/xsk/resolver.cpp rename to src/iw5/iw5_ps_token.cpp index da090232..210d841f 100644 --- a/src/experimental/iw5c/xsk/resolver.cpp +++ b/src/iw5/iw5_ps_token.cpp @@ -1,1727 +1,14 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" -#include "iw5c.hpp" +#include "iw5_ps.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - -namespace xsk::gsc::iw5c +namespace xsk::gsc::iw5_ps { -std::unordered_map opcode_map; -std::unordered_map function_map; -std::unordered_map method_map; -std::unordered_map token_map; -std::unordered_map opcode_map_rev; -std::unordered_map function_map_rev; -std::unordered_map method_map_rev; -std::unordered_map token_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_func_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - const auto itr = function_map.find(id); - - if (itr != function_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_meth_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - const auto itr = method_map.find(id); - - if (itr != method_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_id_")) - { - return static_cast(std::stoul(name.substr(4), nullptr, 16)); - } - - const auto itr = token_map_rev.find(name); - - if (itr != token_map_rev.end()) - { - return itr->second; - } - - return 0; -} - -auto resolver::token_name(std::uint16_t id) -> std::string -{ - const auto itr = token_map.find(id); - - if (itr != token_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - } - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - } - - return false; -} - -void resolver::add_function(const std::string& name, std::uint16_t id) -{ - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - throw error(utils::string::va("builtin function '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - function_map.insert({ id, *str }); - function_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - function_map.insert({ id, *ins.first }); - function_map_rev.insert({ *ins.first, id }); - } - } -} - -void resolver::add_method(const std::string& name, std::uint16_t id) -{ - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - throw error(utils::string::va("builtin method '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - method_map.insert({ id, *str }); - method_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - method_map.insert({ id, *ins.first }); - method_map_rev.insert({ *ins.first, 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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ - "aitype"sv, - "animscripts"sv, - "character"sv, - "codescripts"sv, - "common_scripts"sv, - "maps"sv, - "mptype"sv, - "vehicle_scripts"sv, - "xmodelalias"sv, - "animscripts/civilian"sv, - "animscripts/dog"sv, - "animscripts/hummer_turret"sv, - "animscripts/riotshield"sv, - "animscripts/saw"sv, - "animscripts/scripted"sv, - "animscripts/technical"sv, - "animscripts/traverse"sv, - "maps/animated_models"sv, - "maps/cinematic_setups"sv, - "maps/createart"sv, - "maps/createfx"sv, - "maps/gametypes"sv, - "maps/mp"sv, - "maps/mp/gametypes"sv, - "maps/mp/killstreaks"sv, - "maps/mp/perks"sv, -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -const std::array, 153> opcode_list -{{ - { 0x00, "OP_End" }, - { 0x01, "OP_Return" }, - { 0x02, "OP_GetUndefined" }, - { 0x03, "OP_GetZero" }, - { 0x04, "OP_GetByte" }, - { 0x05, "OP_GetAnimTree" }, - { 0x06, "OP_GetNegByte" }, - { 0x07, "OP_GetUnsignedShort" }, - { 0x08, "OP_GetNegUnsignedShort" }, - { 0x09, "OP_GetInteger" }, - { 0x0A, "OP_GetBuiltinFunction" }, - { 0x0B, "OP_GetBuiltinMethod" }, - { 0x0C, "OP_GetFloat" }, - { 0x0D, "OP_GetString" }, - { 0x0E, "OP_GetIString" }, - { 0x0F, "OP_GetVector" }, - { 0x10, "OP_GetLevelObject" }, - { 0x11, "OP_GetAnimObject" }, - { 0x12, "OP_GetSelf" }, - { 0x13, "OP_GetThisthread" }, - { 0x14, "OP_GetLevel" }, - { 0x15, "OP_GetGame" }, - { 0x16, "OP_GetAnim" }, - { 0x17, "OP_GetAnimation" }, - { 0x18, "OP_GetGameRef" }, - { 0x1A, "OP_GetLocalFunction" }, - { 0x19, "OP_GetFarFunction" }, - { 0x1B, "OP_CreateLocalVariable" }, - { 0x1C, "OP_RemoveLocalVariables" }, - { 0x1D, "OP_EvalLocalVariableCached0" }, - { 0x1E, "OP_EvalLocalVariableCached1" }, - { 0x1F, "OP_EvalLocalVariableCached2" }, - { 0x20, "OP_EvalLocalVariableCached3" }, - { 0x21, "OP_EvalLocalVariableCached4" }, - { 0x22, "OP_EvalLocalVariableCached5" }, - { 0x23, "OP_EvalLocalVariableCached" }, - { 0x24, "OP_EvalLocalArrayCached" }, - { 0x25, "OP_EvalArray" }, - { 0x26, "OP_EvalLocalArrayRefCached0" }, - { 0x27, "OP_EvalNewLocalArrayRefCached0" }, - { 0x28, "OP_EvalLocalArrayRefCached" }, - { 0x29, "OP_EvalArrayRef" }, - { 0x2A, "OP_ClearArray" }, - { 0x2B, "OP_EmptyArray" }, - { 0x2C, "OP_AddArray" }, - { 0x2D, "OP_GetSelfObject" }, - { 0x2E, "OP_EvalLevelFieldVariable" }, - { 0x2F, "OP_EvalAnimFieldVariable" }, - { 0x30, "OP_EvalSelfFieldVariable" }, - { 0x31, "OP_EvalFieldVariable" }, - { 0x32, "OP_EvalLevelFieldVariableRef" }, - { 0x33, "OP_EvalAnimFieldVariableRef" }, - { 0x34, "OP_EvalSelfFieldVariableRef" }, - { 0x35, "OP_EvalFieldVariableRef" }, - { 0x36, "OP_ClearFieldVariable" }, - { 0x37, "OP_SafeCreateVariableFieldCached" }, - { 0x38, "OP_SafeSetVariableFieldCached0" }, - { 0x39, "OP_SafeSetVariableFieldCached" }, - { 0x3A, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x3B, "OP_clearparams" }, - { 0x3C, "OP_checkclearparams" }, - { 0x3D, "OP_EvalLocalVariableRefCached0" }, - { 0x3E, "OP_EvalNewLocalVariableRefCached0" }, - { 0x3F, "OP_EvalLocalVariableRefCached" }, - { 0x40, "OP_SetLevelFieldVariableField" }, - { 0x41, "OP_SetVariableField" }, - { 0x42, "OP_ClearVariableField" }, - { 0x43, "OP_SetAnimFieldVariableField" }, - { 0x44, "OP_SetSelfFieldVariableField" }, - { 0x45, "OP_SetLocalVariableFieldCached0" }, - { 0x46, "OP_SetNewLocalVariableFieldCached0" }, - { 0x47, "OP_SetLocalVariableFieldCached" }, - { 0x48, "OP_ClearLocalVariableFieldCached" }, - { 0x49, "OP_ClearLocalVariableFieldCached0" }, - { 0x4A, "OP_CallBuiltin0" }, - { 0x4B, "OP_CallBuiltin1" }, - { 0x4C, "OP_CallBuiltin2" }, - { 0x4D, "OP_CallBuiltin3" }, - { 0x4E, "OP_CallBuiltin4" }, - { 0x4F, "OP_CallBuiltin5" }, - { 0x50, "OP_CallBuiltin" }, - { 0x51, "OP_CallBuiltinMethod0" }, - { 0x52, "OP_CallBuiltinMethod1" }, - { 0x53, "OP_CallBuiltinMethod2" }, - { 0x54, "OP_CallBuiltinMethod3" }, - { 0x55, "OP_CallBuiltinMethod4" }, - { 0x56, "OP_CallBuiltinMethod5" }, - { 0x57, "OP_CallBuiltinMethod" }, - { 0x58, "OP_wait" }, - { 0x59, "OP_waittillFrameEnd" }, - { 0x5A, "OP_PreScriptCall" }, - { 0x5B, "OP_ScriptLocalFunctionCall2" }, - { 0x5C, "OP_ScriptLocalFunctionCall" }, - { 0x5D, "OP_ScriptLocalMethodCall" }, - { 0x5E, "OP_ScriptLocalThreadCall" }, - { 0x5F, "OP_ScriptLocalChildThreadCall" }, - { 0x60, "OP_ScriptLocalMethodThreadCall" }, - { 0x61, "OP_ScriptLocalMethodChildThreadCall" }, - { 0x62, "OP_ScriptFarFunctionCall2" }, - { 0x63, "OP_ScriptFarFunctionCall" }, - { 0x64, "OP_ScriptFarMethodCall" }, - { 0x65, "OP_ScriptFarThreadCall" }, - { 0x66, "OP_ScriptFarChildThreadCall" }, - { 0x67, "OP_ScriptFarMethodThreadCall" }, - { 0x68, "OP_ScriptFarMethodChildThreadCall" }, - { 0x69, "OP_ScriptFunctionCallPointer" }, - { 0x6A, "OP_ScriptMethodCallPointer" }, - { 0x6B, "OP_ScriptThreadCallPointer" }, - { 0x6C, "OP_ScriptChildThreadCallPointer" }, - { 0x6D, "OP_ScriptMethodThreadCallPointer" }, - { 0x6E, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x6F, "OP_CallBuiltinPointer" }, - { 0x70, "OP_CallBuiltinMethodPointer" }, - { 0x71, "OP_DecTop" }, - { 0x72, "OP_CastFieldObject" }, - { 0x73, "OP_EvalLocalVariableObjectCached" }, - { 0x74, "OP_CastBool" }, - { 0x75, "OP_BoolNot" }, - { 0x76, "OP_BoolComplement" }, - { 0x77, "OP_JumpOnFalse" }, - { 0x78, "OP_JumpOnTrue" }, - { 0x79, "OP_JumpOnFalseExpr" }, - { 0x7A, "OP_JumpOnTrueExpr" }, - { 0x7B, "OP_jump" }, - { 0x7C, "OP_jumpback" }, - { 0x7D, "OP_inc" }, - { 0x7E, "OP_dec" }, - { 0x7F, "OP_bit_or" }, - { 0x80, "OP_bit_ex_or" }, - { 0x81, "OP_bit_and" }, - { 0x82, "OP_equality" }, - { 0x83, "OP_inequality" }, - { 0x84, "OP_less" }, - { 0x85, "OP_greater" }, - { 0x86, "OP_less_equal" }, - { 0x87, "OP_greater_equal" }, - { 0x88, "OP_shift_left" }, - { 0x89, "OP_shift_right" }, - { 0x8A, "OP_plus" }, - { 0x8B, "OP_minus" }, - { 0x8C, "OP_multiply" }, - { 0x8D, "OP_divide" }, - { 0x8E, "OP_mod" }, - { 0x8F, "OP_size" }, - { 0x90, "OP_waittillmatch" }, - { 0x91, "OP_waittillmatch2" }, - { 0x92, "OP_waittill" }, - { 0x93, "OP_notify" }, - { 0x94, "OP_endon" }, - { 0x95, "OP_voidCodepos" }, - { 0x96, "OP_switch" }, - { 0x97, "OP_endswitch" }, - { 0x98, "OP_vector" }, -}}; - -const std::array, 452> function_list -{{ - { 0x001, "createprintchannel" }, - { 0x002, "setprintchannel" }, - { 0x003, "print" }, - { 0x004, "println" }, - { 0x005, "print3d" }, - { 0x006, "line" }, - { 0x007, "precacheturret" }, - { 0x008, "getweaponarray" }, - { 0x009, "spawnturret" }, - { 0x00A, "canspawnturret" }, - { 0x00B, "assert" }, - { 0x00C, "assertex" }, - { 0x00D, "assertmsg" }, - { 0x00E, "isdefined" }, - { 0x00F, "isstring" }, - { 0x010, "setdvar" }, - { 0x011, "setdynamicdvar" }, - { 0x012, "setdvarifuninitialized" }, - { 0x013, "setdevdvar" }, - { 0x014, "setdevdvarifuninitialized" }, - { 0x015, "getdvar" }, - { 0x016, "getdvarint" }, - { 0x017, "getdvarfloat" }, - { 0x018, "getdvarvector" }, - { 0x019, "gettime" }, - { 0x01A, "getentbynum" }, - { 0x01B, "getweaponmodel" }, - { 0x01C, "getweaponhidetags" }, - { 0x01D, "getanimlength" }, - { 0x01E, "animhasnotetrack" }, - { 0x01F, "getnotetracktimes" }, - { 0x020, "spawn" }, - { 0x021, "spawnloopsound" }, - { 0x022, "spawnloopingsound" }, - { 0x023, "bullettrace" }, - { 0x024, "bullettracepassed" }, - { 0x025, "sighttracepassed" }, - { 0x026, "physicstrace" }, - { 0x027, "playerphysicstrace" }, - { 0x028, "getgroundposition" }, - { 0x029, "getmovedelta" }, - { 0x02A, "getangledelta" }, - { 0x02B, "getnorthyaw" }, - { 0x02C, "setnorthyaw" }, - { 0x02D, "setslowmotion" }, - { 0x02E, "randomint" }, - { 0x02F, "randomfloat" }, - { 0x030, "randomintrange" }, - { 0x031, "randomfloatrange" }, - { 0x032, "sin" }, - { 0x033, "cos" }, - { 0x034, "tan" }, - { 0x035, "asin" }, - { 0x036, "acos" }, - { 0x037, "atan" }, - { 0x038, "int" }, - { 0x039, "float" }, - { 0x03A, "abs" }, - { 0x03B, "min" }, - { 0x03C, "max" }, - { 0x03D, "floor" }, - { 0x03E, "ceil" }, - { 0x03F, "exp" }, - { 0x040, "log" }, - { 0x041, "sqrt" }, - { 0x042, "squared" }, - { 0x043, "clamp" }, - { 0x044, "angleclamp" }, - { 0x045, "angleclamp180" }, - { 0x046, "vectorfromlinetopoint" }, - { 0x047, "pointonsegmentnearesttopoint" }, - { 0x048, "distance" }, - { 0x049, "distance2d" }, - { 0x04A, "distancesquared" }, - { 0x04B, "length" }, - { 0x04C, "lengthsquared" }, - { 0x04D, "closer" }, - { 0x04E, "vectordot" }, - { 0x04F, "vectornormalize" }, - { 0x050, "vectortoangles" }, - { 0x051, "vectortoyaw" }, - { 0x052, "vectorlerp" }, - { 0x053, "anglestoup" }, - { 0x054, "anglestoright" }, - { 0x055, "anglestoforward" }, - { 0x056, "combineangles" }, - { 0x057, "transformmove" }, - { 0x058, "issubstr" }, - { 0x059, "isendstr" }, - { 0x05A, "getsubstr" }, - { 0x05B, "tolower" }, - { 0x05C, "strtok" }, - { 0x05D, "stricmp" }, - { 0x05E, "ambientplay" }, - { 0x05F, "ambientstop" }, - { 0x060, "precachemodel" }, - { 0x061, "precacheshellshock" }, - { 0x062, "precacheitem" }, - { 0x063, "precacheshader" }, - { 0x064, "precachestring" }, - { 0x065, "precachemenu" }, - { 0x066, "precacherumble" }, - { 0x067, "precachelocationselector" }, - { 0x068, "precacheleaderboards" }, - { 0x069, "loadfx" }, - { 0x06A, "playfx" }, - { 0x06B, "playfxontag" }, - { 0x06C, "stopfxontag" }, - { 0x06D, "playloopedfx" }, - { 0x06E, "spawnfx" }, - { 0x06F, "triggerfx" }, - { 0x070, "playfxontagforclients" }, - { 0x071, "physicsexplosionsphere" }, - { 0x072, "physicsexplosioncylinder" }, - { 0x073, "physicsjolt" }, - { 0x074, "physicsjitter" }, - { 0x075, "setexpfog" }, - { 0x076, "isexplosivedamagemod" }, - { 0x077, "radiusdamage" }, - { 0x078, "setplayerignoreradiusdamage" }, - { 0x079, "glassradiusdamage" }, - { 0x07A, "earthquake" }, - { 0x07B, "getnumparts" }, - { 0x07C, "getpartname" }, - { 0x07D, "weaponfiretime" }, - { 0x07E, "weaponclipsize" }, - { 0x07F, "weaponisauto" }, - { 0x080, "weaponissemiauto" }, - { 0x081, "weaponisboltaction" }, - { 0x082, "weaponinheritsperks" }, - { 0x083, "weaponburstcount" }, - { 0x084, "weapontype" }, - { 0x085, "weaponclass" }, - { 0x086, "weaponinventorytype" }, - { 0x087, "weaponstartammo" }, - { 0x088, "weaponmaxammo" }, - { 0x089, "weaponaltweaponname" }, - { 0x08A, "isweaponcliponly" }, - { 0x08B, "isweapondetonationtimed" }, - { 0x08C, "weaponhasthermalscope" }, - { 0x08D, "getvehiclenode" }, - { 0x08E, "getvehiclenodearray" }, - { 0x08F, "getallvehiclenodes" }, - { 0x090, "getnumvehicles" }, - { 0x091, "precachevehicle" }, - { 0x092, "spawnvehicle" }, - { 0x093, "vehicle_getarray" }, - { 0x094, "vehicle_getspawnerarray" }, - { 0x095, "playrumbleonposition" }, - { 0x096, "playrumblelooponposition" }, - { 0x097, "stopallrumbles" }, - { 0x098, "soundexists" }, - { 0x099, "openfile" }, - { 0x09A, "closefile" }, - { 0x09B, "fprintln" }, - { 0x09C, "fprintfields" }, - { 0x09D, "freadln" }, - { 0x09E, "fgetarg" }, - { 0x09F, "setminimap" }, - { 0x0A0, "setthermalbodymaterial" }, - { 0x0A1, "getarraykeys" }, - { 0x0A2, "getfirstarraykey" }, - { 0x0A3, "getnextarraykey" }, - { 0x0A4, "sortbydistance" }, - { 0x0A5, "tablelookup" }, - { 0x0A6, "tablelookupbyrow" }, - { 0x0A7, "tablelookupistring" }, - { 0x0A8, "tablelookupistringbyrow" }, - { 0x0A9, "tablelookuprownum" }, - { 0x0AA, "getmissileowner" }, - { 0x0AB, "magicbullet" }, - { 0x0AC, "getweaponflashtagname" }, - { 0x0AD, "averagepoint" }, - { 0x0AE, "averagenormal" }, - { 0x0AF, "getglass" }, - { 0x0B0, "getglassarray" }, - { 0x0B1, "getglassorigin" }, - { 0x0B2, "isglassdestroyed" }, - { 0x0B3, "destroyglass" }, - { 0x0B4, "deleteglass" }, - { 0x0B5, "getentchannelscount" }, - { 0x0B6, "getentchannelname" }, - { 0x0B7, "objective_add" }, - { 0x0B8, "objective_delete" }, - { 0x0B9, "objective_state" }, - { 0x0BA, "objective_icon" }, - { 0x0BB, "objective_position" }, - { 0x0BC, "objective_current" }, - { 0x0BD, "objective_onentity" }, - { 0x0BE, "objective_team" }, - { 0x0BF, "objective_player" }, - { 0x0C0, "objective_playerteam" }, - { 0x0C1, "objective_playerenemyteam" }, - { 0x0C2, "iprintln" }, - { 0x0C3, "iprintlnbold" }, - { 0x0C4, "logstring" }, - { 0x0C5, "getent" }, - { 0x0C6, "getentarray" }, - { 0x0C7, "spawnplane" }, - { 0x0C8, "spawnstruct" }, - { 0x0C9, "spawnhelicopter" }, - { 0x0CA, "isalive" }, - { 0x0CB, "isspawner" }, - { 0x0CC, "missile_createattractorent" }, - { 0x0CD, "missile_createattractororigin" }, - { 0x0CE, "missile_createrepulsorent" }, - { 0x0CF, "missile_createrepulsororigin" }, - { 0x0D0, "missile_deleteattractor" }, - { 0x0D1, "playsoundatpos" }, - { 0x0D2, "newhudelem" }, - { 0x0D3, "newclienthudelem" }, - { 0x0D4, "newteamhudelem" }, - { 0x0D5, "resettimeout" }, - { 0x0D6, "precachefxteamthermal" }, - { 0x0D7, "isplayer" }, - { 0x0D8, "isplayernumber" }, - { 0x0D9, "setwinningplayer" }, - { 0x0DA, "setwinningteam" }, - { 0x0DB, "announcement" }, - { 0x0DC, "clientannouncement" }, - { 0x0DD, "getteamscore" }, - { 0x0DE, "setteamscore" }, - { 0x0DF, "setclientnamemode" }, - { 0x0E0, "updateclientnames" }, - { 0x0E1, "getteamplayersalive" }, - { 0x0E2, "logprint" }, - { 0x0E3, "worldentnumber" }, - { 0x0E4, "obituary" }, - { 0x0E5, "positionwouldtelefrag" }, - { 0x0E6, "canspawn" }, - { 0x0E7, "getstarttime" }, - { 0x0E8, "precachestatusicon" }, - { 0x0E9, "precacheheadicon" }, - { 0x0EA, "precacheminimapicon" }, - { 0x0EB, "precachempanim" }, - { 0x0EC, "map_restart" }, - { 0x0ED, "exitlevel" }, - { 0x0EE, "addtestclient" }, - { 0x0EF, "makedvarserverinfo" }, - { 0x0F0, "setarchive" }, - { 0x0F1, "allclientsprint" }, - { 0x0F2, "clientprint" }, - { 0x0F3, "mapexists" }, - { 0x0F4, "isvalidgametype" }, - { 0x0F5, "matchend" }, - { 0x0F6, "setplayerteamrank" }, - { 0x0F7, "endparty" }, - { 0x0F8, "setteamradar" }, - { 0x0F9, "getteamradar" }, - { 0x0FA, "setteamradarstrength" }, - { 0x0FB, "getteamradarstrength" }, - { 0x0FC, "getuavstrengthmin" }, - { 0x0FD, "getuavstrengthmax" }, - { 0x0FE, "getuavstrengthlevelneutral" }, - { 0x0FF, "getuavstrengthlevelshowenemyfastsweep" }, - { 0x100, "getuavstrengthlevelshowenemydirectional" }, - { 0x101, "blockteamradar" }, - { 0x102, "unblockteamradar" }, - { 0x103, "isteamradarblocked" }, - { 0x104, "getassignedteam" }, - { 0x105, "setmatchdata" }, - { 0x106, "getmatchdata" }, - { 0x107, "sendmatchdata" }, - { 0x108, "clearmatchdata" }, - { 0x109, "setmatchdatadef" }, - { 0x10A, "setmatchclientip" }, - { 0x10B, "setmatchdataid" }, - { 0x10C, "setclientmatchdata" }, - { 0x10D, "getclientmatchdata" }, - { 0x10E, "setclientmatchdatadef" }, - { 0x10F, "sendclientmatchdata" }, - { 0x110, "getbuildversion" }, - { 0x111, "getbuildnumber" }, - { 0x112, "getsystemtime" }, - { 0x113, "getmatchrulesdata" }, - { 0x114, "isusingmatchrulesdata" }, - { 0x115, "kick" }, - { 0x116, "issplitscreen" }, - { 0x117, "setmapcenter" }, - { 0x118, "setgameendtime" }, - { 0x119, "visionsetnaked" }, - { 0x11A, "visionsetnight" }, - { 0x11B, "visionsetmissilecam" }, - { 0x11C, "visionsetthermal" }, - { 0x11D, "visionsetpain" }, - { 0x11E, "endlobby" }, - { 0x11F, "setac130ambience" }, - { 0x120, "getmapcustom" }, - { 0x121, "updateskill" }, - { 0x122, "spawnsighttrace" }, - { 0x123, "incrementcounter" }, - { 0x124, "getcountertotal" }, - { 0x125, "getlevelticks" }, - { 0x126, "perlinnoise2d" }, - { 0x127, "calcrockingangles" }, - { 0x128, "sethudlighting" }, - { 0x129, "reconevent" }, - { 0x12A, "reconspatialevent" }, - { 0x12B, "setsunflareposition" }, - { 0x12C, "createthreatbiasgroup" }, - { 0x12D, "threatbiasgroupexists" }, - { 0x12E, "getthreatbias" }, - { 0x12F, "setthreatbias" }, - { 0x130, "setthreatbiasagainstall" }, - { 0x131, "setignoremegroup" }, - { 0x132, "isenemyteam" }, - { 0x133, "objective_additionalentity" }, - { 0x134, "objective_state_nomessage" }, - { 0x135, "objective_string" }, - { 0x136, "objective_string_nomessage" }, - { 0x137, "objective_additionalposition" }, - { 0x138, "objective_current_nomessage" }, - { 0x139, "objective_additionalcurrent" }, - { 0x13A, "objective_ring" }, - { 0x13B, "objective_setpointertextoverride" }, - { 0x13C, "getnode" }, - { 0x13D, "getnodearray" }, - { 0x13E, "getallnodes" }, - { 0x13F, "getnodesinradius" }, - { 0x140, "getnodesinradiussorted" }, - { 0x141, "getclosestnodeinsight" }, - { 0x142, "getreflectionlocs" }, - { 0x143, "getreflectionreferencelocs" }, - { 0x144, "getvehicletracksegment" }, - { 0x145, "getvehicletracksegmentarray" }, - { 0x146, "getallvehicletracksegments" }, - { 0x147, "isarray" }, - { 0x148, "isai" }, - { 0x149, "issentient" }, - { 0x14A, "isgodmode" }, - { 0x14B, "getdebugdvar" }, - { 0x14C, "getdebugdvarint" }, - { 0x14D, "getdebugdvarfloat" }, - { 0x14E, "setsaveddvar" }, - { 0x14F, "getfreeaicount" }, - { 0x150, "getaicount" }, - { 0x151, "getaiarray" }, - { 0x152, "getaispeciesarray" }, - { 0x153, "getspawnerarray" }, - { 0x154, "getcorpsearray" }, - { 0x155, "getspawnerteamarray" }, - { 0x156, "getweaponclipmodel" }, - { 0x157, "getbrushmodelcenter" }, - { 0x158, "getkeybinding" }, - { 0x159, "getcommandfromkey" }, - { 0x15A, "getsticksconfig" }, - { 0x15B, "weaponfightdist" }, - { 0x15C, "weaponmaxdist" }, - { 0x15D, "isturretactive" }, - { 0x15E, "target_alloc" }, - { 0x15F, "target_flush" }, - { 0x160, "target_set" }, - { 0x161, "target_remove" }, - { 0x162, "target_setshader" }, - { 0x163, "target_setoffscreenshader" }, - { 0x164, "target_isinrect" }, - { 0x165, "target_isincircle" }, - { 0x166, "target_startreticlelockon" }, - { 0x167, "target_clearreticlelockon" }, - { 0x168, "target_getarray" }, - { 0x169, "target_istarget" }, - { 0x16A, "target_setattackmode" }, - { 0x16B, "target_setjavelinonly" }, - { 0x16C, "target_hidefromplayer" }, - { 0x16D, "target_showtoplayer" }, - { 0x16E, "target_setscaledrendermode" }, - { 0x16F, "target_drawcornersonly" }, - { 0x170, "target_drawsquare" }, - { 0x171, "target_drawsingle" }, - { 0x172, "target_setminsize" }, - { 0x173, "target_setmaxsize" }, - { 0x174, "target_setcolor" }, - { 0x175, "target_setdelay" }, - { 0x176, "getstartorigin" }, - { 0x177, "getstartangles" }, - { 0x178, "getcycleoriginoffset" }, - { 0x179, "magicgrenade" }, - { 0x17A, "magicgrenademanual" }, - { 0x17B, "setblur" }, - { 0x17C, "musicplay" }, - { 0x17D, "musicstop" }, - { 0x17E, "soundfade" }, - { 0x17F, "soundsettimescalefactor" }, - { 0x180, "soundresettimescale" }, - { 0x181, "setocclusionpreset" }, - { 0x182, "levelsoundfade" }, - { 0x183, "precachenightvisioncodeassets" }, - { 0x184, "precachedigitaldistortcodeassets" }, - { 0x185, "precacheminimapsentrycodeassets" }, - { 0x186, "savegame" }, - { 0x187, "issavesuccessful" }, - { 0x188, "issaverecentlyloaded" }, - { 0x189, "savegamenocommit" }, - { 0x18A, "commitsave" }, - { 0x18B, "commitwouldbevalid" }, - { 0x18C, "getfxvisibility" }, - { 0x18D, "setculldist" }, - { 0x18E, "getculldist" }, - { 0x18F, "sethalfresparticles" }, - { 0x190, "getmapsunlight" }, - { 0x191, "setsunlight" }, - { 0x192, "resetsunlight" }, - { 0x193, "getmapsundirection" }, - { 0x194, "getmapsunangles" }, - { 0x195, "setsundirection" }, - { 0x196, "lerpsundirection" }, - { 0x197, "lerpsunangles" }, - { 0x198, "resetsundirection" }, - { 0x199, "enableforcedsunshadows" }, - { 0x19A, "enableforcednosunshadows" }, - { 0x19B, "disableforcedsunshadows" }, - { 0x19C, "enableouterspacemodellighting" }, - { 0x19D, "disableouterspacemodellighting" }, - { 0x19E, "remapstage" }, - { 0x19F, "changelevel" }, - { 0x1A0, "missionsuccess" }, - { 0x1A1, "missionfailed" }, - { 0x1A2, "cinematic" }, - { 0x1A3, "cinematicingame" }, - { 0x1A4, "cinematicingamesync" }, - { 0x1A5, "cinematicingameloop" }, - { 0x1A6, "cinematicingameloopresident" }, - { 0x1A7, "iscinematicplaying" }, - { 0x1A8, "stopcinematicingame" }, - { 0x1A9, "pausecinematicingame" }, - { 0x1AA, "drawcompassfriendlies" }, - { 0x1AB, "bulletspread" }, - { 0x1AC, "bullettracer" }, - { 0x1AD, "badplace_delete" }, - { 0x1AE, "badplace_cylinder" }, - { 0x1AF, "badplace_arc" }, - { 0x1B0, "badplace_brush" }, - { 0x1B1, "clearallcorpses" }, - { 0x1B2, "setturretnode" }, - { 0x1B3, "unsetturretnode" }, - { 0x1B4, "setnodepriority" }, - { 0x1B5, "isnodeoccupied" }, - { 0x1B6, "setdebugorigin" }, - { 0x1B7, "setdebugangles" }, - { 0x1B8, "updategamerprofile" }, - { 0x1B9, "updategamerprofileall" }, - { 0x1BA, "clearlocalizedstrings" }, - { 0x1BB, "setphysicsgravitydir" }, - { 0x1BC, "gettimescale" }, - { 0x1BD, "settimescale" }, - { 0x1BE, "setslowmotionview" }, - { 0x1BF, "forcesharedammo" }, - { 0x1C0, "refreshhudcompass" }, - { 0x1C1, "refreshhudammocounter" }, - { 0x1C2, "notifyoncommand" }, - { 0x1C3, "gettimesincelastpaused" }, - { 0x1C4, "setlasermaterial" }, -}}; - -const std::array, 777> method_list -{{ - { 0x8000, "attach" }, - { 0x8001, "attachshieldmodel" }, - { 0x8002, "detach" }, - { 0x8003, "detachshieldmodel" }, - { 0x8004, "moveshieldmodel" }, - { 0x8005, "detachall" }, - { 0x8006, "getattachsize" }, - { 0x8007, "getattachmodelname" }, - { 0x8008, "getattachtagname" }, - { 0x8009, "getattachignorecollision" }, - { 0x800A, "hidepart" }, - { 0x800B, "hidepart_allinstances" }, - { 0x800C, "hideallparts" }, - { 0x800D, "showpart" }, - { 0x800E, "showallparts" }, - { 0x800F, "linkto" }, - { 0x8010, "linktoblendtotag" }, - { 0x8011, "unlink" }, - { 0x8012, "islinked" }, - { 0x8013, "enablelinkto" }, - { 0x8014, "playerlinkto" }, - { 0x8015, "playerlinktodelta" }, - { 0x8016, "playerlinkweaponviewtodelta" }, - { 0x8017, "playerlinktoabsolute" }, - { 0x8018, "playerlinktoblend" }, - { 0x8019, "playerlinkedoffsetenable" }, - { 0x801A, "playerlinkedoffsetdisable" }, - { 0x801B, "playerlinkedsetviewznear" }, - { 0x801C, "playerlinkedsetusebaseangleforviewclamp" }, - { 0x801D, "lerpviewangleclamp" }, - { 0x801E, "setviewangleresistance" }, - { 0x801F, "geteye" }, - { 0x8020, "istouching" }, - { 0x8021, "stoploopsound" }, - { 0x8022, "stopsounds" }, - { 0x8023, "playrumbleonentity" }, - { 0x8024, "playrumblelooponentity" }, - { 0x8025, "stoprumble" }, - { 0x8026, "delete" }, - { 0x8027, "setmodel" }, - { 0x8028, "laseron" }, - { 0x8029, "laseroff" }, - { 0x802A, "laseraltviewon" }, - { 0x802B, "laseraltviewoff" }, - { 0x802C, "thermalvisionon" }, - { 0x802D, "thermalvisionoff" }, - { 0x802E, "thermalvisionfofoverlayon" }, - { 0x802F, "thermalvisionfofoverlayoff" }, - { 0x8030, "autospotoverlayon" }, - { 0x8031, "autospotoverlayoff" }, - { 0x8032, "setcontents" }, - { 0x8033, "makeusable" }, - { 0x8034, "makeunusable" }, - { 0x8035, "setcursorhint" }, - { 0x8036, "sethintstring" }, - { 0x8037, "forceusehinton" }, - { 0x8038, "forceusehintoff" }, - { 0x8039, "makesoft" }, - { 0x803A, "makehard" }, - { 0x803B, "willneverchange" }, - { 0x803C, "startfiring" }, - { 0x803D, "stopfiring" }, - { 0x803E, "isfiringturret" }, - { 0x803F, "startbarrelspin" }, - { 0x8040, "stopbarrelspin" }, - { 0x8041, "getbarrelspinrate" }, - { 0x8042, "remotecontrolturret" }, - { 0x8043, "remotecontrolturretoff" }, - { 0x8044, "shootturret" }, - { 0x8045, "getturretowner" }, - { 0x8046, "setsentryowner" }, - { 0x8047, "setsentrycarrier" }, - { 0x8048, "setturretminimapvisible" }, - { 0x8049, "settargetentity" }, - { 0x804A, "snaptotargetentity" }, - { 0x804B, "cleartargetentity" }, - { 0x804C, "getturrettarget" }, - { 0x804D, "setplayerspread" }, - { 0x804E, "setaispread" }, - { 0x804F, "setsuppressiontime" }, - { 0x8050, "setconvergencetime" }, - { 0x8051, "setconvergenceheightpercent" }, - { 0x8052, "setturretteam" }, - { 0x8053, "maketurretsolid" }, - { 0x8054, "maketurretoperable" }, - { 0x8055, "maketurretinoperable" }, - { 0x8056, "setturretaccuracy" }, - { 0x8057, "setrightarc" }, - { 0x8058, "setleftarc" }, - { 0x8059, "settoparc" }, - { 0x805A, "setbottomarc" }, - { 0x805B, "setautorotationdelay" }, - { 0x805C, "setdefaultdroppitch" }, - { 0x805D, "restoredefaultdroppitch" }, - { 0x805E, "turretfiredisable" }, - { 0x805F, "turretfireenable" }, - { 0x8060, "setturretmodechangewait" }, - { 0x8061, "usetriggerrequirelookat" }, - { 0x8062, "getstance" }, - { 0x8063, "setstance" }, - { 0x8064, "itemweaponsetammo" }, - { 0x8065, "getammocount" }, - { 0x8066, "gettagorigin" }, - { 0x8067, "gettagangles" }, - { 0x8068, "shellshock" }, - { 0x8069, "stunplayer" }, - { 0x806A, "stopshellshock" }, - { 0x806B, "fadeoutshellshock" }, - { 0x806C, "setdepthoffield" }, - { 0x806D, "setviewmodeldepthoffield" }, - { 0x806E, "setmotionblurmovescale" }, - { 0x806F, "setmotionblurturnscale" }, - { 0x8070, "setmotionblurzoomscale" }, - { 0x8071, "viewkick" }, - { 0x8072, "localtoworldcoords" }, - { 0x8073, "getentitynumber" }, - { 0x8074, "getentityvelocity" }, - { 0x8075, "enablegrenadetouchdamage" }, - { 0x8076, "disablegrenadetouchdamage" }, - { 0x8077, "enableaimassist" }, - { 0x8078, "disableaimassist" }, - { 0x8079, "radiusdamage" }, - { 0x807A, "detonate" }, - { 0x807B, "damageconetrace" }, - { 0x807C, "sightconetrace" }, - { 0x807D, "missile_settargetent" }, - { 0x807E, "missile_settargetpos" }, - { 0x807F, "missile_cleartarget" }, - { 0x8080, "missile_setflightmodedirect" }, - { 0x8081, "missile_setflightmodetop" }, - { 0x8082, "getlightintensity" }, - { 0x8083, "setlightintensity" }, - { 0x8084, "isragdoll" }, - { 0x8085, "setmovespeedscale" }, - { 0x8086, "cameralinkto" }, - { 0x8087, "cameraunlink" }, - { 0x8088, "controlslinkto" }, - { 0x8089, "controlsunlink" }, - { 0x808A, "makevehiclesolidcapsule" }, - { 0x808B, "makevehiclesolidsphere" }, - { 0x808C, "makevehiclesolid" }, - { 0x808D, "remotecontrolvehicle" }, - { 0x808E, "remotecontrolvehicleoff" }, - { 0x808F, "isfiringvehicleturret" }, - { 0x8090, "drivevehicleandcontrolturret" }, - { 0x8091, "drivevehicleandcontrolturretoff" }, - { 0x8092, "getplayersetting" }, - { 0x8093, "getlocalplayerprofiledata" }, - { 0x8094, "setlocalplayerprofiledata" }, - { 0x8095, "remotecamerasoundscapeon" }, - { 0x8096, "remotecamerasoundscapeoff" }, - { 0x8097, "radarjamon" }, - { 0x8098, "radarjamoff" }, - { 0x8099, "setmotiontrackervisible" }, - { 0x809A, "getmotiontrackervisible" }, - { 0x809B, "worldpointinreticle_circle" }, - { 0x809C, "getpointinbounds" }, - { 0x809D, "transfermarkstonewscriptmodel" }, - { 0x809E, "setwatersheeting" }, - { 0x809F, "setweaponhudiconoverride" }, - { 0x80A0, "getweaponhudiconoverride" }, - { 0x80A1, "setempjammed" }, - { 0x80A2, "playersetexpfog" }, - { 0x80A3, "isitemunlocked" }, - { 0x80A4, "getplayerdata" }, - { 0x80A5, "setplayerdata" }, - { 0x80A6, "trackerupdate" }, - { 0x80A7, "pingplayer" }, - { 0x80A8, "buttonpressed" }, - { 0x80A9, "sayall" }, - { 0x80AA, "sayteam" }, - { 0x80AB, "showscoreboard" }, - { 0x80AC, "setspawnweapon" }, - { 0x80AD, "dropitem" }, - { 0x80AE, "dropscavengerbag" }, - { 0x80AF, "finishplayerdamage" }, - { 0x80B0, "suicide" }, - { 0x80B1, "closeingamemenu" }, - { 0x80B2, "iprintln" }, - { 0x80B3, "iprintlnbold" }, - { 0x80B4, "spawn" }, - { 0x80B5, "setentertime" }, - { 0x80B6, "cloneplayer" }, - { 0x80B7, "istalking" }, - { 0x80B8, "allowspectateteam" }, - { 0x80B9, "getguid" }, - { 0x80BA, "getxuid" }, - { 0x80BB, "ishost" }, - { 0x80BC, "getspectatingplayer" }, - { 0x80BD, "predictstreampos" }, - { 0x80BE, "updatescores" }, - { 0x80BF, "updatedmscores" }, - { 0x80C0, "setrank" }, - { 0x80C1, "setcardtitle" }, - { 0x80C2, "setcardicon" }, - { 0x80C3, "setcardnameplate" }, - { 0x80C4, "setcarddisplayslot" }, - { 0x80C5, "kc_regweaponforfxremoval" }, - { 0x80C6, "laststandrevive" }, - { 0x80C7, "setspectatedefaults" }, - { 0x80C8, "getthirdpersoncrosshairoffset" }, - { 0x80C9, "disableweaponpickup" }, - { 0x80CA, "enableweaponpickup" }, - { 0x80CB, "issplitscreenplayer" }, - { 0x80CC, "issplitscreenplayerprimary" }, - { 0x80CD, "getviewmodel" }, - { 0x80CE, "fragbuttonpressed" }, - { 0x80CF, "secondaryoffhandbuttonpressed" }, - { 0x80D0, "getcurrentweaponclipammo" }, - { 0x80D1, "setvelocity" }, - { 0x80D2, "getplayerviewheight" }, - { 0x80D3, "getnormalizedmovement" }, - { 0x80D4, "getnormalizedcameramovement" }, - { 0x80D5, "giveweapon" }, - { 0x80D6, "takeweapon" }, - { 0x80D7, "takeallweapons" }, - { 0x80D8, "getcurrentweapon" }, - { 0x80D9, "getcurrentprimaryweapon" }, - { 0x80DA, "getcurrentoffhand" }, - { 0x80DB, "hasweapon" }, - { 0x80DC, "switchtoweapon" }, - { 0x80DD, "switchtoweaponimmediate" }, - { 0x80DE, "switchtooffhand" }, - { 0x80DF, "givestartammo" }, - { 0x80E0, "givemaxammo" }, - { 0x80E1, "getfractionstartammo" }, - { 0x80E2, "getfractionmaxammo" }, - { 0x80E3, "isdualwielding" }, - { 0x80E4, "isreloading" }, - { 0x80E5, "isswitchingweapon" }, - { 0x80E6, "setorigin" }, - { 0x80E7, "getvelocity" }, - { 0x80E8, "setplayerangles" }, - { 0x80E9, "getplayerangles" }, - { 0x80EA, "usebuttonpressed" }, - { 0x80EB, "attackbuttonpressed" }, - { 0x80EC, "adsbuttonpressed" }, - { 0x80ED, "meleebuttonpressed" }, - { 0x80EE, "playerads" }, - { 0x80EF, "isonground" }, - { 0x80F0, "isusingturret" }, - { 0x80F1, "setviewmodel" }, - { 0x80F2, "setoffhandprimaryclass" }, - { 0x80F3, "getoffhandprimaryclass" }, - { 0x80F4, "setoffhandsecondaryclass" }, - { 0x80F5, "getoffhandsecondaryclass" }, - { 0x80F6, "beginlocationselection" }, - { 0x80F7, "endlocationselection" }, - { 0x80F8, "disableweapons" }, - { 0x80F9, "enableweapons" }, - { 0x80FA, "disableoffhandweapons" }, - { 0x80FB, "enableoffhandweapons" }, - { 0x80FC, "disableweaponswitch" }, - { 0x80FD, "enableweaponswitch" }, - { 0x80FE, "openpopupmenu" }, - { 0x80FF, "openpopupmenunomouse" }, - { 0x8100, "closepopupmenu" }, - { 0x8101, "openmenu" }, - { 0x8102, "closemenu" }, - { 0x8103, "savematchrulestohistory" }, - { 0x8104, "freezecontrols" }, - { 0x8105, "disableusability" }, - { 0x8106, "enableusability" }, - { 0x8107, "setwhizbyspreads" }, - { 0x8108, "setwhizbyradii" }, - { 0x8109, "setreverb" }, - { 0x810A, "deactivatereverb" }, - { 0x810B, "setvolmod" }, - { 0x810C, "setchannelvolume" }, - { 0x810D, "setchannelvolumes" }, - { 0x810E, "deactivatechannelvolumes" }, - { 0x810F, "playlocalsound" }, - { 0x8110, "stoplocalsound" }, - { 0x8111, "setweaponammoclip" }, - { 0x8112, "setweaponammostock" }, - { 0x8113, "getweaponammoclip" }, - { 0x8114, "getweaponammostock" }, - { 0x8115, "anyammoforweaponmodes" }, - { 0x8116, "setclientdvar" }, - { 0x8117, "setclientdvars" }, - { 0x8118, "allowads" }, - { 0x8119, "allowjump" }, - { 0x811A, "allowsprint" }, - { 0x811B, "setspreadoverride" }, - { 0x811C, "resetspreadoverride" }, - { 0x811D, "setaimspreadmovementscale" }, - { 0x811E, "setactionslot" }, - { 0x811F, "setviewkickscale" }, - { 0x8120, "getviewkickscale" }, - { 0x8121, "getweaponslistall" }, - { 0x8122, "getweaponslistprimaries" }, - { 0x8123, "getweaponslistoffhands" }, - { 0x8124, "getweaponslistitems" }, - { 0x8125, "getweaponslistexclusives" }, - { 0x8126, "getweaponslist" }, - { 0x8127, "canplayerplacesentry" }, - { 0x8128, "canplayerplacetank" }, - { 0x8129, "visionsetnakedforplayer" }, - { 0x812A, "visionsetnightforplayer" }, - { 0x812B, "visionsetmissilecamforplayer" }, - { 0x812C, "visionsetthermalforplayer" }, - { 0x812D, "visionsetpainforplayer" }, - { 0x812E, "setblurforplayer" }, - { 0x812F, "getplayerweaponmodel" }, - { 0x8130, "getplayerknifemodel" }, - { 0x8131, "updateplayermodelwithweapons" }, - { 0x8132, "notifyonplayercommand" }, - { 0x8133, "canmantle" }, - { 0x8134, "forcemantle" }, - { 0x8135, "ismantling" }, - { 0x8136, "playfx" }, - { 0x8137, "player_recoilscaleon" }, - { 0x8138, "player_recoilscaleoff" }, - { 0x8139, "weaponlockstart" }, - { 0x813A, "weaponlockfinalize" }, - { 0x813B, "weaponlockfree" }, - { 0x813C, "weaponlocktargettooclose" }, - { 0x813D, "weaponlocknoclearance" }, - { 0x813E, "visionsyncwithplayer" }, - { 0x813F, "showhudsplash" }, - { 0x8140, "setperk" }, - { 0x8141, "hasperk" }, - { 0x8142, "clearperks" }, - { 0x8143, "unsetperk" }, - { 0x8144, "noclip" }, - { 0x8145, "ufo" }, - { 0x8146, "moveto" }, - { 0x8147, "movex" }, - { 0x8148, "movey" }, - { 0x8149, "movez" }, - { 0x814A, "movegravity" }, - { 0x814B, "moveslide" }, - { 0x814C, "stopmoveslide" }, - { 0x814D, "rotateto" }, - { 0x814E, "rotatepitch" }, - { 0x814F, "rotateyaw" }, - { 0x8150, "rotateroll" }, - { 0x8151, "addpitch" }, - { 0x8152, "addyaw" }, - { 0x8153, "addroll" }, - { 0x8154, "vibrate" }, - { 0x8155, "rotatevelocity" }, - { 0x8156, "solid" }, - { 0x8157, "notsolid" }, - { 0x8158, "setcandamage" }, - { 0x8159, "setcanradiusdamage" }, - { 0x815A, "physicslaunchclient" }, - { 0x815B, "physicslaunchserver" }, - { 0x815C, "physicslaunchserveritem" }, - { 0x815D, "clonebrushmodeltoscriptmodel" }, - { 0x815E, "scriptmodelplayanim" }, - { 0x815F, "scriptmodelclearanim" }, - { 0x8160, "vehicle_teleport" }, - { 0x8161, "attachpath" }, - { 0x8162, "getattachpos" }, - { 0x8163, "startpath" }, - { 0x8164, "setswitchnode" }, - { 0x8165, "setwaitspeed" }, - { 0x8166, "vehicle_finishdamage" }, - { 0x8167, "vehicle_setspeed" }, - { 0x8168, "vehicle_setspeedimmediate" }, - { 0x8169, "vehicle_rotateyaw" }, - { 0x816A, "vehicle_getspeed" }, - { 0x816B, "vehicle_getvelocity" }, - { 0x816C, "vehicle_getbodyvelocity" }, - { 0x816D, "vehicle_getsteering" }, - { 0x816E, "vehicle_getthrottle" }, - { 0x816F, "vehicle_turnengineoff" }, - { 0x8170, "vehicle_turnengineon" }, - { 0x8171, "getgoalspeedmph" }, - { 0x8172, "setacceleration" }, - { 0x8173, "setdeceleration" }, - { 0x8174, "resumespeed" }, - { 0x8175, "setyawspeed" }, - { 0x8176, "setyawspeedbyname" }, - { 0x8177, "setmaxpitchroll" }, - { 0x8178, "setairresistance" }, - { 0x8179, "setturningability" }, - { 0x817A, "setjitterparams" }, - { 0x817B, "sethoverparams" }, - { 0x817C, "joltbody" }, - { 0x817D, "freevehicle" }, - { 0x817E, "getwheelsurface" }, - { 0x817F, "getvehicleowner" }, - { 0x8180, "setvehiclelookattext" }, - { 0x8181, "setvehicleteam" }, - { 0x8182, "setneargoalnotifydist" }, - { 0x8183, "setvehgoalpos" }, - { 0x8184, "setgoalyaw" }, - { 0x8185, "cleargoalyaw" }, - { 0x8186, "settargetyaw" }, - { 0x8187, "cleartargetyaw" }, - { 0x8188, "vehicle_helisetai" }, - { 0x8189, "setturrettargetvec" }, - { 0x818A, "setturrettargetent" }, - { 0x818B, "clearturrettarget" }, - { 0x818C, "vehicle_canturrettargetpoint" }, - { 0x818D, "setlookatent" }, - { 0x818E, "clearlookatent" }, - { 0x818F, "setvehweapon" }, - { 0x8190, "fireweapon" }, - { 0x8191, "vehicleturretcontrolon" }, - { 0x8192, "vehicleturretcontroloff" }, - { 0x8193, "isturretready" }, - { 0x8194, "vehicledriveto" }, - { 0x8195, "vehicle_dospawn" }, - { 0x8196, "vehicle_isphysveh" }, - { 0x8197, "vehphys_crash" }, - { 0x8198, "vehphys_launch" }, - { 0x8199, "vehphys_disablecrashing" }, - { 0x819A, "vehphys_enablecrashing" }, - { 0x819B, "vehphys_setspeed" }, - { 0x819C, "vehphys_setconveyorbelt" }, - { 0x819D, "freehelicopter" }, - { 0x819E, "playerlinkedturretanglesenable" }, - { 0x819F, "playerlinkedturretanglesdisable" }, - { 0x81A0, "playersetstreamorigin" }, - { 0x81A1, "playerclearstreamorigin" }, - { 0x81A2, "nightvisionviewon" }, - { 0x81A3, "nightvisionviewoff" }, - { 0x81A4, "painvisionon" }, - { 0x81A5, "painvisionoff" }, - { 0x81A6, "getplayerintelisfound" }, - { 0x81A7, "setplayerintelfound" }, - { 0x81A8, "newpip" }, - { 0x81A9, "sethuddynlight" }, - { 0x81AA, "startscriptedanim" }, - { 0x81AB, "startcoverbehavior" }, - { 0x81AC, "startcoverarrival" }, - { 0x81AD, "starttraversearrival" }, - { 0x81AE, "checkcoverexitposwithpath" }, - { 0x81AF, "shoot" }, - { 0x81B0, "shootblank" }, - { 0x81B1, "melee" }, - { 0x81B2, "updateplayersightaccuracy" }, - { 0x81B3, "findshufflecovernode" }, - { 0x81B4, "findnearbycovernode" }, - { 0x81B5, "findcovernode" }, - { 0x81B6, "findbestcovernode" }, - { 0x81B7, "getcovernode" }, - { 0x81B8, "usecovernode" }, - { 0x81B9, "iscovervalidagainstenemy" }, - { 0x81BA, "reacquirestep" }, - { 0x81BB, "findreacquiredirectpath" }, - { 0x81BC, "trimpathtoattack" }, - { 0x81BD, "reacquiremove" }, - { 0x81BE, "findreacquireproximatepath" }, - { 0x81BF, "flagenemyunattackable" }, - { 0x81C0, "enterprone" }, - { 0x81C1, "exitprone" }, - { 0x81C2, "setproneanimnodes" }, - { 0x81C3, "updateprone" }, - { 0x81C4, "clearpitchorient" }, - { 0x81C5, "setlookatanimnodes" }, - { 0x81C6, "setlookat" }, - { 0x81C7, "setlookatentity" }, - { 0x81C8, "setlookatyawlimits" }, - { 0x81C9, "stoplookat" }, - { 0x81CA, "getmuzzlepos" }, - { 0x81CB, "getmuzzleangle" }, - { 0x81CC, "getmuzzlesideoffsetpos" }, - { 0x81CD, "getaimangle" }, - { 0x81CE, "canshoot" }, - { 0x81CF, "canshootenemy" }, - { 0x81D0, "cansee" }, - { 0x81D1, "seerecently" }, - { 0x81D2, "lastknowntime" }, - { 0x81D3, "lastknownpos" }, - { 0x81D4, "dropweapon" }, - { 0x81D5, "maymovetopoint" }, - { 0x81D6, "maymovefrompointtopoint" }, - { 0x81D7, "teleport" }, - { 0x81D8, "forceteleport" }, - { 0x81D9, "safeteleport" }, - { 0x81DA, "withinapproxpathdist" }, - { 0x81DB, "ispathdirect" }, - { 0x81DC, "allowedstances" }, - { 0x81DD, "isstanceallowed" }, - { 0x81DE, "issuppressionwaiting" }, - { 0x81DF, "issuppressed" }, - { 0x81E0, "ismovesuppressed" }, - { 0x81E1, "isgrenadepossafe" }, - { 0x81E2, "checkgrenadethrow" }, - { 0x81E3, "checkgrenadelaunch" }, - { 0x81E4, "checkgrenadelaunchpos" }, - { 0x81E5, "throwgrenade" }, - { 0x81E6, "pickupgrenade" }, - { 0x81E7, "useturret" }, - { 0x81E8, "stopuseturret" }, - { 0x81E9, "canuseturret" }, - { 0x81EA, "traversemode" }, - { 0x81EB, "animmode" }, - { 0x81EC, "orientmode" }, - { 0x81ED, "getmotionangle" }, - { 0x81EE, "shouldfacemotion" }, - { 0x81EF, "getanglestolikelyenemypath" }, - { 0x81F0, "setturretanim" }, - { 0x81F1, "getturret" }, - { 0x81F2, "getgroundenttype" }, - { 0x81F3, "animcustom" }, - { 0x81F4, "isinscriptedstate" }, - { 0x81F5, "canattackenemynode" }, - { 0x81F6, "getnegotiationstartnode" }, - { 0x81F7, "getnegotiationendnode" }, - { 0x81F8, "getdoorpathnode" }, - { 0x81F9, "comparenodedirtopathdir" }, - { 0x81FA, "checkprone" }, - { 0x81FB, "pushplayer" }, - { 0x81FC, "checkgrenadethrowpos" }, - { 0x81FD, "setgoalnode" }, - { 0x81FE, "setgoalpos" }, - { 0x81FF, "setgoalentity" }, - { 0x8200, "setgoalvolume" }, - { 0x8201, "setgoalvolumeauto" }, - { 0x8202, "getgoalvolume" }, - { 0x8203, "cleargoalvolume" }, - { 0x8204, "setfixednodesafevolume" }, - { 0x8205, "getfixednodesafevolume" }, - { 0x8206, "clearfixednodesafevolume" }, - { 0x8207, "isingoal" }, - { 0x8208, "setruntopos" }, - { 0x8209, "nearnode" }, - { 0x820A, "nearclaimnode" }, - { 0x820B, "nearclaimnodeandangle" }, - { 0x820C, "atdangerousnode" }, - { 0x820D, "getenemyinfo" }, - { 0x820E, "clearenemy" }, - { 0x820F, "setentitytarget" }, - { 0x8210, "clearentitytarget" }, - { 0x8211, "setpotentialthreat" }, - { 0x8212, "clearpotentialthreat" }, - { 0x8213, "setflashbanged" }, - { 0x8214, "setengagementmindist" }, - { 0x8215, "setengagementmaxdist" }, - { 0x8216, "isknownenemyinradius" }, - { 0x8217, "isknownenemyinvolume" }, - { 0x8218, "settalktospecies" }, - { 0x8219, "laseralton" }, - { 0x821A, "laseraltoff" }, - { 0x821B, "invisiblenotsolid" }, - { 0x821C, "visiblesolid" }, - { 0x821D, "setdefaultaimlimits" }, - { 0x821E, "initriotshieldhealth" }, - { 0x821F, "getenemysqdist" }, - { 0x8220, "getclosestenemysqdist" }, - { 0x8221, "setthreatbiasgroup" }, - { 0x8222, "getthreatbiasgroup" }, - { 0x8223, "makeentitysentient" }, - { 0x8224, "freeentitysentient" }, - { 0x8225, "isindoor" }, - { 0x8226, "getdroptofloorposition" }, - { 0x8227, "isbadguy" }, - { 0x8228, "animscripted" }, - { 0x8229, "animscriptedthirdperson" }, - { 0x822A, "animrelative" }, - { 0x822B, "stopanimscripted" }, - { 0x822C, "clearanim" }, - { 0x822D, "setanimknob" }, - { 0x822E, "setanimknoblimited" }, - { 0x822F, "setanimknobrestart" }, - { 0x8230, "setanimknoblimitedrestart" }, - { 0x8231, "setanimknoball" }, - { 0x8232, "setanimknoballlimited" }, - { 0x8233, "setanimknoballrestart" }, - { 0x8234, "setanimknoballlimitedrestart" }, - { 0x8235, "setanim" }, - { 0x8236, "setanimlimited" }, - { 0x8237, "setanimrestart" }, - { 0x8238, "setanimlimitedrestart" }, - { 0x8239, "getanimtime" }, - { 0x823A, "getanimweight" }, - { 0x823B, "getanimassettype" }, - { 0x823C, "setflaggedanimknob" }, - { 0x823D, "setflaggedanimknoblimited" }, - { 0x823E, "setflaggedanimknobrestart" }, - { 0x823F, "setflaggedanimknoblimitedrestart" }, - { 0x8240, "setflaggedanimknoball" }, - { 0x8241, "setflaggedanimknoballrestart" }, - { 0x8242, "setflaggedanim" }, - { 0x8243, "setflaggedanimlimited" }, - { 0x8244, "setflaggedanimrestart" }, - { 0x8245, "setflaggedanimlimitedrestart" }, - { 0x8246, "useanimtree" }, - { 0x8247, "stopuseanimtree" }, - { 0x8248, "setanimtime" }, - { 0x8249, "showviewmodel" }, - { 0x824A, "hideviewmodel" }, - { 0x824B, "allowstand" }, - { 0x824C, "allowcrouch" }, - { 0x824D, "allowprone" }, - { 0x824E, "allowlean" }, - { 0x824F, "setocclusion" }, - { 0x8250, "deactivateocclusion" }, - { 0x8251, "isocclusionenabled" }, - { 0x8252, "iseqenabled" }, - { 0x8253, "seteq" }, - { 0x8254, "seteqbands" }, - { 0x8255, "deactivateeq" }, - { 0x8256, "seteqlerp" }, - { 0x8257, "islookingat" }, - { 0x8258, "isthrowinggrenade" }, - { 0x8259, "isfiring" }, - { 0x825A, "ismeleeing" }, - { 0x825B, "setautopickup" }, - { 0x825C, "allowmelee" }, - { 0x825D, "allowfire" }, - { 0x825E, "enablehealthshield" }, - { 0x825F, "enabledeathshield" }, - { 0x8260, "nightvisiongogglesforceon" }, - { 0x8261, "nightvisiongogglesforceoff" }, - { 0x8262, "enableinvulnerability" }, - { 0x8263, "disableinvulnerability" }, - { 0x8264, "enablebreaching" }, - { 0x8265, "disablebreaching" }, - { 0x8266, "forceviewmodelanimation" }, - { 0x8267, "disableturretdismount" }, - { 0x8268, "enableturretdismount" }, - { 0x8269, "uploadscore" }, - { 0x826A, "uploadtime" }, - { 0x826B, "uploadleaderboards" }, - { 0x826C, "giveachievement" }, - { 0x826D, "hidehud" }, - { 0x826E, "showhud" }, - { 0x826F, "mountvehicle" }, - { 0x8270, "dismountvehicle" }, - { 0x8271, "enableslowaim" }, - { 0x8272, "disableslowaim" }, - { 0x8273, "usehintsinvehicle" }, - { 0x8274, "vehicleattackbuttonpressed" }, - { 0x8275, "setwhizbyoffset" }, - { 0x8276, "setwhizbyprobabilities" }, - { 0x8277, "visionsetnakedforplayer_lerp" }, - { 0x8278, "setwaitnode" }, - { 0x8279, "returnplayercontrol" }, - { 0x827A, "vehphys_starttrack" }, - { 0x827B, "vehphys_clearautodisable" }, - { 0x827C, "vehicleusealtblendedaudio" }, - { 0x827D, "settext" }, - { 0x827E, "clearalltextafterhudelem" }, - { 0x827F, "setshader" }, - { 0x8280, "settargetent" }, - { 0x8281, "cleartargetent" }, - { 0x8282, "settimer" }, - { 0x8283, "settimerup" }, - { 0x8284, "settimerstatic" }, - { 0x8285, "settenthstimer" }, - { 0x8286, "settenthstimerup" }, - { 0x8287, "settenthstimerstatic" }, - { 0x8288, "setclock" }, - { 0x8289, "setclockup" }, - { 0x828A, "setvalue" }, - { 0x828B, "setwaypoint" }, - { 0x828C, "setwaypointedgestyle_rotatingicon" }, - { 0x828D, "setwaypointedgestyle_secondaryarrow" }, - { 0x828E, "setwaypointiconoffscreenonly" }, - { 0x828F, "fadeovertime" }, - { 0x8290, "scaleovertime" }, - { 0x8291, "moveovertime" }, - { 0x8292, "reset" }, - { 0x8293, "destroy" }, - { 0x8294, "setpulsefx" }, - { 0x8295, "setplayernamestring" }, - { 0x8296, "changefontscaleovertime" }, - { 0x8297, "startignoringspotlight" }, - { 0x8298, "stopignoringspotlight" }, - { 0x8299, "dontcastshadows" }, - { 0x829A, "castshadows" }, - { 0x829B, "setstablemissile" }, - { 0x829C, "playersetgroundreferenceent" }, - { 0x829D, "dontinterpolate" }, - { 0x829E, "dospawn" }, - { 0x829F, "stalingradspawn" }, - { 0x82A0, "getorigin" }, - { 0x82A1, "getcentroid" }, - { 0x82A2, "getshootatpos" }, - { 0x82A3, "getdebugeye" }, - { 0x82A4, "useby" }, - { 0x82A5, "playsound" }, - { 0x82A6, "playsoundatviewheight" }, - { 0x82A7, "prefetchsound" }, - { 0x82A8, "setpitch" }, - { 0x82A9, "scalepitch" }, - { 0x82AA, "setvolume" }, - { 0x82AB, "scalevolume" }, - { 0x82AC, "setspeakermapmonotostereo" }, - { 0x82AD, "setspeakermapmonoto51" }, - { 0x82AE, "setdistributed2dsound" }, - { 0x82AF, "playsoundasmaster" }, - { 0x82B0, "playloopsound" }, - { 0x82B1, "eqon" }, - { 0x82B2, "eqoff" }, - { 0x82B3, "haseq" }, - { 0x82B4, "iswaitingonsound" }, - { 0x82B5, "getnormalhealth" }, - { 0x82B6, "setnormalhealth" }, - { 0x82B7, "dodamage" }, - { 0x82B8, "kill" }, - { 0x82B9, "show" }, - { 0x82BA, "hide" }, - { 0x82BB, "showonclient" }, - { 0x82BC, "hideonclient" }, - { 0x82BD, "laserforceon" }, - { 0x82BE, "laserforceoff" }, - { 0x82BF, "disconnectpaths" }, - { 0x82C0, "connectpaths" }, - { 0x82C1, "startusingheroonlylighting" }, - { 0x82C2, "stopusingheroonlylighting" }, - { 0x82C3, "startusinglessfrequentlighting" }, - { 0x82C4, "stopusinglessfrequentlighting" }, - { 0x82C5, "setthermalfog" }, - { 0x82C6, "setnightvisionfog" }, - { 0x82C7, "clearthermalfog" }, - { 0x82C8, "clearnightvisionfog" }, - { 0x82C9, "digitaldistortsetparams" }, - { 0x82CA, "setmode" }, - { 0x82CB, "getmode" }, - { 0x82CC, "setturretignoregoals" }, - { 0x82CD, "setturretcanaidetach" }, - { 0x82CE, "setturretfov" }, - { 0x82CF, "lerpfov" }, - { 0x82D0, "getvalidcoverpeekouts" }, - { 0x82D1, "gethighestnodestance" }, - { 0x82D2, "doesnodeallowstance" }, - { 0x82D3, "getgunangles" }, - { 0x82D4, "magicgrenade" }, - { 0x82D5, "magicgrenademanual" }, - { 0x82D6, "setfriendlychain" }, - { 0x82D7, "getentnum" }, - { 0x82D8, "launch" }, - { 0x82D9, "setsoundblend" }, - { 0x82DA, "makefakeai" }, - { 0x82DB, "spawndrone" }, - { 0x82DC, "setcorpseremovetimer" }, - { 0x82DD, "setlookattext" }, - { 0x82DE, "setspawnerteam" }, - { 0x82DF, "addaieventlistener" }, - { 0x82E0, "removeaieventlistener" }, - { 0x82E1, "getlightcolor" }, - { 0x82E2, "setlightcolor" }, - { 0x82E3, "getlightradius" }, - { 0x82E4, "setlightradius" }, - { 0x82E5, "getlightfovinner" }, - { 0x82E6, "getlightfovouter" }, - { 0x82E7, "setlightfovrange" }, - { 0x82E8, "getlightexponent" }, - { 0x82E9, "setlightexponent" }, - { 0x82EA, "startragdoll" }, - { 0x82EB, "startragdollfromimpact" }, - { 0x82EC, "logstring" }, - { 0x82ED, "laserhidefromclient" }, - { 0x82EE, "stopsoundchannel" }, - { 0x82EF, "thermaldrawenable" }, - { 0x82F0, "thermaldrawdisable" }, - { 0x82F1, "setturretdismountorg" }, - { 0x82F2, "setdamagestage" }, - { 0x82F3, "playsoundtoteam" }, - { 0x82F4, "playsoundtoplayer" }, - { 0x82F5, "playerhide" }, - { 0x82F6, "showtoplayer" }, - { 0x82F7, "enableplayeruse" }, - { 0x82F8, "disableplayeruse" }, - { 0x82F9, "makescrambler" }, - { 0x82FA, "makeportableradar" }, - { 0x82FB, "maketrophysystem" }, - { 0x82FC, "placespawnpoint" }, - { 0x82FD, "setteamfortrigger" }, - { 0x82FE, "clientclaimtrigger" }, - { 0x82FF, "clientreleasetrigger" }, - { 0x8300, "releaseclaimedtrigger" }, - { 0x8301, "isusingonlinedataoffline" }, - { 0x8302, "getrestedtime" }, - { 0x8303, "sendleaderboards" }, - { 0x8304, "isonladder" }, - { 0x8305, "getcorpseanim" }, - { 0x8306, "playerforcedeathanim" }, - { 0x8307, "startac130" }, - { 0x8308, "stopac130" }, -/* - { 0x8309, "enablemousesteer" }, - { 0x830A, "setscriptmoverkillcam" }, - { 0x830B, "setmapnamestring" }, - { 0x830C, "setgametypestring" }, -*/ -}}; - -const std::array, 14221> token_list +extern std::array, token_count> const token_list {{ { 0x0000, "" }, { 0x0001, "pl#" }, @@ -35086,53 +33373,4 @@ const std::array, 14221> token_list // { 0x8250, "" }, }}; -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()); - function_map.reserve(function_list.size()); - function_map_rev.reserve(function_list.size()); - method_map.reserve(method_list.size()); - method_map_rev.reserve(method_list.size()); - token_map.reserve(token_list.size()); - token_map_rev.reserve(token_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 : function_list) - { - function_map.insert({ entry.first, entry.second }); - function_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : method_list) - { - method_map.insert({ entry.first, entry.second }); - method_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : token_list) - { - token_map.insert({ entry.first, entry.second }); - token_map_rev.insert({ utils::string::to_lower(entry.second), entry.first }); - } - } -}; - -__init__ _; - -} // namespace xsk::gsc::iw5c - -#ifdef _MSC_VER -#pragma warning(pop) -#endif +} // namespace xsk::gsc::iw5_ps diff --git a/src/iw5/iw5_xb.cpp b/src/iw5/iw5_xb.cpp new file mode 100644 index 00000000..db71a5f7 --- /dev/null +++ b/src/iw5/iw5_xb.cpp @@ -0,0 +1,52 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_xb.hpp" + +namespace xsk::gsc::iw5_xb +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::none, engine::iw5, endian::big, system::xb2, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::iw5_xb diff --git a/src/iw5/iw5_xb.hpp b/src/iw5/iw5_xb.hpp new file mode 100644 index 00000000..48eb1077 --- /dev/null +++ b/src/iw5/iw5_xb.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::iw5_xb +{ +// IW5 XB 1.8.388110 +constexpr usize code_count = 153; +constexpr usize func_count = 455; +constexpr usize meth_count = 779; +constexpr usize token_count = 14221; +constexpr u32 max_string_id = 33386; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::iw5_xb diff --git a/src/iw5/iw5_xb_code.cpp b/src/iw5/iw5_xb_code.cpp new file mode 100644 index 00000000..8e2d44bc --- /dev/null +++ b/src/iw5/iw5_xb_code.cpp @@ -0,0 +1,168 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_xb.hpp" + +namespace xsk::gsc::iw5_xb +{ + +extern std::array, code_count> const code_list +{{ + { 0x00, opcode::OP_End }, + { 0x01, opcode::OP_Return }, + { 0x02, opcode::OP_GetUndefined }, + { 0x03, opcode::OP_GetZero }, + { 0x04, opcode::OP_GetByte }, + { 0x05, opcode::OP_GetAnimTree }, + { 0x06, opcode::OP_GetNegByte }, + { 0x07, opcode::OP_GetUnsignedShort }, + { 0x08, opcode::OP_GetNegUnsignedShort }, + { 0x09, opcode::OP_GetInteger }, + { 0x0A, opcode::OP_GetBuiltinFunction }, + { 0x0B, opcode::OP_GetBuiltinMethod }, + { 0x0C, opcode::OP_GetFloat }, + { 0x0D, opcode::OP_GetString }, + { 0x0E, opcode::OP_GetIString }, + { 0x0F, opcode::OP_GetVector }, + { 0x10, opcode::OP_GetLevelObject }, + { 0x11, opcode::OP_GetAnimObject }, + { 0x12, opcode::OP_GetSelf }, + { 0x13, opcode::OP_GetThisthread }, + { 0x14, opcode::OP_GetLevel }, + { 0x15, opcode::OP_GetGame }, + { 0x16, opcode::OP_GetAnim }, + { 0x17, opcode::OP_GetAnimation }, + { 0x18, opcode::OP_GetGameRef }, + { 0x1A, opcode::OP_GetLocalFunction }, + { 0x19, opcode::OP_GetFarFunction }, + { 0x1B, opcode::OP_CreateLocalVariable }, + { 0x1C, opcode::OP_RemoveLocalVariables }, + { 0x1D, opcode::OP_EvalLocalVariableCached0 }, + { 0x1E, opcode::OP_EvalLocalVariableCached1 }, + { 0x1F, opcode::OP_EvalLocalVariableCached2 }, + { 0x20, opcode::OP_EvalLocalVariableCached3 }, + { 0x21, opcode::OP_EvalLocalVariableCached4 }, + { 0x22, opcode::OP_EvalLocalVariableCached5 }, + { 0x23, opcode::OP_EvalLocalVariableCached }, + { 0x24, opcode::OP_EvalLocalArrayCached }, + { 0x25, opcode::OP_EvalArray }, + { 0x26, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x27, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x28, opcode::OP_EvalLocalArrayRefCached }, + { 0x29, opcode::OP_EvalArrayRef }, + { 0x2A, opcode::OP_ClearArray }, + { 0x2B, opcode::OP_EmptyArray }, + { 0x2C, opcode::OP_AddArray }, + { 0x2D, opcode::OP_GetSelfObject }, + { 0x2E, opcode::OP_EvalLevelFieldVariable }, + { 0x2F, opcode::OP_EvalAnimFieldVariable }, + { 0x30, opcode::OP_EvalSelfFieldVariable }, + { 0x31, opcode::OP_EvalFieldVariable }, + { 0x32, opcode::OP_EvalLevelFieldVariableRef }, + { 0x33, opcode::OP_EvalAnimFieldVariableRef }, + { 0x34, opcode::OP_EvalSelfFieldVariableRef }, + { 0x35, opcode::OP_EvalFieldVariableRef }, + { 0x36, opcode::OP_ClearFieldVariable }, + { 0x37, opcode::OP_SafeCreateVariableFieldCached }, + { 0x38, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x39, opcode::OP_SafeSetVariableFieldCached }, + { 0x3A, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3B, opcode::OP_clearparams }, + { 0x3C, opcode::OP_checkclearparams }, + { 0x3D, opcode::OP_EvalLocalVariableRefCached0 }, + { 0x3E, opcode::OP_EvalNewLocalVariableRefCached0 }, + { 0x3F, opcode::OP_EvalLocalVariableRefCached }, + { 0x40, opcode::OP_SetLevelFieldVariableField }, + { 0x41, opcode::OP_SetVariableField }, + { 0x42, opcode::OP_ClearVariableField }, + { 0x43, opcode::OP_SetAnimFieldVariableField }, + { 0x44, opcode::OP_SetSelfFieldVariableField }, + { 0x45, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x46, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x47, opcode::OP_SetLocalVariableFieldCached }, + { 0x48, opcode::OP_ClearLocalVariableFieldCached }, + { 0x49, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x4A, opcode::OP_CallBuiltin0 }, + { 0x4B, opcode::OP_CallBuiltin1 }, + { 0x4C, opcode::OP_CallBuiltin2 }, + { 0x4D, opcode::OP_CallBuiltin3 }, + { 0x4E, opcode::OP_CallBuiltin4 }, + { 0x4F, opcode::OP_CallBuiltin5 }, + { 0x50, opcode::OP_CallBuiltin }, + { 0x51, opcode::OP_CallBuiltinMethod0 }, + { 0x52, opcode::OP_CallBuiltinMethod1 }, + { 0x53, opcode::OP_CallBuiltinMethod2 }, + { 0x54, opcode::OP_CallBuiltinMethod3 }, + { 0x55, opcode::OP_CallBuiltinMethod4 }, + { 0x56, opcode::OP_CallBuiltinMethod5 }, + { 0x57, opcode::OP_CallBuiltinMethod }, + { 0x58, opcode::OP_wait }, + { 0x59, opcode::OP_waittillFrameEnd }, + { 0x5A, opcode::OP_PreScriptCall }, + { 0x5B, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x5C, opcode::OP_ScriptLocalFunctionCall }, + { 0x5D, opcode::OP_ScriptLocalMethodCall }, + { 0x5E, opcode::OP_ScriptLocalThreadCall }, + { 0x5F, opcode::OP_ScriptLocalChildThreadCall }, + { 0x60, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x61, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x62, opcode::OP_ScriptFarFunctionCall2 }, + { 0x63, opcode::OP_ScriptFarFunctionCall }, + { 0x64, opcode::OP_ScriptFarMethodCall }, + { 0x65, opcode::OP_ScriptFarThreadCall }, + { 0x66, opcode::OP_ScriptFarChildThreadCall }, + { 0x67, opcode::OP_ScriptFarMethodThreadCall }, + { 0x68, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x69, opcode::OP_ScriptFunctionCallPointer }, + { 0x6A, opcode::OP_ScriptMethodCallPointer }, + { 0x6B, opcode::OP_ScriptThreadCallPointer }, + { 0x6C, opcode::OP_ScriptChildThreadCallPointer }, + { 0x6D, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x6E, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x6F, opcode::OP_CallBuiltinPointer }, + { 0x70, opcode::OP_CallBuiltinMethodPointer }, + { 0x71, opcode::OP_DecTop }, + { 0x72, opcode::OP_CastFieldObject }, + { 0x73, opcode::OP_EvalLocalVariableObjectCached }, + { 0x74, opcode::OP_CastBool }, + { 0x75, opcode::OP_BoolNot }, + { 0x76, opcode::OP_BoolComplement }, + { 0x77, opcode::OP_JumpOnFalse }, + { 0x78, opcode::OP_JumpOnTrue }, + { 0x79, opcode::OP_JumpOnFalseExpr }, + { 0x7A, opcode::OP_JumpOnTrueExpr }, + { 0x7B, opcode::OP_jump }, + { 0x7C, opcode::OP_jumpback }, + { 0x7D, opcode::OP_inc }, + { 0x7E, opcode::OP_dec }, + { 0x7F, opcode::OP_bit_or }, + { 0x80, opcode::OP_bit_ex_or }, + { 0x81, opcode::OP_bit_and }, + { 0x82, opcode::OP_equality }, + { 0x83, opcode::OP_inequality }, + { 0x84, opcode::OP_less }, + { 0x85, opcode::OP_greater }, + { 0x86, opcode::OP_less_equal }, + { 0x87, opcode::OP_greater_equal }, + { 0x88, opcode::OP_shift_left }, + { 0x89, opcode::OP_shift_right }, + { 0x8A, opcode::OP_plus }, + { 0x8B, opcode::OP_minus }, + { 0x8C, opcode::OP_multiply }, + { 0x8D, opcode::OP_divide }, + { 0x8E, opcode::OP_mod }, + { 0x8F, opcode::OP_size }, + { 0x90, opcode::OP_waittillmatch }, + { 0x91, opcode::OP_waittillmatch2 }, + { 0x92, opcode::OP_waittill }, + { 0x93, opcode::OP_notify }, + { 0x94, opcode::OP_endon }, + { 0x95, opcode::OP_voidCodepos }, + { 0x96, opcode::OP_switch }, + { 0x97, opcode::OP_endswitch }, + { 0x98, opcode::OP_vector }, +}}; + +} // namespace xsk::gsc::iw5_xb diff --git a/src/iw5/iw5_xb_func.cpp b/src/iw5/iw5_xb_func.cpp new file mode 100644 index 00000000..0557d070 --- /dev/null +++ b/src/iw5/iw5_xb_func.cpp @@ -0,0 +1,470 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_xb.hpp" + +namespace xsk::gsc::iw5_xb +{ + +extern std::array, func_count> const func_list +{{ + { 0x001, "createprintchannel" }, + { 0x002, "setprintchannel" }, + { 0x003, "print" }, + { 0x004, "println" }, + { 0x005, "print3d" }, + { 0x006, "line" }, + { 0x007, "precacheturret" }, + { 0x008, "getweaponarray" }, + { 0x009, "spawnturret" }, + { 0x00A, "canspawnturret" }, + { 0x00B, "assert" }, + { 0x00C, "assertex" }, + { 0x00D, "assertmsg" }, + { 0x00E, "isdefined" }, + { 0x00F, "isstring" }, + { 0x010, "setdvar" }, + { 0x011, "setdynamicdvar" }, + { 0x012, "setdvarifuninitialized" }, + { 0x013, "setdevdvar" }, + { 0x014, "setdevdvarifuninitialized" }, + { 0x015, "getdvar" }, + { 0x016, "getdvarint" }, + { 0x017, "getdvarfloat" }, + { 0x018, "getdvarvector" }, + { 0x019, "gettime" }, + { 0x01A, "getentbynum" }, + { 0x01B, "getweaponmodel" }, + { 0x01C, "getweaponhidetags" }, + { 0x01D, "getanimlength" }, + { 0x01E, "animhasnotetrack" }, + { 0x01F, "getnotetracktimes" }, + { 0x020, "spawn" }, + { 0x021, "spawnloopsound" }, + { 0x022, "spawnloopingsound" }, + { 0x023, "bullettrace" }, + { 0x024, "bullettracepassed" }, + { 0x025, "sighttracepassed" }, + { 0x026, "physicstrace" }, + { 0x027, "playerphysicstrace" }, + { 0x028, "getgroundposition" }, + { 0x029, "getmovedelta" }, + { 0x02A, "getangledelta" }, + { 0x02B, "getnorthyaw" }, + { 0x02C, "setnorthyaw" }, + { 0x02D, "setslowmotion" }, + { 0x02E, "randomint" }, + { 0x02F, "randomfloat" }, + { 0x030, "randomintrange" }, + { 0x031, "randomfloatrange" }, + { 0x032, "sin" }, + { 0x033, "cos" }, + { 0x034, "tan" }, + { 0x035, "asin" }, + { 0x036, "acos" }, + { 0x037, "atan" }, + { 0x038, "int" }, + { 0x039, "float" }, + { 0x03A, "abs" }, + { 0x03B, "min" }, + { 0x03C, "max" }, + { 0x03D, "floor" }, + { 0x03E, "ceil" }, + { 0x03F, "exp" }, + { 0x040, "log" }, + { 0x041, "sqrt" }, + { 0x042, "squared" }, + { 0x043, "clamp" }, + { 0x044, "angleclamp" }, + { 0x045, "angleclamp180" }, + { 0x046, "vectorfromlinetopoint" }, + { 0x047, "pointonsegmentnearesttopoint" }, + { 0x048, "distance" }, + { 0x049, "distance2d" }, + { 0x04A, "distancesquared" }, + { 0x04B, "length" }, + { 0x04C, "lengthsquared" }, + { 0x04D, "closer" }, + { 0x04E, "vectordot" }, + { 0x04F, "vectornormalize" }, + { 0x050, "vectortoangles" }, + { 0x051, "vectortoyaw" }, + { 0x052, "vectorlerp" }, + { 0x053, "anglestoup" }, + { 0x054, "anglestoright" }, + { 0x055, "anglestoforward" }, + { 0x056, "combineangles" }, + { 0x057, "transformmove" }, + { 0x058, "issubstr" }, + { 0x059, "isendstr" }, + { 0x05A, "getsubstr" }, + { 0x05B, "tolower" }, + { 0x05C, "strtok" }, + { 0x05D, "stricmp" }, + { 0x05E, "ambientplay" }, + { 0x05F, "ambientstop" }, + { 0x060, "precachemodel" }, + { 0x061, "precacheshellshock" }, + { 0x062, "precacheitem" }, + { 0x063, "precacheshader" }, + { 0x064, "precachestring" }, + { 0x065, "precachemenu" }, + { 0x066, "precacherumble" }, + { 0x067, "precachelocationselector" }, + { 0x068, "precacheleaderboards" }, + { 0x069, "loadfx" }, + { 0x06A, "playfx" }, + { 0x06B, "playfxontag" }, + { 0x06C, "stopfxontag" }, + { 0x06D, "playloopedfx" }, + { 0x06E, "spawnfx" }, + { 0x06F, "triggerfx" }, + { 0x070, "playfxontagforclients" }, + { 0x071, "physicsexplosionsphere" }, + { 0x072, "physicsexplosioncylinder" }, + { 0x073, "physicsjolt" }, + { 0x074, "physicsjitter" }, + { 0x075, "setexpfog" }, + { 0x076, "isexplosivedamagemod" }, + { 0x077, "radiusdamage" }, + { 0x078, "setplayerignoreradiusdamage" }, + { 0x079, "glassradiusdamage" }, + { 0x07A, "earthquake" }, + { 0x07B, "getnumparts" }, + { 0x07C, "getpartname" }, + { 0x07D, "weaponfiretime" }, + { 0x07E, "weaponclipsize" }, + { 0x07F, "weaponisauto" }, + { 0x080, "weaponissemiauto" }, + { 0x081, "weaponisboltaction" }, + { 0x082, "weaponinheritsperks" }, + { 0x083, "weaponburstcount" }, + { 0x084, "weapontype" }, + { 0x085, "weaponclass" }, + { 0x086, "weaponinventorytype" }, + { 0x087, "weaponstartammo" }, + { 0x088, "weaponmaxammo" }, + { 0x089, "weaponaltweaponname" }, + { 0x08A, "isweaponcliponly" }, + { 0x08B, "isweapondetonationtimed" }, + { 0x08C, "weaponhasthermalscope" }, + { 0x08D, "getvehiclenode" }, + { 0x08E, "getvehiclenodearray" }, + { 0x08F, "getallvehiclenodes" }, + { 0x090, "getnumvehicles" }, + { 0x091, "precachevehicle" }, + { 0x092, "spawnvehicle" }, + { 0x093, "vehicle_getarray" }, + { 0x094, "vehicle_getspawnerarray" }, + { 0x095, "playrumbleonposition" }, + { 0x096, "playrumblelooponposition" }, + { 0x097, "stopallrumbles" }, + { 0x098, "soundexists" }, + { 0x099, "openfile" }, + { 0x09A, "closefile" }, + { 0x09B, "fprintln" }, + { 0x09C, "fprintfields" }, + { 0x09D, "freadln" }, + { 0x09E, "fgetarg" }, + { 0x09F, "setminimap" }, + { 0x0A0, "setthermalbodymaterial" }, + { 0x0A1, "getarraykeys" }, + { 0x0A2, "getfirstarraykey" }, + { 0x0A3, "getnextarraykey" }, + { 0x0A4, "sortbydistance" }, + { 0x0A5, "tablelookup" }, + { 0x0A6, "tablelookupbyrow" }, + { 0x0A7, "tablelookupistring" }, + { 0x0A8, "tablelookupistringbyrow" }, + { 0x0A9, "tablelookuprownum" }, + { 0x0AA, "getmissileowner" }, + { 0x0AB, "magicbullet" }, + { 0x0AC, "getweaponflashtagname" }, + { 0x0AD, "averagepoint" }, + { 0x0AE, "averagenormal" }, + { 0x0AF, "getglass" }, + { 0x0B0, "getglassarray" }, + { 0x0B1, "getglassorigin" }, + { 0x0B2, "isglassdestroyed" }, + { 0x0B3, "destroyglass" }, + { 0x0B4, "deleteglass" }, + { 0x0B5, "getentchannelscount" }, + { 0x0B6, "getentchannelname" }, + { 0x0B7, "objective_add" }, + { 0x0B8, "objective_delete" }, + { 0x0B9, "objective_state" }, + { 0x0BA, "objective_icon" }, + { 0x0BB, "objective_position" }, + { 0x0BC, "objective_current" }, + { 0x0BD, "objective_onentity" }, + { 0x0BE, "objective_team" }, + { 0x0BF, "objective_player" }, + { 0x0C0, "objective_playerteam" }, + { 0x0C1, "objective_playerenemyteam" }, + { 0x0C2, "iprintln" }, + { 0x0C3, "iprintlnbold" }, + { 0x0C4, "logstring" }, + { 0x0C5, "getent" }, + { 0x0C6, "getentarray" }, + { 0x0C7, "spawnplane" }, + { 0x0C8, "spawnstruct" }, + { 0x0C9, "spawnhelicopter" }, + { 0x0CA, "isalive" }, + { 0x0CB, "isspawner" }, + { 0x0CC, "missile_createattractorent" }, + { 0x0CD, "missile_createattractororigin" }, + { 0x0CE, "missile_createrepulsorent" }, + { 0x0CF, "missile_createrepulsororigin" }, + { 0x0D0, "missile_deleteattractor" }, + { 0x0D1, "playsoundatpos" }, + { 0x0D2, "newhudelem" }, + { 0x0D3, "newclienthudelem" }, + { 0x0D4, "newteamhudelem" }, + { 0x0D5, "resettimeout" }, + { 0x0D6, "precachefxteamthermal" }, + { 0x0D7, "isplayer" }, + { 0x0D8, "isplayernumber" }, + { 0x0D9, "setwinningplayer" }, + { 0x0DA, "setwinningteam" }, + { 0x0DB, "announcement" }, + { 0x0DC, "clientannouncement" }, + { 0x0DD, "getteamscore" }, + { 0x0DE, "setteamscore" }, + { 0x0DF, "setclientnamemode" }, + { 0x0E0, "updateclientnames" }, + { 0x0E1, "getteamplayersalive" }, + { 0x0E2, "logprint" }, + { 0x0E3, "worldentnumber" }, + { 0x0E4, "obituary" }, + { 0x0E5, "positionwouldtelefrag" }, + { 0x0E6, "canspawn" }, + { 0x0E7, "getstarttime" }, + { 0x0E8, "precachestatusicon" }, + { 0x0E9, "precacheheadicon" }, + { 0x0EA, "precacheminimapicon" }, + { 0x0EB, "precachempanim" }, + { 0x0EC, "map_restart" }, + { 0x0ED, "exitlevel" }, + { 0x0EE, "addtestclient" }, + { 0x0EF, "makedvarserverinfo" }, + { 0x0F0, "setarchive" }, + { 0x0F1, "allclientsprint" }, + { 0x0F2, "clientprint" }, + { 0x0F3, "mapexists" }, + { 0x0F4, "isvalidgametype" }, + { 0x0F5, "matchend" }, + { 0x0F6, "setplayerteamrank" }, + { 0x0F7, "endparty" }, + { 0x0F8, "setteamradar" }, + { 0x0F9, "getteamradar" }, + { 0x0FA, "setteamradarstrength" }, + { 0x0FB, "getteamradarstrength" }, + { 0x0FC, "getuavstrengthmin" }, + { 0x0FD, "getuavstrengthmax" }, + { 0x0FE, "getuavstrengthlevelneutral" }, + { 0x0FF, "getuavstrengthlevelshowenemyfastsweep" }, + { 0x100, "getuavstrengthlevelshowenemydirectional" }, + { 0x101, "blockteamradar" }, + { 0x102, "unblockteamradar" }, + { 0x103, "isteamradarblocked" }, + { 0x104, "getassignedteam" }, + { 0x105, "setmatchdata" }, + { 0x106, "getmatchdata" }, + { 0x107, "sendmatchdata" }, + { 0x108, "clearmatchdata" }, + { 0x109, "setmatchdatadef" }, + { 0x10A, "setmatchclientip" }, + { 0x10B, "setmatchdataid" }, + { 0x10C, "setclientmatchdata" }, + { 0x10D, "getclientmatchdata" }, + { 0x10E, "setclientmatchdatadef" }, + { 0x10F, "sendclientmatchdata" }, + { 0x110, "getbuildversion" }, + { 0x111, "getbuildnumber" }, + { 0x112, "getsystemtime" }, + { 0x113, "getmatchrulesdata" }, + { 0x114, "isusingmatchrulesdata" }, + { 0x115, "kick" }, + { 0x116, "issplitscreen" }, + { 0x117, "setmapcenter" }, + { 0x118, "setgameendtime" }, + { 0x119, "visionsetnaked" }, + { 0x11A, "visionsetnight" }, + { 0x11B, "visionsetmissilecam" }, + { 0x11C, "visionsetthermal" }, + { 0x11D, "visionsetpain" }, + { 0x11E, "endlobby" }, + { 0x11F, "setac130ambience" }, + { 0x120, "getmapcustom" }, + { 0x121, "updateskill" }, + { 0x122, "spawnsighttrace" }, + { 0x123, "incrementcounter" }, + { 0x124, "getcountertotal" }, + { 0x125, "getlevelticks" }, + { 0x126, "perlinnoise2d" }, + { 0x127, "calcrockingangles" }, + { 0x128, "sethudlighting" }, + { 0x129, "reconevent" }, + { 0x12A, "reconspatialevent" }, + { 0x12B, "setsunflareposition" }, + { 0x12C, "createthreatbiasgroup" }, + { 0x12D, "threatbiasgroupexists" }, + { 0x12E, "getthreatbias" }, + { 0x12F, "setthreatbias" }, + { 0x130, "setthreatbiasagainstall" }, + { 0x131, "setignoremegroup" }, + { 0x132, "isenemyteam" }, + { 0x133, "objective_additionalentity" }, + { 0x134, "objective_state_nomessage" }, + { 0x135, "objective_string" }, + { 0x136, "objective_string_nomessage" }, + { 0x137, "objective_additionalposition" }, + { 0x138, "objective_current_nomessage" }, + { 0x139, "objective_additionalcurrent" }, + { 0x13A, "objective_ring" }, + { 0x13B, "objective_setpointertextoverride" }, + { 0x13C, "getnode" }, + { 0x13D, "getnodearray" }, + { 0x13E, "getallnodes" }, + { 0x13F, "getnodesinradius" }, + { 0x140, "getnodesinradiussorted" }, + { 0x141, "getclosestnodeinsight" }, + { 0x142, "getreflectionlocs" }, + { 0x143, "getreflectionreferencelocs" }, + { 0x144, "getvehicletracksegment" }, + { 0x145, "getvehicletracksegmentarray" }, + { 0x146, "getallvehicletracksegments" }, + { 0x147, "isarray" }, + { 0x148, "isai" }, + { 0x149, "issentient" }, + { 0x14A, "isgodmode" }, + { 0x14B, "getdebugdvar" }, + { 0x14C, "getdebugdvarint" }, + { 0x14D, "getdebugdvarfloat" }, + { 0x14E, "setsaveddvar" }, + { 0x14F, "getfreeaicount" }, + { 0x150, "getaicount" }, + { 0x151, "getaiarray" }, + { 0x152, "getaispeciesarray" }, + { 0x153, "getspawnerarray" }, + { 0x154, "getcorpsearray" }, + { 0x155, "getspawnerteamarray" }, + { 0x156, "getweaponclipmodel" }, + { 0x157, "getbrushmodelcenter" }, + { 0x158, "getkeybinding" }, + { 0x159, "getcommandfromkey" }, + { 0x15A, "getsticksconfig" }, + { 0x15B, "weaponfightdist" }, + { 0x15C, "weaponmaxdist" }, + { 0x15D, "isturretactive" }, + { 0x15E, "target_alloc" }, + { 0x15F, "target_flush" }, + { 0x160, "target_set" }, + { 0x161, "target_remove" }, + { 0x162, "target_setshader" }, + { 0x163, "target_setoffscreenshader" }, + { 0x164, "target_isinrect" }, + { 0x165, "target_isincircle" }, + { 0x166, "target_startreticlelockon" }, + { 0x167, "target_clearreticlelockon" }, + { 0x168, "target_getarray" }, + { 0x169, "target_istarget" }, + { 0x16A, "target_setattackmode" }, + { 0x16B, "target_setjavelinonly" }, + { 0x16C, "target_hidefromplayer" }, + { 0x16D, "target_showtoplayer" }, + { 0x16E, "target_setscaledrendermode" }, + { 0x16F, "target_drawcornersonly" }, + { 0x170, "target_drawsquare" }, + { 0x171, "target_drawsingle" }, + { 0x172, "target_setminsize" }, + { 0x173, "target_setmaxsize" }, + { 0x174, "target_setcolor" }, + { 0x175, "target_setdelay" }, + { 0x176, "getstartorigin" }, + { 0x177, "getstartangles" }, + { 0x178, "getcycleoriginoffset" }, + { 0x179, "magicgrenade" }, + { 0x17A, "magicgrenademanual" }, + { 0x17B, "setblur" }, + { 0x17C, "musicplay" }, + { 0x17D, "musicstop" }, + { 0x17E, "soundfade" }, + { 0x17F, "soundsettimescalefactor" }, + { 0x180, "soundresettimescale" }, + { 0x181, "setocclusionpreset" }, + { 0x182, "levelsoundfade" }, + { 0x183, "precachenightvisioncodeassets" }, + { 0x184, "precachedigitaldistortcodeassets" }, + { 0x185, "precacheminimapsentrycodeassets" }, + { 0x186, "savegame" }, + { 0x187, "issavesuccessful" }, + { 0x188, "issaverecentlyloaded" }, + { 0x189, "savegamenocommit" }, + { 0x18A, "commitsave" }, + { 0x18B, "commitwouldbevalid" }, + { 0x18C, "getfxvisibility" }, + { 0x18D, "setculldist" }, + { 0x18E, "getculldist" }, + { 0x18F, "sethalfresparticles" }, + { 0x190, "getmapsunlight" }, + { 0x191, "setsunlight" }, + { 0x192, "resetsunlight" }, + { 0x193, "getmapsundirection" }, + { 0x194, "getmapsunangles" }, + { 0x195, "setsundirection" }, + { 0x196, "lerpsundirection" }, + { 0x197, "lerpsunangles" }, + { 0x198, "resetsundirection" }, + { 0x199, "enableforcedsunshadows" }, + { 0x19A, "enableforcednosunshadows" }, + { 0x19B, "disableforcedsunshadows" }, + { 0x19C, "enableouterspacemodellighting" }, + { 0x19D, "disableouterspacemodellighting" }, + { 0x19E, "remapstage" }, + { 0x19F, "changelevel" }, + { 0x1A0, "missionsuccess" }, + { 0x1A1, "missionfailed" }, + { 0x1A2, "cinematic" }, + { 0x1A3, "cinematicingame" }, + { 0x1A4, "cinematicingamesync" }, + { 0x1A5, "cinematicingameloop" }, + { 0x1A6, "cinematicingameloopresident" }, + { 0x1A7, "iscinematicplaying" }, + { 0x1A8, "stopcinematicingame" }, + { 0x1A9, "pausecinematicingame" }, + { 0x1AA, "drawcompassfriendlies" }, + { 0x1AB, "bulletspread" }, + { 0x1AC, "bullettracer" }, + { 0x1AD, "badplace_delete" }, + { 0x1AE, "badplace_cylinder" }, + { 0x1AF, "badplace_arc" }, + { 0x1B0, "badplace_brush" }, + { 0x1B1, "clearallcorpses" }, + { 0x1B2, "setturretnode" }, + { 0x1B3, "unsetturretnode" }, + { 0x1B4, "setnodepriority" }, + { 0x1B5, "isnodeoccupied" }, + { 0x1B6, "setdebugorigin" }, + { 0x1B7, "setdebugangles" }, + { 0x1B8, "updategamerprofile" }, + { 0x1B9, "updategamerprofileall" }, + { 0x1BA, "clearlocalizedstrings" }, + { 0x1BB, "setphysicsgravitydir" }, + { 0x1BC, "gettimescale" }, + { 0x1BD, "settimescale" }, + { 0x1BE, "setslowmotionview" }, + { 0x1BF, "forcesharedammo" }, + { 0x1C0, "refreshhudcompass" }, + { 0x1C1, "refreshhudammocounter" }, + { 0x1C2, "notifyoncommand" }, + { 0x1C3, "gettimesincelastpaused" }, + { 0x1C4, "setlasermaterial" }, + { 0x1C5, "_func_1C5" }, + { 0x1C6, "_func_1C6" }, + { 0x1C7, "_func_1C7" }, +}}; + +} // namespace xsk::gsc::iw5_xb diff --git a/src/iw5/iw5_xb_meth.cpp b/src/iw5/iw5_xb_meth.cpp new file mode 100644 index 00000000..d24bc994 --- /dev/null +++ b/src/iw5/iw5_xb_meth.cpp @@ -0,0 +1,794 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_xb.hpp" + +namespace xsk::gsc::iw5_xb +{ + +extern std::array, meth_count> const meth_list +{{ + { 0x8000, "attach" }, + { 0x8001, "attachshieldmodel" }, + { 0x8002, "detach" }, + { 0x8003, "detachshieldmodel" }, + { 0x8004, "moveshieldmodel" }, + { 0x8005, "detachall" }, + { 0x8006, "getattachsize" }, + { 0x8007, "getattachmodelname" }, + { 0x8008, "getattachtagname" }, + { 0x8009, "getattachignorecollision" }, + { 0x800A, "hidepart" }, + { 0x800B, "hidepart_allinstances" }, + { 0x800C, "hideallparts" }, + { 0x800D, "showpart" }, + { 0x800E, "showallparts" }, + { 0x800F, "linkto" }, + { 0x8010, "linktoblendtotag" }, + { 0x8011, "unlink" }, + { 0x8012, "islinked" }, + { 0x8013, "enablelinkto" }, + { 0x8014, "playerlinkto" }, + { 0x8015, "playerlinktodelta" }, + { 0x8016, "playerlinkweaponviewtodelta" }, + { 0x8017, "playerlinktoabsolute" }, + { 0x8018, "playerlinktoblend" }, + { 0x8019, "playerlinkedoffsetenable" }, + { 0x801A, "playerlinkedoffsetdisable" }, + { 0x801B, "playerlinkedsetviewznear" }, + { 0x801C, "playerlinkedsetusebaseangleforviewclamp" }, + { 0x801D, "lerpviewangleclamp" }, + { 0x801E, "setviewangleresistance" }, + { 0x801F, "geteye" }, + { 0x8020, "istouching" }, + { 0x8021, "stoploopsound" }, + { 0x8022, "stopsounds" }, + { 0x8023, "playrumbleonentity" }, + { 0x8024, "playrumblelooponentity" }, + { 0x8025, "stoprumble" }, + { 0x8026, "delete" }, + { 0x8027, "setmodel" }, + { 0x8028, "laseron" }, + { 0x8029, "laseroff" }, + { 0x802A, "laseraltviewon" }, + { 0x802B, "laseraltviewoff" }, + { 0x802C, "thermalvisionon" }, + { 0x802D, "thermalvisionoff" }, + { 0x802E, "thermalvisionfofoverlayon" }, + { 0x802F, "thermalvisionfofoverlayoff" }, + { 0x8030, "autospotoverlayon" }, + { 0x8031, "autospotoverlayoff" }, + { 0x8032, "setcontents" }, + { 0x8033, "makeusable" }, + { 0x8034, "makeunusable" }, + { 0x8035, "setcursorhint" }, + { 0x8036, "sethintstring" }, + { 0x8037, "forceusehinton" }, + { 0x8038, "forceusehintoff" }, + { 0x8039, "makesoft" }, + { 0x803A, "makehard" }, + { 0x803B, "willneverchange" }, + { 0x803C, "startfiring" }, + { 0x803D, "stopfiring" }, + { 0x803E, "isfiringturret" }, + { 0x803F, "startbarrelspin" }, + { 0x8040, "stopbarrelspin" }, + { 0x8041, "getbarrelspinrate" }, + { 0x8042, "remotecontrolturret" }, + { 0x8043, "remotecontrolturretoff" }, + { 0x8044, "shootturret" }, + { 0x8045, "getturretowner" }, + { 0x8046, "setsentryowner" }, + { 0x8047, "setsentrycarrier" }, + { 0x8048, "setturretminimapvisible" }, + { 0x8049, "settargetentity" }, + { 0x804A, "snaptotargetentity" }, + { 0x804B, "cleartargetentity" }, + { 0x804C, "getturrettarget" }, + { 0x804D, "setplayerspread" }, + { 0x804E, "setaispread" }, + { 0x804F, "setsuppressiontime" }, + { 0x8050, "setconvergencetime" }, + { 0x8051, "setconvergenceheightpercent" }, + { 0x8052, "setturretteam" }, + { 0x8053, "maketurretsolid" }, + { 0x8054, "maketurretoperable" }, + { 0x8055, "maketurretinoperable" }, + { 0x8056, "setturretaccuracy" }, + { 0x8057, "setrightarc" }, + { 0x8058, "setleftarc" }, + { 0x8059, "settoparc" }, + { 0x805A, "setbottomarc" }, + { 0x805B, "setautorotationdelay" }, + { 0x805C, "setdefaultdroppitch" }, + { 0x805D, "restoredefaultdroppitch" }, + { 0x805E, "turretfiredisable" }, + { 0x805F, "turretfireenable" }, + { 0x8060, "setturretmodechangewait" }, + { 0x8061, "usetriggerrequirelookat" }, + { 0x8062, "getstance" }, + { 0x8063, "setstance" }, + { 0x8064, "itemweaponsetammo" }, + { 0x8065, "getammocount" }, + { 0x8066, "gettagorigin" }, + { 0x8067, "gettagangles" }, + { 0x8068, "shellshock" }, + { 0x8069, "stunplayer" }, + { 0x806A, "stopshellshock" }, + { 0x806B, "fadeoutshellshock" }, + { 0x806C, "setdepthoffield" }, + { 0x806D, "setviewmodeldepthoffield" }, + { 0x806E, "setmotionblurmovescale" }, + { 0x806F, "setmotionblurturnscale" }, + { 0x8070, "setmotionblurzoomscale" }, + { 0x8071, "viewkick" }, + { 0x8072, "localtoworldcoords" }, + { 0x8073, "getentitynumber" }, + { 0x8074, "getentityvelocity" }, + { 0x8075, "enablegrenadetouchdamage" }, + { 0x8076, "disablegrenadetouchdamage" }, + { 0x8077, "enableaimassist" }, + { 0x8078, "disableaimassist" }, + { 0x8079, "radiusdamage" }, + { 0x807A, "detonate" }, + { 0x807B, "damageconetrace" }, + { 0x807C, "sightconetrace" }, + { 0x807D, "missile_settargetent" }, + { 0x807E, "missile_settargetpos" }, + { 0x807F, "missile_cleartarget" }, + { 0x8080, "missile_setflightmodedirect" }, + { 0x8081, "missile_setflightmodetop" }, + { 0x8082, "getlightintensity" }, + { 0x8083, "setlightintensity" }, + { 0x8084, "isragdoll" }, + { 0x8085, "setmovespeedscale" }, + { 0x8086, "cameralinkto" }, + { 0x8087, "cameraunlink" }, + { 0x8088, "controlslinkto" }, + { 0x8089, "controlsunlink" }, + { 0x808A, "makevehiclesolidcapsule" }, + { 0x808B, "makevehiclesolidsphere" }, + { 0x808C, "makevehiclesolid" }, + { 0x808D, "remotecontrolvehicle" }, + { 0x808E, "remotecontrolvehicleoff" }, + { 0x808F, "isfiringvehicleturret" }, + { 0x8090, "drivevehicleandcontrolturret" }, + { 0x8091, "drivevehicleandcontrolturretoff" }, + { 0x8092, "getplayersetting" }, + { 0x8093, "getlocalplayerprofiledata" }, + { 0x8094, "setlocalplayerprofiledata" }, + { 0x8095, "remotecamerasoundscapeon" }, + { 0x8096, "remotecamerasoundscapeoff" }, + { 0x8097, "radarjamon" }, + { 0x8098, "radarjamoff" }, + { 0x8099, "setmotiontrackervisible" }, + { 0x809A, "getmotiontrackervisible" }, + { 0x809B, "worldpointinreticle_circle" }, + { 0x809C, "getpointinbounds" }, + { 0x809D, "transfermarkstonewscriptmodel" }, + { 0x809E, "setwatersheeting" }, + { 0x809F, "setweaponhudiconoverride" }, + { 0x80A0, "getweaponhudiconoverride" }, + { 0x80A1, "setempjammed" }, + { 0x80A2, "playersetexpfog" }, + { 0x80A3, "isitemunlocked" }, + { 0x80A4, "getplayerdata" }, + { 0x80A5, "setplayerdata" }, + { 0x80A6, "trackerupdate" }, + { 0x80A7, "pingplayer" }, + { 0x80A8, "buttonpressed" }, + { 0x80A9, "sayall" }, + { 0x80AA, "sayteam" }, + { 0x80AB, "showscoreboard" }, + { 0x80AC, "setspawnweapon" }, + { 0x80AD, "dropitem" }, + { 0x80AE, "dropscavengerbag" }, + { 0x80AF, "finishplayerdamage" }, + { 0x80B0, "suicide" }, + { 0x80B1, "closeingamemenu" }, + { 0x80B2, "iprintln" }, + { 0x80B3, "iprintlnbold" }, + { 0x80B4, "spawn" }, + { 0x80B5, "setentertime" }, + { 0x80B6, "cloneplayer" }, + { 0x80B7, "istalking" }, + { 0x80B8, "allowspectateteam" }, + { 0x80B9, "getguid" }, + { 0x80BA, "getxuid" }, + { 0x80BB, "ishost" }, + { 0x80BC, "getspectatingplayer" }, + { 0x80BD, "predictstreampos" }, + { 0x80BE, "updatescores" }, + { 0x80BF, "updatedmscores" }, + { 0x80C0, "setrank" }, + { 0x80C1, "setcardtitle" }, + { 0x80C2, "setcardicon" }, + { 0x80C3, "setcardnameplate" }, + { 0x80C4, "setcarddisplayslot" }, + { 0x80C5, "kc_regweaponforfxremoval" }, + { 0x80C6, "laststandrevive" }, + { 0x80C7, "setspectatedefaults" }, + { 0x80C8, "getthirdpersoncrosshairoffset" }, + { 0x80C9, "disableweaponpickup" }, + { 0x80CA, "enableweaponpickup" }, + { 0x80CB, "issplitscreenplayer" }, + { 0x80CC, "issplitscreenplayerprimary" }, + { 0x80CD, "getviewmodel" }, + { 0x80CE, "fragbuttonpressed" }, + { 0x80CF, "secondaryoffhandbuttonpressed" }, + { 0x80D0, "getcurrentweaponclipammo" }, + { 0x80D1, "setvelocity" }, + { 0x80D2, "getplayerviewheight" }, + { 0x80D3, "getnormalizedmovement" }, + { 0x80D4, "getnormalizedcameramovement" }, + { 0x80D5, "giveweapon" }, + { 0x80D6, "takeweapon" }, + { 0x80D7, "takeallweapons" }, + { 0x80D8, "getcurrentweapon" }, + { 0x80D9, "getcurrentprimaryweapon" }, + { 0x80DA, "getcurrentoffhand" }, + { 0x80DB, "hasweapon" }, + { 0x80DC, "switchtoweapon" }, + { 0x80DD, "switchtoweaponimmediate" }, + { 0x80DE, "switchtooffhand" }, + { 0x80DF, "givestartammo" }, + { 0x80E0, "givemaxammo" }, + { 0x80E1, "getfractionstartammo" }, + { 0x80E2, "getfractionmaxammo" }, + { 0x80E3, "isdualwielding" }, + { 0x80E4, "isreloading" }, + { 0x80E5, "isswitchingweapon" }, + { 0x80E6, "setorigin" }, + { 0x80E7, "getvelocity" }, + { 0x80E8, "setplayerangles" }, + { 0x80E9, "getplayerangles" }, + { 0x80EA, "usebuttonpressed" }, + { 0x80EB, "attackbuttonpressed" }, + { 0x80EC, "adsbuttonpressed" }, + { 0x80ED, "meleebuttonpressed" }, + { 0x80EE, "playerads" }, + { 0x80EF, "isonground" }, + { 0x80F0, "isusingturret" }, + { 0x80F1, "setviewmodel" }, + { 0x80F2, "setoffhandprimaryclass" }, + { 0x80F3, "getoffhandprimaryclass" }, + { 0x80F4, "setoffhandsecondaryclass" }, + { 0x80F5, "getoffhandsecondaryclass" }, + { 0x80F6, "beginlocationselection" }, + { 0x80F7, "endlocationselection" }, + { 0x80F8, "disableweapons" }, + { 0x80F9, "enableweapons" }, + { 0x80FA, "disableoffhandweapons" }, + { 0x80FB, "enableoffhandweapons" }, + { 0x80FC, "disableweaponswitch" }, + { 0x80FD, "enableweaponswitch" }, + { 0x80FE, "openpopupmenu" }, + { 0x80FF, "openpopupmenunomouse" }, + { 0x8100, "closepopupmenu" }, + { 0x8101, "openmenu" }, + { 0x8102, "closemenu" }, + { 0x8103, "savematchrulestohistory" }, + { 0x8104, "freezecontrols" }, + { 0x8105, "disableusability" }, + { 0x8106, "enableusability" }, + { 0x8107, "setwhizbyspreads" }, + { 0x8108, "setwhizbyradii" }, + { 0x8109, "setreverb" }, + { 0x810A, "deactivatereverb" }, + { 0x810B, "setvolmod" }, + { 0x810C, "setchannelvolume" }, + { 0x810D, "setchannelvolumes" }, + { 0x810E, "deactivatechannelvolumes" }, + { 0x810F, "playlocalsound" }, + { 0x8110, "stoplocalsound" }, + { 0x8111, "setweaponammoclip" }, + { 0x8112, "setweaponammostock" }, + { 0x8113, "getweaponammoclip" }, + { 0x8114, "getweaponammostock" }, + { 0x8115, "anyammoforweaponmodes" }, + { 0x8116, "setclientdvar" }, + { 0x8117, "setclientdvars" }, + { 0x8118, "allowads" }, + { 0x8119, "allowjump" }, + { 0x811A, "allowsprint" }, + { 0x811B, "setspreadoverride" }, + { 0x811C, "resetspreadoverride" }, + { 0x811D, "setaimspreadmovementscale" }, + { 0x811E, "setactionslot" }, + { 0x811F, "setviewkickscale" }, + { 0x8120, "getviewkickscale" }, + { 0x8121, "getweaponslistall" }, + { 0x8122, "getweaponslistprimaries" }, + { 0x8123, "getweaponslistoffhands" }, + { 0x8124, "getweaponslistitems" }, + { 0x8125, "getweaponslistexclusives" }, + { 0x8126, "getweaponslist" }, + { 0x8127, "canplayerplacesentry" }, + { 0x8128, "canplayerplacetank" }, + { 0x8129, "visionsetnakedforplayer" }, + { 0x812A, "visionsetnightforplayer" }, + { 0x812B, "visionsetmissilecamforplayer" }, + { 0x812C, "visionsetthermalforplayer" }, + { 0x812D, "visionsetpainforplayer" }, + { 0x812E, "setblurforplayer" }, + { 0x812F, "getplayerweaponmodel" }, + { 0x8130, "getplayerknifemodel" }, + { 0x8131, "updateplayermodelwithweapons" }, + { 0x8132, "notifyonplayercommand" }, + { 0x8133, "canmantle" }, + { 0x8134, "forcemantle" }, + { 0x8135, "ismantling" }, + { 0x8136, "playfx" }, + { 0x8137, "player_recoilscaleon" }, + { 0x8138, "player_recoilscaleoff" }, + { 0x8139, "weaponlockstart" }, + { 0x813A, "weaponlockfinalize" }, + { 0x813B, "weaponlockfree" }, + { 0x813C, "weaponlocktargettooclose" }, + { 0x813D, "weaponlocknoclearance" }, + { 0x813E, "visionsyncwithplayer" }, + { 0x813F, "showhudsplash" }, + { 0x8140, "setperk" }, + { 0x8141, "hasperk" }, + { 0x8142, "clearperks" }, + { 0x8143, "unsetperk" }, + { 0x8144, "noclip" }, + { 0x8145, "ufo" }, + { 0x8146, "moveto" }, + { 0x8147, "movex" }, + { 0x8148, "movey" }, + { 0x8149, "movez" }, + { 0x814A, "movegravity" }, + { 0x814B, "moveslide" }, + { 0x814C, "stopmoveslide" }, + { 0x814D, "rotateto" }, + { 0x814E, "rotatepitch" }, + { 0x814F, "rotateyaw" }, + { 0x8150, "rotateroll" }, + { 0x8151, "addpitch" }, + { 0x8152, "addyaw" }, + { 0x8153, "addroll" }, + { 0x8154, "vibrate" }, + { 0x8155, "rotatevelocity" }, + { 0x8156, "solid" }, + { 0x8157, "notsolid" }, + { 0x8158, "setcandamage" }, + { 0x8159, "setcanradiusdamage" }, + { 0x815A, "physicslaunchclient" }, + { 0x815B, "physicslaunchserver" }, + { 0x815C, "physicslaunchserveritem" }, + { 0x815D, "clonebrushmodeltoscriptmodel" }, + { 0x815E, "scriptmodelplayanim" }, + { 0x815F, "scriptmodelclearanim" }, + { 0x8160, "vehicle_teleport" }, + { 0x8161, "attachpath" }, + { 0x8162, "getattachpos" }, + { 0x8163, "startpath" }, + { 0x8164, "setswitchnode" }, + { 0x8165, "setwaitspeed" }, + { 0x8166, "vehicle_finishdamage" }, + { 0x8167, "vehicle_setspeed" }, + { 0x8168, "vehicle_setspeedimmediate" }, + { 0x8169, "vehicle_rotateyaw" }, + { 0x816A, "vehicle_getspeed" }, + { 0x816B, "vehicle_getvelocity" }, + { 0x816C, "vehicle_getbodyvelocity" }, + { 0x816D, "vehicle_getsteering" }, + { 0x816E, "vehicle_getthrottle" }, + { 0x816F, "vehicle_turnengineoff" }, + { 0x8170, "vehicle_turnengineon" }, + { 0x8171, "getgoalspeedmph" }, + { 0x8172, "setacceleration" }, + { 0x8173, "setdeceleration" }, + { 0x8174, "resumespeed" }, + { 0x8175, "setyawspeed" }, + { 0x8176, "setyawspeedbyname" }, + { 0x8177, "setmaxpitchroll" }, + { 0x8178, "setairresistance" }, + { 0x8179, "setturningability" }, + { 0x817A, "setjitterparams" }, + { 0x817B, "sethoverparams" }, + { 0x817C, "joltbody" }, + { 0x817D, "freevehicle" }, + { 0x817E, "getwheelsurface" }, + { 0x817F, "getvehicleowner" }, + { 0x8180, "setvehiclelookattext" }, + { 0x8181, "setvehicleteam" }, + { 0x8182, "setneargoalnotifydist" }, + { 0x8183, "setvehgoalpos" }, + { 0x8184, "setgoalyaw" }, + { 0x8185, "cleargoalyaw" }, + { 0x8186, "settargetyaw" }, + { 0x8187, "cleartargetyaw" }, + { 0x8188, "vehicle_helisetai" }, + { 0x8189, "setturrettargetvec" }, + { 0x818A, "setturrettargetent" }, + { 0x818B, "clearturrettarget" }, + { 0x818C, "vehicle_canturrettargetpoint" }, + { 0x818D, "setlookatent" }, + { 0x818E, "clearlookatent" }, + { 0x818F, "setvehweapon" }, + { 0x8190, "fireweapon" }, + { 0x8191, "vehicleturretcontrolon" }, + { 0x8192, "vehicleturretcontroloff" }, + { 0x8193, "isturretready" }, + { 0x8194, "vehicledriveto" }, + { 0x8195, "vehicle_dospawn" }, + { 0x8196, "vehicle_isphysveh" }, + { 0x8197, "vehphys_crash" }, + { 0x8198, "vehphys_launch" }, + { 0x8199, "vehphys_disablecrashing" }, + { 0x819A, "vehphys_enablecrashing" }, + { 0x819B, "vehphys_setspeed" }, + { 0x819C, "vehphys_setconveyorbelt" }, + { 0x819D, "freehelicopter" }, + { 0x819E, "playerlinkedturretanglesenable" }, + { 0x819F, "playerlinkedturretanglesdisable" }, + { 0x81A0, "playersetstreamorigin" }, + { 0x81A1, "playerclearstreamorigin" }, + { 0x81A2, "nightvisionviewon" }, + { 0x81A3, "nightvisionviewoff" }, + { 0x81A4, "painvisionon" }, + { 0x81A5, "painvisionoff" }, + { 0x81A6, "getplayerintelisfound" }, + { 0x81A7, "setplayerintelfound" }, + { 0x81A8, "newpip" }, + { 0x81A9, "sethuddynlight" }, + { 0x81AA, "startscriptedanim" }, + { 0x81AB, "startcoverbehavior" }, + { 0x81AC, "startcoverarrival" }, + { 0x81AD, "starttraversearrival" }, + { 0x81AE, "checkcoverexitposwithpath" }, + { 0x81AF, "shoot" }, + { 0x81B0, "shootblank" }, + { 0x81B1, "melee" }, + { 0x81B2, "updateplayersightaccuracy" }, + { 0x81B3, "findshufflecovernode" }, + { 0x81B4, "findnearbycovernode" }, + { 0x81B5, "findcovernode" }, + { 0x81B6, "findbestcovernode" }, + { 0x81B7, "getcovernode" }, + { 0x81B8, "usecovernode" }, + { 0x81B9, "iscovervalidagainstenemy" }, + { 0x81BA, "reacquirestep" }, + { 0x81BB, "findreacquiredirectpath" }, + { 0x81BC, "trimpathtoattack" }, + { 0x81BD, "reacquiremove" }, + { 0x81BE, "findreacquireproximatepath" }, + { 0x81BF, "flagenemyunattackable" }, + { 0x81C0, "enterprone" }, + { 0x81C1, "exitprone" }, + { 0x81C2, "setproneanimnodes" }, + { 0x81C3, "updateprone" }, + { 0x81C4, "clearpitchorient" }, + { 0x81C5, "setlookatanimnodes" }, + { 0x81C6, "setlookat" }, + { 0x81C7, "setlookatentity" }, + { 0x81C8, "setlookatyawlimits" }, + { 0x81C9, "stoplookat" }, + { 0x81CA, "getmuzzlepos" }, + { 0x81CB, "getmuzzleangle" }, + { 0x81CC, "getmuzzlesideoffsetpos" }, + { 0x81CD, "getaimangle" }, + { 0x81CE, "canshoot" }, + { 0x81CF, "canshootenemy" }, + { 0x81D0, "cansee" }, + { 0x81D1, "seerecently" }, + { 0x81D2, "lastknowntime" }, + { 0x81D3, "lastknownpos" }, + { 0x81D4, "dropweapon" }, + { 0x81D5, "maymovetopoint" }, + { 0x81D6, "maymovefrompointtopoint" }, + { 0x81D7, "teleport" }, + { 0x81D8, "forceteleport" }, + { 0x81D9, "safeteleport" }, + { 0x81DA, "withinapproxpathdist" }, + { 0x81DB, "ispathdirect" }, + { 0x81DC, "allowedstances" }, + { 0x81DD, "isstanceallowed" }, + { 0x81DE, "issuppressionwaiting" }, + { 0x81DF, "issuppressed" }, + { 0x81E0, "ismovesuppressed" }, + { 0x81E1, "isgrenadepossafe" }, + { 0x81E2, "checkgrenadethrow" }, + { 0x81E3, "checkgrenadelaunch" }, + { 0x81E4, "checkgrenadelaunchpos" }, + { 0x81E5, "throwgrenade" }, + { 0x81E6, "pickupgrenade" }, + { 0x81E7, "useturret" }, + { 0x81E8, "stopuseturret" }, + { 0x81E9, "canuseturret" }, + { 0x81EA, "traversemode" }, + { 0x81EB, "animmode" }, + { 0x81EC, "orientmode" }, + { 0x81ED, "getmotionangle" }, + { 0x81EE, "shouldfacemotion" }, + { 0x81EF, "getanglestolikelyenemypath" }, + { 0x81F0, "setturretanim" }, + { 0x81F1, "getturret" }, + { 0x81F2, "getgroundenttype" }, + { 0x81F3, "animcustom" }, + { 0x81F4, "isinscriptedstate" }, + { 0x81F5, "canattackenemynode" }, + { 0x81F6, "getnegotiationstartnode" }, + { 0x81F7, "getnegotiationendnode" }, + { 0x81F8, "getdoorpathnode" }, + { 0x81F9, "comparenodedirtopathdir" }, + { 0x81FA, "checkprone" }, + { 0x81FB, "pushplayer" }, + { 0x81FC, "checkgrenadethrowpos" }, + { 0x81FD, "setgoalnode" }, + { 0x81FE, "setgoalpos" }, + { 0x81FF, "setgoalentity" }, + { 0x8200, "setgoalvolume" }, + { 0x8201, "setgoalvolumeauto" }, + { 0x8202, "getgoalvolume" }, + { 0x8203, "cleargoalvolume" }, + { 0x8204, "setfixednodesafevolume" }, + { 0x8205, "getfixednodesafevolume" }, + { 0x8206, "clearfixednodesafevolume" }, + { 0x8207, "isingoal" }, + { 0x8208, "setruntopos" }, + { 0x8209, "nearnode" }, + { 0x820A, "nearclaimnode" }, + { 0x820B, "nearclaimnodeandangle" }, + { 0x820C, "atdangerousnode" }, + { 0x820D, "getenemyinfo" }, + { 0x820E, "clearenemy" }, + { 0x820F, "setentitytarget" }, + { 0x8210, "clearentitytarget" }, + { 0x8211, "setpotentialthreat" }, + { 0x8212, "clearpotentialthreat" }, + { 0x8213, "setflashbanged" }, + { 0x8214, "setengagementmindist" }, + { 0x8215, "setengagementmaxdist" }, + { 0x8216, "isknownenemyinradius" }, + { 0x8217, "isknownenemyinvolume" }, + { 0x8218, "settalktospecies" }, + { 0x8219, "laseralton" }, + { 0x821A, "laseraltoff" }, + { 0x821B, "invisiblenotsolid" }, + { 0x821C, "visiblesolid" }, + { 0x821D, "setdefaultaimlimits" }, + { 0x821E, "initriotshieldhealth" }, + { 0x821F, "getenemysqdist" }, + { 0x8220, "getclosestenemysqdist" }, + { 0x8221, "setthreatbiasgroup" }, + { 0x8222, "getthreatbiasgroup" }, + { 0x8223, "makeentitysentient" }, + { 0x8224, "freeentitysentient" }, + { 0x8225, "isindoor" }, + { 0x8226, "getdroptofloorposition" }, + { 0x8227, "isbadguy" }, + { 0x8228, "animscripted" }, + { 0x8229, "animscriptedthirdperson" }, + { 0x822A, "animrelative" }, + { 0x822B, "stopanimscripted" }, + { 0x822C, "clearanim" }, + { 0x822D, "setanimknob" }, + { 0x822E, "setanimknoblimited" }, + { 0x822F, "setanimknobrestart" }, + { 0x8230, "setanimknoblimitedrestart" }, + { 0x8231, "setanimknoball" }, + { 0x8232, "setanimknoballlimited" }, + { 0x8233, "setanimknoballrestart" }, + { 0x8234, "setanimknoballlimitedrestart" }, + { 0x8235, "setanim" }, + { 0x8236, "setanimlimited" }, + { 0x8237, "setanimrestart" }, + { 0x8238, "setanimlimitedrestart" }, + { 0x8239, "getanimtime" }, + { 0x823A, "getanimweight" }, + { 0x823B, "getanimassettype" }, + { 0x823C, "setflaggedanimknob" }, + { 0x823D, "setflaggedanimknoblimited" }, + { 0x823E, "setflaggedanimknobrestart" }, + { 0x823F, "setflaggedanimknoblimitedrestart" }, + { 0x8240, "setflaggedanimknoball" }, + { 0x8241, "setflaggedanimknoballrestart" }, + { 0x8242, "setflaggedanim" }, + { 0x8243, "setflaggedanimlimited" }, + { 0x8244, "setflaggedanimrestart" }, + { 0x8245, "setflaggedanimlimitedrestart" }, + { 0x8246, "useanimtree" }, + { 0x8247, "stopuseanimtree" }, + { 0x8248, "setanimtime" }, + { 0x8249, "showviewmodel" }, + { 0x824A, "hideviewmodel" }, + { 0x824B, "allowstand" }, + { 0x824C, "allowcrouch" }, + { 0x824D, "allowprone" }, + { 0x824E, "allowlean" }, + { 0x824F, "setocclusion" }, + { 0x8250, "deactivateocclusion" }, + { 0x8251, "isocclusionenabled" }, + { 0x8252, "iseqenabled" }, + { 0x8253, "seteq" }, + { 0x8254, "seteqbands" }, + { 0x8255, "deactivateeq" }, + { 0x8256, "seteqlerp" }, + { 0x8257, "islookingat" }, + { 0x8258, "isthrowinggrenade" }, + { 0x8259, "isfiring" }, + { 0x825A, "ismeleeing" }, + { 0x825B, "setautopickup" }, + { 0x825C, "allowmelee" }, + { 0x825D, "allowfire" }, + { 0x825E, "enablehealthshield" }, + { 0x825F, "enabledeathshield" }, + { 0x8260, "nightvisiongogglesforceon" }, + { 0x8261, "nightvisiongogglesforceoff" }, + { 0x8262, "enableinvulnerability" }, + { 0x8263, "disableinvulnerability" }, + { 0x8264, "enablebreaching" }, + { 0x8265, "disablebreaching" }, + { 0x8266, "forceviewmodelanimation" }, + { 0x8267, "disableturretdismount" }, + { 0x8268, "enableturretdismount" }, + { 0x8269, "uploadscore" }, + { 0x826A, "uploadtime" }, + { 0x826B, "uploadleaderboards" }, + { 0x826C, "giveachievement" }, + { 0x826D, "hidehud" }, + { 0x826E, "showhud" }, + { 0x826F, "mountvehicle" }, + { 0x8270, "dismountvehicle" }, + { 0x8271, "enableslowaim" }, + { 0x8272, "disableslowaim" }, + { 0x8273, "usehintsinvehicle" }, + { 0x8274, "vehicleattackbuttonpressed" }, + { 0x8275, "setwhizbyoffset" }, + { 0x8276, "setwhizbyprobabilities" }, + { 0x8277, "visionsetnakedforplayer_lerp" }, + { 0x8278, "setwaitnode" }, + { 0x8279, "returnplayercontrol" }, + { 0x827A, "vehphys_starttrack" }, + { 0x827B, "vehphys_clearautodisable" }, + { 0x827C, "vehicleusealtblendedaudio" }, + { 0x827D, "settext" }, + { 0x827E, "clearalltextafterhudelem" }, + { 0x827F, "setshader" }, + { 0x8280, "settargetent" }, + { 0x8281, "cleartargetent" }, + { 0x8282, "settimer" }, + { 0x8283, "settimerup" }, + { 0x8284, "settimerstatic" }, + { 0x8285, "settenthstimer" }, + { 0x8286, "settenthstimerup" }, + { 0x8287, "settenthstimerstatic" }, + { 0x8288, "setclock" }, + { 0x8289, "setclockup" }, + { 0x828A, "setvalue" }, + { 0x828B, "setwaypoint" }, + { 0x828C, "setwaypointedgestyle_rotatingicon" }, + { 0x828D, "setwaypointedgestyle_secondaryarrow" }, + { 0x828E, "setwaypointiconoffscreenonly" }, + { 0x828F, "fadeovertime" }, + { 0x8290, "scaleovertime" }, + { 0x8291, "moveovertime" }, + { 0x8292, "reset" }, + { 0x8293, "destroy" }, + { 0x8294, "setpulsefx" }, + { 0x8295, "setplayernamestring" }, + { 0x8296, "changefontscaleovertime" }, + { 0x8297, "startignoringspotlight" }, + { 0x8298, "stopignoringspotlight" }, + { 0x8299, "dontcastshadows" }, + { 0x829A, "castshadows" }, + { 0x829B, "setstablemissile" }, + { 0x829C, "playersetgroundreferenceent" }, + { 0x829D, "dontinterpolate" }, + { 0x829E, "dospawn" }, + { 0x829F, "stalingradspawn" }, + { 0x82A0, "getorigin" }, + { 0x82A1, "getcentroid" }, + { 0x82A2, "getshootatpos" }, + { 0x82A3, "getdebugeye" }, + { 0x82A4, "useby" }, + { 0x82A5, "playsound" }, + { 0x82A6, "playsoundatviewheight" }, + { 0x82A7, "prefetchsound" }, + { 0x82A8, "setpitch" }, + { 0x82A9, "scalepitch" }, + { 0x82AA, "setvolume" }, + { 0x82AB, "scalevolume" }, + { 0x82AC, "setspeakermapmonotostereo" }, + { 0x82AD, "setspeakermapmonoto51" }, + { 0x82AE, "setdistributed2dsound" }, + { 0x82AF, "playsoundasmaster" }, + { 0x82B0, "playloopsound" }, + { 0x82B1, "eqon" }, + { 0x82B2, "eqoff" }, + { 0x82B3, "haseq" }, + { 0x82B4, "iswaitingonsound" }, + { 0x82B5, "getnormalhealth" }, + { 0x82B6, "setnormalhealth" }, + { 0x82B7, "dodamage" }, + { 0x82B8, "kill" }, + { 0x82B9, "show" }, + { 0x82BA, "hide" }, + { 0x82BB, "showonclient" }, + { 0x82BC, "hideonclient" }, + { 0x82BD, "laserforceon" }, + { 0x82BE, "laserforceoff" }, + { 0x82BF, "disconnectpaths" }, + { 0x82C0, "connectpaths" }, + { 0x82C1, "startusingheroonlylighting" }, + { 0x82C2, "stopusingheroonlylighting" }, + { 0x82C3, "startusinglessfrequentlighting" }, + { 0x82C4, "stopusinglessfrequentlighting" }, + { 0x82C5, "setthermalfog" }, + { 0x82C6, "setnightvisionfog" }, + { 0x82C7, "clearthermalfog" }, + { 0x82C8, "clearnightvisionfog" }, + { 0x82C9, "digitaldistortsetparams" }, + { 0x82CA, "setmode" }, + { 0x82CB, "getmode" }, + { 0x82CC, "setturretignoregoals" }, + { 0x82CD, "setturretcanaidetach" }, + { 0x82CE, "setturretfov" }, + { 0x82CF, "lerpfov" }, + { 0x82D0, "getvalidcoverpeekouts" }, + { 0x82D1, "gethighestnodestance" }, + { 0x82D2, "doesnodeallowstance" }, + { 0x82D3, "getgunangles" }, + { 0x82D4, "magicgrenade" }, + { 0x82D5, "magicgrenademanual" }, + { 0x82D6, "setfriendlychain" }, + { 0x82D7, "getentnum" }, + { 0x82D8, "launch" }, + { 0x82D9, "setsoundblend" }, + { 0x82DA, "makefakeai" }, + { 0x82DB, "spawndrone" }, + { 0x82DC, "setcorpseremovetimer" }, + { 0x82DD, "setlookattext" }, + { 0x82DE, "setspawnerteam" }, + { 0x82DF, "addaieventlistener" }, + { 0x82E0, "removeaieventlistener" }, + { 0x82E1, "getlightcolor" }, + { 0x82E2, "setlightcolor" }, + { 0x82E3, "getlightradius" }, + { 0x82E4, "setlightradius" }, + { 0x82E5, "getlightfovinner" }, + { 0x82E6, "getlightfovouter" }, + { 0x82E7, "setlightfovrange" }, + { 0x82E8, "getlightexponent" }, + { 0x82E9, "setlightexponent" }, + { 0x82EA, "startragdoll" }, + { 0x82EB, "startragdollfromimpact" }, + { 0x82EC, "logstring" }, + { 0x82ED, "laserhidefromclient" }, + { 0x82EE, "stopsoundchannel" }, + { 0x82EF, "thermaldrawenable" }, + { 0x82F0, "thermaldrawdisable" }, + { 0x82F1, "setturretdismountorg" }, + { 0x82F2, "setdamagestage" }, + { 0x82F3, "playsoundtoteam" }, + { 0x82F4, "playsoundtoplayer" }, + { 0x82F5, "playerhide" }, + { 0x82F6, "showtoplayer" }, + { 0x82F7, "enableplayeruse" }, + { 0x82F8, "disableplayeruse" }, + { 0x82F9, "makescrambler" }, + { 0x82FA, "makeportableradar" }, + { 0x82FB, "maketrophysystem" }, + { 0x82FC, "placespawnpoint" }, + { 0x82FD, "setteamfortrigger" }, + { 0x82FE, "clientclaimtrigger" }, + { 0x82FF, "clientreleasetrigger" }, + { 0x8300, "releaseclaimedtrigger" }, + { 0x8301, "isusingonlinedataoffline" }, + { 0x8302, "getrestedtime" }, + { 0x8303, "sendleaderboards" }, + { 0x8304, "isonladder" }, + { 0x8305, "getcorpseanim" }, + { 0x8306, "playerforcedeathanim" }, + { 0x8307, "startac130" }, + { 0x8308, "stopac130" }, + { 0x8309, "_meth_8309" }, + { 0x830A, "_meth_830A" }, +}}; + +} // namespace xsk::gsc::iw5_xb diff --git a/src/iw5/iw5_xb_token.cpp b/src/iw5/iw5_xb_token.cpp new file mode 100644 index 00000000..9d3b1da7 --- /dev/null +++ b/src/iw5/iw5_xb_token.cpp @@ -0,0 +1,33376 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw5_xb.hpp" + +namespace xsk::gsc::iw5_xb +{ + +extern std::array, token_count> const token_list +{{ + { 0x0000, "" }, + { 0x0001, "pl#" }, + { 0x0002, "-" }, + { 0x0003, "radius`" }, + { 0x0004, "note:" }, + { 0x0005, "maps/mp/gametypes/_tweakables" }, + { 0x0006, "common_scripts/utility" }, + { 0x0007, "common_scripts/_createfx" }, + { 0x0008, "common_scripts/_createfxmenu" }, + { 0x0009, "common_scripts/_fx" }, + { 0x000A, "maps/_utility" }, + { 0x000B, "maps/_mgturret" }, + { 0x000C, "maps/_bcs_location_trigs" }, + { 0x000D, "maps/_anim" }, + { 0x000E, "maps/_gameskill" }, + { 0x000F, "common_scripts/_destructible" }, + { 0x0010, "common_scripts/_destructible_types" }, + { 0x0011, "maps/_vehicle" }, + { 0x0012, "maps/_mg_penetration" }, + { 0x0013, "maps/_rank" }, + { 0x0014, "maps/_hud_util" }, + { 0x0015, "maps/_hud" }, + { 0x0016, "maps/_missions" }, + { 0x0017, "maps/_colors" }, + { 0x0018, "maps/_spawner" }, + { 0x0019, "maps/_audio" }, + { 0x001A, "maps/_audio_stream_manager" }, + { 0x001B, "maps/_audio_dynamic_ambi" }, + { 0x001C, "maps/_audio_reverb" }, + { 0x001D, "maps/_audio_mix_manager" }, + { 0x001E, "maps/_audio_presets_vehicles" }, + { 0x001F, "maps/_specialops" }, + { 0x0020, "maps/_lights" }, + { 0x0021, "maps/_audio_zone_manager" }, + { 0x0022, "maps/_audio_music" }, + { 0x0023, "maps/_audio_whizby" }, + { 0x0024, "maps/_audio_vehicles" }, + { 0x0025, "maps/_specialops_code" }, + { 0x0026, "maps/_specialops_battlechatter" }, + { 0x0027, "maps/_endmission" }, + { 0x0028, "maps/_utility_code" }, + { 0x0029, "maps/_load" }, + { 0x002A, "maps/_quotes" }, + { 0x002B, "maps/_ambient" }, + { 0x002C, "maps/_coop" }, + { 0x002D, "common_scripts/_artcommon" }, + { 0x002E, "maps/_arcademode" }, + { 0x002F, "maps/_damagefeedback" }, + { 0x0030, "maps/_laststand" }, + { 0x0031, "maps/_player_stats" }, + { 0x0032, "maps/_art" }, + { 0x0033, "maps/_noder" }, + { 0x0034, "common_scripts/_painter" }, + { 0x0035, "maps/_createfx" }, + { 0x0036, "maps/_global_fx" }, + { 0x0037, "maps/_detonategrenades" }, + { 0x0038, "maps/_names" }, + { 0x0039, "maps/_autosave" }, + { 0x003A, "maps/_debug" }, + { 0x003B, "maps/_loadout" }, + { 0x003C, "common_scripts/_elevator" }, + { 0x003D, "common_scripts/_pipes" }, + { 0x003E, "common_scripts/_dynamic_world" }, + { 0x003F, "maps/_introscreen" }, + { 0x0040, "maps/_shutter" }, + { 0x0041, "maps/_escalator" }, + { 0x0042, "maps/_friendlyfire" }, + { 0x0043, "maps/_interactive_objects" }, + { 0x0044, "maps/_intelligence" }, + { 0x0045, "maps/_animatedmodels" }, + { 0x0046, "maps/_fx" }, + { 0x0047, "codescripts/character" }, + { 0x0048, "maps/_compass" }, + { 0x0049, "maps/_hiding_door" }, + { 0x004A, "maps/_drone" }, + { 0x004B, "maps/_patrol" }, + { 0x004C, "maps/_vehicle_aianim" }, + { 0x004D, "maps/_helicopter_ai" }, + { 0x004E, "maps/_helicopter_globals" }, + { 0x004F, "vehicle_scripts/_attack_heli" }, + { 0x0050, "maps/_vehiclenames" }, + { 0x0051, "maps/_treadfx" }, + { 0x0052, "maps/mp/_utility" }, + { 0x0053, "maps/mp/gametypes/_rank" }, + { 0x0054, "maps/mp/gametypes/_persistence" }, + { 0x0055, "maps/mp/gametypes/_gamelogic" }, + { 0x0056, "maps/mp/killstreaks/_killstreaks" }, + { 0x0057, "maps/mp/gametypes/_missions" }, + { 0x0058, "maps/mp/gametypes/_hud_message" }, + { 0x0059, "character/mp_character_ally_ghillie_desert" }, + { 0x005A, "character/mp_character_op_ghillie_desert" }, + { 0x005B, "character/mp_character_ally_ghillie_arctic" }, + { 0x005C, "character/mp_character_op_ghillie_arctic" }, + { 0x005D, "character/mp_character_ally_ghillie_urban" }, + { 0x005E, "character/mp_character_op_ghillie_urban" }, + { 0x005F, "character/mp_character_ally_ghillie_forest" }, + { 0x0060, "character/mp_character_op_ghillie_forest" }, + { 0x0061, "character/mp_character_op_ghillie_militia" }, + { 0x0062, "xmodelalias/alias_delta_elite_heads" }, + { 0x0063, "xmodelalias/alias_delta_elite_heads_longsleeves" }, + { 0x0064, "character/mp_character_delta_elite_assault_aa" }, + { 0x0065, "character/mp_character_delta_elite_assault_ab" }, + { 0x0066, "character/mp_character_delta_elite_assault_ba" }, + { 0x0067, "character/mp_character_delta_elite_assault_bb" }, + { 0x0068, "character/mp_character_delta_elite_lmg_a" }, + { 0x0069, "character/mp_character_delta_elite_lmg_b" }, + { 0x006A, "character/mp_character_delta_elite_smg_a" }, + { 0x006B, "character/mp_character_delta_elite_smg_b" }, + { 0x006C, "character/mp_character_delta_elite_shotgun_a" }, + { 0x006D, "character/mp_character_delta_elite_sniper" }, + { 0x006E, "character/character_mp_ally_juggernaut" }, + { 0x006F, "xmodelalias/alias_sas_heads" }, + { 0x0070, "character/mp_character_sas_urban_assault" }, + { 0x0071, "character/mp_character_sas_urban_lmg" }, + { 0x0072, "character/mp_character_sas_urban_shotgun" }, + { 0x0073, "character/mp_character_sas_urban_smg" }, + { 0x0074, "character/mp_character_sas_urban_sniper" }, + { 0x0075, "character/mp_character_gign_paris_assault" }, + { 0x0076, "character/mp_character_gign_paris_lmg" }, + { 0x0077, "character/mp_character_gign_paris_shotgun" }, + { 0x0078, "character/mp_character_gign_paris_smg" }, + { 0x0079, "character/mp_character_gign_paris_riot" }, + { 0x007A, "xmodelalias/alias_pmc_africa_heads" }, + { 0x007B, "character/mp_character_pmc_africa_assault_a" }, + { 0x007C, "character/mp_character_pmc_africa_assault_aa" }, + { 0x007D, "character/mp_character_pmc_africa_lmg_a" }, + { 0x007E, "character/mp_character_pmc_africa_lmg_aa" }, + { 0x007F, "character/mp_character_pmc_africa_smg_a" }, + { 0x0080, "character/mp_character_pmc_africa_smg_aa" }, + { 0x0081, "character/mp_character_pmc_africa_shotgun_a" }, + { 0x0082, "character/mp_character_pmc_africa_sniper" }, + { 0x0083, "character/mp_character_opforce_air_assault" }, + { 0x0084, "character/mp_character_opforce_air_lmg" }, + { 0x0085, "character/mp_character_opforce_air_shotgun" }, + { 0x0086, "character/mp_character_opforce_air_smg" }, + { 0x0087, "character/mp_character_opforce_air_sniper" }, + { 0x0088, "character/character_mp_opforce_juggernaut" }, + { 0x0089, "xmodelalias/alias_russian_military_arctic_heads" }, + { 0x008A, "character/mp_character_opforce_snow_assault" }, + { 0x008B, "character/mp_character_opforce_snow_lmg" }, + { 0x008C, "character/mp_character_opforce_snow_shotgun" }, + { 0x008D, "character/mp_character_opforce_snow_smg" }, + { 0x008E, "character/mp_character_opforce_snow_sniper" }, + { 0x008F, "character/mp_character_opforce_urban_assault" }, + { 0x0090, "character/mp_character_opforce_urban_lmg" }, + { 0x0091, "character/mp_character_opforce_urban_shotgun" }, + { 0x0092, "character/mp_character_opforce_urban_smg" }, + { 0x0093, "character/mp_character_opforce_urban_sniper" }, + { 0x0094, "character/mp_character_opforce_woods_assault" }, + { 0x0095, "character/mp_character_opforce_woods_lmg" }, + { 0x0096, "character/mp_character_opforce_woods_shotgun" }, + { 0x0097, "character/mp_character_opforce_woods_smg" }, + { 0x0098, "character/mp_character_opforce_woods_sniper" }, + { 0x0099, "xmodelalias/alias_africa_militia_heads_mp" }, + { 0x009A, "character/mp_character_africa_militia_assault_a" }, + { 0x009B, "character/mp_character_africa_militia_assault_b" }, + { 0x009C, "character/mp_character_africa_militia_assault_c" }, + { 0x009D, "character/mp_character_africa_militia_lmg_a" }, + { 0x009E, "character/mp_character_africa_militia_lmg_b" }, + { 0x009F, "character/mp_character_africa_militia_shotgun_a" }, + { 0x00A0, "character/mp_character_africa_militia_shotgun_b" }, + { 0x00A1, "character/mp_character_africa_militia_smg_a" }, + { 0x00A2, "character/mp_character_africa_militia_smg_b" }, + { 0x00A3, "character/mp_character_africa_militia_smg_c" }, + { 0x00A4, "character/mp_character_africa_militia_sniper" }, + { 0x00A5, "xmodelalias/alias_henchmen_heads_mp" }, + { 0x00A6, "character/mp_character_opforce_hench_assault_a" }, + { 0x00A7, "character/mp_character_opforce_hench_assault_b" }, + { 0x00A8, "character/mp_character_opforce_hench_assault_c" }, + { 0x00A9, "character/mp_character_opforce_hench_assault_d" }, + { 0x00AA, "character/mp_character_opforce_hench_lmg_a" }, + { 0x00AB, "character/mp_character_opforce_hench_lmg_b" }, + { 0x00AC, "character/mp_character_opforce_hench_shgn_a" }, + { 0x00AD, "character/mp_character_opforce_hench_shgn_b" }, + { 0x00AE, "character/mp_character_opforce_hench_smg_a" }, + { 0x00AF, "character/mp_character_opforce_hench_smg_b" }, + { 0x00B0, "character/mp_character_opforce_hench_sniper" }, + { 0x00B1, "maps/mp/gametypes/_hostmigration" }, + { 0x00B2, "mptype/mptype_ally_ghillie_desert" }, + { 0x00B3, "mptype/mptype_opforce_ghillie_desert" }, + { 0x00B4, "mptype/mptype_ally_ghillie_arctic" }, + { 0x00B5, "mptype/mptype_opforce_ghillie_arctic" }, + { 0x00B6, "mptype/mptype_ally_ghillie_urban" }, + { 0x00B7, "mptype/mptype_opforce_ghillie_urban" }, + { 0x00B8, "mptype/mptype_ally_ghillie_forest" }, + { 0x00B9, "mptype/mptype_opforce_ghillie_forest" }, + { 0x00BA, "mptype/mptype_opforce_ghillie_militia" }, + { 0x00BB, "mptype/mptype_delta_multicam_assault" }, + { 0x00BC, "mptype/mptype_delta_multicam_lmg" }, + { 0x00BD, "mptype/mptype_delta_multicam_smg" }, + { 0x00BE, "mptype/mptype_delta_multicam_shotgun" }, + { 0x00BF, "mptype/mptype_delta_multicam_sniper" }, + { 0x00C0, "mptype/mptype_delta_multicam_riot" }, + { 0x00C1, "mptype/mptype_ally_juggernaut" }, + { 0x00C2, "mptype/mptype_sas_urban_assault" }, + { 0x00C3, "mptype/mptype_sas_urban_lmg" }, + { 0x00C4, "mptype/mptype_sas_urban_shotgun" }, + { 0x00C5, "mptype/mptype_sas_urban_smg" }, + { 0x00C6, "mptype/mptype_sas_urban_sniper" }, + { 0x00C7, "mptype/mptype_gign_paris_assault" }, + { 0x00C8, "mptype/mptype_gign_paris_lmg" }, + { 0x00C9, "mptype/mptype_gign_paris_shotgun" }, + { 0x00CA, "mptype/mptype_gign_paris_smg" }, + { 0x00CB, "mptype/mptype_gign_paris_sniper" }, + { 0x00CC, "mptype/mptype_gign_paris_riot" }, + { 0x00CD, "mptype/mptype_pmc_africa_assault" }, + { 0x00CE, "mptype/mptype_pmc_africa_lmg" }, + { 0x00CF, "mptype/mptype_pmc_africa_smg" }, + { 0x00D0, "mptype/mptype_pmc_africa_shotgun" }, + { 0x00D1, "mptype/mptype_pmc_africa_sniper" }, + { 0x00D2, "mptype/mptype_pmc_africa_riot" }, + { 0x00D3, "mptype/mptype_opforce_air_assault" }, + { 0x00D4, "mptype/mptype_opforce_air_lmg" }, + { 0x00D5, "mptype/mptype_opforce_air_shotgun" }, + { 0x00D6, "mptype/mptype_opforce_air_smg" }, + { 0x00D7, "mptype/mptype_opforce_air_sniper" }, + { 0x00D8, "mptype/mptype_opforce_air_riot" }, + { 0x00D9, "mptype/mptype_opforce_juggernaut" }, + { 0x00DA, "mptype/mptype_opforce_snow_assault" }, + { 0x00DB, "mptype/mptype_opforce_snow_lmg" }, + { 0x00DC, "mptype/mptype_opforce_snow_shotgun" }, + { 0x00DD, "mptype/mptype_opforce_snow_smg" }, + { 0x00DE, "mptype/mptype_opforce_snow_sniper" }, + { 0x00DF, "mptype/mptype_opforce_snow_riot" }, + { 0x00E0, "mptype/mptype_opforce_urban_assault" }, + { 0x00E1, "mptype/mptype_opforce_urban_lmg" }, + { 0x00E2, "mptype/mptype_opforce_urban_shotgun" }, + { 0x00E3, "mptype/mptype_opforce_urban_smg" }, + { 0x00E4, "mptype/mptype_opforce_urban_sniper" }, + { 0x00E5, "mptype/mptype_opforce_urban_riot" }, + { 0x00E6, "mptype/mptype_opforce_woodland_assault" }, + { 0x00E7, "mptype/mptype_opforce_woodland_lmg" }, + { 0x00E8, "mptype/mptype_opforce_woodland_shotgun" }, + { 0x00E9, "mptype/mptype_opforce_woodland_smg" }, + { 0x00EA, "mptype/mptype_opforce_woodland_sniper" }, + { 0x00EB, "mptype/mptype_opforce_woodland_riot" }, + { 0x00EC, "mptype/mptype_opforce_africa_assault" }, + { 0x00ED, "mptype/mptype_opforce_africa_lmg" }, + { 0x00EE, "mptype/mptype_opforce_africa_shotgun" }, + { 0x00EF, "mptype/mptype_opforce_africa_smg" }, + { 0x00F0, "mptype/mptype_opforce_africa_sniper" }, + { 0x00F1, "mptype/mptype_opforce_africa_riot" }, + { 0x00F2, "mptype/mptype_opforce_henchmen_assault" }, + { 0x00F3, "mptype/mptype_opforce_henchmen_lmg" }, + { 0x00F4, "mptype/mptype_opforce_henchmen_shotgun" }, + { 0x00F5, "mptype/mptype_opforce_henchmen_smg" }, + { 0x00F6, "mptype/mptype_opforce_henchmen_sniper" }, + { 0x00F7, "mptype/mptype_opforce_henchmen_riot" }, + { 0x00F8, "maps/mp/gametypes/_teams" }, + { 0x00F9, "maps/mp/gametypes/_weapons" }, + { 0x00FA, "maps/mp/_entityheadicons" }, + { 0x00FB, "maps/mp/gametypes/_damagefeedback" }, + { 0x00FC, "maps/mp/_stinger" }, + { 0x00FD, "maps/mp/_flashgrenades" }, + { 0x00FE, "maps/mp/_empgrenade" }, + { 0x00FF, "maps/mp/gametypes/_class" }, + { 0x0100, "maps/mp/gametypes/_equipment" }, + { 0x0101, "maps/mp/_javelin" }, + { 0x0102, "maps/mp/gametypes/_shellshock" }, + { 0x0103, "maps/mp/_matchdata" }, + { 0x0104, "maps/mp/killstreaks/_perkstreaks" }, + { 0x0105, "maps/mp/perks/_perkfunctions" }, + { 0x0106, "maps/mp/gametypes/_scrambler" }, + { 0x0107, "maps/mp/gametypes/_portable_radar" }, + { 0x0108, "maps/mp/gametypes/_objpoints" }, + { 0x0109, "maps/mp/gametypes/_hud_util" }, + { 0x010A, "maps/mp/gametypes/_gameobjects" }, + { 0x010B, "maps/mp/gametypes/_quickmessages" }, + { 0x010C, "maps/mp/gametypes/_playerlogic" }, + { 0x010D, "maps/mp/gametypes/_spectating" }, + { 0x010E, "maps/mp/gametypes/_spawnlogic" }, + { 0x010F, "maps/mp/_events" }, + { 0x0110, "maps/mp/gametypes/_gamescore" }, + { 0x0111, "maps/mp/gametypes/_menus" }, + { 0x0112, "maps/mp/_minefields" }, + { 0x0113, "maps/mp/_radiation" }, + { 0x0114, "maps/mp/_shutter" }, + { 0x0115, "maps/mp/_destructables" }, + { 0x0116, "maps/mp/_audio" }, + { 0x0117, "maps/mp/_art" }, + { 0x0118, "maps/mp/_createfx" }, + { 0x0119, "maps/mp/_global_fx" }, + { 0x011A, "maps/mp/_animatedmodels" }, + { 0x011B, "maps/mp/killstreaks/_helicopter" }, + { 0x011C, "maps/mp/_skill" }, + { 0x011D, "maps/mp/killstreaks/_remoteuav" }, + { 0x011E, "maps/mp/gametypes/_battlechatter_mp" }, + { 0x011F, "maps/mp/gametypes/_deathicons" }, + { 0x0120, "maps/mp/gametypes/_killcam" }, + { 0x0121, "maps/mp/perks/_perks" }, + { 0x0122, "maps/mp/gametypes/_damage" }, + { 0x0123, "maps/mp/_highlights" }, + { 0x0124, "maps/mp/killstreaks/_escortairdrop" }, + { 0x0125, "maps/mp/killstreaks/_juggernaut" }, + { 0x0126, "maps/mp/killstreaks/_autosentry" }, + { 0x0127, "maps/mp/killstreaks/_airdrop" }, + { 0x0128, "maps/mp/gametypes/_hud" }, + { 0x0129, "maps/mp/_load" }, + { 0x012A, "maps/mp/gametypes/_serversettings" }, + { 0x012B, "maps/mp/gametypes/_healthoverlay" }, + { 0x012C, "maps/mp/gametypes/_music_and_dialog" }, + { 0x012D, "maps/mp/_awards" }, + { 0x012E, "maps/mp/_areas" }, + { 0x012F, "maps/mp/_defcon" }, + { 0x0130, "maps/mp/_matchevents" }, + { 0x0131, "maps/mp/gametypes/_friendicons" }, + { 0x0132, "maps/mp/_scoreboard" }, + { 0x0133, "maps/mp/killstreaks/_harrier" }, + { 0x0134, "maps/mp/gametypes/_callbacksetup" }, + { 0x0135, "maps/mp/killstreaks/_airstrike" }, + { 0x0136, "maps/mp/killstreaks/_emp" }, + { 0x0137, "maps/mp/killstreaks/_uav" }, + { 0x0138, "maps/mp/killstreaks/_ac130" }, + { 0x0139, "maps/mp/killstreaks/_remotemissile" }, + { 0x013A, "maps/mp/killstreaks/_helicopter_flock" }, + { 0x013B, "maps/mp/killstreaks/_helicopter_guard" }, + { 0x013C, "maps/mp/killstreaks/_nuke" }, + { 0x013D, "maps/mp/killstreaks/_remotemortar" }, + { 0x013E, "maps/mp/killstreaks/_deployablebox" }, + { 0x013F, "maps/mp/killstreaks/_ims" }, + { 0x0140, "maps/mp/killstreaks/_remoteturret" }, + { 0x0141, "maps/mp/killstreaks/_remotetank" }, + { 0x0142, "maps/mp/gametypes/_playercards" }, + { 0x0143, "maps/mp/gametypes/_globallogic" }, + { 0x0144, "xmodelalias/alias_us_army_heads" }, + { 0x0145, "character/mp_character_us_army_assault_a" }, + { 0x0146, "character/mp_character_us_army_assault_b" }, + { 0x0147, "character/mp_character_us_army_assault_c" }, + { 0x0148, "character/mp_character_us_army_lmg" }, + { 0x0149, "character/mp_character_us_army_lmg_b" }, + { 0x014A, "character/mp_character_us_army_lmg_c" }, + { 0x014B, "character/mp_character_us_army_shotgun" }, + { 0x014C, "character/mp_character_us_army_shotgun_b" }, + { 0x014D, "character/mp_character_us_army_shotgun_c" }, + { 0x014E, "xmodelalias/alias_us_army_riot" }, + { 0x014F, "character/mp_character_us_army_riot" }, + { 0x0150, "character/mp_character_us_army_smg" }, + { 0x0151, "character/mp_character_us_army_smg_b" }, + { 0x0152, "character/mp_character_us_army_smg_c" }, + { 0x0153, "character/mp_character_us_army_sniper" }, + { 0x0154, "xmodelalias/alias_opforce_arctic_heads" }, + { 0x0155, "character/mp_character_opforce_arctic_assault_a" }, + { 0x0156, "character/mp_character_opforce_arctic_assault_b" }, + { 0x0157, "character/mp_character_opforce_arctic_assault_c" }, + { 0x0158, "character/mp_character_opforce_arctic_lmg" }, + { 0x0159, "character/mp_character_opforce_arctic_lmg_b" }, + { 0x015A, "character/mp_character_opforce_arctic_lmg_c" }, + { 0x015B, "character/mp_character_opforce_arctic_shotgun" }, + { 0x015C, "character/mp_character_opforce_arctic_shotgun_b" }, + { 0x015D, "character/mp_character_opforce_arctic_shotgun_c" }, + { 0x015E, "character/mp_character_opforce_arctic_smg" }, + { 0x015F, "character/mp_character_opforce_arctic_smg_b" }, + { 0x0160, "character/mp_character_opforce_arctic_smg_c" }, + { 0x0161, "character/mp_character_op_arctic_sniper" }, + { 0x0162, "character/mp_character_op_arctic_riot" }, + { 0x0163, "xmodelalias/alias_seal_udt_heads" }, + { 0x0164, "character/mp_character_seal_udt_assault_a" }, + { 0x0165, "character/mp_character_seal_udt_lmg" }, + { 0x0166, "character/mp_character_seal_udt_assault_b" }, + { 0x0167, "character/mp_character_seal_udt_smg" }, + { 0x0168, "character/mp_character_seal_udt_sniper" }, + { 0x0169, "character/mp_character_udt_riot" }, + { 0x016A, "xmodelalias/alias_opforce_arab_heads" }, + { 0x016B, "character/mp_character_composite_assault_a" }, + { 0x016C, "character/mp_character_composite_lmg" }, + { 0x016D, "character/mp_character_composite_shotgun" }, + { 0x016E, "character/mp_character_composite_smg" }, + { 0x016F, "character/mp_character_op_arab_sniper" }, + { 0x0170, "character/mp_character_op_arab_riot" }, + { 0x0171, "xmodelalias/alias_airborne_heads" }, + { 0x0172, "character/mp_character_airborne_assault_a" }, + { 0x0173, "character/mp_character_airborne_assault_b" }, + { 0x0174, "character/mp_character_airborne_assault_c" }, + { 0x0175, "character/mp_character_airborne_lmg" }, + { 0x0176, "character/mp_character_airborne_lmg_b" }, + { 0x0177, "character/mp_character_airborne_lmg_c" }, + { 0x0178, "character/mp_character_airborne_shotgun" }, + { 0x0179, "character/mp_character_airborne_shotgun_b" }, + { 0x017A, "character/mp_character_airborne_shotgun_c" }, + { 0x017B, "character/mp_character_airborne_smg" }, + { 0x017C, "character/mp_character_airborne_smg_b" }, + { 0x017D, "character/mp_character_airborne_smg_c" }, + { 0x017E, "character/mp_character_op_airborne_sniper" }, + { 0x017F, "character/mp_character_op_airborne_riot" }, + { 0x0180, "xmodelalias/alias_opforce_militia_heads_blk" }, + { 0x0181, "xmodelalias/alias_opforce_militia_heads_wht" }, + { 0x0182, "character/mp_character_militia_assault_aa_blk" }, + { 0x0183, "character/mp_character_militia_assault_aa_wht" }, + { 0x0184, "character/mp_character_militia_assault_ab_blk" }, + { 0x0185, "character/mp_character_militia_assault_ac_blk" }, + { 0x0186, "character/mp_character_militia_lmg_aa_blk" }, + { 0x0187, "character/mp_character_militia_lmg_ab_blk" }, + { 0x0188, "character/mp_character_militia_lmg_ac_blk" }, + { 0x0189, "character/mp_character_militia_shotgun_aa_blk" }, + { 0x018A, "character/mp_character_militia_shotgun_aa_wht" }, + { 0x018B, "character/mp_character_militia_smg_aa_blk" }, + { 0x018C, "character/mp_character_militia_smg_aa_wht" }, + { 0x018D, "character/mp_character_militia_smg_ab_blk" }, + { 0x018E, "character/mp_character_militia_smg_ac_blk" }, + { 0x018F, "character/mp_character_op_militia_sniper" }, + { 0x0190, "character/mp_character_op_militia_riot" }, + { 0x0191, "xmodelalias/alias_tf141_heads_arctic" }, + { 0x0192, "character/mp_character_tf_141_arctic_assault_a" }, + { 0x0193, "character/mp_character_tf_141_arctic_assault_b" }, + { 0x0194, "character/mp_character_tf_141_arctic_lmg" }, + { 0x0195, "character/mp_character_tf_141_arctic_shotgun" }, + { 0x0196, "character/mp_character_tf_141_arctic_smg" }, + { 0x0197, "character/mp_character_tf141_arctic_sniper" }, + { 0x0198, "character/mp_character_tf141_arctic_riot" }, + { 0x0199, "xmodelalias/alias_tf141_heads_desert" }, + { 0x019A, "character/mp_character_tf_141_desert_assault_a" }, + { 0x019B, "character/mp_character_tf_141_desert_assault_b" }, + { 0x019C, "character/mp_character_tf_141_desert_lmg" }, + { 0x019D, "character/mp_character_tf_141_desert_shotgun" }, + { 0x019E, "character/mp_character_tf_141_desert_smg" }, + { 0x019F, "character/mp_character_tf141_desert_sniper" }, + { 0x01A0, "character/mp_character_tf141_desert_riot" }, + { 0x01A1, "xmodelalias/alias_tf141_heads_forest" }, + { 0x01A2, "character/mp_character_tf_141_forest_assault_a" }, + { 0x01A3, "character/mp_character_tf_141_forest_assault_b" }, + { 0x01A4, "character/mp_character_tf_141_forest_lmg" }, + { 0x01A5, "character/mp_character_tf_141_forest_shotgun" }, + { 0x01A6, "character/mp_character_tf_141_forest_smg" }, + { 0x01A7, "character/mp_character_tf141_forest_sniper" }, + { 0x01A8, "character/mp_character_tf141_forest_riot" }, + { 0x01A9, "xmodelalias/alias_delta_heads" }, + { 0x01AA, "xmodelalias/alias_delta_heads_longsleeves" }, + { 0x01AB, "character/mp_character_delta_urban_assault_a" }, + { 0x01AC, "character/mp_character_delta_urban_assault_b" }, + { 0x01AD, "character/mp_character_delta_urban_lmg_a" }, + { 0x01AE, "character/mp_character_delta_urban_lmg_b" }, + { 0x01AF, "character/mp_character_delta_urban_shotgun" }, + { 0x01B0, "character/mp_character_delta_urban_smg_a" }, + { 0x01B1, "character/mp_character_delta_urban_smg_b" }, + { 0x01B2, "character/mp_character_delta_urban_smg_c" }, + { 0x01B3, "character/mp_character_delta_urban_riot" }, + { 0x01B4, "vehicle_scripts/_pavelow_noai" }, + { 0x01B5, "maps/mp/_fx" }, + { 0x01B6, "maps/mp/_compass" }, + { 0x01B7, "maps/mp/_menus" }, + { 0x01B8, "maps/mp/_crib" }, + { 0x01B9, "maps/mp/killstreaks/_autoshotgun" }, + { 0x01BA, "maps/mp/killstreaks/_tank" }, + { 0x01BB, "maps/mp/killstreaks/_mobilemortar" }, + { 0x01BC, "maps/mp/killstreaks/_a10" }, + { 0x01BD, "maps/mp/killstreaks/_teamammorefill" }, + { 0x01BE, "maps/mp/gametypes/_clientids" }, + { 0x01BF, "maps/mp/gametypes/_dev" }, + { 0x01C0, "maps/mp/gametypes/_globalentities" }, + { 0x01C1, "maps/mp/gametypes/_hardpoints" }, + { 0x01C2, "maps/mp/killstreaks/_aamissile" }, + { 0x01C3, "maps/mp/killstreaks/_aastrike" }, + { 0x01C4, "vehicle_scripts/_c130" }, + { 0x01C5, "mptype/mptype_us_army_assault" }, + { 0x01C6, "mptype/mptype_us_army_lmg" }, + { 0x01C7, "mptype/mptype_us_army_shotgun" }, + { 0x01C8, "mptype/mptype_us_army_riot" }, + { 0x01C9, "mptype/mptype_us_army_smg" }, + { 0x01CA, "mptype/mptype_us_army_sniper" }, + { 0x01CB, "mptype/mptype_opforce_arctic_assault" }, + { 0x01CC, "mptype/mptype_opforce_arctic_lmg" }, + { 0x01CD, "mptype/mptype_opforce_arctic_shotgun" }, + { 0x01CE, "mptype/mptype_opforce_arctic_smg" }, + { 0x01CF, "mptype/mptype_opforce_arctic_sniper" }, + { 0x01D0, "mptype/mptype_opforce_arctic_riot" }, + { 0x01D1, "mptype/mptype_seal_udt_assault" }, + { 0x01D2, "mptype/mptype_seal_udt_lmg" }, + { 0x01D3, "mptype/mptype_seal_udt_shotgun" }, + { 0x01D4, "mptype/mptype_seal_udt_smg" }, + { 0x01D5, "mptype/mptype_seal_udt_sniper" }, + { 0x01D6, "mptype/mptype_seal_udt_riot" }, + { 0x01D7, "mptype/mptype_opforce_comp_assault" }, + { 0x01D8, "mptype/mptype_opforce_comp_lmg" }, + { 0x01D9, "mptype/mptype_opforce_comp_shotgun" }, + { 0x01DA, "mptype/mptype_opforce_comp_smg" }, + { 0x01DB, "mptype/mptype_opforce_comp_sniper" }, + { 0x01DC, "mptype/mptype_opforce_comp_riot" }, + { 0x01DD, "character/mp_character_composite_sniper" }, + { 0x01DE, "mptype/mptype_opforce_airborne_assault" }, + { 0x01DF, "mptype/mptype_opforce_airborne_lmg" }, + { 0x01E0, "mptype/mptype_opforce_airborne_shotgun" }, + { 0x01E1, "mptype/mptype_opforce_airborne_smg" }, + { 0x01E2, "mptype/mptype_opforce_airborne_sniper" }, + { 0x01E3, "mptype/mptype_opforce_airborne_riot" }, + { 0x01E4, "mptype/mptype_opforce_militia_assault" }, + { 0x01E5, "mptype/mptype_opforce_militia_lmg" }, + { 0x01E6, "mptype/mptype_opforce_militia_shotgun" }, + { 0x01E7, "mptype/mptype_opforce_militia_smg" }, + { 0x01E8, "mptype/mptype_opforce_militia_sniper" }, + { 0x01E9, "mptype/mptype_opforce_militia_riot" }, + { 0x01EA, "mptype/mptype_tf141_arctic_assault" }, + { 0x01EB, "mptype/mptype_tf141_arctic_lmg" }, + { 0x01EC, "mptype/mptype_tf141_arctic_shotgun" }, + { 0x01ED, "mptype/mptype_tf141_arctic_smg" }, + { 0x01EE, "mptype/mptype_tf141_arctic_sniper" }, + { 0x01EF, "mptype/mptype_tf141_arctic_riot" }, + { 0x01F0, "mptype/mptype_tf141_desert_assault" }, + { 0x01F1, "mptype/mptype_tf141_desert_lmg" }, + { 0x01F2, "mptype/mptype_tf141_desert_shotgun" }, + { 0x01F3, "mptype/mptype_tf141_desert_smg" }, + { 0x01F4, "mptype/mptype_tf141_desert_sniper" }, + { 0x01F5, "mptype/mptype_tf141_desert_riot" }, + { 0x01F6, "mptype/mptype_tf141_forest_assault" }, + { 0x01F7, "mptype/mptype_tf141_forest_lmg" }, + { 0x01F8, "mptype/mptype_tf141_forest_shotgun" }, + { 0x01F9, "mptype/mptype_tf141_forest_smg" }, + { 0x01FA, "mptype/mptype_tf141_forest_sniper" }, + { 0x01FB, "mptype/mptype_tf141_forest_riot" }, + { 0x01FC, "mptype/mptype_delta_ucp_assault" }, + { 0x01FD, "mptype/mptype_delta_ucp_lmg" }, + { 0x01FE, "mptype/mptype_delta_ucp_shotgun" }, + { 0x01FF, "mptype/mptype_delta_ucp_smg" }, + { 0x0200, "mptype/mptype_delta_ucp_sniper" }, + { 0x0201, "mptype/mptype_delta_ucp_riot" }, + { 0x0202, "character/mp_character_delta_urban_assault_c" }, + { 0x0203, "xmodelalias/alias_gign_heads" }, + { 0x0204, "codescripts/delete" }, + { 0x0205, "codescripts/struct" }, + { 0x0206, "vehicle_scripts/_empty" }, + { 0x0207, "maps/_breach" }, + { 0x0208, "maps/_briefing" }, + { 0x0209, "maps/_cagedchickens" }, + { 0x020A, "maps/_carry_ai" }, + { 0x020B, "maps/_deadbody" }, + { 0x020C, "maps/_drone_ai" }, + { 0x020D, "maps/_drone_civilian" }, + { 0x020E, "maps/_flare" }, + { 0x020F, "maps/_flashbang" }, + { 0x0210, "maps/_float" }, + { 0x0211, "maps/_heli_ride" }, + { 0x0212, "maps/_hiding_door_anims" }, + { 0x0213, "maps/_hud_weapons" }, + { 0x0214, "maps/_inventory" }, + { 0x0215, "maps/_leak" }, + { 0x0216, "maps/_menus" }, + { 0x0217, "maps/_shellshock" }, + { 0x0218, "maps/_mortar" }, + { 0x0219, "maps/_overheat" }, + { 0x021A, "maps/_props" }, + { 0x021B, "maps/_radiation" }, + { 0x021C, "maps/_sea" }, + { 0x021D, "maps/_stealth_utility" }, + { 0x021E, "maps/_stealth_shared_utilities" }, + { 0x021F, "maps/_stealth_animation_funcs" }, + { 0x0220, "maps/_stealth_threat_enemy" }, + { 0x0221, "maps/_stealth_visibility_enemy" }, + { 0x0222, "maps/_stealth_visibility_friendly" }, + { 0x0223, "maps/_stealth_behavior_friendly" }, + { 0x0224, "maps/_stealth_behavior_enemy" }, + { 0x0225, "maps/_stealth_corpse_enemy" }, + { 0x0226, "maps/_stealth_corpse_system" }, + { 0x0227, "maps/_stealth_event_enemy" }, + { 0x0228, "maps/_stealth_color_friendly" }, + { 0x0229, "maps/_stealth_accuracy_friendly" }, + { 0x022A, "maps/_stealth_smartstance_friendly" }, + { 0x022B, "maps/_stealth_visibility_system" }, + { 0x022C, "maps/_stealth_vehicle" }, + { 0x022D, "maps/_treeburst" }, + { 0x022E, "maps/_vehicle_missile" }, + { 0x022F, "maps/_vehicle_spline" }, + { 0x0230, "maps/_vehicledrive" }, + { 0x0231, "maps/_weather" }, + { 0x0232, "maps/_wood" }, + { 0x0233, "maps/_audio_presets_music" }, + { 0x0234, "maps/_shg_common" }, + { 0x0235, "common_scripts/_destructible_types_anim_airconditioner" }, + { 0x0236, "maps/animated_models/fence_tarp_107x56_med_01" }, + { 0x0237, "maps/animated_models/fence_tarp_130x56_med_01" }, + { 0x0238, "maps/animated_models/fence_tarp_134x56_med_01" }, + { 0x0239, "maps/animated_models/fence_tarp_134x76_med_01" }, + { 0x023A, "maps/animated_models/fence_tarp_134x76_med_02" }, + { 0x023B, "maps/animated_models/fence_tarp_140x56_med_01" }, + { 0x023C, "maps/animated_models/fence_tarp_151x56_med_01" }, + { 0x023D, "maps/animated_models/fence_tarp_167x56_med_01" }, + { 0x023E, "maps/animated_models/foliage_desertbrush_1_sway" }, + { 0x023F, "maps/animated_models/foliage_pacific_bushtree01" }, + { 0x0240, "maps/animated_models/foliage_pacific_flowers06_sway" }, + { 0x0241, "maps/animated_models/oil_pump_jack01" }, + { 0x0242, "maps/animated_models/oil_pump_jack02" }, + { 0x0243, "maps/animated_models/windmill_spin_med" }, + { 0x0244, "maps/animated_models/windsock_large_wind_medium" }, + { 0x0245, "maps/createart/mp_dome_art" }, + { 0x0246, "maps/mp/_explosive_barrels" }, + { 0x0247, "maps/createfx/mp_dome_fx" }, + { 0x0248, "maps/createart/mp_dome_fog" }, + { 0x0249, "xmodelalias/alias_so_martyrdom_smg_bodies" }, + { 0x024A, "character/character_so_martyrdom" }, + { 0x024B, "xmodelalias/alias_africa_militia_heads_a" }, + { 0x024C, "xmodelalias/alias_africa_militia_hats_a" }, + { 0x024D, "xmodelalias/alias_africa_militia_hats_b" }, + { 0x024E, "xmodelalias/alias_africa_militia_hats_c" }, + { 0x024F, "character/character_africa_militia_smg_a" }, + { 0x0250, "character/character_africa_militia_smg_b" }, + { 0x0251, "character/character_africa_militia_smg_c" }, + { 0x0252, "xmodelalias/alias_so_regular_smg_heads" }, + { 0x0253, "character/character_so_regular_smg" }, + { 0x0254, "maps/_rambo" }, + { 0x0255, "xmodelalias/alias_so_veteran_ar_heads" }, + { 0x0256, "character/character_so_veteran_ar" }, + { 0x0257, "character/character_sp_juggernaut" }, + { 0x0258, "maps/_juggernaut" }, + { 0x0259, "character/character_so_juggernaut_mid" }, + { 0x025A, "maps/_riotshield" }, + { 0x025B, "character/character_so_juggernaut_explosive" }, + { 0x025C, "character/character_so_juggernaut_headshot" }, + { 0x025D, "xmodelalias/alias_chemwar_russian_heads_masked" }, + { 0x025E, "character/character_chemwar_russian_assault_a" }, + { 0x025F, "character/character_chemwar_russian_assault_m_b" }, + { 0x0260, "character/character_chemwar_russian_assault_m_c" }, + { 0x0261, "character/character_chemwar_russian_assault_m_d" }, + { 0x0262, "character/character_chemwar_russian_assault_m_e" }, + { 0x0263, "character/character_chemwar_russian_assault_aa" }, + { 0x0264, "character/character_chemwar_russian_assault_m_bb" }, + { 0x0265, "character/character_chemwar_russian_assault_m_cc" }, + { 0x0266, "character/character_chemwar_russian_assault_m_dd" }, + { 0x0267, "character/character_chemwar_russian_assault_m_ee" }, + { 0x0268, "xmodelalias/alias_so_russian_naval_bodies" }, + { 0x0269, "xmodelalias/alias_russian_naval_heads" }, + { 0x026A, "character/character_so_russian_naval_assault" }, + { 0x026B, "xmodelalias/alias_chemwar_russian_heads_so" }, + { 0x026C, "character/character_chemwar_m_d_so" }, + { 0x026D, "character/character_chemwar_m_dd_so" }, + { 0x026E, "xmodelalias/alias_so_hardened_ar_heads" }, + { 0x026F, "character/character_so_hardened_ar" }, + { 0x0270, "character/character_gign_paris_smg" }, + { 0x0271, "character/character_gign_paris_assault" }, + { 0x0272, "character/character_delta_elite_assault_aa" }, + { 0x0273, "character/character_delta_elite_assault_ab" }, + { 0x0274, "character/character_delta_elite_assault_ba" }, + { 0x0275, "character/character_delta_elite_assault_bb" }, + { 0x0276, "character/character_sp_german_sheperd_dog" }, + { 0x0277, "maps/_utility_joec" }, + { 0x0278, "maps/_squad_enemies" }, + { 0x0279, "maps/_sp_killstreaks" }, + { 0x027A, "maps/_remotemissile_utility" }, + { 0x027B, "maps/_remotemissile" }, + { 0x027C, "maps/_sp_airdrop" }, + { 0x027D, "maps/_so_survival_perks" }, + { 0x027E, "common_scripts/_sentry" }, + { 0x027F, "maps/_sp_airstrike" }, + { 0x0280, "maps/_so_survival_code" }, + { 0x0281, "maps/_chopperboss" }, + { 0x0282, "maps/_so_survival_loot" }, + { 0x0283, "bad_path_listener" }, + { 0x0284, "maps/_so_survival_ai" }, + { 0x0285, "vehicle_scripts/_mi17_noai" }, + { 0x0286, "vehicle_scripts/_littlebird" }, + { 0x0287, "vehicle_scripts/_ucav" }, + { 0x0288, "vehicle_scripts/_mi17" }, + { 0x0289, "vehicle_scripts/_blackhawk" }, + { 0x028A, "maps/_air_support_strobe" }, + { 0x028B, "maps/_so_survival" }, + { 0x028C, "get_attachment_fullname" }, + { 0x028D, "get_attachment_basename" }, + { 0x028E, "maps/_so_survival_armory" }, + { 0x028F, "maps/_so_survival_challenge" }, + { 0x0290, "maps/_so_survival_dialog" }, + { 0x0291, "vehicle_scripts/_littlebird_player" }, + { 0x0292, "maps/_shg_fx" }, + { 0x0293, "maps/createart/ny_manhattan_fog" }, + { 0x0294, "maps/createart/ny_manhattan_art" }, + { 0x0295, "maps/cinematic_setups/nym_hind_finale" }, + { 0x0296, "maps/cinematic_setups/nym_sewer_exit" }, + { 0x0297, "maps/_c4" }, + { 0x0298, "xmodelalias/alias_russian_military_manhattan_heads" }, + { 0x0299, "character/character_opforce_manhattan_assault_a" }, + { 0x029A, "character/character_russian_military_rpg_a" }, + { 0x029B, "character/character_opforce_manhattan_shgn_a" }, + { 0x029C, "character/character_opforce_manhattan_lmg_a" }, + { 0x029D, "xmodelalias/alias_rangers_heads" }, + { 0x029E, "character/character_rangers_bdu_assault_a" }, + { 0x029F, "xmodelalias/alias_air_crew_heads" }, + { 0x02A0, "character/character_air_crew_manhattan" }, + { 0x02A1, "character/character_opforce_manhattan_rpg_a" }, + { 0x02A2, "character/character_delta_elite_smg_a" }, + { 0x02A3, "character/character_delta_elite_smg_b" }, + { 0x02A4, "maps/_minigun_viewmodel" }, + { 0x02A5, "maps/_minigun" }, + { 0x02A6, "maps/createfx/ny_manhattan_fx" }, + { 0x02A7, "vehicle_scripts/_gaz_dshk" }, + { 0x02A8, "vehicle_scripts/_hind" }, + { 0x02A9, "vehicle_scripts/_ss_n_12" }, + { 0x02AA, "maps/animated_models/fence_tarp_108x76_med_01" }, + { 0x02AB, "maps/animated_models/fence_tarp_132x82_med_01" }, + { 0x02AC, "maps/_predator2" }, + { 0x02AD, "maps/_xm25" }, + { 0x02AE, "vehicle_scripts/_blackhawk_minigun" }, + { 0x02AF, "vehicle_scripts/_stryker50cal" }, + { 0x02B0, "initfx" }, + { 0x02B1, "func" }, + { 0x02B2, "main" }, + { 0x02B3, "codecallback_startgametype" }, + { 0x02B4, "codecallback_playerconnect" }, + { 0x02B5, "codecallback_playerdisconnect" }, + { 0x02B6, "codecallback_playerdamage" }, + { 0x02B7, "codecallback_playerkilled" }, + { 0x02B8, "codecallback_vehicledamage" }, + { 0x02B9, "codecallback_codeendgame" }, + { 0x02BA, "codecallback_playerlaststand" }, + { 0x02BB, "codecallback_playermigrated" }, + { 0x02BC, "codecallback_hostmigration" }, + { 0x02BD, "initstructs" }, + { 0x02BE, "createstruct" }, + { 0x02BF, "end_script" }, + { 0x02C0, "init" }, + { 0x02C1, "precache" }, + { 0x02C2, "spawner" }, + { 0x02C3, "code_classname" }, + { 0x02C4, "classname" }, + { 0x02C5, "origin" }, + { 0x02C6, "model" }, + { 0x02C7, "spawnflags" }, + { 0x02C8, "target" }, + { 0x02C9, "targetname" }, + { 0x02CA, "count" }, + { 0x02CB, "health" }, + { 0x02CC, "dmg" }, + { 0x02CD, "angles" }, + { 0x02CE, "birthtime" }, + { 0x02CF, "script_linkname" }, + { 0x02D0, "slidevelocity" }, + { 0x02D1, "name" }, + { 0x02D2, "sessionteam" }, + { 0x02D3, "sessionstate" }, + { 0x02D4, "maxhealth" }, + { 0x02D5, "score" }, + { 0x02D6, "deaths" }, + { 0x02D7, "statusicon" }, + { 0x02D8, "headicon" }, + { 0x02D9, "headiconteam" }, + { 0x02DA, "canclimbladders" }, + { 0x02DB, "kills" }, + { 0x02DC, "assists" }, + { 0x02DD, "hasradar" }, + { 0x02DE, "isradarblocked" }, + { 0x02DF, "radarstrength" }, + { 0x02E0, "radarshowenemydirection" }, + { 0x02E1, "radarmode" }, + { 0x02E2, "forcespectatorclient" }, + { 0x02E3, "killcamentity" }, + { 0x02E4, "killcamentitylookat" }, + { 0x02E5, "archivetime" }, + { 0x02E6, "psoffsettime" }, + { 0x02E7, "pers" }, + { 0x02E8, "x" }, + { 0x02E9, "y" }, + { 0x02EA, "z" }, + { 0x02EB, "fontscale" }, + { 0x02EC, "font" }, + { 0x02ED, "alignx" }, + { 0x02EE, "aligny" }, + { 0x02EF, "horzalign" }, + { 0x02F0, "vertalign" }, + { 0x02F1, "color" }, + { 0x02F2, "alpha" }, + { 0x02F3, "label" }, + { 0x02F4, "sort" }, + { 0x02F5, "foreground" }, + { 0x02F6, "lowresbackground" }, + { 0x02F7, "hidewhendead" }, + { 0x02F8, "hidewheninmenu" }, + { 0x02F9, "splatter" }, + { 0x02FA, "glowcolor" }, + { 0x02FB, "glowalpha" }, + { 0x02FC, "archived" }, + { 0x02FD, "hidein3rdperson" }, + { 0x02FE, "hidewhenindemo" }, + { 0x02FF, "veh_speed" }, + { 0x0300, "veh_pathspeed" }, + { 0x0301, "veh_transmission" }, + { 0x0302, "veh_pathdir" }, + { 0x0303, "veh_pathtype" }, + { 0x0304, "veh_topspeed" }, + { 0x0305, "veh_brake" }, + { 0x0306, "veh_throttle" }, + { 0x0307, "script_noteworthy" }, + { 0x0308, "speed" }, + { 0x0309, "lookahead" }, + { 0x030A, "ambienttrack" }, + { 0x030B, "ambienttrack_ac130" }, + { 0x030C, "message" }, + { 0x030D, "northyaw" }, + { 0x030E, "wait" }, + { 0x030F, "radius" }, + { 0x0310, "height" }, + { 0x0311, "accumulate" }, + { 0x0312, "threshold" }, + { 0x0313, "cursorhint" }, + { 0x0314, "hintstring" }, + { 0x0315, "script_delay" }, + { 0x0316, "script_visionset" }, + { 0x0317, "script_zone" }, + { 0x0318, "rightarc" }, + { 0x0319, "leftarc" }, + { 0x031A, "toparc" }, + { 0x031B, "bottomarc" }, + { 0x031C, "yawconvergencetime" }, + { 0x031D, "pitchconvergencetime" }, + { 0x031E, "suppressionTime" }, + { 0x031F, "maxrange" }, + { 0x0320, "aiSpread" }, + { 0x0321, "damage" }, + { 0x0322, "playerSpread" }, + { 0x0323, "convergencetime" }, + { 0x0324, "weaponinfo" }, + { 0x0325, "vehicletype" }, + { 0x0326, "type" }, + { 0x0327, "accuracy" }, + { 0x0328, "lookforward" }, + { 0x0329, "lookright" }, + { 0x032A, "lookup" }, + { 0x032B, "fovcosine" }, + { 0x032C, "fovcosinebusy" }, + { 0x032D, "upaimlimit" }, + { 0x032E, "downaimlimit" }, + { 0x032F, "rightaimlimit" }, + { 0x0330, "leftaimlimit" }, + { 0x0331, "maxsightdistsqrd" }, + { 0x0332, "sightlatency" }, + { 0x0333, "ignoreclosefoliage" }, + { 0x0334, "followmin" }, + { 0x0335, "followmax" }, + { 0x0336, "chainfallback" }, + { 0x0337, "chainnode" }, + { 0x0338, "interval" }, + { 0x0339, "teammovewaittime" }, + { 0x033A, "damagetaken" }, + { 0x033B, "damagedir" }, + { 0x033C, "damageyaw" }, + { 0x033D, "damagelocation" }, + { 0x033E, "damageweapon" }, + { 0x033F, "damagemod" }, + { 0x0340, "proneok" }, + { 0x0341, "walkdistfacingmotion" }, + { 0x0342, "walkdist" }, + { 0x0343, "desiredangle" }, + { 0x0344, "pacifist" }, + { 0x0345, "pacifistwait" }, + { 0x0346, "footstepdetectdist" }, + { 0x0347, "footstepdetectdistwalk" }, + { 0x0348, "footstepdetectdistsprint" }, + { 0x0349, "reactiontargetpos" }, + { 0x034A, "newenemyreactiondistsq" }, + { 0x034B, "ignoreexplosionevents" }, + { 0x034C, "ignoresuppression" }, + { 0x034D, "suppressionwait" }, + { 0x034E, "suppressionduration" }, + { 0x034F, "suppressionstarttime" }, + { 0x0350, "suppressionmeter" }, + { 0x0351, "weapon" }, + { 0x0352, "dontavoidplayer" }, + { 0x0353, "grenadeawareness" }, + { 0x0354, "grenade" }, + { 0x0355, "grenadeweapon" }, + { 0x0356, "grenadeammo" }, + { 0x0357, "favoriteenemy" }, + { 0x0358, "highlyawareradius" }, + { 0x0359, "minpaindamage" }, + { 0x035A, "allowpain" }, + { 0x035B, "allowdeath" }, + { 0x035C, "delayeddeath" }, + { 0x035D, "diequietly" }, + { 0x035E, "forceragdollimmediate" }, + { 0x035F, "providecoveringfire" }, + { 0x0360, "doingambush" }, + { 0x0361, "combatmode" }, + { 0x0362, "alertlevel" }, + { 0x0363, "alertlevelint" }, + { 0x0364, "useable" }, + { 0x0365, "ignoretriggers" }, + { 0x0366, "pushable" }, + { 0x0367, "script_pushable" }, + { 0x0368, "dropweapon" }, + { 0x0369, "drawoncompass" }, + { 0x036A, "groundtype" }, + { 0x036B, "anim_pose" }, + { 0x036C, "goalradius" }, + { 0x036D, "goalheight" }, + { 0x036E, "goalpos" }, + { 0x036F, "nodeoffsetpos" }, + { 0x0370, "ignoreforfixednodesafecheck" }, + { 0x0371, "fixednode" }, + { 0x0372, "fixednodesaferadius" }, + { 0x0373, "pathgoalpos" }, + { 0x0374, "pathrandompercent" }, + { 0x0375, "usechokepoints" }, + { 0x0376, "stopanimdistsq" }, + { 0x0377, "lastenemysightpos" }, + { 0x0378, "pathenemylookahead" }, + { 0x0379, "pathenemyfightdist" }, + { 0x037A, "meleeattackdist" }, + { 0x037B, "movemode" }, + { 0x037C, "usecombatscriptatcover" }, + { 0x037D, "safetochangescript" }, + { 0x037E, "keepclaimednode" }, + { 0x037F, "keepclaimednodeifvalid" }, + { 0x0380, "keepnodeduringscriptedanim" }, + { 0x0381, "dodangerreact" }, + { 0x0382, "dangerreactduration" }, + { 0x0383, "nododgemove" }, + { 0x0384, "leanamount" }, + { 0x0385, "turnrate" }, + { 0x0386, "badplaceawareness" }, + { 0x0387, "damageshield" }, + { 0x0388, "nogrenadereturnthrow" }, + { 0x0389, "noattackeraccuracymod" }, + { 0x038A, "frontshieldanglecos" }, + { 0x038B, "lookaheaddir" }, + { 0x038C, "lookaheaddist" }, + { 0x038D, "lookaheadhitsstairs" }, + { 0x038E, "velocity" }, + { 0x038F, "prevanimdelta" }, + { 0x0390, "exposedduration" }, + { 0x0391, "requestarrivalnotify" }, + { 0x0392, "scriptedarrivalent" }, + { 0x0393, "goingtoruntopos" }, + { 0x0394, "engagemindist" }, + { 0x0395, "engageminfalloffdist" }, + { 0x0396, "engagemaxdist" }, + { 0x0397, "engagemaxfalloffdist" }, + { 0x0398, "finalaccuracy" }, + { 0x0399, "facemotion" }, + { 0x039A, "gunblockedbywall" }, + { 0x039B, "relativedir" }, + { 0x039C, "lockorientation" }, + { 0x039D, "maxfaceenemydist" }, + { 0x039E, "stairsstate" }, + { 0x039F, "script" }, + { 0x03A0, "prevscript" }, + { 0x03A1, "threatbias" }, + { 0x03A2, "syncedmeleetarget" }, + { 0x03A3, "ignoreme" }, + { 0x03A4, "ignoreall" }, + { 0x03A5, "maxvisibledist" }, + { 0x03A6, "surprisedbymedistsq" }, + { 0x03A7, "ignorerandombulletdamage" }, + { 0x03A8, "dodamagetoall" }, + { 0x03A9, "turretinvulnerability" }, + { 0x03AA, "onlygoodnearestnodes" }, + { 0x03AB, "takedamage" }, + { 0x03AC, "playername" }, + { 0x03AD, "deathinvulnerabletime" }, + { 0x03AE, "criticalbulletdamagedist" }, + { 0x03AF, "attackercount" }, + { 0x03B0, "damagemultiplier" }, + { 0x03B1, "laststand" }, + { 0x03B2, "motiontrackerenabled" }, + { 0x03B3, "team" }, + { 0x03B4, "threatbiasgroup" }, + { 0x03B5, "node" }, + { 0x03B6, "prevnode" }, + { 0x03B7, "enemy" }, + { 0x03B8, "lastattacker" }, + { 0x03B9, "attackeraccuracy" }, + { 0x03BA, "width" }, + { 0x03BB, "enable" }, + { 0x03BC, "freecamera" }, + { 0x03BD, "fov" }, + { 0x03BE, "dofnear" }, + { 0x03BF, "doffar" }, + { 0x03C0, "look" }, + { 0x03C1, "up" }, + { 0x03C2, "right" }, + { 0x03C3, "thermalbodymaterial" }, + { 0x03C4, "entity" }, + { 0x03C5, "tag" }, + { 0x03C6, "nearz" }, + { 0x03C7, "blurradius" }, + { 0x03C8, "lod" }, + { 0x03C9, "clipdistance" }, + { 0x03CA, "enableshadows" }, + { 0x03CB, "visionsetnakedduration" }, + { 0x03CC, "visionsetnaked" }, + { 0x03CD, "visionsetnightduration" }, + { 0x03CE, "visionsetnight" }, + { 0x03CF, "visionsetmissilecamduration" }, + { 0x03D0, "visionsetmissilecam" }, + { 0x03D1, "visionsetthermalduration" }, + { 0x03D2, "visionsetthermal" }, + { 0x03D3, "visionsetpainduration" }, + { 0x03D4, "visionsetpain" }, + { 0x03D5, "activevisionset" }, + { 0x03D6, "activevisionsetduration" }, + { 0x03D7, "animscript" }, + { 0x03D8, "anglelerprate" }, + { 0x03D9, "activator" }, + { 0x03DA, "gravity" }, + { 0x03DB, "ambient" }, + { 0x03DC, "diffusefraction" }, + { 0x03DD, "sunlight" }, + { 0x03DE, "suncolor" }, + { 0x03DF, "sundirection" }, + { 0x03E0, "reflection_clear_color" }, + { 0x03E1, "minusedistsq" }, + { 0x03E2, "owner" }, + { 0x03E3, "create_lock" }, + { 0x03E4, "exploder_before_load" }, + { 0x03E5, "exploderfunction" }, + { 0x03E6, "exploder_after_load" }, + { 0x03E7, "server_culled_sounds" }, + { 0x03E8, "createfx_enabled" }, + { 0x03E9, "createfxent" }, + { 0x03EA, "set_forward_and_up_vectors" }, + { 0x03EB, "v" }, + { 0x03EC, "print_org" }, + { 0x03ED, "oneshotfx" }, + { 0x03EE, "exploderfx" }, + { 0x03EF, "createexploder" }, + { 0x03F0, "createfxexploders" }, + { 0x03F1, "script_exploder" }, + { 0x03F2, "script_fxid" }, + { 0x03F3, "script_firefx" }, + { 0x03F4, "script_firefxdelay" }, + { 0x03F5, "script_firefxsound" }, + { 0x03F6, "script_sound" }, + { 0x03F7, "script_earthquake" }, + { 0x03F8, "script_damage" }, + { 0x03F9, "script_radius" }, + { 0x03FA, "script_soundalias" }, + { 0x03FB, "script_firefxtimeout" }, + { 0x03FC, "script_repeat" }, + { 0x03FD, "script_delay_min" }, + { 0x03FE, "script_delay_max" }, + { 0x03FF, "script_exploder_group" }, + { 0x0400, "targetpos" }, + { 0x0401, "_script_exploders" }, + { 0x0402, "createfx_showorigin" }, + { 0x0403, "loopfx" }, + { 0x0404, "createloopeffect" }, + { 0x0405, "create_looper" }, + { 0x0406, "_effect" }, + { 0x0407, "looper" }, + { 0x0408, "create_loopsound" }, + { 0x0409, "loop_fx_sound" }, + { 0x040A, "create_interval_sound" }, + { 0x040B, "loop_fx_sound_interval" }, + { 0x040C, "loopfxthread" }, + { 0x040D, "waitframe" }, + { 0x040E, "fxstart" }, + { 0x040F, "timeout" }, + { 0x0410, "fxstop" }, + { 0x0411, "loopfxchangeid" }, + { 0x0412, "loopfxchangeorg" }, + { 0x0413, "loopfxchangedelay" }, + { 0x0414, "loopfxdeletion" }, + { 0x0415, "loopfxstop" }, + { 0x0416, "loopsound" }, + { 0x0417, "loopsoundthread" }, + { 0x0418, "gunfireloopfx" }, + { 0x0419, "gunfireloopfxthread" }, + { 0x041A, "gunfireloopfxvec" }, + { 0x041B, "gunfireloopfxvecthread" }, + { 0x041C, "fxfireloopmod" }, + { 0x041D, "setfireloopmod" }, + { 0x041E, "setup_fx" }, + { 0x041F, "script_fxcommand" }, + { 0x0420, "script_fxstart" }, + { 0x0421, "script_fxstop" }, + { 0x0422, "burnville_paratrooper_hack" }, + { 0x0423, "burnville_paratrooper_hack_loop" }, + { 0x0424, "create_triggerfx" }, + { 0x0425, "verify_effects_assignment" }, + { 0x0426, "_missing_fx" }, + { 0x0427, "verify_effects_assignment_print" }, + { 0x0428, "oneshotfxthread" }, + { 0x0429, "menu" }, + { 0x042A, "create_fx_menu" }, + { 0x042B, "setmenu" }, + { 0x042C, "button_is_clicked" }, + { 0x042D, "createloopsound" }, + { 0x042E, "createnewexploder" }, + { 0x042F, "createintervalsound" }, + { 0x0430, "last_displayed_ent" }, + { 0x0431, "clear_settable_fx" }, + { 0x0432, "clear_fx_hudelements" }, + { 0x0433, "_exit_menu" }, + { 0x0434, "clear_entity_selection" }, + { 0x0435, "update_selected_entities" }, + { 0x0436, "get_last_selected_entity" }, + { 0x0437, "selected_fx_ents" }, + { 0x0438, "menu_fx_creation" }, + { 0x0439, "func_get_level_fx" }, + { 0x043A, "effect_list_offset" }, + { 0x043B, "effect_list_offset_max" }, + { 0x043C, "createoneshoteffect" }, + { 0x043D, "finish_creating_entity" }, + { 0x043E, "post_entity_creation_function" }, + { 0x043F, "select_last_entity" }, + { 0x0440, "move_selection_to_cursor" }, + { 0x0441, "menu_init" }, + { 0x0442, "createfx_options" }, + { 0x0443, "mp_createfx" }, + { 0x0444, "createfxmasks" }, + { 0x0445, "get_last_selected_ent" }, + { 0x0446, "entities_are_selected" }, + { 0x0447, "menu_change_selected_fx" }, + { 0x0448, "prepare_option_for_change" }, + { 0x0449, "createfx_centerprint" }, + { 0x044A, "createfx_inputlocked" }, + { 0x044B, "createfxhudelements" }, + { 0x044C, "menu_fx_option_set" }, + { 0x044D, "apply_option_to_selected_fx" }, + { 0x044E, "set_option_index" }, + { 0x044F, "selected_fx_option_index" }, + { 0x0450, "get_selected_option" }, + { 0x0451, "mask" }, + { 0x0452, "addoption" }, + { 0x0453, "get_option" }, + { 0x0454, "display_fx_info" }, + { 0x0455, "set_fx_hudelement" }, + { 0x0456, "createfx_hudelements" }, + { 0x0457, "display_fx_add_options" }, + { 0x0458, "add_option_to_selected_entities" }, + { 0x0459, "menunone" }, + { 0x045A, "draw_effects_list" }, + { 0x045B, "increment_list_offset" }, + { 0x045C, "createeffect" }, + { 0x045D, "drawn" }, + { 0x045E, "createfxbyfxid" }, + { 0x045F, "getloopeffectdelaydefault" }, + { 0x0460, "getoneshoteffectdelaydefault" }, + { 0x0461, "getexploderdelaydefault" }, + { 0x0462, "getintervalsounddelaymindefault" }, + { 0x0463, "getintervalsounddelaymaxdefault" }, + { 0x0464, "add_effect" }, + { 0x0465, "createexploderex" }, + { 0x0466, "set_origin_and_angles" }, + { 0x0467, "createfx_common" }, + { 0x0468, "flag_init" }, + { 0x0469, "createfx" }, + { 0x046A, "createfx_loopcounter" }, + { 0x046B, "createfxlogic" }, + { 0x046C, "get_template_level" }, + { 0x046D, "func_position_player" }, + { 0x046E, "location" }, + { 0x046F, "cleartextmarker" }, + { 0x0470, "selectedmove_up" }, + { 0x0471, "selectedmove_forward" }, + { 0x0472, "selectedmove_right" }, + { 0x0473, "selectedrotate_pitch" }, + { 0x0474, "selectedrotate_roll" }, + { 0x0475, "selectedrotate_yaw" }, + { 0x0476, "selected_fx" }, + { 0x0477, "createfx_lockedlist" }, + { 0x0478, "createfx_draw_enabled" }, + { 0x0479, "buttonisheld" }, + { 0x047A, "player" }, + { 0x047B, "fx_rotating" }, + { 0x047C, "createfx_selecting" }, + { 0x047D, "createfxcursor" }, + { 0x047E, "buttonclick" }, + { 0x047F, "button_is_kb" }, + { 0x0480, "fx_highlightedent" }, + { 0x0481, "func_process_fx_rotater" }, + { 0x0482, "func_position_player_get" }, + { 0x0483, "copy_angles_of_selected_ents" }, + { 0x0484, "reset_axis_of_selected_ents" }, + { 0x0485, "last_selected_entity_has_changed" }, + { 0x0486, "drop_selection_to_ground" }, + { 0x0487, "set_off_exploders" }, + { 0x0488, "exploder" }, + { 0x0489, "draw_distance" }, + { 0x048A, "createfx_autosave" }, + { 0x048B, "flag_waitopen" }, + { 0x048C, "rotate_over_time" }, + { 0x048D, "delete_pressed" }, + { 0x048E, "remove_selected_option" }, + { 0x048F, "remove_option" }, + { 0x0490, "delete_selection" }, + { 0x0491, "insert_effect" }, + { 0x0492, "show_help" }, + { 0x0493, "select_all_exploders_of_currently_selected" }, + { 0x0494, "copy_ents" }, + { 0x0495, "stored_ents" }, + { 0x0496, "textalpha" }, + { 0x0497, "paste_ents" }, + { 0x0498, "add_and_select_entity" }, + { 0x0499, "get_center_of_array" }, + { 0x049A, "ent_draw_axis" }, + { 0x049B, "rotation_is_occuring" }, + { 0x049C, "print_fx_options" }, + { 0x049D, "createfxdefaults" }, + { 0x049E, "entity_highlight_disable" }, + { 0x049F, "entity_highlight_enable" }, + { 0x04A0, "toggle_createfx_drawing" }, + { 0x04A1, "manipulate_createfx_ents" }, + { 0x04A2, "reset_fx_hud_colors" }, + { 0x04A3, "button_is_held" }, + { 0x04A4, "toggle_entity_selection" }, + { 0x04A5, "select_entity" }, + { 0x04A6, "ent_is_highlighted" }, + { 0x04A7, "deselect_entity" }, + { 0x04A8, "index_is_selected" }, + { 0x04A9, "ent_is_selected" }, + { 0x04AA, "draw_axis" }, + { 0x04AB, "fxhudelements" }, + { 0x04AC, "createfx_centerprint_thread" }, + { 0x04AD, "buttondown" }, + { 0x04AE, "buttonpressed_internal" }, + { 0x04AF, "get_selected_move_vector" }, + { 0x04B0, "process_button_held_and_clicked" }, + { 0x04B1, "locked" }, + { 0x04B2, "kb_locked" }, + { 0x04B3, "add_button" }, + { 0x04B4, "add_kb_button" }, + { 0x04B5, "set_anglemod_move_vector" }, + { 0x04B6, "cfxprintlnstart" }, + { 0x04B7, "fileprint_launcher_start_file" }, + { 0x04B8, "cfxprintln" }, + { 0x04B9, "fileprint_launcher" }, + { 0x04BA, "cfxprintlnend" }, + { 0x04BB, "fileprint_launcher_end_file" }, + { 0x04BC, "func_updatefx" }, + { 0x04BD, "hack_start" }, + { 0x04BE, "get_player" }, + { 0x04BF, "createfx_orgranize_array" }, + { 0x04C0, "stop_fx_looper" }, + { 0x04C1, "stop_loopsound" }, + { 0x04C2, "_effect_keys" }, + { 0x04C3, "alphabetize" }, + { 0x04C4, "restart_fx_looper" }, + { 0x04C5, "process_fx_rotater" }, + { 0x04C6, "generate_fx_log" }, + { 0x04C7, "scriptprintln" }, + { 0x04C8, "debugprintln" }, + { 0x04C9, "draw_debug_line" }, + { 0x04CA, "waittillend" }, + { 0x04CB, "noself_func" }, + { 0x04CC, "self_func" }, + { 0x04CD, "randomvector" }, + { 0x04CE, "randomvectorrange" }, + { 0x04CF, "angle_dif" }, + { 0x04D0, "sign" }, + { 0x04D1, "track" }, + { 0x04D2, "current_target" }, + { 0x04D3, "get_enemy_team" }, + { 0x04D4, "clear_exception" }, + { 0x04D5, "defaultexception" }, + { 0x04D6, "exception" }, + { 0x04D7, "set_exception" }, + { 0x04D8, "set_all_exceptions" }, + { 0x04D9, "cointoss" }, + { 0x04DA, "choose_from_weighted_array" }, + { 0x04DB, "get_cumulative_weights" }, + { 0x04DC, "waittill_string" }, + { 0x04DD, "waittill_multiple" }, + { 0x04DE, "threads" }, + { 0x04DF, "waittill_multiple_ents" }, + { 0x04E0, "waittill_any_return" }, + { 0x04E1, "waittill_any_timeout" }, + { 0x04E2, "_timeout" }, + { 0x04E3, "waittill_any" }, + { 0x04E4, "waittill_any_ents" }, + { 0x04E5, "isflashed" }, + { 0x04E6, "flashendtime" }, + { 0x04E7, "flag_exist" }, + { 0x04E8, "flag" }, + { 0x04E9, "init_flags" }, + { 0x04EA, "flags_lock" }, + { 0x04EB, "generic_index" }, + { 0x04EC, "sp_stat_tracking_func" }, + { 0x04ED, "flag_struct" }, + { 0x04EE, "trigger_flags" }, + { 0x04EF, "empty_init_func" }, + { 0x04F0, "issuffix" }, + { 0x04F1, "flag_set" }, + { 0x04F2, "assign_unique_id" }, + { 0x04F3, "unique_id" }, + { 0x04F4, "flag_wait" }, + { 0x04F5, "flag_clear" }, + { 0x04F6, "waittill_either" }, + { 0x04F7, "array_thread" }, + { 0x04F8, "array_call" }, + { 0x04F9, "array_thread4" }, + { 0x04FA, "array_thread5" }, + { 0x04FB, "trigger_on" }, + { 0x04FC, "trigger_on_proc" }, + { 0x04FD, "realorigin" }, + { 0x04FE, "trigger_off" }, + { 0x04FF, "trigger_off_proc" }, + { 0x0500, "set_trigger_flag_permissions" }, + { 0x0501, "update_trigger_based_on_flags" }, + { 0x0502, "script_flag_true" }, + { 0x0503, "script_flag_false" }, + { 0x0504, "trigger_func" }, + { 0x0505, "create_flags_and_return_tokens" }, + { 0x0506, "init_trigger_flags" }, + { 0x0507, "getstruct" }, + { 0x0508, "struct_class_names" }, + { 0x0509, "getstructarray" }, + { 0x050A, "struct_class_init" }, + { 0x050B, "struct" }, + { 0x050C, "fileprint_start" }, + { 0x050D, "fileprint_map_start" }, + { 0x050E, "fileprint_map_header" }, + { 0x050F, "fileprint_map_keypairprint" }, + { 0x0510, "fileprint_map_entity_start" }, + { 0x0511, "fileprint_map_entity_end" }, + { 0x0512, "fileprint_radiant_vec" }, + { 0x0513, "array_remove" }, + { 0x0514, "array_remove_array" }, + { 0x0515, "array_removeundefined" }, + { 0x0516, "array_levelthread" }, + { 0x0517, "array_levelcall" }, + { 0x0518, "add_to_array" }, + { 0x0519, "flag_assert" }, +// { 0x051A, "" }, + { 0x051B, "flag_wait_either_return" }, + { 0x051C, "flag_wait_any" }, + { 0x051D, "flag_wait_any_return" }, + { 0x051E, "flag_wait_all" }, + { 0x051F, "flag_wait_or_timeout" }, + { 0x0520, "flag_waitopen_or_timeout" }, + { 0x0521, "wait_for_flag_or_time_elapses" }, + { 0x0522, "delaycall" }, + { 0x0523, "delaycall_proc" }, + { 0x0524, "noself_delaycall" }, + { 0x0525, "noself_delaycall_proc" }, + { 0x0526, "issp" }, + { 0x0527, "issp_towerdefense" }, + { 0x0528, "string_starts_with" }, + { 0x0529, "plot_points" }, + { 0x052A, "draw_line_for_time" }, + { 0x052B, "array_combine" }, + { 0x052C, "flat_angle" }, + { 0x052D, "flat_origin" }, + { 0x052E, "draw_arrow_time" }, + { 0x052F, "get_linked_ents" }, + { 0x0530, "script_linkto" }, + { 0x0531, "get_linked_vehicle_nodes" }, + { 0x0532, "get_linked_ent" }, + { 0x0533, "get_linked_vehicle_node" }, + { 0x0534, "get_links" }, + { 0x0535, "run_thread_on_targetname" }, + { 0x0536, "getnodearrayfunction" }, + { 0x0537, "run_thread_on_noteworthy" }, + { 0x0538, "draw_arrow" }, +// { 0x0539, "" }, + { 0x053A, "fxexists" }, + { 0x053B, "print_csv_asset" }, + { 0x053C, "csv_lines" }, + { 0x053D, "fileprint_csv_start" }, + { 0x053E, "_loadfx" }, + { 0x053F, "getlastweapon" }, + { 0x0540, "saved_lastweapon" }, + { 0x0541, "playerunlimitedammothread" }, + { 0x0542, "isusabilityenabled" }, + { 0x0543, "disabledusability" }, + { 0x0544, "_disableusability" }, + { 0x0545, "_enableusability" }, + { 0x0546, "resetusability" }, + { 0x0547, "_disableweapon" }, + { 0x0548, "disabledweapon" }, + { 0x0549, "_enableweapon" }, + { 0x054A, "isweaponenabled" }, + { 0x054B, "_disableweaponswitch" }, + { 0x054C, "disabledweaponswitch" }, + { 0x054D, "_enableweaponswitch" }, + { 0x054E, "isweaponswitchenabled" }, + { 0x054F, "_disableoffhandweapons" }, + { 0x0550, "disabledoffhandweapons" }, + { 0x0551, "_enableoffhandweapons" }, + { 0x0552, "isoffhandweaponenabled" }, + { 0x0553, "random" }, + { 0x0554, "spawn_tag_origin" }, + { 0x0555, "waittill_notify_or_timeout" }, + { 0x0556, "fileprintlauncher_linecount" }, + { 0x0557, "launcher_write_clipboard" }, + { 0x0558, "isdestructible" }, + { 0x0559, "destructible_type" }, + { 0x055A, "pauseeffect" }, + { 0x055B, "activate_individual_exploder" }, + { 0x055C, "brush_delete" }, + { 0x055D, "connectpathsfunction" }, + { 0x055E, "exploded" }, + { 0x055F, "brush_throw" }, + { 0x0560, "get_target_ent" }, + { 0x0561, "getnodefunction" }, + { 0x0562, "brush_show" }, +// { 0x0563, "" }, + { 0x0564, "brush_shown" }, + { 0x0565, "disconnect_paths" }, + { 0x0566, "disconnectpathsfunction" }, + { 0x0567, "exploder_earthquake" }, + { 0x0568, "do_earthquake" }, + { 0x0569, "earthquake" }, + { 0x056A, "exploder_rumble" }, + { 0x056B, "exploder_delay" }, + { 0x056C, "exploder_damage" }, + { 0x056D, "effect_loopsound" }, + { 0x056E, "loopsound_ent" }, + { 0x056F, "play_loopsound_in_space" }, + { 0x0570, "sound_effect" }, + { 0x0571, "effect_soundalias" }, + { 0x0572, "play_sound_in_space" }, + { 0x0573, "cannon_effect" }, + { 0x0574, "exploder_playsound" }, + { 0x0575, "fire_effect" }, + { 0x0576, "first_frame" }, + { 0x0577, "loop_sound_delete" }, + { 0x0578, "activate_exploder" }, + { 0x0579, "is_later_in_alphabet" }, + { 0x057A, "alphabet_compare" }, + { 0x057B, "play_loop_sound_on_entity" }, + { 0x057C, "stop_loop_sound_on_entity" }, + { 0x057D, "delete_on_death" }, + { 0x057E, "error" }, + { 0x057F, "create_dvar" }, + { 0x0580, "void" }, + { 0x0581, "tag_project" }, + { 0x0582, "ter_op" }, + { 0x0583, "lock" }, + { 0x0584, "max_count" }, + { 0x0585, "is_locked" }, + { 0x0586, "unlock_wait" }, + { 0x0587, "unlock" }, + { 0x0588, "unlock_thread" }, + { 0x0589, "template_script" }, + { 0x058A, "setparent" }, + { 0x058B, "parent" }, + { 0x058C, "point" }, + { 0x058D, "yoffset" }, + { 0x058E, "xoffset" }, + { 0x058F, "relativepoint" }, + { 0x0590, "getparent" }, + { 0x0591, "addchild" }, +// { 0x0592, "" }, + { 0x0593, "index" }, + { 0x0594, "removechild" }, + { 0x0595, "setpoint" }, + { 0x0596, "uiparent" }, + { 0x0597, "elemtype" }, + { 0x0598, "setpointbar" }, + { 0x0599, "bar" }, + { 0x059A, "padding" }, + { 0x059B, "frac" }, + { 0x059C, "updatebar" }, + { 0x059D, "shader" }, + { 0x059E, "hidebar" }, + { 0x059F, "orig_alpha" }, + { 0x05A0, "createfontstring" }, + { 0x05A1, "fontheight" }, + { 0x05A2, "createclientfontstring" }, + { 0x05A3, "createclienttimer" }, + { 0x05A4, "createserverfontstring" }, + { 0x05A5, "createservertimer" }, + { 0x05A6, "createicon" }, + { 0x05A7, "createclienticon" }, + { 0x05A8, "createicon_hudelem" }, + { 0x05A9, "createbar" }, + { 0x05AA, "flashfrac" }, + { 0x05AB, "createclientprogressbar" }, + { 0x05AC, "createclientbar" }, + { 0x05AD, "setflashfrac" }, + { 0x05AE, "fade_over_time" }, + { 0x05AF, "flashthread" }, + { 0x05B0, "destroyelem" }, + { 0x05B1, "seticonshader" }, +// { 0x05B2, "" }, + { 0x05B3, "setheight" }, + { 0x05B4, "setsize" }, + { 0x05B5, "updatechildren" }, + { 0x05B6, "stance_carry_icon_enable" }, + { 0x05B7, "stance_carry" }, + { 0x05B8, "console" }, + { 0x05B9, "stance_carry_icon_disable" }, + { 0x05BA, "create_mantle" }, + { 0x05BB, "strings" }, + { 0x05BC, "hud_mantle" }, + { 0x05BD, "get_countdown_hud" }, + { 0x05BE, "get_download_state_hud" }, +// { 0x05BF, "" }, + { 0x05C0, "create_client_overlay_custom_size" }, + { 0x05C1, "get_player_from_self" }, + { 0x05C2, "create_client_overlay_fullscreen" }, + { 0x05C3, "color_cool_green" }, + { 0x05C4, "color_cool_green_glow" }, + { 0x05C5, "arcademode_checkpoint_dvars" }, + { 0x05C6, "arcademode_checkpoint_max" }, + { 0x05C7, "arcademode_kills_hud" }, + { 0x05C8, "arcademode_kill_streak_ends" }, + { 0x05C9, "arcademode_last_streak_time" }, + { 0x05CA, "arcademode_ramping_score" }, + { 0x05CB, "arcademode_new_kill_streak_allowed" }, + { 0x05CC, "arcademode_kill_streak_current_multiplier" }, + { 0x05CD, "arcademode_kill_streak_multiplier_count" }, + { 0x05CE, "arcademode_last_multi_kill_sound" }, + { 0x05CF, "arcademode_success" }, + { 0x05D0, "global_kill_func" }, + { 0x05D1, "global_damage_func_ads" }, +// { 0x05D2, "" }, + { 0x05D3, "arcademode_hud_sort" }, + { 0x05D4, "arcademode_maxlives" }, +// { 0x05D5, "" }, + { 0x05D6, "arcademode_playthrough" }, + { 0x05D7, "arcdemode_starttime" }, + { 0x05D8, "arcademode_time" }, + { 0x05D9, "arcademode_killbase" }, + { 0x05DA, "arcademode_damagebase" }, + { 0x05DB, "arcademode_multikills" }, + { 0x05DC, "arcademode_weaponmultiplier" }, + { 0x05DD, "arcademode_complete" }, + { 0x05DE, "arcademode_get_level_time" }, + { 0x05DF, "arcademode_difficultytimerscale" }, + { 0x05E0, "arcademode_death_detection" }, + { 0x05E1, "add_wait" }, + { 0x05E2, "waittill_msg" }, + { 0x05E3, "do_wait_any" }, +// { 0x05E4, "" }, + { 0x05E5, "arcademode_failurestring" }, + { 0x05E6, "arcademode_update_timer" }, + { 0x05E7, "arcademode_hud_timer" }, + { 0x05E8, "arcademode_update_lives" }, + { 0x05E9, "arcademode_lives_hud" }, + { 0x05EA, "arcademode_convert_extra_lives" }, + { 0x05EB, "arcademode_checkpoint_print" }, + { 0x05EC, "arcademode" }, + { 0x05ED, "arcademode_redraw_life" }, + { 0x05EE, "arcademode_remove_life" }, + { 0x05EF, "arcademode_redraw_lives" }, + { 0x05F0, "arcademode_update_streak_progress" }, + { 0x05F1, "arcademode_redraw_streak_progress" }, + { 0x05F2, "arcademode_kill_streak_current_count" }, + { 0x05F3, "arcademode_streak_color" }, + { 0x05F4, "arcademode_streak_glow" }, + { 0x05F5, "arcademode_add_kill" }, + { 0x05F6, "arcademode_kill_zero_x_location" }, + { 0x05F7, "get_streak_hud" }, + { 0x05F8, "arcademode_add_kill_streak_time" }, + { 0x05F9, "arcademode_hud_streak" }, + { 0x05FA, "arcademode_streak_hud" }, + { 0x05FB, "arcademode_streak_hud_shadow" }, + { 0x05FC, "arcademode_add_kill_streak" }, + { 0x05FD, "streak_timer_color_pulse" }, + { 0x05FE, "arcademode_multiplier_maxed" }, + { 0x05FF, "_wait" }, + { 0x0600, "last_song" }, + { 0x0601, "get_hud_score" }, + { 0x0602, "arcademode_update_score" }, +// { 0x0603, "" }, + { 0x0604, "arcademode_hud_scores" }, + { 0x0605, "updatescoreelemsonce" }, + { 0x0606, "hud_update_score" }, + { 0x0607, "get_digits_from_score" }, + { 0x0608, "hud_draw_score" }, + { 0x0609, "hud_draw_score_for_elements" }, + { 0x060A, "arcademode_add_life" }, + { 0x060B, "arcademode_define_damage_multipliers" }, + { 0x060C, "arcademode_kills_until_next_extra_life" }, + { 0x060D, "arcademode_extra_lives_range" }, + { 0x060E, "arcademode_extra_lives_base" }, + { 0x060F, "set_next_extra_life" }, +// { 0x0610, "" }, + { 0x0611, "extra_lives_display" }, + { 0x0612, "fade_out" }, + { 0x0613, "extra_lives_sizzle" }, +// { 0x0614, "" }, + { 0x0615, "round_up_to_five" }, + { 0x0616, "arcademode_add_points" }, + { 0x0617, "arcademode_deathtypes" }, + { 0x0618, "arcademode_killcolors" }, + { 0x0619, "arcademode_add_point_towards_extra_life" }, + { 0x061A, "gameskill" }, +// { 0x061B, "" }, +// { 0x061C, "" }, + { 0x061D, "thirdpointpulseside" }, + { 0x061E, "pointpulse" }, + { 0x061F, "pointpulsecount" }, + { 0x0620, "set_circular_origin" }, + { 0x0621, "arcademode_add_points_for_mod" }, + { 0x0622, "arcademode_add_points_for_individual_kill" }, +// { 0x0623, "" }, +// { 0x0624, "" }, + { 0x0625, "player_kill" }, + { 0x0626, "player_damage" }, + { 0x0627, "player_damage_ads" }, + { 0x0628, "end_mission" }, + { 0x0629, "players" }, + { 0x062A, "create_total_score_hud" }, + { 0x062B, "arcademode_hud_total_scores" }, + { 0x062C, "set_total_score_hud" }, + { 0x062D, "arcademode_ends" }, + { 0x062E, "slowmo_setlerptime_out" }, + { 0x062F, "slowmo_lerp_out" }, + { 0x0630, "slowmo_end" }, + { 0x0631, "arcademode_stoptime" }, + { 0x0632, "mission_failed_disabled" }, + { 0x0633, "arcademode_hud_timer_minutes_tens" }, + { 0x0634, "arcademode_hud_timer_minutes_ones" }, + { 0x0635, "arcademode_hud_timer_seconds_tens" }, + { 0x0636, "arcademode_hud_timer_seconds_ones" }, + { 0x0637, "arcademode_skillmultiplier" }, + { 0x0638, "arcademode_end_boost" }, + { 0x0639, "black_background" }, + { 0x063A, "player_invul_forever" }, + { 0x063B, "set_ignoreme" }, + { 0x063C, "ending_set_time" }, + { 0x063D, "draw_checkpoint" }, + { 0x063E, "arcademode_checkpoint_getid" }, + { 0x063F, "arcademode_init_kill_streak_colors" }, + { 0x0640, "arcademode_killstreak_complete_display" }, + { 0x0641, "arcademode_reset_kill_streak_art" }, + { 0x0642, "arcademode_reset_kill_streak" }, + { 0x0643, "get_hud_multi" }, + { 0x0644, "arcademode_draw_multiplier" }, + { 0x0645, "arcademode_draw_mult_sizzle" }, + { 0x0646, "arcademode_draw_multiplier_kill" }, + { 0x0647, "get_score_string_from_digits" }, + { 0x0648, "init_stats" }, + { 0x0649, "stats" }, + { 0x064A, "was_headshot" }, + { 0x064B, "died_of_headshot" }, + { 0x064C, "register_kill" }, + { 0x064D, "pmc_match" }, + { 0x064E, "is_specialop" }, + { 0x064F, "juggernaut" }, + { 0x0650, "issentrygun" }, + { 0x0651, "riders" }, + { 0x0652, "career_stat_increment" }, + { 0x0653, "register_shot_hit" }, + { 0x0654, "registeringshothit" }, + { 0x0655, "shots_hit" }, + { 0x0656, "shots_fired_recorder" }, + { 0x0657, "isprimaryweapon" }, + { 0x0658, "shots_fired" }, + { 0x0659, "is_new_weapon" }, + { 0x065A, "cause_is_explosive" }, +// { 0x065B, "" }, +// { 0x065C, "" }, + { 0x065D, "get_best_weapons" }, + { 0x065E, "get_weapon_with_most_kills" }, + { 0x065F, "gunner_think" }, + { 0x0660, "can_fire_turret" }, + { 0x0661, "wants_to_fire" }, + { 0x0662, "use_the_turret" }, +// { 0x0663, "" }, + { 0x0664, "current_enemy" }, + { 0x0665, "target_ent_cleanup" }, + { 0x0666, "shoot_enemy_until_he_hides_then_shoot_wall" }, + { 0x0667, "set_firing" }, + { 0x0668, "turret" }, + { 0x0669, "stop_firing" }, + { 0x066A, "start_firing" }, + { 0x066B, "create_mg_team" }, + { 0x066C, "mg_gunner_team" }, + { 0x066D, "mg_gunner_death_notify" }, + { 0x066E, "mgteam_take_turns_firing" }, + { 0x066F, "solo_firing" }, + { 0x0670, "solo_fires" }, + { 0x0671, "dual_firing" }, +// { 0x0672, "" }, + { 0x0673, "get_suppress_point" }, + { 0x0674, "record_enemy_sightings" }, +// { 0x0675, "" }, +// { 0x0676, "" }, + { 0x0677, "squadinitialized" }, +// { 0x0678, "" }, + { 0x0679, "squadcreatestrings" }, + { 0x067A, "squads" }, + { 0x067B, "squadindex" }, + { 0x067C, "squadrand" }, + { 0x067D, "createsquad" }, +// { 0x067E, "" }, + { 0x067F, "sighttime" }, + { 0x0680, "forward" }, + { 0x0681, "isincombat" }, + { 0x0682, "membercount" }, + { 0x0683, "members" }, + { 0x0684, "officers" }, + { 0x0685, "officercount" }, + { 0x0686, "squadlist" }, + { 0x0687, "memberaddfuncs" }, +// { 0x0688, "" }, +// { 0x0689, "" }, + { 0x068A, "memberremovestrings" }, + { 0x068B, "squadupdatefuncs" }, + { 0x068C, "squadupdatestrings" }, + { 0x068D, "squadid" }, + { 0x068E, "deletesquad" }, + { 0x068F, "generatesquadname" }, + { 0x0690, "addplayertosquad" }, + { 0x0691, "script_squadname" }, + { 0x0692, "squad" }, + { 0x0693, "squadchange" }, + { 0x0694, "script_flanker" }, + { 0x0695, "getsquadteam" }, + { 0x0696, "addtosquad" }, + { 0x0697, "lastenemysighttime" }, + { 0x0698, "combattime" }, + { 0x0699, "memberid" }, + { 0x069A, "loadoutcomplete" }, + { 0x069B, "isofficer" }, +// { 0x069C, "" }, + { 0x069D, "officerid" }, + { 0x069E, "addofficertosquad" }, + { 0x069F, "removeofficerfromsquad" }, + { 0x06A0, "officerwaiter" }, + { 0x06A1, "updatewaiter" }, + { 0x06A2, "squadtracker" }, + { 0x06A3, "memberdeathwaiter" }, + { 0x06A4, "attacker" }, + { 0x06A5, "membercombatwaiter" }, + { 0x06A6, "updateheading" }, + { 0x06A7, "updateorigin" }, + { 0x06A8, "updatecombat" }, + { 0x06A9, "isincontact" }, + { 0x06AA, "updateenemy" }, + { 0x06AB, "updateall" }, + { 0x06AC, "updatesquadlist" }, + { 0x06AD, "printabovehead" }, +// { 0x06AE, "" }, + { 0x06AF, "a" }, + { 0x06B0, "state" }, + { 0x06B1, "updatestates" }, + { 0x06B2, "updatememberstates" }, + { 0x06B3, "aiupdatecombat" }, +// { 0x06B4, "" }, + { 0x06B5, "suppressed" }, + { 0x06B6, "suppressedtime" }, +// { 0x06B7, "" }, + { 0x06B8, "squadstates" }, + { 0x06B9, "activateratio" }, + { 0x06BA, "isactive" }, + { 0x06BB, "numactive" }, + { 0x06BC, "resetstate" }, + { 0x06BD, "querymemberanimstate" }, + { 0x06BE, "querymemberstate" }, + { 0x06BF, "lastshoottime" }, + { 0x06C0, "isexposed" }, + { 0x06C1, "addtosystem" }, + { 0x06C2, "bcsenabled" }, + { 0x06C3, "chatinitialized" }, +// { 0x06C4, "" }, + { 0x06C5, "enemyclass" }, + { 0x06C6, "calledout" }, + { 0x06C7, "battlechatter" }, + { 0x06C8, "flavorbursts" }, + { 0x06C9, "script_battlechatter" }, + { 0x06CA, "voice" }, + { 0x06CB, "countryids" }, + { 0x06CC, "countryid" }, + { 0x06CD, "script_friendname" }, + { 0x06CE, "npcid" }, + { 0x06CF, "forceenglish" }, + { 0x06D0, "aithreadthreader" }, + { 0x06D1, "isalliedcountryid" }, + { 0x06D2, "setnpcid" }, + { 0x06D3, "usedids" }, + { 0x06D4, "npcidtracker" }, + { 0x06D5, "aihostileburstloop" }, +// { 0x06D6, "" }, + { 0x06D7, "playbattlechatter" }, + { 0x06D8, "ainameandrankwaiter" }, + { 0x06D9, "getname" }, + { 0x06DA, "bcname" }, + { 0x06DB, "getrank" }, + { 0x06DC, "bcrank" }, + { 0x06DD, "removefromsystem" }, + { 0x06DE, "chatqueue" }, + { 0x06DF, "nextsaytime" }, + { 0x06E0, "nextsaytimes" }, + { 0x06E1, "isspeaking" }, + { 0x06E2, "init_aibattlechatter" }, + { 0x06E3, "expiretime" }, + { 0x06E4, "priority" }, + { 0x06E5, "bcs_minpriority" }, + { 0x06E6, "allowedcallouts" }, + { 0x06E7, "addallowedthreatcallout" }, + { 0x06E8, "playernameids" }, +// { 0x06E9, "" }, + { 0x06EA, "voicecanburst" }, + { 0x06EB, "friendlyfire_warnings" }, +// { 0x06EC, "" }, + { 0x06ED, "addthreatevent" }, + { 0x06EE, "cansay" }, + { 0x06EF, "threatwasalreadycalledout" }, + { 0x06F0, "createchatevent" }, + { 0x06F1, "threat" }, +// { 0x06F2, "" }, + { 0x06F3, "addresponseevent" }, + { 0x06F4, "addresponseevent_internal" }, + { 0x06F5, "isusingsamevoice" }, + { 0x06F6, "reportalias" }, + { 0x06F7, "respondto" }, +// { 0x06F8, "" }, + { 0x06F9, "responseevent_failsafe" }, + { 0x06FA, "addinformevent" }, +// { 0x06FB, "" }, + { 0x06FC, "addreactionevent" }, + { 0x06FD, "reactto" }, + { 0x06FE, "addorderevent" }, + { 0x06FF, "orderto" }, +// { 0x0700, "" }, + { 0x0701, "getclosest" }, + { 0x0702, "getthreats" }, + { 0x0703, "threatid" }, + { 0x0704, "get_array_of_closest" }, + { 0x0705, "getlocation" }, + { 0x0706, "location_called_out_recently" }, + { 0x0707, "threatisviable" }, + { 0x0708, "bcs_maxthreatdistfromplayer" }, + { 0x0709, "entinfrontarc" }, + { 0x070A, "squadthreatwaiter" }, + { 0x070B, "player_can_see_ai" }, + { 0x070C, "aideathfriendly" }, + { 0x070D, "is_in_callable_location" }, + { 0x070E, "aideatheventthread" }, + { 0x070F, "aideathenemy" }, + { 0x0710, "aikilleventthread" }, + { 0x0711, "aiofficerorders" }, + { 0x0712, "aigrenadedangerwaiter" }, + { 0x0713, "aidisplacewaiter" }, + { 0x0714, "paintime" }, + { 0x0715, "evaluatemoveevent" }, + { 0x0716, "isnodecoverorconceal" }, + { 0x0717, "getresponder" }, + { 0x0718, "eventchance" }, + { 0x0719, "nationalityokformoveorder" }, + { 0x071A, "nationalityokformoveordernoncombat" }, + { 0x071B, "aifolloworderwaiter" }, + { 0x071C, "player_friendlyfire_waiter" }, + { 0x071D, "player_friendlyfire_addreactionevent" }, +// { 0x071E, "" }, + { 0x071F, "damage_is_valid_for_friendlyfire_warning" }, + { 0x0720, "friendlyfire_whizby_distances_valid" }, + { 0x0721, "evaluatereloadevent" }, + { 0x0722, "evaluatemeleeevent" }, + { 0x0723, "evaluatefiringevent" }, + { 0x0724, "evaluatesuppressionevent" }, + { 0x0725, "evaluateattackevent" }, +// { 0x0726, "" }, + { 0x0727, "addsituationalcombatorder" }, + { 0x0728, "custom_battlechatter_init_valid_phrases" }, + { 0x0729, "custombcs_validphrases" }, + { 0x072A, "custom_battlechatter_validate_phrase" }, + { 0x072B, "custom_battlechatter_internal" }, + { 0x072C, "bcprintfailprefix" }, + { 0x072D, "customchatphrase" }, + { 0x072E, "tryorderto" }, + { 0x072F, "begincustomevent" }, + { 0x0730, "createchatphrase" }, + { 0x0731, "addactioncovermealiasex" }, + { 0x0732, "addorderalias" }, + { 0x0733, "addmovecombataliasex" }, + { 0x0734, "addmovenoncombataliasex" }, + { 0x0735, "addinformreloadingaliasex" }, + { 0x0736, "addinformalias" }, + { 0x0737, "addnamealiasex" }, +// { 0x0738, "" }, + { 0x0739, "endcustomevent" }, + { 0x073A, "bcs_location_trigs_init" }, + { 0x073B, "bcs_location_mappings" }, + { 0x073C, "bcs_trigs_assign_aliases" }, + { 0x073D, "bcs_locations" }, + { 0x073E, "array_randomize" }, + { 0x073F, "locationaliases" }, + { 0x0740, "parselocationaliases" }, + { 0x0741, "add_bcs_location_mapping" }, + { 0x0742, "bcs_location_trigger_mapping" }, + { 0x0743, "generic_locations" }, + { 0x0744, "landmarks" }, + { 0x0745, "vehicles" }, + { 0x0746, "tibet" }, + { 0x0747, "ny_manhattan" }, + { 0x0748, "ny_harbor" }, + { 0x0749, "hijack" }, + { 0x074A, "warlord" }, + { 0x074B, "london" }, + { 0x074C, "payback" }, + { 0x074D, "hamburg" }, + { 0x074E, "paris_a" }, + { 0x074F, "paris_b" }, + { 0x0750, "paris_ac130" }, + { 0x0751, "prague" }, + { 0x0752, "berlin" }, + { 0x0753, "rescue" }, + { 0x0754, "rescue_2" }, + { 0x0755, "dubai" }, + { 0x0756, "init_battlechatter" }, +// { 0x0757, "" }, + { 0x0758, "eventtypeminwait" }, + { 0x0759, "_stealth" }, + { 0x075A, "eventactionminwait" }, + { 0x075B, "eventpriority" }, + { 0x075C, "eventduration" }, + { 0x075D, "fbt_desireddistmax" }, + { 0x075E, "fbt_waitmin" }, +// { 0x075F, "" }, + { 0x0760, "fbt_linebreakmin" }, + { 0x0761, "fbt_linebreakmax" }, + { 0x0762, "moveorigin" }, + { 0x0763, "bcs_maxtalkingdistfromplayer" }, + { 0x0764, "heightforhighcallout" }, + { 0x0765, "mindistancecallout" }, + { 0x0766, "maxdistancecallout" }, + { 0x0767, "locationlastcallouttimes" }, +// { 0x0768, "" }, + { 0x0769, "bcs_threatresettime" }, + { 0x076A, "teams" }, + { 0x076B, "isteamspeaking" }, +// { 0x076C, "" }, + { 0x076D, "flavorburstvoices" }, + { 0x076E, "lastteamspeaktime" }, + { 0x076F, "lastnamesaid" }, + { 0x0770, "lastnamesaidtime" }, + { 0x0771, "lastnamesaidtimeout" }, + { 0x0772, "threatcallouts" }, + { 0x0773, "lastteamthreatcallout" }, + { 0x0774, "lastteamthreatcallouttime" }, + { 0x0775, "teamthreatcalloutlimittimeout" }, + { 0x0776, "bcs_setup_teams_array" }, + { 0x0777, "bcs_setup_countryids" }, + { 0x0778, "bcs_setup_chatter_toggle_array" }, + { 0x0779, "set_battlechatter_variable" }, + { 0x077A, "bcs_setup_flavorburst_toggle_array" }, + { 0x077B, "init_flavorbursts" }, + { 0x077C, "string" }, + { 0x077D, "flavorburstsused" }, + { 0x077E, "shutdown_battlechatter" }, + { 0x077F, "numspeakers" }, +// { 0x0780, "" }, + { 0x0781, "nexttypesaytimes" }, + { 0x0782, "ismembersaying" }, + { 0x0783, "lastdirection" }, + { 0x0784, "fbt_firstburst" }, + { 0x0785, "fbt_lastbursterid" }, + { 0x0786, "shutdown_squadbattlechatter" }, + { 0x0787, "bcsdebugwaiter" }, + { 0x0788, "enablebattlechatter" }, + { 0x0789, "disablebattlechatter" }, + { 0x078A, "setplayerbcnameid" }, + { 0x078B, "bcnameid" }, +// { 0x078C, "" }, + { 0x078D, "campaign" }, + { 0x078E, "_animactive" }, + { 0x078F, "scripteddialoguestarttime" }, + { 0x0790, "playthreatevent" }, + { 0x0791, "curevent" }, + { 0x0792, "eventtype" }, + { 0x0793, "spotter" }, + { 0x0794, "threattype" }, + { 0x0795, "threatinfantry" }, + { 0x0796, "master" }, + { 0x0797, "threatent" }, + { 0x0798, "responder" }, + { 0x0799, "looktarget" }, + { 0x079A, "playerclockdirection" }, + { 0x079B, "soundaliases" }, + { 0x079C, "doexposedcalloutresponse" }, + { 0x079D, "threatinfantry_docalloutlocation" }, + { 0x079E, "addcalloutresponseevent" }, + { 0x079F, "getthreatinfantrycallouttype" }, + { 0x07A0, "possiblethreatcallouts" }, + { 0x07A1, "usingrocketlauncher" }, + { 0x07A2, "responderclockdirection" }, + { 0x07A3, "getcannedresponse" }, + { 0x07A4, "qafinished" }, + { 0x07A5, "iscallouttypereport" }, + { 0x07A6, "iscallouttypeqa" }, + { 0x07A7, "getqacalloutalias" }, + { 0x07A8, "addpossiblethreatcallout" }, + { 0x07A9, "callouttypewillrepeat" }, + { 0x07AA, "setlastcallouttype" }, + { 0x07AB, "getweightedchanceroll" }, + { 0x07AC, "threatdog" }, + { 0x07AD, "threatinfantryexposed" }, + { 0x07AE, "array_add" }, + { 0x07AF, "threatinfantryrpg" }, + { 0x07B0, "playreactionevent" }, + { 0x07B1, "reactioncasualty" }, + { 0x07B2, "reactiontaunt" }, + { 0x07B3, "reactionfriendlyfire" }, + { 0x07B4, "playresponseevent" }, + { 0x07B5, "responsethreatexposed" }, + { 0x07B6, "responsethreatcallout" }, +// { 0x07B7, "" }, + { 0x07B8, "playorderevent" }, + { 0x07B9, "orderaction" }, +// { 0x07BA, "" }, + { 0x07BB, "orderdisplace" }, + { 0x07BC, "playinformevent" }, +// { 0x07BD, "" }, + { 0x07BE, "informsuppressed" }, + { 0x07BF, "informincoming" }, + { 0x07C0, "informattacking" }, + { 0x07C1, "informkillfirm" }, + { 0x07C2, "playcustomevent" }, + { 0x07C3, "customchatevent" }, + { 0x07C4, "playphrase" }, + { 0x07C5, "eventaction" }, + { 0x07C6, "anim_facialfiller" }, + { 0x07C7, "is_friendlyfire_event" }, + { 0x07C8, "isspeakingfailsafe" }, + { 0x07C9, "clearisspeaking" }, + { 0x07CA, "lockaction" }, + { 0x07CB, "lastcontact" }, + { 0x07CC, "firstcontact" }, + { 0x07CD, "gethighestpriorityevent" }, + { 0x07CE, "gettargettingai" }, + { 0x07CF, "getqueueevents" }, + { 0x07D0, "geteventstate" }, + { 0x07D1, "isfiltered" }, + { 0x07D2, "isvalidevent" }, + { 0x07D3, "typelimited" }, + { 0x07D4, "dotypelimit" }, + { 0x07D5, "bcissniper" }, + { 0x07D6, "issniperrifle" }, +// { 0x07D7, "" }, + { 0x07D8, "bcgetclaimednode" }, + { 0x07D9, "getclaimednode" }, + { 0x07DA, "enemy_team_name" }, + { 0x07DB, "ainame" }, + { 0x07DC, "airank" }, + { 0x07DD, "getclosestfriendlyspeaker" }, + { 0x07DE, "getspeakers" }, + { 0x07DF, "get_all_my_locations" }, + { 0x07E0, "update_bcs_locations" }, + { 0x07E1, "location_called_out_ever" }, + { 0x07E2, "location_add_last_callout_time" }, + { 0x07E3, "location_get_last_callout_time" }, + { 0x07E4, "getrelativeangles" }, + { 0x07E5, "sideisleftright" }, + { 0x07E6, "getdirectionfacingflank" }, + { 0x07E7, "normalizecompassdirection" }, + { 0x07E8, "getdirectioncompass" }, + { 0x07E9, "getdistanceyards" }, + { 0x07EA, "getdistanceyardsnormalized" }, + { 0x07EB, "getfrontarcclockdirection" }, + { 0x07EC, "getdirectionfacingclock" }, + { 0x07ED, "getdegreeselevation" }, + { 0x07EE, "getvectorrightangle" }, + { 0x07EF, "getvectorarrayaverage" }, + { 0x07F0, "addplayernamealias" }, + { 0x07F1, "lastplayernamecalltime" }, +// { 0x07F2, "" }, + { 0x07F3, "cansayname" }, + { 0x07F4, "namesaidrecently" }, + { 0x07F5, "cansayplayername" }, + { 0x07F6, "player_name_called_recently" }, + { 0x07F7, "addthreatalias" }, + { 0x07F8, "addthreatexposedalias" }, + { 0x07F9, "addthreatobviousalias" }, +// { 0x07FA, "" }, + { 0x07FB, "addthreatelevationalias" }, + { 0x07FC, "addthreatcalloutecho" }, + { 0x07FD, "addthreatcalloutresponsealias" }, + { 0x07FE, "addthreatcalloutqa_nextline" }, + { 0x07FF, "createechoalias" }, +// { 0x0800, "" }, + { 0x0801, "addthreatcalloutlandmarkalias" }, + { 0x0802, "script_landmark" }, +// { 0x0803, "" }, + { 0x0804, "addresponsealias" }, + { 0x0805, "addreactionalias" }, +// { 0x0806, "" }, + { 0x0807, "addtauntalias" }, + { 0x0808, "addhostileburstalias" }, + { 0x0809, "initcontact" }, + { 0x080A, "shutdowncontact" }, + { 0x080B, "pointinfov" }, + { 0x080C, "within_fov" }, + { 0x080D, "squadflavorbursttransmissions" }, + { 0x080E, "squadcanburst" }, + { 0x080F, "candoflavorburst" }, + { 0x0810, "getburster" }, + { 0x0811, "get_array_of_farthest" }, + { 0x0812, "getflavorburstid" }, + { 0x0813, "flavorburstwouldrepeat" }, + { 0x0814, "getflavorburstaliases" }, + { 0x0815, "playflavorburstline" }, + { 0x0816, "flavorburstlinedebug" }, + { 0x0817, "battlechatter_canprint" }, + { 0x0818, "battlechatter_canprintdump" }, + { 0x0819, "battlechatter_print" }, + { 0x081A, "battlechatter_printdump" }, + { 0x081B, "getaliastypefromsoundalias" }, + { 0x081C, "battlechatter_printdumpline" }, + { 0x081D, "bcdrawobjects" }, + { 0x081E, "drawbcobject" }, + { 0x081F, "drawbcdirections" }, +// { 0x0820, "" }, + { 0x0821, "voice_is_british_based" }, + { 0x0822, "friendlyfire_warning" }, + { 0x0823, "can_say_friendlyfire" }, + { 0x0824, "friendlyfire_warnings_disable" }, + { 0x0825, "initcharacterface" }, + { 0x0826, "usefacialanims" }, + { 0x0827, "currentdialogimportance" }, + { 0x0828, "alertface" }, + { 0x0829, "idleface" }, +// { 0x082A, "" }, + { 0x082B, "facelastnotifynum" }, + { 0x082C, "saygenericdialogue" }, + { 0x082D, "numfriendlyvoices" }, + { 0x082E, "numenemyvoices" }, + { 0x082F, "setidlefacedelayed" }, + { 0x0830, "setidleface" }, + { 0x0831, "sayspecificdialogue" }, + { 0x0832, "chooseanimfromset" }, + { 0x0833, "playidleface" }, + { 0x0834, "playfacethread" }, + { 0x0835, "facialanimdone" }, + { 0x0836, "facialsounddone" }, + { 0x0837, "faceresult" }, + { 0x0838, "facewaitforresult" }, + { 0x0839, "currentdialognotifystring" }, + { 0x083A, "currentdialogsound" }, + { 0x083B, "waitforfacialanim" }, + { 0x083C, "donotetracks" }, + { 0x083D, "waitforfacesound" }, + { 0x083E, "playface_waitfornotify" }, + { 0x083F, "playface_waitfortime" }, + { 0x0840, "initlevelface" }, + { 0x0841, "root_anim" }, + { 0x0842, "_first_frame_anim" }, + { 0x0843, "_animname" }, + { 0x0844, "scr_anim" }, + { 0x0845, "_anime" }, + { 0x0846, "_tag_entity" }, + { 0x0847, "_custom_anim_thread" }, + { 0x0848, "_custom_anim_loop" }, + { 0x0849, "noteleport" }, + { 0x084A, "anim_blend_time_override" }, + { 0x084B, "_animmode" }, + { 0x084C, "start_notetrack_wait" }, + { 0x084D, "animscriptdonotetracksthread" }, + { 0x084E, "notify_on_end" }, +// { 0x084F, "" }, + { 0x0850, "animsets" }, + { 0x0851, "move" }, + { 0x0852, "init_animset_run_move" }, + { 0x0853, "initanimset" }, + { 0x0854, "init_animset_heat_run_move" }, + { 0x0855, "init_animset_walk_move" }, + { 0x0856, "init_animset_cqb_move" }, + { 0x0857, "init_animset_pistol_stand" }, + { 0x0858, "array" }, + { 0x0859, "pistolstand" }, + { 0x085A, "init_animset_rpg_stand" }, + { 0x085B, "rpgstand" }, + { 0x085C, "init_animset_shotgun_stand" }, + { 0x085D, "shotgunstand" }, + { 0x085E, "init_animset_cqb_stand" }, + { 0x085F, "cqbstand" }, + { 0x0860, "init_animset_heat_stand" }, + { 0x0861, "heatstand" }, + { 0x0862, "init_animset_default_stand" }, + { 0x0863, "defaultstand" }, + { 0x0864, "init_animset_default_crouch" }, + { 0x0865, "defaultcrouch" }, + { 0x0866, "init_animset_rpg_crouch" }, + { 0x0867, "rpgcrouch" }, + { 0x0868, "init_animset_shotgun_crouch" }, + { 0x0869, "shotguncrouch" }, + { 0x086A, "init_animset_default_prone" }, + { 0x086B, "defaultprone" }, + { 0x086C, "init_animset_complete_custom_stand" }, + { 0x086D, "combatstandanims" }, + { 0x086E, "init_animset_custom_stand" }, +// { 0x086F, "" }, + { 0x0870, "combatcrouchanims" }, +// { 0x0871, "" }, + { 0x0872, "clear_custom_animset" }, + { 0x0873, "custommoveanimset" }, + { 0x0874, "customidleanimset" }, + { 0x0875, "set_animarray_standing_turns_pistol" }, + { 0x0876, "set_animarray_standing_turns" }, + { 0x0877, "set_animarray_crouching_turns" }, + { 0x0878, "set_animarray_stance_change" }, + { 0x0879, "set_animarray_burst_and_semi_fire_stand" }, + { 0x087A, "set_animarray_custom_burst_and_semi_fire_stand" }, + { 0x087B, "set_animarray_burst_and_semi_fire_crouch" }, + { 0x087C, "set_animarray_custom_burst_and_semi_fire_crouch" }, + { 0x087D, "set_animarray_add_turn_aims_stand" }, + { 0x087E, "set_animarray_add_turn_aims_crouch" }, + { 0x087F, "set_animarray_standing" }, + { 0x0880, "usingsidearm" }, + { 0x0881, "heat" }, + { 0x0882, "weapon_pump_action_shotgun" }, + { 0x0883, "iscqbwalking" }, + { 0x0884, "set_animarray_crouching" }, + { 0x0885, "primaryweapon" }, + { 0x0886, "placeweaponon" }, + { 0x0887, "set_animarray_prone" }, + { 0x0888, "init_moving_turn_animations" }, + { 0x0889, "runturnanims" }, + { 0x088A, "cqbturnanims" }, +// { 0x088B, "" }, + { 0x088C, "maxrunngunangle" }, + { 0x088D, "runnguntransitionpoint" }, + { 0x088E, "runngunincrement" }, + { 0x088F, "runngunanims" }, + { 0x0890, "set_ambush_sidestep_anims" }, + { 0x0891, "moveanimset" }, + { 0x0892, "heat_reload_anim" }, + { 0x0893, "animarraypickrandom" }, + { 0x0894, "trackshootentorpos" }, + { 0x0895, "trackloop" }, + { 0x0896, "shootent" }, +// { 0x0897, "" }, +// { 0x0898, "" }, +// { 0x0899, "" }, + { 0x089A, "covernode" }, +// { 0x089B, "" }, + { 0x089C, "shootpos" }, + { 0x089D, "shouldcqb" }, +// { 0x089E, "" }, + { 0x089F, "onatv" }, + { 0x08A0, "stepoutyaw" }, + { 0x08A1, "trackloop_cqbshootpos" }, + { 0x08A2, "cqb_target" }, + { 0x08A3, "cqb_wide_target_track" }, + { 0x08A4, "cqb_point_of_interest" }, + { 0x08A5, "cqb_wide_poi_track" }, + { 0x08A6, "trackloop_anglesfornoshootpos" }, + { 0x08A7, "recentlysawenemy" }, + { 0x08A8, "iscombatscriptnode" }, + { 0x08A9, "trackloop_getdesiredangles" }, + { 0x08AA, "trackloop_clampangles" }, + { 0x08AB, "maxanglecheckyawdelta" }, + { 0x08AC, "maxanglecheckpitchdelta" }, +// { 0x08AD, "" }, +// { 0x08AE, "" }, + { 0x08AF, "setanimaimweight" }, + { 0x08B0, "aimweight_start" }, + { 0x08B1, "aimweight_end" }, + { 0x08B2, "aimweight_transframes" }, + { 0x08B3, "aimweight_t" }, + { 0x08B4, "incranimaimweight" }, + { 0x08B5, "usingautomaticweapon" }, + { 0x08B6, "usingsemiautoweapon" }, + { 0x08B7, "autoshootanimrate" }, + { 0x08B8, "burstshootanimrate" }, + { 0x08B9, "waitaftershot" }, +// { 0x08BA, "" }, + { 0x08BB, "refillclip" }, + { 0x08BC, "bulletsinclip" }, + { 0x08BD, "rocketvisible" }, + { 0x08BE, "showrocketwhenreloadisdone" }, + { 0x08BF, "add_weapon" }, + { 0x08C0, "aiweapon" }, + { 0x08C1, "addturret" }, + { 0x08C2, "decidewhatandhowtoshoot" }, + { 0x08C3, "resetmisstime" }, + { 0x08C4, "shootobjective" }, + { 0x08C5, "shootstyle" }, + { 0x08C6, "fastburst" }, + { 0x08C7, "shouldreturntocover" }, +// { 0x08C8, "" }, + { 0x08C9, "has_no_ir" }, + { 0x08CA, "laseron" }, + { 0x08CB, "updatelaserstatus" }, + { 0x08CC, "issniper" }, + { 0x08CD, "atconcealmentnode" }, + { 0x08CE, "canseeenemy" }, + { 0x08CF, "ambushendtime" }, + { 0x08D0, "shootposoverride" }, + { 0x08D1, "specialshootbehavior" }, + { 0x08D2, "waitabit" }, + { 0x08D3, "nogunshoot" }, + { 0x08D4, "shouldsuppress" }, + { 0x08D5, "isshotgun" }, + { 0x08D6, "shouldshootenemyent" }, + { 0x08D7, "rifleshootobjectivenormal" }, + { 0x08D8, "rifleshootobjectivesuppress" }, + { 0x08D9, "getenemysightpos" }, + { 0x08DA, "rifleshootobjectiveambush" }, +// { 0x08DB, "" }, + { 0x08DC, "ambushnode" }, + { 0x08DD, "rifleshoot" }, + { 0x08DE, "cansuppressenemy" }, + { 0x08DF, "shouldstopambushing" }, + { 0x08E0, "rpgshoot" }, + { 0x08E1, "pistolshoot" }, + { 0x08E2, "markenemyposinvisible" }, +// { 0x08E3, "" }, +// { 0x08E4, "" }, + { 0x08E5, "watchforincomingfire" }, + { 0x08E6, "suppressionthreshold" }, + { 0x08E7, "readytoreturntocover" }, +// { 0x08E8, "" }, + { 0x08E9, "runonshootbehaviorend" }, + { 0x08EA, "checkchanged" }, + { 0x08EB, "setshootenttoenemy" }, + { 0x08EC, "havenothingtoshoot" }, + { 0x08ED, "shouldbeajerk" }, + { 0x08EE, "setshootstyleforvisibleenemy" }, + { 0x08EF, "magic_bullet_shield" }, + { 0x08F0, "setshootstyleforsuppression" }, + { 0x08F1, "setshootstyle" }, + { 0x08F2, "shoulddosemiforvariety" }, + { 0x08F3, "safemod" }, + { 0x08F4, "resetsniperaim" }, +// { 0x08F5, "" }, + { 0x08F6, "sniperhitcount" }, + { 0x08F7, "sniper_glint_behavior" }, + { 0x08F8, "disable_sniper_glint" }, + { 0x08F9, "player_sees_my_scope" }, + { 0x08FA, "longdeathstarting" }, + { 0x08FB, "pain_test" }, + { 0x08FC, "disablepain" }, + { 0x08FD, "lastpaintime" }, + { 0x08FE, "painonstairs" }, + { 0x08FF, "nextstandinghitdying" }, + { 0x0900, "initialize" }, + { 0x0901, "no_pain_sound" }, + { 0x0902, "helmetpop" }, + { 0x0903, "painfunction" }, + { 0x0904, "special" }, + { 0x0905, "initpainfx" }, + { 0x0906, "damageshieldpain" }, +// { 0x0907, "" }, + { 0x0908, "predamageshieldignoreme" }, + { 0x0909, "blockingpain" }, + { 0x090A, "wasdamagedbyexplosive" }, + { 0x090B, "lastcarexplosiontime" }, + { 0x090C, "lastcarexplosionrange" }, + { 0x090D, "lastcarexplosiondamagelocation" }, + { 0x090E, "lastcarexplosionlocation" }, + { 0x090F, "maydoupwardsdeath" }, + { 0x0910, "getdamageshieldpainanim" }, +// { 0x0911, "" }, + { 0x0912, "getpainanim" }, + { 0x0913, "disabledamageshieldpain" }, + { 0x0914, "onback" }, + { 0x0915, "stoponback" }, + { 0x0916, "movement" }, + { 0x0917, "getrunningforwardpainanim" }, + { 0x0918, "disablelongpain" }, + { 0x0919, "getstandpistolpainanim" }, + { 0x091A, "damagelocationisany" }, + { 0x091B, "getstandpainanim" }, + { 0x091C, "disablelongdeath" }, + { 0x091D, "removeblockedanims" }, + { 0x091E, "getcrouchpainanim" }, + { 0x091F, "getpronepainanim" }, +// { 0x0920, "" }, + { 0x0921, "notifystartaim" }, + { 0x0922, "specialpainblocker" }, + { 0x0923, "specialpain" }, + { 0x0924, "paindeathnotify" }, + { 0x0925, "dopainfromarray" }, + { 0x0926, "dopain" }, + { 0x0927, "mg42pain" }, + { 0x0928, "mg_animmg" }, + { 0x0929, "waitsetstop" }, + { 0x092A, "crawlingpain" }, + { 0x092B, "crawlingpaintransanim" }, + { 0x092C, "forcelongdeath" }, + { 0x092D, "nextcrawlingpaintimefromlegdamage" }, + { 0x092E, "numdeathsuntilcrawlingpain" }, + { 0x092F, "nextcrawlingpaintime" }, + { 0x0930, "deathfunction" }, + { 0x0931, "iscrawldeltaallowed" }, + { 0x0932, "force_num_crawls" }, + { 0x0933, "initcrawlingpistolanims" }, +// { 0x0934, "" }, + { 0x0935, "crawlingpistol" }, + { 0x0936, "specialdeathfunc" }, + { 0x0937, "donotetracksintercept" }, + { 0x0938, "animarray" }, + { 0x0939, "desiredtimeofdeath" }, + { 0x093A, "donotetracksfortime" }, +// { 0x093B, "" }, +// { 0x093C, "" }, + { 0x093D, "shouldstayalive" }, + { 0x093E, "dyingcrawl" }, + { 0x093F, "custom_crawl_sound" }, + { 0x0940, "nodeath" }, +// { 0x0941, "" }, + { 0x0942, "dyingcrawlbloodsmear" }, + { 0x0943, "crawl_fx_rate" }, + { 0x0944, "crawl_fx" }, + { 0x0945, "dyingcrawlbackaim" }, + { 0x0946, "dyingcrawlaiming" }, + { 0x0947, "getyawtoenemy" }, + { 0x0948, "startdyingcrawlbackaimsoon" }, + { 0x0949, "handlebackcrawlnotetracks" }, + { 0x094A, "shootenemywrapper" }, + { 0x094B, "aimedsomewhatatenemy" }, + { 0x094C, "absangleclamp180" }, + { 0x094D, "painyawdifffartolerance" }, + { 0x094E, "painyawdiffclosedistsq" }, + { 0x094F, "painyawdiffclosetolerance" }, + { 0x0950, "painpitchdifftolerance" }, + { 0x0951, "enemyisingeneraldirection" }, + { 0x0952, "preventpainforashorttime" }, + { 0x0953, "flashbangimmunity" }, + { 0x0954, "doinglongdeath" }, + { 0x0955, "mayonlydie" }, + { 0x0956, "numdeathsuntilcornergrenadedeath" }, + { 0x0957, "nextcornergrenadedeathtime" }, + { 0x0958, "decidenumcrawls" }, + { 0x0959, "numcrawls" }, + { 0x095A, "shouldkeepcrawling" }, +// { 0x095B, "" }, + { 0x095C, "cornerrightgrenadedeath" }, +// { 0x095D, "" }, + { 0x095E, "dropallaiweapons" }, + { 0x095F, "notetrackposeback" }, + { 0x0960, "playdeathsound" }, + { 0x0961, "cornerdeathreleasegrenade" }, + { 0x0962, "playsoundatpoint" }, + { 0x0963, "killself" }, + { 0x0964, "killwrapper" }, + { 0x0965, "last_dmg_player" }, + { 0x0966, "enemyisapproaching" }, + { 0x0967, "enemyvelocity" }, + { 0x0968, "prematurecornergrenadedeath" }, + { 0x0969, "getgrenadedropvelocity" }, + { 0x096A, "waittillgrenadedrops" }, + { 0x096B, "watchenemyvelocity" }, +// { 0x096C, "" }, + { 0x096D, "additive_pain" }, + { 0x096E, "doingadditivepain" }, + { 0x096F, "maketype" }, + { 0x0970, "getinfoindex" }, + { 0x0971, "prop_ac_prs_enm_barge_a_1" }, + { 0x0972, "destructible_create" }, + { 0x0973, "destructible_state" }, + { 0x0974, "destructible_anim" }, + { 0x0975, "destructible_fx" }, +// { 0x0976, "" }, + { 0x0977, "prop_ac_prs_enm_barge_a_2" }, + { 0x0978, "prop_ac_prs_enm_con_digger_a" }, +// { 0x0979, "" }, + { 0x097A, "prop_ac_prs_enm_fuel_tank_a" }, + { 0x097B, "prop_ac_prs_enm_hanger_a" }, + { 0x097C, "prop_ac_prs_enm_maz_a" }, + { 0x097D, "prop_ac_prs_enm_mi26_halo_a" }, + { 0x097E, "prop_ac_prs_enm_mstas_a" }, + { 0x097F, "prop_ac_prs_enm_radar_maz_a" }, + { 0x0980, "prop_ac_prs_enm_s300v_a" }, + { 0x0981, "prop_ac_prs_enm_storage_bld_a_1" }, + { 0x0982, "prop_ac_prs_enm_storage_bld_a_2" }, + { 0x0983, "prop_ac_prs_enm_storage_bld_b" }, + { 0x0984, "prop_ac_prs_enm_tent_a" }, + { 0x0985, "prop_ac_prs_enm_tent_b" }, + { 0x0986, "prop_ac_prs_enm_tent_c" }, + { 0x0987, "prop_ac_prs_enm_truck_a" }, + { 0x0988, "prop_ac_prs_enm_cargo_crate_a_1" }, + { 0x0989, "prop_ac_prs_enm_cargo_crate_a_2" }, + { 0x098A, "prop_ac_prs_enm_crates_a_1" }, +// { 0x098B, "" }, + { 0x098C, "prop_ac_prs_enm_crates_b_1" }, + { 0x098D, "prop_ac_prs_enm_crates_b_2" }, + { 0x098E, "prop_ac_prs_enm_mobile_crane_a" }, + { 0x098F, "prop_ac_prs_enm_landing_craft_a" }, + { 0x0990, "prop_ac_prs_enm_speed_boat_a" }, + { 0x0991, "prop_ac_prs_prp_satellite_dish_a_dish" }, + { 0x0992, "prop_ac_prs_fps_hc_extc_balcony_a1" }, + { 0x0993, "prop_ac_prs_fps_hc_extc_balcony_a2" }, + { 0x0994, "prop_ac_prs_fps_hc_extc_balcony_a3" }, + { 0x0995, "prop_ac_prs_fps_hc_extc_balcony_b1" }, + { 0x0996, "prop_ac_prs_fps_hc_extc_balcony_b2" }, + { 0x0997, "prop_ac_prs_fps_hc_extc_balcony_b3" }, + { 0x0998, "prop_ac_prs_fps_hc_extc_balcony_c1" }, + { 0x0999, "prop_ac_prs_fps_hc_extc_balcony_c2" }, + { 0x099A, "prop_ac_prs_fps_hc_extc_column_b_a1" }, + { 0x099B, "prop_ac_prs_fps_hc_extc_column_b_a2" }, +// { 0x099C, "" }, + { 0x099D, "prop_ac_prs_fps_hc_extc_column_t_a1" }, + { 0x099E, "prop_ac_prs_fps_hc_extc_column_t_a2" }, + { 0x099F, "prop_ac_prs_fps_hc_extc_column_t_a3" }, + { 0x09A0, "prop_ac_prs_enm_missile_boat_a" }, + { 0x09A1, "toy_glass" }, + { 0x09A2, "destructible_splash_damage_scaler" }, + { 0x09A3, "destructible_sound" }, + { 0x09A4, "destructible_part" }, + { 0x09A5, "toy_dt_mirror" }, + { 0x09A6, "toy_icbm_consolemonitor" }, + { 0x09A7, "toy_tubetv_" }, + { 0x09A8, "toy_tvs_flatscreen" }, +// { 0x09A9, "" }, + { 0x09AA, "toy_transformer_ratnest01" }, + { 0x09AB, "destructible_loopfx" }, + { 0x09AC, "destructible_loopsound" }, + { 0x09AD, "destructible_healthdrain" }, + { 0x09AE, "toy_transformer_small01" }, + { 0x09AF, "toy_generator" }, +// { 0x09B0, "" }, + { 0x09B1, "toy_oxygen_tank" }, + { 0x09B2, "toy_electricbox2" }, + { 0x09B3, "toy_electricbox4" }, + { 0x09B4, "toy_airconditioner" }, + { 0x09B5, "toy_ceiling_fan" }, + { 0x09B6, "toy_wall_fan" }, + { 0x09B7, "toy_propane_tank02" }, + { 0x09B8, "destructible_physics" }, + { 0x09B9, "toy_propane_tank02_small" }, + { 0x09BA, "toy_copier" }, + { 0x09BB, "toy_firehydrant" }, + { 0x09BC, "toy_parkingmeter" }, + { 0x09BD, "damage_not" }, +// { 0x09BE, "" }, + { 0x09BF, "toy_mailbox2" }, + { 0x09C0, "toy_newspaper_stand_red" }, +// { 0x09C1, "" }, + { 0x09C2, "toy_filecabinet" }, + { 0x09C3, "toy_trashbin_01" }, +// { 0x09C4, "" }, + { 0x09C5, "toy_trashbag1" }, + { 0x09C6, "toy_recyclebin_01" }, + { 0x09C7, "toy_trashcan_metal_closed" }, + { 0x09C8, "toy_water_collector" }, + { 0x09C9, "toy_foliage_tree_oak_1" }, + { 0x09CA, "toy_paris_tree_plane_large" }, + { 0x09CB, "toy_usa_gas_station_trash_bin_01" }, + { 0x09CC, "toy_usa_gas_station_trash_bin_02" }, +// { 0x09CD, "" }, + { 0x09CE, "destructible_lights_out" }, + { 0x09CF, "toy_light_ceiling_fluorescent" }, + { 0x09D0, "toy_light_ceiling_fluorescent_spotlight" }, + { 0x09D1, "destructible_spotlight" }, + { 0x09D2, "toy_light_ceiling_fluorescent_single" }, + { 0x09D3, "toy_light_ceiling_fluorescent_single_spotlight" }, + { 0x09D4, "toy_bookstore_bookstand4_books" }, + { 0x09D5, "toy_locker_double" }, + { 0x09D6, "toy_dubai_fish_sculpture" }, + { 0x09D7, "toy_intro_concrete_chipaway" }, + { 0x09D8, "toy_chicken" }, + { 0x09D9, "toy_hide_with_fx" }, + { 0x09DA, "vehicle_ac130_80s_sedan1" }, + { 0x09DB, "vehicle_bus_destructible" }, + { 0x09DC, "vehicle_80s_sedan1" }, + { 0x09DD, "vehicle_80s_hatch1" }, +// { 0x09DE, "" }, +// { 0x09DF, "" }, + { 0x09E0, "vehicle_civ_car_a" }, + { 0x09E1, "vehicle_small_hatch" }, +// { 0x09E2, "" }, + { 0x09E3, "vehicle_pickup" }, + { 0x09E4, "vehicle_hummer" }, + { 0x09E5, "vehicle_gaz" }, + { 0x09E6, "vehicle_gaz_harbor" }, + { 0x09E7, "vehicle_bm21" }, + { 0x09E8, "vehicle_moving_truck" }, + { 0x09E9, "vehicle_subway_cart" }, + { 0x09EA, "create_vehicle_subway_cart_window_single" }, + { 0x09EB, "vehicle_subway_cart_windows" }, + { 0x09EC, "vehicle_subway_cart_windows_small" }, + { 0x09ED, "vehicle_luxurysedan" }, + { 0x09EE, "destructible_car_alarm" }, + { 0x09EF, "vehicle_mig29_landed" }, + { 0x09F0, "vehicle_mack_truck_short" }, + { 0x09F1, "vehicle_semi_truck" }, + { 0x09F2, "vehicle_motorcycle" }, + { 0x09F3, "vehicle_scooter" }, + { 0x09F4, "vehicle_subcompact" }, + { 0x09F5, "vehicle_van" }, + { 0x09F6, "vehicle_uaz_van" }, + { 0x09F7, "vehicle_van_iw5" }, + { 0x09F8, "vehicle_delivery_theme_park_truck_destructible" }, + { 0x09F9, "vehicle_suburban" }, + { 0x09FA, "vehicle_snowmobile" }, + { 0x09FB, "destructible_gaspump" }, + { 0x09FC, "destructible_electrical_transformer_large" }, + { 0x09FD, "get_precached_anim" }, + { 0x09FE, "_destructible_preanims" }, + { 0x09FF, "get_precached_animtree" }, + { 0x0A00, "_destructible_preanimtree" }, + { 0x0A01, "vehicle_coupe" }, + { 0x0A02, "vehicle_mini" }, + { 0x0A03, "vehicle_uk_truck" }, + { 0x0A04, "vehicle_uk_police_estate" }, + { 0x0A05, "vehicle_uaz_winter" }, + { 0x0A06, "vehicle_uaz_fabric" }, + { 0x0A07, "vehicle_uaz_hardtop" }, + { 0x0A08, "vehicle_jeep" }, + { 0x0A09, "vehicle_jeep_dusty" }, + { 0x0A0A, "vehicle_uaz_open" }, + { 0x0A0B, "vehicle_india_compact_destructible" }, + { 0x0A0C, "vehicle_india_rickshaw" }, + { 0x0A0D, "vehicle_tuk_tuk" }, + { 0x0A0E, "vehicle_india_suv" }, + { 0x0A0F, "vehicle_policecar" }, + { 0x0A10, "vehicle_policecar_russia" }, + { 0x0A11, "vehicle_taxi" }, + { 0x0A12, "random_dynamic_attachment" }, + { 0x0A13, "vehicle_taxi_dubai" }, + { 0x0A14, "toy_security_camera" }, + { 0x0A15, "toy_building_collapse_paris_ac130" }, + { 0x0A16, "toy_poison_gas_attack" }, + { 0x0A17, "toy_arcade_machine" }, + { 0x0A18, "toy_pinball_machine" }, + { 0x0A19, "toy_fortune_machine" }, + { 0x0A1A, "toy_trashcan_clown" }, +// { 0x0A1B, "" }, + { 0x0A1C, "vehicle_slava_ny_harbor_zonea" }, + { 0x0A1D, "rooftop_skylight_destructible" }, + { 0x0A1E, "satellite_dish_big_destructible" }, + { 0x0A1F, "dest_onestate" }, + { 0x0A20, "dest_pb_planter" }, + { 0x0A21, "berlin_hotel_lights_ceiling1" }, + { 0x0A22, "rus_vx_gas_canister" }, + { 0x0A23, "destructiblespawnedentslimit" }, + { 0x0A24, "destructiblespawnedents" }, + { 0x0A25, "currentcaralarms" }, + { 0x0A26, "commonstarttime" }, + { 0x0A27, "fast_destructible_explode" }, + { 0x0A28, "warn_about_old_destructible" }, + { 0x0A29, "find_destructibles" }, +// { 0x0A2A, "" }, + { 0x0A2B, "modeldummyon" }, + { 0x0A2C, "destructibleinfo" }, +// { 0x0A2D, "" }, + { 0x0A2E, "destructible_parts" }, + { 0x0A2F, "modeldummy" }, + { 0x0A30, "add_key_to_destructible" }, + { 0x0A31, "add_keypairs_to_destructible" }, +// { 0x0A32, "" }, + { 0x0A33, "destructible_info" }, + { 0x0A34, "precache_destructibles" }, + { 0x0A35, "add_destructible_fx" }, + { 0x0A36, "candamagedestructible" }, + { 0x0A37, "destructibles" }, + { 0x0A38, "destructible_think" }, +// { 0x0A39, "" }, + { 0x0A3A, "gunner" }, + { 0x0A3B, "is_shotgun_damage" }, + { 0x0A3C, "enable_ai_shotgun_destructible_damage" }, + { 0x0A3D, "getpartandstateindex" }, + { 0x0A3E, "destructible_update_part" }, + { 0x0A3F, "non_player_damage" }, + { 0x0A40, "waiting_for_queue" }, + { 0x0A41, "exploding" }, + { 0x0A42, "loopingsoundstopnotifies" }, + { 0x0A43, "damage_type" }, + { 0x0A44, "destructible_splash_rotatation" }, + { 0x0A45, "destructible_splash_damage" }, + { 0x0A46, "getallactiveparts" }, + { 0x0A47, "setdistanceonparts" }, + { 0x0A48, "getlowestpartdistance" }, + { 0x0A49, "isvalidsoundcause" }, + { 0x0A4A, "isattackervalid" }, + { 0x0A4B, "forceexploding" }, + { 0x0A4C, "dontallowexplode" }, +// { 0x0A4D, "" }, + { 0x0A4E, "isaifunc" }, + { 0x0A4F, "isvaliddamagecause" }, + { 0x0A50, "godmode" }, + { 0x0A51, "script_bulletshield" }, + { 0x0A52, "getdamagetype" }, + { 0x0A53, "damage_mirror" }, + { 0x0A54, "add_damage_owner_recorder" }, + { 0x0A55, "car_damage_owner_recorder" }, + { 0x0A56, "loopfx_ontag" }, + { 0x0A57, "health_drain" }, + { 0x0A58, "destructible_badplace_radius_multiplier" }, + { 0x0A59, "destructible_health_drain_amount_multiplier" }, + { 0x0A5A, "healthdrain" }, + { 0x0A5B, "disable_destructible_bad_places" }, + { 0x0A5C, "disablebadplace" }, + { 0x0A5D, "badplace_cylinder_func" }, + { 0x0A5E, "badplace_remove" }, + { 0x0A5F, "badplace_delete_func" }, + { 0x0A60, "physics_launch" }, + { 0x0A61, "physics_object_remove" }, + { 0x0A62, "explode" }, + { 0x0A63, "destructible_explosion_radius_multiplier" }, + { 0x0A64, "destructible_protection_func" }, + { 0x0A65, "cleanupvars" }, + { 0x0A66, "animsapplied" }, +// { 0x0A67, "" }, + { 0x0A68, "destructible_cleans_up_more" }, + { 0x0A69, "script_noflip" }, + { 0x0A6A, "car_alarm_org" }, + { 0x0A6B, "set_disable_friendlyfire_value_delayed" }, + { 0x0A6C, "friendlyfiredisabledfordestructible" }, + { 0x0A6D, "connecttraverses" }, + { 0x0A6E, "disconnecttraverses" }, + { 0x0A6F, "get_traverse_disconnect_brush" }, + { 0x0A70, "script_destruct_collision" }, + { 0x0A71, "hideapart" }, + { 0x0A72, "showapart" }, + { 0x0A73, "disable_explosion" }, + { 0x0A74, "force_explosion" }, + { 0x0A75, "get_dummy" }, + { 0x0A76, "play_loop_sound_on_destructible" }, + { 0x0A77, "force_stop_sound" }, + { 0x0A78, "notifydamageafterframe" }, + { 0x0A79, "play_sound" }, +// { 0x0A7A, "" }, + { 0x0A7B, "do_car_alarm" }, +// { 0x0A7C, "" }, +// { 0x0A7D, "" }, +// { 0x0A7E, "" }, + { 0x0A7F, "do_random_dynamic_attachment" }, + { 0x0A80, "get_closest_with_targetname" }, + { 0x0A81, "player_touching_post_clip" }, + { 0x0A82, "get_player_touching" }, + { 0x0A83, "is_so" }, + { 0x0A84, "destructible_handles_collision_brushes" }, + { 0x0A85, "collision_brush_pre_explosion" }, + { 0x0A86, "collision_brush_post_explosion" }, + { 0x0A87, "func_destructible_crush_player" }, + { 0x0A88, "debug_player_in_post_clip" }, + { 0x0A89, "destructible_get_my_breakable_light" }, + { 0x0A8A, "breakable_light" }, + { 0x0A8B, "break_nearest_light" }, + { 0x0A8C, "debug_radiusdamage_circle" }, + { 0x0A8D, "debug_circle_drawlines" }, + { 0x0A8E, "debug_line" }, + { 0x0A8F, "spotlight_tag_origin_cleanup" }, + { 0x0A90, "spotlight_fizzles_out" }, + { 0x0A91, "destructible_spotlight_think" }, + { 0x0A92, "is_valid_damagetype" }, + { 0x0A93, "destructible_sound_think" }, + { 0x0A94, "destructible_fx_think" }, + { 0x0A95, "destructible_animation_think" }, +// { 0x0A96, "" }, + { 0x0A97, "clear_anims" }, + { 0x0A98, "init_destroyed_count" }, + { 0x0A99, "destroyedcount" }, + { 0x0A9A, "destroyedcounttimeout" }, +// { 0x0A9B, "" }, + { 0x0A9C, "add_to_destroyed_count" }, + { 0x0A9D, "get_destroyed_count" }, + { 0x0A9E, "get_max_destroyed_count" }, + { 0x0A9F, "init_destructible_frame_queue" }, + { 0x0AA0, "destructibleframequeue" }, + { 0x0AA1, "add_destructible_to_frame_queue" }, + { 0x0AA2, "entnum" }, + { 0x0AA3, "destructible" }, + { 0x0AA4, "totaldamage" }, + { 0x0AA5, "neardistance" }, + { 0x0AA6, "fxcost" }, + { 0x0AA7, "handle_destructible_frame_queue" }, + { 0x0AA8, "sort_destructible_frame_queue" }, + { 0x0AA9, "get_better_destructible" }, + { 0x0AAA, "get_part_fx_cost_for_action_state" }, + { 0x0AAB, "ragdoll_immediate" }, + { 0x0AAC, "deathanimscript" }, + { 0x0AAD, "doimmediateragdolldeath" }, + { 0x0AAE, "skipdeathanim" }, + { 0x0AAF, "ragdoll_directionscale" }, + { 0x0AB0, "ragdoll_start_vel" }, + { 0x0AB1, "noragdoll" }, + { 0x0AB2, "ragdolltime" }, + { 0x0AB3, "waitforragdoll" }, + { 0x0AB4, "playdeathfx" }, + { 0x0AB5, "play_blood_pool" }, +// { 0x0AB6, "" }, + { 0x0AB7, "specialdeath" }, +// { 0x0AB8, "" }, + { 0x0AB9, "print3dfortime" }, +// { 0x0ABA, "" }, + { 0x0ABB, "helmetlaunch" }, + { 0x0ABC, "removeselffrom_squadlastseenenemypos" }, + { 0x0ABD, "clearsightposnear" }, + { 0x0ABE, "sightpos" }, + { 0x0ABF, "shoulddorunningforwarddeath" }, + { 0x0AC0, "shoulddostrongbulletdamage" }, + { 0x0AC1, "isdeserteagle" }, + { 0x0AC2, "isattackerwithindist" }, + { 0x0AC3, "getdeathanim" }, +// { 0x0AC4, "" }, + { 0x0AC5, "getrunningforwarddeathanim" }, + { 0x0AC6, "removeundefined" }, + { 0x0AC7, "getstandpistoldeathanim" }, +// { 0x0AC8, "" }, +// { 0x0AC9, "" }, + { 0x0ACA, "getpronedeathanim" }, +// { 0x0ACB, "" }, + { 0x0ACC, "getbackdeathanim" }, + { 0x0ACD, "firingdeathallowed" }, + { 0x0ACE, "usingriflelikeweapon" }, + { 0x0ACF, "weaponpos" }, + { 0x0AD0, "tryadddeathanim" }, + { 0x0AD1, "tryaddfiringdeathanim" }, + { 0x0AD2, "playexplodedeathanim" }, + { 0x0AD3, "current_event" }, + { 0x0AD4, "shoot_while_driving_thread" }, + { 0x0AD5, "drivingvehicle" }, + { 0x0AD6, "snowmobile_geton" }, + { 0x0AD7, "disable_surprise" }, + { 0x0AD8, "getoffvehiclefunc" }, + { 0x0AD9, "disablebulletwhizbyreaction" }, +// { 0x0ADA, "" }, + { 0x0ADB, "main_driver" }, + { 0x0ADC, "ridingvehicle" }, + { 0x0ADD, "driver_shooting" }, + { 0x0ADE, "main_passenger" }, + { 0x0ADF, "passenger_shooting" }, + { 0x0AE0, "diraimlimit" }, + { 0x0AE1, "snowmobile_loop_driver" }, + { 0x0AE2, "steering_enable" }, + { 0x0AE3, "update_steering" }, +// { 0x0AE4, "" }, +// { 0x0AE5, "" }, + { 0x0AE6, "snowmobile_loop_passenger_shooting" }, + { 0x0AE7, "snowmobile_do_event" }, + { 0x0AE8, "snowmobile_handle_events" }, + { 0x0AE9, "event" }, + { 0x0AEA, "snowmobile_start_shooting" }, + { 0x0AEB, "snowmobile_stop_shooting" }, +// { 0x0AEC, "" }, + { 0x0AED, "snowmobile_decide_shoot_internal" }, + { 0x0AEE, "snowmobileshootbehavior" }, + { 0x0AEF, "vehicle" }, + { 0x0AF0, "snowmobile_shoot" }, + { 0x0AF1, "shootuntilshootbehaviorchange" }, + { 0x0AF2, "snowmobile_reload" }, + { 0x0AF3, "needtoreload" }, + { 0x0AF4, "snowmobile_reload_internal" }, + { 0x0AF5, "stop_aiming_for_reload" }, +// { 0x0AF6, "" }, + { 0x0AF7, "snowmobile_waitfor_start_aim" }, + { 0x0AF8, "snowmobile_waitfor_end" }, + { 0x0AF9, "snowmobile_waitfor_start_lean" }, + { 0x0AFA, "snowmobile_trackshootentorpos_driver" }, + { 0x0AFB, "snowmobile_trackshootentorpos_passenger" }, +// { 0x0AFC, "" }, + { 0x0AFD, "prevsnowmobiledeath" }, + { 0x0AFE, "prevsnowmobiledeathtime" }, + { 0x0AFF, "snowmobile_death_launchslide" }, + { 0x0B00, "prevframevelocity" }, + { 0x0B01, "snowmobile_normal_death" }, + { 0x0B02, "snowmobile_collide_death" }, +// { 0x0B03, "" }, +// { 0x0B04, "" }, + { 0x0B05, "snowmobile_setanim_driver" }, + { 0x0B06, "snowmobile_setanim_passenger" }, +// { 0x0B07, "" }, + { 0x0B08, "runningreacttobullets" }, + { 0x0B09, "lastrunningreactanim" }, + { 0x0B0A, "coverreactions" }, + { 0x0B0B, "reactionscheckloop" }, +// { 0x0B0C, "" }, + { 0x0B0D, "lastreacttime" }, +// { 0x0B0E, "" }, + { 0x0B0F, "whizbyenemy" }, + { 0x0B10, "disable_dive_whizby_react" }, + { 0x0B11, "randomanimoftwo" }, +// { 0x0B12, "" }, + { 0x0B13, "clearlookatthread" }, +// { 0x0B14, "" }, +// { 0x0B15, "" }, + { 0x0B16, "newenemyreactionanim" }, + { 0x0B17, "newenemysurprisedreaction" }, +// { 0x0B18, "" }, + { 0x0B19, "nextallowedlooktime" }, + { 0x0B1A, "nextallowedsuppresstime" }, + { 0x0B1B, "seekoutenemytime" }, + { 0x0B1C, "lastencountertime" }, + { 0x0B1D, "idlingatcover" }, + { 0x0B1E, "meleecoverchargemintime" }, + { 0x0B1F, "shouldhelpadvancingteammate" }, + { 0x0B20, "tryrunningtoenemy" }, + { 0x0B21, "mainloopstart" }, +// { 0x0B22, "" }, + { 0x0B23, "throwgrenadeatplayerasap" }, + { 0x0B24, "cansuppressenemyfromexposed" }, +// { 0x0B25, "" }, +// { 0x0B26, "" }, + { 0x0B27, "aggressivemode" }, + { 0x0B28, "turntomatchnode" }, + { 0x0B29, "prevattack" }, + { 0x0B2A, "meleecoverchargegraceendtime" }, + { 0x0B2B, "getcorrectcoverangles" }, + { 0x0B2C, "getnodeforwardyaw" }, + { 0x0B2D, "respondtodeadteammate" }, + { 0x0B2E, "respondtodeathtime" }, + { 0x0B2F, "dononattackcoverbehavior" }, + { 0x0B30, "attackvisibleenemy" }, + { 0x0B31, "attacksuppressableenemy" }, +// { 0x0B32, "" }, + { 0x0B33, "attacknothingtodo" }, + { 0x0B34, "isenemyvisiblefromexposed" }, +// { 0x0B35, "" }, + { 0x0B36, "suppressedbehavior" }, + { 0x0B37, "issuppressedwrapper" }, + { 0x0B38, "favor_blindfire" }, + { 0x0B39, "getpermutation" }, + { 0x0B3A, "calloptionalbehaviorcallback" }, +// { 0x0B3B, "" }, + { 0x0B3C, "suppressionstart" }, + { 0x0B3D, "coverreload" }, + { 0x0B3E, "isreloading" }, + { 0x0B3F, "reload" }, + { 0x0B40, "leavecoverandshoot" }, + { 0x0B41, "lookforenemy" }, + { 0x0B42, "fastlook" }, + { 0x0B43, "lookfast" }, + { 0x0B44, "idle" }, + { 0x0B45, "flinching" }, + { 0x0B46, "flinch" }, + { 0x0B47, "idlewait" }, +// { 0x0B48, "" }, +// { 0x0B49, "" }, +// { 0x0B4A, "" }, + { 0x0B4B, "endidleatframeend" }, + { 0x0B4C, "trythrowinggrenade" }, + { 0x0B4D, "ispartiallysuppressedwrapper" }, + { 0x0B4E, "grenadehidden" }, + { 0x0B4F, "blindfire" }, + { 0x0B50, "canblindfire" }, + { 0x0B51, "breakoutofshootingifwanttomoveup" }, + { 0x0B52, "enemyishiding" }, + { 0x0B53, "resetrespondtodeathtime" }, + { 0x0B54, "resetlookforbettercovertime" }, +// { 0x0B55, "" }, + { 0x0B56, "resetseekoutenemytime" }, + { 0x0B57, "cantfindanythingtodo" }, + { 0x0B58, "advanceonhidingenemy" }, + { 0x0B59, "trytogetoutofdangeroussituation" }, + { 0x0B5A, "set_standing_turns" }, + { 0x0B5B, "set_crouching_turns" }, +// { 0x0B5C, "" }, + { 0x0B5D, "turnthreshold" }, + { 0x0B5E, "turntofacerelativeyaw" }, + { 0x0B5F, "shufflemove" }, + { 0x0B60, "shufflenode" }, + { 0x0B61, "cover_wall_think" }, + { 0x0B62, "covertype" }, + { 0x0B63, "aimidlethread" }, + { 0x0B64, "usingmg" }, + { 0x0B65, "turretinfo" }, + { 0x0B66, "fasteranimspeed" }, + { 0x0B67, "movetooriginovertime" }, + { 0x0B68, "exitpronewrapper" }, + { 0x0B69, "isrpd" }, +// { 0x0B6A, "" }, + { 0x0B6B, "crouchingisok" }, + { 0x0B6C, "setup_cover_crouch" }, + { 0x0B6D, "setup_cover_stand" }, + { 0x0B6E, "popupandshoot" }, + { 0x0B6F, "rambochance" }, + { 0x0B70, "endfireandanimidlethread" }, + { 0x0B71, "rockets" }, + { 0x0B72, "throwdownweapon" }, +// { 0x0B73, "" }, + { 0x0B74, "didsomethingotherthanshooting" }, + { 0x0B75, "shootuntilshootbehaviorchange_coverwall" }, +// { 0x0B76, "" }, + { 0x0B77, "hasenemysightpos" }, + { 0x0B78, "animarrayanyexist" }, + { 0x0B79, "getnodeoffset" }, + { 0x0B7A, "isrambo" }, + { 0x0B7B, "ramboaim" }, +// { 0x0B7C, "" }, + { 0x0B7D, "playidleanimation" }, +// { 0x0B7E, "" }, + { 0x0B7F, "peekout" }, + { 0x0B80, "script_dontpeek" }, + { 0x0B81, "pop_up_and_hide_speed" }, + { 0x0B82, "randomfasteranimspeed" }, + { 0x0B83, "pop_up" }, + { 0x0B84, "getanimendpos" }, +// { 0x0B85, "" }, + { 0x0B86, "setup_additive_aim" }, + { 0x0B87, "go_to_hide" }, + { 0x0B88, "endaimidlethread" }, + { 0x0B89, "trythrowinggrenadestayhidden" }, + { 0x0B8A, "dontevershoot" }, + { 0x0B8B, "dontattackme" }, + { 0x0B8C, "trygrenade" }, + { 0x0B8D, "createturret" }, +// { 0x0B8E, "" }, +// { 0x0B8F, "" }, + { 0x0B90, "useselfplacedturret" }, + { 0x0B91, "turret_function" }, +// { 0x0B92, "" }, + { 0x0B93, "issetup" }, +// { 0x0B94, "" }, + { 0x0B95, "ramboanims" }, + { 0x0B96, "covercrouch" }, + { 0x0B97, "covercrouchfail" }, +// { 0x0B98, "" }, + { 0x0B99, "setup_standing_anim_array" }, + { 0x0B9A, "coverstand" }, + { 0x0B9B, "coverstandfail" }, +// { 0x0B9C, "" }, + { 0x0B9D, "loophide" }, + { 0x0B9E, "anglerangethread" }, + { 0x0B9F, "needtochangecovermode" }, + { 0x0BA0, "getbestcovermode" }, + { 0x0BA1, "getrandomcovermode" }, + { 0x0BA2, "getshootpospitch" }, + { 0x0BA3, "getenemyeyepos" }, + { 0x0BA4, "moverun" }, + { 0x0BA5, "chooseposefunc" }, + { 0x0BA6, "beginstandrun" }, + { 0x0BA7, "run_overrideanim" }, +// { 0x0BA8, "" }, + { 0x0BA9, "movestandmoveoverride" }, + { 0x0BAA, "begincrouchrun" }, + { 0x0BAB, "crouchrun_combatanim" }, + { 0x0BAC, "beginpronerun" }, + { 0x0BAD, "getrunanim" }, + { 0x0BAE, "moveanim" }, + { 0x0BAF, "getcrouchrunanim" }, + { 0x0BB0, "pronecrawl" }, + { 0x0BB1, "moveplaybackrate" }, + { 0x0BB2, "initrunngun" }, + { 0x0BB3, "runngun" }, + { 0x0BB4, "update_move_anim_type" }, +// { 0x0BB5, "" }, + { 0x0BB6, "runngunweight" }, + { 0x0BB7, "allowedpartialreloadontheruntime" }, + { 0x0BB8, "runngun_backward" }, + { 0x0BB9, "reacttobulletsinterruptcheck" }, + { 0x0BBA, "reactingtobullet" }, +// { 0x0BBB, "" }, + { 0x0BBC, "requestreacttobullet" }, +// { 0x0BBD, "" }, + { 0x0BBE, "customrunningreacttobullets" }, + { 0x0BBF, "run_overridebulletreact" }, + { 0x0BC0, "getsprintanim" }, +// { 0x0BC1, "" }, + { 0x0BC2, "sprint" }, + { 0x0BC3, "shouldsprintforvariation" }, + { 0x0BC4, "neversprintforvariation" }, + { 0x0BC5, "dangersprinttime" }, + { 0x0BC6, "getmoveplaybackrate" }, + { 0x0BC7, "movestandcombatnormal" }, + { 0x0BC8, "reacttobulletchance" }, + { 0x0BC9, "mayshootwhilemoving" }, + { 0x0BCA, "norunngun" }, + { 0x0BCB, "sidesteprate" }, + { 0x0BCC, "faceenemyaimtracking" }, + { 0x0BCD, "endfaceenemyaimtracking" }, + { 0x0BCE, "runshootwhilemovingthreads" }, + { 0x0BCF, "shoot_while_moving_thread" }, + { 0x0BD0, "stopshootwhilemovingthreads" }, + { 0x0BD1, "rundecidewhatandhowtoshoot" }, + { 0x0BD2, "runshootwhilemoving" }, + { 0x0BD3, "shootwhilemoving" }, + { 0x0BD4, "canshootwhilerunningforward" }, +// { 0x0BD5, "" }, +// { 0x0BD6, "" }, +// { 0x0BD7, "" }, + { 0x0BD8, "movestandnoncombatnormal" }, + { 0x0BD9, "movecrouchrunoverride" }, + { 0x0BDA, "movecrouchrunnormal" }, + { 0x0BDB, "reloadstandrun" }, + { 0x0BDC, "dontshootwhilemoving" }, + { 0x0BDD, "norunreload" }, + { 0x0BDE, "reloadstandruninternal" }, + { 0x0BDF, "getuniqueflagnameindex" }, +// { 0x0BE0, "" }, + { 0x0BE1, "runloopisnearbeginning" }, + { 0x0BE2, "setmovenonforwardanims" }, + { 0x0BE3, "setcombatstandmoveanimweights" }, + { 0x0BE4, "updatemoveanimweights" }, + { 0x0BE5, "wasfacingmotion" }, + { 0x0BE6, "updaterunweightsonce" }, + { 0x0BE7, "quadrantanimweights" }, + { 0x0BE8, "changeweaponstandrun" }, + { 0x0BE9, "wantshotgun" }, + { 0x0BEA, "secondaryweapon" }, + { 0x0BEB, "shotgunswitchstandruninternal" }, + { 0x0BEC, "donotetracksfortimeintercept" }, +// { 0x0BED, "" }, +// { 0x0BEE, "" }, +// { 0x0BEF, "" }, + { 0x0BF0, "lastweapon" }, + { 0x0BF1, "melee_init" }, + { 0x0BF2, "melee_stealthcheck" }, + { 0x0BF3, "ent_flag" }, + { 0x0BF4, "melee_tryexecuting" }, + { 0x0BF5, "dontmelee" }, + { 0x0BF6, "melee_resetaction" }, + { 0x0BF7, "melee" }, + { 0x0BF8, "initiated" }, + { 0x0BF9, "inprogress" }, + { 0x0BFA, "melee_chooseaction" }, + { 0x0BFB, "specialmelee_standard" }, + { 0x0BFC, "nextmeleechecktime" }, +// { 0x0BFD, "" }, + { 0x0BFE, "melee_updateandvalidatestartpos" }, + { 0x0BFF, "startpos" }, + { 0x0C00, "starttotargetcornerangles" }, + { 0x0C01, "melee_isvalid" }, + { 0x0C02, "meleechargedistsq" }, + { 0x0C03, "nofirstframemelee" }, + { 0x0C04, "scriptstarttime" }, +// { 0x0C05, "" }, + { 0x0C06, "nextmeleechargetime" }, + { 0x0C07, "nextmeleechargetarget" }, + { 0x0C08, "melee_startmovement" }, + { 0x0C09, "playingmovementanim" }, + { 0x0C0A, "melee_stopmovement" }, + { 0x0C0B, "melee_mainloop" }, + { 0x0C0C, "melee_standard_delaystandardcharge" }, + { 0x0C0D, "nextmeleestandardchargetime" }, + { 0x0C0E, "nextmeleestandardchargetarget" }, + { 0x0C0F, "melee_standard_checktimeconstraints" }, +// { 0x0C10, "" }, + { 0x0C11, "specialmeleechooseaction" }, + { 0x0C12, "melee_standard_resetgiveuptime" }, + { 0x0C13, "giveuptime" }, + { 0x0C14, "melee_standard_main" }, + { 0x0C15, "melee_standard_playattackloop" }, +// { 0x0C16, "" }, + { 0x0C17, "distance2dsquared" }, + { 0x0C18, "melee_standard_getinposition" }, + { 0x0C19, "melee_playchargesound" }, +// { 0x0C1A, "" }, + { 0x0C1B, "melee_aivsai_exposed_chooseanimationandposition_flip" }, +// { 0x0C1C, "" }, + { 0x0C1D, "animname" }, + { 0x0C1E, "surviveanimname" }, + { 0x0C1F, "melee_aivsai_exposed_chooseanimationandposition_wrestle" }, + { 0x0C20, "meleealwayswin" }, + { 0x0C21, "melee_aivsai_exposed_chooseanimationandposition_behind" }, + { 0x0C22, "melee_aivsai_exposed_chooseanimationandposition_buildexposedlist" }, +// { 0x0C23, "" }, + { 0x0C24, "meleeforcedexposedwrestle" }, + { 0x0C25, "melee_aivsai_exposed_chooseanimationandposition" }, + { 0x0C26, "startangles" }, +// { 0x0C27, "" }, + { 0x0C28, "melee_aivsai_specialcover_chooseanimationandposition" }, + { 0x0C29, "faceyaw" }, + { 0x0C2A, "melee_aivsai_specialcover_canexecute" }, + { 0x0C2B, "melee_aivsai_chooseaction" }, + { 0x0C2C, "precisepositioning" }, + { 0x0C2D, "startposoffset" }, + { 0x0C2E, "melee_aivsai_schedulenotetracklink" }, + { 0x0C2F, "syncnotetrackent" }, + { 0x0C30, "melee_aivsai_targetlink" }, +// { 0x0C31, "" }, + { 0x0C32, "melee_aivsai_main" }, + { 0x0C33, "death" }, + { 0x0C34, "partner" }, + { 0x0C35, "forceuseweapon" }, + { 0x0C36, "getcurrentweaponslotname" }, + { 0x0C37, "weaponslot" }, + { 0x0C38, "melee_aivsai_animcustominterruptionmonitor" }, + { 0x0C39, "melee_aivsai_getinposition_updateandvalidatetarget" }, + { 0x0C3A, "melee_aivsai_getinposition_issuccessful" }, + { 0x0C3B, "melee_aivsai_getinposition_finalize" }, + { 0x0C3C, "melee_aivsai_getinposition" }, + { 0x0C3D, "melee_aivsai_execute" }, + { 0x0C3E, "survive" }, + { 0x0C3F, "melee_disableinterruptions" }, + { 0x0C40, "wasallowingpain" }, + { 0x0C41, "wasflashbangimmune" }, + { 0x0C42, "disable_pain" }, + { 0x0C43, "setflashbangimmunity" }, +// { 0x0C44, "" }, +// { 0x0C45, "" }, +// { 0x0C46, "" }, + { 0x0C47, "melee_droppedweaponmonitorthread" }, + { 0x0C48, "melee_partnerendedmeleemonitorthread_shouldanimsurvive" }, + { 0x0C49, "surviveanimallowed" }, +// { 0x0C4A, "" }, + { 0x0C4B, "animateddeath" }, + { 0x0C4C, "interruptdeath" }, + { 0x0C4D, "unsynchappened" }, + { 0x0C4E, "melee_unlink" }, +// { 0x0C4F, "" }, + { 0x0C50, "melee_handlenotetracks_unsync" }, + { 0x0C51, "melee_handlenotetracks_shoulddieafterunsync" }, + { 0x0C52, "melee_handlenotetracks_death" }, + { 0x0C53, "melee_handlenotetracks" }, + { 0x0C54, "hasknife" }, +// { 0x0C55, "" }, + { 0x0C56, "melee_deathhandler_delayed" }, +// { 0x0C57, "" }, + { 0x0C58, "melee_endscript_checkdeath" }, + { 0x0C59, "melee_endscript_checkpositionandmovement" }, + { 0x0C5A, "melee_endscript_checkweapon" }, + { 0x0C5B, "melee_endscript_checkstatechanges" }, + { 0x0C5C, "enable_pain" }, + { 0x0C5D, "melee_endscript" }, + { 0x0C5E, "melee_acquiremutex" }, + { 0x0C5F, "melee_releasemutex" }, +// { 0x0C60, "" }, + { 0x0C61, "determinecqbanim" }, + { 0x0C62, "runloopcount" }, + { 0x0C63, "getrandomintfromseed" }, + { 0x0C64, "cqbtracking" }, +// { 0x0C65, "" }, + { 0x0C66, "cqbpointsofinterest" }, +// { 0x0C67, "" }, +// { 0x0C68, "" }, + { 0x0C69, "disable_cqb_points_of_interest" }, + { 0x0C6A, "movewalk" }, + { 0x0C6B, "beginstandwalk" }, + { 0x0C6C, "walk_overrideanim" }, + { 0x0C6D, "walk_override_weights" }, +// { 0x0C6E, "" }, + { 0x0C6F, "beginpronewalk" }, + { 0x0C70, "dowalkanimoverride" }, + { 0x0C71, "getwalkanim" }, + { 0x0C72, "dowalkanim" }, + { 0x0C73, "doorenterexitcheck" }, + { 0x0C74, "disabledoorbehavior" }, + { 0x0C75, "teamflashbangimmune" }, +// { 0x0C76, "" }, + { 0x0C77, "dodoorgrenadethrow" }, + { 0x0C78, "nextdoorgrenadetime" }, + { 0x0C79, "minindoortime" }, + { 0x0C7A, "oldgrenadeweapon" }, + { 0x0C7B, "pathchangecheck" }, + { 0x0C7C, "restartmoveloop" }, + { 0x0C7D, "doorenter_trygrenade" }, + { 0x0C7E, "setactivegrenadetimer" }, + { 0x0C7F, "getgrenadethrowoffset" }, + { 0x0C80, "trygrenadethrow" }, + { 0x0C81, "indoorcqbtogglecheck" }, + { 0x0C82, "isindoor" }, + { 0x0C83, "doorenter_enable_cqbwalk" }, +// { 0x0C84, "" }, + { 0x0C85, "cqbwalking" }, + { 0x0C86, "enable_cqbwalk" }, + { 0x0C87, "doorexit_disable_cqbwalk" }, + { 0x0C88, "cqbenabled" }, + { 0x0C89, "disable_cqbwalk" }, + { 0x0C8A, "distance2dandheightcheck" }, +// { 0x0C8B, "" }, + { 0x0C8C, "doorenter" }, + { 0x0C8D, "doorfragchance" }, +// { 0x0C8E, "" }, + { 0x0C8F, "doorexit" }, + { 0x0C90, "custom_animscript_table" }, + { 0x0C91, "startmovetransition" }, + { 0x0C92, "doingreacquirestep" }, + { 0x0C93, "ignorepathchange" }, +// { 0x0C94, "" }, +// { 0x0C95, "" }, + { 0x0C96, "moveloopoverridefunc" }, + { 0x0C97, "moveinit" }, +// { 0x0C98, "" }, + { 0x0C99, "getupifprone" }, + { 0x0C9A, "choosepose" }, + { 0x0C9B, "proneto" }, + { 0x0C9C, "waspreviouslyincover" }, +// { 0x0C9D, "" }, + { 0x0C9E, "movemainloop" }, + { 0x0C9F, "changemovemode" }, + { 0x0CA0, "prevmovemode" }, + { 0x0CA1, "movemainloopinternal" }, + { 0x0CA2, "moveloopcleanupfunc" }, + { 0x0CA3, "movemainloopprocess" }, + { 0x0CA4, "iscqbwalkingorfacingenemy" }, + { 0x0CA5, "ammocheattime" }, + { 0x0CA6, "cheatammoifnecessary" }, + { 0x0CA7, "startthreadstorunwhilemoving" }, + { 0x0CA8, "stairscheck" }, + { 0x0CA9, "prevstairsstate" }, + { 0x0CAA, "noturnanims" }, + { 0x0CAB, "turnanim" }, + { 0x0CAC, "turntime" }, + { 0x0CAD, "pathchange_getturnanim" }, + { 0x0CAE, "pathturnanimoverridefunc" }, + { 0x0CAF, "pathchange_candoturnanim" }, + { 0x0CB0, "pathchange_doturnanim" }, + { 0x0CB1, "pathturnanimblendtime" }, + { 0x0CB2, "pathchange_domovetransition" }, + { 0x0CB3, "pathchange_cleanupturnanim" }, + { 0x0CB4, "dodgemoveloopoverride" }, + { 0x0CB5, "trydodgewithanim" }, + { 0x0CB6, "animdodgeobstacle" }, + { 0x0CB7, "dodgeleftanim" }, + { 0x0CB8, "dodgerightanim" }, + { 0x0CB9, "dodgerightanimoffset" }, + { 0x0CBA, "dodgeleftanimoffset" }, + { 0x0CBB, "setdodgeanims" }, + { 0x0CBC, "cleardodgeanims" }, + { 0x0CBD, "meleeattackcheck_whilemoving" }, + { 0x0CBE, "meleeplayerwhilemoving" }, + { 0x0CBF, "bulletwhizbycheck_whilemoving" }, + { 0x0CC0, "get_shuffle_to_corner_start_anim" }, +// { 0x0CC1, "" }, +// { 0x0CC2, "" }, + { 0x0CC3, "movecovertocover_checkendpose" }, + { 0x0CC4, "movecovertocover" }, + { 0x0CC5, "shufflemoveinterrupted" }, + { 0x0CC6, "movecovertocoverfinish" }, + { 0x0CC7, "movedoorsidetoside" }, + { 0x0CC8, "handlesidetosidenotetracks" }, +// { 0x0CC9, "" }, +// { 0x0CCA, "" }, + { 0x0CCB, "goingtoproneaim" }, + { 0x0CCC, "enterpronewrapper" }, + { 0x0CCD, "updatepronewrapper" }, + { 0x0CCE, "pronecombatmainloop" }, +// { 0x0CCF, "" }, + { 0x0CD0, "pronereload" }, + { 0x0CD1, "setup_cover_prone" }, + { 0x0CD2, "considerthrowgrenade" }, + { 0x0CD3, "shouldfirewhilechangingpose" }, + { 0x0CD4, "getaimyawtoshootentorpos" }, + { 0x0CD5, "prone_transitionto" }, +// { 0x0CD6, "" }, + { 0x0CD7, "setupproneaim" }, + { 0x0CD8, "prone_anim_override" }, + { 0x0CD9, "prone_rate_override" }, + { 0x0CDA, "no_ai" }, + { 0x0CDB, "randomizeidleset" }, + { 0x0CDC, "setposemovement" }, + { 0x0CDD, "idleset" }, + { 0x0CDE, "setlaststoppedtime" }, + { 0x0CDF, "laststoppedtime" }, + { 0x0CE0, "specialidleloop" }, + { 0x0CE1, "specialidleanim" }, + { 0x0CE2, "animplaybackrate" }, +// { 0x0CE3, "" }, + { 0x0CE4, "transitiontoidle" }, + { 0x0CE5, "idleanimtransition" }, + { 0x0CE6, "playidle" }, + { 0x0CE7, "readyanimarray" }, + { 0x0CE8, "busereadyidle" }, + { 0x0CE9, "readyanimweights" }, + { 0x0CEA, "anim_array" }, + { 0x0CEB, "idleanimarray" }, + { 0x0CEC, "idleanimweights" }, + { 0x0CED, "pronestill" }, + { 0x0CEE, "updatepronethread" }, + { 0x0CEF, "delayedexception" }, + { 0x0CF0, "do_friendly_fire_reaction" }, + { 0x0CF1, "disablefriendlyfirereaction" }, + { 0x0CF2, "transitiontocombat" }, +// { 0x0CF3, "" }, + { 0x0CF4, "setup" }, + { 0x0CF5, "previouspitchdelta" }, + { 0x0CF6, "setupaim" }, + { 0x0CF7, "meleestate" }, + { 0x0CF8, "stopshortly" }, + { 0x0CF9, "set_aim_and_turn_limits" }, + { 0x0CFA, "defaultturnthreshold" }, + { 0x0CFB, "setupexposedcombatloop" }, + { 0x0CFC, "magicreloadwhenreachenemy" }, + { 0x0CFD, "dontcrouchtime" }, +// { 0x0CFE, "" }, + { 0x0CFF, "startfireandaimidlethread" }, + { 0x0D00, "exposedcombatcheckstance" }, +// { 0x0D01, "" }, + { 0x0D02, "forcesidearm" }, + { 0x0D03, "usingprimary" }, + { 0x0D04, "exposedcombatcheckputawaypistol" }, + { 0x0D05, "exposedcombatpositionadjust" }, + { 0x0D06, "exposedcombatneedtoturn" }, + { 0x0D07, "getpredictedaimyawtoshootentorpos" }, + { 0x0D08, "exposedcombatmainloop" }, + { 0x0D09, "hidefireshowaimidle" }, +// { 0x0D0A, "" }, +// { 0x0D0B, "" }, +// { 0x0D0C, "" }, + { 0x0D0D, "waitforstancechange" }, +// { 0x0D0E, "" }, + { 0x0D0F, "group" }, + { 0x0D10, "nextgiveuponenemytime" }, + { 0x0D11, "cantseeenemywait" }, + { 0x0D12, "resetgiveuponenemytime" }, + { 0x0D13, "watchshootentvelocity" }, + { 0x0D14, "shouldswapshotgun" }, + { 0x0D15, "donotetrackswithendon" }, + { 0x0D16, "faceenemyimmediately" }, + { 0x0D17, "isdeltaallowed" }, + { 0x0D18, "isanimdeltaingoal" }, + { 0x0D19, "doturn" }, + { 0x0D1A, "iscombatpathnode" }, + { 0x0D1B, "turnlastresort" }, + { 0x0D1C, "doturnnotetracks" }, +// { 0x0D1D, "" }, + { 0x0D1E, "turningaimingon" }, + { 0x0D1F, "turningaimingoff" }, +// { 0x0D20, "" }, + { 0x0D21, "shootuntilneedtoturn" }, + { 0x0D22, "watchforneedtoturnortimeout" }, +// { 0x0D23, "" }, + { 0x0D24, "minexposedgrenadedist" }, + { 0x0D25, "nextgrenadetrytime" }, + { 0x0D26, "tryexposedthrowgrenade" }, + { 0x0D27, "grenadethrowpose" }, + { 0x0D28, "grenadecooldownelapsed" }, + { 0x0D29, "getyawtospot" }, + { 0x0D2A, "transitionto" }, + { 0x0D2B, "keeptryingtomelee" }, + { 0x0D2C, "trymelee" }, +// { 0x0D2D, "" }, + { 0x0D2E, "nomeleechargedelay" }, + { 0x0D2F, "exposedreload" }, + { 0x0D30, "exposedreloading" }, + { 0x0D31, "specialreloadanimfunc" }, +// { 0x0D32, "" }, +// { 0x0D33, "" }, + { 0x0D34, "abortreloadwhencanshoot" }, +// { 0x0D35, "" }, + { 0x0D36, "drop_turret" }, + { 0x0D37, "dropturret" }, + { 0x0D38, "needstorechamber" }, + { 0x0D39, "restoredefaults" }, + { 0x0D3A, "exception_exposed_mg42_portable" }, + { 0x0D3B, "tryusingsidearm" }, + { 0x0D3C, "no_pistol_switch" }, + { 0x0D3D, "switchtosidearm" }, +// { 0x0D3E, "" }, +// { 0x0D3F, "" }, + { 0x0D40, "donotetrackspostcallbackwithendon" }, + { 0x0D41, "donotetrackspostcallback" }, + { 0x0D42, "faceenemydelay" }, + { 0x0D43, "handlepickup" }, + { 0x0D44, "switchtolastweapon" }, +// { 0x0D45, "" }, + { 0x0D46, "handleputaway" }, + { 0x0D47, "handlecleanupputaway" }, +// { 0x0D48, "" }, + { 0x0D49, "reacquirewhennecessary" }, + { 0x0D4A, "tryexposedreacquire" }, + { 0x0D4B, "reacquire_state" }, + { 0x0D4C, "prevenemy" }, + { 0x0D4D, "approachnumber" }, + { 0x0D4E, "approachtype" }, + { 0x0D4F, "covertrans" }, + { 0x0D50, "movetransitionrate" }, + { 0x0D51, "arrivalendstance" }, + { 0x0D52, "lastapproachaborttime" }, + { 0x0D53, "handlestartaim" }, + { 0x0D54, "isthreatenedbyenemy" }, + { 0x0D55, "abortapproachifthreatened" }, +// { 0x0D56, "" }, + { 0x0D57, "canusesawapproach" }, + { 0x0D58, "getnodeyawtoenemy" }, + { 0x0D59, "determinenodeapproachtype" }, + { 0x0D5A, "approach_types" }, + { 0x0D5B, "arrivalstance" }, + { 0x0D5C, "determinenodeexittype" }, +// { 0x0D5D, "" }, + { 0x0D5E, "coverexit" }, + { 0x0D5F, "determineexposedapproachtype" }, + { 0x0D60, "getmaxdirectionsandexcludedirfromapproachtype" }, + { 0x0D61, "maxdirections" }, + { 0x0D62, "excludedir" }, + { 0x0D63, "shouldapproachtoexposed" }, + { 0x0D64, "exposedtransition" }, + { 0x0D65, "canseepointfromexposedatnode" }, +// { 0x0D66, "" }, + { 0x0D67, "getapproachent" }, + { 0x0D68, "getapproachpoint" }, + { 0x0D69, "checkapproachpreconditions" }, + { 0x0D6A, "disablearrivals" }, + { 0x0D6B, "checkapproachconditions" }, + { 0x0D6C, "coverapproachlastminutecheck" }, + { 0x0D6D, "approachwaittillclose" }, + { 0x0D6E, "startcoverapproach" }, + { 0x0D6F, "newarrivals" }, + { 0x0D70, "covertranslongestdist" }, + { 0x0D71, "covertransdist" }, +// { 0x0D72, "" }, +// { 0x0D73, "" }, + { 0x0D74, "checkarrivalenterpositions" }, + { 0x0D75, "transindex" }, + { 0x0D76, "dolastminuteexposedapproachwrapper" }, + { 0x0D77, "watchgoalchanged" }, + { 0x0D78, "exposedapproachconditioncheck" }, +// { 0x0D79, "" }, + { 0x0D7A, "exposedapproachwaittillclose" }, + { 0x0D7B, "longestexposedapproachdist" }, + { 0x0D7C, "faceenemyatendofapproach" }, +// { 0x0D7D, "" }, +// { 0x0D7E, "" }, +// { 0x0D7F, "" }, + { 0x0D80, "faceenemyarrival" }, + { 0x0D81, "transitions" }, + { 0x0D82, "waitforpathgoalpos" }, + { 0x0D83, "startmovetransitionpreconditions" }, + { 0x0D84, "disableexits" }, + { 0x0D85, "startmovetransitionconditions" }, + { 0x0D86, "getexitnode" }, + { 0x0D87, "custommovetransitionfunc" }, + { 0x0D88, "startmovetransitionanim" }, + { 0x0D89, "determinenonnodeexittype" }, + { 0x0D8A, "determineheatcoverexittype" }, +// { 0x0D8B, "" }, + { 0x0D8C, "permanentcustommovetransition" }, + { 0x0D8D, "coverexitpos" }, +// { 0x0D8E, "" }, + { 0x0D8F, "docoverexitanimation" }, + { 0x0D90, "finishcoverexitnotetracks" }, + { 0x0D91, "drawvec" }, + { 0x0D92, "drawapproachvec" }, + { 0x0D93, "calculatenodetransitionangles" }, + { 0x0D94, "coverexitangles" }, + { 0x0D95, "sortnodetransitionangles" }, + { 0x0D96, "checkcoverexitpos" }, + { 0x0D97, "coverexitdist" }, +// { 0x0D98, "" }, + { 0x0D99, "getarrivalstartpos" }, + { 0x0D9A, "getarrivalprestartpos" }, +// { 0x0D9B, "" }, + { 0x0D9C, "checkcoverenterpos" }, + { 0x0D9D, "use_readystand" }, + { 0x0D9E, "readystand_anims_inited" }, + { 0x0D9F, "debug_arrivals_on_actor" }, + { 0x0DA0, "debug_arrival" }, + { 0x0DA1, "scr_notetrack" }, + { 0x0DA2, "scr_face" }, + { 0x0DA3, "scr_look" }, + { 0x0DA4, "scr_animsound" }, + { 0x0DA5, "scr_sound" }, + { 0x0DA6, "scr_radio" }, + { 0x0DA7, "scr_text" }, +// { 0x0DA8, "" }, + { 0x0DA9, "_lastanimtime" }, + { 0x0DAA, "anim_first_frame" }, + { 0x0DAB, "anim_generic_first_frame" }, + { 0x0DAC, "anim_generic" }, + { 0x0DAD, "anim_generic_gravity" }, + { 0x0DAE, "anim_generic_run" }, + { 0x0DAF, "anim_generic_reach" }, + { 0x0DB0, "anim_generic_reach_and_arrive" }, + { 0x0DB1, "anim_reach_and_plant" }, + { 0x0DB2, "anim_reach_and_plant_and_arrive" }, + { 0x0DB3, "anim_generic_loop" }, + { 0x0DB4, "anim_custom_animmode" }, + { 0x0DB5, "anim_custom_animmode_loop" }, + { 0x0DB6, "wait_until_anim_finishes" }, + { 0x0DB7, "anim_generic_custom_animmode" }, + { 0x0DB8, "anim_generic_custom_animmode_loop" }, +// { 0x0DB9, "" }, + { 0x0DBA, "anim_first_frame_solo" }, + { 0x0DBB, "anim_last_frame_solo" }, + { 0x0DBC, "assert_existance_of_anim" }, + { 0x0DBD, "anim_first_frame_on_guy" }, + { 0x0DBE, "first_frame_time" }, + { 0x0DBF, "anim_custom_animmode_on_guy" }, + { 0x0DC0, "_custom_anim" }, +// { 0x0DC1, "" }, + { 0x0DC2, "anim_loop_packet_solo" }, + { 0x0DC3, "anim_loop_packet" }, + { 0x0DC4, "remove_from_animloop" }, + { 0x0DC5, "play_sound_on_entity" }, + { 0x0DC6, "anim_single_failsafeonguy" }, + { 0x0DC7, "anim_single_failsafe" }, + { 0x0DC8, "anim_single" }, +// { 0x0DC9, "" }, + { 0x0DCA, "anim_single_internal" }, + { 0x0DCB, "anim_deathnotify" }, +// { 0x0DCC, "" }, + { 0x0DCD, "anim_dialogueendnotify" }, + { 0x0DCE, "anim_animationendnotify" }, + { 0x0DCF, "waittill_match_or_timeout" }, + { 0x0DD0, "dontdonotetracks" }, + { 0x0DD1, "add_animsound" }, + { 0x0DD2, "animsound_hudlimit" }, + { 0x0DD3, "animsounds" }, + { 0x0DD4, "end_time" }, +// { 0x0DD5, "" }, + { 0x0DD6, "anime" }, + { 0x0DD7, "notetrack" }, + { 0x0DD8, "animsound_tracker" }, + { 0x0DD9, "animsound_start_tracker" }, +// { 0x0DDA, "" }, + { 0x0DDB, "notetrack_wait" }, +// { 0x0DDC, "" }, +// { 0x0DDD, "" }, + { 0x0DDE, "play_sound_on_tag" }, +// { 0x0DDF, "" }, + { 0x0DE0, "anim_handle_notetrack" }, + { 0x0DE1, "anim_addmodel" }, + { 0x0DE2, "scriptmodel" }, + { 0x0DE3, "anim_removemodel" }, + { 0x0DE4, "gun_pickup_left" }, +// { 0x0DE5, "" }, + { 0x0DE6, "gun_pickup_right" }, + { 0x0DE7, "gun_leave_behind" }, + { 0x0DE8, "anim_weight" }, + { 0x0DE9, "anim_reach_and_idle" }, + { 0x0DEA, "reachers" }, + { 0x0DEB, "wait_for_guy_to_die_or_get_in_position" }, + { 0x0DEC, "idle_on_reach" }, + { 0x0DED, "get_anim_position" }, + { 0x0DEE, "anim_reach_together" }, + { 0x0DEF, "modify_moveplaybackrate_together" }, + { 0x0DF0, "remove_dead_from_array" }, + { 0x0DF1, "reach_goal_pos" }, + { 0x0DF2, "anim_reach" }, + { 0x0DF3, "anim_reach_with_funcs" }, + { 0x0DF4, "oldgoalradius" }, + { 0x0DF5, "anim_teleport" }, + { 0x0DF6, "anim_moveto" }, + { 0x0DF7, "anim_generic_teleport" }, + { 0x0DF8, "anim_spawn_generic_model" }, + { 0x0DF9, "anim_spawn_model" }, + { 0x0DFA, "anim_spawn_tag_model" }, + { 0x0DFB, "anim_link_tag_model" }, + { 0x0DFC, "anim_spawner_teleport" }, + { 0x0DFD, "reach_death_notify" }, +// { 0x0DFE, "" }, + { 0x0DFF, "set_goal_pos" }, + { 0x0E00, "reach_with_standard_adjustments_begin" }, + { 0x0E01, "oldpathenemyfightdist" }, + { 0x0E02, "oldpathenemylookahead" }, +// { 0x0E03, "" }, + { 0x0E04, "fixednodewason" }, + { 0x0E05, "old_disablearrivals" }, + { 0x0E06, "reach_with_standard_adjustments_end" }, + { 0x0E07, "anim_changes_pushplayer" }, + { 0x0E08, "dontchangepushplayer" }, + { 0x0E09, "reach_with_arrivals_begin" }, + { 0x0E0A, "reach_with_planting" }, +// { 0x0E0B, "" }, + { 0x0E0C, "setanimtree" }, + { 0x0E0D, "scr_animtree" }, +// { 0x0E0E, "" }, +// { 0x0E0F, "" }, + { 0x0E10, "anim_single_run_solo" }, + { 0x0E11, "anim_reach_and_idle_solo" }, +// { 0x0E12, "" }, + { 0x0E13, "anim_reach_and_approach_solo" }, + { 0x0E14, "anim_reach_and_approach_node_solo" }, +// { 0x0E15, "" }, +// { 0x0E16, "" }, + { 0x0E17, "anim_teleport_solo" }, +// { 0x0E18, "" }, + { 0x0E19, "completedanims" }, + { 0x0E1A, "anim_single_queue" }, + { 0x0E1B, "last_queue_time" }, + { 0x0E1C, "wait_for_buffer_time_to_pass" }, +// { 0x0E1D, "" }, + { 0x0E1E, "anim_generic_queue" }, + { 0x0E1F, "function_stack_timeout" }, + { 0x0E20, "anim_dontpushplayer" }, + { 0x0E21, "anim_pushplayer" }, + { 0x0E22, "addnotetrack_dialogue" }, + { 0x0E23, "add_notetrack_and_get_index" }, +// { 0x0E24, "" }, + { 0x0E25, "addnotetrack_sound" }, + { 0x0E26, "get_generic_anime" }, +// { 0x0E27, "" }, + { 0x0E28, "addnotetrack_animsound" }, +// { 0x0E29, "" }, + { 0x0E2A, "addnotetrack_detach" }, + { 0x0E2B, "addnotetrack_detach_gun" }, + { 0x0E2C, "addnotetrack_customfunction" }, + { 0x0E2D, "addnotetrack_startfxontag" }, +// { 0x0E2E, "" }, + { 0x0E2F, "addnotetrack_flag" }, +// { 0x0E30, "" }, +// { 0x0E31, "" }, +// { 0x0E32, "" }, + { 0x0E33, "set_talker_until_msg" }, + { 0x0E34, "talk_for_time" }, + { 0x0E35, "getyawangles" }, + { 0x0E36, "lookline" }, + { 0x0E37, "anim_reach_idle" }, + { 0x0E38, "reachidle" }, + { 0x0E39, "delayeddialogue" }, + { 0x0E3A, "clearfaceanimonanimdone" }, + { 0x0E3B, "anim_start_pos" }, + { 0x0E3C, "anim_start_pos_solo" }, + { 0x0E3D, "set_start_pos" }, + { 0x0E3E, "anim_start_at_groundpos" }, +// { 0x0E3F, "" }, + { 0x0E40, "anim_at_self" }, + { 0x0E41, "anim_at_entity" }, + { 0x0E42, "add_to_animsound" }, +// { 0x0E43, "" }, + { 0x0E44, "anim_set_rate" }, + { 0x0E45, "anim_set_rate_internal" }, + { 0x0E46, "getanim_from_animname" }, + { 0x0E47, "anim_set_time" }, +// { 0x0E48, "" }, + { 0x0E49, "getanim" }, + { 0x0E4A, "last_anim_time_check" }, + { 0x0E4B, "last_anim_time" }, +// { 0x0E4C, "" }, + { 0x0E4D, "hiding_door_spawner" }, + { 0x0E4E, "_hiding_door_pushplayer_clips" }, +// { 0x0E4F, "" }, + { 0x0E50, "script_flag_wait" }, + { 0x0E51, "add_spawn_function" }, + { 0x0E52, "hiding_door_guy" }, + { 0x0E53, "set_deathanim" }, + { 0x0E54, "clear_deathanim" }, + { 0x0E55, "quit_door_behavior" }, + { 0x0E56, "player_entered_backdoor" }, + { 0x0E57, "hiding_door_guy_should_charge" }, + { 0x0E58, "hiding_door_guy_should_throw_grenade" }, +// { 0x0E59, "" }, +// { 0x0E5A, "" }, +// { 0x0E5B, "" }, + { 0x0E5C, "hiding_door_guy_pushplayer" }, +// { 0x0E5D, "" }, + { 0x0E5E, "hiding_door_death" }, + { 0x0E5F, "hiding_door_death_door_connections" }, + { 0x0E60, "hiding_door_starts_open" }, + { 0x0E61, "setup_names" }, + { 0x0E62, "names" }, + { 0x0E63, "nameindex" }, + { 0x0E64, "copy_names" }, + { 0x0E65, "add_name" }, + { 0x0E66, "remove_name" }, + { 0x0E67, "init_script_friendnames" }, + { 0x0E68, "script_friendnames" }, + { 0x0E69, "normalize_script_friendname" }, + { 0x0E6A, "remove_script_friendnames_from_list" }, + { 0x0E6B, "randomize_name_list" }, + { 0x0E6C, "get_name" }, + { 0x0E6D, "get_name_for_nationality" }, +// { 0x0E6E, "" }, +// { 0x0E6F, "" }, + { 0x0E70, "nationalityusessurnames" }, + { 0x0E71, "monitor_challenges" }, + { 0x0E72, "challenge_targetval" }, + { 0x0E73, "challenge_rewardval" }, + { 0x0E74, "getchallengestatus" }, + { 0x0E75, "challengedata" }, + { 0x0E76, "ch_getprogress" }, + { 0x0E77, "ch_getstate" }, + { 0x0E78, "ch_setprogress" }, + { 0x0E79, "ch_setstate" }, + { 0x0E7A, "ch_gettarget" }, +// { 0x0E7B, "" }, +// { 0x0E7C, "" }, + { 0x0E7D, "buildchallengeinfo" }, + { 0x0E7E, "challengesplashnotify" }, + { 0x0E7F, "optionalnumber" }, + { 0x0E80, "sound" }, +// { 0x0E81, "" }, + { 0x0E82, "actionnotify" }, + { 0x0E83, "updatechallenges" }, +// { 0x0E84, "" }, + { 0x0E85, "giverankxpafterwait" }, +// { 0x0E86, "" }, + { 0x0E87, "processchallenge" }, + { 0x0E88, "initnotifymessage" }, +// { 0x0E89, "" }, +// { 0x0E8A, "" }, + { 0x0E8B, "notifytext" }, + { 0x0E8C, "notifytext2" }, + { 0x0E8D, "notifyicon" }, + { 0x0E8E, "doingnotify" }, +// { 0x0E8F, "" }, + { 0x0E90, "doingsplash" }, + { 0x0E91, "splashqueue" }, + { 0x0E92, "maxrank" }, + { 0x0E93, "ranktable" }, + { 0x0E94, "xp_init" }, + { 0x0E95, "xp_player_init" }, +// { 0x0E96, "" }, + { 0x0E97, "rankupdatetotal" }, + { 0x0E98, "hud_rankscroreupdate" }, + { 0x0E99, "xp_bar_client_elem" }, +// { 0x0E9A, "" }, + { 0x0E9B, "xpbar_update" }, + { 0x0E9C, "hud_xpbar" }, + { 0x0E9D, "get_xpbarwidth" }, + { 0x0E9E, "xp_setup" }, +// { 0x0E9F, "" }, + { 0x0EA0, "xpscale" }, + { 0x0EA1, "givexp_think" }, + { 0x0EA2, "givexp_helper" }, + { 0x0EA3, "givexp_kill_func" }, + { 0x0EA4, "is_survival" }, + { 0x0EA5, "attacker_list" }, +// { 0x0EA6, "" }, + { 0x0EA7, "is_special_targetname_attacker" }, + { 0x0EA8, "ai_xp_init" }, + { 0x0EA9, "last_attacked" }, + { 0x0EAA, "add_damage_function" }, + { 0x0EAB, "xp_took_damage" }, + { 0x0EAC, "updateplayerscore" }, + { 0x0EAD, "xp_enable" }, + { 0x0EAE, "print_score_increment" }, + { 0x0EAF, "fontpulseinit" }, +// { 0x0EB0, "" }, +// { 0x0EB1, "" }, + { 0x0EB2, "inframes" }, + { 0x0EB3, "outframes" }, + { 0x0EB4, "fontpulse" }, +// { 0x0EB5, "" }, + { 0x0EB6, "setpromotion" }, + { 0x0EB7, "updaterankannouncehud" }, + { 0x0EB8, "titletext" }, +// { 0x0EB9, "" }, + { 0x0EBA, "duration" }, + { 0x0EBB, "textlabel" }, + { 0x0EBC, "textisstring" }, + { 0x0EBD, "eog_summary_delay" }, +// { 0x0EBE, "" }, +// { 0x0EBF, "" }, + { 0x0EC0, "actionnotifymessage" }, + { 0x0EC1, "removetypefromqueue" }, + { 0x0EC2, "shownotifymessage" }, + { 0x0EC3, "titlelabel" }, + { 0x0EC4, "titleisstring" }, + { 0x0EC5, "text2label" }, +// { 0x0EC6, "" }, +// { 0x0EC7, "" }, + { 0x0EC8, "canreadtext" }, + { 0x0EC9, "isflashbanged" }, + { 0x0ECA, "dispatchnotify" }, + { 0x0ECB, "registerscoreinfo" }, + { 0x0ECC, "getscoreinfovalue" }, + { 0x0ECD, "getrankinfominxp" }, +// { 0x0ECE, "" }, + { 0x0ECF, "getrankinfomaxxp" }, + { 0x0ED0, "getrankinfofull" }, + { 0x0ED1, "getrankinfoicon" }, + { 0x0ED2, "getrankforxp" }, + { 0x0ED3, "getrankxp" }, + { 0x0ED4, "so" }, + { 0x0ED5, "eventtypes" }, + { 0x0ED6, "skipdistancecheck" }, + { 0x0ED7, "noreloadcalloutweapons" }, + { 0x0ED8, "bcmaxdistsqd" }, + { 0x0ED9, "enable_chatter" }, + { 0x0EDA, "so_player_chatter_enabled" }, + { 0x0EDB, "disable_chatter" }, + { 0x0EDC, "enable_chatter_on_player" }, + { 0x0EDD, "so_isspeaking" }, + { 0x0EDE, "bc_eventtypelastusedtime" }, + { 0x0EDF, "revive_tracking" }, + { 0x0EE0, "claymore_tracking" }, + { 0x0EE1, "sentry_tracking" }, + { 0x0EE2, "kill_generic_tracking" }, + { 0x0EE3, "kill_infantry_tracking" }, + { 0x0EE4, "area_secure_tracking" }, + { 0x0EE5, "affirmative_tracking" }, + { 0x0EE6, "negative_tracking" }, + { 0x0EE7, "on_comms_tracking" }, + { 0x0EE8, "mark_dropzone_tracking" }, + { 0x0EE9, "glowstick_tracking" }, + { 0x0EEA, "reload_tracking" }, + { 0x0EEB, "weapon_no_reload_callout" }, + { 0x0EEC, "grenade_tracking" }, + { 0x0EED, "friendlyfire_tracking" }, + { 0x0EEE, "friendlyfire_is_valid" }, + { 0x0EEF, "friendlyfire_whizby_tracking" }, + { 0x0EF0, "friendlyfire_whizby_is_valid" }, +// { 0x0EF1, "" }, +// { 0x0EF2, "" }, +// { 0x0EF3, "" }, + { 0x0EF4, "bleedout_time" }, + { 0x0EF5, "bleedout_time_default" }, + { 0x0EF6, "laststand_stage2_multiplier" }, + { 0x0EF7, "can_say_current_nag_event_type" }, + { 0x0EF8, "play_so_chatter" }, + { 0x0EF9, "can_say_event_type" }, +// { 0x0EFA, "" }, + { 0x0EFB, "check_overrides" }, + { 0x0EFC, "so_override" }, + { 0x0EFD, "get_player_team_prefix" }, + { 0x0EFE, "so_stealth" }, + { 0x0EFF, "player2" }, + { 0x0F00, "so_campaign" }, +// { 0x0F01, "" }, + { 0x0F02, "get_other_player" }, + { 0x0F03, "is_downed" }, + { 0x0F04, "ent_flag_exist" }, +// { 0x0F05, "" }, +// { 0x0F06, "" }, +// { 0x0F07, "" }, +// { 0x0F08, "" }, + { 0x0F09, "script_color_allies" }, + { 0x0F0A, "script_color_axis" }, + { 0x0F0B, "color_node_type_function" }, +// { 0x0F0C, "" }, + { 0x0F0D, "colorchecklist" }, + { 0x0F0E, "currentcolorforced" }, + { 0x0F0F, "lastcolorforced" }, + { 0x0F10, "arrays_of_colorforced_ai" }, + { 0x0F11, "_color_friendly_spawners" }, + { 0x0F12, "convert_color_to_short_string" }, + { 0x0F13, "script_forcecolor" }, + { 0x0F14, "ai_picks_destination" }, + { 0x0F15, "currentcolorcode" }, + { 0x0F16, "goto_current_colorindex" }, + { 0x0F17, "has_color" }, +// { 0x0F18, "" }, +// { 0x0F19, "" }, + { 0x0F1A, "get_color_list" }, + { 0x0F1B, "array_remove_dupes" }, + { 0x0F1C, "get_colorcodes_from_trigger" }, +// { 0x0F1D, "" }, + { 0x0F1E, "colorcode_is_used_in_map" }, + { 0x0F1F, "trigger_issues_orders" }, + { 0x0F20, "activated_color_trigger" }, +// { 0x0F21, "" }, + { 0x0F22, "trigger_delete_target_chain" }, + { 0x0F23, "array_delete" }, + { 0x0F24, "activate_color_trigger" }, + { 0x0F25, "get_colorcodes_and_activate_trigger" }, + { 0x0F26, "activate_color_trigger_internal" }, + { 0x0F27, "activate_color_code_internal" }, + { 0x0F28, "arrays_of_colorcoded_spawners" }, + { 0x0F29, "array_removedead" }, + { 0x0F2A, "arrays_of_colorcoded_ai" }, + { 0x0F2B, "same_color_code_as_last_time" }, + { 0x0F2C, "process_cover_node_with_last_in_mind_allies" }, + { 0x0F2D, "cover_nodes_last" }, + { 0x0F2E, "cover_nodes_first" }, + { 0x0F2F, "process_cover_node_with_last_in_mind_axis" }, + { 0x0F30, "process_cover_node" }, +// { 0x0F31, "" }, + { 0x0F32, "path_nodes" }, + { 0x0F33, "prioritize_colorcoded_nodes" }, + { 0x0F34, "script_colorlast" }, +// { 0x0F35, "" }, + { 0x0F36, "get_colorcoded_volume" }, +// { 0x0F37, "" }, + { 0x0F38, "send_ai_to_colorvolume" }, + { 0x0F39, "issue_color_order_to_ai" }, + { 0x0F3A, "take_color_node" }, + { 0x0F3B, "player_color_node" }, + { 0x0F3C, "color_node_finds_a_user" }, + { 0x0F3D, "color_node_finds_user_from_colorcodes" }, + { 0x0F3E, "color_node_finds_user_for_colorcode" }, +// { 0x0F3F, "" }, + { 0x0F40, "occupies_colorcode" }, + { 0x0F41, "ai_sets_goal_with_delay" }, + { 0x0F42, "ai_sets_goal" }, + { 0x0F43, "script_careful" }, + { 0x0F44, "set_goal_and_volume" }, + { 0x0F45, "colornode_func" }, + { 0x0F46, "_colors_go_line" }, + { 0x0F47, "colornode_setgoal_func" }, +// { 0x0F48, "" }, + { 0x0F49, "is_using_forcegoal_radius" }, + { 0x0F4A, "script_forcegoal" }, + { 0x0F4B, "forcegoal_radius" }, + { 0x0F4C, "careful_logic" }, + { 0x0F4D, "recover_from_careful_disable" }, +// { 0x0F4E, "" }, + { 0x0F4F, "isknownenemyinradius_tmp" }, + { 0x0F50, "wait_until_an_enemy_is_in_safe_area" }, + { 0x0F51, "my_current_node_delays" }, +// { 0x0F52, "" }, + { 0x0F53, "color_ordered_node_assignment" }, + { 0x0F54, "color_node" }, + { 0x0F55, "get_best_available_colored_node" }, + { 0x0F56, "get_best_available_new_colored_node" }, + { 0x0F57, "process_stop_short_of_node" }, + { 0x0F58, "wait_for_killanimscript_or_time" }, + { 0x0F59, "reached_node_but_could_not_claim_it" }, + { 0x0F5A, "decrementcolorusers" }, + { 0x0F5B, "colorislegit" }, + { 0x0F5C, "add_volume_to_global_arrays" }, + { 0x0F5D, "add_node_to_global_arrays" }, +// { 0x0F5E, "" }, +// { 0x0F5F, "" }, + { 0x0F60, "removespawnerfromcolornumberarray" }, + { 0x0F61, "add_cover_node" }, + { 0x0F62, "add_path_node" }, +// { 0x0F63, "" }, +// { 0x0F64, "" }, + { 0x0F65, "colornode_replace_on_death" }, + { 0x0F66, "replace_on_death" }, + { 0x0F67, "current_color_order" }, + { 0x0F68, "color_doesnt_care_about_heroes" }, + { 0x0F69, "remove_heroes_from_array" }, + { 0x0F6A, "color_doesnt_care_about_classname" }, + { 0x0F6B, "remove_without_classname" }, + { 0x0F6C, "set_force_color" }, + { 0x0F6D, "friendly_promotion_thread" }, + { 0x0F6E, "get_color_from_order" }, + { 0x0F6F, "friendly_spawner_vision_checker" }, + { 0x0F70, "friendly_respawn_vision_checker_thread" }, + { 0x0F71, "respawn_spawner_org" }, + { 0x0F72, "get_color_spawner" }, + { 0x0F73, "respawn_friendlies_without_vision_check" }, + { 0x0F74, "respawn_friendlies_force_vision_check" }, + { 0x0F75, "wait_until_vision_check_satisfied_or_disabled" }, + { 0x0F76, "spawn_hidden_reinforcement" }, +// { 0x0F77, "" }, + { 0x0F78, "lock_spawner_for_awhile" }, + { 0x0F79, "friendly_respawn_lock_func" }, + { 0x0F7A, "player_sees_spawner" }, + { 0x0F7B, "kill_color_replacements" }, + { 0x0F7C, "remove_replace_on_death" }, + { 0x0F7D, "get_team" }, + { 0x0F7E, "linetime_proc" }, + { 0x0F7F, "structarray_swap" }, + { 0x0F80, "struct_array_index" }, + { 0x0F81, "waitspread_code" }, + { 0x0F82, "wait_spreaders" }, + { 0x0F83, "wait_spreader_allotment" }, + { 0x0F84, "active_wait_spread" }, + { 0x0F85, "waitspread_insert" }, + { 0x0F86, "waittill_objective_event_proc" }, + { 0x0F87, "script_deathchain" }, + { 0x0F88, "deathspawner" }, +// { 0x0F89, "" }, +// { 0x0F8A, "" }, + { 0x0F8B, "wait_for_trigger_think" }, + { 0x0F8C, "wait_for_trigger" }, + { 0x0F8D, "ent_waits_for_level_notify" }, + { 0x0F8E, "ent_waits_for_notify" }, + { 0x0F8F, "ent_waits_for_trigger" }, + { 0x0F90, "ent_times_out" }, + { 0x0F91, "update_debug_friendlycolor_on_death" }, +// { 0x0F92, "" }, + { 0x0F93, "update_debug_friendlycolor" }, + { 0x0F94, "insure_player_does_not_set_forcecolor_twice_in_one_frame" }, + { 0x0F95, "new_color_being_set" }, + { 0x0F96, "new_force_color_being_set" }, + { 0x0F97, "dontcolormove" }, +// { 0x0F98, "" }, + { 0x0F99, "_radio_queue" }, + { 0x0F9A, "last_mission_sound_time" }, +// { 0x0F9B, "" }, + { 0x0F9C, "waittill_either_function_internal" }, + { 0x0F9D, "hintprintwait" }, + { 0x0F9E, "hint_timeout" }, + { 0x0F9F, "timed_out" }, + { 0x0FA0, "hintprint" }, + { 0x0FA1, "hint_fontscale" }, + { 0x0FA2, "current_global_hint" }, +// { 0x0FA3, "" }, +// { 0x0FA4, "" }, + { 0x0FA5, "current_hint" }, + { 0x0FA6, "ent_flag_clear" }, +// { 0x0FA7, "" }, + { 0x0FA8, "showhintprint_struct" }, + { 0x0FA9, "lerp_player_view_to_tag_internal" }, + { 0x0FAA, "lerp_player_view_to_position" }, + { 0x0FAB, "lerp_player_view_to_tag_oldstyle_internal" }, +// { 0x0FAC, "" }, + { 0x0FAD, "function_stack_wait" }, + { 0x0FAE, "function_stack_wait_finish" }, + { 0x0FAF, "function_stack_proc" }, + { 0x0FB0, "function_stack_func_begun" }, + { 0x0FB1, "function_stack_self_death" }, +// { 0x0FB2, "" }, + { 0x0FB3, "unflash_flag" }, + { 0x0FB4, "wait_for_sounddone_or_death" }, + { 0x0FB5, "init_vision_set" }, + { 0x0FB6, "lvl_visionset" }, + { 0x0FB7, "vision_cheat_enabled" }, + { 0x0FB8, "array_waitlogic1" }, +// { 0x0FB9, "" }, + { 0x0FBA, "array_waitlogic2" }, +// { 0x0FBB, "" }, + { 0x0FBC, "parms" }, +// { 0x0FBD, "" }, + { 0x0FBE, "exec_call_noself" }, + { 0x0FBF, "exec_func" }, + { 0x0FC0, "ender" }, + { 0x0FC1, "waittill_func_ends" }, + { 0x0FC2, "waittill_abort_func_ends" }, + { 0x0FC3, "abort_count" }, + { 0x0FC4, "do_abort" }, +// { 0x0FC5, "" }, + { 0x0FC6, "yaw" }, + { 0x0FC7, "pitch" }, + { 0x0FC8, "roll" }, + { 0x0FC9, "dynamic_run_speed_proc" }, + { 0x0FCA, "ent_flag_init" }, +// { 0x0FCB, "" }, +// { 0x0FCC, "" }, + { 0x0FCD, "last_set_goalent" }, + { 0x0FCE, "drs_ahead_test" }, + { 0x0FCF, "last_set_goalnode" }, +// { 0x0FD0, "" }, +// { 0x0FD1, "" }, + { 0x0FD2, "set_generic_run_anim_array" }, + { 0x0FD3, "set_generic_run_anim" }, + { 0x0FD4, "clear_run_anim" }, +// { 0x0FD5, "" }, +// { 0x0FD6, "" }, +// { 0x0FD7, "" }, + { 0x0FD8, "get_target_nodes" }, + { 0x0FD9, "get_target_ents" }, + { 0x0FDA, "go_to_node_wait_for_player" }, + { 0x0FDB, "dynamic_run_set" }, + { 0x0FDC, "anim_stopanimscripted" }, + { 0x0FDD, "dynamic_run_speed_stopped" }, + { 0x0FDE, "loops" }, + { 0x0FDF, "handsignal" }, + { 0x0FE0, "dynamic_run_speed_dialogue" }, +// { 0x0FE1, "" }, + { 0x0FE2, "g_speed_get_func" }, + { 0x0FE3, "g_speed_set_func" }, + { 0x0FE4, "movespeed_get_func" }, + { 0x0FE5, "movespeedscale" }, + { 0x0FE6, "movespeed_set_func" }, + { 0x0FE7, "autosave_tactical_setup" }, + { 0x0FE8, "autosave_tactical_player_nades" }, + { 0x0FE9, "autosave_tactical_grenade_check" }, + { 0x0FEA, "autosave_tactical_grenade_check_dieout" }, + { 0x0FEB, "autosave_tactical_proc" }, +// { 0x0FEC, "" }, + { 0x0FED, "autosave_by_name" }, + { 0x0FEE, "music_play_internal_stop_with_fade_then_call" }, + { 0x0FEF, "music_stop" }, + { 0x0FF0, "music_play" }, + { 0x0FF1, "music_loop_internal_stop_with_fade_then_call" }, + { 0x0FF2, "music_loop_internal" }, + { 0x0FF3, "musicplaywrapper" }, + { 0x0FF4, "musiclength" }, + { 0x0FF5, "music_loop" }, + { 0x0FF6, "music_loop_stealth_pause" }, + { 0x0FF7, "doslide" }, + { 0x0FF8, "kill_deathflag_proc" }, + { 0x0FF9, "update_rumble_intensity" }, + { 0x0FFA, "intensity" }, + { 0x0FFB, "start_glow" }, + { 0x0FFC, "glow_model" }, + { 0x0FFD, "blend_default_dof" }, + { 0x0FFE, "dofdefault" }, + { 0x0FFF, "process_blend" }, + { 0x1000, "start" }, +// { 0x1001, "" }, + { 0x1002, "base" }, + { 0x1003, "time" }, +// { 0x1004, "" }, + { 0x1005, "trace_fx" }, + { 0x1006, "fx" }, + { 0x1007, "surface" }, + { 0x1008, "fx_array" }, + { 0x1009, "rumble" }, +// { 0x100A, "" }, + { 0x100B, "toy_model" }, + { 0x100C, "interactives" }, + { 0x100D, "put_toy_in_volume" }, + { 0x100E, "precache_destructible" }, + { 0x100F, "get_color_info_from_trigger" }, + { 0x1010, "delaythread_proc" }, + { 0x1011, "add_wait_asserter" }, +// { 0x1012, "" }, + { 0x1013, "comparesizesfx" }, + { 0x1014, "waittill_triggered_current" }, + { 0x1015, "currentnode" }, + { 0x1016, "add_trigger_func_thread" }, +// { 0x1017, "" }, + { 0x1018, "objective_recon" }, + { 0x1019, "is_default_start" }, + { 0x101A, "recon_objective_lasttime" }, + { 0x101B, "mission_recon" }, + { 0x101C, "get_leveltime" }, + { 0x101D, "rvb_init" }, + { 0x101E, "_audio" }, + { 0x101F, "reverb" }, + { 0x1020, "use_string_table_presets" }, + { 0x1021, "use_iw_presets" }, + { 0x1022, "current_reverb" }, + { 0x1023, "rvb_use_string_table" }, + { 0x1024, "rvb_use_iw_presets" }, + { 0x1025, "rvb_set_dry_level" }, + { 0x1026, "drylevel" }, + { 0x1027, "rvb_set_wet_level" }, + { 0x1028, "wetlevel" }, + { 0x1029, "rvb_apply_reverb" }, + { 0x102A, "applied_reverb" }, + { 0x102B, "fadetime" }, + { 0x102C, "roomtype" }, + { 0x102D, "rvb_start_preset" }, + { 0x102E, "aud_print_warning" }, + { 0x102F, "deathsdoor" }, + { 0x1030, "rvbx_store_current_reverb_track" }, +// { 0x1031, "" }, + { 0x1032, "ambient_reverb" }, + { 0x1033, "rvb_deactive_reverb" }, + { 0x1034, "rvb_get_applied_reverb" }, + { 0x1035, "rvbx_get_preset_from_string_table" }, + { 0x1036, "get_reverb_stringtable" }, + { 0x1037, "rvbx_get_reverb_preset_from_stringtable_internal" }, + { 0x1038, "rvbx_apply_inital_reverb" }, +// { 0x1039, "" }, +// { 0x103A, "" }, + { 0x103B, "preset_cache" }, +// { 0x103C, "" }, + { 0x103D, "audio_presets_reverb" }, + { 0x103E, "rvbx_create" }, + { 0x103F, "sm_init" }, + { 0x1040, "stream" }, + { 0x1041, "music" }, +// { 0x1042, "" }, + { 0x1043, "prev" }, +// { 0x1044, "" }, +// { 0x1045, "" }, + { 0x1046, "fade" }, + { 0x1047, "vol" }, +// { 0x1048, "" }, + { 0x1049, "sm_stop_ambient_alias" }, + { 0x104A, "sm_stop_music_alias" }, + { 0x104B, "sm_stop_ambience" }, + { 0x104C, "sm_stop_music" }, + { 0x104D, "sm_mix_ambience" }, + { 0x104E, "alias" }, + { 0x104F, "sm_get_current_ambience_name" }, + { 0x1050, "sm_get_current_music_name" }, + { 0x1051, "smx_set_values_for_struct" }, + { 0x1052, "smx_create_struct" }, + { 0x1053, "smx_clear_struct" }, + { 0x1054, "damb_init" }, + { 0x1055, "damb" }, + { 0x1056, "loop_handle_index" }, + { 0x1057, "single_loop_handle_index" }, + { 0x1058, "oneshot_handle_index" }, + { 0x1059, "serial_playback_lock" }, + { 0x105A, "playing" }, + { 0x105B, "component_weights" }, + { 0x105C, "callbacks" }, +// { 0x105D, "" }, +// { 0x105E, "" }, + { 0x105F, "entity_ref_count" }, +// { 0x1060, "" }, + { 0x1061, "max_entities" }, +// { 0x1062, "" }, + { 0x1063, "damb_use_string_table" }, + { 0x1064, "damb_use_iw_presets" }, + { 0x1065, "damb_zone_start_preset" }, + { 0x1066, "damb_start_preset" }, +// { 0x1067, "" }, + { 0x1068, "damb_stop_preset_at_point" }, + { 0x1069, "damb_make_linked_damb" }, +// { 0x106A, "" }, + { 0x106B, "max_delay" }, +// { 0x106C, "" }, + { 0x106D, "damb_start_preset_on_entity" }, + { 0x106E, "damb_stop" }, + { 0x106F, "damb_stop_zone" }, + { 0x1070, "damb_zone_stop_preset" }, + { 0x1071, "damb_stop_preset" }, + { 0x1072, "damb_prob_mix_damb_presets" }, + { 0x1073, "damb_set_oneshot_callback_for_component" }, + { 0x1074, "callback" }, +// { 0x1075, "" }, + { 0x1076, "audio_presets_dynamic_ambience" }, + { 0x1077, "damb_pause_damb" }, + { 0x1078, "damb_unpause_damb" }, + { 0x1079, "damb_manual_trigger" }, + { 0x107A, "damb_link_to_damb" }, + { 0x107B, "dambx_start_preset" }, + { 0x107C, "dambx_start_linked_dambs" }, +// { 0x107D, "" }, + { 0x107E, "dambx_update_serially" }, +// { 0x107F, "" }, +// { 0x1080, "" }, + { 0x1081, "ent" }, + { 0x1082, "success" }, + { 0x1083, "dambx_play_component_loops" }, + { 0x1084, "dambx_get_component_data" }, + { 0x1085, "single_loops" }, +// { 0x1086, "" }, + { 0x1087, "max_radius" }, +// { 0x1088, "" }, + { 0x1089, "max_time" }, + { 0x108A, "first_event" }, + { 0x108B, "first_event_min" }, + { 0x108C, "first_event_max" }, + { 0x108D, "min_pitch" }, + { 0x108E, "max_pitch" }, + { 0x108F, "min_trav_time" }, + { 0x1090, "max_trav_time" }, +// { 0x1091, "" }, + { 0x1092, "max_delta" }, + { 0x1093, "min_delta_angle" }, + { 0x1094, "max_delta_angle" }, + { 0x1095, "min_pitch_time" }, +// { 0x1096, "" }, + { 0x1097, "min_start_angle" }, + { 0x1098, "max_start_angle" }, + { 0x1099, "mode" }, +// { 0x109A, "" }, +// { 0x109B, "" }, +// { 0x109C, "" }, + { 0x109D, "start_position" }, +// { 0x109E, "" }, + { 0x109F, "end_position" }, + { 0x10A0, "start_pitch" }, + { 0x10A1, "end_pitch" }, + { 0x10A2, "pitch_time" }, + { 0x10A3, "dambx_trigger_linked_damb" }, + { 0x10A4, "dambx_make_first_wait" }, + { 0x10A5, "dambx_update" }, +// { 0x10A6, "" }, +// { 0x10A7, "" }, + { 0x10A8, "dambx_perform_oneshot_event" }, + { 0x10A9, "aud_check_sound_done" }, + { 0x10AA, "sounddone" }, + { 0x10AB, "dambx_perform_loop_event" }, + { 0x10AC, "aud_fade_loop_out_and_delete" }, +// { 0x10AD, "" }, +// { 0x10AE, "" }, + { 0x10AF, "dambx_get_loop_preset" }, + { 0x10B0, "audio_presets_dynamic_ambience_loop_definitions" }, + { 0x10B1, "dambx_get_component_preset" }, + { 0x10B2, "audio_presets_dynamic_ambience_components" }, + { 0x10B3, "dambx_play" }, +// { 0x10B4, "" }, + { 0x10B5, "dambx_fade_out_playing_loop" }, + { 0x10B6, "dambx_get_list_value_from_string_table" }, + { 0x10B7, "dambx_get_loop_def_from_string_table" }, + { 0x10B8, "get_damb_loops_stringtable" }, +// { 0x10B9, "" }, + { 0x10BA, "dambx_get_two_value_float_array" }, + { 0x10BB, "dambx_get_component_from_string_table_internal" }, + { 0x10BC, "dambx_get_component_from_string_table" }, + { 0x10BD, "get_damb_component_stringtable" }, + { 0x10BE, "dambx_get_preset_from_stringtable_internal" }, + { 0x10BF, "dambx_get_preset_from_string_table" }, + { 0x10C0, "get_damb_stringtable" }, + { 0x10C1, "dambx_get_damb_preset" }, +// { 0x10C2, "" }, +// { 0x10C3, "" }, + { 0x10C4, "mm_init" }, + { 0x10C5, "mix" }, +// { 0x10C6, "" }, + { 0x10C7, "debug_mix_mode" }, +// { 0x10C8, "" }, +// { 0x10C9, "" }, + { 0x10CA, "sticky_submixes" }, + { 0x10CB, "volmod_submixes" }, + { 0x10CC, "volmod_submixblends" }, + { 0x10CD, "changed_presets" }, + { 0x10CE, "headroom" }, + { 0x10CF, "blend_value" }, + { 0x10D0, "blend_name" }, + { 0x10D1, "mm_precache_preset" }, + { 0x10D2, "mm_set_headroom_mix" }, + { 0x10D3, "headroom_preset" }, +// { 0x10D4, "" }, + { 0x10D5, "mm_disable_debug_mode" }, + { 0x10D6, "mm_use_string_table" }, + { 0x10D7, "mm_start_preset" }, + { 0x10D8, "mm_start_zone_preset" }, + { 0x10D9, "current_volume" }, +// { 0x10DA, "" }, +// { 0x10DB, "" }, + { 0x10DC, "mm_clear_submixes" }, + { 0x10DD, "mm_make_submix_sticky" }, + { 0x10DE, "mm_make_submix_unsticky" }, + { 0x10DF, "mm_add_submix" }, + { 0x10E0, "mm_add_submix_blend_to" }, + { 0x10E1, "mm_add_submix_blend" }, + { 0x10E2, "mm_set_submix_blend_value" }, +// { 0x10E3, "" }, +// { 0x10E4, "" }, + { 0x10E5, "clear" }, + { 0x10E6, "mm_scale_submix" }, +// { 0x10E7, "" }, + { 0x10E8, "mm_clear_submix" }, + { 0x10E9, "mm_get_applied_preset_name" }, + { 0x10EA, "mm_add_dynamic_volmod_submix" }, + { 0x10EB, "aud_is_even" }, + { 0x10EC, "mm_add_dynamic_submix" }, + { 0x10ED, "mm_does_volmod_submix_exist" }, + { 0x10EE, "mm_mute_volmods" }, + { 0x10EF, "mm_clear_volmod_mute_mix" }, + { 0x10F0, "mm_solo_volmods" }, + { 0x10F1, "volmod_vals" }, + { 0x10F2, "mm_clear_solo_volmods" }, + { 0x10F3, "mm_get_channel_names" }, + { 0x10F4, "channel_names" }, + { 0x10F5, "mm_get_num_volmod_submixes" }, + { 0x10F6, "mm_get_num_submixes" }, +// { 0x10F7, "" }, + { 0x10F8, "mm_get_volmod_submix_by_name" }, + { 0x10F9, "mm_set_default_volmod" }, + { 0x10FA, "aud_print_error" }, + { 0x10FB, "mm_get_original_default_volmod" }, + { 0x10FC, "mm_restore_original_default_volmod" }, + { 0x10FD, "mmx_set_mix" }, +// { 0x10FE, "" }, +// { 0x10FF, "" }, + { 0x1100, "mmx_create_submix_blend" }, + { 0x1101, "presetb" }, + { 0x1102, "preseta" }, + { 0x1103, "mmx_clear_submixes" }, + { 0x1104, "mmx_update_mix" }, + { 0x1105, "last_fade_time" }, +// { 0x1106, "" }, + { 0x1107, "mmx_mix_in_non_changed_submixes" }, + { 0x1108, "volume_products" }, +// { 0x1109, "" }, + { 0x110A, "volume" }, + { 0x110B, "fade_time" }, + { 0x110C, "mmx_set_volume_products_volmods" }, + { 0x110D, "mmx_apply_initial_mix" }, + { 0x110E, "mmx_apply_debug_mix" }, + { 0x110F, "mmx_volmod_setting_enqueue" }, + { 0x1110, "volmod_queue" }, + { 0x1111, "volmod_index" }, + { 0x1112, "mmx_mix_setting_enqueue" }, +// { 0x1113, "" }, + { 0x1114, "mmx_volmod_server_throttler" }, + { 0x1115, "mmx_mix_server_throttler" }, + { 0x1116, "mmx_get_preset_from_string_table" }, + { 0x1117, "get_mix_stringtable" }, + { 0x1118, "mmx_get_mix_preset_from_stringtable_internal" }, +// { 0x1119, "" }, +// { 0x111A, "" }, + { 0x111B, "aud_is_common_indexed" }, + { 0x111C, "aud_is_local_indexed" }, + { 0x111D, "volmodfile" }, +// { 0x111E, "" }, + { 0x111F, "audio_presets_mix" }, + { 0x1120, "mmx_init_volmods" }, + { 0x1121, "mmx_init_channel_names" }, + { 0x1122, "mmx_get_channel_volumes" }, + { 0x1123, "channel_volumes" }, + { 0x1124, "volmod_mix_with_all_channels_at" }, + { 0x1125, "mmx_parse_volumemodgroups_csv" }, + { 0x1126, "mmx_is_mix_channel" }, + { 0x1127, "mmx_is_volmod_channel" }, + { 0x1128, "azm_init" }, + { 0x1129, "zone_mgr" }, + { 0x112A, "current_zone" }, +// { 0x112B, "" }, + { 0x112C, "overrides" }, + { 0x112D, "samb" }, + { 0x112E, "rev" }, +// { 0x112F, "" }, + { 0x1130, "use_level_audio_zones" }, + { 0x1131, "level_audio_zones_function" }, + { 0x1132, "azm_use_string_table" }, + { 0x1133, "azm_use_iw_presets" }, +// { 0x1134, "" }, +// { 0x1135, "" }, + { 0x1136, "aud_set_occlusion" }, +// { 0x1137, "" }, +// { 0x1138, "" }, + { 0x1139, "azm_set_zone_streamed_ambience" }, + { 0x113A, "azm_set_zone_dynamic_ambience" }, +// { 0x113B, "" }, +// { 0x113C, "" }, + { 0x113D, "azm_set_zone_mix" }, +// { 0x113E, "" }, +// { 0x113F, "" }, + { 0x1140, "azm_get_current_zone" }, + { 0x1141, "azm_set_current_zone" }, + { 0x1142, "azm_print_enter_blend" }, + { 0x1143, "azm_print_exit_blend" }, +// { 0x1144, "" }, + { 0x1145, "azmx_load_zone" }, + { 0x1146, "azmx_get_preset_from_string_table" }, + { 0x1147, "get_zone_stringtable" }, + { 0x1148, "azmx_get_zone_preset_from_stringtable_internal" }, + { 0x1149, "azmx_restart_stream" }, +// { 0x114A, "" }, + { 0x114B, "azmx_restart_reverb" }, + { 0x114C, "azmx_restart_occlusion" }, +// { 0x114D, "" }, +// { 0x114E, "" }, + { 0x114F, "azmx_wait_till_fade_done_and_remove_zone" }, +// { 0x1150, "" }, +// { 0x1151, "" }, +// { 0x1152, "" }, + { 0x1153, "samb1_name" }, + { 0x1154, "samb2_name" }, + { 0x1155, "damb1_name" }, + { 0x1156, "damb2_name" }, + { 0x1157, "occlusion1" }, +// { 0x1158, "" }, + { 0x1159, "filter1" }, + { 0x115A, "filter2" }, + { 0x115B, "reverb1" }, + { 0x115C, "reverb2" }, + { 0x115D, "mix1_name" }, +// { 0x115E, "" }, + { 0x115F, "mix1" }, + { 0x1160, "mix2" }, +// { 0x1161, "" }, +// { 0x1162, "" }, + { 0x1163, "azmx_blend_zones" }, +// { 0x1164, "" }, +// { 0x1165, "" }, + { 0x1166, "audio_presets_music_moods" }, + { 0x1167, "audio_presets_music_cue_groups" }, + { 0x1168, "audio_presets_music_cues" }, + { 0x1169, "mus_init" }, + { 0x116A, "cue_cash" }, + { 0x116B, "curr_cue_name" }, + { 0x116C, "prev_cue_name" }, +// { 0x116D, "" }, +// { 0x116E, "" }, + { 0x116F, "mus_play" }, +// { 0x1170, "" }, + { 0x1171, "mus_is_playing" }, + { 0x1172, "mus_get_playing_cue_preset" }, + { 0x1173, "musx_construct_cue" }, + { 0x1174, "musx_start_cue" }, + { 0x1175, "musx_stop_all_music" }, +// { 0x1176, "" }, + { 0x1177, "musx_get_cashed_cue" }, + { 0x1178, "musx_cash_cue" }, + { 0x1179, "musx_monitor_game_vars" }, +// { 0x117A, "" }, +// { 0x117B, "" }, + { 0x117C, "whiz_init" }, + { 0x117D, "whiz" }, + { 0x117E, "whiz_use_string_table" }, + { 0x117F, "whiz_set_preset" }, + { 0x1180, "audio_presets_whizby" }, + { 0x1181, "whiz_set_probabilities" }, + { 0x1182, "whiz_set_spreads" }, + { 0x1183, "whiz_set_radii" }, + { 0x1184, "whiz_set_offset" }, + { 0x1185, "whizx_get_stringtable_preset" }, + { 0x1186, "whizx_get_mix_preset_from_stringtable_internal" }, + { 0x1187, "audio_presets_vehicles" }, + { 0x1188, "audio_presets_vehicle_maps" }, + { 0x1189, "vm_init" }, +// { 0x118A, "" }, + { 0x118B, "minrate" }, + { 0x118C, "defrate" }, + { 0x118D, "defsmooth" }, + { 0x118E, "minpitch" }, + { 0x118F, "maxpitch" }, + { 0x1190, "fadein_time" }, + { 0x1191, "print_speed" }, +// { 0x1192, "" }, + { 0x1193, "print_yaw" }, + { 0x1194, "print_roll" }, + { 0x1195, "print_altitude" }, +// { 0x1196, "" }, + { 0x1197, "presets" }, + { 0x1198, "maps" }, + { 0x1199, "instances" }, + { 0x119A, "ducked_instances" }, +// { 0x119B, "" }, + { 0x119C, "duck_stops" }, + { 0x119D, "vm_register_custom_callback" }, + { 0x119E, "vm_start_preset" }, + { 0x119F, "aud_play_linked_sound" }, + { 0x11A0, "instance_name" }, + { 0x11A1, "min" }, + { 0x11A2, "max" }, + { 0x11A3, "smoothness" }, + { 0x11A4, "smooth_up" }, + { 0x11A5, "smooth_down" }, +// { 0x11A6, "" }, + { 0x11A7, "alias_data" }, +// { 0x11A8, "" }, + { 0x11A9, "heightmax" }, + { 0x11AA, "custom_callback" }, + { 0x11AB, "multiply_by_throttle" }, + { 0x11AC, "multiply_by_leftstick" }, + { 0x11AD, "start_alias_data" }, + { 0x11AE, "pitch_map_name" }, + { 0x11AF, "volume_map_name" }, + { 0x11B0, "stop_alias_data" }, + { 0x11B1, "throttle_input" }, + { 0x11B2, "on_threshold" }, + { 0x11B3, "off_threshold" }, + { 0x11B4, "duck_amount" }, + { 0x11B5, "duck_time" }, + { 0x11B6, "offset" }, + { 0x11B7, "alias_name" }, + { 0x11B8, "vol_map_name" }, + { 0x11B9, "vm_stop" }, + { 0x11BA, "playing_presets" }, + { 0x11BB, "aud_fade_out_and_delete" }, + { 0x11BC, "vm_stop_preset_instance" }, + { 0x11BD, "vm_set_range" }, + { 0x11BE, "aud_overrides" }, + { 0x11BF, "min_range" }, + { 0x11C0, "max_range" }, + { 0x11C1, "vmx_monitor_oneshot_ent" }, + { 0x11C2, "sound_playing" }, +// { 0x11C3, "" }, + { 0x11C4, "vmx_stop_sound" }, +// { 0x11C5, "" }, + { 0x11C6, "vmx_init_oneshot_ents" }, + { 0x11C7, "start_ents" }, + { 0x11C8, "stop_ents" }, + { 0x11C9, "start_ent_count" }, +// { 0x11CA, "" }, +// { 0x11CB, "" }, +// { 0x11CC, "" }, + { 0x11CD, "vmx_get_stop_sound_playing" }, + { 0x11CE, "vmx_scale_start_sound_pitch" }, + { 0x11CF, "vmx_scale_stop_sound_pitch" }, + { 0x11D0, "vmx_scale_start_sound_volume" }, + { 0x11D1, "vmx_scale_stop_sound_volume" }, +// { 0x11D2, "" }, + { 0x11D3, "ref" }, + { 0x11D4, "vmx_play_stop_sound" }, + { 0x11D5, "vmx_monitor_start_ent" }, + { 0x11D6, "vmx_monitor_stop_ent" }, + { 0x11D7, "vmx_stop_stop_ent" }, + { 0x11D8, "vmx_stop_start_ent" }, + { 0x11D9, "vmx_do_start_stop_callback" }, + { 0x11DA, "vm_disablethrottleupdate" }, +// { 0x11DB, "" }, + { 0x11DC, "aud_engine_throttle_amount" }, + { 0x11DD, "vm_enablethrottleupdate" }, + { 0x11DE, "vmx_callback" }, + { 0x11DF, "init_height" }, +// { 0x11E0, "" }, +// { 0x11E1, "" }, +// { 0x11E2, "" }, +// { 0x11E3, "" }, +// { 0x11E4, "" }, +// { 0x11E5, "" }, +// { 0x11E6, "" }, + { 0x11E7, "vmx_get_yaw" }, + { 0x11E8, "vmx_get_roll" }, + { 0x11E9, "vmx_get_altitude" }, + { 0x11EA, "vmx_get_throttle" }, + { 0x11EB, "vm_ground_vehicle_start" }, +// { 0x11EC, "" }, + { 0x11ED, "move_lo_lp" }, + { 0x11EE, "rolling_lp" }, +// { 0x11EF, "" }, + { 0x11F0, "engine_rev_lo_os" }, + { 0x11F1, "breaks_os" }, + { 0x11F2, "vmx_vehicle_engine" }, + { 0x11F3, "do_rev" }, + { 0x11F4, "ents_mixed_in" }, +// { 0x11F5, "" }, + { 0x11F6, "has_move_played" }, + { 0x11F7, "has_roll_played" }, + { 0x11F8, "veh_mix_ents" }, + { 0x11F9, "idle_ent" }, + { 0x11FA, "move_ent" }, + { 0x11FB, "roll_ent" }, + { 0x11FC, "one_shot" }, + { 0x11FD, "vmx_ground_speed_watch" }, + { 0x11FE, "vmx_aud_ent_fade_out" }, + { 0x11FF, "vmx_aud_ent_fade_in" }, + { 0x1200, "vmx_cleanup_ents" }, + { 0x1201, "vmx_ground_vehicle_monitor_death" }, + { 0x1202, "vmx_monitor_explosion" }, +// { 0x1203, "" }, + { 0x1204, "vm_aud_air_vehicle_flyby" }, + { 0x1205, "vmx_waittill_deathspin" }, +// { 0x1206, "" }, +// { 0x1207, "" }, +// { 0x1208, "" }, + { 0x1209, "kill_flicker_when_damaged" }, + { 0x120A, "generic_pulsing" }, + { 0x120B, "generic_double_strobe" }, +// { 0x120C, "" }, + { 0x120D, "generic_flickering" }, + { 0x120E, "linked_models" }, +// { 0x120F, "" }, + { 0x1210, "unlit_models" }, + { 0x1211, "linked_lights" }, + { 0x1212, "linked_light_ents" }, + { 0x1213, "linked_prefab_ents" }, + { 0x1214, "linked_things" }, + { 0x1215, "unlit_model" }, + { 0x1216, "effect" }, + { 0x1217, "script_parameters" }, + { 0x1218, "generic_flicker_msg_watcher" }, + { 0x1219, "script_light_startnotify" }, + { 0x121A, "script_light_stopnotify" }, +// { 0x121B, "" }, +// { 0x121C, "" }, + { 0x121D, "restarteffect" }, + { 0x121E, "generic_flicker" }, +// { 0x121F, "" }, + { 0x1220, "generic_spot" }, + { 0x1221, "flickerlightintensity" }, + { 0x1222, "burning_trash_fire" }, + { 0x1223, "strobelight" }, + { 0x1224, "changelightcolorto" }, + { 0x1225, "changelightcolortoworkerthread" }, + { 0x1226, "television" }, + { 0x1227, "tv_changes_intensity" }, + { 0x1228, "tv_changes_color" }, + { 0x1229, "sun_shadow_trigger" }, + { 0x122A, "script_duration" }, + { 0x122B, "set_sun_shadow_params" }, +// { 0x122C, "" }, + { 0x122D, "script_sunshadowscale" }, +// { 0x122E, "" }, + { 0x122F, "script_sunsamplesizenear" }, + { 0x1230, "script_qualityspotshadow" }, + { 0x1231, "lerp_sunsamplesizenear_overtime" }, +// { 0x1232, "" }, + { 0x1233, "tank_fire_at_enemies" }, +// { 0x1234, "" }, + { 0x1235, "get_tank_target_by_script_noteworthy" }, +// { 0x1236, "" }, + { 0x1237, "spawn_ai" }, + { 0x1238, "setupplayerforanimations" }, +// { 0x1239, "" }, + { 0x123A, "forceplayerweapon_start" }, + { 0x123B, "old_force_weapon" }, + { 0x123C, "force_weapon" }, + { 0x123D, "forceplayerweapon_end" }, +// { 0x123E, "" }, + { 0x123F, "sniper_mag_hud" }, + { 0x1240, "sniper_zoom_hint_hud" }, +// { 0x1241, "" }, + { 0x1242, "sniper_dvar" }, + { 0x1243, "variable_scope_weapons" }, + { 0x1244, "isads" }, + { 0x1245, "variable_scope_shadow_center" }, + { 0x1246, "turnonvariablescopehud" }, + { 0x1247, "turnoffvariablescopehud" }, +// { 0x1248, "" }, +// { 0x1249, "" }, + { 0x124A, "convert_fov_string" }, + { 0x124B, "worldtolocalcoords" }, +// { 0x124C, "" }, + { 0x124D, "createdebugtexthud" }, + { 0x124E, "debug_text_hud" }, + { 0x124F, "printdebugtexthud" }, + { 0x1250, "printdebugtextstringhud" }, +// { 0x1251, "" }, +// { 0x1252, "" }, + { 0x1253, "dialogue_reminder" }, + { 0x1254, "dialogue_queue" }, + { 0x1255, "conversation_start" }, + { 0x1256, "conversation_stop" }, + { 0x1257, "array_find" }, + { 0x1258, "array_combine_unique" }, +// { 0x1259, "" }, + { 0x125A, "script_flag" }, + { 0x125B, "script_specialops" }, + { 0x125C, "so_mark_class" }, + { 0x125D, "laser_targeting_device" }, +// { 0x125E, "" }, + { 0x125F, "laserforceon" }, + { 0x1260, "laserallowed" }, + { 0x1261, "lasercooldownafterhit" }, + { 0x1262, "shouldforcedisablelaser" }, + { 0x1263, "laser_designator_disable_list" }, + { 0x1264, "cleanuplasertargetingdevice" }, + { 0x1265, "monitorlaseroff" }, + { 0x1266, "laser_designate_target" }, + { 0x1267, "laser_targets" }, + { 0x1268, "gettargettriggerhit" }, + { 0x1269, "laser_triggers" }, +// { 0x126A, "" }, + { 0x126B, "laser_artillery" }, + { 0x126C, "flavorbursts_off" }, + { 0x126D, "script_index" }, + { 0x126E, "script_group" }, + { 0x126F, "get_geo_group" }, +// { 0x1270, "" }, +// { 0x1271, "" }, +// { 0x1272, "" }, + { 0x1273, "progress_bar_hud_failure" }, + { 0x1274, "set_hud_red" }, +// { 0x1275, "" }, + { 0x1276, "set_hud_green" }, + { 0x1277, "hud_blink" }, +// { 0x1278, "" }, + { 0x1279, "vision_change_multiple_internal" }, + { 0x127A, "forward_for_vision_change" }, + { 0x127B, "change_character_model" }, + { 0x127C, "update_weapon_tag_visibility" }, +// { 0x127D, "" }, +// { 0x127E, "" }, +// { 0x127F, "" }, +// { 0x1280, "" }, + { 0x1281, "bonus_2_shader" }, + { 0x1282, "challenge_1" }, + { 0x1283, "challenge_2" }, + { 0x1284, "custom_eog_no_defaults" }, + { 0x1285, "eog_summary_callback" }, + { 0x1286, "get_challenge_values" }, + { 0x1287, "require_defined_bonuses" }, + { 0x1288, "bonus_1" }, + { 0x1289, "bonus_2" }, + { 0x128A, "custom_eog_summary" }, + { 0x128B, "challenge_time_limit" }, + { 0x128C, "session_score" }, + { 0x128D, "final_summary" }, +// { 0x128E, "" }, +// { 0x128F, "" }, + { 0x1290, "add_custom_eog_summary_line_blank" }, +// { 0x1291, "" }, +// { 0x1292, "" }, + { 0x1293, "so_mission_worst_time" }, + { 0x1294, "timed_mission" }, + { 0x1295, "get_final_summary" }, + { 0x1296, "challenge_end_time" }, + { 0x1297, "challenge_start_time" }, + { 0x1298, "convert_to_time_string" }, + { 0x1299, "specops_reward_gameskill" }, + { 0x129A, "so_get_difficulty_menu_string" }, + { 0x129B, "get_tally_string" }, + { 0x129C, "get_time_message" }, + { 0x129D, "handle_bonus_xp" }, + { 0x129E, "give_xp_on_success" }, +// { 0x129F, "" }, + { 0x12A0, "ch_1" }, +// { 0x12A1, "" }, +// { 0x12A2, "" }, +// { 0x12A3, "" }, + { 0x12A4, "get_bonus_number" }, + { 0x12A5, "calculate_bonus" }, + { 0x12A6, "give_bonus" }, +// { 0x12A7, "" }, +// { 0x12A8, "" }, + { 0x12A9, "bonus1_icon_text" }, + { 0x12AA, "bonus2_icon_text" }, +// { 0x12AB, "" }, + { 0x12AC, "flash_text" }, + { 0x12AD, "move_bonus" }, + { 0x12AE, "make_bar_get_basic_placement" }, + { 0x12AF, "make_text_get_basic_placement" }, + { 0x12B0, "get_basic_placement" }, + { 0x12B1, "multiple_dialogue_queue" }, + { 0x12B2, "bcs_scripted_dialogue_start" }, +// { 0x12B3, "" }, + { 0x12B4, "anim_end_early_deathnotify" }, + { 0x12B5, "anim_end_early_facialendnotify" }, + { 0x12B6, "anim_end_early_dialogueendnotify" }, + { 0x12B7, "anim_end_early_animationendnotify" }, +// { 0x12B8, "" }, +// { 0x12B9, "" }, + { 0x12BA, "warn_facial_dialogue_unspoken" }, + { 0x12BB, "warn_facial_dialogue_too_many" }, + { 0x12BC, "aud_init" }, + { 0x12BD, "aud" }, + { 0x12BE, "using_string_tables" }, +// { 0x12BF, "" }, + { 0x12C0, "local" }, + { 0x12C1, "common" }, +// { 0x12C2, "" }, + { 0x12C3, "progress_trigger_callbacks" }, + { 0x12C4, "progress_maps" }, +// { 0x12C5, "" }, +// { 0x12C6, "" }, + { 0x12C7, "current_filter_indices" }, + { 0x12C8, "vo_duck_active" }, +// { 0x12C9, "" }, + { 0x12CA, "player_state" }, + { 0x12CB, "locamote" }, + { 0x12CC, "locamote_prev" }, +// { 0x12CD, "" }, +// { 0x12CE, "" }, + { 0x12CF, "eq_mix_track" }, + { 0x12D0, "eq_track" }, + { 0x12D1, "audio_presets_occlusion" }, + { 0x12D2, "audio_presets_zones" }, + { 0x12D3, "aud_prime_stream" }, +// { 0x12D4, "" }, + { 0x12D5, "aud_is_stream_primed" }, + { 0x12D6, "aud_error_if_not_primed" }, +// { 0x12D7, "" }, + { 0x12D8, "aud_wait_till_primed" }, + { 0x12D9, "aud_prime_and_play_internal" }, + { 0x12DA, "aud_prime_and_play" }, + { 0x12DB, "aud_add_progress_map" }, + { 0x12DC, "aud_get_progress_map" }, + { 0x12DD, "is_deathsdoor_audio_enabled" }, + { 0x12DE, "deathsdoor_enabled" }, + { 0x12DF, "aud_enable_deathsdoor_audio" }, + { 0x12E0, "disable_breathing_sound" }, + { 0x12E1, "aud_disable_deathsdoor_audio" }, +// { 0x12E2, "" }, + { 0x12E3, "in_deathsdoor" }, + { 0x12E4, "occlusion" }, + { 0x12E5, "filter" }, + { 0x12E6, "set_deathsdoor" }, +// { 0x12E7, "" }, + { 0x12E8, "aud_set_mission_failed_music" }, +// { 0x12E9, "" }, + { 0x12EA, "aud_wait_for_mission_fail_music" }, + { 0x12EB, "aud_set_filter_internal" }, + { 0x12EC, "channel" }, +// { 0x12ED, "" }, +// { 0x12EE, "" }, + { 0x12EF, "gain" }, + { 0x12F0, "q" }, +// { 0x12F1, "" }, + { 0x12F2, "aud_set_filter_threaded" }, + { 0x12F3, "aud_clear_filter" }, +// { 0x12F4, "" }, + { 0x12F5, "filter_zone_disabled" }, +// { 0x12F6, "" }, + { 0x12F7, "aud_disable_filter_setting" }, +// { 0x12F8, "" }, +// { 0x12F9, "" }, + { 0x12FA, "scalefactor" }, +// { 0x12FB, "" }, + { 0x12FC, "aud_set_timescale_threaded" }, + { 0x12FD, "aud_set_timescale" }, + { 0x12FE, "aud_set_occlusion_internal" }, + { 0x12FF, "occlusion_presets" }, + { 0x1300, "aud_set_occlusion_threaded" }, +// { 0x1301, "" }, +// { 0x1302, "" }, + { 0x1303, "aud_use_level_zones" }, + { 0x1304, "aud_use_level_reverb" }, + { 0x1305, "aud_use_level_filters" }, + { 0x1306, "level_audio_filter_function" }, +// { 0x1307, "" }, + { 0x1308, "set_stringtable_mapname" }, + { 0x1309, "get_stringtable_mapname" }, +// { 0x130A, "" }, + { 0x130B, "set_damb_stringtable" }, + { 0x130C, "set_damb_component_stringtable" }, + { 0x130D, "set_damb_loops_stringtable" }, +// { 0x130E, "" }, +// { 0x130F, "" }, + { 0x1310, "get_filter_stringtable" }, +// { 0x1311, "" }, + { 0x1312, "set_occlusion_stringtable" }, + { 0x1313, "get_occlusion_stringtable" }, +// { 0x1314, "" }, + { 0x1315, "aud_dispatch_msg" }, + { 0x1316, "aud_get_player_locamote_state" }, + { 0x1317, "aud_get_sticky_threat" }, + { 0x1318, "aud_set_sticky_threat" }, + { 0x1319, "aud_clear_sticky_threat" }, + { 0x131A, "aud_num_alive_enemies" }, + { 0x131B, "_audio_msg_handler" }, + { 0x131C, "pos" }, + { 0x131D, "spread_width" }, + { 0x131E, "rear_dist" }, + { 0x131F, "right_alias" }, +// { 0x1320, "" }, + { 0x1321, "explosion_pos" }, + { 0x1322, "aud_handle_flickering_light" }, + { 0x1323, "aud_play_conversation" }, + { 0x1324, "delay" }, + { 0x1325, "trigger_multiple_audio_register_callback" }, + { 0x1326, "trigger_function_keys" }, + { 0x1327, "get_target_ent_target" }, + { 0x1328, "get_target_ent_origin" }, + { 0x1329, "get_target_ent_target_ent" }, + { 0x132A, "get_target_ent_target_ent_origin" }, +// { 0x132B, "" }, + { 0x132C, "get_zone_to" }, + { 0x132D, "trigger_multiple_audio_trigger" }, + { 0x132E, "script_audio_zones" }, + { 0x132F, "audio_zones" }, + { 0x1330, "script_audio_progress_map" }, + { 0x1331, "script_audio_enter_func" }, + { 0x1332, "script_audio_exit_func" }, + { 0x1333, "script_audio_progress_func" }, + { 0x1334, "script_audio_point_func" }, + { 0x1335, "script_audio_blend_mode" }, + { 0x1336, "script_audio_enter_msg" }, + { 0x1337, "script_audio_progress_msg" }, +// { 0x1338, "" }, + { 0x1339, "script_audio_exit_msg" }, + { 0x133A, "trigger_multiple_audio_progress" }, + { 0x133B, "trigger_multiple_audio_progress_point" }, + { 0x133C, "trigger_multiple_audio_blend" }, + { 0x133D, "aud_play_dynamic_explosion" }, + { 0x133E, "aud_do_dynamic_explosion_math" }, + { 0x133F, "aud_get_optional_param" }, + { 0x1340, "aud_scale_vector_2d" }, +// { 0x1341, "" }, +// { 0x1342, "" }, +// { 0x1343, "" }, + { 0x1344, "aud_vector_magnitude_2d" }, + { 0x1345, "aud_print_synch" }, + { 0x1346, "aud_print" }, + { 0x1347, "aud_print_debug" }, + { 0x1348, "aud_print_zone_small" }, + { 0x1349, "equal_strings" }, + { 0x134A, "isundefined" }, + { 0x134B, "delete_on_sounddone" }, + { 0x134C, "delete_sound_entity" }, + { 0x134D, "aud_min" }, + { 0x134E, "aud_max" }, + { 0x134F, "aud_clamp" }, + { 0x1350, "aud_fade_sound_in" }, +// { 0x1351, "" }, + { 0x1352, "aud_map_range" }, + { 0x1353, "aud_smooth" }, +// { 0x1354, "" }, + { 0x1355, "all_mix_channels" }, + { 0x1356, "aud_setalltimescalefactors" }, + { 0x1357, "aud_settimescalefactors" }, + { 0x1358, "audx_settimescalefactors" }, + { 0x1359, "aud_set_breach_time_scale_factors" }, + { 0x135A, "play_2d_sound_internal" }, + { 0x135B, "aud_delay_play_2d_sound_internal" }, + { 0x135C, "aud_play_2d_sound" }, +// { 0x135D, "" }, + { 0x135E, "audx_play_linked_sound_internal" }, + { 0x135F, "audx_monitor_linked_entity_health" }, +// { 0x1360, "" }, + { 0x1361, "aud_play_sound_at_internal" }, + { 0x1362, "aud_play_sound_at" }, +// { 0x1363, "" }, + { 0x1364, "aud_play_primed_point_source_loop" }, + { 0x1365, "aud_play_point_source_loop" }, + { 0x1366, "aud_stop_point_source_loop" }, + { 0x1367, "aud_set_point_source_loop_volume" }, + { 0x1368, "aud_play_loops_on_destructables_array" }, + { 0x1369, "loop_sound_stopped" }, + { 0x136A, "aud_set_music_submix" }, + { 0x136B, "aud_set_ambi_submix" }, + { 0x136C, "aud_fade_in_music" }, + { 0x136D, "aud_in_zone" }, + { 0x136E, "aud_find_exploder" }, + { 0x136F, "aud_duck" }, + { 0x1370, "audx_duck" }, +// { 0x1371, "" }, +// { 0x1372, "" }, +// { 0x1373, "" }, +// { 0x1374, "" }, + { 0x1375, "index_common_presets" }, + { 0x1376, "get_mix_index" }, +// { 0x1377, "" }, + { 0x1378, "aud_percent_chance" }, + { 0x1379, "aud_start_slow_mo_gunshot_callback" }, + { 0x137A, "aud_impact_monitor" }, + { 0x137B, "aud_stop_slow_mo_gunshot_callback" }, +// { 0x137C, "" }, +// { 0x137D, "" }, + { 0x137E, "points" }, + { 0x137F, "edge_spread" }, + { 0x1380, "update_rate" }, +// { 0x1381, "" }, + { 0x1382, "max_dist" }, + { 0x1383, "vol_scale" }, +// { 0x1384, "" }, + { 0x1385, "aud_start_distributed_sound" }, + { 0x1386, "audx_distributed_sound_update_loop" }, + { 0x1387, "aud_slomo_wait" }, + { 0x1388, "aud_slomo_wait_internal" }, + { 0x1389, "aud_set_level_fade_time" }, + { 0x138A, "level_fade_time" }, + { 0x138B, "aud_level_fadein" }, + { 0x138C, "aud_is_specops" }, + { 0x138D, "specops" }, + { 0x138E, "audx_set_spec_ops_internal" }, + { 0x138F, "aud_set_spec_ops" }, + { 0x1390, "audx_play_line_emitter_internal" }, + { 0x1391, "point2" }, +// { 0x1392, "" }, + { 0x1393, "is_playing" }, + { 0x1394, "fade_in" }, + { 0x1395, "aud_stop_line_emitter" }, + { 0x1396, "aud_play_line_emitter" }, + { 0x1397, "aud_print_3d_on_ent" }, + { 0x1398, "specialops_init" }, + { 0x1399, "setglobaldifficulty" }, +// { 0x139A, "" }, + { 0x139B, "no_friendly_fire_penalty" }, + { 0x139C, "so_hud_show_time" }, + { 0x139D, "challenge_time_nudge" }, + { 0x139E, "challenge_time_hurry" }, + { 0x139F, "so_compass_zoom" }, + { 0x13A0, "disable_saving" }, +// { 0x13A1, "" }, + { 0x13A2, "specialops_dialog_init" }, + { 0x13A3, "solo_player_in_special_ops" }, + { 0x13A4, "set_custom_gameskill_func" }, + { 0x13A5, "coop_player_in_special_ops_survival" }, + { 0x13A6, "enable_escape_warning_auto" }, + { 0x13A7, "enable_escape_failure_auto" }, + { 0x13A8, "so_deadquotes_chance" }, + { 0x13A9, "so_special_failure_hint" }, + { 0x13AA, "pick_starting_location_so" }, + { 0x13AB, "register_level_unlock" }, + { 0x13AC, "register_survival_unlock" }, + { 0x13AD, "enable_damagefeedback" }, + { 0x13AE, "setup_xp" }, + { 0x13AF, "roundstat_init" }, +// { 0x13B0, "" }, + { 0x13B1, "so_precache_strings" }, + { 0x13B2, "so_standard_wait" }, +// { 0x13B3, "" }, + { 0x13B4, "specialops_remove_entity_check" }, + { 0x13B5, "so_special_failure_hint_reset_dvars" }, + { 0x13B6, "enable_triggered_start" }, + { 0x13B7, "enable_triggered_complete" }, + { 0x13B8, "disable_mission_end_trigger" }, + { 0x13B9, "wait_all_players_are_touching" }, + { 0x13BA, "wait_all_players_have_touched" }, + { 0x13BB, "fade_challenge_in" }, + { 0x13BC, "so_waiting_for_players_alpha" }, + { 0x13BD, "fade_challenge_out" }, +// { 0x13BE, "" }, + { 0x13BF, "congrat_min_wave" }, + { 0x13C0, "so_eog_summary_calculate" }, + { 0x13C1, "specialops_mission_over_setup" }, + { 0x13C2, "so_eog_summary_display" }, + { 0x13C3, "override_summary_time" }, + { 0x13C4, "round_millisec_on_sec" }, +// { 0x13C5, "" }, + { 0x13C6, "override_summary_score" }, + { 0x13C7, "enable_countdown_timer" }, +// { 0x13C8, "" }, + { 0x13C9, "show_countdown_timer_time" }, + { 0x13CA, "enable_challenge_timer" }, + { 0x13CB, "start_flag" }, + { 0x13CC, "passed_flag" }, + { 0x13CD, "challenge_time_beep_start" }, + { 0x13CE, "so_challenge_time_beep" }, + { 0x13CF, "challenge_timer_player_setup" }, + { 0x13D0, "enable_challenge_counter" }, + { 0x13D1, "hud_so_counter_messages" }, + { 0x13D2, "hud_so_counter_values" }, + { 0x13D3, "enable_challenge_counter_think" }, + { 0x13D4, "disable_challenge_counter" }, + { 0x13D5, "disable_challenge_counter_all" }, +// { 0x13D6, "" }, + { 0x13D7, "enable_kill_counter" }, +// { 0x13D8, "" }, + { 0x13D9, "enable_kill_counter_think" }, +// { 0x13DA, "" }, + { 0x13DB, "disable_challenge_timer" }, +// { 0x13DC, "" }, +// { 0x13DD, "" }, + { 0x13DE, "so_waiting_for_players" }, + { 0x13DF, "so_wait_for_player_ready" }, + { 0x13E0, "waiting_to_start_hud" }, + { 0x13E1, "ready_indication_hud" }, + { 0x13E2, "so_wait_for_player_ready_cleanup" }, + { 0x13E3, "attacker_is_p1" }, + { 0x13E4, "attacker_is_p2" }, +// { 0x13E5, "" }, + { 0x13E6, "escape_warning_triggers" }, + { 0x13E7, "disable_escape_warning" }, +// { 0x13E8, "" }, + { 0x13E9, "escape_hint_active" }, + { 0x13EA, "ping_escape_warning" }, + { 0x13EB, "display_hint_timeout" }, + { 0x13EC, "ping_escape_splash" }, + { 0x13ED, "enable_escape_failure" }, +// { 0x13EE, "" }, + { 0x13EF, "so_delete_all_by_type" }, +// { 0x13F0, "" }, + { 0x13F1, "type_vehicle" }, + { 0x13F2, "type_spawn_trigger" }, + { 0x13F3, "type_trigger" }, + { 0x13F4, "type_flag_trigger" }, + { 0x13F5, "type_killspawner_trigger" }, +// { 0x13F6, "" }, + { 0x13F7, "type_goalvolume" }, + { 0x13F8, "script_goalvolume" }, + { 0x13F9, "type_infovolume" }, +// { 0x13FA, "" }, + { 0x13FB, "type_weapon_placed" }, +// { 0x13FC, "" }, + { 0x13FD, "so_delete_all_triggers" }, + { 0x13FE, "so_delete_all_vehicles" }, +// { 0x13FF, "" }, + { 0x1400, "so_make_specialops_ent" }, + { 0x1401, "so_make_bcslocations_specialops_ent" }, + { 0x1402, "so_array_make_specialops" }, + { 0x1403, "so_traversed_list" }, +// { 0x1404, "" }, + { 0x1405, "linkto" }, + { 0x1406, "so_delete_breach_ents" }, +// { 0x1407, "" }, +// { 0x1408, "" }, + { 0x1409, "so_force_deadquote_array" }, + { 0x140A, "so_include_deadquote_array" }, + { 0x140B, "array_merge" }, + { 0x140C, "so_hud_can_show" }, + { 0x140D, "so_create_hud_item_delay_draw" }, + { 0x140E, "so_create_hud_item_data" }, + { 0x140F, "so_create_hud_item_debug" }, +// { 0x1410, "" }, +// { 0x1411, "" }, +// { 0x1412, "" }, +// { 0x1413, "" }, + { 0x1414, "so_hud_pulse_loop" }, + { 0x1415, "pulse_time" }, + { 0x1416, "pulse_scale_normal" }, + { 0x1417, "pulse_scale_big" }, +// { 0x1418, "" }, +// { 0x1419, "" }, +// { 0x141A, "" }, +// { 0x141B, "" }, +// { 0x141C, "" }, + { 0x141D, "so_hud_pulse_warning" }, + { 0x141E, "so_hud_pulse_alarm" }, + { 0x141F, "so_hud_pulse_failure" }, + { 0x1420, "so_hud_pulse_disabled" }, +// { 0x1421, "" }, + { 0x1422, "pulse_bounds" }, +// { 0x1423, "" }, + { 0x1424, "so_remove_hud_item" }, + { 0x1425, "set_hud_white" }, + { 0x1426, "set_hud_blue" }, + { 0x1427, "set_hud_yellow" }, + { 0x1428, "set_hud_grey" }, + { 0x1429, "info_hud_wait_for_player" }, + { 0x142A, "so_infohud_toggle_state" }, + { 0x142B, "info_hud_wait_force_on" }, + { 0x142C, "info_hud_start_state" }, +// { 0x142D, "" }, + { 0x142E, "info_hud_handle_fade" }, +// { 0x142F, "" }, +// { 0x1430, "" }, +// { 0x1431, "" }, + { 0x1432, "so_challenge_time_left" }, + { 0x1433, "hud_so_timer_time" }, + { 0x1434, "challenge_timer_thread" }, + { 0x1435, "is_dvar_character_switcher" }, +// { 0x1436, "" }, + { 0x1437, "is_best_wave" }, + { 0x1438, "is_best_time" }, + { 0x1439, "is_poor_time" }, +// { 0x143A, "" }, +// { 0x143B, "" }, + { 0x143C, "so_dialog_mission_success" }, +// { 0x143D, "" }, + { 0x143E, "failed_dialog_played" }, + { 0x143F, "so_dialog_mission_failed_generic" }, + { 0x1440, "so_dialog_mission_failed_time" }, + { 0x1441, "so_dialog_mission_failed_bleedout" }, +// { 0x1442, "" }, + { 0x1443, "so_dialog_time_low_hurry" }, + { 0x1444, "so_dialog_killing_civilians" }, + { 0x1445, "civilian_warning_time" }, + { 0x1446, "civilian_warning_throttle" }, + { 0x1447, "so_dialog_progress_update" }, + { 0x1448, "so_progress_goal_status" }, + { 0x1449, "so_dialog_progress_update_time_quality" }, + { 0x144A, "so_dialog_counter_update" }, + { 0x144B, "so_counter_dialog_time" }, + { 0x144C, "challenge_progress_manual_update" }, +// { 0x144D, "" }, + { 0x144E, "coop_death_reason" }, + { 0x144F, "kill_wrapper" }, + { 0x1450, "get_previously_completed_difficulty" }, + { 0x1451, "specopssettings" }, +// { 0x1452, "" }, +// { 0x1453, "" }, + { 0x1454, "so_hud_stars_init" }, + { 0x1455, "race_times" }, + { 0x1456, "stars_removed" }, + { 0x1457, "so_hud_stars_single_think" }, + { 0x1458, "so_hud_star_count" }, + { 0x1459, "so_hud_stars_remove" }, + { 0x145A, "so_hud_stars_validate_difficulty" }, + { 0x145B, "so_hud_stars_sound_and_flash" }, + { 0x145C, "so_hud_stars_single_force_alpha_end" }, + { 0x145D, "unlock_hint" }, + { 0x145E, "unlock_hint_think" }, + { 0x145F, "unlock_array" }, + { 0x1460, "icon" }, + { 0x1461, "register_recent_unlock" }, + { 0x1462, "armory_all_items" }, + { 0x1463, "desc" }, + { 0x1464, "pass_recent_item_unlock" }, + { 0x1465, "unlock_hint_reset" }, +// { 0x1466, "" }, +// { 0x1467, "" }, + { 0x1468, "surhud_challenge_label" }, + { 0x1469, "surhud_challenge_progress" }, + { 0x146A, "surhud_challenge_reward" }, +// { 0x146B, "" }, + { 0x146C, "surhud_enable" }, + { 0x146D, "surhud_disable" }, + { 0x146E, "_setplayerdata_single" }, +// { 0x146F, "" }, + { 0x1470, "setdeadquote" }, +// { 0x1471, "" }, + { 0x1472, "setdeadquote_so" }, + { 0x1473, "is_coop_online" }, +// { 0x1474, "" }, + { 0x1475, "so_builddeadquote" }, + { 0x1476, "should_use_custom_deadquotes" }, + { 0x1477, "register_survival_armory_unlock" }, +// { 0x1478, "" }, + { 0x1479, "unlocklvl" }, + { 0x147A, "skip_playersetstreamorigin" }, + { 0x147B, "isdefendmatch" }, + { 0x147C, "pmc_gametype" }, + { 0x147D, "pick_starting_location_pmc" }, + { 0x147E, "get_closest_exclude" }, +// { 0x147F, "" }, + { 0x1480, "place_player2_near_player1" }, + { 0x1481, "translate_local" }, + { 0x1482, "specialops_remove_flag_check" }, + { 0x1483, "specialops_remove_name_check" }, +// { 0x1484, "" }, + { 0x1485, "so_hud_can_toggle" }, + { 0x1486, "hud_so_timer_msg" }, + { 0x1487, "challenge_timer_detect_3quarter" }, + { 0x1488, "challenge_timer_detect_halfway" }, +// { 0x1489, "" }, + { 0x148A, "challenge_timer_wait_start" }, + { 0x148B, "challenge_timer_should_play_alarm" }, + { 0x148C, "challenge_timer_show_nudge" }, + { 0x148D, "challenge_timer_show_hurry" }, + { 0x148E, "challenge_timer_be_silent" }, + { 0x148F, "challenge_time_silent" }, + { 0x1490, "challenge_timer_give_alert" }, + { 0x1491, "challenge_timer_should_pulse" }, +// { 0x1492, "" }, + { 0x1493, "so_deadquote_time" }, +// { 0x1494, "" }, + { 0x1495, "challenge_timer_destroy_prematurely" }, + { 0x1496, "challenge_timer_destroy" }, + { 0x1497, "validate_timer" }, +// { 0x1498, "" }, +// { 0x1499, "" }, + { 0x149A, "setup_leaderboard_data" }, + { 0x149B, "game_performance" }, + { 0x149C, "so_survival_stars_func" }, + { 0x149D, "specialops_blur_player_screen" }, + { 0x149E, "specialops_mission_over_remove_ai" }, +// { 0x149F, "" }, + { 0x14A0, "stop_magic_bullet_shield" }, +// { 0x14A1, "" }, + { 0x14A2, "suppress_challenge_success_print" }, + { 0x14A3, "specialops_mission_over_setup_failure" }, + { 0x14A4, "is_current_level_locked" }, +// { 0x14A5, "" }, +// { 0x14A6, "" }, + { 0x14A7, "specialops_achievement_by_stars" }, +// { 0x14A8, "" }, + { 0x14A9, "get_num_of_levels_with_star" }, +// { 0x14AA, "" }, +// { 0x14AB, "" }, +// { 0x14AC, "" }, + { 0x14AD, "ps3" }, +// { 0x14AE, "" }, + { 0x14AF, "eog_bestscore" }, + { 0x14B0, "eog_bestscore_value" }, +// { 0x14B1, "" }, + { 0x14B2, "determine_waiting_message" }, + { 0x14B3, "display_waiting_message" }, + { 0x14B4, "waiting_hud" }, + { 0x14B5, "display_frozen_message" }, + { 0x14B6, "frozen_and_waiting" }, + { 0x14B7, "create_waiting_message" }, + { 0x14B8, "waiting_message_hide" }, + { 0x14B9, "waiting_message_delete_on_so_end" }, + { 0x14BA, "is_touching_escape_trigger" }, +// { 0x14BB, "" }, +// { 0x14BC, "" }, + { 0x14BD, "enable_escape_warning_auto_init" }, + { 0x14BE, "show_escape_warning_auto" }, + { 0x14BF, "ping_escape_warning_auto" }, +// { 0x14C0, "" }, + { 0x14C1, "so_escape_warning_colorfunc" }, + { 0x14C2, "remove_escape_warning_auto" }, + { 0x14C3, "ping_escape_warning_auto_valid" }, +// { 0x14C4, "" }, + { 0x14C5, "set_hudelem_white" }, +// { 0x14C6, "" }, + { 0x14C7, "set_hudelem_green" }, + { 0x14C8, "set_hudelem_yellow" }, + { 0x14C9, "set_hudelem_red" }, + { 0x14CA, "set_hudelem_grey" }, + { 0x14CB, "pulse_start_big" }, +// { 0x14CC, "" }, + { 0x14CD, "pulse_time_loop" }, +// { 0x14CE, "" }, +// { 0x14CF, "" }, +// { 0x14D0, "" }, + { 0x14D1, "so_special_death_hint_tracker" }, +// { 0x14D2, "" }, + { 0x14D3, "so_friendly_fire_death" }, + { 0x14D4, "so_radiation_death" }, + { 0x14D5, "radiationdeath" }, + { 0x14D6, "so_dog_death" }, +// { 0x14D7, "" }, + { 0x14D8, "so_juggernaut_death" }, + { 0x14D9, "so_destructible_death" }, + { 0x14DA, "so_exploding_barrel_death" }, + { 0x14DB, "lastexplodingbarrel" }, + { 0x14DC, "so_grenade_suicide_death" }, + { 0x14DD, "lastgrenadetime" }, + { 0x14DE, "so_grenade_regular_death" }, +// { 0x14DF, "" }, +// { 0x14E0, "" }, + { 0x14E1, "so_special_failure_hint_set_array" }, + { 0x14E2, "setup_new_eq_settings" }, + { 0x14E3, "ambient_eq" }, + { 0x14E4, "use_eq_settings" }, + { 0x14E5, "deactivate_index" }, + { 0x14E6, "blend_to_eq_track" }, +// { 0x14E7, "" }, + { 0x14E8, "deactivate_reverb" }, + { 0x14E9, "ambientdelay" }, + { 0x14EA, "ambientevent" }, +// { 0x14EB, "" }, + { 0x14EC, "set_ambient" }, +// { 0x14ED, "" }, + { 0x14EE, "get_progess" }, + { 0x14EF, "get_progress" }, + { 0x14F0, "specopsgroups" }, + { 0x14F1, "missionsettings" }, + { 0x14F2, "debug_test_next_mission" }, + { 0x14F3, "setupsogroup" }, + { 0x14F4, "_nextmission" }, +// { 0x14F5, "" }, + { 0x14F6, "nextmission_exit_time" }, +// { 0x14F7, "" }, + { 0x14F8, "nextmission" }, + { 0x14F9, "auto_adust_zone_complete" }, + { 0x14FA, "level_end_save" }, + { 0x14FB, "giveachievement_wrapper" }, + { 0x14FC, "updatesppercent" }, + { 0x14FD, "gettotalpercentcompletesp" }, + { 0x14FE, "getstat_progression" }, + { 0x14FF, "getstat_easy" }, + { 0x1500, "getstat_regular" }, + { 0x1501, "getstat_hardened" }, + { 0x1502, "getstat_veteran" }, + { 0x1503, "getstat_intel" }, + { 0x1504, "getlevelcompleted" }, + { 0x1505, "getsolevelcompleted" }, + { 0x1506, "award_no_stars" }, +// { 0x1507, "" }, +// { 0x1508, "" }, + { 0x1509, "eog_newstar" }, + { 0x150A, "eog_newstar_value" }, + { 0x150B, "eog_unlock" }, + { 0x150C, "eog_unlock_value" }, +// { 0x150D, "" }, + { 0x150E, "setlevelcompleted" }, + { 0x150F, "_sethighestmissionifnotcheating" }, +// { 0x1510, "" }, +// { 0x1511, "" }, + { 0x1512, "getmissiondvarstring" }, + { 0x1513, "getlowestskill" }, + { 0x1514, "createmission" }, +// { 0x1515, "" }, + { 0x1516, "hardenedaward" }, + { 0x1517, "addlevel" }, + { 0x1518, "keepweapons" }, + { 0x1519, "achievement" }, + { 0x151A, "skipssuccess" }, + { 0x151B, "veteran_achievement" }, + { 0x151C, "addspecoplevel" }, + { 0x151D, "group_members" }, + { 0x151E, "addprereq" }, +// { 0x151F, "" }, + { 0x1520, "getkeepweapons" }, + { 0x1521, "getachievement" }, + { 0x1522, "getlevelveteranaward" }, + { 0x1523, "getfadetime" }, + { 0x1524, "haslevelveteranaward" }, + { 0x1525, "hasachievement" }, + { 0x1526, "check_other_haslevelveteranachievement" }, + { 0x1527, "gethardenedaward" }, + { 0x1528, "hasmissionhardenedaward" }, + { 0x1529, "getnextlevelindex" }, +// { 0x152A, "" }, +// { 0x152B, "" }, + { 0x152C, "credits_end" }, +// { 0x152D, "" }, + { 0x152E, "so_survival_score_func" }, + { 0x152F, "so_survival_wave_func" }, + { 0x1530, "eog_line" }, + { 0x1531, "reset_eog_popup_dvars" }, + { 0x1532, "add_eog_default_stats" }, + { 0x1533, "so_eog_default_playerlabel" }, +// { 0x1534, "" }, +// { 0x1535, "" }, + { 0x1536, "so_eog_default_time" }, + { 0x1537, "so_eog_default_score" }, + { 0x1538, "debugchains" }, +// { 0x1539, "" }, + { 0x153A, "debug_stopenemypos" }, + { 0x153B, "debug_enemyposproc" }, + { 0x153C, "debug_enemyposreplay" }, + { 0x153D, "goodshootpos" }, + { 0x153E, "goodenemy" }, + { 0x153F, "drawenttag" }, + { 0x1540, "drawtag" }, + { 0x1541, "draworgforever" }, + { 0x1542, "drawarrowforever" }, + { 0x1543, "draworiginforever" }, + { 0x1544, "drawarrow" }, + { 0x1545, "drawforwardforever" }, + { 0x1546, "drawplayerviewforever" }, + { 0x1547, "drawtagforever" }, + { 0x1548, "drawtagtrails" }, + { 0x1549, "dragtaguntildeath" }, + { 0x154A, "viewtag" }, + { 0x154B, "debug_corner" }, + { 0x154C, "debugspawners" }, + { 0x154D, "activenodes" }, + { 0x154E, "completednodes" }, + { 0x154F, "covertest" }, +// { 0x1550, "" }, +// { 0x1551, "" }, + { 0x1552, "removeactivespawner" }, + { 0x1553, "createline" }, + { 0x1554, "createlineconstantly" }, + { 0x1555, "debugmisstime" }, +// { 0x1556, "" }, +// { 0x1557, "" }, +// { 0x1558, "" }, + { 0x1559, "debugjump" }, + { 0x155A, "debugdvars" }, + { 0x155B, "remove_reflection_objects" }, + { 0x155C, "create_reflection_objects" }, + { 0x155D, "create_reflection_object" }, +// { 0x155E, "" }, + { 0x155F, "debug_reflection_buttons" }, + { 0x1560, "remove_fxlighting_object" }, + { 0x1561, "create_fxlighting_object" }, + { 0x1562, "play_fxlighting_fx" }, + { 0x1563, "debug_fxlighting" }, +// { 0x1564, "" }, +// { 0x1565, "" }, +// { 0x1566, "" }, + { 0x1567, "debug_character_count" }, + { 0x1568, "nuke" }, + { 0x1569, "debug_nuke" }, + { 0x156A, "debug_misstime" }, + { 0x156B, "camera" }, +// { 0x156C, "" }, + { 0x156D, "freeplayer" }, + { 0x156E, "setplayertocamera" }, + { 0x156F, "anglescheck" }, +// { 0x1570, "" }, + { 0x1571, "dollytime" }, + { 0x1572, "dollystart" }, + { 0x1573, "dollyend" }, + { 0x1574, "dollygo" }, + { 0x1575, "deathspawnerpreview" }, + { 0x1576, "deathspawnerents" }, +// { 0x1577, "" }, + { 0x1578, "lastsightposwatch" }, + { 0x1579, "watchminimap" }, + { 0x157A, "updateminimapsetting" }, +// { 0x157B, "" }, + { 0x157C, "minimapheight" }, +// { 0x157D, "" }, + { 0x157E, "minimapplayer" }, + { 0x157F, "getchains" }, +// { 0x1580, "" }, + { 0x1581, "vecscale" }, + { 0x1582, "drawminimapbounds" }, + { 0x1583, "islookingatorigin" }, + { 0x1584, "debug_colornodes" }, +// { 0x1585, "" }, + { 0x1586, "draw_colornodes" }, + { 0x1587, "colornodes_debug_array" }, + { 0x1588, "get_team_substr" }, + { 0x1589, "try_to_draw_line_to_node" }, + { 0x158A, "fogcheck" }, + { 0x158B, "debugthreat" }, + { 0x158C, "last_threat_debug" }, +// { 0x158D, "" }, +// { 0x158E, "" }, + { 0x158F, "debugcolorfriendlies" }, + { 0x1590, "debug_color_huds" }, + { 0x1591, "draw_color_friendlies" }, + { 0x1592, "get_script_palette" }, + { 0x1593, "playernode" }, + { 0x1594, "drawusers" }, + { 0x1595, "debuggoalpos" }, +// { 0x1596, "" }, + { 0x1597, "colordebug" }, + { 0x1598, "draw_colored_nodes" }, +// { 0x1599, "" }, + { 0x159A, "animsound_aliases" }, +// { 0x159B, "" }, + { 0x159C, "init_animsounds_for_animname" }, + { 0x159D, "add_hud_line" }, + { 0x159E, "animsound_hud_extralines" }, + { 0x159F, "debug_animsound" }, + { 0x15A0, "draw_animsounds_in_hud" }, + { 0x15A1, "animsound_tagged" }, + { 0x15A2, "animsound_hud_animname" }, +// { 0x15A3, "" }, +// { 0x15A4, "" }, + { 0x15A5, "animsound_input" }, +// { 0x15A6, "" }, +// { 0x15A7, "" }, +// { 0x15A8, "" }, + { 0x15A9, "animsound_hud_alias" }, + { 0x15AA, "animsound_hud_anime" }, + { 0x15AB, "get_alias_from_stored" }, + { 0x15AC, "is_from_animsound" }, + { 0x15AD, "display_animsound" }, + { 0x15AE, "animsounds_thisframe" }, +// { 0x15AF, "" }, +// { 0x15B0, "" }, +// { 0x15B1, "" }, + { 0x15B2, "debug_animsoundsave" }, + { 0x15B3, "print_aliases_to_file" }, + { 0x15B4, "tostr" }, + { 0x15B5, "linedraw" }, + { 0x15B6, "print3ddraw" }, + { 0x15B7, "complete_me" }, +// { 0x15B8, "" }, +// { 0x15B9, "" }, + { 0x15BA, "chase_cam_last_num" }, + { 0x15BB, "chase_cam_target" }, + { 0x15BC, "chase_cam_ent" }, + { 0x15BD, "chasecam_onent" }, + { 0x15BE, "viewfx" }, +// { 0x15BF, "" }, + { 0x15C0, "print_vehicle_info" }, + { 0x15C1, "vnum" }, + { 0x15C2, "draw_dot_for_ent" }, + { 0x15C3, "draw_dot_for_guy" }, + { 0x15C4, "init_damage_feedback" }, + { 0x15C5, "hud_damagefeedback" }, + { 0x15C6, "monitordamage" }, +// { 0x15C7, "" }, + { 0x15C8, "remove_damage_function" }, + { 0x15C9, "damagefeedback_took_damage" }, + { 0x15CA, "is_damagefeedback_enabled" }, +// { 0x15CB, "" }, + { 0x15CC, "updatedamagefeedback" }, + { 0x15CD, "slowmo" }, + { 0x15CE, "speed_slow" }, + { 0x15CF, "coop_icon_blinktime" }, + { 0x15D0, "coop_icon_blinkcrement" }, + { 0x15D1, "coop_revive_nag_hud_refreshtime" }, + { 0x15D2, "initialize_colors" }, + { 0x15D3, "coop_icon_color_normal" }, + { 0x15D4, "coop_icon_color_downed" }, + { 0x15D5, "coop_icon_color_shoot" }, +// { 0x15D6, "" }, + { 0x15D7, "coop_icon_color_dying" }, +// { 0x15D8, "" }, +// { 0x15D9, "" }, + { 0x15DA, "nofriendlyhudicon" }, +// { 0x15DB, "" }, + { 0x15DC, "material" }, + { 0x15DD, "create_fresh_friendly_icon" }, + { 0x15DE, "friendly_hud_icon_blink_on_fire" }, + { 0x15DF, "friendly_hud_icon_blink_on_damage" }, +// { 0x15E0, "" }, + { 0x15E1, "is_player_down" }, +// { 0x15E2, "" }, +// { 0x15E3, "" }, + { 0x15E4, "player_friendly_hud_destroy" }, +// { 0x15E5, "" }, + { 0x15E6, "friendlyhudicon_showall" }, + { 0x15E7, "friendlyhudicon_disable" }, + { 0x15E8, "friendlyhudicon_enable" }, + { 0x15E9, "friendlyhudicon_normal" }, +// { 0x15EA, "" }, + { 0x15EB, "friendlyhudicon_downed" }, + { 0x15EC, "friendlyhudicon_update" }, + { 0x15ED, "friendlyhudicon_currentmaterial" }, + { 0x15EE, "friendlyhudicon_rotating" }, + { 0x15EF, "monitor_color_blind_toggle" }, + { 0x15F0, "laststand_initialized" }, + { 0x15F1, "type_getup_lives" }, + { 0x15F2, "revive_hud_base_offset" }, + { 0x15F3, "revive_bar_offset" }, +// { 0x15F4, "" }, + { 0x15F5, "laststand_hud_elements" }, + { 0x15F6, "laststand_on_load_finished" }, +// { 0x15F7, "" }, + { 0x15F8, "add_global_spawn_function" }, + { 0x15F9, "player_laststand_proc" }, + { 0x15FA, "laststand_enabled" }, +// { 0x15FB, "" }, + { 0x15FC, "laststand_stage3_multiplier" }, +// { 0x15FD, "" }, + { 0x15FE, "laststand_revive_time" }, + { 0x15FF, "down_player_requests" }, +// { 0x1600, "" }, + { 0x1601, "laststand_downed_player_manager" }, + { 0x1602, "laststand_recent_player_downed_time" }, + { 0x1603, "player_downed_death_buffer_time" }, +// { 0x1604, "" }, +// { 0x1605, "" }, +// { 0x1606, "" }, +// { 0x1607, "" }, +// { 0x1608, "" }, +// { 0x1609, "" }, +// { 0x160A, "" }, +// { 0x160B, "" }, + { 0x160C, "player_laststand_on_revive" }, + { 0x160D, "laststand_savior" }, + { 0x160E, "bars" }, + { 0x160F, "player_laststand_is_reviving" }, + { 0x1610, "player_laststand_revive_self" }, + { 0x1611, "player_laststand_revive_buddy_cleanup" }, + { 0x1612, "laststand_freeze_players" }, + { 0x1613, "is_player_down_and_out" }, +// { 0x1614, "" }, + { 0x1615, "player_laststand_downed_nag_button" }, + { 0x1616, "lastrevivenagbuttonpresstime" }, + { 0x1617, "nag_should_draw_hud" }, + { 0x1618, "nag_hud_on" }, + { 0x1619, "nag_prompt_show" }, +// { 0x161A, "" }, +// { 0x161B, "" }, + { 0x161C, "can_show_nag_prompt" }, + { 0x161D, "hide_nag_prompt" }, + { 0x161E, "laststand_coop_hud_manager" }, + { 0x161F, "revive_text_friend" }, + { 0x1620, "revive_timer_friend" }, + { 0x1621, "revive_text_local" }, + { 0x1622, "revive_timer_local" }, + { 0x1623, "laststand_coop_hud_create" }, + { 0x1624, "player_laststand_hud_hide" }, +// { 0x1625, "" }, + { 0x1626, "laststand_getup_hud_init" }, + { 0x1627, "laststand_getup_fast" }, +// { 0x1628, "" }, +// { 0x1629, "" }, +// { 0x162A, "" }, +// { 0x162B, "" }, +// { 0x162C, "" }, + { 0x162D, "player_laststand_downed_icon" }, + { 0x162E, "player_laststand_countdown_timer" }, + { 0x162F, "get_coop_downed_hud_color" }, + { 0x1630, "blinkstate" }, + { 0x1631, "coop_downed_hud_should_blink" }, + { 0x1632, "laststand_hud_destroy" }, + { 0x1633, "player_laststand_set_down_attributes" }, + { 0x1634, "placingsentry" }, + { 0x1635, "player_laststand_set_original_attributes" }, + { 0x1636, "achieve_downed_kills" }, +// { 0x1637, "" }, +// { 0x1638, "" }, + { 0x1639, "forced_pistol" }, + { 0x163A, "preincap_pistol" }, +// { 0x163B, "" }, +// { 0x163C, "" }, +// { 0x163D, "" }, +// { 0x163E, "" }, + { 0x163F, "dont_crush_player" }, + { 0x1640, "player_laststand_set_down_part1" }, + { 0x1641, "laststand_count" }, +// { 0x1642, "" }, + { 0x1643, "last_damage_time" }, + { 0x1644, "player_laststand_getup_sequence_clean_up" }, +// { 0x1645, "" }, +// { 0x1646, "" }, + { 0x1647, "player_laststand_getup_sequence_ignore" }, + { 0x1648, "player_laststand_getup_sequence_catch_kills" }, +// { 0x1649, "" }, +// { 0x164A, "" }, + { 0x164B, "player_laststand_getup_bar_adjust" }, + { 0x164C, "player_laststand_getup_bar_set_fill" }, + { 0x164D, "player_laststand_set_down_part2" }, + { 0x164E, "player_laststand_force_switch_to_pistol" }, + { 0x164F, "coop_incap_weapon" }, +// { 0x1650, "" }, + { 0x1651, "player_laststand_down_draw_attention" }, + { 0x1652, "ai_laststand_on_death" }, + { 0x1653, "player_dying_effect" }, +// { 0x1654, "" }, + { 0x1655, "player_laststand_effect" }, + { 0x1656, "player_shock_effect" }, + { 0x1657, "laststand_get_type" }, +// { 0x1658, "" }, +// { 0x1659, "" }, + { 0x165A, "laststand_downing_will_fail" }, + { 0x165B, "get_lives_remaining" }, + { 0x165C, "update_lives_remaining" }, + { 0x165D, "player_laststand_kill" }, + { 0x165E, "try_crush_player" }, +// { 0x165F, "" }, + { 0x1660, "laststand_on_mission_end" }, + { 0x1661, "revive_hud_cleanup_bars" }, + { 0x1662, "waittill_disable_nag" }, + { 0x1663, "player_can_restore_weapon" }, +// { 0x1664, "" }, + { 0x1665, "player_get_revive_ent" }, + { 0x1666, "revive_destroy_use_targets" }, +// { 0x1667, "" }, + { 0x1668, "artstartvisionfileexport" }, +// { 0x1669, "" }, + { 0x166A, "artstartfogfileexport" }, + { 0x166B, "artendfogfileexport" }, + { 0x166C, "artcommonfxprintln" }, +// { 0x166D, "" }, +// { 0x166E, "" }, + { 0x166F, "fogexphalfplane" }, + { 0x1670, "fognearplane" }, + { 0x1671, "fogcolor" }, + { 0x1672, "fogmaxopacity" }, + { 0x1673, "sunfogenabled" }, + { 0x1674, "sunfogcolor" }, +// { 0x1675, "" }, +// { 0x1676, "" }, + { 0x1677, "sunfogendfadeangle" }, + { 0x1678, "sunfogscale" }, +// { 0x1679, "" }, + { 0x167A, "updatefogfromscript" }, + { 0x167B, "artfxprintlnfog" }, + { 0x167C, "_clearalltextafterhudelem" }, + { 0x167D, "special_weapon_dof_funcs" }, +// { 0x167E, "" }, + { 0x167F, "vision_set_vision" }, + { 0x1680, "vision_set_transition_ent" }, + { 0x1681, "vision_set" }, + { 0x1682, "vision_set_fog" }, + { 0x1683, "curdof" }, +// { 0x1684, "" }, + { 0x1685, "button_down" }, + { 0x1686, "create_vision_set_vision" }, + { 0x1687, "updatefogentfromscript" }, +// { 0x1688, "" }, +// { 0x1689, "" }, + { 0x168A, "red" }, + { 0x168B, "green" }, + { 0x168C, "blue" }, + { 0x168D, "maxopacity" }, +// { 0x168E, "" }, + { 0x168F, "sungreen" }, + { 0x1690, "sunblue" }, + { 0x1691, "sundir" }, + { 0x1692, "sunbeginfadeangle" }, +// { 0x1693, "" }, + { 0x1694, "normalfogscale" }, + { 0x1695, "set_fog_to_ent_values" }, +// { 0x1696, "" }, + { 0x1697, "selected" }, + { 0x1698, "r_glow" }, + { 0x1699, "r_glowradius0" }, + { 0x169A, "r_glowbloomcutoff" }, + { 0x169B, "r_glowbloomdesaturation" }, + { 0x169C, "r_glowbloomintensity0" }, + { 0x169D, "r_filmenable" }, + { 0x169E, "r_filmcontrast" }, +// { 0x169F, "" }, +// { 0x16A0, "" }, + { 0x16A1, "r_filmdesaturationdark" }, + { 0x16A2, "r_filminvert" }, +// { 0x16A3, "" }, + { 0x16A4, "r_filmmediumtint" }, + { 0x16A5, "r_filmdarktint" }, + { 0x16A6, "r_primarylightusetweaks" }, + { 0x16A7, "r_primarylighttweakdiffusestrength" }, +// { 0x16A8, "" }, + { 0x16A9, "fovslidercheck" }, + { 0x16AA, "fogslidercheck" }, + { 0x16AB, "construct_vision_ents" }, + { 0x16AC, "script_visionset_start" }, + { 0x16AD, "script_visionset_end" }, +// { 0x16AE, "" }, +// { 0x16AF, "" }, +// { 0x16B0, "" }, + { 0x16B1, "transitiontime" }, +// { 0x16B2, "" }, + { 0x16B3, "print_current_vision" }, + { 0x16B4, "print_fog_ents" }, + { 0x16B5, "print_fog_ents_csv" }, + { 0x16B6, "cloudlight" }, + { 0x16B7, "sunlight_bright" }, + { 0x16B8, "sunlight_dark" }, +// { 0x16B9, "" }, +// { 0x16BA, "" }, + { 0x16BB, "brighten" }, +// { 0x16BC, "" }, + { 0x16BD, "scale" }, + { 0x16BE, "adsdof" }, + { 0x16BF, "dof" }, + { 0x16C0, "level_specific_dof" }, +// { 0x16C1, "" }, +// { 0x16C2, "" }, +// { 0x16C3, "" }, + { 0x16C4, "setdoftarget" }, + { 0x16C5, "changedofvalue" }, +// { 0x16C6, "" }, + { 0x16C7, "dofvarupdate" }, + { 0x16C8, "setdefaultdepthoffield" }, + { 0x16C9, "isdofdefault" }, +// { 0x16CA, "" }, +// { 0x16CB, "" }, +// { 0x16CC, "" }, + { 0x16CD, "crosshair_value" }, + { 0x16CE, "controler_hud_add" }, + { 0x16CF, "hud_controler" }, +// { 0x16D0, "" }, + { 0x16D1, "base_button_text" }, + { 0x16D2, "_newhudelem" }, +// { 0x16D3, "" }, + { 0x16D4, "_settext" }, + { 0x16D5, "realtext" }, + { 0x16D6, "setgroup_up" }, + { 0x16D7, "setgroup_down" }, +// { 0x16D8, "" }, + { 0x16D9, "setcurrentgroup" }, + { 0x16DA, "spam_model_current_group" }, + { 0x16DB, "vision_set_fog_changes" }, + { 0x16DC, "init_fog_transition" }, + { 0x16DD, "fog_transition_ent" }, +// { 0x16DE, "" }, + { 0x16DF, "playerinit" }, + { 0x16E0, "drone_paths" }, + { 0x16E1, "node_offset" }, +// { 0x16E2, "" }, + { 0x16E3, "dronestruct" }, + { 0x16E4, "dummyguy_index_max" }, + { 0x16E5, "dummyguy" }, + { 0x16E6, "dronespawner_init" }, +// { 0x16E7, "" }, + { 0x16E8, "dummyguyindex" }, + { 0x16E9, "dummynode" }, +// { 0x16EA, "" }, + { 0x16EB, "place_node_radius" }, + { 0x16EC, "place_node_group" }, +// { 0x16ED, "" }, + { 0x16EE, "placed_nodes" }, + { 0x16EF, "noder_heightoffset" }, + { 0x16F0, "wall_look" }, + { 0x16F1, "node_grid" }, + { 0x16F2, "coliding_node" }, + { 0x16F3, "node_select_locked" }, + { 0x16F4, "node_animation_preview" }, + { 0x16F5, "player_view_trace" }, + { 0x16F6, "noder_player" }, + { 0x16F7, "noder_init" }, + { 0x16F8, "preview_node" }, + { 0x16F9, "selector_model" }, + { 0x16FA, "selected_node" }, + { 0x16FB, "hud_update_placed_model_count" }, + { 0x16FC, "hud_noder" }, + { 0x16FD, "group_hudelems" }, + { 0x16FE, "selection_lock_indicator" }, + { 0x16FF, "node_animation_preview_indicator" }, + { 0x1700, "controler_hud_update_text" }, + { 0x1701, "controler_hud_update_button" }, + { 0x1702, "place_node_current_group" }, + { 0x1703, "grid_size" }, + { 0x1704, "add_node_type" }, + { 0x1705, "wall_snap_direction" }, +// { 0x1706, "" }, +// { 0x1707, "" }, +// { 0x1708, "" }, + { 0x1709, "button_modifier" }, + { 0x170A, "button_modifier_release_func" }, + { 0x170B, "button_monitor" }, + { 0x170C, "button_func_isflow" }, + { 0x170D, "add_button_func" }, + { 0x170E, "add_button_modifier_func" }, + { 0x170F, "deleteme" }, + { 0x1710, "getcurrent_groupstruct" }, + { 0x1711, "get_wall_offset" }, + { 0x1712, "find_corner_snap" }, +// { 0x1713, "" }, +// { 0x1714, "" }, + { 0x1715, "place_node_place_at_feet" }, + { 0x1716, "get_mp_player" }, +// { 0x1717, "" }, +// { 0x1718, "" }, + { 0x1719, "has_dummy_guy" }, + { 0x171A, "is_hidden" }, + { 0x171B, "dump_nodes" }, + { 0x171C, "is_player_looking_at_a_wall" }, +// { 0x171D, "" }, + { 0x171E, "bullettrace_but_not_nodes" }, + { 0x171F, "traces_hitting_node" }, + { 0x1720, "groundpos_loc" }, +// { 0x1721, "" }, + { 0x1722, "snap_number_to_nearest_grid" }, +// { 0x1723, "" }, +// { 0x1724, "" }, +// { 0x1725, "" }, + { 0x1726, "node_is_touching" }, + { 0x1727, "hud_update_gridsize" }, + { 0x1728, "grid_up" }, + { 0x1729, "grid_down" }, + { 0x172A, "grid_toggle" }, + { 0x172B, "select_traced_node" }, + { 0x172C, "select_node" }, + { 0x172D, "place_new_dummy_guy_and_animate_at_node" }, + { 0x172E, "lastnode" }, + { 0x172F, "select_coliding_node" }, +// { 0x1730, "" }, +// { 0x1731, "" }, + { 0x1732, "debug_message" }, +// { 0x1733, "" }, + { 0x1734, "set_button_funcs_main" }, + { 0x1735, "clear_all_button_funcs" }, +// { 0x1736, "" }, +// { 0x1737, "" }, + { 0x1738, "hint_buttons_main" }, + { 0x1739, "select_node_cover_crouch" }, + { 0x173A, "select_node_pathnode" }, +// { 0x173B, "" }, + { 0x173C, "select_node_cover_prone" }, +// { 0x173D, "" }, +// { 0x173E, "" }, + { 0x173F, "select_node_concealment_prone" }, + { 0x1740, "select_node_concealment_stand" }, + { 0x1741, "select_node_cover_left" }, + { 0x1742, "select_node_cover_right" }, + { 0x1743, "set_button_funcs_quick_select" }, +// { 0x1744, "" }, + { 0x1745, "noder_elems" }, +// { 0x1746, "" }, + { 0x1747, "fifo_dummyguy" }, + { 0x1748, "node_has_animations" }, + { 0x1749, "toggle_animation_preview" }, + { 0x174A, "hide_all_dummyguys" }, + { 0x174B, "show_all_dummyguys" }, + { 0x174C, "draw_lines_to_connectible_nodes" }, + { 0x174D, "manage_nearnodes" }, + { 0x174E, "nearnodes_time" }, + { 0x174F, "spam_model_group" }, +// { 0x1750, "" }, + { 0x1751, "painter_clean_me" }, + { 0x1752, "default_undefined" }, + { 0x1753, "bposedstyle" }, +// { 0x1754, "" }, + { 0x1755, "btreeorient" }, + { 0x1756, "bfacade" }, + { 0x1757, "density" }, + { 0x1758, "maxdist" }, +// { 0x1759, "" }, + { 0x175A, "setup_painter_group" }, + { 0x175B, "script_painter_treeorient" }, +// { 0x175C, "" }, + { 0x175D, "script_painter_facade" }, + { 0x175E, "script_paintergroup" }, + { 0x175F, "get_angle_offset" }, +// { 0x1760, "" }, +// { 0x1761, "" }, +// { 0x1762, "" }, +// { 0x1763, "" }, +// { 0x1764, "" }, +// { 0x1765, "" }, + { 0x1766, "spam_models_flowrate" }, +// { 0x1767, "" }, + { 0x1768, "spam_maxdist" }, + { 0x1769, "previewmodels" }, + { 0x176A, "spam_models_iscustomrotation" }, + { 0x176B, "spam_models_iscustomheight" }, + { 0x176C, "spam_models_customheight" }, + { 0x176D, "spam_model_circlescale_lasttime" }, + { 0x176E, "spam_model_circlescale_accumtime" }, +// { 0x176F, "" }, + { 0x1770, "timelimitoverride" }, + { 0x1771, "painter_player" }, + { 0x1772, "painter_init" }, + { 0x1773, "hint_buttons_zoffset" }, +// { 0x1774, "" }, +// { 0x1775, "" }, +// { 0x1776, "" }, + { 0x1777, "heightoffset" }, +// { 0x1778, "" }, +// { 0x1779, "" }, +// { 0x177A, "" }, + { 0x177B, "customheight_mode" }, + { 0x177C, "customheight_mode_offsetmodels" }, + { 0x177D, "orgorg" }, + { 0x177E, "customrotation_mode_off" }, + { 0x177F, "customrotation_mode" }, + { 0x1780, "spam_models_customrotation" }, +// { 0x1781, "" }, + { 0x1782, "crosshair_fadetopoint" }, + { 0x1783, "spam_model_circlescale" }, +// { 0x1784, "" }, + { 0x1785, "draw_placement_circle" }, + { 0x1786, "orienttoplayeryrot" }, +// { 0x1787, "" }, + { 0x1788, "spam_model_place" }, +// { 0x1789, "" }, +// { 0x178A, "" }, + { 0x178B, "is_too_dense" }, +// { 0x178C, "" }, + { 0x178D, "contour_point" }, + { 0x178E, "plot_circle" }, +// { 0x178F, "" }, + { 0x1790, "dump_models" }, + { 0x1791, "is_mp" }, +// { 0x1792, "" }, +// { 0x1793, "" }, + { 0x1794, "func_create_loopsound" }, + { 0x1795, "global_fx" }, + { 0x1796, "_global_fx_ents" }, + { 0x1797, "getstructarray_delete" }, +// { 0x1798, "" }, + { 0x1799, "watchgrenadeusage" }, +// { 0x179A, "" }, +// { 0x179B, "" }, + { 0x179C, "throwinggrenade" }, + { 0x179D, "beginsmokegrenadetracking" }, + { 0x179E, "smokegrenades" }, +// { 0x179F, "" }, +// { 0x17A0, "" }, +// { 0x17A1, "" }, +// { 0x17A2, "" }, + { 0x17A3, "has_semtex_on_it" }, +// { 0x17A4, "" }, + { 0x17A5, "attacker_isonmyteam" }, + { 0x17A6, "smoke_grenade_death" }, +// { 0x17A7, "" }, + { 0x17A8, "grenade_earthquake" }, + { 0x17A9, "threw_ninebang" }, + { 0x17AA, "beginc4tracking" }, + { 0x17AB, "watchc4" }, +// { 0x17AC, "" }, + { 0x17AD, "array_remove_nokeys" }, + { 0x17AE, "watchclaymores" }, +// { 0x17AF, "" }, + { 0x17B0, "claymoresentientfunc" }, + { 0x17B1, "claymoredetonation" }, + { 0x17B2, "detonateradius" }, + { 0x17B3, "claymores" }, + { 0x17B4, "deleteondeath" }, +// { 0x17B5, "" }, +// { 0x17B6, "" }, +// { 0x17B7, "" }, +// { 0x17B8, "" }, + { 0x17B9, "resetc4explodethisframe" }, + { 0x17BA, "saydamaged" }, + { 0x17BB, "playc4effects" }, + { 0x17BC, "playclaymoreeffects" }, + { 0x17BD, "clearfxondeath" }, +// { 0x17BE, "" }, + { 0x17BF, "isplayer" }, + { 0x17C0, "isadestructable" }, + { 0x17C1, "damagecenter" }, + { 0x17C2, "weapondamagetracepassed" }, + { 0x17C3, "damageent" }, + { 0x17C4, "damageorigin" }, + { 0x17C5, "callbackplayerdamage" }, + { 0x17C6, "debugline" }, + { 0x17C7, "onweapondamage" }, + { 0x17C8, "watchc4altdetonate" }, +// { 0x17C9, "" }, + { 0x17CA, "_extra_autosave_checks" }, + { 0x17CB, "autosave_proximity_threat_func" }, + { 0x17CC, "getdescription" }, + { 0x17CD, "getnames" }, + { 0x17CE, "beginningoflevelsave" }, + { 0x17CF, "trigger_autosave_stealth" }, + { 0x17D0, "autosave_stealth" }, + { 0x17D1, "trigger_autosave_tactical" }, + { 0x17D2, "autosave_tactical" }, +// { 0x17D3, "" }, + { 0x17D4, "script_autosave" }, + { 0x17D5, "autosaves_think" }, + { 0x17D6, "autosavenamethink" }, +// { 0x17D7, "" }, + { 0x17D8, "customautosavecheck" }, + { 0x17D9, "script_autosavename" }, +// { 0x17DA, "" }, +// { 0x17DB, "" }, + { 0x17DC, "autosave_timeout" }, +// { 0x17DD, "" }, +// { 0x17DE, "" }, + { 0x17DF, "_autosave_game_now" }, + { 0x17E0, "autosave_now_trigger" }, + { 0x17E1, "autosave_now" }, +// { 0x17E2, "" }, + { 0x17E3, "tryautosave" }, +// { 0x17E4, "" }, + { 0x17E5, "extra_autosave_checks_failed" }, +// { 0x17E6, "" }, + { 0x17E7, "autosavecheck" }, + { 0x17E8, "autosave_check_override" }, + { 0x17E9, "special_autosavecondition" }, + { 0x17EA, "dopickyautosavechecks" }, + { 0x17EB, "global_callbacks" }, + { 0x17EC, "autosave_threat_check_enabled" }, + { 0x17ED, "savehere" }, + { 0x17EE, "cansave" }, + { 0x17EF, "autosaveplayercheck" }, + { 0x17F0, "ac130gunner" }, + { 0x17F1, "shellshocked" }, + { 0x17F2, "autosaveammocheck" }, + { 0x17F3, "autosavehealthcheck" }, +// { 0x17F4, "" }, +// { 0x17F5, "" }, + { 0x17F6, "enemy_is_a_threat" }, +// { 0x17F7, "" }, + { 0x17F8, "recon_checkpoint_lasttime" }, + { 0x17F9, "init_loadout" }, + { 0x17FA, "dodgeloadout" }, + { 0x17FB, "setdefaultactionslot" }, + { 0x17FC, "init_player" }, + { 0x17FD, "char_switcher" }, + { 0x17FE, "coop_player1" }, +// { 0x17FF, "" }, + { 0x1800, "character_switched" }, +// { 0x1801, "" }, + { 0x1802, "loadout" }, + { 0x1803, "give_loadout" }, + { 0x1804, "character_selected" }, + { 0x1805, "setmodelfunc" }, + { 0x1806, "default_weapon" }, + { 0x1807, "castle_main_weapon" }, + { 0x1808, "castle_side_weapon" }, + { 0x1809, "dubai_main_weapon" }, + { 0x180A, "testmap" }, + { 0x180B, "give_loadout_specialops" }, + { 0x180C, "so_warlord_secondary" }, + { 0x180D, "so_warlord_primary" }, + { 0x180E, "so_payback_primary" }, + { 0x180F, "so_payback_secondary" }, + { 0x1810, "primary_weapon" }, + { 0x1811, "secondary_weapon" }, + { 0x1812, "sniper_primary" }, + { 0x1813, "sniper_secondary" }, + { 0x1814, "heavy_primary" }, + { 0x1815, "heavy_secondary" }, + { 0x1816, "possible_precache" }, + { 0x1817, "give_default_loadout" }, + { 0x1818, "give_default_loadout_coop" }, + { 0x1819, "saveplayerweaponstatepersistent" }, + { 0x181A, "restoreplayerweaponstatepersistent" }, + { 0x181B, "legit_weapons" }, + { 0x181C, "sniper_escape_initial_secondary_weapon_loadout" }, + { 0x181D, "set_legit_weapons_for_sniper_escape" }, +// { 0x181E, "" }, +// { 0x181F, "" }, + { 0x1820, "favela_escape_main_weapon" }, +// { 0x1821, "" }, + { 0x1822, "dc_whitehouse_main_weapon" }, + { 0x1823, "max_ammo_on_legit_sniper_escape_weapon" }, +// { 0x1824, "" }, + { 0x1825, "coop_gamesetup_menu" }, + { 0x1826, "coop_gamesetup_ac130" }, +// { 0x1827, "" }, + { 0x1828, "give_default_loadout_specialops" }, + { 0x1829, "so_player_num" }, + { 0x182A, "so_player_add_player_giveweapon" }, + { 0x182B, "so_player_set_maxammo" }, +// { 0x182C, "" }, + { 0x182D, "so_player_set_setoffhandsecondaryclass" }, + { 0x182E, "so_player_set_switchtoweapon" }, + { 0x182F, "so_player_setmodelfunc" }, + { 0x1830, "so_player_setmodelfunc_precache" }, + { 0x1831, "so_player_setactionslot" }, + { 0x1832, "so_player_giveweapon" }, + { 0x1833, "parm1" }, + { 0x1834, "parm2" }, + { 0x1835, "so_player_give_loadout" }, + { 0x1836, "so_players_give_action" }, + { 0x1837, "so_players_give_loadout" }, + { 0x1838, "updatemodel" }, + { 0x1839, "last_modelfunc" }, + { 0x183A, "so_player_setup_body" }, + { 0x183B, "so_player_get_bodyfunc" }, + { 0x183C, "so_player_get_bodyfunc_precache" }, + { 0x183D, "so_player_get_hands" }, + { 0x183E, "so_body_player_ranger" }, + { 0x183F, "so_body_player_seal" }, + { 0x1840, "so_body_player_arctic" }, +// { 0x1841, "" }, + { 0x1842, "so_body_player_desert" }, + { 0x1843, "so_body_player_ghillie" }, + { 0x1844, "so_body_player_delta" }, + { 0x1845, "so_body_player_sas" }, +// { 0x1846, "" }, + { 0x1847, "so_body_player_hijack_2" }, + { 0x1848, "so_body_player_fso_1" }, +// { 0x1849, "" }, +// { 0x184A, "" }, + { 0x184B, "so_body_player_seal_precache" }, + { 0x184C, "so_body_player_arctic_precache" }, + { 0x184D, "so_body_player_woodland_precache" }, + { 0x184E, "so_body_player_desert_precache" }, + { 0x184F, "so_body_player_ghillie_precache" }, + { 0x1850, "so_body_player_delta_precache" }, + { 0x1851, "so_body_player_sas_precache" }, +// { 0x1852, "" }, + { 0x1853, "so_body_player_hijack_precache_2" }, + { 0x1854, "so_body_player_fso_precache_1" }, + { 0x1855, "so_body_player_fso_precache_2" }, + { 0x1856, "elevators" }, + { 0x1857, "elevator_callbutton_link_v" }, +// { 0x1858, "" }, + { 0x1859, "elevator_update_global_dvars" }, + { 0x185A, "elevator_accel" }, +// { 0x185B, "" }, + { 0x185C, "elevator_music" }, +// { 0x185D, "" }, +// { 0x185E, "" }, +// { 0x185F, "" }, +// { 0x1860, "" }, + { 0x1861, "elevator_waittime" }, + { 0x1862, "elevator_aggressive_call" }, + { 0x1863, "elevator_debug" }, + { 0x1864, "elevator_motion_detection" }, + { 0x1865, "elevator_think" }, + { 0x1866, "elevator_call" }, +// { 0x1867, "" }, + { 0x1868, "floor_override" }, + { 0x1869, "overrider" }, + { 0x186A, "elevator_fsm" }, +// { 0x186B, "" }, + { 0x186C, "moveto_floor" }, + { 0x186D, "motion_trigger" }, + { 0x186E, "elevator_interrupted" }, + { 0x186F, "monitor_callbutton" }, + { 0x1870, "e" }, +// { 0x1871, "" }, +// { 0x1872, "" }, + { 0x1873, "elevator_interrupt" }, + { 0x1874, "elevator_floor_update" }, +// { 0x1875, "" }, + { 0x1876, "listen_for" }, + { 0x1877, "position_elevators" }, + { 0x1878, "elevator_move" }, + { 0x1879, "close_inner_doors" }, +// { 0x187A, "" }, +// { 0x187B, "" }, + { 0x187C, "open_outer_doors" }, + { 0x187D, "build_elevators" }, + { 0x187E, "build_call_buttons" }, +// { 0x187F, "" }, + { 0x1880, "make_discrete_trigger" }, + { 0x1881, "enabled" }, +// { 0x1882, "" }, + { 0x1883, "enable_trigger" }, +// { 0x1884, "" }, + { 0x1885, "disable_trigger_helper" }, +// { 0x1886, "" }, + { 0x1887, "get_outer_doorsets" }, + { 0x1888, "get_outer_closedpos" }, + { 0x1889, "get_outer_leftdoor" }, + { 0x188A, "get_outer_rightdoor" }, +// { 0x188B, "" }, + { 0x188C, "get_outer_rightdoor_openedpos" }, + { 0x188D, "get_housing_children" }, + { 0x188E, "get_housing_mainframe" }, +// { 0x188F, "" }, + { 0x1890, "get_housing_primarylight" }, + { 0x1891, "get_housing_musak_model" }, + { 0x1892, "get_housing_door_trigger" }, + { 0x1893, "get_housing_inside_trigger" }, +// { 0x1894, "" }, +// { 0x1895, "" }, + { 0x1896, "get_housing_rightdoor" }, + { 0x1897, "get_housing_leftdoor_opened_pos" }, + { 0x1898, "get_housing_rightdoor_opened_pos" }, + { 0x1899, "get_curfloor" }, +// { 0x189A, "" }, +// { 0x189B, "" }, + { 0x189C, "isinbound" }, +// { 0x189D, "" }, + { 0x189E, "waittill_or_timeout" }, + { 0x189F, "elevator_get_dvar_int" }, + { 0x18A0, "elevator_get_dvar" }, +// { 0x18A1, "" }, +// { 0x18A2, "" }, + { 0x18A3, "num_pipe_fx" }, + { 0x18A4, "pipesetup" }, +// { 0x18A5, "" }, + { 0x18A6, "b" }, + { 0x18A7, "pipe_wait_loop" }, + { 0x18A8, "pipe_logic" }, + { 0x18A9, "_pipe_methods" }, + { 0x18AA, "pipefx" }, + { 0x18AB, "fx_time" }, + { 0x18AC, "_sound" }, + { 0x18AD, "pipe_damage" }, + { 0x18AE, "_dmg" }, +// { 0x18AF, "" }, +// { 0x18B0, "" }, + { 0x18B1, "methodsinit" }, + { 0x18B2, "pipe_calc_ballistic" }, +// { 0x18B3, "" }, + { 0x18B4, "pipe_calc_nofx" }, + { 0x18B5, "precachefx" }, + { 0x18B6, "onplayerconnect" }, +// { 0x18B7, "" }, +// { 0x18B8, "" }, +// { 0x18B9, "" }, + { 0x18BA, "civilian_jet_flyby" }, +// { 0x18BB, "" }, +// { 0x18BC, "" }, + { 0x18BD, "jet_flyto" }, + { 0x18BE, "engine_fxs" }, +// { 0x18BF, "" }, + { 0x18C0, "jet_engine_fx" }, + { 0x18C1, "jet_flash_fx_red" }, + { 0x18C2, "jet_flash_fx_green" }, + { 0x18C3, "jet_flash_fx_blink" }, + { 0x18C4, "civilianjetflyby" }, + { 0x18C5, "old_origin" }, + { 0x18C6, "jet_fly_vec" }, +// { 0x18C7, "" }, + { 0x18C8, "jet_reset" }, +// { 0x18C9, "" }, + { 0x18CA, "civilianjetflyby_timer" }, +// { 0x18CB, "" }, +// { 0x18CC, "" }, +// { 0x18CD, "" }, + { 0x18CE, "remotemissileinprogress" }, + { 0x18CF, "gettimeinterval" }, +// { 0x18D0, "" }, + { 0x18D1, "gametype" }, +// { 0x18D2, "" }, + { 0x18D3, "watchdvars" }, +// { 0x18D4, "" }, + { 0x18D5, "jet_flyby" }, + { 0x18D6, "mapcenter" }, + { 0x18D7, "jet_planesound" }, +// { 0x18D8, "" }, +// { 0x18D9, "" }, +// { 0x18DA, "" }, +// { 0x18DB, "" }, + { 0x18DC, "vending_machine" }, + { 0x18DD, "vm_normal" }, +// { 0x18DE, "" }, +// { 0x18DF, "" }, + { 0x18E0, "vm_fx_loc" }, + { 0x18E1, "vm_normal_model" }, + { 0x18E2, "vm_damaged_model" }, + { 0x18E3, "vm_soda_model" }, + { 0x18E4, "vm_soda_start_pos" }, + { 0x18E5, "vm_soda_start_angle" }, +// { 0x18E6, "" }, + { 0x18E7, "vm_soda_stop_angle" }, + { 0x18E8, "soda_array" }, + { 0x18E9, "soda_count" }, +// { 0x18EA, "" }, + { 0x18EB, "hp" }, +// { 0x18EC, "" }, + { 0x18ED, "spawn_soda" }, + { 0x18EE, "soda_can_drop" }, + { 0x18EF, "soda_can_eject" }, +// { 0x18F0, "" }, + { 0x18F1, "freefall" }, + { 0x18F2, "metal_detector" }, +// { 0x18F3, "" }, + { 0x18F4, "alarm_playing" }, + { 0x18F5, "alarm_annoyance" }, + { 0x18F6, "tolerance" }, +// { 0x18F7, "" }, +// { 0x18F8, "" }, + { 0x18F9, "waittill_any_or_timeout" }, + { 0x18FA, "metal_detector_weapons" }, + { 0x18FB, "waittill_weapon_placed" }, + { 0x18FC, "weapon_notify_loop" }, + { 0x18FD, "isinbound_single" }, + { 0x18FE, "metal_detector_dmg_monitor" }, + { 0x18FF, "metal_detector_touch_monitor" }, + { 0x1900, "alarm_validate_damage" }, +// { 0x1901, "" }, +// { 0x1902, "" }, + { 0x1903, "motion_light" }, + { 0x1904, "movetracker" }, +// { 0x1905, "" }, + { 0x1906, "lightrigs" }, + { 0x1907, "touchlist" }, + { 0x1908, "distmoved" }, + { 0x1909, "motion_light_timeout" }, + { 0x190A, "outdoor_motion_dlight" }, +// { 0x190B, "" }, + { 0x190C, "lightent" }, + { 0x190D, "outdoor_motion_dlight_timeout" }, + { 0x190E, "dog_bark" }, + { 0x190F, "trigger_door" }, +// { 0x1910, "" }, + { 0x1911, "doorangle" }, + { 0x1912, "baseyaw" }, +// { 0x1913, "" }, +// { 0x1914, "" }, +// { 0x1915, "" }, + { 0x1916, "use_toggle" }, + { 0x1917, "bird_startle" }, +// { 0x1918, "" }, + { 0x1919, "copier" }, + { 0x191A, "copy_bar" }, +// { 0x191B, "" }, + { 0x191C, "light" }, + { 0x191D, "end_pos" }, + { 0x191E, "get_photo_copier" }, + { 0x191F, "waittill_copier_copies" }, + { 0x1920, "photo_copier" }, + { 0x1921, "photo_copier_no_light" }, + { 0x1922, "reset_copier" }, + { 0x1923, "photo_copier_copy_bar_goes" }, + { 0x1924, "photo_copier_light_on" }, +// { 0x1925, "" }, + { 0x1926, "photo_light_flicker" }, + { 0x1927, "fan_blade_rotate" }, + { 0x1928, "triggertouchthink" }, +// { 0x1929, "" }, + { 0x192A, "playertouchtriggerthink" }, +// { 0x192B, "" }, + { 0x192C, "movetrackers" }, + { 0x192D, "gameended" }, + { 0x192E, "movementtracker" }, + { 0x192F, "disablemovementtracker" }, +// { 0x1930, "" }, +// { 0x1931, "" }, + { 0x1932, "linefeed_delay" }, + { 0x1933, "credits_active" }, +// { 0x1934, "" }, + { 0x1935, "introscreen_generic_black_fade_in" }, + { 0x1936, "introscreen_generic_white_fade_in" }, + { 0x1937, "introscreen_generic_fade_in" }, + { 0x1938, "introscreen_create_line" }, + { 0x1939, "introstring" }, +// { 0x193A, "" }, +// { 0x193B, "" }, +// { 0x193C, "" }, + { 0x193D, "_cornerlinethread" }, + { 0x193E, "intro_offset" }, +// { 0x193F, "" }, +// { 0x1940, "" }, +// { 0x1941, "" }, +// { 0x1942, "" }, + { 0x1943, "london_intro" }, +// { 0x1944, "" }, + { 0x1945, "prague_intro" }, + { 0x1946, "prague_escape_intro" }, + { 0x1947, "payback_intro" }, + { 0x1948, "send_notify" }, + { 0x1949, "hudtimestamp" }, +// { 0x194A, "" }, + { 0x194B, "feedline_delay" }, + { 0x194C, "slamzoom_intro" }, + { 0x194D, "customintroangles" }, + { 0x194E, "dontrevivehud" }, + { 0x194F, "add_func" }, +// { 0x1950, "" }, + { 0x1951, "hide_hud" }, + { 0x1952, "weapon_pullout" }, + { 0x1953, "revive_ammo_counter" }, + { 0x1954, "nocompass" }, + { 0x1955, "ramp_out_sunsample_over_time" }, + { 0x1956, "get_introscreen_levelname" }, + { 0x1957, "introscreen_levelname" }, + { 0x1958, "main_old_maps" }, + { 0x1959, "cliffhanger_intro_text" }, +// { 0x195A, "" }, +// { 0x195B, "" }, +// { 0x195C, "" }, + { 0x195D, "rescue_2_intro" }, +// { 0x195E, "" }, + { 0x195F, "windstrength" }, + { 0x1960, "animrate" }, +// { 0x1961, "" }, + { 0x1962, "animweightmax" }, + { 0x1963, "inc" }, +// { 0x1964, "" }, + { 0x1965, "windcontroller" }, + { 0x1966, "new_style_shutters" }, + { 0x1967, "pivot" }, + { 0x1968, "shutterwander" }, +// { 0x1969, "" }, +// { 0x196A, "" }, +// { 0x196B, "" }, + { 0x196C, "shutterwanderright" }, + { 0x196D, "shuttersound" }, + { 0x196E, "wirewander" }, +// { 0x196F, "" }, + { 0x1970, "awningwander" }, + { 0x1971, "palmtree_anims" }, +// { 0x1972, "" }, +// { 0x1973, "" }, +// { 0x1974, "" }, +// { 0x1975, "" }, +// { 0x1976, "" }, +// { 0x1977, "" }, + { 0x1978, "escalator_move" }, + { 0x1979, "final_move" }, + { 0x197A, "breakables_fx" }, + { 0x197B, "_glass_info" }, + { 0x197C, "tv_lite_array" }, + { 0x197D, "barrelexpsound" }, +// { 0x197E, "" }, + { 0x197F, "barrelhealth" }, +// { 0x1980, "" }, + { 0x1981, "barrelexplodingthisframe" }, + { 0x1982, "breakables_clip" }, + { 0x1983, "console_auto_aim" }, + { 0x1984, "console_auto_aim_2nd" }, + { 0x1985, "set_console_status" }, + { 0x1986, "_breakable_utility_modelarray" }, +// { 0x1987, "" }, + { 0x1988, "_breakable_utility_maxnum" }, + { 0x1989, "security_camera_logic" }, +// { 0x198A, "" }, +// { 0x198B, "" }, +// { 0x198C, "" }, + { 0x198D, "onmodel" }, + { 0x198E, "disable_interactive_tv_use_triggers" }, + { 0x198F, "usetrig" }, + { 0x1990, "lite" }, + { 0x1991, "liteintensity" }, + { 0x1992, "tv_off" }, + { 0x1993, "tv_damage" }, + { 0x1994, "tvhook" }, +// { 0x1995, "" }, + { 0x1996, "script_health" }, +// { 0x1997, "" }, + { 0x1998, "oil_spill_think" }, + { 0x1999, "barrel" }, +// { 0x199A, "" }, + { 0x199B, "extra" }, +// { 0x199C, "" }, + { 0x199D, "oil_spill_burn" }, + { 0x199E, "oil_spill_burn_section" }, + { 0x199F, "explodable_barrel_think" }, + { 0x19A0, "explodable_barrel_burn" }, + { 0x19A1, "explodable_barrel_explode" }, +// { 0x19A2, "" }, + { 0x19A3, "arcademode_kill" }, + { 0x19A4, "shuddering_entity_think" }, +// { 0x19A5, "" }, + { 0x19A6, "helmet_pop" }, + { 0x19A7, "helmet_logic" }, +// { 0x19A8, "" }, + { 0x19A9, "allowbreak" }, + { 0x19AA, "breakingents" }, + { 0x19AB, "breakable_think_triggered" }, + { 0x19AC, "breakable_think" }, + { 0x19AD, "plate" }, + { 0x19AE, "breakable_logic" }, +// { 0x19AF, "" }, + { 0x19B0, "crateimpactsound" }, + { 0x19B1, "xenon_auto_aim" }, + { 0x19B2, "autoaim" }, + { 0x19B3, "xenon_auto_aim_stop_logic" }, +// { 0x19B4, "" }, +// { 0x19B5, "" }, + { 0x19B6, "wait_message" }, +// { 0x19B7, "" }, + { 0x19B8, "breakable_clip" }, + { 0x19B9, "make_broken_peices" }, + { 0x19BA, "list_add" }, + { 0x19BB, "pieces_move" }, +// { 0x19BC, "" }, + { 0x19BD, "addpiece" }, +// { 0x19BE, "" }, +// { 0x19BF, "" }, + { 0x19C0, "getclosestent" }, + { 0x19C1, "getclosestaccurantent" }, + { 0x19C2, "getclosestaiment" }, + { 0x19C3, "is_iw4_map_sp" }, + { 0x19C4, "intel_items" }, + { 0x19C5, "intel_counter" }, + { 0x19C6, "table_origins" }, + { 0x19C7, "remove_all_intel" }, + { 0x19C8, "removed" }, + { 0x19C9, "remove_intel_item" }, + { 0x19CA, "item" }, +// { 0x19CB, "" }, +// { 0x19CC, "" }, + { 0x19CD, "intel_think" }, + { 0x19CE, "poll_for_found" }, +// { 0x19CF, "" }, +// { 0x19D0, "" }, +// { 0x19D1, "" }, +// { 0x19D2, "" }, + { 0x19D3, "wait_for_pickup" }, + { 0x19D4, "save_intel_for_all_players" }, +// { 0x19D5, "" }, + { 0x19D6, "intel_feedback" }, + { 0x19D7, "player_giveachievement_wrapper" }, + { 0x19D8, "setup_hud_elem" }, + { 0x19D9, "assert_if_identical_origins" }, +// { 0x19DA, "" }, +// { 0x19DB, "" }, + { 0x19DC, "anim_prop_models_animtree" }, +// { 0x19DD, "" }, + { 0x19DE, "anim_prop_init_threads" }, + { 0x19DF, "init_wind_if_uninitialized" }, +// { 0x19E0, "" }, +// { 0x19E1, "" }, + { 0x19E2, "weight" }, + { 0x19E3, "variance" }, + { 0x19E4, "model_init" }, + { 0x19E5, "already_dumpped" }, +// { 0x19E6, "" }, + { 0x19E7, "animatetreewind" }, + { 0x19E8, "blendtreeanims" }, + { 0x19E9, "script_print_fx" }, + { 0x19EA, "script_playfx" }, + { 0x19EB, "script_playfxontag" }, + { 0x19EC, "grenadeexplosionfx" }, + { 0x19ED, "soundfx" }, + { 0x19EE, "soundfxdelete" }, + { 0x19EF, "rainfx" }, + { 0x19F0, "rainloop" }, + { 0x19F1, "blenddelete" }, + { 0x19F2, "watersheeting" }, +// { 0x19F3, "" }, +// { 0x19F4, "" }, + { 0x19F5, "attachhead" }, +// { 0x19F6, "" }, + { 0x19F7, "script_char_index" }, + { 0x19F8, "headmodel" }, +// { 0x19F9, "" }, + { 0x19FA, "character_hat_index" }, +// { 0x19FB, "" }, +// { 0x19FC, "" }, + { 0x19FD, "putguninhand" }, + { 0x19FE, "save" }, + { 0x19FF, "anim_guninhand" }, + { 0x1A00, "load" }, + { 0x1A01, "get_random_character" }, +// { 0x1A02, "" }, + { 0x1A03, "character_index_cache" }, +// { 0x1A04, "" }, + { 0x1A05, "initialize_character_group" }, + { 0x1A06, "get_random_weapon" }, + { 0x1A07, "setupminimap" }, +// { 0x1A08, "" }, +// { 0x1A09, "" }, +// { 0x1A0A, "" }, + { 0x1A0B, "map_width" }, + { 0x1A0C, "map_height" }, + { 0x1A0D, "mapsize" }, + { 0x1A0E, "visionthermaldefault" }, + { 0x1A0F, "clear_custom_eog_summary" }, + { 0x1A10, "notetracks" }, + { 0x1A11, "registernotetracks" }, + { 0x1A12, "add_start" }, + { 0x1A13, "wait_any_func_array" }, +// { 0x1A14, "" }, + { 0x1A15, "run_call_after_wait_array" }, +// { 0x1A16, "" }, +// { 0x1A17, "" }, +// { 0x1A18, "" }, + { 0x1A19, "dirteffectmenu" }, +// { 0x1A1A, "" }, + { 0x1A1B, "radiation_totalpercent" }, +// { 0x1A1C, "" }, + { 0x1A1D, "default_run_speed" }, +// { 0x1A1E, "" }, + { 0x1A1F, "createclientfontstring_func" }, + { 0x1A20, "hudsetpoint_func" }, + { 0x1A21, "makeentitysentient_func" }, + { 0x1A22, "freeentitysentient_func" }, + { 0x1A23, "laseron_func" }, + { 0x1A24, "laseroff_func" }, +// { 0x1A25, "" }, + { 0x1A26, "stat_track_damage_func" }, + { 0x1A27, "_notetrackfx" }, + { 0x1A28, "inwater" }, + { 0x1A29, "hero_list" }, + { 0x1A2A, "flashmonitor" }, + { 0x1A2B, "shock_ondeath" }, + { 0x1A2C, "setskill" }, + { 0x1A2D, "handle_starts_endons" }, + { 0x1A2E, "killspawn_groups" }, + { 0x1A2F, "audio_stringtable_mapname" }, + { 0x1A30, "init_vehicles" }, + { 0x1A31, "deleteent" }, +// { 0x1A32, "" }, + { 0x1A33, "playerhealthregen" }, + { 0x1A34, "friendly_spawner" }, +// { 0x1A35, "" }, + { 0x1A36, "goalvolumes" }, +// { 0x1A37, "" }, + { 0x1A38, "friendlychain_ondeath" }, + { 0x1A39, "friendlyspawnwave" }, +// { 0x1A3A, "" }, + { 0x1A3B, "trigger_hint_string" }, +// { 0x1A3C, "" }, + { 0x1A3D, "shared_portable_turrets" }, + { 0x1A3E, "spawn_groups" }, + { 0x1A3F, "get_load_trigger_classes" }, +// { 0x1A40, "" }, +// { 0x1A41, "" }, + { 0x1A42, "get_load_trigger_funcs" }, + { 0x1A43, "friendly_wave" }, +// { 0x1A44, "" }, + { 0x1A45, "camper_trigger_think" }, + { 0x1A46, "flood_trigger_think" }, + { 0x1A47, "two_stage_spawner_think" }, + { 0x1A48, "random_spawn" }, + { 0x1A49, "objective_event_init" }, + { 0x1A4A, "outdoor_think" }, + { 0x1A4B, "indoor_think" }, + { 0x1A4C, "init_script_triggers" }, + { 0x1A4D, "script_fallback" }, + { 0x1A4E, "fallback_think" }, + { 0x1A4F, "script_mgturretauto" }, + { 0x1A50, "mgturret_auto" }, + { 0x1A51, "kill_spawner" }, + { 0x1A52, "script_kill_vehicle_spawner" }, +// { 0x1A53, "" }, + { 0x1A54, "script_emptyspawner" }, + { 0x1A55, "empty_spawner" }, +// { 0x1A56, "" }, + { 0x1A57, "script_triggered_playerseek" }, + { 0x1A58, "script_bctrigger" }, + { 0x1A59, "script_trigger_group" }, + { 0x1A5A, "script_random_killspawner" }, +// { 0x1A5B, "" }, + { 0x1A5C, "set_early_level" }, +// { 0x1A5D, "" }, + { 0x1A5E, "trigger_slide" }, + { 0x1A5F, "slidetriggerplayerthink" }, +// { 0x1A60, "" }, + { 0x1A61, "player_view" }, + { 0x1A62, "script_accel" }, +// { 0x1A63, "" }, + { 0x1A64, "end_slide_delay" }, + { 0x1A65, "endsliding" }, + { 0x1A66, "setup_simple_primary_lights" }, + { 0x1A67, "weapon_ammo" }, + { 0x1A68, "script_ammo_max" }, +// { 0x1A69, "" }, + { 0x1A6A, "script_ammo_extra" }, + { 0x1A6B, "script_ammo_alt_clip" }, + { 0x1A6C, "script_ammo_alt_extra" }, + { 0x1A6D, "trigger_group" }, + { 0x1A6E, "trigger_group_remove" }, + { 0x1A6F, "exploder_load" }, + { 0x1A70, "script_chance" }, + { 0x1A71, "script_exploder_delay" }, + { 0x1A72, "shock_onpain" }, + { 0x1A73, "usedanimations" }, + { 0x1A74, "badplace_think" }, + { 0x1A75, "badplaces" }, + { 0x1A76, "setup_individual_exploder" }, + { 0x1A77, "exploders" }, + { 0x1A78, "exploder_model_starts_hidden" }, +// { 0x1A79, "" }, + { 0x1A7A, "script_disconnectpaths" }, +// { 0x1A7B, "" }, + { 0x1A7C, "setupexploders" }, + { 0x1A7D, "masked_exploder" }, + { 0x1A7E, "enable_struct_exploders" }, +// { 0x1A7F, "" }, +// { 0x1A80, "" }, + { 0x1A81, "script_ender" }, + { 0x1A82, "script_physics" }, + { 0x1A83, "setup_flag_exploders" }, + { 0x1A84, "exploder_flag_wait" }, + { 0x1A85, "nearairushesplayer" }, + { 0x1A86, "enemyseekingplayer" }, + { 0x1A87, "get_closest_ai" }, + { 0x1A88, "playerdamagerumble" }, +// { 0x1A89, "" }, + { 0x1A8A, "playerdamageshellshock" }, + { 0x1A8B, "map_is_early_in_the_game" }, + { 0x1A8C, "player_special_death_hint" }, + { 0x1A8D, "vehicle_death" }, + { 0x1A8E, "destructible_death" }, + { 0x1A8F, "exploding_barrel_death_af_chase" }, + { 0x1A90, "exploding_barrel_death" }, + { 0x1A91, "grenade_death_text_hudelement" }, +// { 0x1A92, "" }, +// { 0x1A93, "" }, + { 0x1A94, "special_death_indicator_hudelement" }, + { 0x1A95, "triggered_playerseek" }, +// { 0x1A96, "" }, +// { 0x1A97, "" }, +// { 0x1A98, "" }, +// { 0x1A99, "" }, +// { 0x1A9A, "" }, +// { 0x1A9B, "" }, +// { 0x1A9C, "" }, + { 0x1A9D, "bctrigger_validate_distance" }, + { 0x1A9E, "waterthink" }, +// { 0x1A9F, "" }, +// { 0x1AA0, "" }, + { 0x1AA1, "depth_allow_stand" }, + { 0x1AA2, "waterthink_rampspeed" }, +// { 0x1AA3, "" }, +// { 0x1AA4, "" }, + { 0x1AA5, "saw_mgturretlink" }, + { 0x1AA6, "trigger_unlock" }, + { 0x1AA7, "array_notify" }, +// { 0x1AA8, "" }, + { 0x1AA9, "wait_for_an_unlocked_trigger" }, + { 0x1AAA, "report_trigger" }, +// { 0x1AAB, "" }, + { 0x1AAC, "trigger_lookat" }, + { 0x1AAD, "trigger_looking" }, +// { 0x1AAE, "" }, + { 0x1AAF, "set_vision_set" }, + { 0x1AB0, "trigger_lookat_think" }, + { 0x1AB1, "script_dot" }, + { 0x1AB2, "trigger_cansee" }, + { 0x1AB3, "cantraceto" }, + { 0x1AB4, "indicate_start" }, +// { 0x1AB5, "" }, +// { 0x1AB6, "" }, + { 0x1AB7, "start_point" }, + { 0x1AB8, "default_start_override" }, + { 0x1AB9, "default_start" }, + { 0x1ABA, "level_has_start_points" }, +// { 0x1ABB, "" }, + { 0x1ABC, "already_ran_function" }, + { 0x1ABD, "get_string_for_starts" }, + { 0x1ABE, "create_start" }, + { 0x1ABF, "start_menu" }, + { 0x1AC0, "start_nogame" }, + { 0x1AC1, "get_start_dvars" }, + { 0x1AC2, "display_starts" }, + { 0x1AC3, "display_starts_pressed" }, + { 0x1AC4, "start_list_menu" }, +// { 0x1AC5, "" }, + { 0x1AC6, "start_display_cleanup" }, + { 0x1AC7, "devhelp_hudelements" }, +// { 0x1AC8, "" }, + { 0x1AC9, "flag_set_player_trigger" }, + { 0x1ACA, "trigger_nobloodpool" }, + { 0x1ACB, "set_wait_then_clear_skipbloodpool" }, +// { 0x1ACC, "" }, + { 0x1ACD, "sun_off" }, + { 0x1ACE, "flag_set_trigger" }, + { 0x1ACF, "flag_set_trigger_specialops" }, + { 0x1AD0, "player_touched_arr" }, + { 0x1AD1, "flag_set_trigger_specialops_clear" }, + { 0x1AD2, "trigger_damage_player_flag_set" }, +// { 0x1AD3, "" }, + { 0x1AD4, "flag_unset_trigger" }, + { 0x1AD5, "eq_trigger" }, + { 0x1AD6, "set_eq_func" }, +// { 0x1AD7, "" }, +// { 0x1AD8, "" }, + { 0x1AD9, "eq_trigger_table" }, + { 0x1ADA, "player_touched_eq_trigger" }, + { 0x1ADB, "eq_table" }, + { 0x1ADC, "eq_touching" }, + { 0x1ADD, "ai_touched_eq_trigger" }, +// { 0x1ADE, "" }, + { 0x1ADF, "ai_array" }, + { 0x1AE0, "set_eq_on" }, + { 0x1AE1, "set_eq_off" }, + { 0x1AE2, "add_tokens_to_trigger_flags" }, +// { 0x1AE3, "" }, + { 0x1AE4, "script_flag_true_trigger" }, + { 0x1AE5, "wait_for_flag" }, +// { 0x1AE6, "" }, +// { 0x1AE7, "" }, + { 0x1AE8, "trigger_multiple_friendly_stop_respawn" }, + { 0x1AE9, "trigger_multiple_friendly_respawn" }, +// { 0x1AEA, "" }, +// { 0x1AEB, "" }, + { 0x1AEC, "do_radius_damage_from_target" }, +// { 0x1AED, "" }, + { 0x1AEE, "trigger_damage_do_radius_damage" }, +// { 0x1AEF, "" }, + { 0x1AF0, "background_block" }, +// { 0x1AF1, "" }, +// { 0x1AF2, "" }, + { 0x1AF3, "get_ignoreme" }, + { 0x1AF4, "trigger_pacifist" }, +// { 0x1AF5, "" }, +// { 0x1AF6, "" }, +// { 0x1AF7, "" }, + { 0x1AF8, "touched_trigger_runs_func" }, + { 0x1AF9, "trigger_turns_off" }, + { 0x1AFA, "set_player_viewhand_model" }, +// { 0x1AFB, "" }, +// { 0x1AFC, "" }, +// { 0x1AFD, "" }, + { 0x1AFE, "script_hint" }, + { 0x1AFF, "display_hint" }, + { 0x1B00, "stun_test" }, + { 0x1B01, "allowads" }, +// { 0x1B02, "" }, +// { 0x1B03, "" }, +// { 0x1B04, "" }, + { 0x1B05, "found_toucher" }, +// { 0x1B06, "" }, + { 0x1B07, "flag_set_touching" }, + { 0x1B08, "setobjectivetextcolors" }, + { 0x1B09, "ammo_pickup" }, + { 0x1B0A, "get_script_linkto_targets" }, + { 0x1B0B, "delete_link_chain" }, +// { 0x1B0C, "" }, + { 0x1B0D, "trigger_fog" }, + { 0x1B0E, "script_fogset_start" }, + { 0x1B0F, "script_fogset_end" }, + { 0x1B10, "sunfog_enabled" }, + { 0x1B11, "get_fog" }, +// { 0x1B12, "" }, + { 0x1B13, "start_fardist" }, + { 0x1B14, "start_color" }, + { 0x1B15, "start_opacity" }, +// { 0x1B16, "" }, +// { 0x1B17, "" }, + { 0x1B18, "start_sunbeginfadeangle" }, + { 0x1B19, "start_sunendfadeangle" }, + { 0x1B1A, "start_sunfogscale" }, + { 0x1B1B, "end_neardist" }, + { 0x1B1C, "end_fardist" }, + { 0x1B1D, "end_color" }, + { 0x1B1E, "end_opacity" }, + { 0x1B1F, "end_suncolor" }, + { 0x1B20, "end_sundir" }, + { 0x1B21, "end_sunbeginfadeangle" }, +// { 0x1B22, "" }, +// { 0x1B23, "" }, + { 0x1B24, "set_fog_progress" }, + { 0x1B25, "remove_level_first_frame" }, + { 0x1B26, "no_crouch_or_prone_think" }, + { 0x1B27, "no_crouch_or_prone_think_for_player" }, + { 0x1B28, "no_prone_think" }, +// { 0x1B29, "" }, +// { 0x1B2A, "" }, + { 0x1B2B, "spawn_setcharacter" }, + { 0x1B2C, "check_flag_for_stat_tracking" }, + { 0x1B2D, "precache_script_models" }, +// { 0x1B2E, "" }, + { 0x1B2F, "arcademode_save" }, + { 0x1B30, "player_death_detection" }, + { 0x1B31, "player_died_recently_degrades" }, + { 0x1B32, "trigger_spawngroup" }, +// { 0x1B33, "" }, + { 0x1B34, "recon_player" }, + { 0x1B35, "recon_player_downed" }, + { 0x1B36, "last_downed_time" }, + { 0x1B37, "init_level_players" }, + { 0x1B38, "kill_all_players_trigger" }, + { 0x1B39, "trigger_vehicle_spline_spawn" }, + { 0x1B3A, "spawn_vehicle_and_attach_to_spline_path" }, + { 0x1B3B, "trigger_vehicle_spawn" }, +// { 0x1B3C, "" }, + { 0x1B3D, "trigger_dooropen" }, + { 0x1B3E, "trigger_glass_break" }, + { 0x1B3F, "trigger_vehicle_getin_spawn" }, +// { 0x1B40, "" }, +// { 0x1B41, "" }, + { 0x1B42, "vehicle_spawns_targets_and_rides" }, + { 0x1B43, "vehicle_becomes_crashable" }, +// { 0x1B44, "" }, +// { 0x1B45, "" }, + { 0x1B46, "guy_spawns_and_gets_in_vehicle" }, + { 0x1B47, "mount_snowmobile" }, + { 0x1B48, "watchweaponchange" }, + { 0x1B49, "friendly_thermal_reflector_effect" }, + { 0x1B4A, "weap_has_thermal" }, +// { 0x1B4B, "" }, + { 0x1B4C, "turn_thermal_on" }, + { 0x1B4D, "is_in_thermal_vision" }, + { 0x1B4E, "turn_thermal_off" }, + { 0x1B4F, "thermal_effectson" }, + { 0x1B50, "has_thermal_fx" }, +// { 0x1B51, "" }, +// { 0x1B52, "" }, + { 0x1B53, "claymore_pickup_think_global" }, +// { 0x1B54, "" }, + { 0x1B55, "ammo_cache_think_global" }, + { 0x1B56, "use_trigger" }, +// { 0x1B57, "" }, +// { 0x1B58, "" }, + { 0x1B59, "ammo_icon_trig" }, +// { 0x1B5A, "" }, + { 0x1B5B, "player_looking_at" }, + { 0x1B5C, "ammo_icon_fade_in" }, +// { 0x1B5D, "" }, +// { 0x1B5E, "" }, + { 0x1B5F, "init_visionset_progress_trigger" }, + { 0x1B60, "get_vision_set_fog" }, + { 0x1B61, "sunred_start" }, + { 0x1B62, "sungreen_start" }, + { 0x1B63, "sunblue_start" }, + { 0x1B64, "sundir_start" }, + { 0x1B65, "sunbeginfadeangle_start" }, + { 0x1B66, "sunendfadeangle_start" }, +// { 0x1B67, "" }, + { 0x1B68, "visionset_diff" }, +// { 0x1B69, "" }, + { 0x1B6A, "init_self_visionset" }, +// { 0x1B6B, "" }, + { 0x1B6C, "global_empty_callback" }, + { 0x1B6D, "trigger_multiple_compass" }, +// { 0x1B6E, "" }, + { 0x1B6F, "trigger_multiple_fx_volume" }, + { 0x1B70, "trigger_multiple_fx_trigger_on_think" }, +// { 0x1B71, "" }, +// { 0x1B72, "" }, + { 0x1B73, "slowmo_system_init" }, + { 0x1B74, "slowmo_system_defaults" }, +// { 0x1B75, "" }, + { 0x1B76, "lerp_time_out" }, + { 0x1B77, "speed_norm" }, + { 0x1B78, "add_no_game_starts" }, +// { 0x1B79, "" }, +// { 0x1B7A, "" }, + { 0x1B7B, "custom_no_game_setupfunc" }, + { 0x1B7C, "do_no_game_start_teleport" }, + { 0x1B7D, "teleport_player" }, + { 0x1B7E, "friendlyfire" }, + { 0x1B7F, "participation" }, + { 0x1B80, "friendlyfiredisabled" }, + { 0x1B81, "debug_friendlyfire" }, + { 0x1B82, "friendly_fire_think" }, + { 0x1B83, "no_friendly_fire_splash_damage" }, +// { 0x1B84, "" }, +// { 0x1B85, "" }, + { 0x1B86, "friendly_fire_checkpoints" }, + { 0x1B87, "failonfriendlyfire" }, +// { 0x1B88, "" }, +// { 0x1B89, "" }, + { 0x1B8A, "participation_point_cap" }, + { 0x1B8B, "participation_point_flattenovertime" }, + { 0x1B8C, "turnbackon" }, +// { 0x1B8D, "" }, +// { 0x1B8E, "" }, + { 0x1B8F, "custom_friendly_fire_message" }, +// { 0x1B90, "" }, +// { 0x1B91, "" }, + { 0x1B92, "notifydamagenotdone" }, + { 0x1B93, "notifydeath" }, + { 0x1B94, "detectfriendlyfireonentity" }, +// { 0x1B95, "" }, + { 0x1B96, "lookahead_value" }, + { 0x1B97, "drone_lookahead_value" }, + { 0x1B98, "max_drones" }, + { 0x1B99, "drones" }, + { 0x1B9A, "struct_arrayspawn" }, + { 0x1B9B, "drone_spawn_func" }, + { 0x1B9C, "drone_give_soul" }, + { 0x1B9D, "script_moveplaybackrate" }, + { 0x1B9E, "dronecallbackthread" }, +// { 0x1B9F, "" }, + { 0x1BA0, "ai_dont_glow_in_thermal" }, + { 0x1BA1, "drone_init" }, +// { 0x1BA2, "" }, + { 0x1BA3, "script_moveoverride" }, +// { 0x1BA4, "" }, + { 0x1BA5, "drone_array_handling" }, + { 0x1BA6, "structarray_add" }, +// { 0x1BA7, "" }, +// { 0x1BA8, "" }, + { 0x1BA9, "drone_death_thread" }, + { 0x1BAA, "animset" }, +// { 0x1BAB, "" }, + { 0x1BAC, "drone_death_handler" }, + { 0x1BAD, "nocorpsedelete" }, + { 0x1BAE, "drone_wait_for_death" }, + { 0x1BAF, "drone_thermal_draw_disable" }, +// { 0x1BB0, "" }, +// { 0x1BB1, "" }, + { 0x1BB2, "drone_drop_real_weapon_on_death" }, +// { 0x1BB3, "" }, + { 0x1BB4, "drone_idle_custom" }, + { 0x1BB5, "drone_idle_override" }, + { 0x1BB6, "idleanim" }, + { 0x1BB7, "drone_get_goal_loc_with_arrival" }, +// { 0x1BB8, "" }, + { 0x1BB9, "weaponsound" }, + { 0x1BBA, "drone_fire_randomly" }, + { 0x1BBB, "drone_shoot" }, + { 0x1BBC, "drone_shoot_fx" }, + { 0x1BBD, "drone_play_weapon_sound" }, + { 0x1BBE, "drone_wait_move" }, +// { 0x1BBF, "" }, +// { 0x1BC0, "" }, +// { 0x1BC1, "" }, + { 0x1BC2, "anim_relative" }, + { 0x1BC3, "run_speed" }, + { 0x1BC4, "anim_time" }, + { 0x1BC5, "drone_move" }, + { 0x1BC6, "runanim" }, +// { 0x1BC7, "" }, + { 0x1BC8, "started_moving" }, +// { 0x1BC9, "" }, +// { 0x1BCA, "" }, +// { 0x1BCB, "" }, +// { 0x1BCC, "" }, +// { 0x1BCD, "" }, + { 0x1BCE, "draw_point" }, +// { 0x1BCF, "" }, + { 0x1BD0, "patrol" }, +// { 0x1BD1, "" }, + { 0x1BD2, "script_patroller" }, + { 0x1BD3, "get_linked_structs" }, + { 0x1BD4, "set_goal_ent" }, + { 0x1BD5, "set_goal_node" }, +// { 0x1BD6, "" }, +// { 0x1BD7, "" }, +// { 0x1BD8, "" }, + { 0x1BD9, "script_flag_set" }, + { 0x1BDA, "script_ent_flag_set" }, + { 0x1BDB, "script_flag_clear" }, +// { 0x1BDC, "" }, + { 0x1BDD, "script_animation" }, + { 0x1BDE, "patrol_no_stop_transition" }, + { 0x1BDF, "script_faceangles" }, +// { 0x1BE0, "" }, + { 0x1BE1, "patrol_scriptedanim" }, + { 0x1BE2, "patrol_end_idle" }, + { 0x1BE3, "patrol_do_stop_transition_anim" }, + { 0x1BE4, "patrol_stop" }, + { 0x1BE5, "patrol_do_start_transition_anim" }, +// { 0x1BE6, "" }, +// { 0x1BE7, "" }, +// { 0x1BE8, "" }, + { 0x1BE9, "turn_180_move_start_func" }, + { 0x1BEA, "set_patrol_run_anim_array" }, + { 0x1BEB, "patrol_walk_anim" }, + { 0x1BEC, "patrol_walk_twitch" }, +// { 0x1BED, "" }, +// { 0x1BEE, "" }, +// { 0x1BEF, "" }, + { 0x1BF0, "waittill_combat" }, + { 0x1BF1, "script_nobark" }, + { 0x1BF2, "default_goalradius" }, +// { 0x1BF3, "" }, +// { 0x1BF4, "" }, + { 0x1BF5, "showclaimed" }, +// { 0x1BF6, "" }, + { 0x1BF7, "script_pet" }, + { 0x1BF8, "pet_patrol" }, + { 0x1BF9, "patrol_goal_pos" }, +// { 0x1BFA, "" }, + { 0x1BFB, "options" }, +// { 0x1BFC, "" }, +// { 0x1BFD, "" }, + { 0x1BFE, "recursed" }, + { 0x1BFF, "pet_debug_positions" }, + { 0x1C00, "pet_patrol_get_available_origin" }, +// { 0x1C01, "" }, + { 0x1C02, "set_dog_walk_anim" }, + { 0x1C03, "pet_patrol_handle_movespeed" }, + { 0x1C04, "init_move_transition_arrays" }, +// { 0x1C05, "" }, +// { 0x1C06, "" }, +// { 0x1C07, "" }, + { 0x1C08, "covertranssplit" }, + { 0x1C09, "initmovestartstoptransitions" }, + { 0x1C0A, "coverstepinanim" }, + { 0x1C0B, "coverstepinoffsets" }, + { 0x1C0C, "coverstepinangles" }, + { 0x1C0D, "getsplittimes" }, + { 0x1C0E, "getexitsplittime" }, + { 0x1C0F, "gettranssplittime" }, + { 0x1C10, "initflashed" }, + { 0x1C11, "flashanimarray" }, + { 0x1C12, "flashanimindex" }, + { 0x1C13, "randomizeflashanimarray" }, + { 0x1C14, "getnextflashanim" }, +// { 0x1C15, "" }, +// { 0x1C16, "" }, + { 0x1C17, "specialflashedfunc" }, +// { 0x1C18, "" }, +// { 0x1C19, "" }, +// { 0x1C1A, "" }, +// { 0x1C1B, "" }, +// { 0x1C1C, "" }, +// { 0x1C1D, "" }, + { 0x1C1E, "isweaponinitialized" }, + { 0x1C1F, "setglobalaimsettings" }, + { 0x1C20, "aimyawdifffartolerance" }, + { 0x1C21, "aimyawdiffclosedistsq" }, + { 0x1C22, "aimyawdiffclosetolerance" }, + { 0x1C23, "aimpitchdifftolerance" }, +// { 0x1C24, "" }, + { 0x1C25, "sidearm" }, + { 0x1C26, "weaponposdropping" }, + { 0x1C27, "neverlean" }, + { 0x1C28, "rpgplayerrepulsor" }, + { 0x1C29, "gunhand" }, + { 0x1C2A, "prevputguninhandtime" }, +// { 0x1C2B, "" }, + { 0x1C2C, "lastenemytime" }, +// { 0x1C2D, "" }, + { 0x1C2E, "lookangle" }, +// { 0x1C2F, "" }, +// { 0x1C30, "" }, + { 0x1C31, "baseaccuracy" }, +// { 0x1C32, "" }, + { 0x1C33, "accuracystationarymod" }, + { 0x1C34, "sightpostime" }, +// { 0x1C35, "" }, +// { 0x1C36, "" }, + { 0x1C37, "script_forcegrenade" }, +// { 0x1C38, "" }, + { 0x1C39, "ammocheatinterval" }, + { 0x1C3A, "shouldconserveammotime" }, + { 0x1C3B, "monitorflash" }, + { 0x1C3C, "weapons_with_ir" }, + { 0x1C3D, "setnameandrank_andaddtosquad" }, + { 0x1C3E, "pollallowedstancesthread" }, + { 0x1C3F, "setupuniqueanims" }, +// { 0x1C40, "" }, + { 0x1C41, "infiniteloop" }, + { 0x1C42, "empty" }, +// { 0x1C43, "" }, + { 0x1C44, "lastplayersighted" }, +// { 0x1C45, "" }, + { 0x1C46, "window_down_height" }, + { 0x1C47, "firstinit" }, + { 0x1C48, "notfirsttime" }, + { 0x1C49, "invul" }, + { 0x1C4A, "nextgrenadedrop" }, +// { 0x1C4B, "" }, +// { 0x1C4C, "" }, +// { 0x1C4D, "" }, +// { 0x1C4E, "" }, + { 0x1C4F, "optionalstepeffectfunction" }, + { 0x1C50, "playfootstepeffectsmall" }, + { 0x1C51, "optionalstepeffectsmallfunction" }, + { 0x1C52, "playfootstepeffect" }, +// { 0x1C53, "" }, + { 0x1C54, "optionalstepeffectssmall" }, + { 0x1C55, "shootenemywrapper_shootnotify" }, + { 0x1C56, "shootenemywrapper_func" }, + { 0x1C57, "fire_straight" }, + { 0x1C58, "fire_notetrack_functions" }, + { 0x1C59, "shootnotetrack" }, + { 0x1C5A, "painai" }, + { 0x1C5B, "initposemovementfunctions" }, + { 0x1C5C, "burstfirenumshots" }, +// { 0x1C5D, "" }, +// { 0x1C5E, "" }, +// { 0x1C5F, "" }, + { 0x1C60, "watchreloading" }, + { 0x1C61, "initdeveloperdvars" }, + { 0x1C62, "initbattlechatter" }, +// { 0x1C63, "" }, + { 0x1C64, "initgrenades" }, + { 0x1C65, "grenadetimers" }, +// { 0x1C66, "" }, + { 0x1C67, "lastgrenadelandednearplayertime" }, + { 0x1C68, "lastfraggrenadetoplayerstart" }, + { 0x1C69, "initgrenadethrowanims" }, +// { 0x1C6A, "" }, +// { 0x1C6B, "" }, +// { 0x1C6C, "" }, + { 0x1C6D, "lastadvancetoenemysrc" }, + { 0x1C6E, "lastadvancetoenemyattacker" }, +// { 0x1C6F, "" }, + { 0x1C70, "advancetoenemyinterval" }, + { 0x1C71, "advancetoenemygroupmax" }, + { 0x1C72, "aiturnnotifies" }, + { 0x1C73, "setnextplayergrenadetime" }, +// { 0x1C74, "" }, +// { 0x1C75, "" }, +// { 0x1C76, "" }, +// { 0x1C77, "" }, + { 0x1C78, "randominttablesize" }, + { 0x1C79, "randominttable" }, + { 0x1C7A, "ondeath" }, +// { 0x1C7B, "" }, + { 0x1C7C, "usingturret" }, +// { 0x1C7D, "" }, + { 0x1C7E, "disable_achievement_harder_they_fall_guy" }, +// { 0x1C7F, "" }, +// { 0x1C80, "" }, +// { 0x1C81, "" }, + { 0x1C82, "ffpoints" }, +// { 0x1C83, "" }, + { 0x1C84, "smoke_thrown" }, + { 0x1C85, "deathflags" }, + { 0x1C86, "spawner_number" }, + { 0x1C87, "go_to_node_arrays" }, +// { 0x1C88, "" }, + { 0x1C89, "team_specific_spawn_functions" }, + { 0x1C8A, "next_health_drop_time" }, + { 0x1C8B, "guys_to_die_before_next_health_drop" }, +// { 0x1C8C, "" }, +// { 0x1C8D, "" }, + { 0x1C8E, "mg42_hide_distance" }, + { 0x1C8F, "maxfriendlies" }, + { 0x1C90, "_max_script_health" }, + { 0x1C91, "ai_classname_in_level" }, + { 0x1C92, "ai_classname_in_level_keys" }, +// { 0x1C93, "" }, +// { 0x1C94, "" }, + { 0x1C95, "process_deathflags" }, + { 0x1C96, "spawn_guys_until_death_or_no_count" }, + { 0x1C97, "ai_deathflag" }, +// { 0x1C98, "" }, + { 0x1C99, "script_deathflag_longdeath" }, +// { 0x1C9A, "" }, + { 0x1C9B, "spawner_deathflag" }, +// { 0x1C9C, "" }, + { 0x1C9D, "update_deathflag" }, +// { 0x1C9E, "" }, + { 0x1C9F, "doautospawn" }, + { 0x1CA0, "triggerunlocked" }, + { 0x1CA1, "vehicle_spawn" }, + { 0x1CA2, "spawn_pool_enabled" }, + { 0x1CA3, "trigger_pool_spawners" }, + { 0x1CA4, "deletestructarray_ref" }, +// { 0x1CA5, "" }, +// { 0x1CA6, "" }, + { 0x1CA7, "get_spawner_from_pool" }, + { 0x1CA8, "spawner_pool" }, + { 0x1CA9, "poolindex" }, + { 0x1CAA, "pool" }, + { 0x1CAB, "spawn_pool_copy_function" }, + { 0x1CAC, "create_new_spawner_pool" }, + { 0x1CAD, "trigger_spawner_spawns_guys" }, +// { 0x1CAE, "" }, + { 0x1CAF, "dronespawn" }, +// { 0x1CB0, "" }, + { 0x1CB1, "script_forcespawn" }, + { 0x1CB2, "script_combatbehavior" }, + { 0x1CB3, "enable_heat_behavior" }, +// { 0x1CB4, "" }, +// { 0x1CB5, "" }, + { 0x1CB6, "trigger_reinforcement_get_reinforcement_spawner" }, +// { 0x1CB7, "" }, + { 0x1CB8, "reincrement_count_if_deleted" }, + { 0x1CB9, "script_force_count" }, + { 0x1CBA, "delete_start" }, + { 0x1CBB, "script_start" }, +// { 0x1CBC, "" }, +// { 0x1CBD, "" }, +// { 0x1CBE, "" }, + { 0x1CBF, "set_count" }, + { 0x1CC0, "kill_spawnernum" }, + { 0x1CC1, "trigger_spawn" }, + { 0x1CC2, "spawn_grenade" }, + { 0x1CC3, "grenade_cache" }, + { 0x1CC4, "grenade_cache_index" }, + { 0x1CC5, "waittilldeathorpaindeath" }, +// { 0x1CC6, "" }, +// { 0x1CC7, "" }, +// { 0x1CC8, "" }, + { 0x1CC9, "spawn_prethink" }, + { 0x1CCA, "script_difficulty" }, + { 0x1CCB, "script_aigroup" }, + { 0x1CCC, "script_delete" }, + { 0x1CCD, "_ai_delete" }, + { 0x1CCE, "_ai_health" }, + { 0x1CCF, "spawn_functions" }, + { 0x1CD0, "spawnercallbackthread" }, + { 0x1CD1, "spawn_think" }, +// { 0x1CD2, "" }, + { 0x1CD3, "shouldnt_spawn_because_of_script_difficulty" }, +// { 0x1CD4, "" }, + { 0x1CD5, "specops_think" }, + { 0x1CD6, "multikill_monitor" }, + { 0x1CD7, "multikill_count" }, + { 0x1CD8, "specops_dmg" }, +// { 0x1CD9, "" }, + { 0x1CDA, "deathfunctions" }, + { 0x1CDB, "deathfuncs" }, + { 0x1CDC, "ai_damage_think" }, + { 0x1CDD, "damage_functions" }, + { 0x1CDE, "living_ai_prethink" }, +// { 0x1CDF, "" }, +// { 0x1CE0, "" }, + { 0x1CE1, "script_followmin" }, + { 0x1CE2, "script_followmax" }, +// { 0x1CE3, "" }, + { 0x1CE4, "auto_adjust_enemy_death_detection" }, + { 0x1CE5, "script_combatmode" }, + { 0x1CE6, "spawn_team_team3" }, + { 0x1CE7, "spawn_team_neutral" }, + { 0x1CE8, "subclass_elite" }, +// { 0x1CE9, "" }, +// { 0x1CEA, "" }, +// { 0x1CEB, "" }, +// { 0x1CEC, "" }, + { 0x1CED, "pain_resistance" }, +// { 0x1CEE, "" }, +// { 0x1CEF, "" }, +// { 0x1CF0, "" }, +// { 0x1CF1, "" }, + { 0x1CF2, "script_dontshootwhilemoving" }, + { 0x1CF3, "script_attackeraccuracy" }, + { 0x1CF4, "script_startrunning" }, +// { 0x1CF5, "" }, + { 0x1CF6, "script_nosurprise" }, + { 0x1CF7, "script_nobloodpool" }, +// { 0x1CF8, "" }, + { 0x1CF9, "script_danger_react" }, + { 0x1CFA, "enable_danger_react" }, + { 0x1CFB, "script_faceenemydist" }, +// { 0x1CFC, "" }, + { 0x1CFD, "script_fixednode" }, + { 0x1CFE, "script_threatbiasgroup" }, +// { 0x1CFF, "" }, +// { 0x1D00, "" }, +// { 0x1D01, "" }, + { 0x1D02, "script_ignoreall" }, + { 0x1D03, "script_sightrange" }, + { 0x1D04, "script_favoriteenemy" }, +// { 0x1D05, "" }, + { 0x1D06, "script_maxdist" }, + { 0x1D07, "script_longdeath" }, +// { 0x1D08, "" }, +// { 0x1D09, "" }, + { 0x1D0A, "script_pacifist" }, +// { 0x1D0B, "" }, + { 0x1D0C, "script_nodrop" }, +// { 0x1D0D, "" }, + { 0x1D0E, "set_ai_number" }, +// { 0x1D0F, "" }, + { 0x1D10, "script_playerseek" }, +// { 0x1D11, "" }, +// { 0x1D12, "" }, +// { 0x1D13, "" }, +// { 0x1D14, "" }, + { 0x1D15, "script_readystand" }, +// { 0x1D16, "" }, +// { 0x1D17, "" }, + { 0x1D18, "used_an_mg42" }, +// { 0x1D19, "" }, +// { 0x1D1A, "" }, +// { 0x1D1B, "" }, + { 0x1D1C, "scrub_guy" }, + { 0x1D1D, "clear_force_color" }, +// { 0x1D1E, "" }, +// { 0x1D1F, "" }, + { 0x1D20, "flag_turret_for_use" }, + { 0x1D21, "flagged_for_use" }, + { 0x1D22, "set_goal_volume" }, +// { 0x1D23, "" }, + { 0x1D24, "go_to_origin" }, +// { 0x1D25, "" }, +// { 0x1D26, "" }, + { 0x1D27, "empty_arrived_func" }, + { 0x1D28, "get_least_used_from_array" }, +// { 0x1D29, "" }, +// { 0x1D2A, "" }, + { 0x1D2B, "go_to_node_set_goal_ent" }, + { 0x1D2C, "go_to_node_set_goal_pos" }, + { 0x1D2D, "go_to_node_set_goal_node" }, + { 0x1D2E, "targets_and_uses_turret" }, + { 0x1D2F, "remove_crawled" }, + { 0x1D30, "crawled" }, + { 0x1D31, "crawl_target_and_init_flags" }, +// { 0x1D32, "" }, +// { 0x1D33, "" }, + { 0x1D34, "script_goalheight" }, + { 0x1D35, "set_goal_from_settings" }, +// { 0x1D36, "" }, + { 0x1D37, "manualtarget" }, + { 0x1D38, "use_a_turret" }, + { 0x1D39, "script_autotarget" }, + { 0x1D3A, "script_manualtarget" }, + { 0x1D3B, "manual_target" }, + { 0x1D3C, "manual_think" }, +// { 0x1D3D, "" }, + { 0x1D3E, "mg42_firing" }, +// { 0x1D3F, "" }, +// { 0x1D40, "" }, + { 0x1D41, "fallback_ai_think_death" }, +// { 0x1D42, "" }, +// { 0x1D43, "" }, + { 0x1D44, "fallback_initiated" }, + { 0x1D45, "fallback_death" }, + { 0x1D46, "fallback_goal" }, + { 0x1D47, "fallback_ai" }, + { 0x1D48, "coverprint" }, + { 0x1D49, "newfallback_overmind" }, + { 0x1D4A, "spawner_fallbackers" }, +// { 0x1D4B, "" }, + { 0x1D4C, "fallback_text" }, + { 0x1D4D, "fallback_wait" }, +// { 0x1D4E, "" }, + { 0x1D4F, "fallback_coverprint" }, +// { 0x1D50, "" }, +// { 0x1D51, "" }, +// { 0x1D52, "" }, + { 0x1D53, "delete_me" }, + { 0x1D54, "vlength" }, + { 0x1D55, "specialcheck" }, +// { 0x1D56, "" }, + { 0x1D57, "friendly_wave_trigger" }, + { 0x1D58, "set_spawncount" }, + { 0x1D59, "friendlydeath_thread" }, + { 0x1D5A, "totalfriends" }, +// { 0x1D5B, "" }, + { 0x1D5C, "combatbehavior" }, + { 0x1D5D, "friendlywave_thread" }, + { 0x1D5E, "script_usemg42" }, + { 0x1D5F, "turret_use_time" }, + { 0x1D60, "friendly_mg42_death_notify" }, + { 0x1D61, "friendly_mg42_wait_for_use" }, +// { 0x1D62, "" }, +// { 0x1D63, "" }, +// { 0x1D64, "" }, + { 0x1D65, "friendly_mg42" }, + { 0x1D66, "nofour" }, +// { 0x1D67, "" }, +// { 0x1D68, "" }, +// { 0x1D69, "" }, + { 0x1D6A, "friendly_mg42_doneusingturret" }, +// { 0x1D6B, "" }, + { 0x1D6C, "notanksquish" }, + { 0x1D6D, "levelhasvehicles" }, + { 0x1D6E, "tanksquish_damage_check" }, +// { 0x1D6F, "" }, +// { 0x1D70, "" }, +// { 0x1D71, "" }, +// { 0x1D72, "" }, +// { 0x1D73, "" }, + { 0x1D74, "panzer_ent_offset" }, + { 0x1D75, "panzer_pos" }, + { 0x1D76, "showstart" }, + { 0x1D77, "spawnwaypointfriendlies" }, +// { 0x1D78, "" }, + { 0x1D79, "waittilldeathorleavesquad" }, + { 0x1D7A, "spawnerwave" }, + { 0x1D7B, "issquad" }, + { 0x1D7C, "script_randomspawn" }, +// { 0x1D7D, "" }, +// { 0x1D7E, "" }, +// { 0x1D7F, "" }, + { 0x1D80, "securestarted" }, + { 0x1D81, "ai" }, + { 0x1D82, "flood_and_secure_spawner_think" }, +// { 0x1D83, "" }, + { 0x1D84, "addtowavespawner" }, +// { 0x1D85, "" }, + { 0x1D86, "addedtowave" }, +// { 0x1D87, "" }, +// { 0x1D88, "" }, + { 0x1D89, "playerwasnearby" }, + { 0x1D8A, "waittillrestartordistance" }, + { 0x1D8B, "flood_and_secure_spawn" }, + { 0x1D8C, "flood_and_secure_spawn_goal" }, + { 0x1D8D, "fightdist" }, + { 0x1D8E, "script_noteworthy2" }, +// { 0x1D8F, "" }, + { 0x1D90, "whisper" }, + { 0x1D91, "friendlychain" }, + { 0x1D92, "lastfriendlytrigger" }, + { 0x1D93, "script_baseoffire" }, + { 0x1D94, "objectiveisallowed" }, +// { 0x1D95, "" }, + { 0x1D96, "active_objective" }, +// { 0x1D97, "" }, + { 0x1D98, "inactive_objective" }, +// { 0x1D99, "" }, +// { 0x1D9A, "" }, + { 0x1D9B, "deathchainainotify" }, + { 0x1D9C, "deathchainspawnerlogic" }, + { 0x1D9D, "friendlychain_ondeaththink" }, + { 0x1D9E, "setnewplayerchain" }, + { 0x1D9F, "set_friendly_chain_wrapper" }, + { 0x1DA0, "friendlyspawnorg" }, + { 0x1DA1, "friendlyspawntrigger" }, +// { 0x1DA2, "" }, + { 0x1DA3, "getfriendlyspawnstart" }, + { 0x1DA4, "activefriendlyspawn" }, + { 0x1DA5, "getfriendlyspawntrigger" }, +// { 0x1DA6, "" }, +// { 0x1DA7, "" }, +// { 0x1DA8, "" }, + { 0x1DA9, "friendlyspawnwave_triggerthink" }, + { 0x1DAA, "deathchain_goalvolume" }, + { 0x1DAB, "debugprint" }, + { 0x1DAC, "aigroup_create" }, + { 0x1DAD, "aicount" }, +// { 0x1DAE, "" }, + { 0x1DAF, "spawners" }, + { 0x1DB0, "aigroup_spawnerthink" }, + { 0x1DB1, "decremented" }, +// { 0x1DB2, "" }, +// { 0x1DB3, "" }, + { 0x1DB4, "aigroup_soldierthink" }, + { 0x1DB5, "claimed" }, + { 0x1DB6, "script_spawn_here" }, + { 0x1DB7, "camper_guy" }, + { 0x1DB8, "move_when_enemy_hides" }, + { 0x1DB9, "claimed_node" }, + { 0x1DBA, "claim_a_node" }, + { 0x1DBB, "find_unclaimed_node" }, + { 0x1DBC, "flood_spawner_init" }, + { 0x1DBD, "trigger_requires_player" }, +// { 0x1DBE, "" }, +// { 0x1DBF, "" }, +// { 0x1DC0, "" }, + { 0x1DC1, "player_saw_kill" }, +// { 0x1DC2, "" }, + { 0x1DC3, "pyramid_death_report" }, + { 0x1DC4, "spawn" }, + { 0x1DC5, "pyramid_spawn" }, + { 0x1DC6, "pyramid_spawner_reports_death" }, + { 0x1DC7, "expand_goalradius" }, + { 0x1DC8, "drop_health_timeout_thread" }, +// { 0x1DC9, "" }, +// { 0x1DCA, "" }, + { 0x1DCB, "traceshow" }, + { 0x1DCC, "show_bad_path" }, +// { 0x1DCD, "" }, +// { 0x1DCE, "" }, + { 0x1DCF, "is_the_player" }, +// { 0x1DD0, "" }, + { 0x1DD1, "drone_delete_on_unload" }, + { 0x1DD2, "spawner_makerealai" }, + { 0x1DD3, "vehicle_idling" }, +// { 0x1DD4, "" }, +// { 0x1DD5, "" }, +// { 0x1DD6, "" }, +// { 0x1DD7, "" }, +// { 0x1DD8, "" }, + { 0x1DD9, "achieve_engineer_turret" }, +// { 0x1DDA, "" }, +// { 0x1DDB, "" }, + { 0x1DDC, "achieve_key_master_shotgun" }, + { 0x1DDD, "achieve_some_like_hot_thermal" }, + { 0x1DDE, "achieve_2_birds_1_stone" }, + { 0x1DDF, "achieve_driveby" }, +// { 0x1DE0, "" }, + { 0x1DE1, "rappeller" }, + { 0x1DE2, "achieve_riotshield_melee" }, +// { 0x1DE3, "" }, +// { 0x1DE4, "" }, + { 0x1DE5, "breaching_shots_fired" }, +// { 0x1DE6, "" }, + { 0x1DE7, "achieve_akimbo" }, +// { 0x1DE8, "" }, + { 0x1DE9, "achieve_threesome" }, + { 0x1DEA, "add_random_killspawner_to_spawngroup" }, +// { 0x1DEB, "" }, +// { 0x1DEC, "" }, +// { 0x1DED, "" }, +// { 0x1DEE, "" }, +// { 0x1DEF, "" }, + { 0x1DF0, "init_mgturretsettings" }, +// { 0x1DF1, "" }, + { 0x1DF2, "magic_distance" }, +// { 0x1DF3, "" }, +// { 0x1DF4, "" }, + { 0x1DF5, "mg42_trigger" }, + { 0x1DF6, "script_mg42auto" }, + { 0x1DF7, "ai_mode" }, +// { 0x1DF8, "" }, + { 0x1DF9, "burst_fire_settings" }, +// { 0x1DFA, "" }, +// { 0x1DFB, "" }, +// { 0x1DFC, "" }, +// { 0x1DFD, "" }, +// { 0x1DFE, "" }, +// { 0x1DFF, "" }, +// { 0x1E00, "" }, + { 0x1E01, "shell_sound_enabled" }, + { 0x1E02, "turret_shell_sound" }, + { 0x1E03, "drop_to_ground" }, + { 0x1E04, "turrettimer" }, + { 0x1E05, "random_spread" }, +// { 0x1E06, "" }, + { 0x1E07, "_spawner_mg42_think" }, + { 0x1E08, "script_mg42" }, + { 0x1E09, "mg42_enabled" }, +// { 0x1E0A, "" }, + { 0x1E0B, "mg42_think" }, + { 0x1E0C, "kill_objects" }, + { 0x1E0D, "mg42_gunner_think" }, + { 0x1E0E, "player_safe" }, + { 0x1E0F, "player_covertrigger" }, + { 0x1E10, "player_covertype" }, +// { 0x1E11, "" }, + { 0x1E12, "mg42_gunner_manual_think" }, +// { 0x1E13, "" }, + { 0x1E14, "target_entity" }, +// { 0x1E15, "" }, +// { 0x1E16, "" }, +// { 0x1E17, "" }, + { 0x1E18, "move_use_turret" }, + { 0x1E19, "temp_think" }, +// { 0x1E1A, "" }, +// { 0x1E1B, "" }, + { 0x1E1C, "script_turret_reuse_min" }, + { 0x1E1D, "script_turret_reuse_max" }, + { 0x1E1E, "turret_find_user" }, + { 0x1E1F, "getdifficulty" }, + { 0x1E20, "script_skilloverride" }, +// { 0x1E21, "" }, + { 0x1E22, "suppressiontime" }, +// { 0x1E23, "" }, +// { 0x1E24, "" }, + { 0x1E25, "mg42_target_drones" }, + { 0x1E26, "dronefailed" }, + { 0x1E27, "script_fireondrones" }, + { 0x1E28, "drones_targets_sets_to_default" }, + { 0x1E29, "defaultonmode" }, + { 0x1E2A, "oldconvergencetime" }, +// { 0x1E2B, "" }, + { 0x1E2C, "anim_wait_func" }, + { 0x1E2D, "drone_target" }, + { 0x1E2E, "structarray_shuffle" }, + { 0x1E2F, "get_bestdrone" }, + { 0x1E30, "prefers_drones" }, +// { 0x1E31, "" }, + { 0x1E32, "script_dont_link_turret" }, +// { 0x1E33, "" }, + { 0x1E34, "shared_turrets" }, +// { 0x1E35, "" }, + { 0x1E36, "script_turret_ambush" }, +// { 0x1E37, "" }, + { 0x1E38, "dropturretproc" }, + { 0x1E39, "turretmodel" }, + { 0x1E3A, "turretdeathdetacher" }, +// { 0x1E3B, "" }, +// { 0x1E3C, "" }, +// { 0x1E3D, "" }, + { 0x1E3E, "move_target_pos_to_new_turrets_visibility" }, + { 0x1E3F, "record_bread_crumbs_for_ambush" }, + { 0x1E40, "bread_crumbs" }, + { 0x1E41, "aim_turret_at_ambush_point_or_visible_enemy" }, + { 0x1E42, "find_a_new_turret_spot" }, + { 0x1E43, "snap_lock_turret_onto_target" }, +// { 0x1E44, "" }, + { 0x1E45, "pickup_gun" }, + { 0x1E46, "get_turret_setup_anim" }, + { 0x1E47, "run_to_new_spot_and_setup_gun" }, + { 0x1E48, "mg42" }, + { 0x1E49, "move_to_run_pos" }, + { 0x1E4A, "runpos" }, +// { 0x1E4B, "" }, +// { 0x1E4C, "" }, +// { 0x1E4D, "" }, +// { 0x1E4E, "" }, +// { 0x1E4F, "" }, +// { 0x1E50, "" }, + { 0x1E51, "find_connected_turrets" }, + { 0x1E52, "find_good_ambush_spot" }, + { 0x1E53, "find_different_way_to_attack_last_seen_position" }, + { 0x1E54, "portable_mg_spot" }, +// { 0x1E55, "" }, + { 0x1E56, "solid" }, + { 0x1E57, "show_turret" }, +// { 0x1E58, "" }, +// { 0x1E59, "" }, +// { 0x1E5A, "" }, + { 0x1E5B, "waittill_turret_is_released" }, +// { 0x1E5C, "" }, +// { 0x1E5D, "" }, + { 0x1E5E, "baseignorerandombulletdamage" }, +// { 0x1E5F, "" }, +// { 0x1E60, "" }, +// { 0x1E61, "" }, +// { 0x1E62, "" }, + { 0x1E63, "difficultysettings_frac_data_points" }, +// { 0x1E64, "" }, + { 0x1E65, "mg42badplace_maxtime" }, + { 0x1E66, "difficultysettings" }, + { 0x1E67, "custom_gameskill_func" }, +// { 0x1E68, "" }, + { 0x1E69, "screeneffect" }, +// { 0x1E6A, "" }, +// { 0x1E6B, "" }, + { 0x1E6C, "updatealldifficulty" }, + { 0x1E6D, "dog_health" }, + { 0x1E6E, "explosiveplanttime" }, + { 0x1E6F, "min_sniper_burst_delay_time" }, + { 0x1E70, "max_sniper_burst_delay_time" }, + { 0x1E71, "updategameskill" }, + { 0x1E72, "gameskill_change_monitor" }, +// { 0x1E73, "" }, + { 0x1E74, "aa_should_start_fresh" }, +// { 0x1E75, "" }, + { 0x1E76, "invultime_preshield" }, + { 0x1E77, "invultime_onshield" }, + { 0x1E78, "invultime_postshield" }, + { 0x1E79, "playerhealth_regularregendelay" }, + { 0x1E7A, "worthydamageratio" }, + { 0x1E7B, "longregentime" }, +// { 0x1E7C, "" }, + { 0x1E7D, "regenrate" }, + { 0x1E7E, "player_attacker_accuracy" }, + { 0x1E7F, "playergrenadebasetime" }, +// { 0x1E80, "" }, + { 0x1E81, "update_player_attacker_accuracy" }, + { 0x1E82, "apply_difficulty_step_with_func" }, + { 0x1E83, "misstimeconstant" }, + { 0x1E84, "misstimedistancefactor" }, + { 0x1E85, "dog_hits_before_kill" }, + { 0x1E86, "double_grenades_allowed" }, + { 0x1E87, "set_difficulty_from_locked_settings" }, +// { 0x1E88, "" }, +// { 0x1E89, "" }, + { 0x1E8A, "get_blended_difficulty" }, + { 0x1E8B, "getcurrentdifficultysetting" }, +// { 0x1E8C, "" }, + { 0x1E8D, "get_locked_difficulty_val_player" }, + { 0x1E8E, "get_locked_difficulty_val_global" }, +// { 0x1E8F, "" }, + { 0x1E90, "pain_protection" }, + { 0x1E91, "pain_protection_check" }, +// { 0x1E92, "" }, + { 0x1E93, "ramboaccuracymult" }, + { 0x1E94, "setsniperaccuracy" }, + { 0x1E95, "lastmissedenemy" }, +// { 0x1E96, "" }, + { 0x1E97, "neverforcesnipermissenemy" }, +// { 0x1E98, "" }, +// { 0x1E99, "" }, + { 0x1E9A, "waittimeifplayerishit" }, +// { 0x1E9B, "" }, + { 0x1E9C, "resetmissdebouncetime" }, + { 0x1E9D, "setmisstime" }, + { 0x1E9E, "accuracygrowthmultiplier" }, +// { 0x1E9F, "" }, +// { 0x1EA0, "" }, + { 0x1EA1, "screen_effect_on_open_side" }, +// { 0x1EA2, "" }, + { 0x1EA3, "screen_detailed_alpha" }, +// { 0x1EA4, "" }, + { 0x1EA5, "blood_splat_on_screen" }, + { 0x1EA6, "display_screen_effect" }, + { 0x1EA7, "playerhurtcheck" }, + { 0x1EA8, "dirt_on_screen_from_position" }, + { 0x1EA9, "bloodsplateffect" }, + { 0x1EAA, "hurtagain" }, + { 0x1EAB, "damagepoint" }, +// { 0x1EAC, "" }, + { 0x1EAD, "mods_override" }, + { 0x1EAE, "player_health_packets" }, + { 0x1EAF, "text" }, +// { 0x1EB0, "" }, + { 0x1EB1, "reducetakecoverwarnings" }, +// { 0x1EB2, "" }, + { 0x1EB3, "noplayerinvul" }, +// { 0x1EB4, "" }, +// { 0x1EB5, "" }, +// { 0x1EB6, "" }, +// { 0x1EB7, "" }, +// { 0x1EB8, "" }, + { 0x1EB9, "background" }, + { 0x1EBA, "create_warning_elem" }, +// { 0x1EBB, "" }, +// { 0x1EBC, "" }, + { 0x1EBD, "destroy_warning_elem_when_mission_failed" }, +// { 0x1EBE, "" }, +// { 0x1EBF, "" }, + { 0x1EC0, "may_change_cover_warning_alpha" }, + { 0x1EC1, "fontscaler" }, +// { 0x1EC2, "" }, + { 0x1EC3, "take_cover_warnings_enabled" }, + { 0x1EC4, "cover_warnings_disabled" }, +// { 0x1EC5, "" }, +// { 0x1EC6, "" }, +// { 0x1EC7, "" }, + { 0x1EC8, "healthoverlay_remove" }, + { 0x1EC9, "init_take_cover_warnings" }, + { 0x1ECA, "increment_take_cover_warnings_on_death" }, + { 0x1ECB, "auto_adjust_difficulty_player_positioner" }, +// { 0x1ECC, "" }, + { 0x1ECD, "autospot_is_close_to_player" }, + { 0x1ECE, "auto_adjust_difficulty_player_movement_check" }, + { 0x1ECF, "movedrecently" }, + { 0x1ED0, "auto_adjust_difficulty_track_player_death" }, + { 0x1ED1, "auto_adjust_difficulty_track_player_shots" }, + { 0x1ED2, "timebetweenshots" }, + { 0x1ED3, "hud_debug_add_frac" }, + { 0x1ED4, "hud_debug_add" }, +// { 0x1ED5, "" }, + { 0x1ED6, "hudnum" }, + { 0x1ED7, "huddebugnum" }, + { 0x1ED8, "hud_debug_add_message" }, + { 0x1ED9, "hudmsgshare" }, + { 0x1EDA, "debugleft" }, +// { 0x1EDB, "" }, + { 0x1EDC, "hud_debug_add_display" }, + { 0x1EDD, "hud_debug_add_string" }, + { 0x1EDE, "hud_debug_add_num" }, + { 0x1EDF, "hud_debug_add_second_string" }, + { 0x1EE0, "auto_adjust_results" }, + { 0x1EE1, "command_used" }, +// { 0x1EE2, "" }, +// { 0x1EE3, "" }, + { 0x1EE4, "player_ads_time" }, + { 0x1EE5, "aa_player_health_tracking" }, +// { 0x1EE6, "" }, +// { 0x1EE7, "" }, +// { 0x1EE8, "" }, + { 0x1EE9, "aa_update_flags" }, + { 0x1EEA, "aa_add_event" }, + { 0x1EEB, "aa_add_event_float" }, + { 0x1EEC, "return_false" }, + { 0x1EED, "player_attacker" }, + { 0x1EEE, "player_did_most_damage" }, + { 0x1EEF, "empty_kill_func" }, +// { 0x1EF0, "" }, +// { 0x1EF1, "" }, + { 0x1EF2, "bullet_attack" }, +// { 0x1EF3, "" }, + { 0x1EF4, "coop_with_one_player_downed" }, + { 0x1EF5, "gettargetangleoffset" }, + { 0x1EF6, "getsniperburstdelaytime" }, +// { 0x1EF7, "" }, + { 0x1EF8, "getburstdelaytime" }, + { 0x1EF9, "burstdelay" }, + { 0x1EFA, "aimbutdontshoot" }, +// { 0x1EFB, "" }, + { 0x1EFC, "decidenumshotsforburst" }, +// { 0x1EFD, "" }, +// { 0x1EFE, "" }, +// { 0x1EFF, "" }, + { 0x1F00, "fireuntiloutofammo" }, + { 0x1F01, "shootrateoverride" }, +// { 0x1F02, "" }, + { 0x1F03, "fireuntiloutofammointernal" }, + { 0x1F04, "notifyonanimend" }, + { 0x1F05, "shootatshootentorpos" }, + { 0x1F06, "shootposwrapper" }, + { 0x1F07, "showrocket" }, + { 0x1F08, "decrementbulletsinclip" }, + { 0x1F09, "shotgunpumpsound" }, + { 0x1F0A, "stopshotgunpumpaftertime" }, + { 0x1F0B, "rechamber" }, +// { 0x1F0C, "" }, + { 0x1F0D, "addgrenadethrowanimoffset" }, + { 0x1F0E, "grenadethrowanims" }, + { 0x1F0F, "grenadethrowoffsets" }, + { 0x1F10, "throwgrenadeatplayerasap_combat_utility" }, + { 0x1F11, "activegrenadetimer" }, + { 0x1F12, "isplayertimer" }, + { 0x1F13, "timername" }, + { 0x1F14, "usingplayergrenadetimer" }, +// { 0x1F15, "" }, + { 0x1F16, "getdesiredgrenadetimervalue" }, +// { 0x1F17, "" }, +// { 0x1F18, "" }, +// { 0x1F19, "" }, +// { 0x1F1A, "" }, + { 0x1F1B, "trygrenadeposproc" }, + { 0x1F1C, "ignoregrenadesafetime" }, + { 0x1F1D, "oldgrenawareness" }, +// { 0x1F1E, "" }, + { 0x1F1F, "dogrenadethrow" }, + { 0x1F20, "donotetracksforever" }, + { 0x1F21, "getgrenademodel" }, + { 0x1F22, "isholdinggrenade" }, +// { 0x1F23, "" }, +// { 0x1F24, "" }, + { 0x1F25, "grenadelandednearplayer" }, +// { 0x1F26, "" }, +// { 0x1F27, "" }, +// { 0x1F28, "" }, + { 0x1F29, "detachgrenadeonscriptchange" }, + { 0x1F2A, "offsettoorigin" }, + { 0x1F2B, "grenadeline" }, +// { 0x1F2C, "" }, +// { 0x1F2D, "" }, + { 0x1F2E, "usecovernodeifpossible" }, + { 0x1F2F, "checkadvanceonenemyconditions" }, +// { 0x1F30, "" }, +// { 0x1F31, "" }, + { 0x1F32, "getgunyawtoshootentorpos" }, +// { 0x1F33, "" }, + { 0x1F34, "getpitchtoenemy" }, + { 0x1F35, "getpitchtospot" }, +// { 0x1F36, "" }, + { 0x1F37, "waittillreloadfinished" }, +// { 0x1F38, "" }, + { 0x1F39, "checkgrenadethrowdist" }, + { 0x1F3A, "neverstopmonitoringflash" }, + { 0x1F3B, "script_immunetoflash" }, + { 0x1F3C, "flashingteam" }, +// { 0x1F3D, "" }, +// { 0x1F3E, "" }, + { 0x1F3F, "islongrangeai" }, +// { 0x1F40, "" }, +// { 0x1F41, "" }, +// { 0x1F42, "" }, + { 0x1F43, "detachallweaponmodels" }, +// { 0x1F44, "" }, + { 0x1F45, "shieldbroken" }, +// { 0x1F46, "" }, + { 0x1F47, "custom_laser_function" }, + { 0x1F48, "canuselaser" }, +// { 0x1F49, "" }, + { 0x1F4A, "dropaiweapon" }, + { 0x1F4B, "dropweaponwrapper" }, +// { 0x1F4C, "" }, +// { 0x1F4D, "" }, + { 0x1F4E, "getpitchtoshootentorpos" }, + { 0x1F4F, "usemuzzlesideoffset" }, + { 0x1F50, "getaimyawtopoint" }, + { 0x1F51, "ramboaiminternal" }, + { 0x1F52, "insure_dropping_clip" }, + { 0x1F53, "handledropclip" }, + { 0x1F54, "resetcliponabort" }, + { 0x1F55, "dropclipmodel" }, + { 0x1F56, "returntrue" }, + { 0x1F57, "createrpgrepulsors" }, + { 0x1F58, "rpgplayerrepulsor_getnummisses" }, + { 0x1F59, "rpgplayerrepulsor_create" }, + { 0x1F5A, "handledogsoundnotetracks" }, +// { 0x1F5B, "" }, + { 0x1F5C, "growling" }, + { 0x1F5D, "script_growl" }, + { 0x1F5E, "notetrackfire" }, +// { 0x1F5F, "" }, + { 0x1F60, "notetrackstopanim" }, + { 0x1F61, "unlinknextframe" }, + { 0x1F62, "notetrackstartragdoll" }, +// { 0x1F63, "" }, + { 0x1F64, "notetrackmovementstop" }, +// { 0x1F65, "" }, + { 0x1F66, "notetrackmovementrun" }, + { 0x1F67, "notetrackalertnessaiming" }, + { 0x1F68, "notetrackalertnesscasual" }, +// { 0x1F69, "" }, + { 0x1F6A, "setpose" }, +// { 0x1F6B, "" }, + { 0x1F6C, "notetrackposecrouch" }, + { 0x1F6D, "notetrackposeprone" }, +// { 0x1F6E, "" }, + { 0x1F6F, "notetrackgunhand" }, +// { 0x1F70, "" }, + { 0x1F71, "notetrackguntochest" }, + { 0x1F72, "notetrackguntoback" }, + { 0x1F73, "getpreferredweapon" }, + { 0x1F74, "notetrackpistolpickup" }, +// { 0x1F75, "" }, + { 0x1F76, "notetrackdropclip" }, + { 0x1F77, "notetrackrefillclip" }, + { 0x1F78, "notetrackloadshell" }, +// { 0x1F79, "" }, + { 0x1F7A, "notetrackgravity" }, +// { 0x1F7B, "" }, + { 0x1F7C, "get_notetrack_movement" }, + { 0x1F7D, "customnotetrackfx" }, + { 0x1F7E, "sound_prefix" }, + { 0x1F7F, "sound_suffix" }, + { 0x1F80, "notetrackfootscrape" }, +// { 0x1F81, "" }, + { 0x1F82, "notetrackcodemove" }, +// { 0x1F83, "" }, + { 0x1F84, "notetrackbodyfall" }, +// { 0x1F85, "" }, + { 0x1F86, "donotetracksfortimeout" }, +// { 0x1F87, "" }, + { 0x1F88, "donotetracksforeverproc" }, +// { 0x1F89, "" }, + { 0x1F8A, "donotetracksfortimeendnotify" }, +// { 0x1F8B, "" }, + { 0x1F8C, "lastgroundtype" }, + { 0x1F8D, "dontshootstraight" }, +// { 0x1F8E, "" }, +// { 0x1F8F, "" }, + { 0x1F90, "setposemovementfnarray" }, + { 0x1F91, "beginstandstop" }, +// { 0x1F92, "" }, +// { 0x1F93, "" }, +// { 0x1F94, "" }, +// { 0x1F95, "" }, + { 0x1F96, "standwalktostand" }, +// { 0x1F97, "" }, +// { 0x1F98, "" }, +// { 0x1F99, "" }, + { 0x1F9A, "playblendtransitionstandrun" }, +// { 0x1F9B, "" }, + { 0x1F9C, "blendintostandwalk" }, + { 0x1F9D, "alwaysrunforward" }, + { 0x1F9E, "crouchtostand" }, + { 0x1F9F, "faststand" }, + { 0x1FA0, "crouchtocrouchwalk" }, +// { 0x1FA1, "" }, +// { 0x1FA2, "" }, + { 0x1FA3, "crouchwalktostand" }, + { 0x1FA4, "crouchruntocrouch" }, + { 0x1FA5, "crouchruntostand" }, +// { 0x1FA6, "" }, +// { 0x1FA7, "" }, + { 0x1FA8, "blendintocrouchrun" }, +// { 0x1FA9, "" }, +// { 0x1FAA, "" }, + { 0x1FAB, "pronetocrouchwalk" }, + { 0x1FAC, "blendintocrouchwalk" }, + { 0x1FAD, "standtocrouch" }, + { 0x1FAE, "fastcrouch" }, + { 0x1FAF, "pronetocrouch" }, + { 0x1FB0, "pronetostand" }, + { 0x1FB1, "pronetostandwalk" }, + { 0x1FB2, "pronetopronemove" }, +// { 0x1FB3, "" }, + { 0x1FB4, "pronecrawltoprone" }, +// { 0x1FB5, "" }, + { 0x1FB6, "crouchtopronewalk" }, +// { 0x1FB7, "" }, + { 0x1FB8, "standtoprone" }, + { 0x1FB9, "standtopronewalk" }, +// { 0x1FBA, "" }, + { 0x1FBB, "crouchruntoprone" }, + { 0x1FBC, "getquadrant" }, + { 0x1FBD, "crouchruntopronewalk" }, + { 0x1FBE, "crouchruntopronerun" }, + { 0x1FBF, "playtransitionanimationthread_withoutwaitsetstates" }, + { 0x1FC0, "playtransitionanimation" }, +// { 0x1FC1, "" }, +// { 0x1FC2, "" }, + { 0x1FC3, "pronelegsstraighttree" }, + { 0x1FC4, "corner_think" }, + { 0x1FC5, "animarrayfuncs" }, +// { 0x1FC6, "" }, +// { 0x1FC7, "" }, +// { 0x1FC8, "" }, +// { 0x1FC9, "" }, + { 0x1FCA, "havegonetocover" }, +// { 0x1FCB, "" }, +// { 0x1FCC, "" }, + { 0x1FCD, "shouldchangestanceforfun" }, + { 0x1FCE, "changestanceforfuntime" }, +// { 0x1FCF, "" }, + { 0x1FD0, "canseepointfromexposedatcorner" }, +// { 0x1FD1, "" }, + { 0x1FD2, "shootposoutsidelegalyawrange" }, +// { 0x1FD3, "" }, +// { 0x1FD4, "" }, +// { 0x1FD5, "" }, + { 0x1FD6, "changestepoutpos" }, +// { 0x1FD7, "" }, + { 0x1FD8, "shouldlean" }, + { 0x1FD9, "startaiming" }, +// { 0x1FDA, "" }, + { 0x1FDB, "stopaiming" }, + { 0x1FDC, "setaimingparams" }, + { 0x1FDD, "spot" }, + { 0x1FDE, "stepoutandhidespeed" }, + { 0x1FDF, "stepout" }, +// { 0x1FE0, "" }, +// { 0x1FE1, "" }, +// { 0x1FE2, "" }, + { 0x1FE3, "notifystopshootingaftertime" }, + { 0x1FE4, "shootuntilshootbehaviorchange_corner" }, + { 0x1FE5, "showstate" }, + { 0x1FE6, "canreturntocover" }, + { 0x1FE7, "returntocover" }, +// { 0x1FE8, "" }, + { 0x1FE9, "printyawtoenemy" }, +// { 0x1FEA, "" }, + { 0x1FEB, "nextpeekoutattempttime" }, + { 0x1FEC, "canstoppeeking" }, + { 0x1FED, "cornerreload" }, + { 0x1FEE, "ispathclear" }, +// { 0x1FEF, "" }, + { 0x1FF0, "set_anim_array" }, +// { 0x1FF1, "" }, +// { 0x1FF2, "" }, + { 0x1FF3, "gotocover" }, + { 0x1FF4, "getnodedirection" }, + { 0x1FF5, "getnodeorigin" }, + { 0x1FF6, "hideyawoffset" }, +// { 0x1FF7, "" }, + { 0x1FF8, "set_standing_animarray_aiming" }, + { 0x1FF9, "set_crouching_animarray_aiming" }, +// { 0x1FFA, "" }, + { 0x1FFB, "initanimtree" }, + { 0x1FFC, "missedsightchecks" }, + { 0x1FFD, "updateanimpose" }, + { 0x1FFE, "desired_anim_pose" }, +// { 0x1FFF, "" }, +// { 0x2000, "" }, +// { 0x2001, "" }, +// { 0x2002, "" }, +// { 0x2003, "" }, +// { 0x2004, "" }, + { 0x2005, "absyawtoenemy2d" }, + { 0x2006, "absyawtoorigin" }, + { 0x2007, "absyawtoangles" }, +// { 0x2008, "" }, + { 0x2009, "getyawtotag" }, +// { 0x200A, "" }, + { 0x200B, "isstanceallowedwrapper" }, + { 0x200C, "getnodetype" }, + { 0x200D, "getnodeforward" }, + { 0x200E, "isinset" }, + { 0x200F, "playanim" }, +// { 0x2010, "" }, + { 0x2011, "drawstring" }, +// { 0x2012, "" }, +// { 0x2013, "" }, + { 0x2014, "util_ignorecurrentsightpos" }, + { 0x2015, "ignoresightpos" }, + { 0x2016, "ignoreorigin" }, +// { 0x2017, "" }, + { 0x2018, "debugtimeout" }, + { 0x2019, "debugposinternal" }, + { 0x201A, "debugpos" }, + { 0x201B, "debugpossize" }, + { 0x201C, "debugburstprint" }, +// { 0x201D, "" }, +// { 0x201E, "" }, +// { 0x201F, "" }, + { 0x2020, "showdebugline" }, +// { 0x2021, "" }, +// { 0x2022, "" }, +// { 0x2023, "" }, + { 0x2024, "personalcoldbreathstop" }, +// { 0x2025, "" }, + { 0x2026, "forcesuppression" }, + { 0x2027, "calculatenodeoffset" }, + { 0x2028, "checkpitchvisibility" }, +// { 0x2029, "" }, + { 0x202A, "shouldresetgiveuponsuppressiontimer" }, + { 0x202B, "updategiveuponsuppressiontimer" }, + { 0x202C, "giveuponsuppressiontime" }, + { 0x202D, "showlines" }, +// { 0x202E, "" }, + { 0x202F, "hassuppressableenemy" }, + { 0x2030, "canseeandshootpoint" }, + { 0x2031, "needrecalculatesuppressspot" }, + { 0x2032, "lastenemysightposold" }, +// { 0x2033, "" }, +// { 0x2034, "" }, + { 0x2035, "print3dtime" }, +// { 0x2036, "" }, +// { 0x2037, "" }, + { 0x2038, "sawenemymove" }, + { 0x2039, "personalsighttime" }, +// { 0x203A, "" }, + { 0x203B, "usingboltactionweapon" }, + { 0x203C, "random_weight" }, + { 0x203D, "setfootstepeffect" }, + { 0x203E, "setfootstepeffectsmall" }, +// { 0x203F, "" }, +// { 0x2040, "" }, + { 0x2041, "enterpronewrapperproc" }, + { 0x2042, "exitpronewrapperproc" }, +// { 0x2043, "" }, + { 0x2044, "canhitsuppressspot" }, + { 0x2045, "getaisecondaryweapon" }, + { 0x2046, "getaisidearmweapon" }, + { 0x2047, "getaicurrentweapon" }, +// { 0x2048, "" }, + { 0x2049, "getaicurrentweaponslot" }, + { 0x204A, "aihasweapon" }, + { 0x204B, "usingpistol" }, + { 0x204C, "ragdolldeath" }, + { 0x204D, "atv_geton" }, +// { 0x204E, "" }, + { 0x204F, "atv_loop_driver" }, +// { 0x2050, "" }, +// { 0x2051, "" }, +// { 0x2052, "" }, +// { 0x2053, "" }, + { 0x2054, "atv_stop_shooting" }, + { 0x2055, "atv_decide_shoot" }, + { 0x2056, "atv_decide_shoot_internal" }, + { 0x2057, "atvshootbehavior" }, +// { 0x2058, "" }, + { 0x2059, "atv_reload" }, + { 0x205A, "atv_reload_internal" }, + { 0x205B, "atv_waitfor_start_aim" }, +// { 0x205C, "" }, + { 0x205D, "atv_waitfor_start_lean" }, + { 0x205E, "atv_trackshootentorpos_driver" }, +// { 0x205F, "" }, +// { 0x2060, "" }, + { 0x2061, "prevatvdeathtime" }, + { 0x2062, "atv_death_launchslide" }, + { 0x2063, "atv_normal_death" }, + { 0x2064, "atv_collide_death" }, +// { 0x2065, "" }, + { 0x2066, "atv_setanim_driver" }, +// { 0x2067, "" }, + { 0x2068, "vehicle_aianims" }, + { 0x2069, "attachedguys" }, + { 0x206A, "usedpositions" }, +// { 0x206B, "" }, + { 0x206C, "delayer" }, +// { 0x206D, "" }, + { 0x206E, "vehicle_idle" }, +// { 0x206F, "" }, + { 0x2070, "vehicle_standattack" }, + { 0x2071, "deathscript" }, +// { 0x2072, "" }, +// { 0x2073, "" }, +// { 0x2074, "" }, + { 0x2075, "sittag_offset" }, + { 0x2076, "bhasgunwhileriding" }, + { 0x2077, "gun_remove" }, +// { 0x2078, "" }, + { 0x2079, "getin_idle_func" }, +// { 0x207A, "" }, + { 0x207B, "script_allow_driver_death" }, + { 0x207C, "vehicle_allows_rider_death" }, + { 0x207D, "script_allow_rider_deaths" }, +// { 0x207E, "" }, +// { 0x207F, "" }, + { 0x2080, "script_nomg" }, +// { 0x2081, "" }, + { 0x2082, "runningtovehicle" }, + { 0x2083, "getinorgs" }, +// { 0x2084, "" }, + { 0x2085, "load_ai_goddriver" }, +// { 0x2086, "" }, + { 0x2087, "guy_deathimate_me" }, +// { 0x2088, "" }, +// { 0x2089, "" }, + { 0x208A, "is_rider" }, +// { 0x208B, "" }, +// { 0x208C, "" }, +// { 0x208D, "" }, + { 0x208E, "get_my_vehicleride" }, + { 0x208F, "get_in_vehicle" }, + { 0x2090, "handle_detached_guys_check" }, +// { 0x2091, "" }, +// { 0x2092, "" }, + { 0x2093, "forced_startingposition" }, + { 0x2094, "vehicle_loaded_if_full" }, + { 0x2095, "vehicle_reload" }, + { 0x2096, "vehicle_unload" }, + { 0x2097, "vehicle_load_ai" }, +// { 0x2098, "" }, + { 0x2099, "guy_runtovehicle" }, +// { 0x209A, "" }, +// { 0x209B, "" }, + { 0x209C, "get_in_moving_vehicle" }, + { 0x209D, "script_startingposition" }, + { 0x209E, "availablepositions" }, + { 0x209F, "nonanimatedpositions" }, + { 0x20A0, "set_forcegoal" }, + { 0x20A1, "disable_arrivals" }, + { 0x20A2, "enable_arrivals" }, + { 0x20A3, "unset_forcegoal" }, + { 0x20A4, "vehicle_getinanim" }, + { 0x20A5, "vehicle_getoutanim" }, +// { 0x20A6, "" }, + { 0x20A7, "vehicle_getinanim_clear" }, +// { 0x20A8, "" }, +// { 0x20A9, "" }, +// { 0x20AA, "" }, +// { 0x20AB, "" }, +// { 0x20AC, "" }, +// { 0x20AD, "" }, +// { 0x20AE, "" }, + { 0x20AF, "deaddriver" }, + { 0x20B0, "hasstarted" }, + { 0x20B1, "copy_cat" }, +// { 0x20B2, "" }, +// { 0x20B3, "" }, +// { 0x20B4, "" }, + { 0x20B5, "_linkto" }, + { 0x20B6, "anim_pos" }, +// { 0x20B7, "" }, +// { 0x20B8, "" }, + { 0x20B9, "vehicle_aianimthread" }, +// { 0x20BA, "" }, + { 0x20BB, "guy_handle" }, + { 0x20BC, "guy_stand_attack" }, + { 0x20BD, "standidle" }, +// { 0x20BE, "" }, + { 0x20BF, "standdown" }, +// { 0x20C0, "" }, +// { 0x20C1, "" }, +// { 0x20C2, "" }, +// { 0x20C3, "" }, +// { 0x20C4, "" }, + { 0x20C5, "guy_turret_turnleft" }, +// { 0x20C6, "" }, +// { 0x20C7, "" }, +// { 0x20C8, "" }, + { 0x20C9, "vehicle_turret_fire" }, +// { 0x20CA, "" }, +// { 0x20CB, "" }, + { 0x20CC, "hideidle" }, + { 0x20CD, "play_new_idle" }, + { 0x20CE, "vehicle_idle_override" }, +// { 0x20CF, "" }, + { 0x20D0, "playerpiggyback" }, +// { 0x20D1, "" }, + { 0x20D2, "randomoccurrance" }, +// { 0x20D3, "" }, + { 0x20D4, "duck_once" }, +// { 0x20D5, "" }, + { 0x20D6, "vehicle_duck_once" }, +// { 0x20D7, "" }, + { 0x20D8, "weave" }, + { 0x20D9, "guy_weave" }, +// { 0x20DA, "" }, + { 0x20DB, "guy_duck" }, +// { 0x20DC, "" }, +// { 0x20DD, "" }, + { 0x20DE, "duckidleoccurrence" }, +// { 0x20DF, "" }, + { 0x20E0, "guy_duck_out" }, +// { 0x20E1, "" }, +// { 0x20E2, "" }, + { 0x20E3, "guy_unload_que" }, + { 0x20E4, "unloadque" }, +// { 0x20E5, "" }, +// { 0x20E6, "" }, +// { 0x20E7, "" }, + { 0x20E8, "vehicle_unloadgroups" }, + { 0x20E9, "check_unloadgroup" }, + { 0x20EA, "getoutrig_model_idle" }, +// { 0x20EB, "" }, +// { 0x20EC, "" }, + { 0x20ED, "vehicle_attachedmodels" }, + { 0x20EE, "crashing" }, +// { 0x20EF, "" }, +// { 0x20F0, "" }, +// { 0x20F1, "" }, + { 0x20F2, "achievement_attacker" }, +// { 0x20F3, "" }, + { 0x20F4, "forcefallthroughonropes" }, + { 0x20F5, "setanimrestart_once" }, + { 0x20F6, "getout_rigspawn" }, +// { 0x20F7, "" }, + { 0x20F8, "fastroperiganimating" }, + { 0x20F9, "dropanim" }, + { 0x20FA, "check_sound_tag_dupe" }, + { 0x20FB, "sound_tag_dupe" }, +// { 0x20FC, "" }, +// { 0x20FD, "" }, +// { 0x20FE, "" }, + { 0x20FF, "gun_recall" }, + { 0x2100, "onrotatingvehicleturret" }, + { 0x2101, "vehicle_getoutanim_clear" }, + { 0x2102, "vehicle_getoutsoundtag" }, +// { 0x2103, "" }, +// { 0x2104, "" }, +// { 0x2105, "" }, +// { 0x2106, "" }, +// { 0x2107, "" }, +// { 0x2108, "" }, + { 0x2109, "script_keepdriver" }, + { 0x210A, "exittag" }, +// { 0x210B, "" }, +// { 0x210C, "" }, +// { 0x210D, "" }, + { 0x210E, "player_getout_sound" }, + { 0x210F, "getoutloopsnd" }, + { 0x2110, "play_loop_sound_on_tag" }, + { 0x2111, "player_getout_sound_loop" }, + { 0x2112, "rappel_kill_achievement" }, + { 0x2113, "enable_achievement_harder_they_fall" }, +// { 0x2114, "" }, + { 0x2115, "littlebirde_getout_unlinks" }, + { 0x2116, "getout_secondary" }, +// { 0x2117, "" }, + { 0x2118, "anim_end_early" }, + { 0x2119, "player_getout_sound_end" }, +// { 0x211A, "" }, +// { 0x211B, "" }, + { 0x211C, "getoutstance" }, + { 0x211D, "getout_delete" }, + { 0x211E, "guy_resets_goalpos" }, +// { 0x211F, "" }, +// { 0x2120, "" }, +// { 0x2121, "" }, + { 0x2122, "recover_interval" }, + { 0x2123, "animontag_ragdoll_death" }, +// { 0x2124, "" }, +// { 0x2125, "" }, +// { 0x2126, "" }, +// { 0x2127, "" }, +// { 0x2128, "" }, +// { 0x2129, "" }, + { 0x212A, "explosion_death" }, +// { 0x212B, "" }, +// { 0x212C, "" }, + { 0x212D, "vehicle_ai_event" }, +// { 0x212E, "" }, + { 0x212F, "turn_right" }, +// { 0x2130, "" }, + { 0x2131, "vehicle_turn_right" }, +// { 0x2132, "" }, + { 0x2133, "vehicle_turn_left" }, + { 0x2134, "turn_left" }, +// { 0x2135, "" }, +// { 0x2136, "" }, + { 0x2137, "idle_hardright" }, +// { 0x2138, "" }, + { 0x2139, "idle_hardleft" }, + { 0x213A, "ai_wait_go" }, + { 0x213B, "set_pos" }, +// { 0x213C, "" }, + { 0x213D, "passenger_2_turret_func" }, + { 0x213E, "set_turret_team" }, +// { 0x213F, "" }, +// { 0x2140, "" }, + { 0x2141, "explosion_death_offset" }, +// { 0x2142, "" }, +// { 0x2143, "" }, + { 0x2144, "vehicle_animate" }, + { 0x2145, "vehicle_getinstart" }, +// { 0x2146, "" }, + { 0x2147, "is_position_in_group" }, + { 0x2148, "get_availablepositions" }, + { 0x2149, "getanimatemodel" }, + { 0x214A, "detach_models_with_substr" }, + { 0x214B, "should_give_orghealth" }, + { 0x214C, "guy_pre_unload_check" }, + { 0x214D, "pre_unload" }, +// { 0x214E, "" }, + { 0x214F, "pre_unload_idle" }, + { 0x2150, "guy_idle_alert" }, + { 0x2151, "idle_alert" }, + { 0x2152, "guy_idle_alert_check" }, +// { 0x2153, "" }, + { 0x2154, "idle_alert_to_casual" }, + { 0x2155, "guy_idle_alert_to_casual_check" }, +// { 0x2156, "" }, +// { 0x2157, "" }, + { 0x2158, "animate_guys" }, + { 0x2159, "queued_anim_threads" }, +// { 0x215A, "" }, +// { 0x215B, "" }, +// { 0x215C, "" }, + { 0x215D, "set_custom_eog_summary" }, + { 0x215E, "set_eog_success_heading" }, + { 0x215F, "round_float" }, +// { 0x2160, "" }, +// { 0x2161, "" }, + { 0x2162, "set_nvg_vision" }, + { 0x2163, "sun_light_fade" }, + { 0x2164, "ent_flag_wait_vehicle_node" }, + { 0x2165, "ent_flag_wait_either" }, +// { 0x2166, "" }, +// { 0x2167, "" }, +// { 0x2168, "" }, +// { 0x2169, "" }, +// { 0x216A, "" }, + { 0x216B, "ent_flag_clear_delayed" }, +// { 0x216C, "" }, + { 0x216D, "get_closest_index_to_player_view" }, +// { 0x216E, "" }, + { 0x216F, "flag_triggers_init" }, + { 0x2170, "flag_set_delayed" }, +// { 0x2171, "" }, +// { 0x2172, "" }, +// { 0x2173, "" }, +// { 0x2174, "" }, + { 0x2175, "autosave_by_name_silent" }, + { 0x2176, "autosave_by_name_thread" }, +// { 0x2177, "" }, +// { 0x2178, "" }, + { 0x2179, "debug_message_ai" }, +// { 0x217A, "" }, +// { 0x217B, "" }, + { 0x217C, "script_chain" }, +// { 0x217D, "" }, + { 0x217E, "chain_on" }, + { 0x217F, "closerfunc" }, + { 0x2180, "fartherfunc" }, +// { 0x2181, "" }, + { 0x2182, "getclosestfx" }, +// { 0x2183, "" }, +// { 0x2184, "" }, + { 0x2185, "get_within_range" }, +// { 0x2186, "" }, + { 0x2187, "get_closest_living" }, +// { 0x2188, "" }, + { 0x2189, "get_closest_index" }, +// { 0x218A, "" }, +// { 0x218B, "" }, + { 0x218C, "can_see_origin" }, +// { 0x218D, "" }, +// { 0x218E, "" }, + { 0x218F, "disable_long_death" }, +// { 0x2190, "" }, +// { 0x2191, "" }, +// { 0x2192, "" }, + { 0x2193, "deletable_magic_bullet_shield" }, + { 0x2194, "set_ignoreall" }, +// { 0x2195, "" }, +// { 0x2196, "" }, +// { 0x2197, "" }, +// { 0x2198, "" }, +// { 0x2199, "" }, + { 0x219A, "hide_exploder_models" }, +// { 0x219B, "" }, +// { 0x219C, "" }, +// { 0x219D, "" }, +// { 0x219E, "" }, + { 0x219F, "force_crawling_death" }, +// { 0x21A0, "" }, + { 0x21A1, "custom_crawling_death_array" }, + { 0x21A2, "nofallanim" }, + { 0x21A3, "force_crawl_angle" }, +// { 0x21A4, "" }, + { 0x21A5, "get_friendly_chain_node" }, +// { 0x21A6, "" }, +// { 0x21A7, "" }, +// { 0x21A8, "" }, +// { 0x21A9, "" }, + { 0x21AA, "view_tag" }, +// { 0x21AB, "" }, +// { 0x21AC, "" }, + { 0x21AD, "trigger_wait" }, +// { 0x21AE, "" }, + { 0x21AF, "set_flag_on_dead" }, + { 0x21B0, "set_flag_on_dead_or_dying" }, + { 0x21B1, "set_flag_on_spawned" }, + { 0x21B2, "empty_func" }, + { 0x21B3, "set_flag_on_spawned_ai_proc" }, + { 0x21B4, "set_flag_on_func_wait_proc" }, +// { 0x21B5, "" }, + { 0x21B6, "set_flag_on_targetname_trigger" }, +// { 0x21B7, "" }, + { 0x21B8, "waittill_dead_or_dying" }, + { 0x21B9, "waittill_dead_thread" }, + { 0x21BA, "waittill_dead_or_dying_thread" }, +// { 0x21BB, "" }, +// { 0x21BC, "" }, +// { 0x21BD, "" }, + { 0x21BE, "get_ai_group_count" }, +// { 0x21BF, "" }, +// { 0x21C0, "" }, + { 0x21C1, "waittill_notetrack_or_damage" }, + { 0x21C2, "get_living_ai" }, + { 0x21C3, "get_living_ai_array" }, + { 0x21C4, "get_vehicle" }, + { 0x21C5, "get_vehicle_array" }, +// { 0x21C6, "" }, + { 0x21C7, "get_living_aispecies" }, + { 0x21C8, "get_living_aispecies_array" }, + { 0x21C9, "gather_delay_proc" }, +// { 0x21CA, "" }, + { 0x21CB, "death_waiter" }, + { 0x21CC, "getchar" }, + { 0x21CD, "getlinks_array" }, + { 0x21CE, "array_merge_links" }, + { 0x21CF, "array_exclude" }, + { 0x21D0, "array_compare" }, +// { 0x21D1, "" }, + { 0x21D2, "draw_line" }, + { 0x21D3, "draw_line_to_ent_for_time" }, + { 0x21D4, "draw_line_from_ent_for_time" }, +// { 0x21D5, "" }, +// { 0x21D6, "" }, + { 0x21D7, "draw_line_until_notify" }, +// { 0x21D8, "" }, +// { 0x21D9, "" }, + { 0x21DA, "draw_circle_lines_until_notify" }, + { 0x21DB, "clear_enemy_passthrough" }, + { 0x21DC, "battlechatter_off" }, +// { 0x21DD, "" }, +// { 0x21DE, "" }, + { 0x21DF, "set_team_bcvoice" }, + { 0x21E0, "set_ai_bcvoice" }, + { 0x21E1, "flavorbursts_on" }, + { 0x21E2, "set_flavorbursts_team_state" }, + { 0x21E3, "set_flavorbursts" }, + { 0x21E4, "friendlyfire_warnings_off" }, + { 0x21E5, "friendlyfire_warnings_on" }, +// { 0x21E6, "" }, + { 0x21E7, "get_obj_event" }, +// { 0x21E8, "" }, + { 0x21E9, "waittill_objective_event_notrigger" }, + { 0x21EA, "obj_set_chain_and_enemies" }, +// { 0x21EB, "" }, +// { 0x21EC, "" }, + { 0x21ED, "get_last_ent_in_chain" }, + { 0x21EE, "player_seek" }, + { 0x21EF, "set_forcedgoal" }, +// { 0x21F0, "" }, + { 0x21F1, "oldmaxdist" }, + { 0x21F2, "oldmaxsight" }, + { 0x21F3, "array_removedead_keepkeys" }, + { 0x21F4, "array_removedead_or_dying" }, + { 0x21F5, "array_insert" }, + { 0x21F6, "array_remove_index" }, +// { 0x21F7, "" }, + { 0x21F8, "structarray_swaptolast" }, + { 0x21F9, "set_ambient_alias" }, + { 0x21FA, "get_use_key" }, + { 0x21FB, "doom" }, + { 0x21FC, "get_stop_watch" }, +// { 0x21FD, "" }, +// { 0x21FE, "" }, +// { 0x21FF, "" }, + { 0x2200, "set_objective_active" }, +// { 0x2201, "" }, + { 0x2202, "script_wait_add" }, +// { 0x2203, "" }, +// { 0x2204, "" }, +// { 0x2205, "" }, + { 0x2206, "guy_runtovehicle_load" }, +// { 0x2207, "" }, + { 0x2208, "enable_ai_color" }, + { 0x2209, "old_forcecolor" }, + { 0x220A, "enable_ai_color_dontmove" }, + { 0x220B, "check_force_color" }, + { 0x220C, "get_force_color" }, +// { 0x220D, "" }, + { 0x220E, "set_force_color_spawner" }, + { 0x220F, "issue_color_orders" }, +// { 0x2210, "" }, +// { 0x2211, "" }, + { 0x2212, "ninebanghandler" }, +// { 0x2213, "" }, + { 0x2214, "flashnearbyallies" }, + { 0x2215, "pauseexploder" }, + { 0x2216, "restartexploder" }, + { 0x2217, "getfxarraybyid" }, +// { 0x2218, "" }, +// { 0x2219, "" }, +// { 0x221A, "" }, +// { 0x221B, "" }, + { 0x221C, "vehicle_resumepath" }, + { 0x221D, "vehicle_resumepathvehicle" }, + { 0x221E, "vehicle_land" }, +// { 0x221F, "" }, +// { 0x2220, "" }, + { 0x2221, "vehicle_liftoffvehicle" }, + { 0x2222, "vehicle_dynamicpath" }, + { 0x2223, "vehicle_paths" }, +// { 0x2224, "" }, +// { 0x2225, "" }, + { 0x2226, "_getvehiclespawnerarray" }, +// { 0x2227, "" }, +// { 0x2228, "" }, + { 0x2229, "add_start_construct" }, +// { 0x222A, "" }, + { 0x222B, "set_default_start" }, +// { 0x222C, "" }, +// { 0x222D, "" }, +// { 0x222E, "" }, + { 0x222F, "within_fov_of_players" }, +// { 0x2230, "" }, +// { 0x2231, "" }, + { 0x2232, "player_radio_emitter" }, + { 0x2233, "radio_dialogue_overlap" }, + { 0x2234, "radio_dialogue_clear_stack" }, + { 0x2235, "radio_dialogue_interupt" }, + { 0x2236, "radio_dialogue_safe" }, +// { 0x2237, "" }, +// { 0x2238, "" }, +// { 0x2239, "" }, + { 0x223A, "hint_delete" }, + { 0x223B, "hint_position_internal" }, +// { 0x223C, "" }, + { 0x223D, "remove_global_spawn_function" }, +// { 0x223E, "" }, +// { 0x223F, "" }, + { 0x2240, "array_kill" }, + { 0x2241, "activate_trigger_with_targetname" }, + { 0x2242, "activate_trigger_with_noteworthy" }, + { 0x2243, "disable_trigger_with_targetname" }, + { 0x2244, "disable_trigger_with_noteworthy" }, + { 0x2245, "enable_trigger_with_targetname" }, + { 0x2246, "enable_trigger_with_noteworthy" }, +// { 0x2247, "" }, + { 0x2248, "get_ai_number" }, +// { 0x2249, "" }, +// { 0x224A, "" }, + { 0x224B, "set_team_pacifist" }, +// { 0x224C, "" }, +// { 0x224D, "" }, + { 0x224E, "set_promotion_order" }, + { 0x224F, "set_empty_promotion_order" }, +// { 0x2250, "" }, +// { 0x2251, "" }, + { 0x2252, "remove_noteworthy_from_array" }, + { 0x2253, "get_closest_colored_friendly" }, +// { 0x2254, "" }, +// { 0x2255, "" }, +// { 0x2256, "" }, +// { 0x2257, "" }, + { 0x2258, "instantly_promote_nearest_friendly_with_classname" }, + { 0x2259, "promote_nearest_friendly_with_classname" }, + { 0x225A, "riotshield_lock_orientation" }, + { 0x225B, "riotshield_unlock_orientation" }, + { 0x225C, "instantly_set_color_from_array_with_classname" }, + { 0x225D, "instantly_set_color_from_array" }, + { 0x225E, "wait_for_script_noteworthy_trigger" }, + { 0x225F, "wait_for_targetname_trigger" }, + { 0x2260, "wait_for_flag_or_timeout" }, + { 0x2261, "wait_for_notify_or_timeout" }, +// { 0x2262, "" }, + { 0x2263, "wait_for_either_trigger" }, +// { 0x2264, "" }, +// { 0x2265, "" }, + { 0x2266, "disable_readystand" }, +// { 0x2267, "" }, +// { 0x2268, "" }, + { 0x2269, "do_in_order" }, +// { 0x226A, "" }, +// { 0x226B, "" }, + { 0x226C, "touched" }, +// { 0x226D, "" }, + { 0x226E, "getanim_generic" }, + { 0x226F, "show_hint" }, + { 0x2270, "hide_hint" }, + { 0x2271, "fire_radius" }, + { 0x2272, "clearthreatbias" }, +// { 0x2273, "" }, +// { 0x2274, "" }, +// { 0x2275, "" }, + { 0x2276, "set_goalradius" }, + { 0x2277, "try_forever_spawn" }, + { 0x2278, "set_allowdeath" }, + { 0x2279, "set_run_anim" }, +// { 0x227A, "" }, +// { 0x227B, "" }, + { 0x227C, "set_generic_idle_anim" }, + { 0x227D, "set_idle_anim" }, +// { 0x227E, "" }, + { 0x227F, "clear_generic_run_anim" }, + { 0x2280, "set_run_anim_array" }, +// { 0x2281, "" }, + { 0x2282, "debugvar" }, + { 0x2283, "physicsjolt_proximity" }, + { 0x2284, "set_goal_entity" }, + { 0x2285, "activate_trigger" }, + { 0x2286, "activate_trigger_process" }, + { 0x2287, "self_delete" }, + { 0x2288, "remove_nocolor_from_array" }, + { 0x2289, "clear_colors" }, + { 0x228A, "clear_team_colors" }, + { 0x228B, "place_weapon_on" }, +// { 0x228C, "" }, +// { 0x228D, "" }, + { 0x228E, "lerp_player_view_to_tag_oldstyle" }, + { 0x228F, "player_moves" }, + { 0x2290, "waittill_either_function" }, +// { 0x2291, "" }, + { 0x2292, "enable_careful" }, + { 0x2293, "disable_careful" }, + { 0x2294, "enable_sprint" }, + { 0x2295, "disable_sprint" }, + { 0x2296, "disable_bulletwhizbyreaction" }, +// { 0x2297, "" }, + { 0x2298, "clear_dvar" }, +// { 0x2299, "" }, + { 0x229A, "set_fixednode_true" }, +// { 0x229B, "" }, + { 0x229C, "script_delay_spawn" }, +// { 0x229D, "" }, + { 0x229E, "function_stack_clear" }, + { 0x229F, "geo_off" }, +// { 0x22A0, "" }, + { 0x22A1, "disable_exits" }, + { 0x22A2, "enable_exits" }, + { 0x22A3, "disable_turnanims" }, + { 0x22A4, "enable_turnanims" }, + { 0x22A5, "set_blur" }, +// { 0x22A6, "" }, +// { 0x22A7, "" }, + { 0x22A8, "set_goal_node_targetname" }, + { 0x22A9, "objective_complete" }, + { 0x22AA, "get_guy_with_script_noteworthy_from_spawner" }, + { 0x22AB, "get_guy_with_targetname_from_spawner" }, + { 0x22AC, "get_guys_with_targetname_from_spawner" }, + { 0x22AD, "array_spawn" }, +// { 0x22AE, "" }, + { 0x22AF, "array_spawn_noteworthy" }, +// { 0x22B0, "" }, + { 0x22B1, "spawn_targetname" }, + { 0x22B2, "add_dialogue_line" }, + { 0x22B3, "dialogue_huds" }, + { 0x22B4, "destructible_disable_explosion" }, + { 0x22B5, "destructible_force_explosion" }, +// { 0x22B6, "" }, +// { 0x22B7, "" }, + { 0x22B8, "set_baseaccuracy" }, + { 0x22B9, "xenon" }, +// { 0x22BA, "" }, +// { 0x22BB, "" }, + { 0x22BC, "hunted_style_door_open" }, +// { 0x22BD, "" }, + { 0x22BE, "lerp_fov_overtime" }, + { 0x22BF, "lerp_fovscale_overtime" }, + { 0x22C0, "putgunaway" }, + { 0x22C1, "apply_fog" }, + { 0x22C2, "apply_end_fog" }, + { 0x22C3, "_delete" }, + { 0x22C4, "_kill" }, + { 0x22C5, "_setentitytarget" }, + { 0x22C6, "_clearentitytarget" }, + { 0x22C7, "_unlink" }, + { 0x22C8, "disable_oneshotfx_with_noteworthy" }, + { 0x22C9, "_setlightintensity" }, + { 0x22CA, "array_wait" }, +// { 0x22CB, "" }, +// { 0x22CC, "" }, + { 0x22CD, "enable_auto_adjust_threatbias" }, + { 0x22CE, "auto_adjust_threatbias" }, + { 0x22CF, "auto_adjust_difficulty_frac" }, + { 0x22D0, "disable_auto_adjust_threatbias" }, + { 0x22D1, "waittill_player_lookat" }, +// { 0x22D2, "" }, + { 0x22D3, "players_looking_at" }, + { 0x22D4, "either_player_looking_at" }, +// { 0x22D5, "" }, +// { 0x22D6, "" }, + { 0x22D7, "players_within_distance" }, + { 0x22D8, "ai_delete_when_out_of_sight" }, + { 0x22D9, "add_abort" }, +// { 0x22DA, "" }, + { 0x22DB, "add_noself_call" }, + { 0x22DC, "add_endon" }, + { 0x22DD, "do_wait" }, + { 0x22DE, "forced_start_catchup" }, +// { 0x22DF, "" }, +// { 0x22E0, "" }, + { 0x22E1, "is_after_start" }, + { 0x22E2, "_earthquake" }, + { 0x22E3, "waterfx" }, +// { 0x22E4, "" }, + { 0x22E5, "mix_up" }, + { 0x22E6, "mix_down" }, +// { 0x22E7, "" }, +// { 0x22E8, "" }, + { 0x22E9, "fail_on_friendly_fire" }, + { 0x22EA, "normal_friendly_fire_penalty" }, + { 0x22EB, "getplayerclaymores" }, + { 0x22EC, "getplayerc4" }, + { 0x22ED, "_waittillmatch" }, +// { 0x22EE, "" }, +// { 0x22EF, "" }, + { 0x22F0, "add_jav_glow" }, +// { 0x22F1, "" }, + { 0x22F2, "delete_on_not_defined" }, +// { 0x22F3, "" }, +// { 0x22F4, "" }, + { 0x22F5, "slowmo_setspeed_norm" }, + { 0x22F6, "slowmo_setlerptime_in" }, + { 0x22F7, "slowmo_lerp_in" }, +// { 0x22F8, "" }, +// { 0x22F9, "" }, +// { 0x22FA, "" }, + { 0x22FB, "arcademode_stop_timer" }, + { 0x22FC, "music_loop_stealth" }, + { 0x22FD, "all_players_istouching" }, + { 0x22FE, "any_players_istouching" }, + { 0x22FF, "get_ent_closest_to_flag_trig" }, +// { 0x2300, "" }, +// { 0x2301, "" }, + { 0x2302, "get_average_origin" }, + { 0x2303, "generic_damage_think" }, + { 0x2304, "playlocalsoundwrapper" }, +// { 0x2305, "" }, + { 0x2306, "teleport_players" }, + { 0x2307, "hide_player_model" }, + { 0x2308, "show_player_model" }, + { 0x2309, "entities" }, + { 0x230A, "open_up_fov" }, + { 0x230B, "get_ai_touching_volume" }, + { 0x230C, "get_drones_touching_volume" }, + { 0x230D, "get_drones_with_targetname" }, + { 0x230E, "is_other_player_downed" }, + { 0x230F, "follow_path" }, +// { 0x2310, "" }, +// { 0x2311, "" }, + { 0x2312, "player_seek_enable" }, + { 0x2313, "player_seek_disable" }, + { 0x2314, "waittill_entity_in_range_or_timeout" }, + { 0x2315, "waittill_entity_in_range" }, +// { 0x2316, "" }, + { 0x2317, "player_has_thermal" }, + { 0x2318, "waittill_true_goal" }, + { 0x2319, "player_speed_percent" }, + { 0x231A, "g_speed" }, + { 0x231B, "blend_movespeedscale_percent" }, +// { 0x231C, "" }, +// { 0x231D, "" }, +// { 0x231E, "" }, + { 0x231F, "player_speed_default" }, + { 0x2320, "blend_movespeedscale_default" }, +// { 0x2321, "" }, +// { 0x2322, "" }, +// { 0x2323, "" }, + { 0x2324, "move_all_fx" }, +// { 0x2325, "" }, + { 0x2326, "custom_linkto_slide" }, + { 0x2327, "getentwithflag" }, + { 0x2328, "getentarraywithflag" }, +// { 0x2329, "" }, +// { 0x232A, "" }, +// { 0x232B, "" }, +// { 0x232C, "" }, + { 0x232D, "get_rumble_ent" }, + { 0x232E, "set_rumble_intensity" }, + { 0x232F, "rumble_ramp_on" }, + { 0x2330, "rumble_ramp_off" }, + { 0x2331, "rumble_ramp_to" }, + { 0x2332, "glow" }, + { 0x2333, "non_glow_model" }, +// { 0x2334, "" }, + { 0x2335, "array_delete_evenly" }, +// { 0x2336, "" }, +// { 0x2337, "" }, + { 0x2338, "tracefx_on_tag" }, +// { 0x2339, "" }, + { 0x233A, "enable_surprise" }, + { 0x233B, "disable_heat_behavior" }, + { 0x233C, "getvehiclearray" }, + { 0x233D, "hint" }, +// { 0x233E, "" }, +// { 0x233F, "" }, +// { 0x2340, "" }, + { 0x2341, "get_player_view_controller" }, + { 0x2342, "blend_dof" }, +// { 0x2343, "" }, + { 0x2344, "store_players_weapons" }, + { 0x2345, "stored_weapons" }, +// { 0x2346, "" }, +// { 0x2347, "" }, + { 0x2348, "show_entity" }, +// { 0x2349, "" }, + { 0x234A, "set_moveplaybackrate" }, + { 0x234B, "array_spawn_function" }, + { 0x234C, "array_spawn_function_targetname" }, +// { 0x234D, "" }, + { 0x234E, "enable_dontevershoot" }, + { 0x234F, "disable_dontevershoot" }, + { 0x2350, "create_fog" }, +// { 0x2351, "" }, +// { 0x2352, "" }, +// { 0x2353, "" }, +// { 0x2354, "" }, + { 0x2355, "vision_set_changes" }, + { 0x2356, "set_art_tweaked_vision_set" }, +// { 0x2357, "" }, + { 0x2358, "enable_teamflashbangimmunity_proc" }, +// { 0x2359, "" }, +// { 0x235A, "" }, +// { 0x235B, "" }, + { 0x235C, "activate_interactives_in_volume" }, +// { 0x235D, "" }, +// { 0x235E, "" }, + { 0x235F, "activate_exploders_in_volume" }, + { 0x2360, "delete_destructibles_in_volumes" }, +// { 0x2361, "" }, + { 0x2362, "delete_exploders_in_volumes" }, +// { 0x2363, "" }, +// { 0x2364, "" }, + { 0x2365, "waittill_volume_dead" }, +// { 0x2366, "" }, + { 0x2367, "waittill_volume_dead_then_set_flag" }, + { 0x2368, "waittill_targetname_volume_dead_then_set_flag" }, +// { 0x2369, "" }, + { 0x236A, "player_cant_be_shot" }, +// { 0x236B, "" }, + { 0x236C, "array_index_by_parameters" }, +// { 0x236D, "" }, +// { 0x236E, "" }, +// { 0x236F, "" }, +// { 0x2370, "" }, +// { 0x2371, "" }, + { 0x2372, "flashbangstop" }, +// { 0x2373, "" }, +// { 0x2374, "" }, +// { 0x2375, "" }, + { 0x2376, "player_rides_in_humvee" }, + { 0x2377, "player_dismount" }, +// { 0x2378, "" }, +// { 0x2379, "" }, + { 0x237A, "player_rides_humvee_offset_dismount" }, + { 0x237B, "player_leaves_humvee" }, + { 0x237C, "dirteffect" }, + { 0x237D, "screen_effect_sides" }, + { 0x237E, "pathrandompercent_set" }, + { 0x237F, "old_pathrandompercent" }, + { 0x2380, "pathrandompercent_zero" }, + { 0x2381, "pathrandompercent_reset" }, +// { 0x2382, "" }, +// { 0x2383, "" }, + { 0x2384, "old_walkdist" }, +// { 0x2385, "" }, +// { 0x2386, "" }, + { 0x2387, "ignorerandombulletdamage_drone_proc" }, + { 0x2388, "fakehealth" }, +// { 0x2389, "" }, +// { 0x238A, "" }, +// { 0x238B, "" }, + { 0x238C, "set_brakes" }, + { 0x238D, "disable_ignorerandombulletdamage_drone" }, +// { 0x238E, "" }, + { 0x238F, "disable_danger_react" }, +// { 0x2390, "" }, + { 0x2391, "reset_group_advance_to_enemy_timer" }, +// { 0x2392, "" }, +// { 0x2393, "" }, +// { 0x2394, "" }, + { 0x2395, "objective_clearadditionalpositions" }, +// { 0x2396, "" }, +// { 0x2397, "" }, +// { 0x2398, "" }, +// { 0x2399, "" }, + { 0x239A, "musicloop" }, + { 0x239B, "player_mount_vehicle" }, + { 0x239C, "player_dismount_vehicle" }, +// { 0x239D, "" }, +// { 0x239E, "" }, +// { 0x239F, "" }, +// { 0x23A0, "" }, +// { 0x23A1, "" }, + { 0x23A2, "template_so_level" }, + { 0x23A3, "define_introscreen" }, +// { 0x23A4, "" }, +// { 0x23A5, "" }, + { 0x23A6, "fx_volume_pause" }, +// { 0x23A7, "" }, + { 0x23A8, "fx_volume_restart_noteworthy" }, +// { 0x23A9, "" }, + { 0x23AA, "fx_volume_restart" }, + { 0x23AB, "flag_count_increment" }, +// { 0x23AC, "" }, + { 0x23AD, "flag_count_decrement" }, + { 0x23AE, "flag_count_set" }, + { 0x23AF, "add_cleanup_ent" }, + { 0x23B0, "cleanup_ents" }, +// { 0x23B1, "" }, + { 0x23B2, "add_trigger_function" }, + { 0x23B3, "getallweapons" }, +// { 0x23B4, "" }, + { 0x23B5, "move_with_rate" }, + { 0x23B6, "flag_on_death" }, + { 0x23B7, "damagefeedback" }, + { 0x23B8, "disable_damagefeedback" }, + { 0x23B9, "add_damagefeedback" }, +// { 0x23BA, "" }, + { 0x23BB, "deletestructarray" }, + { 0x23BC, "deletestruct_ref" }, +// { 0x23BD, "" }, +// { 0x23BE, "" }, + { 0x23BF, "setentityheadicon" }, + { 0x23C0, "entityheadiconoffset" }, + { 0x23C1, "entityheadiconreferencefunc" }, +// { 0x23C2, "" }, +// { 0x23C3, "" }, + { 0x23C4, "updateentityheadicon" }, +// { 0x23C5, "" }, + { 0x23C6, "destroyentityheadiconondeath" }, +// { 0x23C7, "" }, + { 0x23C8, "evasive_createmaneuvers" }, +// { 0x23C9, "" }, +// { 0x23CA, "" }, + { 0x23CB, "evasive_endmaneuvers" }, + { 0x23CC, "evasive_addpoint" }, + { 0x23CD, "evasive_points" }, +// { 0x23CE, "" }, + { 0x23CF, "evasive_drawpoints" }, +// { 0x23D0, "" }, +// { 0x23D1, "" }, + { 0x23D2, "wingman_getgoalpos" }, + { 0x23D3, "getplayerhelispeed" }, +// { 0x23D4, "" }, + { 0x23D5, "fullmodel" }, + { 0x23D6, "script_wingman" }, + { 0x23D7, "wingman" }, +// { 0x23D8, "" }, + { 0x23D9, "playercontrolled" }, +// { 0x23DA, "" }, +// { 0x23DB, "" }, +// { 0x23DC, "" }, + { 0x23DD, "flares_fire" }, +// { 0x23DE, "" }, +// { 0x23DF, "" }, +// { 0x23E0, "" }, + { 0x23E1, "centeraimpoint" }, +// { 0x23E2, "" }, +// { 0x23E3, "" }, + { 0x23E4, "script_targetoffset_z" }, + { 0x23E5, "flares_get_vehicle_velocity" }, + { 0x23E6, "missile_deathwait" }, + { 0x23E7, "getenemytarget" }, + { 0x23E8, "ignored_by_attack_heli" }, + { 0x23E9, "shootenemytarget_bullets" }, + { 0x23EA, "cobraweapon" }, + { 0x23EB, "gunnerweapon" }, +// { 0x23EC, "" }, + { 0x23ED, "shootenemytarget_bullets_debugline" }, + { 0x23EE, "attachmissiles" }, + { 0x23EF, "hasattachedweapons" }, +// { 0x23F0, "" }, +// { 0x23F1, "" }, +// { 0x23F2, "" }, +// { 0x23F3, "" }, + { 0x23F4, "delayed_earthquake" }, +// { 0x23F5, "" }, +// { 0x23F6, "" }, + { 0x23F7, "attack_heli_fx" }, + { 0x23F8, "attackheliaiburstsize" }, + { 0x23F9, "cosine" }, + { 0x23FA, "attackhelirange" }, + { 0x23FB, "attackhelikillsai" }, + { 0x23FC, "attackhelifov" }, +// { 0x23FD, "" }, + { 0x23FE, "attackhelitargetreaquire" }, + { 0x23FF, "attackhelimovetime" }, + { 0x2400, "attackheliplayerbreak" }, + { 0x2401, "attackhelitimeout" }, + { 0x2402, "start_attack_heli" }, + { 0x2403, "spawn_vehicle_from_targetname_and_drive" }, +// { 0x2404, "" }, + { 0x2405, "no_attractor" }, + { 0x2406, "attractor" }, + { 0x2407, "attractor2" }, + { 0x2408, "startingorigin" }, + { 0x2409, "circling" }, + { 0x240A, "allowshoot" }, +// { 0x240B, "" }, + { 0x240C, "moving" }, + { 0x240D, "istakingdamage" }, +// { 0x240E, "" }, + { 0x240F, "turrettype" }, + { 0x2410, "targetdefault" }, + { 0x2411, "etarget" }, + { 0x2412, "script_spotlight" }, + { 0x2413, "spotlight" }, + { 0x2414, "detect_player_death" }, +// { 0x2415, "" }, +// { 0x2416, "" }, + { 0x2417, "turrets" }, + { 0x2418, "setup_miniguns" }, +// { 0x2419, "" }, +// { 0x241A, "" }, +// { 0x241B, "" }, +// { 0x241C, "" }, + { 0x241D, "kill_heli_logic" }, +// { 0x241E, "" }, + { 0x241F, "enemy_heli_killed" }, + { 0x2420, "commander_speaking" }, +// { 0x2421, "" }, + { 0x2422, "attack_heli_safe_volumes" }, +// { 0x2423, "" }, + { 0x2424, "dontwaitforpathend" }, + { 0x2425, "heli_circling_think" }, + { 0x2426, "heli_goal_think" }, + { 0x2427, "player_is_aiming_with_rocket" }, + { 0x2428, "heli_shoot_think" }, +// { 0x2429, "" }, + { 0x242A, "player_grace_period" }, + { 0x242B, "heli_can_see_target" }, + { 0x242C, "heli_has_player_target" }, + { 0x242D, "heli_has_target" }, +// { 0x242E, "" }, +// { 0x242F, "" }, + { 0x2430, "heli_get_target_player_only" }, + { 0x2431, "heli_get_target_ai_only" }, +// { 0x2432, "" }, +// { 0x2433, "" }, +// { 0x2434, "" }, +// { 0x2435, "" }, + { 0x2436, "get_different_player" }, + { 0x2437, "notify_disable" }, + { 0x2438, "notify_enable" }, + { 0x2439, "fire_guns" }, +// { 0x243A, "" }, +// { 0x243B, "" }, + { 0x243C, "turret_default_fire" }, + { 0x243D, "turret_minigun_fire" }, + { 0x243E, "minigun_fire" }, + { 0x243F, "target_track" }, +// { 0x2440, "" }, + { 0x2441, "minigun_ai_target_cleanup" }, + { 0x2442, "minigun_spindown" }, +// { 0x2443, "" }, +// { 0x2444, "" }, + { 0x2445, "can_see_player" }, +// { 0x2446, "" }, +// { 0x2447, "" }, + { 0x2448, "seen_attacker" }, + { 0x2449, "heli_damage_update" }, +// { 0x244A, "" }, +// { 0x244B, "" }, +// { 0x244C, "" }, +// { 0x244D, "" }, +// { 0x244E, "" }, +// { 0x244F, "" }, +// { 0x2450, "" }, +// { 0x2451, "" }, +// { 0x2452, "" }, +// { 0x2453, "" }, + { 0x2454, "heli_spotlight_think" }, + { 0x2455, "left_ent" }, + { 0x2456, "right_ent" }, + { 0x2457, "within_player_fov" }, +// { 0x2458, "" }, + { 0x2459, "littlebird_turrets_think" }, +// { 0x245A, "" }, +// { 0x245B, "" }, +// { 0x245C, "" }, + { 0x245D, "preferredtarget" }, + { 0x245E, "script_shotcount" }, + { 0x245F, "heli_default_missiles_off" }, + { 0x2460, "heli_spotlight_on" }, + { 0x2461, "heli_spotlight_off" }, + { 0x2462, "heli_spotlight_random_targets_on" }, + { 0x2463, "heli_spotlight_random_targets_off" }, +// { 0x2464, "" }, +// { 0x2465, "" }, +// { 0x2466, "" }, + { 0x2467, "boneyard_style_heli_missile_attack" }, +// { 0x2468, "" }, + { 0x2469, "boneyard_fire_at_targets" }, + { 0x246A, "get_american_name" }, +// { 0x246B, "" }, +// { 0x246C, "" }, + { 0x246D, "get_russian_name" }, +// { 0x246E, "" }, + { 0x246F, "script_tankgroup" }, +// { 0x2470, "" }, + { 0x2471, "setvehiclefx" }, +// { 0x2472, "" }, + { 0x2473, "setallvehiclefx" }, + { 0x2474, "disablevehiclescripts" }, +// { 0x2475, "" }, + { 0x2476, "vehicle_processtriggers" }, + { 0x2477, "init_helicopter_list" }, +// { 0x2478, "" }, + { 0x2479, "init_airplane_list" }, +// { 0x247A, "" }, +// { 0x247B, "" }, + { 0x247C, "trigger_getlinkmap" }, + { 0x247D, "setup_script_gatetrigger" }, + { 0x247E, "script_gatetrigger" }, + { 0x247F, "vehicle_gatetrigger" }, + { 0x2480, "setup_script_vehiclespawngroup" }, +// { 0x2481, "" }, + { 0x2482, "setup_vehicle_spawners" }, + { 0x2483, "vehicle_spawn_think" }, +// { 0x2484, "" }, + { 0x2485, "vehicle_linked_entities_think" }, +// { 0x2486, "" }, + { 0x2487, "is_trigger_once" }, +// { 0x2488, "" }, +// { 0x2489, "" }, +// { 0x248A, "" }, +// { 0x248B, "" }, + { 0x248C, "script_vehicletriggergroup" }, + { 0x248D, "vehicle_flags" }, + { 0x248E, "script_vehiclegroupdelete" }, + { 0x248F, "vehicle_deletegroup" }, +// { 0x2490, "" }, + { 0x2491, "vehicle_startmovegroup" }, +// { 0x2492, "" }, +// { 0x2493, "" }, + { 0x2494, "path_detour_script_origin" }, + { 0x2495, "crash_detour_check" }, + { 0x2496, "script_crashtype" }, + { 0x2497, "derailed" }, +// { 0x2498, "" }, + { 0x2499, "path_detour" }, + { 0x249A, "script_vehicledetourgroup" }, +// { 0x249B, "" }, +// { 0x249C, "" }, + { 0x249D, "script_transmission" }, + { 0x249E, "reverse_node" }, + { 0x249F, "_setswitchnode" }, +// { 0x24A0, "" }, + { 0x24A1, "detouringpath" }, +// { 0x24A2, "" }, + { 0x24A3, "vehicle_link" }, + { 0x24A4, "spawn_array" }, + { 0x24A5, "remove_non_riders_from_array" }, + { 0x24A6, "ai_should_be_added" }, + { 0x24A7, "get_vehicle_ai_spawners" }, + { 0x24A8, "vehicle_ridespawners" }, + { 0x24A9, "get_vehicle_ai_riders" }, +// { 0x24AA, "" }, + { 0x24AB, "spawn_group" }, + { 0x24AC, "spawn_unload_group" }, +// { 0x24AD, "" }, +// { 0x24AE, "" }, + { 0x24AF, "script_vehiclewalk" }, + { 0x24B0, "script_followmode" }, + { 0x24B1, "followmode" }, +// { 0x24B2, "" }, + { 0x24B3, "runtovehicle" }, + { 0x24B4, "climbnode" }, + { 0x24B5, "climbanim" }, + { 0x24B6, "vehicle_goal" }, + { 0x24B7, "runtovehicle_setgoal" }, + { 0x24B8, "setup_groundnode_detour" }, + { 0x24B9, "turn_unloading_drones_to_ai" }, + { 0x24BA, "add_proccess_trigger" }, + { 0x24BB, "islastnode" }, + { 0x24BC, "get_path_getfunc" }, +// { 0x24BD, "" }, +// { 0x24BE, "" }, + { 0x24BF, "vehicle_paths_non_heli" }, + { 0x24C0, "gateopen" }, +// { 0x24C1, "" }, + { 0x24C2, "script_crashtypeoverride" }, + { 0x24C3, "script_badplace" }, + { 0x24C4, "script_turretmg" }, + { 0x24C5, "script_turningdir" }, + { 0x24C6, "script_deathroll" }, +// { 0x24C7, "" }, +// { 0x24C8, "" }, +// { 0x24C9, "" }, + { 0x24CA, "script_brake" }, +// { 0x24CB, "" }, + { 0x24CC, "script_ent_flag_wait" }, +// { 0x24CD, "" }, + { 0x24CE, "set_lookat_point" }, + { 0x24CF, "script_vehicle_lights_off" }, + { 0x24D0, "script_vehicle_lights_on" }, +// { 0x24D1, "" }, + { 0x24D2, "script_vehicle_selfremove" }, + { 0x24D3, "vehicle_paths_helicopter" }, + { 0x24D4, "script_helimove" }, + { 0x24D5, "vehicle_should_unload" }, + { 0x24D6, "script_unload" }, +// { 0x24D7, "" }, + { 0x24D8, "overshoot_next_node" }, + { 0x24D9, "is_script_vehicle_selfremove" }, + { 0x24DA, "must_stop_at_next_point" }, + { 0x24DB, "heli_wait_node" }, +// { 0x24DC, "" }, +// { 0x24DD, "" }, + { 0x24DE, "script_airresistance" }, +// { 0x24DF, "" }, +// { 0x24E0, "" }, +// { 0x24E1, "" }, +// { 0x24E2, "" }, +// { 0x24E3, "" }, + { 0x24E4, "script_firelink" }, +// { 0x24E5, "" }, +// { 0x24E6, "" }, +// { 0x24E7, "" }, +// { 0x24E8, "" }, +// { 0x24E9, "" }, +// { 0x24EA, "" }, +// { 0x24EB, "" }, +// { 0x24EC, "" }, +// { 0x24ED, "" }, +// { 0x24EE, "" }, +// { 0x24EF, "" }, + { 0x24F0, "path_gate_wait_till_open" }, + { 0x24F1, "waitingforgate" }, +// { 0x24F2, "" }, +// { 0x24F3, "" }, +// { 0x24F4, "" }, +// { 0x24F5, "" }, + { 0x24F6, "truckjunk" }, +// { 0x24F7, "" }, + { 0x24F8, "remove_vehicle_spawned_thisframe" }, +// { 0x24F9, "" }, +// { 0x24FA, "" }, +// { 0x24FB, "" }, +// { 0x24FC, "" }, +// { 0x24FD, "" }, +// { 0x24FE, "" }, +// { 0x24FF, "" }, +// { 0x2500, "" }, +// { 0x2501, "" }, +// { 0x2502, "" }, +// { 0x2503, "" }, +// { 0x2504, "" }, + { 0x2505, "script_dontunloadonend" }, + { 0x2506, "script_physicsjolt" }, + { 0x2507, "vehiclespawncallbackthread" }, + { 0x2508, "ischeapshieldenabled" }, + { 0x2509, "cheap_vehicles_have_shields" }, +// { 0x250A, "" }, +// { 0x250B, "" }, +// { 0x250C, "" }, +// { 0x250D, "" }, + { 0x250E, "deathdamage_min" }, + { 0x250F, "mindamage" }, +// { 0x2510, "" }, + { 0x2511, "range" }, + { 0x2512, "vehicle_kill" }, + { 0x2513, "rumbletrigger" }, + { 0x2514, "vehicle_rumble_unique" }, + { 0x2515, "vehicle_rumble_override" }, + { 0x2516, "vehicle_rumble" }, + { 0x2517, "vehicle_death_thread" }, +// { 0x2518, "" }, + { 0x2519, "vehicle_deathmodel_delay" }, + { 0x251A, "dontdisconnectpaths" }, + { 0x251B, "free_on_death" }, +// { 0x251C, "" }, +// { 0x251D, "" }, +// { 0x251E, "" }, +// { 0x251F, "" }, + { 0x2520, "attackback" }, + { 0x2521, "badshot" }, +// { 0x2522, "" }, +// { 0x2523, "" }, + { 0x2524, "offsetone" }, + { 0x2525, "offsetrange" }, + { 0x2526, "rocket_destroyed_for_achievement" }, + { 0x2527, "rumble_basetime" }, +// { 0x2528, "" }, +// { 0x2529, "" }, +// { 0x252A, "" }, + { 0x252B, "script_mp_style_helicopter" }, +// { 0x252C, "" }, +// { 0x252D, "" }, + { 0x252E, "shotsatzerospeed" }, +// { 0x252F, "" }, + { 0x2530, "target_min_range" }, +// { 0x2531, "" }, +// { 0x2532, "" }, +// { 0x2533, "" }, + { 0x2534, "turret_damage_min" }, + { 0x2535, "turret_damage_range" }, + { 0x2536, "badplacemodifier" }, +// { 0x2537, "" }, + { 0x2538, "rumble_scale" }, + { 0x2539, "rumbleon" }, + { 0x253A, "teleported_to_path_section" }, + { 0x253B, "turretaccmaxs" }, +// { 0x253C, "" }, + { 0x253D, "turretfiretimer" }, + { 0x253E, "turretonvistarg" }, +// { 0x253F, "" }, + { 0x2540, "water_splash_function" }, + { 0x2541, "water_splash_reset_function" }, +// { 0x2542, "" }, +// { 0x2543, "" }, + { 0x2544, "ent_flag_lock" }, + { 0x2545, "vehicle_stop_named" }, + { 0x2546, "enable_rocket_death" }, +// { 0x2547, "" }, + { 0x2548, "default_target_vec" }, +// { 0x2549, "" }, +// { 0x254A, "" }, +// { 0x254B, "" }, +// { 0x254C, "" }, + { 0x254D, "vehicle_should_do_rocket_death" }, +// { 0x254E, "" }, + { 0x254F, "vehicle_has_rocket_death" }, + { 0x2550, "vehicle_death_fx" }, +// { 0x2551, "" }, +// { 0x2552, "" }, +// { 0x2553, "" }, + { 0x2554, "vehicle_hasmainturret" }, + { 0x2555, "is_corpse" }, +// { 0x2556, "" }, + { 0x2557, "clear_anims_on_death" }, +// { 0x2558, "" }, +// { 0x2559, "" }, + { 0x255A, "get_unused_crash_locations" }, + { 0x255B, "helicopter_crash_locations" }, + { 0x255C, "detach_getoutrigs" }, + { 0x255D, "helicopter_crash_move" }, +// { 0x255E, "" }, +// { 0x255F, "" }, +// { 0x2560, "" }, +// { 0x2561, "" }, +// { 0x2562, "" }, +// { 0x2563, "" }, +// { 0x2564, "" }, + { 0x2565, "helicopter_crash_zigzag" }, + { 0x2566, "helicopter_crash_rotate" }, + { 0x2567, "crash_path_check" }, +// { 0x2568, "" }, +// { 0x2569, "" }, +// { 0x256A, "" }, +// { 0x256B, "" }, + { 0x256C, "kill_fx_thread" }, +// { 0x256D, "" }, + { 0x256E, "notifystring" }, + { 0x256F, "selfdeletedelay" }, + { 0x2570, "beffectlooping" }, +// { 0x2571, "" }, + { 0x2572, "remove_deathfx_entity_delay" }, + { 0x2573, "bsoundlooping" }, + { 0x2574, "loop_fx_on_vehicle_tag" }, +// { 0x2575, "" }, + { 0x2576, "vtclassname" }, +// { 0x2577, "" }, + { 0x2578, "build_rumble_override" }, + { 0x2579, "build_rumble_unique" }, + { 0x257A, "build_deathquake" }, + { 0x257B, "vttype" }, + { 0x257C, "build_quake" }, +// { 0x257D, "" }, + { 0x257E, "randomaditionaltime" }, +// { 0x257F, "" }, + { 0x2580, "build_deathfx_override" }, + { 0x2581, "vtmodel" }, + { 0x2582, "vtoverride" }, + { 0x2583, "vehicle_death_fx_override" }, + { 0x2584, "build_deathfx" }, + { 0x2585, "is_overrode" }, + { 0x2586, "build_rocket_deathfx" }, +// { 0x2587, "" }, +// { 0x2588, "" }, +// { 0x2589, "" }, + { 0x258A, "vehicle_kill_disconnect_paths_forever" }, + { 0x258B, "disconnect_paths_whenstopped" }, +// { 0x258C, "" }, + { 0x258D, "debug_vehiclesetspeed" }, + { 0x258E, "script_resumespeed" }, + { 0x258F, "resumemsgs" }, + { 0x2590, "attacking" }, + { 0x2591, "attackspeed" }, + { 0x2592, "print_resumespeed" }, + { 0x2593, "force_kill" }, +// { 0x2594, "" }, + { 0x2595, "godoff" }, + { 0x2596, "setturretfireondrones" }, +// { 0x2597, "" }, +// { 0x2598, "" }, +// { 0x2599, "" }, + { 0x259A, "idle_animations" }, +// { 0x259B, "" }, + { 0x259C, "animate_drive_idle" }, + { 0x259D, "vehicle_driveidle_normal_speed" }, +// { 0x259E, "" }, +// { 0x259F, "" }, +// { 0x25A0, "" }, +// { 0x25A1, "" }, +// { 0x25A2, "" }, +// { 0x25A3, "" }, + { 0x25A4, "vehicle_walkai" }, +// { 0x25A5, "" }, +// { 0x25A6, "" }, + { 0x25A7, "is_node_script_origin" }, + { 0x25A8, "node_trigger_process" }, +// { 0x25A9, "" }, +// { 0x25AA, "" }, + { 0x25AB, "setup_triggers" }, + { 0x25AC, "is_node_script_struct" }, + { 0x25AD, "setup_vehicles" }, +// { 0x25AE, "" }, +// { 0x25AF, "" }, + { 0x25B0, "check_spawn_group_isspawner" }, + { 0x25B1, "vehicle_life" }, + { 0x25B2, "vehicle_life_range_low" }, +// { 0x25B3, "" }, + { 0x25B4, "destructible_model" }, + { 0x25B5, "mginit" }, + { 0x25B6, "vehicle_mgturret" }, + { 0x25B7, "script_mg_angle" }, + { 0x25B8, "info" }, +// { 0x25B9, "" }, + { 0x25BA, "ownervehicle" }, + { 0x25BB, "deletedelay" }, + { 0x25BC, "defaultdroppitch" }, +// { 0x25BD, "" }, +// { 0x25BE, "" }, +// { 0x25BF, "" }, + { 0x25C0, "mgon" }, +// { 0x25C1, "" }, +// { 0x25C2, "" }, +// { 0x25C3, "" }, + { 0x25C4, "hashelicopterdustkickup" }, + { 0x25C5, "hashelicopterturret" }, +// { 0x25C6, "" }, + { 0x25C7, "chopper_turret_off" }, +// { 0x25C8, "" }, +// { 0x25C9, "" }, +// { 0x25CA, "" }, + { 0x25CB, "forwardvec" }, +// { 0x25CC, "" }, +// { 0x25CD, "" }, +// { 0x25CE, "" }, + { 0x25CF, "empty_var" }, + { 0x25D0, "setup_levelvars" }, + { 0x25D1, "vehicle_deathswitch" }, +// { 0x25D2, "" }, +// { 0x25D3, "" }, + { 0x25D4, "vehicle_team" }, + { 0x25D5, "attack_origin_condition_threadd" }, + { 0x25D6, "vehiclefireanim" }, + { 0x25D7, "vehiclefireanim_settle" }, +// { 0x25D8, "" }, + { 0x25D9, "vehicle_turret_requiresrider" }, + { 0x25DA, "vehicle_isstationary" }, +// { 0x25DB, "" }, +// { 0x25DC, "" }, + { 0x25DD, "vehicle_deckdust" }, + { 0x25DE, "vehicle_shoot_shock" }, + { 0x25DF, "vehicle_frontarmor" }, + { 0x25E0, "vehicle_types" }, +// { 0x25E1, "" }, +// { 0x25E2, "" }, + { 0x25E3, "vehicle_death_jolt" }, +// { 0x25E4, "" }, +// { 0x25E5, "" }, +// { 0x25E6, "" }, + { 0x25E7, "attacker_troop_isonmyteam" }, + { 0x25E8, "has_frontarmor" }, + { 0x25E9, "grenadeshielded" }, +// { 0x25EA, "" }, + { 0x25EB, "bulletshielded" }, +// { 0x25EC, "" }, + { 0x25ED, "script_explosive_bullet_shield" }, +// { 0x25EE, "" }, +// { 0x25EF, "" }, + { 0x25F0, "unstoppable_friendly_fire_shield" }, +// { 0x25F1, "" }, +// { 0x25F2, "" }, + { 0x25F3, "hit_bullet_armor" }, + { 0x25F4, "regen_front_armor" }, + { 0x25F5, "vehicle_kill_rumble_forever" }, + { 0x25F6, "vehicle_kill_badplace_forever" }, + { 0x25F7, "vehicle_badplace" }, +// { 0x25F8, "" }, + { 0x25F9, "no_treads" }, +// { 0x25FA, "" }, +// { 0x25FB, "" }, + { 0x25FC, "do_multiple_treads" }, + { 0x25FD, "vehicle_kill_treads_forever" }, +// { 0x25FE, "" }, + { 0x25FF, "treadfx_freq_scale" }, +// { 0x2600, "" }, +// { 0x2601, "" }, +// { 0x2602, "" }, + { 0x2603, "vehicle_shoot_shock_overlay" }, + { 0x2604, "shock_distance" }, +// { 0x2605, "" }, + { 0x2606, "shellshock_audio_disabled" }, +// { 0x2607, "" }, +// { 0x2608, "" }, + { 0x2609, "get_vehiclenode_any_dynamic" }, +// { 0x260A, "" }, + { 0x260B, "littlebird_landing" }, +// { 0x260C, "" }, +// { 0x260D, "" }, + { 0x260E, "move_turrets_here" }, + { 0x260F, "vehicle_to_dummy" }, + { 0x2610, "move_effects_ent_here" }, +// { 0x2611, "" }, +// { 0x2612, "" }, +// { 0x2613, "" }, + { 0x2614, "script_ghettotag" }, +// { 0x2615, "" }, + { 0x2616, "base_origin" }, + { 0x2617, "dummy_to_vehicle" }, + { 0x2618, "move_riders_here" }, + { 0x2619, "spawn_vehicles_from_targetname_newstyle" }, +// { 0x261A, "" }, + { 0x261B, "spawn_vehicle_from_targetname" }, + { 0x261C, "spawn_vehicles_from_targetname_and_drive" }, +// { 0x261D, "" }, + { 0x261E, "treadfx_maxheight" }, + { 0x261F, "treadfx_immediate" }, + { 0x2620, "skip_treadfx" }, + { 0x2621, "tank_crush" }, + { 0x2622, "final_origin" }, +// { 0x2623, "" }, +// { 0x2624, "" }, + { 0x2625, "loadplayer" }, + { 0x2626, "player_animtree" }, +// { 0x2627, "" }, + { 0x2628, "turret_deleteme" }, +// { 0x2629, "" }, +// { 0x262A, "" }, + { 0x262B, "wheeldirectionchange" }, + { 0x262C, "maingun_fx" }, + { 0x262D, "maingun_fx_override" }, +// { 0x262E, "" }, + { 0x262F, "build_light" }, + { 0x2630, "vehicle_lights" }, + { 0x2631, "vehicle_lights_group_override" }, +// { 0x2632, "" }, + { 0x2633, "group_light" }, + { 0x2634, "vehicle_lights_group" }, + { 0x2635, "lights_on" }, +// { 0x2636, "" }, +// { 0x2637, "" }, +// { 0x2638, "" }, + { 0x2639, "lastlighttime" }, +// { 0x263A, "" }, + { 0x263B, "deathfx_ent" }, + { 0x263C, "lights_off" }, +// { 0x263D, "" }, +// { 0x263E, "" }, +// { 0x263F, "" }, +// { 0x2640, "" }, + { 0x2641, "build_shoot_shock" }, + { 0x2642, "build_idle" }, + { 0x2643, "build_drive" }, + { 0x2644, "build_template" }, +// { 0x2645, "" }, +// { 0x2646, "" }, +// { 0x2647, "" }, +// { 0x2648, "" }, + { 0x2649, "build_mainturret" }, +// { 0x264A, "" }, + { 0x264B, "build_grenadeshield" }, +// { 0x264C, "" }, +// { 0x264D, "" }, +// { 0x264E, "" }, + { 0x264F, "build_unload_groups" }, + { 0x2650, "build_life" }, + { 0x2651, "build_deckdust" }, + { 0x2652, "build_destructible" }, + { 0x2653, "vehicle_csv_export" }, + { 0x2654, "build_localinit" }, + { 0x2655, "get_from_spawnstruct" }, + { 0x2656, "get_from_entity" }, + { 0x2657, "get_from_spawnstruct_target" }, + { 0x2658, "get_from_entity_target" }, +// { 0x2659, "" }, + { 0x265A, "set_lookat_from_dest" }, +// { 0x265B, "" }, +// { 0x265C, "" }, + { 0x265D, "armordamagehints" }, + { 0x265E, "displayingdamagehints" }, + { 0x265F, "damage_hints" }, +// { 0x2660, "" }, +// { 0x2661, "" }, + { 0x2662, "is_dummy" }, + { 0x2663, "apply_truckjunk" }, + { 0x2664, "destroyefx" }, +// { 0x2665, "" }, + { 0x2666, "ghetto_tag_create" }, +// { 0x2667, "" }, + { 0x2668, "vehicle_load_ai_single" }, +// { 0x2669, "" }, +// { 0x266A, "" }, + { 0x266B, "team1" }, + { 0x266C, "build_death_badplace" }, + { 0x266D, "build_death_jolt" }, + { 0x266E, "kill_jolt" }, + { 0x266F, "heli_squashes_stuff" }, + { 0x2670, "_getvehiclespawnerarray_by_spawngroup" }, +// { 0x2671, "" }, +// { 0x2672, "" }, + { 0x2673, "gag_heliride_spawner" }, + { 0x2674, "auto_assign_ride_group" }, + { 0x2675, "vehicle_group_autoasign" }, +// { 0x2676, "" }, +// { 0x2677, "" }, +// { 0x2678, "" }, + { 0x2679, "steering_maxroll" }, + { 0x267A, "leanasitturns" }, + { 0x267B, "steering_maxdelta" }, + { 0x267C, "snowmobile_mount_anims" }, + { 0x267D, "get_my_spline_node" }, +// { 0x267E, "" }, +// { 0x267F, "" }, + { 0x2680, "script_speed" }, + { 0x2681, "attach_vehicle_triggers" }, + { 0x2682, "vehicle_triggers" }, +// { 0x2683, "" }, +// { 0x2684, "" }, + { 0x2685, "manual_tag_linkto" }, + { 0x2686, "littlebird_lands_and_unloads" }, + { 0x2687, "custom_landing" }, +// { 0x2688, "" }, +// { 0x2689, "" }, + { 0x268A, "vehicle_land_beneath_node" }, + { 0x268B, "vehicle_get_riders_by_group" }, + { 0x268C, "get_stage_nodes" }, +// { 0x268D, "" }, +// { 0x268E, "" }, + { 0x268F, "load_side" }, + { 0x2690, "stage_guy" }, +// { 0x2691, "" }, +// { 0x2692, "" }, +// { 0x2693, "" }, + { 0x2694, "vehicle_turret_scan_off" }, + { 0x2695, "vehicle_aim_turret_at_angle" }, +// { 0x2696, "" }, +// { 0x2697, "" }, + { 0x2698, "kill_lights" }, + { 0x2699, "vehicle_lights_on" }, +// { 0x269A, "" }, +// { 0x269B, "" }, +// { 0x269C, "" }, + { 0x269D, "vehicle_switch_paths" }, +// { 0x269E, "" }, +// { 0x269F, "" }, +// { 0x26A0, "" }, +// { 0x26A1, "" }, + { 0x26A2, "strip_suffix" }, +// { 0x26A3, "" }, +// { 0x26A4, "" }, + { 0x26A5, "lastupdatetime" }, + { 0x26A6, "createtimer" }, + { 0x26A7, "basewidth" }, + { 0x26A8, "baseheight" }, +// { 0x26A9, "" }, +// { 0x26AA, "" }, + { 0x26AB, "getcurrentfraction" }, + { 0x26AC, "createprimaryprogressbar" }, + { 0x26AD, "primaryprogressbarheight" }, + { 0x26AE, "primaryprogressbarwidth" }, +// { 0x26AF, "" }, + { 0x26B0, "primaryprogressbarx" }, + { 0x26B1, "createprimaryprogressbartext" }, +// { 0x26B2, "" }, + { 0x26B3, "primaryprogressbartexty" }, +// { 0x26B4, "" }, +// { 0x26B5, "" }, + { 0x26B6, "teamprogressbarheight" }, + { 0x26B7, "teamprogressbarwidth" }, + { 0x26B8, "teamprogressbary" }, + { 0x26B9, "createteamprogressbartext" }, + { 0x26BA, "teamprogressbarfontsize" }, + { 0x26BB, "teamprogressbartexty" }, + { 0x26BC, "hideelem" }, +// { 0x26BD, "" }, + { 0x26BE, "geticonshader" }, + { 0x26BF, "seticonsize" }, + { 0x26C0, "transitionreset" }, + { 0x26C1, "transitionzoomin" }, +// { 0x26C2, "" }, + { 0x26C3, "transitionslidein" }, + { 0x26C4, "transitionslideout" }, +// { 0x26C5, "" }, +// { 0x26C6, "" }, +// { 0x26C7, "" }, +// { 0x26C8, "" }, +// { 0x26C9, "" }, + { 0x26CA, "getdailyref" }, + { 0x26CB, "hud" }, +// { 0x26CC, "" }, +// { 0x26CD, "" }, +// { 0x26CE, "" }, +// { 0x26CF, "" }, +// { 0x26D0, "" }, + { 0x26D1, "placement" }, + { 0x26D2, "getlosingplayers" }, +// { 0x26D3, "" }, + { 0x26D4, "rankingenabled" }, + { 0x26D5, "hardcoremode" }, + { 0x26D6, "xppointspopup" }, + { 0x26D7, "statadd" }, +// { 0x26D8, "" }, +// { 0x26D9, "" }, +// { 0x26DA, "" }, +// { 0x26DB, "" }, + { 0x26DC, "onplayerscore" }, + { 0x26DD, "objectivepointsmod" }, + { 0x26DE, "_setplayerscore" }, + { 0x26DF, "_getplayerscore" }, + { 0x26E0, "giveteamscoreforobjective" }, + { 0x26E1, "otherteam" }, + { 0x26E2, "waswinning" }, +// { 0x26E3, "" }, +// { 0x26E4, "" }, +// { 0x26E5, "" }, +// { 0x26E6, "" }, + { 0x26E7, "_setteamscore" }, +// { 0x26E8, "" }, +// { 0x26E9, "" }, +// { 0x26EA, "" }, +// { 0x26EB, "" }, +// { 0x26EC, "" }, + { 0x26ED, "isobjectivebased" }, +// { 0x26EE, "" }, + { 0x26EF, "sendupdatedteamscores" }, + { 0x26F0, "waittillslowprocessallowed" }, + { 0x26F1, "sendupdateddmscores" }, + { 0x26F2, "updateddmscores" }, +// { 0x26F3, "" }, +// { 0x26F4, "" }, +// { 0x26F5, "" }, + { 0x26F6, "getbetterplayer" }, + { 0x26F7, "updateteamplacement" }, +// { 0x26F8, "" }, +// { 0x26F9, "" }, + { 0x26FA, "onxpevent" }, +// { 0x26FB, "" }, + { 0x26FC, "getpersstat" }, + { 0x26FD, "incplayerstat" }, + { 0x26FE, "giveadrenaline" }, +// { 0x26FF, "" }, +// { 0x2700, "" }, +// { 0x2701, "" }, +// { 0x2702, "" }, +// { 0x2703, "" }, + { 0x2704, "dvar" }, + { 0x2705, "gametweaks" }, +// { 0x2706, "" }, +// { 0x2707, "" }, + { 0x2708, "classtweaks" }, + { 0x2709, "weapontweaks" }, +// { 0x270A, "" }, + { 0x270B, "hudtweaks" }, + { 0x270C, "gettweakabledvar" }, +// { 0x270D, "" }, + { 0x270E, "gettweakablelastvalue" }, +// { 0x270F, "" }, +// { 0x2710, "" }, +// { 0x2711, "" }, +// { 0x2712, "" }, +// { 0x2713, "" }, +// { 0x2714, "" }, +// { 0x2715, "" }, +// { 0x2716, "" }, + { 0x2717, "minefield_kill" }, + { 0x2718, "minefield" }, +// { 0x2719, "" }, +// { 0x271A, "" }, +// { 0x271B, "" }, + { 0x271C, "playerleavearea" }, +// { 0x271D, "" }, +// { 0x271E, "" }, +// { 0x271F, "" }, +// { 0x2720, "" }, + { 0x2721, "radiationsound" }, + { 0x2722, "blackout" }, + { 0x2723, "doradiationdamage" }, +// { 0x2724, "" }, + { 0x2725, "fadeoutblackout" }, + { 0x2726, "destructable_think" }, + { 0x2727, "script_accumulate" }, + { 0x2728, "script_threshold" }, +// { 0x2729, "" }, +// { 0x272A, "" }, + { 0x272B, "blockarea" }, + { 0x272C, "blockentsinarea" }, +// { 0x272D, "" }, +// { 0x272E, "" }, + { 0x272F, "unblockentsinarea" }, + { 0x2730, "callback_hostmigration" }, +// { 0x2731, "" }, +// { 0x2732, "" }, + { 0x2733, "updatetimerpausedness" }, +// { 0x2734, "" }, +// { 0x2735, "" }, +// { 0x2736, "" }, + { 0x2737, "matchstarttimer" }, + { 0x2738, "hostmigrationwaitforplayers" }, +// { 0x2739, "" }, + { 0x273A, "hostmigrationcontrolsfrozen" }, + { 0x273B, "isreallyalive" }, + { 0x273C, "freezecontrolswrapper" }, +// { 0x273D, "" }, +// { 0x273E, "" }, +// { 0x273F, "" }, +// { 0x2740, "" }, + { 0x2741, "waitlongdurationwithgameendtimeupdate" }, +// { 0x2742, "" }, +// { 0x2743, "" }, +// { 0x2744, "" }, +// { 0x2745, "" }, + { 0x2746, "onfreeplayerconnect" }, +// { 0x2747, "" }, +// { 0x2748, "" }, + { 0x2749, "trackplayedtime" }, +// { 0x274A, "" }, +// { 0x274B, "" }, +// { 0x274C, "" }, +// { 0x274D, "" }, + { 0x274E, "updateplayedtime" }, +// { 0x274F, "" }, +// { 0x2750, "" }, +// { 0x2751, "" }, + { 0x2752, "stataddchildbufferedwithmax" }, + { 0x2753, "bufferedstatsmax" }, + { 0x2754, "stataddbufferedwithmax" }, + { 0x2755, "updateteamtime" }, +// { 0x2756, "" }, +// { 0x2757, "" }, + { 0x2758, "teamlimit" }, + { 0x2759, "getteambalance" }, +// { 0x275A, "" }, +// { 0x275B, "" }, + { 0x275C, "axis" }, + { 0x275D, "allies" }, + { 0x275E, "setghilliemodels" }, + { 0x275F, "environment" }, + { 0x2760, "setteammodels" }, +// { 0x2761, "" }, +// { 0x2762, "" }, +// { 0x2763, "" }, +// { 0x2764, "" }, +// { 0x2765, "" }, + { 0x2766, "updatefreeplayertimes" }, + { 0x2767, "updatefreeplayedtime" }, + { 0x2768, "getjointeampermissions" }, + { 0x2769, "onplayerspawned" }, + { 0x276A, "getteamname" }, +// { 0x276B, "" }, + { 0x276C, "getteamforfeitedstring" }, +// { 0x276D, "" }, + { 0x276E, "getteamicon" }, + { 0x276F, "getteamhudicon" }, +// { 0x2770, "" }, + { 0x2771, "getteamvoiceprefix" }, +// { 0x2772, "" }, +// { 0x2773, "" }, +// { 0x2774, "" }, +// { 0x2775, "" }, +// { 0x2776, "" }, +// { 0x2777, "" }, + { 0x2778, "getteamcolor" }, + { 0x2779, "getteamcratemodel" }, + { 0x277A, "getteamdeploymodel" }, + { 0x277B, "initedentityheadicons" }, +// { 0x277C, "" }, +// { 0x277D, "" }, + { 0x277E, "getplayerforguid" }, +// { 0x277F, "" }, +// { 0x2780, "" }, +// { 0x2781, "" }, + { 0x2782, "setteamheadicon" }, +// { 0x2783, "" }, + { 0x2784, "setplayerheadicon" }, + { 0x2785, "keepiconpositioned" }, + { 0x2786, "destroyheadiconsondeath" }, +// { 0x2787, "" }, +// { 0x2788, "" }, + { 0x2789, "trophyarray" }, +// { 0x278A, "" }, + { 0x278B, "createbombsquadmodel" }, + { 0x278C, "weaponname" }, +// { 0x278D, "" }, + { 0x278E, "ammo" }, + { 0x278F, "trigger" }, +// { 0x2790, "" }, + { 0x2791, "trophyuselistener" }, + { 0x2792, "setselfusable" }, + { 0x2793, "notusableforjoiningplayers" }, + { 0x2794, "giveperk" }, + { 0x2795, "trophyplayerspawnwaiter" }, + { 0x2796, "trophydisconnectwaiter" }, +// { 0x2797, "" }, + { 0x2798, "grenades" }, + { 0x2799, "missiles" }, +// { 0x279A, "" }, +// { 0x279B, "" }, +// { 0x279C, "" }, + { 0x279D, "projectileexplode" }, + { 0x279E, "empgrenadeexplode" }, + { 0x279F, "mine_explode" }, + { 0x27A0, "trophydamage" }, +// { 0x27A1, "" }, + { 0x27A2, "idflags_penetration" }, + { 0x27A3, "wasdamagedfrombulletpenetration" }, +// { 0x27A4, "" }, + { 0x27A5, "trophybreak" }, + { 0x27A6, "startmonitoringflash" }, + { 0x27A7, "stopmonitoringflash" }, + { 0x27A8, "usingremote" }, + { 0x27A9, "stunscaler" }, +// { 0x27AA, "" }, + { 0x27AB, "flashduration" }, + { 0x27AC, "flashrumbleduration" }, +// { 0x27AD, "" }, +// { 0x27AE, "" }, +// { 0x27AF, "" }, +// { 0x27B0, "" }, +// { 0x27B1, "" }, +// { 0x27B2, "" }, +// { 0x27B3, "" }, + { 0x27B4, "checktoturnoffemp" }, +// { 0x27B5, "" }, + { 0x27B6, "empplayer" }, +// { 0x27B7, "" }, +// { 0x27B8, "" }, +// { 0x27B9, "" }, + { 0x27BA, "stingerstage" }, +// { 0x27BB, "" }, + { 0x27BC, "stingerlockstarttime" }, + { 0x27BD, "stingerlostsightlinetime" }, +// { 0x27BE, "" }, +// { 0x27BF, "" }, + { 0x27C0, "stingeruseentered" }, + { 0x27C1, "resetstingerlockingondeath" }, +// { 0x27C2, "" }, + { 0x27C3, "ac130" }, + { 0x27C4, "planemodel" }, + { 0x27C5, "loopstingerlockingfeedback" }, +// { 0x27C6, "" }, + { 0x27C7, "locksighttest" }, + { 0x27C8, "stingerdebugdraw" }, +// { 0x27C9, "" }, + { 0x27CA, "gettargetlist" }, +// { 0x27CB, "" }, +// { 0x27CC, "" }, + { 0x27CD, "littlebirds" }, + { 0x27CE, "ugvs" }, + { 0x27CF, "stingerusageloop" }, +// { 0x27D0, "" }, + { 0x27D1, "javelinstage" }, + { 0x27D2, "javelinpoints" }, +// { 0x27D3, "" }, +// { 0x27D4, "" }, + { 0x27D5, "javelintargetpoint" }, + { 0x27D6, "javelintargetnormal" }, + { 0x27D7, "javelinlockstarttime" }, +// { 0x27D8, "" }, + { 0x27D9, "javelinuseentered" }, + { 0x27DA, "currentlylocking" }, + { 0x27DB, "currentlylocked" }, + { 0x27DC, "javelintarget" }, +// { 0x27DD, "" }, +// { 0x27DE, "" }, + { 0x27DF, "lockmissesincr" }, + { 0x27E0, "lockmissespassedthreshold" }, + { 0x27E1, "targetpointtooclose" }, +// { 0x27E2, "" }, +// { 0x27E3, "" }, +// { 0x27E4, "" }, +// { 0x27E5, "" }, +// { 0x27E6, "" }, +// { 0x27E7, "" }, + { 0x27E8, "vehiclelocksighttest" }, + { 0x27E9, "javelinlockvehicle" }, + { 0x27EA, "stillvalidjavelinlock" }, + { 0x27EB, "shellshockondamage" }, +// { 0x27EC, "" }, + { 0x27ED, "isusingremote" }, + { 0x27EE, "bloodeffect" }, + { 0x27EF, "c4_earthquake" }, + { 0x27F0, "barrel_earthquake" }, + { 0x27F1, "artillery_earthquake" }, + { 0x27F2, "attachmentgroup" }, + { 0x27F3, "getattachmentlist" }, + { 0x27F4, "scavenger_altmode" }, + { 0x27F5, "scavenger_secondary" }, + { 0x27F6, "getintproperty" }, + { 0x27F7, "riotshieldxpbullets" }, +// { 0x27F8, "" }, +// { 0x27F9, "" }, +// { 0x27FA, "" }, +// { 0x27FB, "" }, +// { 0x27FC, "" }, +// { 0x27FD, "" }, + { 0x27FE, "minedetectionradius" }, + { 0x27FF, "minedetectionheight" }, +// { 0x2800, "" }, +// { 0x2801, "" }, +// { 0x2802, "" }, +// { 0x2803, "" }, +// { 0x2804, "" }, +// { 0x2805, "" }, +// { 0x2806, "" }, + { 0x2807, "mine_beacon" }, + { 0x2808, "delayminetime" }, + { 0x2809, "stingerfxid" }, + { 0x280A, "primary_weapon_array" }, + { 0x280B, "side_arm_array" }, + { 0x280C, "grenade_array" }, +// { 0x280D, "" }, +// { 0x280E, "" }, +// { 0x280F, "" }, + { 0x2810, "dumpit" }, + { 0x2811, "bombsquadwaiter" }, + { 0x2812, "bombsquadvisibilityupdater" }, +// { 0x2813, "" }, + { 0x2814, "hasdonecombat" }, +// { 0x2815, "" }, + { 0x2816, "concussionendtime" }, +// { 0x2817, "" }, + { 0x2818, "trackingweaponshots" }, +// { 0x2819, "" }, + { 0x281A, "trackingweaponhits" }, + { 0x281B, "trackingweaponheadshots" }, + { 0x281C, "trackingweapondeaths" }, +// { 0x281D, "" }, +// { 0x281E, "" }, +// { 0x281F, "" }, + { 0x2820, "tookweaponfrom" }, +// { 0x2821, "" }, + { 0x2822, "getweaponclass" }, +// { 0x2823, "" }, + { 0x2824, "watchjavelinusage" }, + { 0x2825, "lastdroppableweapon" }, + { 0x2826, "hitsthismag" }, +// { 0x2827, "" }, + { 0x2828, "bothbarrels" }, +// { 0x2829, "" }, +// { 0x282A, "" }, + { 0x282B, "class_num" }, + { 0x282C, "loadoutprimarybuff" }, +// { 0x282D, "" }, +// { 0x282E, "" }, +// { 0x282F, "" }, + { 0x2830, "watchstartweaponchange" }, +// { 0x2831, "" }, +// { 0x2832, "" }, +// { 0x2833, "" }, +// { 0x2834, "" }, + { 0x2835, "dropweaponfordeath" }, +// { 0x2836, "" }, + { 0x2837, "ownersattacker" }, + { 0x2838, "detachifattached" }, + { 0x2839, "deletepickupafterawhile" }, + { 0x283A, "getitemweaponname" }, + { 0x283B, "watchpickup" }, +// { 0x283C, "" }, +// { 0x283D, "" }, + { 0x283E, "dropscavengerfordeath" }, + { 0x283F, "getweaponbasedgrenadecount" }, +// { 0x2840, "" }, +// { 0x2841, "" }, +// { 0x2842, "" }, + { 0x2843, "setweaponstat" }, +// { 0x2844, "" }, +// { 0x2845, "" }, +// { 0x2846, "" }, +// { 0x2847, "" }, +// { 0x2848, "" }, +// { 0x2849, "" }, +// { 0x284A, "" }, + { 0x284B, "genericchallenge" }, + { 0x284C, "checkhit" }, +// { 0x284D, "" }, + { 0x284E, "gotpullbacknotify" }, + { 0x284F, "claymorearray" }, +// { 0x2850, "" }, +// { 0x2851, "" }, + { 0x2852, "originalowner" }, + { 0x2853, "watchsmokeexplode" }, +// { 0x2854, "" }, +// { 0x2855, "" }, + { 0x2856, "addmissiletosighttraces" }, +// { 0x2857, "" }, +// { 0x2858, "" }, + { 0x2859, "setaltsceneobj" }, +// { 0x285A, "" }, +// { 0x285B, "" }, +// { 0x285C, "" }, + { 0x285D, "threwback" }, +// { 0x285E, "" }, +// { 0x285F, "" }, +// { 0x2860, "" }, + { 0x2861, "equipmentwatchuse" }, +// { 0x2862, "" }, + { 0x2863, "c4activate" }, +// { 0x2864, "" }, + { 0x2865, "waschained" }, +// { 0x2866, "" }, + { 0x2867, "c4detectiontrigger" }, + { 0x2868, "detectid" }, + { 0x2869, "bombsquadicon" }, +// { 0x286A, "" }, + { 0x286B, "detecticonwaiter" }, +// { 0x286C, "" }, + { 0x286D, "bombsquadids" }, + { 0x286E, "setupbombsquad" }, + { 0x286F, "bombsquadicons" }, + { 0x2870, "showheadicon" }, + { 0x2871, "get_damageable_player_pos" }, +// { 0x2872, "" }, + { 0x2873, "get_damageable_grenade_pos" }, + { 0x2874, "get_damageable_grenade" }, + { 0x2875, "get_damageable_sentry" }, + { 0x2876, "get_damageable_mine" }, +// { 0x2877, "" }, + { 0x2878, "debugcircle" }, + { 0x2879, "isaltmodeweapon" }, +// { 0x287A, "" }, + { 0x287B, "isriotshield" }, + { 0x287C, "isoffhandweapon" }, +// { 0x287D, "" }, + { 0x287E, "isgrenade" }, + { 0x287F, "updatesavedlastweapon" }, +// { 0x2880, "" }, +// { 0x2881, "" }, + { 0x2882, "isdeathstreakweapon" }, + { 0x2883, "clearempondeath" }, +// { 0x2884, "" }, + { 0x2885, "getbaseweaponname" }, + { 0x2886, "weaponspeed" }, + { 0x2887, "movespeedscaler" }, +// { 0x2888, "" }, + { 0x2889, "setrecoilscale" }, + { 0x288A, "buildweapondata" }, + { 0x288B, "basename" }, + { 0x288C, "assetname" }, + { 0x288D, "variants" }, +// { 0x288E, "" }, + { 0x288F, "isstuck" }, +// { 0x2890, "" }, + { 0x2891, "playercardsplashnotify" }, +// { 0x2892, "" }, + { 0x2893, "turret_monitoruse" }, + { 0x2894, "turret_playerthread" }, +// { 0x2895, "" }, +// { 0x2896, "" }, +// { 0x2897, "" }, +// { 0x2898, "" }, +// { 0x2899, "" }, + { 0x289A, "minedamagemonitor" }, +// { 0x289B, "" }, +// { 0x289C, "" }, + { 0x289D, "mineselfdestruct" }, + { 0x289E, "minebounce" }, +// { 0x289F, "" }, + { 0x28A0, "playspinnerfx" }, + { 0x28A1, "minedamagedebug" }, +// { 0x28A2, "" }, +// { 0x28A3, "" }, + { 0x28A4, "watchmineusage" }, + { 0x28A5, "minedeleteondisconnect" }, + { 0x28A6, "minethrown" }, + { 0x28A7, "minebeacon" }, + { 0x28A8, "minebeaconteamupdater" }, + { 0x28A9, "maxlives" }, +// { 0x28AA, "" }, + { 0x28AB, "maxevents" }, +// { 0x28AC, "" }, + { 0x28AD, "maxlogclients" }, + { 0x28AE, "maxnumchallengesperplayer" }, + { 0x28AF, "maxnumawardsperplayer" }, + { 0x28B0, "getmatchdatetime" }, + { 0x28B1, "logkillstreakevent" }, + { 0x28B2, "clientid" }, + { 0x28B3, "loggameevent" }, +// { 0x28B4, "" }, + { 0x28B5, "logmultikill" }, +// { 0x28B6, "" }, + { 0x28B7, "spawnpos" }, + { 0x28B8, "wasti" }, + { 0x28B9, "spawntime" }, + { 0x28BA, "logplayerxp" }, +// { 0x28BB, "" }, + { 0x28BC, "curclass" }, +// { 0x28BD, "" }, + { 0x28BE, "cac_getweaponattachment" }, +// { 0x28BF, "" }, + { 0x28C0, "cac_getoffhand" }, +// { 0x28C1, "" }, + { 0x28C2, "cac_getdeathstreak" }, + { 0x28C3, "cac_getweaponbuff" }, +// { 0x28C4, "" }, + { 0x28C5, "classtablename" }, +// { 0x28C6, "" }, +// { 0x28C7, "" }, + { 0x28C8, "table_getoffhand" }, + { 0x28C9, "table_getequipment" }, +// { 0x28CA, "" }, + { 0x28CB, "table_getdeathstreak" }, + { 0x28CC, "table_getweaponbuff" }, + { 0x28CD, "table_getkillstreak" }, + { 0x28CE, "validateattachment" }, +// { 0x28CF, "" }, + { 0x28D0, "isattachment" }, + { 0x28D1, "logplayerdata" }, +// { 0x28D2, "" }, +// { 0x28D3, "" }, +// { 0x28D4, "" }, +// { 0x28D5, "" }, + { 0x28D6, "doublebubblesort" }, + { 0x28D7, "gameendlistener" }, +// { 0x28D8, "" }, + { 0x28D9, "canlogclient" }, + { 0x28DA, "canlogevent" }, + { 0x28DB, "canlogkillstreak" }, + { 0x28DC, "canloglife" }, + { 0x28DD, "logweaponstat" }, +// { 0x28DE, "" }, +// { 0x28DF, "" }, +// { 0x28E0, "" }, + { 0x28E1, "logaward" }, +// { 0x28E2, "" }, +// { 0x28E3, "" }, +// { 0x28E4, "" }, + { 0x28E5, "tryusepaint" }, +// { 0x28E6, "" }, + { 0x28E7, "tryusesteadyaim" }, +// { 0x28E8, "" }, +// { 0x28E9, "" }, +// { 0x28EA, "" }, + { 0x28EB, "tryusescavenger" }, +// { 0x28EC, "" }, +// { 0x28ED, "" }, + { 0x28EE, "tryusecoldblooded" }, +// { 0x28EF, "" }, + { 0x28F0, "tryuseblastshield" }, + { 0x28F1, "tryusesitrep" }, + { 0x28F2, "tryuseironlungs" }, +// { 0x28F3, "" }, + { 0x28F4, "tryusedeadsilence" }, +// { 0x28F5, "" }, +// { 0x28F6, "" }, + { 0x28F7, "_unsetextraperks" }, +// { 0x28F8, "" }, +// { 0x28F9, "" }, + { 0x28FA, "isperkstreakon" }, +// { 0x28FB, "" }, + { 0x28FC, "available" }, +// { 0x28FD, "" }, + { 0x28FE, "_giveweapon" }, + { 0x28FF, "unsetscrambler" }, +// { 0x2900, "" }, + { 0x2901, "inplayerscrambler" }, + { 0x2902, "deployedscrambler" }, + { 0x2903, "scramblers" }, + { 0x2904, "cleanarray" }, + { 0x2905, "monitorscrambleruse" }, +// { 0x2906, "" }, +// { 0x2907, "" }, + { 0x2908, "scramblerbeepsounds" }, +// { 0x2909, "" }, +// { 0x290A, "" }, + { 0x290B, "scrambleruselistener" }, +// { 0x290C, "" }, + { 0x290D, "scramproxyactive" }, +// { 0x290E, "" }, + { 0x290F, "setportableradar" }, + { 0x2910, "unsetportableradar" }, + { 0x2911, "deleteportableradar" }, + { 0x2912, "inplayerportableradar" }, + { 0x2913, "deployedportableradar" }, + { 0x2914, "monitorportableradaruse" }, + { 0x2915, "portableradarsetup" }, +// { 0x2916, "" }, + { 0x2917, "portableradarbeepsounds" }, + { 0x2918, "portableradardamagelistener" }, + { 0x2919, "portableradaruselistener" }, +// { 0x291A, "" }, +// { 0x291B, "" }, + { 0x291C, "spawnglowmodel" }, +// { 0x291D, "" }, +// { 0x291E, "" }, +// { 0x291F, "" }, + { 0x2920, "perksetfuncs" }, + { 0x2921, "perkunsetfuncs" }, + { 0x2922, "fauxperks" }, +// { 0x2923, "" }, +// { 0x2924, "" }, +// { 0x2925, "" }, + { 0x2926, "unsetsiege" }, +// { 0x2927, "" }, +// { 0x2928, "" }, + { 0x2929, "setlocaljammer" }, + { 0x292A, "unsetlocaljammer" }, + { 0x292B, "setthermal" }, +// { 0x292C, "" }, + { 0x292D, "setblackbox" }, +// { 0x292E, "" }, + { 0x292F, "setlightweight" }, +// { 0x2930, "" }, +// { 0x2931, "" }, + { 0x2932, "unsetsteelnerves" }, +// { 0x2933, "" }, + { 0x2934, "unsetdelaymine" }, +// { 0x2935, "" }, + { 0x2936, "unsetchallenger" }, +// { 0x2937, "" }, +// { 0x2938, "" }, +// { 0x2939, "" }, +// { 0x293A, "" }, +// { 0x293B, "" }, +// { 0x293C, "" }, +// { 0x293D, "" }, + { 0x293E, "unsetac130" }, +// { 0x293F, "" }, +// { 0x2940, "" }, + { 0x2941, "setpredatormissile" }, +// { 0x2942, "" }, +// { 0x2943, "" }, +// { 0x2944, "" }, + { 0x2945, "setprecision_airstrike" }, + { 0x2946, "unsetprecision_airstrike" }, +// { 0x2947, "" }, + { 0x2948, "unsethelicopterminigun" }, +// { 0x2949, "" }, + { 0x294A, "unsetonemanarmy" }, + { 0x294B, "setlittlebirdsupport" }, +// { 0x294C, "" }, + { 0x294D, "settacticalinsertion" }, +// { 0x294E, "" }, + { 0x294F, "setsteadyaimpro" }, +// { 0x2950, "" }, +// { 0x2951, "" }, + { 0x2952, "unsetstunresistance" }, + { 0x2953, "setmarksman" }, + { 0x2954, "unsetmarksman" }, +// { 0x2955, "" }, + { 0x2956, "unsetdoubleload" }, +// { 0x2957, "" }, +// { 0x2958, "" }, +// { 0x2959, "" }, + { 0x295A, "unsethardshell" }, +// { 0x295B, "" }, +// { 0x295C, "" }, +// { 0x295D, "" }, +// { 0x295E, "" }, +// { 0x295F, "" }, +// { 0x2960, "" }, + { 0x2961, "setoverkillpro" }, + { 0x2962, "unsetoverkillpro" }, + { 0x2963, "setcombathigh" }, + { 0x2964, "unsetcombathigh" }, +// { 0x2965, "" }, + { 0x2966, "unsetlightarmor" }, + { 0x2967, "setrevenge" }, + { 0x2968, "unsetrevenge" }, +// { 0x2969, "" }, +// { 0x296A, "" }, + { 0x296B, "setfinalstand" }, + { 0x296C, "unsetfinalstand" }, + { 0x296D, "setjuiced" }, +// { 0x296E, "" }, + { 0x296F, "setcarepackage" }, + { 0x2970, "unsetcarepackage" }, +// { 0x2971, "" }, +// { 0x2972, "" }, + { 0x2973, "setuav" }, + { 0x2974, "unsetuav" }, + { 0x2975, "precacheshaders" }, + { 0x2976, "validateperk" }, +// { 0x2977, "" }, + { 0x2978, "omaclasschanged" }, +// { 0x2979, "" }, +// { 0x297A, "" }, + { 0x297B, "drawline" }, +// { 0x297C, "" }, + { 0x297D, "xpscaler" }, +// { 0x297E, "" }, + { 0x297F, "objidpainted" }, +// { 0x2980, "" }, + { 0x2981, "bulletdamagemod" }, +// { 0x2982, "" }, + { 0x2983, "explosivedamagemod" }, + { 0x2984, "blastshieldmod" }, + { 0x2985, "dangerclosemod" }, + { 0x2986, "haslightarmor" }, + { 0x2987, "damageblockedtotal" }, + { 0x2988, "initperkdvars" }, + { 0x2989, "armorvestdefmod" }, +// { 0x298A, "" }, + { 0x298B, "riotshieldmod" }, +// { 0x298C, "" }, + { 0x298D, "specialty" }, + { 0x298E, "gambitusetracker" }, + { 0x298F, "giveblindeyeafterspawn" }, +// { 0x2990, "" }, +// { 0x2991, "" }, +// { 0x2992, "" }, +// { 0x2993, "" }, +// { 0x2994, "" }, + { 0x2995, "objpointscale" }, +// { 0x2996, "" }, +// { 0x2997, "" }, +// { 0x2998, "" }, + { 0x2999, "basealpha" }, + { 0x299A, "deleteobjpoint" }, + { 0x299B, "setoriginbyname" }, +// { 0x299C, "" }, + { 0x299D, "getobjpointbyindex" }, + { 0x299E, "startflashing" }, + { 0x299F, "stopflashing" }, + { 0x29A0, "script_gameobjectname" }, + { 0x29A1, "numgametypereservedobjectives" }, + { 0x29A2, "objidstart" }, + { 0x29A3, "carryobject" }, + { 0x29A4, "claimtrigger" }, + { 0x29A5, "canpickupobject" }, + { 0x29A6, "killedinuse" }, +// { 0x29A7, "" }, +// { 0x29A8, "" }, +// { 0x29A9, "" }, +// { 0x29AA, "" }, + { 0x29AB, "triggertype" }, + { 0x29AC, "baseorigin" }, +// { 0x29AD, "" }, + { 0x29AE, "offset3d" }, +// { 0x29AF, "" }, +// { 0x29B0, "" }, +// { 0x29B1, "" }, +// { 0x29B2, "" }, +// { 0x29B3, "" }, +// { 0x29B4, "" }, +// { 0x29B5, "" }, +// { 0x29B6, "" }, + { 0x29B7, "isresetting" }, + { 0x29B8, "interactteam" }, + { 0x29B9, "allowweapons" }, + { 0x29BA, "worldicons" }, + { 0x29BB, "carriervisible" }, + { 0x29BC, "visibleteam" }, +// { 0x29BD, "" }, +// { 0x29BE, "" }, + { 0x29BF, "onpickup" }, + { 0x29C0, "onreset" }, +// { 0x29C1, "" }, + { 0x29C2, "usetime" }, + { 0x29C3, "userate" }, +// { 0x29C4, "" }, +// { 0x29C5, "" }, + { 0x29C6, "numtouching" }, +// { 0x29C7, "" }, + { 0x29C8, "claimplayer" }, +// { 0x29C9, "" }, + { 0x29CA, "lastclaimtime" }, + { 0x29CB, "carryobjectusethink" }, + { 0x29CC, "carryobjectproxthink" }, + { 0x29CD, "carryobjectproxthinkinstant" }, +// { 0x29CE, "" }, + { 0x29CF, "onenduse" }, +// { 0x29D0, "" }, +// { 0x29D1, "" }, +// { 0x29D2, "" }, + { 0x29D3, "onpickupfailed" }, +// { 0x29D4, "" }, +// { 0x29D5, "" }, +// { 0x29D6, "" }, +// { 0x29D7, "" }, +// { 0x29D8, "" }, +// { 0x29D9, "" }, +// { 0x29DA, "" }, + { 0x29DB, "setdropped" }, + { 0x29DC, "body" }, +// { 0x29DD, "" }, +// { 0x29DE, "" }, + { 0x29DF, "clearcarrier" }, + { 0x29E0, "pickuptimeout" }, + { 0x29E1, "autoresettime" }, +// { 0x29E2, "" }, + { 0x29E3, "trackcarrier" }, +// { 0x29E4, "" }, + { 0x29E5, "deleteuseobject" }, + { 0x29E6, "_objective_delete" }, +// { 0x29E7, "" }, + { 0x29E8, "keyobject" }, + { 0x29E9, "onuse" }, +// { 0x29EA, "" }, +// { 0x29EB, "" }, +// { 0x29EC, "" }, +// { 0x29ED, "" }, + { 0x29EE, "onbeginuse" }, + { 0x29EF, "cantusehintthink" }, +// { 0x29F0, "" }, + { 0x29F1, "starttime" }, +// { 0x29F2, "" }, + { 0x29F3, "proxtriggerthink" }, +// { 0x29F4, "" }, +// { 0x29F5, "" }, + { 0x29F6, "requireslos" }, + { 0x29F7, "setclaimteam" }, +// { 0x29F8, "" }, + { 0x29F9, "nousebar" }, +// { 0x29FA, "" }, +// { 0x29FB, "" }, + { 0x29FC, "proxbartext" }, + { 0x29FD, "lastuserate" }, +// { 0x29FE, "" }, +// { 0x29FF, "" }, +// { 0x2A00, "" }, +// { 0x2A01, "" }, + { 0x2A02, "attachusemodel" }, + { 0x2A03, "attachedusemodel" }, +// { 0x2A04, "" }, + { 0x2A05, "lastnonuseweapon" }, + { 0x2A06, "detachusemodels" }, +// { 0x2A07, "" }, +// { 0x2A08, "" }, + { 0x2A09, "personalusebar" }, + { 0x2A0A, "updatetrigger" }, +// { 0x2A0B, "" }, + { 0x2A0C, "updateworldicon" }, + { 0x2A0D, "updatetimer" }, +// { 0x2A0E, "" }, + { 0x2A0F, "updatecompassicon" }, + { 0x2A10, "shouldpingobject" }, + { 0x2A11, "getupdateteams" }, +// { 0x2A12, "" }, +// { 0x2A13, "" }, + { 0x2A14, "setownerteam" }, +// { 0x2A15, "" }, + { 0x2A16, "setusetime" }, + { 0x2A17, "setusetext" }, +// { 0x2A18, "" }, + { 0x2A19, "setteamusetext" }, + { 0x2A1A, "setusehinttext" }, + { 0x2A1B, "allowcarry" }, + { 0x2A1C, "allowuse" }, + { 0x2A1D, "setvisibleteam" }, + { 0x2A1E, "setmodelvisibility" }, + { 0x2A1F, "_suicide" }, +// { 0x2A20, "" }, + { 0x2A21, "setcarriervisible" }, + { 0x2A22, "setcanuse" }, +// { 0x2A23, "" }, + { 0x2A24, "set2dicon" }, +// { 0x2A25, "" }, +// { 0x2A26, "" }, + { 0x2A27, "worlduseicons" }, + { 0x2A28, "setcarryicon" }, + { 0x2A29, "disableobject" }, + { 0x2A2A, "enableobject" }, + { 0x2A2B, "getrelativeteam" }, + { 0x2A2C, "isfriendlyteam" }, +// { 0x2A2D, "" }, + { 0x2A2E, "isteam" }, +// { 0x2A2F, "" }, + { 0x2A30, "getenemyteam" }, +// { 0x2A31, "" }, +// { 0x2A32, "" }, + { 0x2A33, "getlabel" }, + { 0x2A34, "script_label" }, +// { 0x2A35, "" }, +// { 0x2A36, "" }, + { 0x2A37, "recoilscale" }, +// { 0x2A38, "" }, + { 0x2A39, "perkusedeathtracker" }, + { 0x2A3A, "_useperkenabled" }, + { 0x2A3B, "endgame" }, + { 0x2A3C, "attackertable" }, +// { 0x2A3D, "" }, +// { 0x2A3E, "" }, +// { 0x2A3F, "" }, + { 0x2A40, "nukedetonated" }, + { 0x2A41, "nukevisionset" }, +// { 0x2A42, "" }, + { 0x2A43, "tracksiegeenable" }, +// { 0x2A44, "" }, +// { 0x2A45, "" }, +// { 0x2A46, "" }, + { 0x2A47, "killstreakscaler" }, +// { 0x2A48, "" }, +// { 0x2A49, "" }, + { 0x2A4A, "killstreakthink" }, + { 0x2A4B, "givekillstreak" }, + { 0x2A4C, "killstreaksplashnotify" }, + { 0x2A4D, "onemanarmyweaponchangetracker" }, +// { 0x2A4E, "" }, +// { 0x2A4F, "" }, +// { 0x2A50, "" }, +// { 0x2A51, "" }, +// { 0x2A52, "" }, + { 0x2A53, "omausebar" }, + { 0x2A54, "clearprevioustispawnpoint" }, +// { 0x2A55, "" }, +// { 0x2A56, "" }, + { 0x2A57, "tispawnposition" }, +// { 0x2A58, "" }, +// { 0x2A59, "" }, +// { 0x2A5A, "" }, +// { 0x2A5B, "" }, + { 0x2A5C, "playerspawnpos" }, +// { 0x2A5D, "" }, + { 0x2A5E, "glowstickteamupdater" }, +// { 0x2A5F, "" }, +// { 0x2A60, "" }, +// { 0x2A61, "" }, + { 0x2A62, "updateenemyuse" }, +// { 0x2A63, "" }, +// { 0x2A64, "" }, +// { 0x2A65, "" }, + { 0x2A66, "makeenemyusable" }, + { 0x2A67, "getotherteam" }, +// { 0x2A68, "" }, +// { 0x2A69, "" }, +// { 0x2A6A, "" }, + { 0x2A6B, "juicedoverlay" }, +// { 0x2A6C, "" }, + { 0x2A6D, "juicedicon" }, + { 0x2A6E, "unsetjuicedonride" }, +// { 0x2A6F, "" }, + { 0x2A70, "combathighoverlay" }, +// { 0x2A71, "" }, + { 0x2A72, "combathighicon" }, + { 0x2A73, "unsetcombathighondeath" }, +// { 0x2A74, "" }, + { 0x2A75, "givelightarmor" }, +// { 0x2A76, "" }, + { 0x2A77, "removelightarmorondeath" }, + { 0x2A78, "removelightarmor" }, +// { 0x2A79, "" }, +// { 0x2A7A, "" }, +// { 0x2A7B, "" }, + { 0x2A7C, "pintoscreenedge" }, +// { 0x2A7D, "" }, + { 0x2A7E, "is3d" }, + { 0x2A7F, "revengeparams" }, +// { 0x2A80, "" }, + { 0x2A81, "watchrevengekill" }, +// { 0x2A82, "" }, +// { 0x2A83, "" }, + { 0x2A84, "watchrevengevictimdisconnected" }, + { 0x2A85, "objidfriendly" }, + { 0x2A86, "spectateoverride" }, +// { 0x2A87, "" }, + { 0x2A88, "updatespectatesettings" }, + { 0x2A89, "setspectatepermissions" }, +// { 0x2A8A, "" }, + { 0x2A8B, "allowfreespectate" }, +// { 0x2A8C, "" }, + { 0x2A8D, "registeradrenalineinfo" }, +// { 0x2A8E, "" }, + { 0x2A8F, "killedplayers" }, +// { 0x2A90, "" }, +// { 0x2A91, "" }, +// { 0x2A92, "" }, +// { 0x2A93, "" }, + { 0x2A94, "lastkilltime" }, +// { 0x2A95, "" }, +// { 0x2A96, "" }, +// { 0x2A97, "" }, +// { 0x2A98, "" }, +// { 0x2A99, "" }, + { 0x2A9A, "attackers" }, + { 0x2A9B, "attackerdata" }, +// { 0x2A9C, "" }, + { 0x2A9D, "xpeventpopup" }, + { 0x2A9E, "assistedsuicide" }, +// { 0x2A9F, "" }, + { 0x2AA0, "killstreaks" }, +// { 0x2AA1, "" }, + { 0x2AA2, "islongshot" }, + { 0x2AA3, "checkmatchdatakills" }, + { 0x2AA4, "idflags" }, +// { 0x2AA5, "" }, +// { 0x2AA6, "" }, + { 0x2AA7, "loadoutsecondary" }, + { 0x2AA8, "matchmakinggame" }, + { 0x2AA9, "setplayerstatiflower" }, +// { 0x2AAA, "" }, +// { 0x2AAB, "" }, +// { 0x2AAC, "" }, + { 0x2AAD, "campercheck" }, +// { 0x2AAE, "" }, + { 0x2AAF, "lastkilllocation" }, +// { 0x2AB0, "" }, + { 0x2AB1, "consolation" }, + { 0x2AB2, "proximityassist" }, +// { 0x2AB3, "" }, +// { 0x2AB4, "" }, + { 0x2AB5, "longshot" }, + { 0x2AB6, "execution" }, +// { 0x2AB7, "" }, +// { 0x2AB8, "" }, + { 0x2AB9, "defendedplayer" }, + { 0x2ABA, "postdeathkill" }, + { 0x2ABB, "backstab" }, +// { 0x2ABC, "" }, +// { 0x2ABD, "" }, + { 0x2ABE, "teamplayercardsplash" }, +// { 0x2ABF, "" }, +// { 0x2AC0, "" }, + { 0x2AC1, "buzzkill" }, +// { 0x2AC2, "" }, +// { 0x2AC3, "" }, + { 0x2AC4, "monitorhealed" }, +// { 0x2AC5, "" }, + { 0x2AC6, "monitorcratejacking" }, +// { 0x2AC7, "" }, + { 0x2AC8, "quickcommands" }, + { 0x2AC9, "spamdelay" }, + { 0x2ACA, "quickstatements" }, +// { 0x2ACB, "" }, + { 0x2ACC, "doquickmessage" }, + { 0x2ACD, "quickmessagetoall" }, + { 0x2ACE, "saveheadicon" }, + { 0x2ACF, "oldheadicon" }, + { 0x2AD0, "oldheadiconteam" }, +// { 0x2AD1, "" }, +// { 0x2AD2, "" }, +// { 0x2AD3, "" }, + { 0x2AD4, "forceend" }, +// { 0x2AD5, "" }, + { 0x2AD6, "spectator" }, +// { 0x2AD7, "" }, +// { 0x2AD8, "" }, + { 0x2AD9, "getteamassignment" }, + { 0x2ADA, "menuautoassign" }, + { 0x2ADB, "closemenus" }, + { 0x2ADC, "switching_teams" }, + { 0x2ADD, "joining_team" }, + { 0x2ADE, "leaving_team" }, + { 0x2ADF, "beginclasschoice" }, + { 0x2AE0, "allowclasschoice" }, + { 0x2AE1, "predictabouttospawnplayerovertime" }, +// { 0x2AE2, "" }, +// { 0x2AE3, "" }, +// { 0x2AE4, "" }, + { 0x2AE5, "menuallies" }, + { 0x2AE6, "hasspawned" }, +// { 0x2AE7, "" }, +// { 0x2AE8, "" }, +// { 0x2AE9, "" }, +// { 0x2AEA, "" }, + { 0x2AEB, "getclasschoice" }, +// { 0x2AEC, "" }, + { 0x2AED, "lastclass" }, +// { 0x2AEE, "" }, +// { 0x2AEF, "" }, + { 0x2AF0, "tag_stowed_hip" }, +// { 0x2AF1, "" }, + { 0x2AF2, "spawnclient" }, +// { 0x2AF3, "" }, + { 0x2AF4, "removefromteamcount" }, + { 0x2AF5, "allowteamchoice" }, + { 0x2AF6, "addtoteamcount" }, + { 0x2AF7, "updateobjectivetext" }, +// { 0x2AF8, "" }, +// { 0x2AF9, "" }, + { 0x2AFA, "lastwave" }, + { 0x2AFB, "wavedelay" }, +// { 0x2AFC, "" }, + { 0x2AFD, "wavespawnindex" }, + { 0x2AFE, "teamkilldelay" }, +// { 0x2AFF, "" }, +// { 0x2B00, "" }, +// { 0x2B01, "" }, + { 0x2B02, "tispawndelay" }, + { 0x2B03, "mayspawn" }, + { 0x2B04, "getgametypenumlives" }, + { 0x2B05, "disablespawning" }, + { 0x2B06, "gamehasstarted" }, + { 0x2B07, "setlowermessage" }, +// { 0x2B08, "" }, + { 0x2B09, "waitingtospawn" }, +// { 0x2B0A, "" }, + { 0x2B0B, "clearlowermessage" }, +// { 0x2B0C, "" }, +// { 0x2B0D, "" }, +// { 0x2B0E, "" }, + { 0x2B0F, "waitrespawnbutton" }, + { 0x2B10, "removespawnmessageshortly" }, +// { 0x2B11, "" }, + { 0x2B12, "diehardmode" }, +// { 0x2B13, "" }, + { 0x2B14, "standardmaxhealth" }, + { 0x2B15, "freezeplayerforroundend" }, +// { 0x2B16, "" }, + { 0x2B17, "showspawnnotifies" }, + { 0x2B18, "defconsplashnotify" }, + { 0x2B19, "isrested" }, +// { 0x2B1A, "" }, +// { 0x2B1B, "" }, + { 0x2B1C, "predictabouttospawnplayer" }, + { 0x2B1D, "getspawnpoint_random" }, + { 0x2B1E, "getspawnpoint" }, + { 0x2B1F, "checkpredictedspawnpointcorrectness" }, + { 0x2B20, "percentage" }, + { 0x2B21, "printpredictedspawnpointcorrectness" }, +// { 0x2B22, "" }, +// { 0x2B23, "" }, +// { 0x2B24, "" }, +// { 0x2B25, "" }, + { 0x2B26, "fauxdead" }, + { 0x2B27, "killsthislife" }, +// { 0x2B28, "" }, +// { 0x2B29, "" }, + { 0x2B2A, "friendlydamage" }, + { 0x2B2B, "afk" }, + { 0x2B2C, "inc4death" }, +// { 0x2B2D, "" }, +// { 0x2B2E, "" }, + { 0x2B2F, "shielddamage" }, + { 0x2B30, "shieldbullethits" }, +// { 0x2B31, "" }, +// { 0x2B32, "" }, + { 0x2B33, "gettimelimit" }, + { 0x2B34, "gettimepassed" }, + { 0x2B35, "finalizespawnpointchoice" }, +// { 0x2B36, "" }, +// { 0x2B37, "" }, + { 0x2B38, "playerspawned" }, + { 0x2B39, "setthirdpersondof" }, + { 0x2B3A, "gameflag" }, +// { 0x2B3B, "" }, + { 0x2B3C, "oldnotifymessage" }, +// { 0x2B3D, "" }, + { 0x2B3E, "hideperksondeath" }, + { 0x2B3F, "hideperksonkill" }, +// { 0x2B40, "" }, + { 0x2B41, "in_spawnspectator" }, + { 0x2B42, "getplayerfromclientnum" }, + { 0x2B43, "onspawnspectator" }, + { 0x2B44, "spawnintermission" }, +// { 0x2B45, "" }, +// { 0x2B46, "" }, + { 0x2B47, "postgamenotifies" }, + { 0x2B48, "spawnendofgame" }, + { 0x2B49, "setspawnvariables" }, + { 0x2B4A, "notifyconnecting" }, +// { 0x2B4B, "" }, + { 0x2B4C, "connected" }, +// { 0x2B4D, "" }, +// { 0x2B4E, "" }, + { 0x2B4F, "hitlocinited" }, +// { 0x2B50, "" }, + { 0x2B51, "callback_playerconnect" }, + { 0x2B52, "usingonlinedataoffline" }, + { 0x2B53, "resetadrenaline" }, +// { 0x2B54, "" }, + { 0x2B55, "leaderdialogactive" }, +// { 0x2B56, "" }, +// { 0x2B57, "" }, +// { 0x2B58, "" }, +// { 0x2B59, "" }, +// { 0x2B5A, "" }, +// { 0x2B5B, "" }, +// { 0x2B5C, "" }, + { 0x2B5D, "updatelossstats" }, + { 0x2B5E, "onplayerconnectaudioinit" }, +// { 0x2B5F, "" }, + { 0x2B60, "callback_playermigrated" }, +// { 0x2B61, "" }, + { 0x2B62, "getrestxpcap" }, +// { 0x2B63, "" }, +// { 0x2B64, "" }, + { 0x2B65, "kickifdontspawn" }, + { 0x2B66, "kickwait" }, +// { 0x2B67, "" }, + { 0x2B68, "initplayerstats" }, + { 0x2B69, "initbufferedstats" }, + { 0x2B6A, "initpersstat" }, +// { 0x2B6B, "" }, +// { 0x2B6C, "" }, +// { 0x2B6D, "" }, +// { 0x2B6E, "" }, +// { 0x2B6F, "" }, +// { 0x2B70, "" }, +// { 0x2B71, "" }, +// { 0x2B72, "" }, +// { 0x2B73, "" }, +// { 0x2B74, "" }, + { 0x2B75, "statsetchildbuffered" }, + { 0x2B76, "teamcount" }, + { 0x2B77, "addtoalivecount" }, +// { 0x2B78, "" }, + { 0x2B79, "maxplayercount" }, + { 0x2B7A, "removefromalivecount" }, +// { 0x2B7B, "" }, +// { 0x2B7C, "" }, + { 0x2B7D, "removefromlivescount" }, +// { 0x2B7E, "" }, + { 0x2B7F, "callbackstartgametype" }, + { 0x2B80, "callbackplayerconnect" }, +// { 0x2B81, "" }, + { 0x2B82, "callbackplayerkilled" }, +// { 0x2B83, "" }, + { 0x2B84, "callbackplayerlaststand" }, + { 0x2B85, "callbackplayermigrated" }, +// { 0x2B86, "" }, +// { 0x2B87, "" }, +// { 0x2B88, "" }, +// { 0x2B89, "" }, +// { 0x2B8A, "" }, +// { 0x2B8B, "" }, +// { 0x2B8C, "" }, +// { 0x2B8D, "" }, + { 0x2B8E, "hurtplayersthink" }, + { 0x2B8F, "setupdestructiblekillcaments" }, +// { 0x2B90, "" }, + { 0x2B91, "hostname" }, +// { 0x2B92, "" }, +// { 0x2B93, "" }, +// { 0x2B94, "" }, +// { 0x2B95, "" }, +// { 0x2B96, "" }, +// { 0x2B97, "" }, + { 0x2B98, "script_gametype_hq" }, +// { 0x2B99, "" }, +// { 0x2B9A, "" }, +// { 0x2B9B, "" }, +// { 0x2B9C, "" }, + { 0x2B9D, "killcamlength" }, + { 0x2B9E, "kc_timer" }, + { 0x2B9F, "kc_skiptext" }, + { 0x2BA0, "kc_othertext" }, + { 0x2BA1, "kc_icon" }, +// { 0x2BA2, "" }, +// { 0x2BA3, "" }, + { 0x2BA4, "calculatekillcamtime" }, +// { 0x2BA5, "" }, +// { 0x2BA6, "" }, +// { 0x2BA7, "" }, +// { 0x2BA8, "" }, +// { 0x2BA9, "" }, + { 0x2BAA, "waitcopycatbutton" }, +// { 0x2BAB, "" }, + { 0x2BAC, "endkillcamifnothingtoshow" }, +// { 0x2BAD, "" }, +// { 0x2BAE, "" }, +// { 0x2BAF, "" }, + { 0x2BB0, "cancelkillcamonuse" }, +// { 0x2BB1, "" }, + { 0x2BB2, "cancelkillcamsafespawnbutton" }, +// { 0x2BB3, "" }, +// { 0x2BB4, "" }, +// { 0x2BB5, "" }, + { 0x2BB6, "initkcelements" }, + { 0x2BB7, "selfdeathicons" }, +// { 0x2BB8, "" }, + { 0x2BB9, "adddeathicon" }, + { 0x2BBA, "lastdeathicon" }, +// { 0x2BBB, "" }, +// { 0x2BBC, "" }, + { 0x2BBD, "targets" }, + { 0x2BBE, "onplayerdisconnect" }, +// { 0x2BBF, "" }, + { 0x2BC0, "processkill" }, + { 0x2BC1, "heli_types" }, +// { 0x2BC2, "" }, +// { 0x2BC3, "" }, +// { 0x2BC4, "" }, + { 0x2BC5, "heli_crash_nodes" }, + { 0x2BC6, "heli_missile_rof" }, + { 0x2BC7, "heli_maxhealth" }, +// { 0x2BC8, "" }, + { 0x2BC9, "heli_targeting_delay" }, + { 0x2BCA, "heli_turretreloadtime" }, +// { 0x2BCB, "" }, +// { 0x2BCC, "" }, +// { 0x2BCD, "" }, + { 0x2BCE, "heli_target_recognition" }, +// { 0x2BCF, "" }, + { 0x2BD0, "heli_missile_target_cone" }, + { 0x2BD1, "heli_armor_bulletdamage" }, +// { 0x2BD2, "" }, +// { 0x2BD3, "" }, + { 0x2BD4, "heli_angle_offset" }, +// { 0x2BD5, "" }, +// { 0x2BD6, "" }, + { 0x2BD7, "fx_heli_dust" }, +// { 0x2BD8, "" }, + { 0x2BD9, "helidialog" }, +// { 0x2BDA, "" }, +// { 0x2BDB, "" }, + { 0x2BDC, "makehelitype" }, +// { 0x2BDD, "" }, + { 0x2BDE, "addairexplosion" }, + { 0x2BDF, "pavelowlightfx" }, + { 0x2BE0, "defaultlightfx" }, + { 0x2BE1, "usehelicopter" }, +// { 0x2BE2, "" }, + { 0x2BE3, "usehelicopterflares" }, + { 0x2BE4, "usehelicopterminigun" }, + { 0x2BE5, "usehelicoptermk19" }, + { 0x2BE6, "tryusehelicopter" }, +// { 0x2BE7, "" }, + { 0x2BE8, "updatekillstreaks" }, + { 0x2BE9, "lifeid" }, + { 0x2BEA, "helitype" }, +// { 0x2BEB, "" }, +// { 0x2BEC, "" }, + { 0x2BED, "maxvehiclesallowed" }, + { 0x2BEE, "setusingremote" }, + { 0x2BEF, "initridekillstreak" }, + { 0x2BF0, "clearusingremote" }, +// { 0x2BF1, "" }, +// { 0x2BF2, "" }, + { 0x2BF3, "precachehelicopter" }, + { 0x2BF4, "heli_sound" }, + { 0x2BF5, "spawn_helicopter" }, + { 0x2BF6, "heli_type" }, + { 0x2BF7, "zoffset" }, + { 0x2BF8, "heliride" }, +// { 0x2BF9, "" }, + { 0x2BFA, "thermalvision" }, + { 0x2BFB, "enhanced_vision" }, +// { 0x2BFC, "" }, +// { 0x2BFD, "" }, + { 0x2BFE, "helitargetorigin" }, + { 0x2BFF, "remotehelilos" }, +// { 0x2C00, "" }, +// { 0x2C01, "" }, +// { 0x2C02, "" }, + { 0x2C03, "getposnearenemies" }, +// { 0x2C04, "" }, +// { 0x2C05, "" }, +// { 0x2C06, "" }, +// { 0x2C07, "" }, + { 0x2C08, "heli_think" }, + { 0x2C09, "targeting_delay" }, + { 0x2C0A, "primarytarget" }, + { 0x2C0B, "secondarytarget" }, + { 0x2C0C, "currentstate" }, + { 0x2C0D, "makegunship" }, +// { 0x2C0E, "" }, +// { 0x2C0F, "" }, +// { 0x2C10, "" }, + { 0x2C11, "sentry_attacktargets" }, + { 0x2C12, "sentry_burstfirestart" }, + { 0x2C13, "sentry_burstfirestop" }, +// { 0x2C14, "" }, + { 0x2C15, "queueremovefirst" }, +// { 0x2C16, "" }, +// { 0x2C17, "" }, + { 0x2C18, "cantarget_turret" }, + { 0x2C19, "getbestprimarytarget" }, + { 0x2C1A, "threatlevel" }, +// { 0x2C1B, "" }, + { 0x2C1C, "antithreat" }, + { 0x2C1D, "heli_reset" }, +// { 0x2C1E, "" }, +// { 0x2C1F, "" }, + { 0x2C20, "largeprojectiledamage" }, + { 0x2C21, "vehiclekilled" }, +// { 0x2C22, "" }, + { 0x2C23, "laststate" }, +// { 0x2C24, "" }, +// { 0x2C25, "" }, +// { 0x2C26, "" }, +// { 0x2C27, "" }, +// { 0x2C28, "" }, + { 0x2C29, "check_owner" }, + { 0x2C2A, "heli_leave_on_disconnect" }, +// { 0x2C2B, "" }, + { 0x2C2C, "heli_leave_on_spawned" }, + { 0x2C2D, "heli_leave_on_gameended" }, +// { 0x2C2E, "" }, +// { 0x2C2F, "" }, +// { 0x2C30, "" }, + { 0x2C31, "missiletarget" }, +// { 0x2C32, "" }, + { 0x2C33, "missile_support" }, + { 0x2C34, "attack_primary" }, + { 0x2C35, "waitontargetordeath" }, + { 0x2C36, "firemissile" }, +// { 0x2C37, "" }, +// { 0x2C38, "" }, + { 0x2C39, "heli_fly_simple_path" }, +// { 0x2C3A, "" }, + { 0x2C3B, "desired_speed" }, + { 0x2C3C, "desired_accel" }, + { 0x2C3D, "heli_loop_speed_control" }, +// { 0x2C3E, "" }, +// { 0x2C3F, "" }, +// { 0x2C40, "" }, +// { 0x2C41, "" }, +// { 0x2C42, "" }, +// { 0x2C43, "" }, + { 0x2C44, "debug_print3d" }, +// { 0x2C45, "" }, +// { 0x2C46, "" }, +// { 0x2C47, "" }, + { 0x2C48, "helis" }, +// { 0x2C49, "" }, +// { 0x2C4A, "" }, +// { 0x2C4B, "" }, + { 0x2C4C, "exceededmaxlittlebirds" }, +// { 0x2C4D, "" }, + { 0x2C4E, "deployflares" }, + { 0x2C4F, "heli_flares_monitor" }, + { 0x2C50, "numflares" }, + { 0x2C51, "handleincomingstinger" }, +// { 0x2C52, "" }, +// { 0x2C53, "" }, + { 0x2C54, "watchsamproximity" }, +// { 0x2C55, "" }, +// { 0x2C56, "" }, +// { 0x2C57, "" }, + { 0x2C58, "remoteuav_dialog" }, +// { 0x2C59, "" }, +// { 0x2C5A, "" }, +// { 0x2C5B, "" }, + { 0x2C5C, "useremoteuav" }, + { 0x2C5D, "tryuseremoteuav" }, + { 0x2C5E, "nukeincoming" }, +// { 0x2C5F, "" }, + { 0x2C60, "givecarryremoteuav" }, +// { 0x2C61, "" }, + { 0x2C62, "sentrytype" }, +// { 0x2C63, "" }, +// { 0x2C64, "" }, +// { 0x2C65, "" }, + { 0x2C66, "maxheight" }, + { 0x2C67, "maxdistance" }, + { 0x2C68, "setcarryingremoteuav" }, + { 0x2C69, "carriedby" }, +// { 0x2C6A, "" }, +// { 0x2C6B, "" }, +// { 0x2C6C, "" }, +// { 0x2C6D, "" }, +// { 0x2C6E, "" }, +// { 0x2C6F, "" }, + { 0x2C70, "remoteuav_clearrideintro" }, + { 0x2C71, "lockplayerforremoteuavlaunch" }, + { 0x2C72, "clearplayerlockfromremoteuavlaunch" }, + { 0x2C73, "createremoteuav" }, + { 0x2C74, "destroyed" }, +// { 0x2C75, "" }, + { 0x2C76, "scrambler" }, +// { 0x2C77, "" }, + { 0x2C78, "markedplayers" }, +// { 0x2C79, "" }, +// { 0x2C7A, "" }, +// { 0x2C7B, "" }, + { 0x2C7C, "playerlinked" }, +// { 0x2C7D, "" }, + { 0x2C7E, "juggernautoverlay" }, +// { 0x2C7F, "" }, + { 0x2C80, "remoteuav" }, +// { 0x2C81, "" }, + { 0x2C82, "remoteuav_endride" }, + { 0x2C83, "remoteuav_freezebuffer" }, +// { 0x2C84, "" }, + { 0x2C85, "remoteuav_track" }, + { 0x2C86, "lasttrackingdialogtime" }, + { 0x2C87, "lockedtarget" }, + { 0x2C88, "trace" }, +// { 0x2C89, "" }, +// { 0x2C8A, "" }, +// { 0x2C8B, "" }, +// { 0x2C8C, "" }, +// { 0x2C8D, "" }, +// { 0x2C8E, "" }, +// { 0x2C8F, "" }, + { 0x2C90, "remoteuav_markplayer" }, + { 0x2C91, "birth_time" }, +// { 0x2C92, "" }, + { 0x2C93, "remoteuavmarkedobjid02" }, + { 0x2C94, "remoteuavmarkedobjid03" }, + { 0x2C95, "remoteuav_processtaggedassist" }, +// { 0x2C96, "" }, + { 0x2C97, "remoteuav_clearmarkedforowner" }, + { 0x2C98, "remoteuav_operationrumble" }, +// { 0x2C99, "" }, + { 0x2C9A, "centerref" }, +// { 0x2C9B, "" }, + { 0x2C9C, "heliinproximity" }, + { 0x2C9D, "remoteuav_in_range" }, + { 0x2C9E, "remoteuav_staticfade" }, + { 0x2C9F, "remoteuav_rangecountdown" }, +// { 0x2CA0, "" }, +// { 0x2CA1, "" }, +// { 0x2CA2, "" }, + { 0x2CA3, "remoteuav_leave_on_timeout" }, +// { 0x2CA4, "" }, +// { 0x2CA5, "" }, + { 0x2CA6, "remoteuav_cleanup" }, + { 0x2CA7, "remoteuav_light_fx" }, + { 0x2CA8, "remoteuav_handleincomingstinger" }, +// { 0x2CA9, "" }, +// { 0x2CAA, "" }, + { 0x2CAB, "missile_isincoming" }, + { 0x2CAC, "remoteuav_watchheliproximity" }, +// { 0x2CAD, "" }, + { 0x2CAE, "callback_vehicledamage" }, + { 0x2CAF, "speakers" }, +// { 0x2CB0, "" }, + { 0x2CB1, "grenadeproximitytracking" }, +// { 0x2CB2, "" }, +// { 0x2CB3, "" }, +// { 0x2CB4, "" }, + { 0x2CB5, "reloadtracking" }, +// { 0x2CB6, "" }, + { 0x2CB7, "saylocalsounddelayed" }, +// { 0x2CB8, "" }, + { 0x2CB9, "dosound" }, + { 0x2CBA, "timehack" }, +// { 0x2CBB, "" }, + { 0x2CBC, "addspeaker" }, +// { 0x2CBD, "" }, +// { 0x2CBE, "" }, + { 0x2CBF, "isteamswitchbalanced" }, +// { 0x2CC0, "" }, + { 0x2CC1, "killedself" }, + { 0x2CC2, "isheadshot" }, +// { 0x2CC3, "" }, +// { 0x2CC4, "" }, +// { 0x2CC5, "" }, +// { 0x2CC6, "" }, + { 0x2CC7, "handlesuicidedeath" }, +// { 0x2CC8, "" }, + { 0x2CC9, "graceperiod" }, + { 0x2CCA, "handlenormaldeath" }, + { 0x2CCB, "updatepersratio" }, + { 0x2CCC, "cloneloadout" }, +// { 0x2CCD, "" }, +// { 0x2CCE, "" }, +// { 0x2CCF, "" }, + { 0x2CD0, "statgetchild" }, +// { 0x2CD1, "" }, + { 0x2CD2, "lastattackedshieldplayer" }, + { 0x2CD3, "lastattackedshieldtime" }, + { 0x2CD4, "isplayerweapon" }, + { 0x2CD5, "callback_playerkilled" }, + { 0x2CD6, "queueshieldforremoval" }, +// { 0x2CD7, "" }, +// { 0x2CD8, "" }, +// { 0x2CD9, "" }, +// { 0x2CDA, "" }, +// { 0x2CDB, "" }, + { 0x2CDC, "uselaststandparams" }, + { 0x2CDD, "einflictor" }, +// { 0x2CDE, "" }, + { 0x2CDF, "smeansofdeath" }, + { 0x2CE0, "sweapon" }, + { 0x2CE1, "sprimaryweapon" }, + { 0x2CE2, "vdir" }, + { 0x2CE3, "shitloc" }, +// { 0x2CE4, "" }, + { 0x2CE5, "nuked" }, +// { 0x2CE6, "" }, +// { 0x2CE7, "" }, + { 0x2CE8, "trackleaderboarddeathstats" }, + { 0x2CE9, "trackattackerleaderboarddeathstats" }, + { 0x2CEA, "lastdeathpos" }, + { 0x2CEB, "sameshotdamage" }, +// { 0x2CEC, "" }, +// { 0x2CED, "" }, +// { 0x2CEE, "" }, +// { 0x2CEF, "" }, +// { 0x2CF0, "" }, +// { 0x2CF1, "" }, + { 0x2CF2, "initfinalkillcam" }, +// { 0x2CF3, "" }, + { 0x2CF4, "finalkillcam_victim" }, +// { 0x2CF5, "" }, + { 0x2CF6, "finalkillcam_attackernum" }, +// { 0x2CF7, "" }, +// { 0x2CF8, "" }, +// { 0x2CF9, "" }, + { 0x2CFA, "finalkillcam_deathtimeoffset" }, +// { 0x2CFB, "" }, + { 0x2CFC, "finalkillcam_timerecorded" }, +// { 0x2CFD, "" }, +// { 0x2CFE, "" }, +// { 0x2CFF, "" }, +// { 0x2D00, "" }, +// { 0x2D01, "" }, +// { 0x2D02, "" }, +// { 0x2D03, "" }, +// { 0x2D04, "" }, + { 0x2D05, "resetplayervariables" }, + { 0x2D06, "getkillcamentity" }, + { 0x2D07, "samturret" }, + { 0x2D08, "imskillcament" }, +// { 0x2D09, "" }, + { 0x2D0A, "remote_mortar" }, +// { 0x2D0B, "" }, +// { 0x2D0C, "" }, +// { 0x2D0D, "" }, + { 0x2D0E, "damageinfo" }, + { 0x2D0F, "hitloc" }, +// { 0x2D10, "" }, +// { 0x2D11, "" }, + { 0x2D12, "colorindex" }, + { 0x2D13, "damageinfocolorindex" }, +// { 0x2D14, "" }, +// { 0x2D15, "" }, +// { 0x2D16, "" }, +// { 0x2D17, "" }, +// { 0x2D18, "" }, +// { 0x2D19, "" }, + { 0x2D1A, "idflags_shield_explosive_splash" }, +// { 0x2D1B, "" }, +// { 0x2D1C, "" }, + { 0x2D1D, "candocombat" }, +// { 0x2D1E, "" }, + { 0x2D1F, "killstreakspawnshield" }, + { 0x2D20, "idflags_no_protection" }, + { 0x2D21, "lastspawnpoint" }, +// { 0x2D22, "" }, +// { 0x2D23, "" }, + { 0x2D24, "lastdamagewasfromenemy" }, +// { 0x2D25, "" }, + { 0x2D26, "wascooked" }, + { 0x2D27, "playerdamaged" }, +// { 0x2D28, "" }, + { 0x2D29, "shouldweaponfeedback" }, +// { 0x2D2A, "" }, + { 0x2D2B, "findisfacing" }, +// { 0x2D2C, "" }, + { 0x2D2D, "instutter" }, +// { 0x2D2E, "" }, + { 0x2D2F, "isprimary" }, +// { 0x2D30, "" }, +// { 0x2D31, "" }, +// { 0x2D32, "" }, + { 0x2D33, "finishplayerdamagewrapper" }, +// { 0x2D34, "" }, + { 0x2D35, "dieaftertime" }, + { 0x2D36, "detonateonuse" }, + { 0x2D37, "detonateondeath" }, + { 0x2D38, "c4deathdetonate" }, + { 0x2D39, "c4deatheffect" }, + { 0x2D3A, "enablelaststandweapons" }, +// { 0x2D3B, "" }, +// { 0x2D3C, "" }, +// { 0x2D3D, "" }, +// { 0x2D3E, "" }, +// { 0x2D3F, "" }, +// { 0x2D40, "" }, +// { 0x2D41, "" }, +// { 0x2D42, "" }, +// { 0x2D43, "" }, +// { 0x2D44, "" }, + { 0x2D45, "delaystartragdoll" }, + { 0x2D46, "noragdollents" }, + { 0x2D47, "getmostkilledby" }, +// { 0x2D48, "" }, +// { 0x2D49, "" }, +// { 0x2D4A, "" }, + { 0x2D4B, "deleteonreviveordeathordisconnect" }, +// { 0x2D4C, "" }, +// { 0x2D4D, "" }, +// { 0x2D4E, "" }, + { 0x2D4F, "revivetriggerthink" }, +// { 0x2D50, "" }, + { 0x2D51, "combathigh" }, + { 0x2D52, "emitfalldamage" }, + { 0x2D53, "isflankkill" }, +// { 0x2D54, "" }, +// { 0x2D55, "" }, + { 0x2D56, "destroyonreviveentdeath" }, +// { 0x2D57, "" }, +// { 0x2D58, "" }, + { 0x2D59, "matchrules_vampirism" }, + { 0x2D5A, "healthregendisabled" }, +// { 0x2D5B, "" }, + { 0x2D5C, "regenspeed" }, +// { 0x2D5D, "" }, + { 0x2D5E, "breathingmanager" }, +// { 0x2D5F, "" }, +// { 0x2D60, "" }, +// { 0x2D61, "" }, +// { 0x2D62, "" }, + { 0x2D63, "playerpainbreathingsound" }, + { 0x2D64, "playedstartingmusic" }, + { 0x2D65, "onlastalive" }, +// { 0x2D66, "" }, +// { 0x2D67, "" }, +// { 0x2D68, "" }, +// { 0x2D69, "" }, +// { 0x2D6A, "" }, + { 0x2D6B, "gamewinnerdialog" }, +// { 0x2D6C, "" }, +// { 0x2D6D, "" }, +// { 0x2D6E, "" }, + { 0x2D6F, "suspensemusic" }, + { 0x2D70, "finalkillcammusic" }, +// { 0x2D71, "" }, +// { 0x2D72, "" }, +// { 0x2D73, "" }, +// { 0x2D74, "" }, + { 0x2D75, "initplayerstat" }, +// { 0x2D76, "" }, + { 0x2D77, "previousdeaths" }, +// { 0x2D78, "" }, +// { 0x2D79, "" }, + { 0x2D7A, "usedweapons" }, +// { 0x2D7B, "" }, + { 0x2D7C, "initgametypeawards" }, + { 0x2D7D, "initbaseaward" }, + { 0x2D7E, "winners" }, +// { 0x2D7F, "" }, +// { 0x2D80, "" }, +// { 0x2D81, "" }, + { 0x2D82, "var1" }, +// { 0x2D83, "" }, +// { 0x2D84, "" }, +// { 0x2D85, "" }, + { 0x2D86, "initderivedaward" }, + { 0x2D87, "initawardflag" }, + { 0x2D88, "initmultiaward" }, +// { 0x2D89, "" }, +// { 0x2D8A, "" }, + { 0x2D8B, "initthresholdaward" }, + { 0x2D8C, "setmatchrecordifgreater" }, +// { 0x2D8D, "" }, + { 0x2D8E, "getplayerstattime" }, +// { 0x2D8F, "" }, +// { 0x2D90, "" }, + { 0x2D91, "setpersonalbestifgreater" }, +// { 0x2D92, "" }, +// { 0x2D93, "" }, +// { 0x2D94, "" }, + { 0x2D95, "getawardwinners" }, +// { 0x2D96, "" }, +// { 0x2D97, "" }, + { 0x2D98, "getawardrecord" }, +// { 0x2D99, "" }, +// { 0x2D9A, "" }, +// { 0x2D9B, "" }, +// { 0x2D9C, "" }, +// { 0x2D9D, "" }, +// { 0x2D9E, "" }, + { 0x2D9F, "isstataward" }, + { 0x2DA0, "isthresholdaward" }, +// { 0x2DA1, "" }, + { 0x2DA2, "isawardexclusive" }, + { 0x2DA3, "hasdisplayvalue" }, + { 0x2DA4, "giveaward" }, + { 0x2DA5, "getformattedvalue" }, +// { 0x2DA6, "" }, +// { 0x2DA7, "" }, +// { 0x2DA8, "" }, + { 0x2DA9, "lowestwithhalfplayedtime" }, +// { 0x2DAA, "" }, + { 0x2DAB, "isatleast" }, + { 0x2DAC, "isatmost" }, +// { 0x2DAD, "" }, + { 0x2DAE, "setratio" }, + { 0x2DAF, "getkillstreakawardref" }, +// { 0x2DB0, "" }, +// { 0x2DB1, "" }, + { 0x2DB2, "monitorswaps" }, + { 0x2DB3, "monitormovementdistance" }, +// { 0x2DB4, "" }, + { 0x2DB5, "lastcampchecked" }, +// { 0x2DB6, "" }, +// { 0x2DB7, "" }, +// { 0x2DB8, "" }, +// { 0x2DB9, "" }, +// { 0x2DBA, "" }, +// { 0x2DBB, "" }, +// { 0x2DBC, "" }, + { 0x2DBD, "monitorshieldblocks" }, + { 0x2DBE, "monitorflashhits" }, + { 0x2DBF, "monitorstunhits" }, +// { 0x2DC0, "" }, + { 0x2DC1, "softlandingtriggers" }, +// { 0x2DC2, "" }, +// { 0x2DC3, "" }, +// { 0x2DC4, "" }, +// { 0x2DC5, "" }, + { 0x2DC6, "softlandingwaiter" }, + { 0x2DC7, "defconmode" }, +// { 0x2DC8, "" }, + { 0x2DC9, "defconpointmod" }, + { 0x2DCA, "defconkillstreakwait" }, + { 0x2DCB, "defconkillstreakthread" }, + { 0x2DCC, "updatedefcon" }, +// { 0x2DCD, "" }, +// { 0x2DCE, "" }, +// { 0x2DCF, "" }, +// { 0x2DD0, "" }, +// { 0x2DD1, "" }, + { 0x2DD2, "isjuggernautrecon" }, +// { 0x2DD3, "" }, + { 0x2DD4, "matchrules_showjuggradaricon" }, +// { 0x2DD5, "" }, +// { 0x2DD6, "" }, +// { 0x2DD7, "" }, +// { 0x2DD8, "" }, +// { 0x2DD9, "" }, + { 0x2DDA, "isjuggernautdef" }, +// { 0x2DDB, "" }, +// { 0x2DDC, "" }, +// { 0x2DDD, "" }, +// { 0x2DDE, "" }, +// { 0x2DDF, "" }, +// { 0x2DE0, "" }, + { 0x2DE1, "pausemax" }, +// { 0x2DE2, "" }, + { 0x2DE3, "sentrymodeoff" }, + { 0x2DE4, "spinuptime" }, + { 0x2DE5, "overheattime" }, +// { 0x2DE6, "" }, + { 0x2DE7, "fxtime" }, + { 0x2DE8, "modelbase" }, + { 0x2DE9, "modelplacement" }, +// { 0x2DEA, "" }, +// { 0x2DEB, "" }, + { 0x2DEC, "teamsplash" }, +// { 0x2DED, "" }, + { 0x2DEE, "vodestroyed" }, + { 0x2DEF, "ownerhintstring" }, + { 0x2DF0, "tryuseautosentry" }, + { 0x2DF1, "tryusesam" }, +// { 0x2DF2, "" }, +// { 0x2DF3, "" }, + { 0x2DF4, "last_sentry" }, +// { 0x2DF5, "" }, +// { 0x2DF6, "" }, + { 0x2DF7, "restoreweapon" }, +// { 0x2DF8, "" }, + { 0x2DF9, "restoreperk" }, +// { 0x2DFA, "" }, +// { 0x2DFB, "" }, + { 0x2DFC, "waitrestoreperks" }, +// { 0x2DFD, "" }, + { 0x2DFE, "sentry_initsentry" }, + { 0x2DFF, "laser_on" }, +// { 0x2E00, "" }, +// { 0x2E01, "" }, + { 0x2E02, "overheated" }, + { 0x2E03, "cooldownwaittime" }, + { 0x2E04, "sentry_handledamage" }, +// { 0x2E05, "" }, + { 0x2E06, "sentry_handledeath" }, + { 0x2E07, "ownertrigger" }, + { 0x2E08, "forcedisable" }, +// { 0x2E09, "" }, +// { 0x2E0A, "" }, + { 0x2E0B, "sentry_handleuse" }, + { 0x2E0C, "turret_handlepickup" }, + { 0x2E0D, "turret_handleuse" }, + { 0x2E0E, "sentry_handleownerdisconnect" }, +// { 0x2E0F, "" }, +// { 0x2E10, "" }, +// { 0x2E11, "" }, + { 0x2E12, "sentry_setcarried" }, + { 0x2E13, "updatesentryplacement" }, + { 0x2E14, "sentry_oncarrierdeath" }, + { 0x2E15, "sentry_oncarrierdisconnect" }, +// { 0x2E16, "" }, +// { 0x2E17, "" }, +// { 0x2E18, "" }, +// { 0x2E19, "" }, +// { 0x2E1A, "" }, +// { 0x2E1B, "" }, +// { 0x2E1C, "" }, +// { 0x2E1D, "" }, + { 0x2E1E, "removefromturretlist" }, + { 0x2E1F, "sentry_timeout" }, +// { 0x2E20, "" }, + { 0x2E21, "sentry_spinup" }, +// { 0x2E22, "" }, + { 0x2E23, "turret_shotmonitor" }, + { 0x2E24, "sentry_heatmonitor" }, +// { 0x2E25, "" }, + { 0x2E26, "turret_coolmonitor" }, +// { 0x2E27, "" }, +// { 0x2E28, "" }, +// { 0x2E29, "" }, +// { 0x2E2A, "" }, + { 0x2E2B, "samtargetent" }, + { 0x2E2C, "sammissilegroups" }, +// { 0x2E2D, "" }, +// { 0x2E2E, "" }, +// { 0x2E2F, "" }, +// { 0x2E30, "" }, + { 0x2E31, "sam_watchlineofsight" }, +// { 0x2E32, "" }, +// { 0x2E33, "" }, +// { 0x2E34, "" }, + { 0x2E35, "airdropcrates" }, +// { 0x2E36, "" }, +// { 0x2E37, "" }, +// { 0x2E38, "" }, +// { 0x2E39, "" }, + { 0x2E3A, "cratemaxval" }, +// { 0x2E3B, "" }, +// { 0x2E3C, "" }, +// { 0x2E3D, "" }, + { 0x2E3E, "getrandomcratetype" }, + { 0x2E3F, "getcratetypefordroptype" }, + { 0x2E40, "tryuseassaultairdrop" }, +// { 0x2E41, "" }, +// { 0x2E42, "" }, + { 0x2E43, "tryuseairdropsentryminigun" }, +// { 0x2E44, "" }, + { 0x2E45, "tryusejuggernautglairdrop" }, +// { 0x2E46, "" }, + { 0x2E47, "tryusejuggernautdefairdrop" }, + { 0x2E48, "tryusetrophyairdrop" }, + { 0x2E49, "tryusemegaairdrop" }, +// { 0x2E4A, "" }, + { 0x2E4B, "tryuseairdropremotetank" }, +// { 0x2E4C, "" }, +// { 0x2E4D, "" }, +// { 0x2E4E, "" }, + { 0x2E4F, "tryuseairdrop" }, + { 0x2E50, "watchdisconnect" }, + { 0x2E51, "beginairdropviamarker" }, +// { 0x2E52, "" }, +// { 0x2E53, "" }, + { 0x2E54, "ischangingweapon" }, +// { 0x2E55, "" }, +// { 0x2E56, "" }, + { 0x2E57, "beginairdropmarkertracking" }, + { 0x2E58, "airdropmarkeractivate" }, + { 0x2E59, "finishsupportescortusage" }, +// { 0x2E5A, "" }, +// { 0x2E5B, "" }, +// { 0x2E5C, "" }, +// { 0x2E5D, "" }, +// { 0x2E5E, "" }, +// { 0x2E5F, "" }, +// { 0x2E60, "" }, +// { 0x2E61, "" }, +// { 0x2E62, "" }, +// { 0x2E63, "" }, +// { 0x2E64, "" }, + { 0x2E65, "friendlymodel" }, + { 0x2E66, "enemymodel" }, +// { 0x2E67, "" }, +// { 0x2E68, "" }, + { 0x2E69, "cratesetupforuse" }, +// { 0x2E6A, "" }, + { 0x2E6B, "dropthecrate" }, +// { 0x2E6C, "" }, +// { 0x2E6D, "" }, + { 0x2E6E, "droptimeout" }, + { 0x2E6F, "getpathstart" }, +// { 0x2E70, "" }, + { 0x2E71, "getflyheightoffset" }, +// { 0x2E72, "" }, + { 0x2E73, "doflyby" }, +// { 0x2E74, "" }, + { 0x2E75, "domegaflyby" }, + { 0x2E76, "doc130flyby" }, +// { 0x2E77, "" }, +// { 0x2E78, "" }, + { 0x2E79, "stoploopafter" }, + { 0x2E7A, "playlooponent" }, +// { 0x2E7B, "" }, +// { 0x2E7C, "" }, +// { 0x2E7D, "" }, +// { 0x2E7E, "" }, + { 0x2E7F, "watchtimeout" }, + { 0x2E80, "heli_existence" }, + { 0x2E81, "heli_handledamage" }, + { 0x2E82, "alreadydead" }, +// { 0x2E83, "" }, +// { 0x2E84, "" }, +// { 0x2E85, "" }, + { 0x2E86, "nukecapturethink" }, + { 0x2E87, "crateothercapturethink" }, +// { 0x2E88, "" }, +// { 0x2E89, "" }, +// { 0x2E8A, "" }, +// { 0x2E8B, "" }, + { 0x2E8C, "getkillstreakcrateicon" }, + { 0x2E8D, "getstreakcost" }, + { 0x2E8E, "nukecratethink" }, + { 0x2E8F, "gtnw" }, +// { 0x2E90, "" }, +// { 0x2E91, "" }, + { 0x2E92, "juggernautcratethink" }, +// { 0x2E93, "" }, +// { 0x2E94, "" }, +// { 0x2E95, "" }, + { 0x2E96, "bomb" }, + { 0x2E97, "detonatetrap" }, + { 0x2E98, "deletecrate" }, +// { 0x2E99, "" }, +// { 0x2E9A, "" }, +// { 0x2E9B, "" }, +// { 0x2E9C, "" }, + { 0x2E9D, "hijacknotify" }, +// { 0x2E9E, "" }, +// { 0x2E9F, "" }, +// { 0x2EA0, "" }, + { 0x2EA1, "deleteuseent" }, + { 0x2EA2, "airdropdetonateonstuck" }, +// { 0x2EA3, "" }, +// { 0x2EA4, "" }, +// { 0x2EA5, "" }, +// { 0x2EA6, "" }, + { 0x2EA7, "taghatchr" }, + { 0x2EA8, "tagdropcrates" }, + { 0x2EA9, "prompt" }, +// { 0x2EAA, "" }, + { 0x2EAB, "tryuseescortairdrop" }, + { 0x2EAC, "tryuseospreygunner" }, +// { 0x2EAD, "" }, +// { 0x2EAE, "" }, +// { 0x2EAF, "" }, + { 0x2EB0, "_beginlocationselection" }, +// { 0x2EB1, "" }, +// { 0x2EB2, "" }, +// { 0x2EB3, "" }, +// { 0x2EB4, "" }, +// { 0x2EB5, "" }, +// { 0x2EB6, "" }, +// { 0x2EB7, "" }, + { 0x2EB8, "useospreygunner" }, + { 0x2EB9, "ridegunner" }, + { 0x2EBA, "waitsetthermal" }, +// { 0x2EBB, "" }, + { 0x2EBC, "escort_prompt" }, + { 0x2EBD, "airshippitchpropsup" }, +// { 0x2EBE, "" }, + { 0x2EBF, "airshippitchhatchup" }, + { 0x2EC0, "airshippitchhatchdown" }, + { 0x2EC1, "getbestheight" }, +// { 0x2EC2, "" }, + { 0x2EC3, "airshipflydefense" }, +// { 0x2EC4, "" }, + { 0x2EC5, "aishootplayer" }, + { 0x2EC6, "targetdeathwaiter" }, +// { 0x2EC7, "" }, +// { 0x2EC8, "" }, + { 0x2EC9, "ospreydropcrateslowimpulse" }, +// { 0x2ECA, "" }, +// { 0x2ECB, "" }, +// { 0x2ECC, "" }, +// { 0x2ECD, "" }, +// { 0x2ECE, "" }, + { 0x2ECF, "getmapcenter" }, + { 0x2ED0, "getstartspawns" }, + { 0x2ED1, "domortar" }, +// { 0x2ED2, "" }, +// { 0x2ED3, "" }, +// { 0x2ED4, "" }, + { 0x2ED5, "doairstrikeflyby" }, + { 0x2ED6, "spawnpoints" }, +// { 0x2ED7, "" }, +// { 0x2ED8, "" }, +// { 0x2ED9, "" }, +// { 0x2EDA, "" }, +// { 0x2EDB, "" }, +// { 0x2EDC, "" }, +// { 0x2EDD, "" }, +// { 0x2EDE, "" }, +// { 0x2EDF, "" }, +// { 0x2EE0, "" }, +// { 0x2EE1, "" }, +// { 0x2EE2, "" }, + { 0x2EE3, "buildscoreboardtype" }, + { 0x2EE4, "onforfeit" }, +// { 0x2EE5, "" }, +// { 0x2EE6, "" }, + { 0x2EE7, "forcedend" }, +// { 0x2EE8, "" }, + { 0x2EE9, "matchforfeittimer" }, + { 0x2EEA, "matchforfeittext" }, + { 0x2EEB, "matchforfeittimer_internal" }, + { 0x2EEC, "default_ondeadevent" }, +// { 0x2EED, "" }, + { 0x2EEE, "getlastlivingplayer" }, +// { 0x2EEF, "" }, +// { 0x2EF0, "" }, + { 0x2EF1, "hostforcedend" }, +// { 0x2EF2, "" }, + { 0x2EF3, "onelefttime" }, + { 0x2EF4, "ononeleftevent" }, + { 0x2EF5, "getpotentiallivingplayers" }, + { 0x2EF6, "waittillfinalkillcamdone" }, +// { 0x2EF7, "" }, +// { 0x2EF8, "" }, + { 0x2EF9, "prematchperiod" }, +// { 0x2EFA, "" }, +// { 0x2EFB, "" }, +// { 0x2EFC, "" }, +// { 0x2EFD, "" }, + { 0x2EFE, "updatewinlossstats" }, +// { 0x2EFF, "" }, + { 0x2F00, "waslastround" }, + { 0x2F01, "updatematchbonusscores" }, +// { 0x2F02, "" }, + { 0x2F03, "getspm" }, + { 0x2F04, "matchbonus" }, + { 0x2F05, "givematchbonus" }, + { 0x2F06, "setxenonranks" }, +// { 0x2F07, "" }, + { 0x2F08, "gethalftime" }, +// { 0x2F09, "" }, + { 0x2F0A, "ontimelimit" }, +// { 0x2F0B, "" }, +// { 0x2F0C, "" }, +// { 0x2F0D, "" }, +// { 0x2F0E, "" }, + { 0x2F0F, "matchstarttimerpc" }, +// { 0x2F10, "" }, +// { 0x2F11, "" }, +// { 0x2F12, "" }, +// { 0x2F13, "" }, + { 0x2F14, "halftimetype" }, + { 0x2F15, "checkroundswitch" }, +// { 0x2F16, "" }, + { 0x2F17, "timepaused" }, +// { 0x2F18, "" }, +// { 0x2F19, "" }, +// { 0x2F1A, "" }, + { 0x2F1B, "lowermessage" }, +// { 0x2F1C, "" }, + { 0x2F1D, "gethostplayer" }, + { 0x2F1E, "hostidledout" }, +// { 0x2F1F, "" }, +// { 0x2F20, "" }, +// { 0x2F21, "" }, +// { 0x2F22, "" }, +// { 0x2F23, "" }, +// { 0x2F24, "" }, +// { 0x2F25, "" }, +// { 0x2F26, "" }, +// { 0x2F27, "" }, +// { 0x2F28, "" }, +// { 0x2F29, "" }, +// { 0x2F2A, "" }, + { 0x2F2B, "onstartgametype" }, +// { 0x2F2C, "" }, +// { 0x2F2D, "" }, +// { 0x2F2E, "" }, +// { 0x2F2F, "" }, +// { 0x2F30, "" }, +// { 0x2F31, "" }, +// { 0x2F32, "" }, + { 0x2F33, "timelimitclock" }, + { 0x2F34, "timerstopped" }, + { 0x2F35, "gametimer" }, + { 0x2F36, "discardtime" }, +// { 0x2F37, "" }, + { 0x2F38, "timerpausetime" }, + { 0x2F39, "pausetimer" }, + { 0x2F3A, "resumetimer" }, + { 0x2F3B, "startgame" }, + { 0x2F3C, "spawnperframeupdate" }, + { 0x2F3D, "roundbegin" }, +// { 0x2F3E, "" }, +// { 0x2F3F, "" }, +// { 0x2F40, "" }, + { 0x2F41, "displayroundend" }, + { 0x2F42, "teamoutcomenotify" }, + { 0x2F43, "outcomenotify" }, + { 0x2F44, "displaygameend" }, + { 0x2F45, "displayroundswitch" }, + { 0x2F46, "endgameovertime" }, + { 0x2F47, "endgamehalftime" }, + { 0x2F48, "levelflagset" }, +// { 0x2F49, "" }, +// { 0x2F4A, "" }, +// { 0x2F4B, "" }, + { 0x2F4C, "updateendreasontext" }, +// { 0x2F4D, "" }, +// { 0x2F4E, "" }, + { 0x2F4F, "estimatedtimetillscorelimit" }, +// { 0x2F50, "" }, +// { 0x2F51, "" }, +// { 0x2F52, "" }, +// { 0x2F53, "" }, + { 0x2F54, "processlobbydata" }, + { 0x2F55, "incrementweaponstat" }, + { 0x2F56, "updateweaponbufferedstats" }, + { 0x2F57, "incrementattachmentstat" }, +// { 0x2F58, "" }, +// { 0x2F59, "" }, + { 0x2F5A, "checkforpersonalbests" }, + { 0x2F5B, "xpgains" }, +// { 0x2F5C, "" }, +// { 0x2F5D, "" }, +// { 0x2F5E, "" }, + { 0x2F5F, "callbackhostmigration" }, + { 0x2F60, "setupdamageflags" }, + { 0x2F61, "idflags_radius" }, + { 0x2F62, "idflags_no_armor" }, + { 0x2F63, "idflags_no_team_protection" }, +// { 0x2F64, "" }, + { 0x2F65, "setupcallbacks" }, + { 0x2F66, "setdefaultcallbacks" }, + { 0x2F67, "abortlevel" }, + { 0x2F68, "callbackvoid" }, + { 0x2F69, "beginharrier" }, + { 0x2F6A, "getcorrectheight" }, +// { 0x2F6B, "" }, + { 0x2F6C, "accel" }, + { 0x2F6D, "defendloc" }, + { 0x2F6E, "defendlocation" }, + { 0x2F6F, "closetogoalcheck" }, + { 0x2F70, "engageground" }, + { 0x2F71, "harrierleave" }, + { 0x2F72, "airplane" }, + { 0x2F73, "harrierdelete" }, +// { 0x2F74, "" }, +// { 0x2F75, "" }, + { 0x2F76, "getnewpoint" }, + { 0x2F77, "besttarget" }, +// { 0x2F78, "" }, + { 0x2F79, "tracegroundpoint" }, +// { 0x2F7A, "" }, + { 0x2F7B, "harrier_afterburnerfx" }, + { 0x2F7C, "stopharrierwingfx" }, +// { 0x2F7D, "" }, +// { 0x2F7E, "" }, + { 0x2F7F, "isreadytofire" }, +// { 0x2F80, "" }, +// { 0x2F81, "" }, +// { 0x2F82, "" }, +// { 0x2F83, "" }, + { 0x2F84, "watchtargetlos" }, + { 0x2F85, "breaktarget" }, +// { 0x2F86, "" }, + { 0x2F87, "nontarget" }, + { 0x2F88, "istarget" }, +// { 0x2F89, "" }, +// { 0x2F8A, "" }, +// { 0x2F8B, "" }, +// { 0x2F8C, "" }, +// { 0x2F8D, "" }, + { 0x2F8E, "harrierdestroyed" }, +// { 0x2F8F, "" }, + { 0x2F90, "harrier_deathfx" }, +// { 0x2F91, "" }, +// { 0x2F92, "" }, +// { 0x2F93, "" }, +// { 0x2F94, "" }, + { 0x2F95, "watchvehtargetcrash" }, + { 0x2F96, "watchvehtargetdeath" }, +// { 0x2F97, "" }, +// { 0x2F98, "" }, +// { 0x2F99, "" }, + { 0x2F9A, "onfirefx" }, + { 0x2F9B, "airstrikefx" }, +// { 0x2F9C, "" }, +// { 0x2F9D, "" }, +// { 0x2F9E, "" }, +// { 0x2F9F, "" }, + { 0x2FA0, "dangermaxradius" }, +// { 0x2FA1, "" }, + { 0x2FA2, "dangerforwardpush" }, +// { 0x2FA3, "" }, +// { 0x2FA4, "" }, +// { 0x2FA5, "" }, +// { 0x2FA6, "" }, +// { 0x2FA7, "" }, + { 0x2FA8, "tryuseharrierairstrike" }, +// { 0x2FA9, "" }, +// { 0x2FAA, "" }, +// { 0x2FAB, "" }, + { 0x2FAC, "getairstrikedanger" }, + { 0x2FAD, "getsingleairstrikedanger" }, + { 0x2FAE, "pointisinairstrikearea" }, +// { 0x2FAF, "" }, +// { 0x2FB0, "" }, +// { 0x2FB1, "" }, +// { 0x2FB2, "" }, + { 0x2FB3, "airstrikedamageentsthread" }, +// { 0x2FB4, "" }, +// { 0x2FB5, "" }, +// { 0x2FB6, "" }, +// { 0x2FB7, "" }, + { 0x2FB8, "dobomberstrike" }, +// { 0x2FB9, "" }, + { 0x2FBA, "playbombfx" }, +// { 0x2FBB, "" }, + { 0x2FBC, "airstriketype" }, + { 0x2FBD, "callstrike_bomb" }, +// { 0x2FBE, "" }, +// { 0x2FBF, "" }, + { 0x2FC0, "addplanetolist" }, + { 0x2FC1, "removeplanefromlist" }, + { 0x2FC2, "callstrike_bombeffect" }, + { 0x2FC3, "spawnbomb" }, + { 0x2FC4, "callstrike" }, +// { 0x2FC5, "" }, +// { 0x2FC6, "" }, +// { 0x2FC7, "" }, +// { 0x2FC8, "" }, + { 0x2FC9, "finishairstrikeusage" }, +// { 0x2FCA, "" }, + { 0x2FCB, "handleemp" }, +// { 0x2FCC, "" }, +// { 0x2FCD, "" }, + { 0x2FCE, "expandmins" }, +// { 0x2FCF, "" }, +// { 0x2FD0, "" }, + { 0x2FD1, "teamspawnpoints" }, + { 0x2FD2, "inited" }, + { 0x2FD3, "spawnmins" }, +// { 0x2FD4, "" }, + { 0x2FD5, "placespawnpoints" }, +// { 0x2FD6, "" }, + { 0x2FD7, "getspawnpointarray" }, +// { 0x2FD8, "" }, +// { 0x2FD9, "" }, + { 0x2FDA, "spawnpointinit" }, + { 0x2FDB, "sighttracepoint" }, +// { 0x2FDC, "" }, +// { 0x2FDD, "" }, +// { 0x2FDE, "" }, + { 0x2FDF, "getteamspawnpoints" }, +// { 0x2FE0, "" }, + { 0x2FE1, "getbestweightedspawnpoint" }, + { 0x2FE2, "sights" }, + { 0x2FE3, "lastsighttracetime" }, + { 0x2FE4, "getallotherplayers" }, + { 0x2FE5, "initweights" }, +// { 0x2FE6, "" }, + { 0x2FE7, "numplayersatlastupdate" }, + { 0x2FE8, "weighteddistsum" }, + { 0x2FE9, "distsum" }, + { 0x2FEA, "favorclosespawnent" }, +// { 0x2FEB, "" }, +// { 0x2FEC, "" }, +// { 0x2FED, "" }, +// { 0x2FEE, "" }, +// { 0x2FEF, "" }, +// { 0x2FF0, "" }, +// { 0x2FF1, "" }, + { 0x2FF2, "spawnlogic_spawnkills" }, +// { 0x2FF3, "" }, + { 0x2FF4, "tanks" }, + { 0x2FF5, "ims" }, +// { 0x2FF6, "" }, + { 0x2FF7, "sightcheckcost" }, + { 0x2FF8, "watchspawnprofile" }, + { 0x2FF9, "spawnprofile" }, + { 0x2FFA, "spawngraphcheck" }, + { 0x2FFB, "spawngraph" }, +// { 0x2FFC, "" }, + { 0x2FFD, "fake" }, +// { 0x2FFE, "" }, + { 0x2FFF, "setupspawngraphpoint" }, + { 0x3000, "visible" }, +// { 0x3001, "" }, + { 0x3002, "loopbotspawns" }, + { 0x3003, "trackgrenades" }, + { 0x3004, "trackmissiles" }, + { 0x3005, "ispointvulnerable" }, + { 0x3006, "claymoremodelcenteroffset" }, +// { 0x3007, "" }, + { 0x3008, "claymoredetectionconeangle" }, + { 0x3009, "avoidweapondamage" }, + { 0x300A, "adjustsightvalue" }, + { 0x300B, "spawnpointupdate" }, +// { 0x300C, "" }, + { 0x300D, "nearbypenalty" }, +// { 0x300E, "" }, +// { 0x300F, "" }, +// { 0x3010, "" }, +// { 0x3011, "" }, + { 0x3012, "getrevengespawndistancesq" }, +// { 0x3013, "" }, +// { 0x3014, "" }, +// { 0x3015, "" }, +// { 0x3016, "" }, +// { 0x3017, "" }, + { 0x3018, "avoidsamespawn" }, + { 0x3019, "setupkillstreakspawnshield" }, +// { 0x301A, "" }, + { 0x301B, "ac130_num_flares" }, +// { 0x301C, "" }, +// { 0x301D, "" }, + { 0x301E, "lastradiotransmission" }, +// { 0x301F, "" }, + { 0x3020, "physicssphereradius" }, + { 0x3021, "physicssphereforce" }, +// { 0x3022, "" }, +// { 0x3023, "" }, +// { 0x3024, "" }, + { 0x3025, "tryuseac130" }, +// { 0x3026, "" }, + { 0x3027, "init_sounds" }, +// { 0x3028, "" }, + { 0x3029, "played" }, + { 0x302A, "sounds" }, + { 0x302B, "add_context_sensative_timeout" }, +// { 0x302C, "" }, +// { 0x302D, "" }, + { 0x302E, "deleteonac130playerremoved" }, + { 0x302F, "setac130player" }, + { 0x3030, "incomingmissile" }, +// { 0x3031, "" }, + { 0x3032, "ac130_altscene" }, + { 0x3033, "cameramodel" }, + { 0x3034, "removeac130playerongameend" }, + { 0x3035, "removeac130playerongamecleanup" }, +// { 0x3036, "" }, + { 0x3037, "removeac130playeroncrash" }, + { 0x3038, "removeac130playerondisconnect" }, +// { 0x3039, "" }, + { 0x303A, "removeac130playeronspectate" }, + { 0x303B, "removeac130playeraftertime" }, +// { 0x303C, "" }, + { 0x303D, "darkscreenoverlay" }, + { 0x303E, "damagetracker" }, +// { 0x303F, "" }, + { 0x3040, "overlay_coords" }, +// { 0x3041, "" }, +// { 0x3042, "" }, +// { 0x3043, "" }, +// { 0x3044, "" }, + { 0x3045, "changeweapons" }, +// { 0x3046, "" }, +// { 0x3047, "" }, +// { 0x3048, "" }, + { 0x3049, "clouds_create" }, + { 0x304A, "playerweapon" }, + { 0x304B, "gun_fired_and_ready_105mm" }, + { 0x304C, "shotfired" }, +// { 0x304D, "" }, + { 0x304E, "shotfireddarkscreenoverlay" }, +// { 0x304F, "" }, +// { 0x3050, "" }, + { 0x3051, "context_sensative_dialog_guy_in_sight" }, + { 0x3052, "context_sensative_dialog_guy_in_sight_check" }, + { 0x3053, "context_sensative_dialog_guy_crawling" }, +// { 0x3054, "" }, +// { 0x3055, "" }, +// { 0x3056, "" }, +// { 0x3057, "" }, + { 0x3058, "context_sensative_dialog_kill_thread" }, + { 0x3059, "context_sensative_dialog_locations" }, +// { 0x305A, "" }, +// { 0x305B, "" }, + { 0x305C, "context_sensative_dialog_vehiclespawn" }, +// { 0x305D, "" }, +// { 0x305E, "" }, +// { 0x305F, "" }, + { 0x3060, "context_sensative_dialog_play_random_group_sound" }, +// { 0x3061, "" }, +// { 0x3062, "" }, +// { 0x3063, "" }, + { 0x3064, "debug_circle" }, + { 0x3065, "stingerproximitydetonate" }, +// { 0x3066, "" }, +// { 0x3067, "" }, + { 0x3068, "angelflareprecache" }, +// { 0x3069, "" }, + { 0x306A, "missileremotelaunchvert" }, +// { 0x306B, "" }, +// { 0x306C, "" }, + { 0x306D, "remotemissile_fx" }, + { 0x306E, "tryusepredatormissile" }, + { 0x306F, "getbestspawnpoint" }, + { 0x3070, "spawnscore" }, +// { 0x3071, "" }, + { 0x3072, "handledamage" }, + { 0x3073, "missileeyes" }, +// { 0x3074, "" }, + { 0x3075, "staticeffect" }, +// { 0x3076, "" }, +// { 0x3077, "" }, + { 0x3078, "rocket_cleanupondeath" }, + { 0x3079, "player_cleanupongameended" }, + { 0x307A, "radarviewtime" }, + { 0x307B, "uavblocktime" }, + { 0x307C, "uav_fx" }, + { 0x307D, "killstreaksetupfuncs" }, +// { 0x307E, "" }, +// { 0x307F, "" }, +// { 0x3080, "" }, + { 0x3081, "rotateuavrig" }, + { 0x3082, "launchuav" }, + { 0x3083, "timetoadd" }, +// { 0x3084, "" }, +// { 0x3085, "" }, +// { 0x3086, "" }, +// { 0x3087, "" }, +// { 0x3088, "" }, +// { 0x3089, "" }, + { 0x308A, "waittill_notify_or_timeout_hostmigration_pause" }, +// { 0x308B, "" }, +// { 0x308C, "" }, + { 0x308D, "tryuseuavsupport" }, + { 0x308E, "tryusedoubleuav" }, +// { 0x308F, "" }, + { 0x3090, "tryusecounteruav" }, + { 0x3091, "uavstrikesetup" }, +// { 0x3092, "" }, + { 0x3093, "tryuseuavstrike" }, + { 0x3094, "tryusedirectionaluav" }, + { 0x3095, "useuav" }, +// { 0x3096, "" }, +// { 0x3097, "" }, +// { 0x3098, "" }, + { 0x3099, "updateplayersuavstatus" }, + { 0x309A, "blockplayeruav" }, +// { 0x309B, "" }, + { 0x309C, "useplayeruav" }, + { 0x309D, "setteamradarwrapper" }, +// { 0x309E, "" }, +// { 0x309F, "" }, +// { 0x30A0, "" }, + { 0x30A1, "addactivecounteruav" }, + { 0x30A2, "removeactiveuav" }, +// { 0x30A3, "" }, + { 0x30A4, "tryuselbflock" }, + { 0x30A5, "selectlbstrikelocation" }, +// { 0x30A6, "" }, + { 0x30A7, "finishlbstrikeusage" }, +// { 0x30A8, "" }, + { 0x30A9, "getflightpath" }, +// { 0x30AA, "" }, +// { 0x30AB, "" }, + { 0x30AC, "killcount" }, + { 0x30AD, "mgturret1" }, + { 0x30AE, "monitorkills" }, +// { 0x30AF, "" }, + { 0x30B0, "flock_handledamage" }, + { 0x30B1, "trail_fx" }, +// { 0x30B2, "" }, +// { 0x30B3, "" }, + { 0x30B4, "heliguardsettings" }, +// { 0x30B5, "" }, + { 0x30B6, "weaponmodelleft" }, + { 0x30B7, "weaponmodelright" }, + { 0x30B8, "weapontagleft" }, +// { 0x30B9, "" }, +// { 0x30BA, "" }, +// { 0x30BB, "" }, + { 0x30BC, "littlebirdguard" }, + { 0x30BD, "air_node_mesh" }, +// { 0x30BE, "" }, +// { 0x30BF, "" }, + { 0x30C0, "heliguardtype" }, +// { 0x30C1, "" }, + { 0x30C2, "attract_strength" }, +// { 0x30C3, "" }, + { 0x30C4, "hasdodged" }, + { 0x30C5, "lbsupport_lightfx" }, +// { 0x30C6, "" }, +// { 0x30C7, "" }, + { 0x30C8, "lbsupport_movetoplayer" }, + { 0x30C9, "intransit" }, + { 0x30CA, "lbsupport_watchdeath" }, +// { 0x30CB, "" }, +// { 0x30CC, "" }, + { 0x30CD, "lbsupport_watchownerdamage" }, +// { 0x30CE, "" }, +// { 0x30CF, "" }, + { 0x30D0, "lbsupport_handledamage" }, + { 0x30D1, "marker" }, +// { 0x30D2, "" }, + { 0x30D3, "lbsupport_getcloseststartnode" }, + { 0x30D4, "air_start_nodes" }, +// { 0x30D5, "" }, +// { 0x30D6, "" }, + { 0x30D7, "neighbors" }, + { 0x30D8, "lbsupport_arraycontains" }, + { 0x30D9, "lbsupport_getlinkedstructs" }, +// { 0x30DA, "" }, +// { 0x30DB, "" }, +// { 0x30DC, "" }, + { 0x30DD, "lbsupport_burstfirestart" }, + { 0x30DE, "lbsupport_burstfirestop" }, +// { 0x30DF, "" }, +// { 0x30E0, "" }, + { 0x30E1, "emp_jamteam" }, + { 0x30E2, "emp_jamplayers" }, +// { 0x30E3, "" }, +// { 0x30E4, "" }, + { 0x30E5, "empeffect" }, +// { 0x30E6, "" }, +// { 0x30E7, "" }, +// { 0x30E8, "" }, +// { 0x30E9, "" }, +// { 0x30EA, "" }, + { 0x30EB, "teamnukeemped" }, +// { 0x30EC, "" }, + { 0x30ED, "nukeinfo" }, + { 0x30EE, "tryusenuke" }, + { 0x30EF, "delaythread_nuke" }, + { 0x30F0, "donuke" }, + { 0x30F1, "cancelnukeondeath" }, +// { 0x30F2, "" }, + { 0x30F3, "nukesoundexplosion" }, + { 0x30F4, "nukeeffects" }, +// { 0x30F5, "" }, + { 0x30F6, "nukeaftermatheffect" }, +// { 0x30F7, "" }, + { 0x30F8, "nukevision" }, +// { 0x30F9, "" }, +// { 0x30FA, "" }, + { 0x30FB, "nukeearthquake" }, +// { 0x30FC, "" }, + { 0x30FD, "nuke_empteamtracker" }, +// { 0x30FE, "" }, +// { 0x30FF, "" }, +// { 0x3100, "" }, +// { 0x3101, "" }, + { 0x3102, "spawnremote" }, + { 0x3103, "lookcenter" }, +// { 0x3104, "" }, +// { 0x3105, "" }, +// { 0x3106, "" }, +// { 0x3107, "" }, +// { 0x3108, "" }, +// { 0x3109, "" }, +// { 0x310A, "" }, +// { 0x310B, "" }, +// { 0x310C, "" }, +// { 0x310D, "" }, +// { 0x310E, "" }, + { 0x310F, "handleownerdisconnect" }, + { 0x3110, "removeremote" }, +// { 0x3111, "" }, +// { 0x3112, "" }, +// { 0x3113, "" }, +// { 0x3114, "" }, +// { 0x3115, "" }, +// { 0x3116, "" }, +// { 0x3117, "" }, +// { 0x3118, "" }, + { 0x3119, "tryusedeployablevest" }, +// { 0x311A, "" }, + { 0x311B, "watchmarkerusage" }, + { 0x311C, "watchmarker" }, + { 0x311D, "takeweapononstuck" }, +// { 0x311E, "" }, + { 0x311F, "markeractivate" }, +// { 0x3120, "" }, +// { 0x3121, "" }, +// { 0x3122, "" }, +// { 0x3123, "" }, + { 0x3124, "isusable" }, +// { 0x3125, "" }, +// { 0x3126, "" }, +// { 0x3127, "" }, +// { 0x3128, "" }, +// { 0x3129, "" }, + { 0x312A, "box_handleownerdisconnect" }, + { 0x312B, "boxthink" }, +// { 0x312C, "" }, + { 0x312D, "boxcapturethink" }, +// { 0x312E, "" }, +// { 0x312F, "" }, + { 0x3130, "box_modelteamupdater" }, + { 0x3131, "boxparams" }, + { 0x3132, "disablewhenjuggernaut" }, + { 0x3133, "imssettings" }, +// { 0x3134, "" }, +// { 0x3135, "" }, + { 0x3136, "cannotplacestring" }, +// { 0x3137, "" }, +// { 0x3138, "" }, + { 0x3139, "modelexplosive2" }, + { 0x313A, "modelexplosive3" }, + { 0x313B, "modelexplosive4" }, + { 0x313C, "modellid1" }, + { 0x313D, "modellid2" }, +// { 0x313E, "" }, +// { 0x313F, "" }, + { 0x3140, "tagexplosive1" }, + { 0x3141, "tagexplosive2" }, + { 0x3142, "tagexplosive3" }, +// { 0x3143, "" }, + { 0x3144, "taglid1" }, + { 0x3145, "taglid2" }, +// { 0x3146, "" }, +// { 0x3147, "" }, +// { 0x3148, "" }, + { 0x3149, "imslist" }, + { 0x314A, "giveims" }, +// { 0x314B, "" }, + { 0x314C, "createimsforplayer" }, +// { 0x314D, "" }, + { 0x314E, "createims" }, +// { 0x314F, "" }, +// { 0x3150, "" }, + { 0x3151, "lid3" }, +// { 0x3152, "" }, + { 0x3153, "explosive1" }, +// { 0x3154, "" }, +// { 0x3155, "" }, + { 0x3156, "explosive4" }, + { 0x3157, "ims_createbombsquadmodel" }, +// { 0x3158, "" }, + { 0x3159, "ims_handledeath" }, + { 0x315A, "ims_handleuse" }, + { 0x315B, "ims_handleownerdisconnect" }, +// { 0x315C, "" }, +// { 0x315D, "" }, +// { 0x315E, "" }, +// { 0x315F, "" }, + { 0x3160, "ims_oncarrierdeath" }, + { 0x3161, "ims_oncarrierdisconnect" }, +// { 0x3162, "" }, +// { 0x3163, "" }, + { 0x3164, "attacktrigger" }, + { 0x3165, "attackmovetime" }, +// { 0x3166, "" }, +// { 0x3167, "" }, +// { 0x3168, "" }, + { 0x3169, "ims_setinactive" }, + { 0x316A, "isfriendlytoims" }, + { 0x316B, "ims_attacktargets" }, +// { 0x316C, "" }, +// { 0x316D, "" }, +// { 0x316E, "" }, + { 0x316F, "removefromimslist" }, +// { 0x3170, "" }, + { 0x3171, "ims_showallparts" }, + { 0x3172, "turretsettings" }, +// { 0x3173, "" }, + { 0x3174, "hintexit" }, + { 0x3175, "laptopinfo" }, +// { 0x3176, "" }, +// { 0x3177, "" }, + { 0x3178, "takekillstreakweapons" }, + { 0x3179, "takekillstreakweaponifnodupe" }, + { 0x317A, "tryuseremoteturret" }, + { 0x317B, "setcarryingturret" }, + { 0x317C, "restoreweaponclipammo" }, +// { 0x317D, "" }, + { 0x317E, "waitrestoreweapons" }, +// { 0x317F, "" }, +// { 0x3180, "" }, +// { 0x3181, "" }, + { 0x3182, "updateturretplacement" }, +// { 0x3183, "" }, + { 0x3184, "turret_oncarrierdisconnect" }, + { 0x3185, "turret_oncarrierchangedteam" }, + { 0x3186, "turret_ongameended" }, + { 0x3187, "createturretforplayer" }, + { 0x3188, "stunned" }, +// { 0x3189, "" }, +// { 0x318A, "" }, +// { 0x318B, "" }, +// { 0x318C, "" }, + { 0x318D, "startusingremoteturret" }, + { 0x318E, "stopusingremoteturret" }, +// { 0x318F, "" }, +// { 0x3190, "" }, +// { 0x3191, "" }, + { 0x3192, "enter_message_deleted" }, +// { 0x3193, "" }, + { 0x3194, "turret_setinactive" }, +// { 0x3195, "" }, +// { 0x3196, "" }, +// { 0x3197, "" }, + { 0x3198, "turret_handledeath" }, +// { 0x3199, "" }, +// { 0x319A, "" }, +// { 0x319B, "" }, + { 0x319C, "turret_watchlowhealth" }, + { 0x319D, "turret_stun" }, +// { 0x319E, "" }, +// { 0x319F, "" }, + { 0x31A0, "missileinfo" }, + { 0x31A1, "modelmgturret" }, + { 0x31A2, "stringplace" }, +// { 0x31A3, "" }, + { 0x31A4, "remote_tank_armor_bulletdamage" }, +// { 0x31A5, "" }, +// { 0x31A6, "" }, +// { 0x31A7, "" }, +// { 0x31A8, "" }, +// { 0x31A9, "" }, + { 0x31AA, "tank_setcarried" }, +// { 0x31AB, "" }, + { 0x31AC, "tank_oncarrierdeath" }, + { 0x31AD, "tank_oncarrierdisconnect" }, + { 0x31AE, "tank_ongameended" }, + { 0x31AF, "tank_setcancelled" }, +// { 0x31B0, "" }, +// { 0x31B1, "" }, +// { 0x31B2, "" }, + { 0x31B3, "tank" }, +// { 0x31B4, "" }, +// { 0x31B5, "" }, +// { 0x31B6, "" }, +// { 0x31B7, "" }, +// { 0x31B8, "" }, + { 0x31B9, "tank_freezebuffer" }, +// { 0x31BA, "" }, +// { 0x31BB, "" }, + { 0x31BC, "tank_handletimeout" }, + { 0x31BD, "tank_handledeath" }, + { 0x31BE, "tank_incrementdamagefade" }, +// { 0x31BF, "" }, +// { 0x31C0, "" }, +// { 0x31C1, "" }, + { 0x31C2, "tank_watchfiring" }, + { 0x31C3, "tank_firemissiles" }, + { 0x31C4, "tank_earthquake" }, + { 0x31C5, "addtougvlist" }, + { 0x31C6, "removefromugvlist" }, + { 0x31C7, "tank_playerexit" }, + { 0x31C8, "killstreakweapons" }, +// { 0x31C9, "" }, + { 0x31CA, "killstreakchainingweapons" }, + { 0x31CB, "killstreakrounddelay" }, + { 0x31CC, "initkillstreakdata" }, + { 0x31CD, "curdefvalue" }, + { 0x31CE, "spupdatetotal" }, + { 0x31CF, "earnedstreaklevel" }, + { 0x31D0, "adrenaline" }, + { 0x31D1, "initplayerkillstreaks" }, + { 0x31D2, "earned" }, + { 0x31D3, "awardxp" }, + { 0x31D4, "kid" }, + { 0x31D5, "isgimme" }, +// { 0x31D6, "" }, +// { 0x31D7, "" }, +// { 0x31D8, "" }, + { 0x31D9, "previousadrenaline" }, + { 0x31DA, "resetstreakcount" }, +// { 0x31DB, "" }, + { 0x31DC, "getmaxstreakcost" }, +// { 0x31DD, "" }, + { 0x31DE, "killstreakindexweapon" }, + { 0x31DF, "waitforchangeteam" }, + { 0x31E0, "isridekillstreak" }, +// { 0x31E1, "" }, +// { 0x31E2, "" }, + { 0x31E3, "killstreakusepressed" }, + { 0x31E4, "selectinglocation" }, + { 0x31E5, "usehardpoint" }, + { 0x31E6, "updatespecialistkillstreaks" }, +// { 0x31E7, "" }, +// { 0x31E8, "" }, +// { 0x31E9, "" }, + { 0x31EA, "waittakekillstreakweapon" }, +// { 0x31EB, "" }, +// { 0x31EC, "" }, +// { 0x31ED, "" }, + { 0x31EE, "killstreakearned" }, +// { 0x31EF, "" }, + { 0x31F0, "earnkillstreak" }, +// { 0x31F1, "" }, +// { 0x31F2, "" }, +// { 0x31F3, "" }, +// { 0x31F4, "" }, +// { 0x31F5, "" }, +// { 0x31F6, "" }, +// { 0x31F7, "" }, + { 0x31F8, "getkillstreakinformenemy" }, +// { 0x31F9, "" }, + { 0x31FA, "getkillstreakdialog" }, + { 0x31FB, "getkillstreakicon" }, + { 0x31FC, "getkillstreakdpadicon" }, + { 0x31FD, "getkillstreakindex" }, + { 0x31FE, "giveownedkillstreakitem" }, +// { 0x31FF, "" }, +// { 0x3200, "" }, +// { 0x3201, "" }, +// { 0x3202, "" }, +// { 0x3203, "" }, + { 0x3204, "leadersoundgroup" }, + { 0x3205, "getkillstreakcount" }, + { 0x3206, "shufflekillstreaksup" }, +// { 0x3207, "" }, + { 0x3208, "streakselectuptracker" }, +// { 0x3209, "" }, +// { 0x320A, "" }, + { 0x320B, "adrenalineinfo" }, + { 0x320C, "giveallperks" }, +// { 0x320D, "" }, +// { 0x320E, "" }, +// { 0x320F, "" }, + { 0x3210, "weaponpromotionsplashnotify" }, + { 0x3211, "textglowcolor" }, +// { 0x3212, "" }, + { 0x3213, "overlayoffsety" }, + { 0x3214, "playercardplayer" }, +// { 0x3215, "" }, +// { 0x3216, "" }, + { 0x3217, "hintmessagedeaththink" }, + { 0x3218, "lowermessagethink" }, + { 0x3219, "lowermessages" }, +// { 0x321A, "" }, +// { 0x321B, "" }, +// { 0x321C, "" }, +// { 0x321D, "" }, +// { 0x321E, "" }, +// { 0x321F, "" }, + { 0x3220, "missioncallbacks" }, +// { 0x3221, "" }, + { 0x3222, "perkmap" }, +// { 0x3223, "" }, + { 0x3224, "patientzeroname" }, +// { 0x3225, "" }, +// { 0x3226, "" }, + { 0x3227, "monitorscavengerpickup" }, +// { 0x3228, "" }, +// { 0x3229, "" }, + { 0x322A, "monitortacinsertionsdestroyed" }, +// { 0x322B, "" }, + { 0x322C, "initmissiondata" }, + { 0x322D, "registermissioncallback" }, + { 0x322E, "ch_assists" }, + { 0x322F, "ch_hardpoints" }, + { 0x3230, "hardpointtype" }, + { 0x3231, "ch_vehicle_kills" }, +// { 0x3232, "" }, + { 0x3233, "ch_vehicle_killed" }, + { 0x3234, "clearidshortly" }, + { 0x3235, "explosivekills" }, +// { 0x3236, "" }, +// { 0x3237, "" }, +// { 0x3238, "" }, +// { 0x3239, "" }, + { 0x323A, "ishighestscoringplayer" }, + { 0x323B, "ch_kills" }, + { 0x323C, "iscacsecondaryweapon" }, +// { 0x323D, "" }, +// { 0x323E, "" }, + { 0x323F, "getweaponattachments" }, + { 0x3240, "anglesondeath" }, + { 0x3241, "anglesonkill" }, +// { 0x3242, "" }, + { 0x3243, "holdingbreath" }, +// { 0x3244, "" }, + { 0x3245, "isplanting" }, + { 0x3246, "isdefusing" }, + { 0x3247, "isbombcarrier" }, + { 0x3248, "dd" }, + { 0x3249, "lastprimaryweaponswaptime" }, + { 0x324A, "lastflashedtime" }, +// { 0x324B, "" }, +// { 0x324C, "" }, +// { 0x324D, "" }, +// { 0x324E, "" }, +// { 0x324F, "" }, + { 0x3250, "attackerstance" }, + { 0x3251, "ch_roundplayed" }, + { 0x3252, "place" }, +// { 0x3253, "" }, +// { 0x3254, "" }, +// { 0x3255, "" }, +// { 0x3256, "" }, + { 0x3257, "domissioncallback" }, + { 0x3258, "monitorsprintdistance" }, + { 0x3259, "sprintdistthissprint" }, + { 0x325A, "monitorsinglesprintdistance" }, +// { 0x325B, "" }, +// { 0x325C, "" }, +// { 0x325D, "" }, +// { 0x325E, "" }, +// { 0x325F, "" }, + { 0x3260, "survivalistchallenge" }, + { 0x3261, "monitorstreaks" }, +// { 0x3262, "" }, + { 0x3263, "monitormiscsingle" }, + { 0x3264, "monitormisccallback" }, +// { 0x3265, "" }, + { 0x3266, "resetbrinkofdeathkillstreakshortly" }, + { 0x3267, "playerdied" }, +// { 0x3268, "" }, +// { 0x3269, "" }, + { 0x326A, "getweaponattachment" }, +// { 0x326B, "" }, + { 0x326C, "isattachmentunlocked" }, + { 0x326D, "buildchallegeinfo" }, + { 0x326E, "monitorprocesschallenge" }, +// { 0x326F, "" }, +// { 0x3270, "" }, +// { 0x3271, "" }, + { 0x3272, "monitoradstime" }, +// { 0x3273, "" }, +// { 0x3274, "" }, + { 0x3275, "mantling" }, +// { 0x3276, "" }, + { 0x3277, "monitorflashbang" }, + { 0x3278, "monitorconcussion" }, +// { 0x3279, "" }, + { 0x327A, "waitdelayminetime" }, + { 0x327B, "weaponranktable" }, + { 0x327C, "maxprestige" }, +// { 0x327D, "" }, +// { 0x327E, "" }, +// { 0x327F, "" }, +// { 0x3280, "" }, + { 0x3281, "getweaponrankinfoxpamt" }, +// { 0x3282, "" }, +// { 0x3283, "" }, + { 0x3284, "xpupdatetotal" }, +// { 0x3285, "" }, + { 0x3286, "hud_xppointspopup" }, + { 0x3287, "hud_xpeventpopup" }, +// { 0x3288, "" }, +// { 0x3289, "" }, +// { 0x328A, "" }, + { 0x328B, "roundup" }, +// { 0x328C, "" }, + { 0x328D, "levelflag" }, +// { 0x328E, "" }, + { 0x328F, "createxppointspopup" }, + { 0x3290, "createxpeventpopup" }, + { 0x3291, "removerankhud" }, +// { 0x3292, "" }, +// { 0x3293, "" }, +// { 0x3294, "" }, +// { 0x3295, "" }, + { 0x3296, "getprestigelevel" }, +// { 0x3297, "" }, +// { 0x3298, "" }, + { 0x3299, "isweaponmaxrank" }, + { 0x329A, "incrankxp" }, + { 0x329B, "ischeater" }, + { 0x329C, "getrestxpaward" }, + { 0x329D, "islastrestxpaward" }, +// { 0x329E, "" }, + { 0x329F, "isweaponchallenge" }, +// { 0x32A0, "" }, +// { 0x32A1, "" }, +// { 0x32A2, "" }, + { 0x32A3, "defaultclass" }, +// { 0x32A4, "" }, + { 0x32A5, "cac_getweaponcamo" }, +// { 0x32A6, "" }, + { 0x32A7, "recipe_getkillstreak" }, +// { 0x32A8, "" }, +// { 0x32A9, "" }, + { 0x32AA, "table_getteamperk" }, + { 0x32AB, "loadoutfakeperks" }, + { 0x32AC, "getloadoutstreaktypefromstreaktype" }, + { 0x32AD, "recipeclassapplyjuggernaut" }, +// { 0x32AE, "" }, + { 0x32AF, "loadoutprimarycamo" }, +// { 0x32B0, "" }, +// { 0x32B1, "" }, +// { 0x32B2, "" }, + { 0x32B3, "_clearperks" }, + { 0x32B4, "_detachall" }, + { 0x32B5, "loadoutallperks" }, +// { 0x32B6, "" }, + { 0x32B7, "loadoutperk2" }, + { 0x32B8, "loadoutperk3" }, + { 0x32B9, "loadoutperkequipment" }, + { 0x32BA, "tryattach" }, +// { 0x32BB, "" }, +// { 0x32BC, "" }, + { 0x32BD, "lettertonumber" }, +// { 0x32BE, "" }, +// { 0x32BF, "" }, + { 0x32C0, "buildweaponnamereticle" }, + { 0x32C1, "makeletterstonumbers" }, +// { 0x32C2, "" }, + { 0x32C3, "replenishloadout" }, + { 0x32C4, "classgrenades" }, +// { 0x32C5, "" }, +// { 0x32C6, "" }, + { 0x32C7, "getperkforclass" }, +// { 0x32C8, "" }, +// { 0x32C9, "" }, + { 0x32CA, "isvalidweaponbuff" }, + { 0x32CB, "isweaponbuffunlocked" }, + { 0x32CC, "isvalidcamo" }, + { 0x32CD, "isvalidreticle" }, +// { 0x32CE, "" }, +// { 0x32CF, "" }, +// { 0x32D0, "" }, +// { 0x32D1, "" }, +// { 0x32D2, "" }, +// { 0x32D3, "" }, +// { 0x32D4, "" }, + { 0x32D5, "isvalidweapon" }, +// { 0x32D6, "" }, + { 0x32D7, "isvalidkillstreak" }, + { 0x32D8, "persistentdatainfo" }, + { 0x32D9, "bufferedstats" }, +// { 0x32DA, "" }, +// { 0x32DB, "" }, +// { 0x32DC, "" }, +// { 0x32DD, "" }, +// { 0x32DE, "" }, +// { 0x32DF, "" }, +// { 0x32E0, "" }, +// { 0x32E1, "" }, + { 0x32E2, "endselectiononemp" }, +// { 0x32E3, "" }, +// { 0x32E4, "" }, + { 0x32E5, "getplant" }, +// { 0x32E6, "" }, + { 0x32E7, "deleteplacedentity" }, + { 0x32E8, "sortlowermessages" }, +// { 0x32E9, "" }, +// { 0x32EA, "" }, + { 0x32EB, "showtimer" }, +// { 0x32EC, "" }, + { 0x32ED, "fadetoalpha" }, + { 0x32EE, "fadetoalphatime" }, +// { 0x32EF, "" }, +// { 0x32F0, "" }, +// { 0x32F1, "" }, + { 0x32F2, "clearondeath" }, + { 0x32F3, "clearafterfade" }, +// { 0x32F4, "" }, + { 0x32F5, "printboldonteam" }, + { 0x32F6, "printboldonteamarg" }, + { 0x32F7, "printonteamarg" }, +// { 0x32F8, "" }, +// { 0x32F9, "" }, +// { 0x32FA, "" }, + { 0x32FB, "printandsoundonplayer" }, +// { 0x32FC, "" }, +// { 0x32FD, "" }, + { 0x32FE, "dvarfloatvalue" }, + { 0x32FF, "updatepersratiobuffered" }, +// { 0x3300, "" }, +// { 0x3301, "" }, + { 0x3302, "leaderdialogbothteams" }, +// { 0x3303, "" }, +// { 0x3304, "" }, +// { 0x3305, "" }, +// { 0x3306, "" }, + { 0x3307, "setobjectivehinttext" }, + { 0x3308, "getobjectivetext" }, + { 0x3309, "getobjectivescoretext" }, + { 0x330A, "getminutespassed" }, +// { 0x330B, "" }, +// { 0x330C, "" }, +// { 0x330D, "" }, +// { 0x330E, "" }, +// { 0x330F, "" }, +// { 0x3310, "" }, +// { 0x3311, "" }, +// { 0x3312, "" }, + { 0x3313, "registerwinlimitdvar" }, + { 0x3314, "registerscorelimitdvar" }, +// { 0x3315, "" }, + { 0x3316, "registerhalftimedvar" }, +// { 0x3317, "" }, +// { 0x3318, "" }, +// { 0x3319, "" }, + { 0x331A, "_takeweaponsexcept" }, + { 0x331B, "savedata" }, + { 0x331C, "offhandclass" }, +// { 0x331D, "" }, +// { 0x331E, "" }, +// { 0x331F, "" }, + { 0x3320, "clipammol" }, + { 0x3321, "stockammo" }, +// { 0x3322, "" }, +// { 0x3323, "" }, +// { 0x3324, "" }, +// { 0x3325, "" }, + { 0x3326, "registerwatchdvarfloat" }, +// { 0x3327, "" }, + { 0x3328, "setoverridewatchdvar" }, +// { 0x3329, "" }, +// { 0x332A, "" }, +// { 0x332B, "" }, +// { 0x332C, "" }, +// { 0x332D, "" }, + { 0x332E, "ddtimetoadd" }, +// { 0x332F, "" }, +// { 0x3330, "" }, + { 0x3331, "getlivingplayers" }, + { 0x3332, "getremotename" }, + { 0x3333, "queues" }, +// { 0x3334, "" }, +// { 0x3335, "" }, + { 0x3336, "quicksort" }, +// { 0x3337, "" }, +// { 0x3338, "" }, +// { 0x3339, "" }, +// { 0x333A, "" }, + { 0x333B, "givecombathigh" }, + { 0x333C, "arrayinsertion" }, +// { 0x333D, "" }, +// { 0x333E, "" }, + { 0x333F, "_statusmenu" }, + { 0x3340, "streakshouldchain" }, + { 0x3341, "fixakimbostring" }, + { 0x3342, "rounddecimalplaces" }, + { 0x3343, "maketeamusable" }, +// { 0x3344, "" }, +// { 0x3345, "" }, + { 0x3346, "gameflagclear" }, + { 0x3347, "isprimarydamage" }, + { 0x3348, "levelflags" }, +// { 0x3349, "" }, +// { 0x334A, "" }, + { 0x334B, "killtrigger" }, +// { 0x334C, "" }, + { 0x334D, "matchrules_allowcustomclasses" }, +// { 0x334E, "" }, +// { 0x334F, "" }, +// { 0x3350, "" }, +// { 0x3351, "" }, +// { 0x3352, "" }, +// { 0x3353, "" }, + { 0x3354, "is_roomtype_valid" }, +// { 0x3355, "" }, +// { 0x3356, "" }, +// { 0x3357, "" }, + { 0x3358, "set_whizby_radius" }, + { 0x3359, "set_whizby_spread" }, +// { 0x335A, "" }, + { 0x335B, "radial_button_definitions" }, + { 0x335C, "radial_init" }, + { 0x335D, "radial_button_group" }, +// { 0x335E, "" }, + { 0x335F, "end_angle" }, +// { 0x3360, "" }, +// { 0x3361, "" }, +// { 0x3362, "" }, + { 0x3363, "observer" }, +// { 0x3364, "" }, +// { 0x3365, "" }, +// { 0x3366, "" }, + { 0x3367, "rs_angle" }, +// { 0x3368, "" }, +// { 0x3369, "" }, +// { 0x336A, "" }, + { 0x336B, "font_size" }, + { 0x336C, "font_color" }, + { 0x336D, "action_func" }, +// { 0x336E, "" }, + { 0x336F, "updateselectedbutton" }, + { 0x3370, "radial_button_current_group" }, +// { 0x3371, "" }, + { 0x3372, "watchselectbuttonpress" }, +// { 0x3373, "" }, +// { 0x3374, "" }, +// { 0x3375, "" }, + { 0x3376, "draw_radial_buttons" }, + { 0x3377, "draw_radial_button" }, + { 0x3378, "zoom_to_radial_menu" }, +// { 0x3379, "" }, +// { 0x337A, "" }, +// { 0x337B, "" }, + { 0x337C, "getmidangle" }, +// { 0x337D, "" }, + { 0x337E, "action_back" }, +// { 0x337F, "" }, +// { 0x3380, "" }, + { 0x3381, "action_gears" }, +// { 0x3382, "" }, +// { 0x3383, "" }, +// { 0x3384, "" }, + { 0x3385, "view_paths" }, + { 0x3386, "build_path_by_targetname" }, + { 0x3387, "go_path_by_targetname" }, + { 0x3388, "dummy_mover" }, +// { 0x3389, "" }, +// { 0x338A, "" }, +// { 0x338B, "" }, +// { 0x338C, "" }, +// { 0x338D, "" }, +// { 0x338E, "" }, + { 0x338F, "thumpersetup" }, + { 0x3390, "tryusethumper" }, + { 0x3391, "saveweaponammoondeath" }, +// { 0x3392, "" }, +// { 0x3393, "" }, + { 0x3394, "standardspeed" }, +// { 0x3395, "" }, +// { 0x3396, "" }, + { 0x3397, "tryusetank" }, + { 0x3398, "tankinuse" }, + { 0x3399, "tankspawner" }, + { 0x339A, "starttank" }, + { 0x339B, "nodes" }, + { 0x339C, "objid" }, +// { 0x339D, "" }, + { 0x339E, "neutraltarget" }, + { 0x339F, "waitforchangeteams" }, + { 0x33A0, "waitfordisco" }, +// { 0x33A1, "" }, +// { 0x33A2, "" }, + { 0x33A3, "changingdirection" }, + { 0x33A4, "speedtype" }, + { 0x33A5, "setminiengagementspeed" }, + { 0x33A6, "setstandardspeed" }, + { 0x33A7, "setevadespeed" }, + { 0x33A8, "setdangerspeed" }, +// { 0x33A9, "" }, + { 0x33AA, "stoptoforward" }, + { 0x33AB, "checkdanger" }, + { 0x33AC, "numenemiesclose" }, + { 0x33AD, "tankupdate" }, + { 0x33AE, "graphnodes" }, + { 0x33AF, "endnode" }, + { 0x33B0, "tankdamagemonitor" }, + { 0x33B1, "forcedtarget" }, + { 0x33B2, "handlethreat" }, + { 0x33B3, "tankcover" }, + { 0x33B4, "handlepossiblethreat" }, +// { 0x33B5, "" }, +// { 0x33B6, "" }, +// { 0x33B7, "" }, + { 0x33B8, "modifydamage" }, + { 0x33B9, "destroytank" }, +// { 0x33BA, "" }, + { 0x33BB, "onhitpitchclamp" }, + { 0x33BC, "waitforturretready" }, + { 0x33BD, "tankgettargets" }, + { 0x33BE, "harrier" }, +// { 0x33BF, "" }, +// { 0x33C0, "" }, +// { 0x33C1, "" }, +// { 0x33C2, "" }, + { 0x33C3, "badtargetreset" }, +// { 0x33C4, "" }, +// { 0x33C5, "" }, + { 0x33C6, "isvehicletarget" }, + { 0x33C7, "turretsighttrace" }, +// { 0x33C8, "" }, + { 0x33C9, "tankgetminitargets" }, +// { 0x33CA, "" }, + { 0x33CB, "acquireminitarget" }, +// { 0x33CC, "" }, + { 0x33CD, "fireminiontarget" }, +// { 0x33CE, "" }, +// { 0x33CF, "" }, +// { 0x33D0, "" }, + { 0x33D1, "explicitabandonminitarget" }, + { 0x33D2, "addtotanklist" }, +// { 0x33D3, "" }, +// { 0x33D4, "" }, + { 0x33D5, "dist" }, + { 0x33D6, "setuppaths" }, + { 0x33D7, "branchnodes" }, +// { 0x33D8, "" }, +// { 0x33D9, "" }, +// { 0x33DA, "" }, +// { 0x33DB, "" }, +// { 0x33DC, "" }, + { 0x33DD, "linkdirs" }, +// { 0x33DE, "" }, +// { 0x33DF, "" }, + { 0x33E0, "otherdir" }, +// { 0x33E1, "" }, + { 0x33E2, "linkstartnodes" }, +// { 0x33E3, "" }, + { 0x33E4, "nodetracker" }, +// { 0x33E5, "" }, +// { 0x33E6, "" }, + { 0x33E7, "forcetrigger" }, + { 0x33E8, "getforwardgraphnode" }, +// { 0x33E9, "" }, +// { 0x33EA, "" }, + { 0x33EB, "getprevnode" }, +// { 0x33EC, "" }, + { 0x33ED, "linkinfos" }, + { 0x33EE, "linklengths" }, + { 0x33EF, "addlinknode" }, + { 0x33F0, "tographnode" }, +// { 0x33F1, "" }, +// { 0x33F2, "" }, +// { 0x33F3, "" }, +// { 0x33F4, "" }, + { 0x33F5, "openlist" }, +// { 0x33F6, "" }, +// { 0x33F7, "" }, +// { 0x33F8, "" }, +// { 0x33F9, "" }, +// { 0x33FA, "" }, + { 0x33FB, "openlistid" }, +// { 0x33FC, "" }, +// { 0x33FD, "" }, +// { 0x33FE, "" }, +// { 0x33FF, "" }, + { 0x3400, "drawpath" }, + { 0x3401, "drawgraph" }, + { 0x3402, "drawlink" }, + { 0x3403, "debugprintln2" }, +// { 0x3404, "" }, +// { 0x3405, "" }, + { 0x3406, "tankexplode" }, +// { 0x3407, "" }, +// { 0x3408, "" }, +// { 0x3409, "" }, +// { 0x340A, "" }, +// { 0x340B, "" }, +// { 0x340C, "" }, + { 0x340D, "selectentrancelocation" }, + { 0x340E, "createmobilemortar" }, + { 0x340F, "playersattacked" }, +// { 0x3410, "" }, +// { 0x3411, "" }, + { 0x3412, "highx" }, +// { 0x3413, "" }, +// { 0x3414, "" }, + { 0x3415, "movetoposition" }, + { 0x3416, "fxent" }, +// { 0x3417, "" }, + { 0x3418, "findrandomtarget" }, +// { 0x3419, "" }, + { 0x341A, "firemortar" }, +// { 0x341B, "" }, +// { 0x341C, "" }, +// { 0x341D, "" }, +// { 0x341E, "" }, +// { 0x341F, "" }, + { 0x3420, "a10maxhealth" }, +// { 0x3421, "" }, +// { 0x3422, "" }, + { 0x3423, "a10startpointoffset" }, + { 0x3424, "a10impactfxdelay" }, +// { 0x3425, "" }, +// { 0x3426, "" }, +// { 0x3427, "" }, +// { 0x3428, "" }, + { 0x3429, "a10bulletimpactsdelay" }, + { 0x342A, "a10earthquakemagnitude" }, +// { 0x342B, "" }, +// { 0x342C, "" }, + { 0x342D, "a10dirteffectradius" }, +// { 0x342E, "" }, +// { 0x342F, "" }, +// { 0x3430, "" }, + { 0x3431, "useduava10" }, + { 0x3432, "tryusea10strike" }, +// { 0x3433, "" }, + { 0x3434, "finisha10strikeusage" }, + { 0x3435, "calla10strike" }, + { 0x3436, "doa10strike" }, +// { 0x3437, "" }, +// { 0x3438, "" }, +// { 0x3439, "" }, + { 0x343A, "startpoint" }, +// { 0x343B, "" }, + { 0x343C, "endpoint" }, + { 0x343D, "a10playenginefx" }, +// { 0x343E, "" }, +// { 0x343F, "" }, +// { 0x3440, "" }, +// { 0x3441, "" }, +// { 0x3442, "" }, +// { 0x3443, "" }, + { 0x3444, "manageshootinggroundsound" }, +// { 0x3445, "" }, +// { 0x3446, "" }, +// { 0x3447, "" }, +// { 0x3448, "" }, +// { 0x3449, "" }, +// { 0x344A, "" }, +// { 0x344B, "" }, + { 0x344C, "showspawnpoints" }, + { 0x344D, "print3duntilnotified" }, +// { 0x344E, "" }, +// { 0x344F, "" }, + { 0x3450, "updatereflectionprobe" }, +// { 0x3451, "" }, +// { 0x3452, "" }, +// { 0x3453, "" }, + { 0x3454, "endgameontimelimit" }, + { 0x3455, "playerslookingforsafespawn" }, +// { 0x3456, "" }, + { 0x3457, "blank" }, +// { 0x3458, "" }, +// { 0x3459, "" }, +// { 0x345A, "" }, +// { 0x345B, "" }, +// { 0x345C, "" }, +// { 0x345D, "" }, + { 0x345E, "flagbasefxid" }, +// { 0x345F, "" }, + { 0x3460, "nearbyspawns" }, +// { 0x3461, "" }, +// { 0x3462, "" }, + { 0x3463, "baseeffectforward" }, +// { 0x3464, "" }, + { 0x3465, "baseeffectpos" }, + { 0x3466, "useobj" }, + { 0x3467, "adjflags" }, + { 0x3468, "getunownedflagneareststart" }, + { 0x3469, "didstatusnotify" }, + { 0x346A, "statusdialog" }, + { 0x346B, "resetflagbaseeffect" }, +// { 0x346C, "" }, + { 0x346D, "capturetime" }, +// { 0x346E, "" }, +// { 0x346F, "" }, +// { 0x3470, "" }, +// { 0x3471, "" }, +// { 0x3472, "" }, + { 0x3473, "getteamflagcount" }, +// { 0x3474, "" }, +// { 0x3475, "" }, + { 0x3476, "getboundaryflagspawns" }, +// { 0x3477, "" }, +// { 0x3478, "" }, + { 0x3479, "getownedflagspawns" }, + { 0x347A, "flagsetup" }, + { 0x347B, "descriptor" }, +// { 0x347C, "" }, +// { 0x347D, "" }, +// { 0x347E, "" }, + { 0x347F, "getcapxpscale" }, + { 0x3480, "multibomb" }, +// { 0x3481, "" }, +// { 0x3482, "" }, + { 0x3483, "checkallowspectating" }, + { 0x3484, "sd_endgame" }, +// { 0x3485, "" }, + { 0x3486, "killcamentnum" }, +// { 0x3487, "" }, + { 0x3488, "planttime" }, +// { 0x3489, "" }, +// { 0x348A, "" }, + { 0x348B, "relatedbrushmodel" }, +// { 0x348C, "" }, + { 0x348D, "sdbomb" }, +// { 0x348E, "" }, +// { 0x348F, "" }, +// { 0x3490, "" }, +// { 0x3491, "" }, + { 0x3492, "sdbombmodel" }, + { 0x3493, "onuseplantobject" }, + { 0x3494, "bombowner" }, + { 0x3495, "bombplantedtime" }, +// { 0x3496, "" }, + { 0x3497, "removebombcarrierclass" }, +// { 0x3498, "" }, + { 0x3499, "tickingobject" }, +// { 0x349A, "" }, +// { 0x349B, "" }, + { 0x349C, "setspecialloadout" }, +// { 0x349D, "" }, +// { 0x349E, "" }, +// { 0x349F, "" }, +// { 0x34A0, "" }, +// { 0x34A1, "" }, +// { 0x34A2, "" }, +// { 0x34A3, "" }, + { 0x34A4, "hotpotato" }, +// { 0x34A5, "" }, + { 0x34A6, "sabotage" }, +// { 0x34A7, "" }, +// { 0x34A8, "" }, + { 0x34A9, "distancetosite" }, +// { 0x34AA, "" }, + { 0x34AB, "bombdistance" }, +// { 0x34AC, "" }, + { 0x34AD, "abandonmentthink" }, +// { 0x34AE, "" }, +// { 0x34AF, "" }, + { 0x34B0, "dangerteam" }, +// { 0x34B1, "" }, +// { 0x34B2, "" }, +// { 0x34B3, "" }, +// { 0x34B4, "" }, +// { 0x34B5, "" }, +// { 0x34B6, "" }, + { 0x34B7, "kothmode" }, + { 0x34B8, "destroytime" }, +// { 0x34B9, "" }, +// { 0x34BA, "" }, + { 0x34BB, "extradelay" }, +// { 0x34BC, "" }, +// { 0x34BD, "" }, + { 0x34BE, "updateobjectivehintmessages" }, +// { 0x34BF, "" }, +// { 0x34C0, "" }, +// { 0x34C1, "" }, +// { 0x34C2, "" }, +// { 0x34C3, "" }, + { 0x34C4, "objectivehintdestroyhq" }, + { 0x34C5, "objectivehintdefendhq" }, +// { 0x34C6, "" }, + { 0x34C7, "hqrevealtime" }, + { 0x34C8, "timerdisplay" }, + { 0x34C9, "gameobject" }, +// { 0x34CA, "" }, +// { 0x34CB, "" }, +// { 0x34CC, "" }, +// { 0x34CD, "" }, + { 0x34CE, "onradiocapture" }, +// { 0x34CF, "" }, + { 0x34D0, "destroyhqaftertime" }, +// { 0x34D1, "" }, +// { 0x34D2, "" }, + { 0x34D3, "outerspawns" }, +// { 0x34D4, "" }, +// { 0x34D5, "" }, + { 0x34D6, "radios" }, +// { 0x34D7, "" }, + { 0x34D8, "prevradio2" }, + { 0x34D9, "makeradioactive" }, + { 0x34DA, "makeradioinactive" }, +// { 0x34DB, "" }, +// { 0x34DC, "" }, + { 0x34DD, "pickradiotospawn" }, +// { 0x34DE, "" }, +// { 0x34DF, "" }, +// { 0x34E0, "" }, +// { 0x34E1, "" }, + { 0x34E2, "icon2d" }, + { 0x34E3, "iconcapture3d" }, + { 0x34E4, "iconcapture2d" }, + { 0x34E5, "icondefend3d" }, +// { 0x34E6, "" }, + { 0x34E7, "icontarget3d" }, +// { 0x34E8, "" }, +// { 0x34E9, "" }, + { 0x34EA, "capzones" }, +// { 0x34EB, "" }, +// { 0x34EC, "" }, +// { 0x34ED, "" }, +// { 0x34EE, "" }, +// { 0x34EF, "" }, +// { 0x34F0, "" }, +// { 0x34F1, "" }, +// { 0x34F2, "" }, + { 0x34F3, "iconescort3d" }, + { 0x34F4, "iconescort2d" }, +// { 0x34F5, "" }, +// { 0x34F6, "" }, + { 0x34F7, "iconcaptureflag3d" }, + { 0x34F8, "iconcaptureflag2d" }, +// { 0x34F9, "" }, + { 0x34FA, "icondefendflag2d" }, + { 0x34FB, "iconreturnflag3d" }, +// { 0x34FC, "" }, +// { 0x34FD, "" }, +// { 0x34FE, "" }, +// { 0x34FF, "" }, +// { 0x3500, "" }, + { 0x3501, "enemyflagstatusicon" }, +// { 0x3502, "" }, + { 0x3503, "returnaftertime" }, + { 0x3504, "applyflagcarrierclass" }, + { 0x3505, "removeflagcarrierclass" }, +// { 0x3506, "" }, +// { 0x3507, "" }, + { 0x3508, "iconflagbase3d" }, +// { 0x3509, "" }, + { 0x350A, "athome" }, + { 0x350B, "createcapzones" }, + { 0x350C, "zoneheadicon" }, +// { 0x350D, "" }, + { 0x350E, "cappedflag" }, + { 0x350F, "givescore" }, +// { 0x3510, "" }, +// { 0x3511, "" }, +// { 0x3512, "" }, + { 0x3513, "oic_rewardammo" }, + { 0x3514, "oic_loadouts" }, + { 0x3515, "waitloadoutdone" }, + { 0x3516, "oic_gun" }, + { 0x3517, "waitgiveammo" }, +// { 0x3518, "" }, + { 0x3519, "watchelimination" }, +// { 0x351A, "" }, +// { 0x351B, "" }, +// { 0x351C, "" }, +// { 0x351D, "" }, + { 0x351E, "grnd_centerloc" }, +// { 0x351F, "" }, + { 0x3520, "initfirstzone" }, +// { 0x3521, "" }, + { 0x3522, "grnd_dropzones" }, +// { 0x3523, "" }, + { 0x3524, "grnd_zone" }, +// { 0x3525, "" }, +// { 0x3526, "" }, + { 0x3527, "ingrindzone" }, + { 0x3528, "setplayermessages" }, +// { 0x3529, "" }, +// { 0x352A, "" }, + { 0x352B, "grndheadicon" }, +// { 0x352C, "" }, + { 0x352D, "getnextzone" }, +// { 0x352E, "" }, + { 0x352F, "cyclezones" }, + { 0x3530, "grndtracking" }, + { 0x3531, "locationscoring" }, +// { 0x3532, "" }, +// { 0x3533, "" }, + { 0x3534, "getdropzonecratetype" }, +// { 0x3535, "" }, + { 0x3536, "createzones" }, +// { 0x3537, "" }, +// { 0x3538, "" }, + { 0x3539, "tdef_loadouts" }, +// { 0x353A, "" }, + { 0x353B, "portable_radar" }, +// { 0x353C, "" }, +// { 0x353D, "" }, + { 0x353E, "watchforendgame" }, + { 0x353F, "createflag" }, + { 0x3540, "flagattachradar" }, + { 0x3541, "getflagradarowner" }, + { 0x3542, "flagradarmover" }, +// { 0x3543, "" }, + { 0x3544, "conf_fx" }, +// { 0x3545, "" }, +// { 0x3546, "" }, +// { 0x3547, "" }, +// { 0x3548, "" }, +// { 0x3549, "" }, +// { 0x354A, "" }, +// { 0x354B, "" }, +// { 0x354C, "" }, + { 0x354D, "infect_chosefirstinfected" }, +// { 0x354E, "" }, +// { 0x354F, "" }, +// { 0x3550, "" }, +// { 0x3551, "" }, + { 0x3552, "choosefirstinfected" }, +// { 0x3553, "" }, + { 0x3554, "setinitialtonormalinfected" }, +// { 0x3555, "" }, + { 0x3556, "getnuminfected" }, + { 0x3557, "getnumsurvivors" }, + { 0x3558, "matchrules_respawnnewjugg" }, +// { 0x3559, "" }, +// { 0x355A, "" }, +// { 0x355B, "" }, +// { 0x355C, "" }, +// { 0x355D, "" }, + { 0x355E, "jugg_juggscore" }, + { 0x355F, "jugg_firstspawn" }, +// { 0x3560, "" }, +// { 0x3561, "" }, +// { 0x3562, "" }, +// { 0x3563, "" }, +// { 0x3564, "" }, + { 0x3565, "gun_firstspawn" }, + { 0x3566, "gungamegunindex" }, + { 0x3567, "gungameprevgunindex" }, +// { 0x3568, "" }, +// { 0x3569, "" }, +// { 0x356A, "" }, + { 0x356B, "gethighestprogressedplayer" }, +// { 0x356C, "" }, +// { 0x356D, "" }, +// { 0x356E, "" }, + { 0x356F, "updategunhud" }, +// { 0x3570, "" }, +// { 0x3571, "" }, + { 0x3572, "setguns" }, +// { 0x3573, "" }, +// { 0x3574, "" }, + { 0x3575, "jugg_attackers" }, + { 0x3576, "jugg_currjugg" }, +// { 0x3577, "" }, +// { 0x3578, "" }, + { 0x3579, "isjuggmodejuggernaut" }, + { 0x357A, "tjugg_loadouts" }, +// { 0x357B, "" }, + { 0x357C, "respawnoldjugg" }, +// { 0x357D, "" }, + { 0x357E, "logattackers" }, + { 0x357F, "resetjuggloadoutondisconnect" }, + { 0x3580, "getbestteammate" }, + { 0x3581, "precacheflag" }, + { 0x3582, "arenatimeflagwaiter" }, +// { 0x3583, "" }, + { 0x3584, "arenaflag" }, +// { 0x3585, "" }, +// { 0x3586, "" }, + { 0x3587, "bombsplanted" }, + { 0x3588, "ddbombmodel" }, +// { 0x3589, "" }, + { 0x358A, "spawn_defenders_a" }, + { 0x358B, "spawn_defenders_b" }, + { 0x358C, "spawn_attackers" }, + { 0x358D, "spawn_attackers_a" }, + { 0x358E, "spawn_attackers_b" }, +// { 0x358F, "" }, +// { 0x3590, "" }, +// { 0x3591, "" }, + { 0x3592, "bplanted" }, +// { 0x3593, "" }, +// { 0x3594, "" }, +// { 0x3595, "" }, + { 0x3596, "ddbomb" }, +// { 0x3597, "" }, + { 0x3598, "resetbombzone" }, + { 0x3599, "defusing" }, +// { 0x359A, "" }, +// { 0x359B, "" }, + { 0x359C, "bombhandler" }, +// { 0x359D, "" }, + { 0x359E, "waittime" }, + { 0x359F, "setbombtimerdvar" }, +// { 0x35A0, "" }, + { 0x35A1, "restarttimer" }, + { 0x35A2, "skipwait" }, + { 0x35A3, "isvip" }, +// { 0x35A4, "" }, + { 0x35A5, "vipselection" }, +// { 0x35A6, "" }, +// { 0x35A7, "" }, + { 0x35A8, "setvipuse" }, +// { 0x35A9, "" }, +// { 0x35AA, "" }, + { 0x35AB, "forcevipspawn" }, +// { 0x35AC, "" }, + { 0x35AD, "usebar" }, + { 0x35AE, "usebartext" }, + { 0x35AF, "setupnukesite" }, + { 0x35B0, "nukesite" }, +// { 0x35B1, "" }, + { 0x35B2, "scorecounter" }, +// { 0x35B3, "" }, +// { 0x35B4, "" }, +// { 0x35B5, "" }, +// { 0x35B6, "" }, + { 0x35B7, "aamissilelaunchhorz" }, +// { 0x35B8, "" }, +// { 0x35B9, "" }, + { 0x35BA, "gettargets" }, + { 0x35BB, "aa_missile_fire" }, +// { 0x35BC, "" }, + { 0x35BD, "teamairdenied" }, + { 0x35BE, "tryuseaastrike" }, + { 0x35BF, "cycletargets" }, +// { 0x35C0, "" }, +// { 0x35C1, "" }, + { 0x35C2, "airdeniedplayer" }, + { 0x35C3, "finishaastrike" }, + { 0x35C4, "fireattarget" }, + { 0x35C5, "aasoundmanager" }, + { 0x35C6, "set_vehicle_anims" }, + { 0x35C7, "setanims" }, + { 0x35C8, "tweakfile" }, +// { 0x35C9, "" }, +// { 0x35CA, "" }, +// { 0x35CB, "" }, + { 0x35CC, "additionalassets" }, + { 0x35CD, "coverleft90" }, + { 0x35CE, "coverleft45" }, + { 0x35CF, "coverleftgrenade" }, + { 0x35D0, "coverright90" }, + { 0x35D1, "coverright45" }, + { 0x35D2, "coverrightgrenade" }, +// { 0x35D3, "" }, +// { 0x35D4, "" }, + { 0x35D5, "disable_militia_behavior" }, +// { 0x35D6, "" }, +// { 0x35D7, "" }, +// { 0x35D8, "" }, +// { 0x35D9, "" }, + { 0x35DA, "juggernaut_sound_when_player_close" }, + { 0x35DB, "skip_juggernaut_intro_sound" }, + { 0x35DC, "pmc_alljuggernauts" }, +// { 0x35DD, "" }, + { 0x35DE, "init_riotshield_ai_anims" }, + { 0x35DF, "notetrackdetachshield" }, + { 0x35E0, "riotshield_approach_type" }, +// { 0x35E1, "" }, + { 0x35E2, "init_riotshield_ai" }, +// { 0x35E3, "" }, +// { 0x35E4, "" }, +// { 0x35E5, "" }, +// { 0x35E6, "" }, +// { 0x35E7, "" }, + { 0x35E8, "riotshield_melee_aivsai" }, + { 0x35E9, "riotshield_startmovetransition" }, + { 0x35EA, "fastwalk" }, +// { 0x35EB, "" }, +// { 0x35EC, "" }, +// { 0x35ED, "" }, +// { 0x35EE, "" }, +// { 0x35EF, "" }, +// { 0x35F0, "" }, +// { 0x35F1, "" }, +// { 0x35F2, "" }, + { 0x35F3, "init_riotshield_animsets" }, +// { 0x35F4, "" }, + { 0x35F5, "riotshield_choose_pose" }, +// { 0x35F6, "" }, +// { 0x35F7, "" }, + { 0x35F8, "riotshield_sprint_off" }, +// { 0x35F9, "" }, +// { 0x35FA, "" }, + { 0x35FB, "riotshield_init_flee" }, + { 0x35FC, "riotshield_flee_and_drop_shield" }, + { 0x35FD, "dropshieldinplace" }, +// { 0x35FE, "" }, +// { 0x35FF, "" }, +// { 0x3600, "" }, +// { 0x3601, "" }, +// { 0x3602, "" }, +// { 0x3603, "" }, +// { 0x3604, "" }, + { 0x3605, "fleethreshold" }, +// { 0x3606, "" }, +// { 0x3607, "" }, +// { 0x3608, "" }, +// { 0x3609, "" }, + { 0x360A, "group_sort_by_closest_match" }, +// { 0x360B, "" }, +// { 0x360C, "" }, +// { 0x360D, "" }, +// { 0x360E, "" }, +// { 0x360F, "" }, +// { 0x3610, "" }, +// { 0x3611, "" }, + { 0x3612, "group_sprint_off" }, +// { 0x3613, "" }, +// { 0x3614, "" }, +// { 0x3615, "" }, + { 0x3616, "group_free_combat" }, +// { 0x3617, "" }, +// { 0x3618, "" }, +// { 0x3619, "" }, +// { 0x361A, "" }, +// { 0x361B, "" }, +// { 0x361C, "" }, + { 0x361D, "dogsinitialized" }, + { 0x361E, "notfirsttimedogs" }, + { 0x361F, "dogstartmovedist" }, + { 0x3620, "dogtraverseanims" }, +// { 0x3621, "" }, +// { 0x3622, "" }, + { 0x3623, "doglookpose" }, +// { 0x3624, "" }, +// { 0x3625, "" }, + { 0x3626, "prevturnrate" }, +// { 0x3627, "" }, + { 0x3628, "randomattackidle" }, + { 0x3629, "shouldattackidle" }, +// { 0x362A, "" }, +// { 0x362B, "" }, +// { 0x362C, "" }, + { 0x362D, "meleeingplayer" }, + { 0x362E, "player_killed" }, + { 0x362F, "knock_down_player_coop" }, + { 0x3630, "dog_downed_player" }, + { 0x3631, "dog_player_kill" }, + { 0x3632, "dog_death_hud" }, + { 0x3633, "dog_deathquote" }, +// { 0x3634, "" }, + { 0x3635, "attackmiss" }, + { 0x3636, "skipstartmove" }, + { 0x3637, "attackmisstracktargetthread" }, +// { 0x3638, "" }, + { 0x3639, "dogmelee" }, +// { 0x363A, "" }, + { 0x363B, "handlemeleebiteattacknotetracks" }, + { 0x363C, "addsafetyhealth" }, + { 0x363D, "removesafetyhealth" }, + { 0x363E, "handlemeleefinishattacknotetracks" }, + { 0x363F, "handle_dogbite_notetrack" }, + { 0x3640, "set_melee_timer" }, +// { 0x3641, "" }, + { 0x3642, "playerdoginit" }, +// { 0x3643, "" }, + { 0x3644, "dogmeleeplayercounter" }, + { 0x3645, "meleebiteattackplayer" }, + { 0x3646, "doginited" }, + { 0x3647, "inseq" }, +// { 0x3648, "" }, + { 0x3649, "clear_player_attacked_by_dog_on_death" }, +// { 0x364A, "" }, +// { 0x364B, "" }, +// { 0x364C, "" }, +// { 0x364D, "" }, + { 0x364E, "setnextdogattackallowtime" }, +// { 0x364F, "" }, + { 0x3650, "meleekilltarget" }, + { 0x3651, "originaltarget" }, + { 0x3652, "combatidle" }, + { 0x3653, "combatidlepreventoverlappingplayer" }, +// { 0x3654, "" }, +// { 0x3655, "" }, + { 0x3656, "checkendcombat" }, +// { 0x3657, "" }, + { 0x3658, "dog_death_type" }, +// { 0x3659, "" }, + { 0x365A, "player_attacked" }, +// { 0x365B, "" }, +// { 0x365C, "" }, + { 0x365D, "dog_hint_fade" }, + { 0x365E, "necksnapped" }, +// { 0x365F, "" }, + { 0x3660, "dog_delayed_allow_damage" }, +// { 0x3661, "" }, +// { 0x3662, "" }, +// { 0x3663, "" }, + { 0x3664, "dogmeleeearly" }, + { 0x3665, "set_melee_early" }, +// { 0x3666, "" }, + { 0x3667, "meleeseq" }, + { 0x3668, "meleestrugglevsdog_interruptedcheck" }, + { 0x3669, "meleestrugglevsdog_end" }, + { 0x366A, "playerdrone_create" }, +// { 0x366B, "" }, + { 0x366C, "playerdone_anim_neck_snap" }, +// { 0x366D, "" }, +// { 0x366E, "" }, + { 0x366F, "playerview_spawn" }, + { 0x3670, "handleplayerknockdownnotetracks" }, +// { 0x3671, "" }, +// { 0x3672, "" }, +// { 0x3673, "" }, +// { 0x3674, "" }, +// { 0x3675, "" }, +// { 0x3676, "" }, + { 0x3677, "playerview_endsequence" }, +// { 0x3678, "" }, + { 0x3679, "playerview_unlinkplayeranddelete" }, + { 0x367A, "restoreplayercontrols" }, + { 0x367B, "playerview_show" }, + { 0x367C, "playerview_playknockdownanimlimited" }, + { 0x367D, "playerview_playknockdownanim" }, + { 0x367E, "playerview_playmissanim" }, + { 0x367F, "playerview_knockdownlate" }, + { 0x3680, "dog_vs_player_anim_rate" }, +// { 0x3681, "" }, +// { 0x3682, "" }, +// { 0x3683, "" }, +// { 0x3684, "" }, + { 0x3685, "pathchangecheck2" }, + { 0x3686, "pathchange_getdogturnanim" }, + { 0x3687, "pathchange_dodogturnanim" }, + { 0x3688, "pathchange_cleanupdogturnanim" }, +// { 0x3689, "" }, + { 0x368A, "playmovestartanim" }, + { 0x368B, "startmove" }, +// { 0x368C, "" }, +// { 0x368D, "" }, +// { 0x368E, "" }, +// { 0x368F, "" }, + { 0x3690, "codescripted" }, + { 0x3691, "deathstring_passed" }, + { 0x3692, "deathstring" }, + { 0x3693, "exchange_sort_by_handler" }, + { 0x3694, "on_player_trig_record_and_notify" }, +// { 0x3695, "" }, +// { 0x3696, "" }, +// { 0x3697, "" }, + { 0x3698, "new_squad_logic" }, +// { 0x3699, "" }, +// { 0x369A, "" }, + { 0x369B, "squad_follower_func" }, + { 0x369C, "squad_disband" }, + { 0x369D, "leader" }, +// { 0x369E, "" }, +// { 0x369F, "" }, +// { 0x36A0, "" }, + { 0x36A1, "cleaning_up" }, + { 0x36A2, "desired_squads" }, + { 0x36A3, "spawn_enemy_squads" }, +// { 0x36A4, "" }, +// { 0x36A5, "" }, +// { 0x36A6, "" }, + { 0x36A7, "protector_obj_group" }, + { 0x36A8, "squad_spread" }, + { 0x36A9, "saw_player" }, +// { 0x36AA, "" }, + { 0x36AB, "spawn_enemy_group" }, + { 0x36AC, "back_occupied" }, + { 0x36AD, "squad_drop_weapon_rate" }, +// { 0x36AE, "" }, +// { 0x36AF, "" }, +// { 0x36B0, "" }, + { 0x36B1, "wait_for_followers" }, +// { 0x36B2, "" }, +// { 0x36B3, "" }, +// { 0x36B4, "" }, +// { 0x36B5, "" }, +// { 0x36B6, "" }, + { 0x36B7, "is_occupying" }, +// { 0x36B8, "" }, + { 0x36B9, "protector_leader_logic" }, + { 0x36BA, "protecting_obj" }, +// { 0x36BB, "" }, + { 0x36BC, "setup_follower_goalradius_riotshield" }, + { 0x36BD, "get_riotshield_back_pos" }, +// { 0x36BE, "" }, +// { 0x36BF, "" }, + { 0x36C0, "is_leader_riotshield" }, +// { 0x36C1, "" }, + { 0x36C2, "handle_all_followers_dying" }, + { 0x36C3, "drawleader" }, + { 0x36C4, "draw_debug_marker" }, + { 0x36C5, "drawfollowers" }, + { 0x36C6, "sp_airdrop_preload" }, +// { 0x36C7, "" }, +// { 0x36C8, "" }, + { 0x36C9, "numairdropcrates" }, +// { 0x36CA, "" }, + { 0x36CB, "globalinitdone" }, + { 0x36CC, "sp_airdrop_init_done" }, + { 0x36CD, "sp_try_use_airdrop" }, +// { 0x36CE, "" }, + { 0x36CF, "sp_begin_airdrop_via_marker" }, +// { 0x36D0, "" }, +// { 0x36D1, "" }, + { 0x36D2, "sp_airdrop_marker_activate" }, +// { 0x36D3, "" }, + { 0x36D4, "sp_airdrop_heli_setup" }, +// { 0x36D5, "" }, + { 0x36D6, "sp_create_airdrop_crate" }, + { 0x36D7, "basemodel" }, +// { 0x36D8, "" }, + { 0x36D9, "crates_on_ground" }, + { 0x36DA, "sp_airdrop_setup_crate_collisions" }, +// { 0x36DB, "" }, + { 0x36DC, "sp_airdrop_get_free_sbmodel_collision" }, +// { 0x36DD, "" }, +// { 0x36DE, "" }, +// { 0x36DF, "" }, +// { 0x36E0, "" }, +// { 0x36E1, "" }, +// { 0x36E2, "" }, + { 0x36E3, "sp_airdrop_crate_timeout" }, +// { 0x36E4, "" }, +// { 0x36E5, "" }, +// { 0x36E6, "" }, +// { 0x36E7, "" }, +// { 0x36E8, "" }, +// { 0x36E9, "" }, +// { 0x36EA, "" }, + { 0x36EB, "sp_airdrop_crate_friendly_hijack_thread" }, +// { 0x36EC, "" }, +// { 0x36ED, "" }, +// { 0x36EE, "" }, +// { 0x36EF, "" }, + { 0x36F0, "cratehint" }, + { 0x36F1, "airdropcrateunstuck" }, + { 0x36F2, "sp_airdrop_unstuck_think" }, +// { 0x36F3, "" }, +// { 0x36F4, "" }, + { 0x36F5, "sp_crate_world_icon" }, +// { 0x36F6, "" }, + { 0x36F7, "sp_airdrop_crate_owner_capture_think" }, + { 0x36F8, "sp_airdrop_teammate_capture_think" }, + { 0x36F9, "sp_use_hold_think" }, +// { 0x36FA, "" }, + { 0x36FB, "sp_use_hold_think_loop" }, + { 0x36FC, "sp_personal_use_bar" }, + { 0x36FD, "min_time_between_uav_launches" }, + { 0x36FE, "remote_missile_targets" }, + { 0x36FF, "last_uav_launch_time" }, + { 0x3700, "uav_radio_offline_called" }, +// { 0x3701, "" }, + { 0x3702, "uav_struct" }, + { 0x3703, "view_cone" }, +// { 0x3704, "" }, +// { 0x3705, "" }, + { 0x3706, "should_break_use_drone" }, + { 0x3707, "uav_is_destroyed" }, + { 0x3708, "is_flying_missile" }, +// { 0x3709, "" }, +// { 0x370A, "" }, + { 0x370B, "is_radio_defined" }, + { 0x370C, "should_break_available" }, + { 0x370D, "uav_is_not_available" }, +// { 0x370E, "" }, +// { 0x370F, "" }, + { 0x3710, "disable_uav" }, + { 0x3711, "restore_uav_weapon" }, + { 0x3712, "uav_weaponname" }, +// { 0x3713, "" }, +// { 0x3714, "" }, + { 0x3715, "give_remotemissile_weapon" }, +// { 0x3716, "" }, + { 0x3717, "set_remotemissile_actionslot" }, +// { 0x3718, "" }, +// { 0x3719, "" }, + { 0x371A, "uav_rigs" }, +// { 0x371B, "" }, +// { 0x371C, "" }, +// { 0x371D, "" }, +// { 0x371E, "" }, +// { 0x371F, "" }, +// { 0x3720, "" }, +// { 0x3721, "" }, +// { 0x3722, "" }, + { 0x3723, "remotemissile_offline" }, +// { 0x3724, "" }, +// { 0x3725, "" }, +// { 0x3726, "" }, +// { 0x3727, "" }, +// { 0x3728, "" }, +// { 0x3729, "" }, +// { 0x372A, "" }, +// { 0x372B, "" }, +// { 0x372C, "" }, +// { 0x372D, "" }, + { 0x372E, "text1" }, +// { 0x372F, "" }, +// { 0x3730, "" }, +// { 0x3731, "" }, +// { 0x3732, "" }, +// { 0x3733, "" }, +// { 0x3734, "" }, +// { 0x3735, "" }, +// { 0x3736, "" }, + { 0x3737, "text_noticedestroy" }, + { 0x3738, "waitwithabortondamage" }, + { 0x3739, "notifyonmissiledeath" }, + { 0x373A, "remotemissilefiretime" }, +// { 0x373B, "" }, +// { 0x373C, "" }, +// { 0x373D, "" }, + { 0x373E, "uavtargetent" }, + { 0x373F, "holdstancechange" }, + { 0x3740, "uavremotelaunchersequence" }, +// { 0x3741, "" }, +// { 0x3742, "" }, +// { 0x3743, "" }, +// { 0x3744, "" }, +// { 0x3745, "" }, + { 0x3746, "activate_uav_hud_cb" }, + { 0x3747, "firemissile_uav_hud_cb" }, + { 0x3748, "uav_missile_tag_for_camera" }, + { 0x3749, "remote_missile_steering_cb" }, + { 0x374A, "fov_is_altered" }, + { 0x374B, "uav_reload" }, +// { 0x374C, "" }, + { 0x374D, "do_physics_impact_on_explosion" }, +// { 0x374E, "" }, + { 0x374F, "uavtargetpos" }, + { 0x3750, "missile_kills" }, + { 0x3751, "missile_kill_ai" }, + { 0x3752, "missile_kill_vehicle" }, +// { 0x3753, "" }, + { 0x3754, "current_uav_index" }, + { 0x3755, "get_uav" }, + { 0x3756, "uav" }, + { 0x3757, "exitfromcamera_missile" }, + { 0x3758, "exitfromcamera_uav" }, + { 0x3759, "deactivate_uav_hud_cb" }, + { 0x375A, "waitforattackcommand" }, + { 0x375B, "wait_for_command_thread" }, +// { 0x375C, "" }, +// { 0x375D, "" }, +// { 0x375E, "" }, +// { 0x375F, "" }, +// { 0x3760, "" }, + { 0x3761, "uav_missle_start_right_distance" }, + { 0x3762, "remote_missile_snow" }, +// { 0x3763, "" }, +// { 0x3764, "" }, + { 0x3765, "draw_red_boxes" }, + { 0x3766, "draw_target" }, +// { 0x3767, "" }, + { 0x3768, "drawtargetsend" }, +// { 0x3769, "" }, + { 0x376A, "switchbacktomainweaponfast" }, +// { 0x376B, "" }, +// { 0x376C, "" }, +// { 0x376D, "" }, +// { 0x376E, "" }, +// { 0x376F, "" }, +// { 0x3770, "" }, +// { 0x3771, "" }, + { 0x3772, "open_view_cone" }, + { 0x3773, "setup_remote_missile_target" }, +// { 0x3774, "" }, +// { 0x3775, "" }, + { 0x3776, "add_player_rig" }, + { 0x3777, "give_player_remote_missiles" }, +// { 0x3778, "" }, +// { 0x3779, "" }, +// { 0x377A, "" }, + { 0x377B, "perks_preload" }, +// { 0x377C, "" }, + { 0x377D, "give_perk" }, +// { 0x377E, "" }, + { 0x377F, "give_perk_dummy" }, +// { 0x3780, "" }, +// { 0x3781, "" }, +// { 0x3782, "" }, +// { 0x3783, "" }, + { 0x3784, "take_perk_fastreload" }, +// { 0x3785, "" }, +// { 0x3786, "" }, + { 0x3787, "give_perk_detectexplosive" }, +// { 0x3788, "" }, +// { 0x3789, "" }, +// { 0x378A, "" }, +// { 0x378B, "" }, +// { 0x378C, "" }, +// { 0x378D, "" }, + { 0x378E, "update_on_give_perk" }, +// { 0x378F, "" }, + { 0x3790, "setup_sentry_globals" }, +// { 0x3791, "" }, + { 0x3792, "sentry_settings" }, +// { 0x3793, "" }, + { 0x3794, "setup_sentry_minigun" }, + { 0x3795, "setup_sentry_minigun_weak" }, + { 0x3796, "setup_sentry_grenade_launcher" }, +// { 0x3797, "" }, +// { 0x3798, "" }, + { 0x3799, "sentry_gun_default_settings" }, + { 0x379A, "use_laser" }, +// { 0x379B, "" }, +// { 0x379C, "" }, +// { 0x379D, "" }, +// { 0x379E, "" }, +// { 0x379F, "" }, +// { 0x37A0, "" }, +// { 0x37A1, "" }, +// { 0x37A2, "" }, + { 0x37A3, "placementmodel" }, +// { 0x37A4, "" }, + { 0x37A5, "damage_smoke_time" }, + { 0x37A6, "sentry_gun_weak_settings" }, + { 0x37A7, "sentry_minigun_default_settings" }, +// { 0x37A8, "" }, +// { 0x37A9, "" }, +// { 0x37AA, "" }, +// { 0x37AB, "" }, + { 0x37AC, "sentry_cooling_speed" }, +// { 0x37AD, "" }, +// { 0x37AE, "" }, +// { 0x37AF, "" }, +// { 0x37B0, "" }, +// { 0x37B1, "" }, +// { 0x37B2, "" }, + { 0x37B3, "sentry_death_wait" }, + { 0x37B4, "stay_solid_on_death" }, + { 0x37B5, "handle_sentry_on_carrier_death" }, +// { 0x37B6, "" }, +// { 0x37B7, "" }, +// { 0x37B8, "" }, +// { 0x37B9, "" }, + { 0x37BA, "sentry_badplace_create" }, +// { 0x37BB, "" }, +// { 0x37BC, "" }, + { 0x37BD, "move_sentry_wait" }, +// { 0x37BE, "" }, +// { 0x37BF, "" }, +// { 0x37C0, "" }, +// { 0x37C1, "" }, +// { 0x37C2, "" }, + { 0x37C3, "sentry_cooling" }, + { 0x37C4, "sentry_overheat_debug" }, + { 0x37C5, "sentry_overheat_deactivate" }, +// { 0x37C6, "" }, +// { 0x37C7, "" }, +// { 0x37C8, "" }, +// { 0x37C9, "" }, +// { 0x37CA, "" }, +// { 0x37CB, "" }, +// { 0x37CC, "" }, +// { 0x37CD, "" }, +// { 0x37CE, "" }, + { 0x37CF, "fire_anim_start" }, + { 0x37D0, "delete_sentry_turret" }, +// { 0x37D1, "" }, + { 0x37D2, "cam" }, +// { 0x37D3, "" }, +// { 0x37D4, "" }, + { 0x37D5, "fire_sound_spinloop" }, +// { 0x37D6, "" }, +// { 0x37D7, "" }, +// { 0x37D8, "" }, +// { 0x37D9, "" }, + { 0x37DA, "sentry_placement_cancel_monitor" }, +// { 0x37DB, "" }, +// { 0x37DC, "" }, +// { 0x37DD, "" }, + { 0x37DE, "sentry_ammo_enabled" }, +// { 0x37DF, "" }, + { 0x37E0, "updatesentryposition" }, + { 0x37E1, "sentry_placement_hint_show" }, + { 0x37E2, "forced_hint" }, +// { 0x37E3, "" }, + { 0x37E4, "folded_sentry_use_wait" }, +// { 0x37E5, "" }, +// { 0x37E6, "" }, +// { 0x37E7, "" }, + { 0x37E8, "waitactivatebutton" }, + { 0x37E9, "makesentrysolid" }, +// { 0x37EA, "" }, +// { 0x37EB, "" }, +// { 0x37EC, "" }, + { 0x37ED, "sentrypoweroff" }, +// { 0x37EE, "" }, +// { 0x37EF, "" }, +// { 0x37F0, "" }, +// { 0x37F1, "" }, +// { 0x37F2, "" }, +// { 0x37F3, "" }, + { 0x37F4, "sentry_destroy_on_owner_leave" }, +// { 0x37F5, "" }, +// { 0x37F6, "" }, + { 0x37F7, "sentry_ammo_debug" }, +// { 0x37F8, "" }, +// { 0x37F9, "" }, + { 0x37FA, "sentry_reset_on_owner_death" }, +// { 0x37FB, "" }, +// { 0x37FC, "" }, +// { 0x37FD, "" }, +// { 0x37FE, "" }, + { 0x37FF, "dual_waittill" }, + { 0x3800, "sentry_turn_laser_on" }, + { 0x3801, "sentry_turn_laser_off" }, +// { 0x3802, "" }, + { 0x3803, "try_use_airstrike" }, + { 0x3804, "directionyaw" }, +// { 0x3805, "" }, + { 0x3806, "endselectionon" }, +// { 0x3807, "" }, + { 0x3808, "finish_using_airstrike" }, + { 0x3809, "do_airstrike" }, + { 0x380A, "airstrike_spawn_fake_plane" }, + { 0x380B, "sp_killstreaks_global_preload" }, +// { 0x380C, "" }, +// { 0x380D, "" }, +// { 0x380E, "" }, + { 0x380F, "sp_killstreaks_hud_init" }, +// { 0x3810, "" }, +// { 0x3811, "" }, +// { 0x3812, "" }, +// { 0x3813, "" }, +// { 0x3814, "" }, +// { 0x3815, "" }, +// { 0x3816, "" }, +// { 0x3817, "" }, +// { 0x3818, "" }, +// { 0x3819, "" }, +// { 0x381A, "" }, +// { 0x381B, "" }, +// { 0x381C, "" }, + { 0x381D, "has_any_killstreak" }, +// { 0x381E, "" }, +// { 0x381F, "" }, +// { 0x3820, "" }, +// { 0x3821, "" }, + { 0x3822, "used_sp_killstreak" }, +// { 0x3823, "" }, +// { 0x3824, "" }, + { 0x3825, "remotemissilefired" }, +// { 0x3826, "" }, + { 0x3827, "sp_killstreak_carepackage_main" }, +// { 0x3828, "" }, +// { 0x3829, "" }, + { 0x382A, "sp_killstreak_perk_crateopen" }, +// { 0x382B, "" }, +// { 0x382C, "" }, +// { 0x382D, "" }, + { 0x382E, "sentry_cancel_notify" }, +// { 0x382F, "" }, +// { 0x3830, "" }, +// { 0x3831, "" }, +// { 0x3832, "" }, +// { 0x3833, "" }, + { 0x3834, "loc_current" }, +// { 0x3835, "" }, +// { 0x3836, "" }, +// { 0x3837, "" }, + { 0x3838, "request_move" }, + { 0x3839, "chopper_boss_finding_target" }, +// { 0x383A, "" }, +// { 0x383B, "" }, + { 0x383C, "chopper_boss_damage_states" }, + { 0x383D, "chopper_boss_can_hit" }, + { 0x383E, "chopper_boss_can_hit_from" }, + { 0x383F, "chopper_boss_in_range" }, +// { 0x3840, "" }, +// { 0x3841, "" }, +// { 0x3842, "" }, +// { 0x3843, "" }, +// { 0x3844, "" }, + { 0x3845, "chopper_boss_wait_face_target" }, + { 0x3846, "chopper_boss_fire_turrets" }, +// { 0x3847, "" }, +// { 0x3848, "" }, + { 0x3849, "dist2d" }, +// { 0x384A, "" }, +// { 0x384B, "" }, +// { 0x384C, "" }, +// { 0x384D, "" }, +// { 0x384E, "" }, +// { 0x384F, "" }, + { 0x3850, "loot_init" }, +// { 0x3851, "" }, +// { 0x3852, "" }, + { 0x3853, "loot_info_array" }, +// { 0x3854, "" }, + { 0x3855, "wave_unlock" }, + { 0x3856, "wave_lock" }, +// { 0x3857, "" }, + { 0x3858, "rank" }, +// { 0x3859, "" }, +// { 0x385A, "" }, + { 0x385B, "highest_player_rank" }, +// { 0x385C, "" }, +// { 0x385D, "" }, + { 0x385E, "loot_item_exist" }, + { 0x385F, "get_loot_ref_by_index" }, + { 0x3860, "get_ref_by_index" }, + { 0x3861, "get_loot_type" }, +// { 0x3862, "" }, +// { 0x3863, "" }, +// { 0x3864, "" }, +// { 0x3865, "" }, +// { 0x3866, "" }, +// { 0x3867, "" }, +// { 0x3868, "" }, +// { 0x3869, "" }, +// { 0x386A, "" }, + { 0x386B, "ai_preload_weapons" }, +// { 0x386C, "" }, + { 0x386D, "survival_ai" }, + { 0x386E, "survival_boss" }, + { 0x386F, "survival_repeat_wave" }, +// { 0x3870, "" }, + { 0x3871, "survival_wave" }, + { 0x3872, "special_ai_behavior_func" }, + { 0x3873, "wave_populate" }, + { 0x3874, "idx" }, +// { 0x3875, "" }, + { 0x3876, "squadarray" }, + { 0x3877, "specialai" }, +// { 0x3878, "" }, + { 0x3879, "bossdelay" }, +// { 0x387A, "" }, + { 0x387B, "bossnonai" }, +// { 0x387C, "" }, +// { 0x387D, "" }, + { 0x387E, "repeating" }, +// { 0x387F, "" }, + { 0x3880, "ai_type_add_override_class" }, +// { 0x3881, "" }, +// { 0x3882, "" }, +// { 0x3883, "" }, +// { 0x3884, "" }, +// { 0x3885, "" }, + { 0x3886, "givexp_kill" }, + { 0x3887, "ai_type" }, + { 0x3888, "register_xp" }, + { 0x3889, "update_player_closest_node_think" }, + { 0x388A, "node_closest" }, +// { 0x388B, "" }, +// { 0x388C, "" }, + { 0x388D, "get_survival_enemies_living" }, + { 0x388E, "bosses" }, +// { 0x388F, "" }, +// { 0x3890, "" }, + { 0x3891, "weapon_drop_ammo_adjustment" }, +// { 0x3892, "" }, +// { 0x3893, "" }, +// { 0x3894, "" }, +// { 0x3895, "" }, + { 0x3896, "money_fx_on_death" }, +// { 0x3897, "" }, + { 0x3898, "ai_on_flashed" }, + { 0x3899, "get_ai_type_ref" }, +// { 0x389A, "" }, + { 0x389B, "special_ai" }, + { 0x389C, "default_ai" }, +// { 0x389D, "" }, +// { 0x389E, "" }, +// { 0x389F, "" }, +// { 0x38A0, "" }, +// { 0x38A1, "" }, + { 0x38A2, "survival_ai_regular" }, +// { 0x38A3, "" }, + { 0x38A4, "aggressive_squad_leader" }, +// { 0x38A5, "" }, + { 0x38A6, "special_ability" }, +// { 0x38A7, "" }, + { 0x38A8, "martyrdom_ability" }, +// { 0x38A9, "" }, +// { 0x38AA, "" }, +// { 0x38AB, "" }, +// { 0x38AC, "" }, +// { 0x38AD, "" }, +// { 0x38AE, "" }, + { 0x38AF, "survival_ai_claymore_and_chemical" }, + { 0x38B0, "mine_locs_populate" }, + { 0x38B1, "so_mine_locs" }, + { 0x38B2, "mine_locs_attempt_plant" }, +// { 0x38B3, "" }, + { 0x38B4, "mine_ai_remove_busy" }, +// { 0x38B5, "" }, + { 0x38B6, "mine_locs_get_valid" }, +// { 0x38B7, "" }, + { 0x38B8, "occupied" }, +// { 0x38B9, "" }, +// { 0x38BA, "" }, +// { 0x38BB, "" }, + { 0x38BC, "behavior_special_ai_mine_place" }, + { 0x38BD, "mine_ai_planting_death" }, + { 0x38BE, "claymore_create" }, + { 0x38BF, "claymore_on_trigger" }, + { 0x38C0, "claymore_on_trigger_laser_check" }, + { 0x38C1, "so_claymore_trig_dot" }, +// { 0x38C2, "" }, +// { 0x38C3, "" }, +// { 0x38C4, "" }, + { 0x38C5, "mine_delete_on_death" }, + { 0x38C6, "claymore_on_damage" }, +// { 0x38C7, "" }, +// { 0x38C8, "" }, + { 0x38C9, "mine_on_death" }, +// { 0x38CA, "" }, +// { 0x38CB, "" }, +// { 0x38CC, "" }, +// { 0x38CD, "" }, + { 0x38CE, "chemical_ability_on_tank_damage" }, + { 0x38CF, "so_survival_kill_ai" }, + { 0x38D0, "chemical_ability_on_death" }, + { 0x38D1, "chemical_ability_detonate" }, +// { 0x38D2, "" }, +// { 0x38D3, "" }, + { 0x38D4, "gassed" }, + { 0x38D5, "gassed_before" }, + { 0x38D6, "gas_time" }, +// { 0x38D7, "" }, +// { 0x38D8, "" }, + { 0x38D9, "chembomb_create" }, +// { 0x38DA, "" }, +// { 0x38DB, "" }, +// { 0x38DC, "" }, +// { 0x38DD, "" }, +// { 0x38DE, "" }, +// { 0x38DF, "" }, + { 0x38E0, "dog_reloc_trig_array" }, +// { 0x38E1, "" }, + { 0x38E2, "dog_reloc_monitor" }, + { 0x38E3, "dog_reloc" }, + { 0x38E4, "spawn_dogs" }, +// { 0x38E5, "" }, +// { 0x38E6, "" }, +// { 0x38E7, "" }, +// { 0x38E8, "" }, +// { 0x38E9, "" }, +// { 0x38EA, "" }, +// { 0x38EB, "" }, + { 0x38EC, "dog_seek_player" }, +// { 0x38ED, "" }, + { 0x38EE, "dog_get_living" }, +// { 0x38EF, "" }, +// { 0x38F0, "" }, +// { 0x38F1, "" }, + { 0x38F2, "clear_from_boss_array_when_dead" }, + { 0x38F3, "drop_jug_by_chopper" }, +// { 0x38F4, "" }, +// { 0x38F5, "" }, + { 0x38F6, "chopper_drop_smoke_at_unloading" }, +// { 0x38F7, "" }, +// { 0x38F8, "" }, +// { 0x38F9, "" }, + { 0x38FA, "damage_factor" }, +// { 0x38FB, "" }, + { 0x38FC, "dmg_factor_calc" }, + { 0x38FD, "global_jug_behavior" }, + { 0x38FE, "boss_jug_helmet_pop" }, + { 0x38FF, "boss_jug_regular" }, + { 0x3900, "boss_jug_headshot" }, +// { 0x3901, "" }, +// { 0x3902, "" }, + { 0x3903, "dropriotshield" }, + { 0x3904, "subclass_juggernaut_riotshield" }, + { 0x3905, "juggernaut_abandon_shield" }, +// { 0x3906, "" }, +// { 0x3907, "" }, +// { 0x3908, "" }, + { 0x3909, "survival_drop_chopper_init" }, + { 0x390A, "spawn_chopper_boss" }, +// { 0x390B, "" }, +// { 0x390C, "" }, +// { 0x390D, "" }, +// { 0x390E, "" }, +// { 0x390F, "" }, + { 0x3910, "drop_riotshield_think" }, +// { 0x3911, "" }, + { 0x3912, "ally_on_death" }, +// { 0x3913, "" }, + { 0x3914, "get_all_mine_locs" }, +// { 0x3915, "" }, + { 0x3916, "manage_ai_relative_to_player" }, +// { 0x3917, "" }, + { 0x3918, "manage_ai_go_to_player_node" }, + { 0x3919, "survival_enable_sprint" }, + { 0x391A, "survival_disable_sprint" }, + { 0x391B, "ai_exist" }, +// { 0x391C, "" }, +// { 0x391D, "" }, +// { 0x391E, "" }, + { 0x391F, "get_ai_classname" }, +// { 0x3920, "" }, +// { 0x3921, "" }, + { 0x3922, "get_ai_name" }, + { 0x3923, "get_ai_desc" }, +// { 0x3924, "" }, + { 0x3925, "get_ai_speed" }, +// { 0x3926, "" }, +// { 0x3927, "" }, +// { 0x3928, "" }, + { 0x3929, "wave_exist" }, + { 0x392A, "get_wave_boss_delay" }, +// { 0x392B, "" }, +// { 0x392C, "" }, +// { 0x392D, "" }, +// { 0x392E, "" }, +// { 0x392F, "" }, + { 0x3930, "get_special_ai_quantity" }, +// { 0x3931, "" }, +// { 0x3932, "" }, +// { 0x3933, "" }, +// { 0x3934, "" }, +// { 0x3935, "" }, +// { 0x3936, "" }, +// { 0x3937, "" }, +// { 0x3938, "" }, + { 0x3939, "remotemissile_infantry_kills_dialogue" }, +// { 0x393A, "" }, + { 0x393B, "remotemissile_uav" }, +// { 0x393C, "" }, + { 0x393D, "ai_remote_missile_fof_outline" }, + { 0x393E, "splash_notify_message" }, +// { 0x393F, "" }, + { 0x3940, "splashdesc" }, +// { 0x3941, "" }, +// { 0x3942, "" }, +// { 0x3943, "" }, +// { 0x3944, "" }, +// { 0x3945, "" }, + { 0x3946, "title_set_value" }, +// { 0x3947, "" }, +// { 0x3948, "" }, +// { 0x3949, "" }, +// { 0x394A, "" }, + { 0x394B, "title_color" }, +// { 0x394C, "" }, +// { 0x394D, "" }, +// { 0x394E, "" }, + { 0x394F, "desc1" }, +// { 0x3950, "" }, +// { 0x3951, "" }, + { 0x3952, "desc2_set_value" }, +// { 0x3953, "" }, +// { 0x3954, "" }, +// { 0x3955, "" }, +// { 0x3956, "" }, +// { 0x3957, "" }, +// { 0x3958, "" }, +// { 0x3959, "" }, +// { 0x395A, "" }, + { 0x395B, "playsoundlocally" }, + { 0x395C, "abortflag" }, + { 0x395D, "fadeout" }, + { 0x395E, "zoomout" }, +// { 0x395F, "" }, +// { 0x3960, "" }, + { 0x3961, "createfontstring_mp" }, + { 0x3962, "createicon_mp" }, +// { 0x3963, "" }, +// { 0x3964, "" }, + { 0x3965, "throw_grenade_at_player" }, +// { 0x3966, "" }, + { 0x3967, "chopper_wait_for_cloest_open_path_start" }, +// { 0x3968, "" }, +// { 0x3969, "" }, +// { 0x396A, "" }, +// { 0x396B, "" }, +// { 0x396C, "" }, + { 0x396D, "milliseconds" }, +// { 0x396E, "" }, +// { 0x396F, "" }, + { 0x3970, "so_survival_validate_entities" }, + { 0x3971, "debug_survival_error_msgs" }, +// { 0x3972, "" }, + { 0x3973, "debug_survival_error_locs" }, + { 0x3974, "so_survival_display_entity_error_3d" }, +// { 0x3975, "" }, +// { 0x3976, "" }, +// { 0x3977, "" }, +// { 0x3978, "" }, +// { 0x3979, "" }, +// { 0x397A, "" }, +// { 0x397B, "" }, +// { 0x397C, "" }, + { 0x397D, "survival_dialog_sentry_updates" }, +// { 0x397E, "" }, +// { 0x397F, "" }, + { 0x3980, "armed" }, + { 0x3981, "use_old_turret" }, +// { 0x3982, "" }, +// { 0x3983, "" }, + { 0x3984, "playjettrail" }, + { 0x3985, "plane_sound_node" }, + { 0x3986, "fire_missile_node" }, +// { 0x3987, "" }, +// { 0x3988, "" }, +// { 0x3989, "" }, +// { 0x398A, "" }, +// { 0x398B, "" }, + { 0x398C, "enemy_air_support_marker_fx" }, + { 0x398D, "enemy_air_support_trail_fx" }, +// { 0x398E, "" }, + { 0x398F, "air_support_strobes" }, + { 0x3990, "fake_strobe" }, +// { 0x3991, "" }, +// { 0x3992, "" }, +// { 0x3993, "" }, + { 0x3994, "enable_strobes_for_player" }, + { 0x3995, "air_support_loop" }, + { 0x3996, "strobe_firedelay_override" }, + { 0x3997, "strobe_no_vis_check" }, + { 0x3998, "strobe_no_badplace" }, +// { 0x3999, "" }, +// { 0x399A, "" }, +// { 0x399B, "" }, +// { 0x399C, "" }, +// { 0x399D, "" }, + { 0x399E, "isenemystrobe" }, +// { 0x399F, "" }, + { 0x39A0, "marker_pulse" }, +// { 0x39A1, "" }, + { 0x39A2, "air_support_enqueue" }, +// { 0x39A3, "" }, +// { 0x39A4, "" }, + { 0x39A5, "set_aircraft" }, +// { 0x39A6, "" }, +// { 0x39A7, "" }, +// { 0x39A8, "" }, +// { 0x39A9, "" }, +// { 0x39AA, "" }, +// { 0x39AB, "" }, +// { 0x39AC, "" }, + { 0x39AD, "target_pos" }, +// { 0x39AE, "" }, +// { 0x39AF, "" }, +// { 0x39B0, "" }, + { 0x39B1, "compute_targets" }, +// { 0x39B2, "" }, + { 0x39B3, "get_best_target" }, +// { 0x39B4, "" }, +// { 0x39B5, "" }, + { 0x39B6, "visibility_check" }, +// { 0x39B7, "" }, + { 0x39B8, "air_support_strobe_num_killed" }, +// { 0x39B9, "" }, + { 0x39BA, "get_num_kills" }, +// { 0x39BB, "" }, + { 0x39BC, "btr_courtyard" }, + { 0x39BD, "monitor_last_weapon" }, +// { 0x39BE, "" }, +// { 0x39BF, "" }, + { 0x39C0, "armory_postload" }, + { 0x39C1, "ac130_traverse" }, +// { 0x39C2, "" }, +// { 0x39C3, "" }, + { 0x39C4, "sub_type" }, + { 0x39C5, "cost" }, + { 0x39C6, "unlockrank" }, + { 0x39C7, "func_can_give" }, + { 0x39C8, "func_give" }, + { 0x39C9, "maxstock" }, +// { 0x39CA, "" }, + { 0x39CB, "armory_setup" }, +// { 0x39CC, "" }, +// { 0x39CD, "" }, +// { 0x39CE, "" }, +// { 0x39CF, "" }, + { 0x39D0, "armory_setup_players" }, +// { 0x39D1, "" }, + { 0x39D2, "armory_use_monitor" }, +// { 0x39D3, "" }, + { 0x39D4, "waittill_armory_warning_respond" }, +// { 0x39D5, "" }, +// { 0x39D6, "" }, +// { 0x39D7, "" }, + { 0x39D8, "using_armory" }, +// { 0x39D9, "" }, + { 0x39DA, "selected_weapon" }, + { 0x39DB, "survival_credit" }, +// { 0x39DC, "" }, +// { 0x39DD, "" }, + { 0x39DE, "pip" }, +// { 0x39DF, "" }, + { 0x39E0, "sentry_pip_cam" }, +// { 0x39E1, "" }, +// { 0x39E2, "" }, + { 0x39E3, "pip_sentry_id" }, +// { 0x39E4, "" }, +// { 0x39E5, "" }, +// { 0x39E6, "" }, + { 0x39E7, "setup_pip_name" }, +// { 0x39E8, "" }, +// { 0x39E9, "" }, +// { 0x39EA, "" }, +// { 0x39EB, "" }, +// { 0x39EC, "" }, +// { 0x39ED, "" }, + { 0x39EE, "hint_bubble" }, + { 0x39EF, "item_exist" }, +// { 0x39F0, "" }, + { 0x39F1, "get_icon" }, +// { 0x39F2, "" }, +// { 0x39F3, "" }, + { 0x39F4, "get_sub_type" }, +// { 0x39F5, "" }, +// { 0x39F6, "" }, +// { 0x39F7, "" }, +// { 0x39F8, "" }, + { 0x39F9, "get_unlock_rank" }, + { 0x39FA, "is_item_enabled" }, + { 0x39FB, "get_item_drop_stock" }, +// { 0x39FC, "" }, +// { 0x39FD, "" }, + { 0x39FE, "armory_give" }, + { 0x39FF, "get_func_can_give" }, + { 0x3A00, "get_func_give" }, +// { 0x3A01, "" }, + { 0x3A02, "give_default" }, +// { 0x3A03, "" }, + { 0x3A04, "give_ammo" }, + { 0x3A05, "give_ammo_max" }, + { 0x3A06, "can_give_weapon" }, +// { 0x3A07, "" }, +// { 0x3A08, "" }, + { 0x3A09, "can_give_weapon_upgrade" }, +// { 0x3A0A, "" }, +// { 0x3A0B, "" }, + { 0x3A0C, "get_weapon_base_name" }, + { 0x3A0D, "get_upgrades_on_weapon" }, +// { 0x3A0E, "" }, +// { 0x3A0F, "" }, + { 0x3A10, "give_grenade" }, +// { 0x3A11, "" }, +// { 0x3A12, "" }, +// { 0x3A13, "" }, + { 0x3A14, "give_slotted_explosive" }, + { 0x3A15, "can_give_riotshield_so" }, +// { 0x3A16, "" }, +// { 0x3A17, "" }, + { 0x3A18, "give_sentry" }, + { 0x3A19, "can_give_armor" }, +// { 0x3A1A, "" }, + { 0x3A1B, "give_armor" }, +// { 0x3A1C, "" }, +// { 0x3A1D, "" }, +// { 0x3A1E, "" }, + { 0x3A1F, "player_armor_shield" }, + { 0x3A20, "armor_shield_on" }, +// { 0x3A21, "" }, +// { 0x3A22, "" }, +// { 0x3A23, "" }, +// { 0x3A24, "" }, +// { 0x3A25, "" }, +// { 0x3A26, "" }, +// { 0x3A27, "" }, + { 0x3A28, "give_friendlies_monitor_use" }, +// { 0x3A29, "" }, + { 0x3A2A, "give_airstrike" }, + { 0x3A2B, "sticky_strobe" }, + { 0x3A2C, "strobe_timeout" }, + { 0x3A2D, "watch_for_strobe_hit" }, +// { 0x3A2E, "" }, + { 0x3A2F, "can_give_chopper" }, +// { 0x3A30, "" }, +// { 0x3A31, "" }, +// { 0x3A32, "" }, +// { 0x3A33, "" }, +// { 0x3A34, "" }, +// { 0x3A35, "" }, +// { 0x3A36, "" }, +// { 0x3A37, "" }, + { 0x3A38, "splash" }, +// { 0x3A39, "" }, + { 0x3A3A, "repeatable" }, + { 0x3A3B, "carry" }, + { 0x3A3C, "wave_active" }, + { 0x3A3D, "wave_inactive" }, + { 0x3A3E, "challenge_init" }, +// { 0x3A3F, "" }, + { 0x3A40, "sur_challenge_think" }, +// { 0x3A41, "" }, + { 0x3A42, "completed_ch" }, + { 0x3A43, "challenge_func_director" }, +// { 0x3A44, "" }, +// { 0x3A45, "" }, +// { 0x3A46, "" }, +// { 0x3A47, "" }, +// { 0x3A48, "" }, +// { 0x3A49, "" }, + { 0x3A4A, "track_flash_kill" }, +// { 0x3A4B, "" }, + { 0x3A4C, "track_melee_streak" }, + { 0x3A4D, "sur_ch_quadkill" }, +// { 0x3A4E, "" }, +// { 0x3A4F, "" }, +// { 0x3A50, "" }, +// { 0x3A51, "" }, +// { 0x3A52, "" }, +// { 0x3A53, "" }, +// { 0x3A54, "" }, +// { 0x3A55, "" }, +// { 0x3A56, "" }, +// { 0x3A57, "" }, +// { 0x3A58, "" }, +// { 0x3A59, "" }, +// { 0x3A5A, "" }, +// { 0x3A5B, "" }, +// { 0x3A5C, "" }, +// { 0x3A5D, "" }, + { 0x3A5E, "ch_get_splash" }, + { 0x3A5F, "ch_get_icon" }, +// { 0x3A60, "" }, +// { 0x3A61, "" }, + { 0x3A62, "ch_get_repeatable" }, +// { 0x3A63, "" }, + { 0x3A64, "ch_get_wave_active" }, + { 0x3A65, "ch_get_wave_inactive" }, + { 0x3A66, "get_loadout_item_ref" }, +// { 0x3A67, "" }, +// { 0x3A68, "" }, +// { 0x3A69, "" }, +// { 0x3A6A, "" }, +// { 0x3A6B, "" }, + { 0x3A6C, "survival_leaderboard_wave_func" }, + { 0x3A6D, "survival_leaderboard_score_func" }, +// { 0x3A6E, "" }, +// { 0x3A6F, "" }, +// { 0x3A70, "" }, +// { 0x3A71, "" }, +// { 0x3A72, "" }, +// { 0x3A73, "" }, + { 0x3A74, "waittill_survival_start" }, + { 0x3A75, "setup_players" }, +// { 0x3A76, "" }, +// { 0x3A77, "" }, + { 0x3A78, "give_player_armor" }, + { 0x3A79, "give_player_equipment" }, +// { 0x3A7A, "" }, +// { 0x3A7B, "" }, + { 0x3A7C, "decrease_rev_time" }, +// { 0x3A7D, "" }, +// { 0x3A7E, "" }, +// { 0x3A7F, "" }, + { 0x3A80, "weapon_collect_ammo_adjust_was_recent" }, + { 0x3A81, "weapon_collect_balance_ammo" }, +// { 0x3A82, "" }, +// { 0x3A83, "" }, +// { 0x3A84, "" }, +// { 0x3A85, "" }, + { 0x3A86, "delayed_enemy_ping" }, + { 0x3A87, "survival_wave_catch_player_ready" }, +// { 0x3A88, "" }, + { 0x3A89, "survival_players_ready" }, +// { 0x3A8A, "" }, +// { 0x3A8B, "" }, + { 0x3A8C, "survival_wave_catch_player_ready_clean" }, +// { 0x3A8D, "" }, + { 0x3A8E, "spawn_wave" }, +// { 0x3A8F, "" }, + { 0x3A90, "spawn_special_ai" }, + { 0x3A91, "reenforcement_squad_spawn" }, +// { 0x3A92, "" }, + { 0x3A93, "wave_has_boss" }, + { 0x3A94, "spawn_boss" }, +// { 0x3A95, "" }, +// { 0x3A96, "" }, +// { 0x3A97, "" }, +// { 0x3A98, "" }, + { 0x3A99, "performance" }, +// { 0x3A9A, "" }, +// { 0x3A9B, "" }, +// { 0x3A9C, "" }, +// { 0x3A9D, "" }, +// { 0x3A9E, "" }, + { 0x3A9F, "performance_track_downed" }, + { 0x3AA0, "performance_track_credits" }, + { 0x3AA1, "performance_track_time" }, + { 0x3AA2, "performance_track_headshot" }, +// { 0x3AA3, "" }, +// { 0x3AA4, "" }, + { 0x3AA5, "performance_damagetaken_update" }, +// { 0x3AA6, "" }, +// { 0x3AA7, "" }, +// { 0x3AA8, "" }, + { 0x3AA9, "performance_track_nonai_kills" }, + { 0x3AAA, "reward_calculation" }, + { 0x3AAB, "get_reward" }, + { 0x3AAC, "camping_think" }, +// { 0x3AAD, "" }, +// { 0x3AAE, "" }, +// { 0x3AAF, "" }, + { 0x3AB0, "camping_loc" }, +// { 0x3AB1, "" }, + { 0x3AB2, "camp_response_interval" }, + { 0x3AB3, "level_ai_respond" }, + { 0x3AB4, "level_ai_boss_respond" }, +// { 0x3AB5, "" }, + { 0x3AB6, "update_from_xp" }, +// { 0x3AB7, "" }, +// { 0x3AB8, "" }, + { 0x3AB9, "update_from_credits" }, + { 0x3ABA, "intro_music" }, + { 0x3ABB, "music_boss" }, +// { 0x3ABC, "" }, + { 0x3ABD, "credits_ui_init" }, + { 0x3ABE, "ui_rolling_credits" }, + { 0x3ABF, "wave_timer_player_setup" }, + { 0x3AC0, "hud_so_wave_timer_time" }, +// { 0x3AC1, "" }, +// { 0x3AC2, "" }, +// { 0x3AC3, "" }, + { 0x3AC4, "armor_x" }, +// { 0x3AC5, "" }, + { 0x3AC6, "armor_shield_size" }, +// { 0x3AC7, "" }, + { 0x3AC8, "shield_elem_fade" }, + { 0x3AC9, "armor_jitter" }, +// { 0x3ACA, "" }, +// { 0x3ACB, "" }, + { 0x3ACC, "enemy_remaining_hud" }, +// { 0x3ACD, "" }, +// { 0x3ACE, "" }, +// { 0x3ACF, "" }, + { 0x3AD0, "icon_size" }, +// { 0x3AD1, "" }, + { 0x3AD2, "laststand_hud_lives" }, +// { 0x3AD3, "" }, +// { 0x3AD4, "" }, +// { 0x3AD5, "" }, + { 0x3AD6, "player_performance_ui_init" }, + { 0x3AD7, "performance_summary" }, +// { 0x3AD8, "" }, +// { 0x3AD9, "" }, +// { 0x3ADA, "" }, +// { 0x3ADB, "" }, +// { 0x3ADC, "" }, + { 0x3ADD, "survival_armory_hint" }, +// { 0x3ADE, "" }, +// { 0x3ADF, "" }, +// { 0x3AE0, "" }, +// { 0x3AE1, "" }, +// { 0x3AE2, "" }, + { 0x3AE3, "set_animarray_crouching_right" }, +// { 0x3AE4, "" }, + { 0x3AE5, "islowthrowsafe" }, +// { 0x3AE6, "" }, +// { 0x3AE7, "" }, +// { 0x3AE8, "" }, + { 0x3AE9, "facial_animation" }, +// { 0x3AEA, "" }, +// { 0x3AEB, "" }, +// { 0x3AEC, "" }, +// { 0x3AED, "" }, +// { 0x3AEE, "" }, +// { 0x3AEF, "" }, +// { 0x3AF0, "" }, +// { 0x3AF1, "" }, +// { 0x3AF2, "" }, + { 0x3AF3, "traversedeathindex" }, +// { 0x3AF4, "" }, +// { 0x3AF5, "" }, + { 0x3AF6, "handletraversedeathnotetrack" }, +// { 0x3AF7, "" }, +// { 0x3AF8, "" }, + { 0x3AF9, "finishtraversedrop" }, +// { 0x3AFA, "" }, +// { 0x3AFB, "" }, +// { 0x3AFC, "" }, +// { 0x3AFD, "" }, + { 0x3AFE, "step_down_human" }, + { 0x3AFF, "step_up_human" }, +// { 0x3B00, "" }, +// { 0x3B01, "" }, + { 0x3B02, "jump_through_window_human" }, +// { 0x3B03, "" }, +// { 0x3B04, "" }, +// { 0x3B05, "" }, +// { 0x3B06, "" }, + { 0x3B07, "low_wall_human" }, +// { 0x3B08, "" }, + { 0x3B09, "slide_across_car_dog" }, + { 0x3B0A, "traversedeath" }, +// { 0x3B0B, "" }, +// { 0x3B0C, "" }, +// { 0x3B0D, "" }, +// { 0x3B0E, "" }, +// { 0x3B0F, "" }, +// { 0x3B10, "" }, + { 0x3B11, "stop" }, +// { 0x3B12, "" }, + { 0x3B13, "civilianflashedarray" }, +// { 0x3B14, "" }, +// { 0x3B15, "" }, + { 0x3B16, "closestai" }, +// { 0x3B17, "" }, + { 0x3B18, "breached" }, +// { 0x3B19, "" }, +// { 0x3B1A, "" }, +// { 0x3B1B, "" }, + { 0x3B1C, "readytobreach" }, +// { 0x3B1D, "" }, +// { 0x3B1E, "" }, + { 0x3B1F, "cleared" }, +// { 0x3B20, "" }, +// { 0x3B21, "" }, + { 0x3B22, "hostilesspawned" }, + { 0x3B23, "sbadplacename" }, +// { 0x3B24, "" }, +// { 0x3B25, "" }, + { 0x3B26, "triggerhintstring" }, + { 0x3B27, "edoor" }, + { 0x3B28, "vector" }, +// { 0x3B29, "" }, + { 0x3B2A, "iexplodernum" }, +// { 0x3B2B, "" }, +// { 0x3B2C, "" }, + { 0x3B2D, "firstbreacher" }, + { 0x3B2E, "breach_dont_fire" }, +// { 0x3B2F, "" }, +// { 0x3B30, "" }, +// { 0x3B31, "" }, + { 0x3B32, "usebreachapproach" }, +// { 0x3B33, "" }, +// { 0x3B34, "" }, + { 0x3B35, "friendly_breach_thread" }, +// { 0x3B36, "" }, + { 0x3B37, "detcord_logic" }, + { 0x3B38, "sound_effect_play" }, +// { 0x3B39, "" }, + { 0x3B3A, "detpackstunradius" }, + { 0x3B3B, "stunnedanimnumber" }, + { 0x3B3C, "breach_trigger_think" }, +// { 0x3B3D, "" }, +// { 0x3B3E, "" }, + { 0x3B3F, "breach_abort" }, +// { 0x3B40, "" }, +// { 0x3B41, "" }, +// { 0x3B42, "" }, +// { 0x3B43, "" }, + { 0x3B44, "spawnbreachhostiles" }, +// { 0x3B45, "" }, + { 0x3B46, "door_open" }, +// { 0x3B47, "" }, + { 0x3B48, "maxdetpackdamage" }, +// { 0x3B49, "" }, +// { 0x3B4A, "" }, + { 0x3B4B, "breach_set_goaladius" }, +// { 0x3B4C, "" }, +// { 0x3B4D, "" }, + { 0x3B4E, "breach_set_animname" }, + { 0x3B4F, "old_animname" }, + { 0x3B50, "breach_reset_animname" }, +// { 0x3B51, "" }, + { 0x3B52, "slide" }, +// { 0x3B53, "" }, +// { 0x3B54, "" }, +// { 0x3B55, "" }, + { 0x3B56, "imagea" }, +// { 0x3B57, "" }, +// { 0x3B58, "" }, +// { 0x3B59, "" }, +// { 0x3B5A, "" }, + { 0x3B5B, "briefing_fadeouttime" }, +// { 0x3B5C, "" }, + { 0x3B5D, "fadeinfiretoskip" }, + { 0x3B5E, "fadefiretoskip" }, + { 0x3B5F, "waittillbriefingdone" }, +// { 0x3B60, "" }, +// { 0x3B61, "" }, + { 0x3B62, "imagefadeout" }, + { 0x3B63, "endthread" }, + { 0x3B64, "soundplay" }, + { 0x3B65, "soundplay_flag" }, + { 0x3B66, "dothebriefing" }, + { 0x3B67, "skipthebriefing" }, +// { 0x3B68, "" }, +// { 0x3B69, "" }, + { 0x3B6A, "initchickens" }, + { 0x3B6B, "spawnchicken" }, + { 0x3B6C, "initcarry" }, +// { 0x3B6D, "" }, + { 0x3B6E, "setwounded" }, +// { 0x3B6F, "" }, +// { 0x3B70, "" }, +// { 0x3B71, "" }, +// { 0x3B72, "" }, + { 0x3B73, "goto_and_pickup_wounded" }, + { 0x3B74, "link_wounded" }, + { 0x3B75, "carry_to_and_putdown_wounded" }, +// { 0x3B76, "" }, +// { 0x3B77, "" }, +// { 0x3B78, "" }, +// { 0x3B79, "" }, +// { 0x3B7A, "" }, +// { 0x3B7B, "" }, +// { 0x3B7C, "" }, +// { 0x3B7D, "" }, + { 0x3B7E, "script_trace" }, + { 0x3B7F, "que_body" }, + { 0x3B80, "civilian_noncombatmoveturn" }, + { 0x3B81, "civilian_combatmoveturn" }, + { 0x3B82, "civilian_combathunchedmoveturn" }, +// { 0x3B83, "" }, +// { 0x3B84, "" }, +// { 0x3B85, "" }, +// { 0x3B86, "" }, +// { 0x3B87, "" }, +// { 0x3B88, "" }, +// { 0x3B89, "" }, +// { 0x3B8A, "" }, + { 0x3B8B, "initcivilianprops" }, +// { 0x3B8C, "" }, + { 0x3B8D, "startcombat" }, + { 0x3B8E, "force_civilian_stand_run" }, + { 0x3B8F, "force_civilian_hunched_run" }, + { 0x3B90, "checkcombatstate" }, +// { 0x3B91, "" }, +// { 0x3B92, "" }, +// { 0x3B93, "" }, + { 0x3B94, "sun_color" }, + { 0x3B95, "merge_sunsingledvar" }, +// { 0x3B96, "" }, +// { 0x3B97, "" }, +// { 0x3B98, "" }, + { 0x3B99, "flare_path" }, + { 0x3B9A, "flare_initial_fx" }, + { 0x3B9B, "flare_explodes" }, + { 0x3B9C, "red_suncolor" }, + { 0x3B9D, "original_suncolor" }, +// { 0x3B9E, "" }, + { 0x3B9F, "flag_flare" }, +// { 0x3BA0, "" }, +// { 0x3BA1, "" }, +// { 0x3BA2, "" }, +// { 0x3BA3, "" }, +// { 0x3BA4, "" }, +// { 0x3BA5, "" }, +// { 0x3BA6, "" }, +// { 0x3BA7, "" }, +// { 0x3BA8, "" }, +// { 0x3BA9, "" }, +// { 0x3BAA, "" }, +// { 0x3BAB, "" }, + { 0x3BAC, "player_heli_ropeanimoverride_idle" }, +// { 0x3BAD, "" }, +// { 0x3BAE, "" }, + { 0x3BAF, "registerweaponinfo" }, +// { 0x3BB0, "" }, +// { 0x3BB1, "" }, +// { 0x3BB2, "" }, + { 0x3BB3, "getweaponinfostring" }, + { 0x3BB4, "bulletalphas" }, +// { 0x3BB5, "" }, +// { 0x3BB6, "" }, +// { 0x3BB7, "" }, +// { 0x3BB8, "" }, + { 0x3BB9, "gethudweapontype" }, + { 0x3BBA, "updatehudweaponammo" }, + { 0x3BBB, "inventory" }, +// { 0x3BBC, "" }, +// { 0x3BBD, "" }, +// { 0x3BBE, "" }, +// { 0x3BBF, "" }, +// { 0x3BC0, "" }, +// { 0x3BC1, "" }, + { 0x3BC2, "leak_setup" }, + { 0x3BC3, "leak_barrel_setup" }, + { 0x3BC4, "curvol" }, + { 0x3BC5, "lowz" }, + { 0x3BC6, "highz" }, +// { 0x3BC7, "" }, + { 0x3BC8, "_leak_methods" }, +// { 0x3BC9, "" }, + { 0x3BCA, "leak_calc_ballistic" }, + { 0x3BCB, "leak_calc_splash" }, +// { 0x3BCC, "" }, +// { 0x3BCD, "" }, + { 0x3BCE, "menustack" }, + { 0x3BCF, "display" }, +// { 0x3BD0, "" }, + { 0x3BD1, "ypos" }, +// { 0x3BD2, "" }, + { 0x3BD3, "loadmultiplayer" }, + { 0x3BD4, "pushmenu" }, +// { 0x3BD5, "" }, + { 0x3BD6, "menutype" }, +// { 0x3BD7, "" }, + { 0x3BD8, "createmenu" }, + { 0x3BD9, "itemdefs" }, + { 0x3BDA, "itemwidth" }, +// { 0x3BDB, "" }, +// { 0x3BDC, "" }, +// { 0x3BDD, "" }, +// { 0x3BDE, "" }, + { 0x3BDF, "createsubmenu" }, +// { 0x3BE0, "" }, +// { 0x3BE1, "" }, + { 0x3BE2, "itemtype" }, +// { 0x3BE3, "" }, +// { 0x3BE4, "" }, + { 0x3BE5, "action" }, +// { 0x3BE6, "" }, +// { 0x3BE7, "" }, + { 0x3BE8, "setting" }, +// { 0x3BE9, "" }, + { 0x3BEA, "createitemelems" }, + { 0x3BEB, "bgicon" }, +// { 0x3BEC, "" }, +// { 0x3BED, "" }, +// { 0x3BEE, "" }, +// { 0x3BEF, "" }, + { 0x3BF0, "destroyitemelems" }, + { 0x3BF1, "setelempoints" }, + { 0x3BF2, "showmenu" }, + { 0x3BF3, "hidemenu" }, + { 0x3BF4, "collapsemenu" }, + { 0x3BF5, "expandmenu" }, +// { 0x3BF6, "" }, + { 0x3BF7, "setselected" }, +// { 0x3BF8, "" }, +// { 0x3BF9, "" }, +// { 0x3BFA, "" }, +// { 0x3BFB, "" }, +// { 0x3BFC, "" }, +// { 0x3BFD, "" }, +// { 0x3BFE, "" }, +// { 0x3BFF, "" }, +// { 0x3C00, "" }, + { 0x3C01, "initthumbsticklayout" }, + { 0x3C02, "initbuttonlayout" }, +// { 0x3C03, "" }, +// { 0x3C04, "" }, +// { 0x3C05, "" }, + { 0x3C06, "initvibration" }, + { 0x3C07, "updatedisplayvalue" }, + { 0x3C08, "setupaction" }, +// { 0x3C09, "" }, +// { 0x3C0A, "" }, + { 0x3C0B, "runaction" }, + { 0x3C0C, "testaction" }, + { 0x3C0D, "marine" }, + { 0x3C0E, "menuresponse" }, +// { 0x3C0F, "" }, +// { 0x3C10, "" }, +// { 0x3C11, "" }, +// { 0x3C12, "" }, +// { 0x3C13, "" }, + { 0x3C14, "railyard_style" }, + { 0x3C15, "istopbarrage" }, +// { 0x3C16, "" }, +// { 0x3C17, "" }, + { 0x3C18, "mortars" }, +// { 0x3C19, "" }, +// { 0x3C1A, "" }, +// { 0x3C1B, "" }, +// { 0x3C1C, "" }, +// { 0x3C1D, "" }, + { 0x3C1E, "script_timer" }, +// { 0x3C1F, "" }, +// { 0x3C20, "" }, + { 0x3C21, "mortarthread" }, + { 0x3C22, "script_mortargroup_mortar_group" }, +// { 0x3C23, "" }, +// { 0x3C24, "" }, +// { 0x3C25, "" }, +// { 0x3C26, "" }, + { 0x3C27, "bunker_style_mortar" }, +// { 0x3C28, "" }, +// { 0x3C29, "" }, +// { 0x3C2A, "" }, + { 0x3C2B, "bunker_style_mortar_activate" }, + { 0x3C2C, "mortarnoincomingsound" }, + { 0x3C2D, "mortarnoquake" }, + { 0x3C2E, "bunker_style_mortar_explode" }, +// { 0x3C2F, "" }, +// { 0x3C30, "" }, +// { 0x3C31, "" }, + { 0x3C32, "bog_style_mortar_think" }, + { 0x3C33, "bogmortarsgoonce" }, +// { 0x3C34, "" }, +// { 0x3C35, "" }, +// { 0x3C36, "" }, + { 0x3C37, "nomaxmortardist" }, + { 0x3C38, "mortar_max_dist" }, + { 0x3C39, "nomortars" }, + { 0x3C3A, "bog_style_mortar_cleanup" }, +// { 0x3C3B, "" }, + { 0x3C3C, "mortar_within_player_fov" }, + { 0x3C3D, "playermortarfovoffset" }, +// { 0x3C3E, "" }, +// { 0x3C3F, "" }, +// { 0x3C40, "" }, +// { 0x3C41, "" }, +// { 0x3C42, "" }, +// { 0x3C43, "" }, + { 0x3C44, "bog_style_mortar_off" }, +// { 0x3C45, "" }, +// { 0x3C46, "" }, +// { 0x3C47, "" }, +// { 0x3C48, "" }, +// { 0x3C49, "" }, +// { 0x3C4A, "" }, +// { 0x3C4B, "" }, +// { 0x3C4C, "" }, +// { 0x3C4D, "" }, + { 0x3C4E, "activate_mortar" }, +// { 0x3C4F, "" }, +// { 0x3C50, "" }, +// { 0x3C51, "" }, +// { 0x3C52, "" }, +// { 0x3C53, "" }, +// { 0x3C54, "" }, +// { 0x3C55, "" }, +// { 0x3C56, "" }, + { 0x3C57, "_explosion_iminrange" }, +// { 0x3C58, "" }, + { 0x3C59, "_explosion_idamagemax" }, +// { 0x3C5A, "" }, + { 0x3C5B, "_explosion_fquakepower" }, +// { 0x3C5C, "" }, +// { 0x3C5D, "" }, + { 0x3C5E, "generic_style_setradius" }, + { 0x3C5F, "generic_style_setdamage" }, + { 0x3C60, "generic_style_setquake" }, +// { 0x3C61, "" }, + { 0x3C62, "explosion_stopnotify" }, + { 0x3C63, "bstopbarrage" }, +// { 0x3C64, "" }, + { 0x3C65, "iminrange" }, + { 0x3C66, "explosion_delay" }, + { 0x3C67, "explosion_barrage_delay" }, + { 0x3C68, "explosion_activate" }, + { 0x3C69, "explosion_boom" }, +// { 0x3C6A, "" }, +// { 0x3C6B, "" }, + { 0x3C6C, "_effecttype" }, +// { 0x3C6D, "" }, +// { 0x3C6E, "" }, +// { 0x3C6F, "" }, + { 0x3C70, "overheat_enable" }, + { 0x3C71, "turret_heat_status" }, +// { 0x3C72, "" }, + { 0x3C73, "turret_heat_rate" }, + { 0x3C74, "turret_cool_rate" }, +// { 0x3C75, "" }, +// { 0x3C76, "" }, + { 0x3C77, "overheat_flash_time_increment" }, +// { 0x3C78, "" }, + { 0x3C79, "overheat_disable" }, +// { 0x3C7A, "" }, +// { 0x3C7B, "" }, + { 0x3C7C, "status_meter_update" }, +// { 0x3C7D, "" }, + { 0x3C7E, "create_hud" }, +// { 0x3C7F, "" }, + { 0x3C80, "prop_notetrack_exist" }, + { 0x3C81, "prop_notetracks" }, +// { 0x3C82, "" }, +// { 0x3C83, "" }, +// { 0x3C84, "" }, + { 0x3C85, "add_sit_load_ak_notetracks" }, +// { 0x3C86, "" }, +// { 0x3C87, "" }, +// { 0x3C88, "" }, + { 0x3C89, "phone" }, + { 0x3C8A, "detach_phone" }, + { 0x3C8B, "attach_cig" }, + { 0x3C8C, "cigar" }, + { 0x3C8D, "detach_cig" }, +// { 0x3C8E, "" }, + { 0x3C8F, "prop_delete_cig" }, +// { 0x3C90, "" }, + { 0x3C91, "cig_throwing" }, +// { 0x3C92, "" }, + { 0x3C93, "smoke_exhale" }, +// { 0x3C94, "" }, +// { 0x3C95, "" }, + { 0x3C96, "super_dose" }, + { 0x3C97, "inside" }, +// { 0x3C98, "" }, + { 0x3C99, "updateradiationtrigger_perplayer" }, +// { 0x3C9A, "" }, +// { 0x3C9B, "" }, +// { 0x3C9C, "" }, +// { 0x3C9D, "" }, +// { 0x3C9E, "" }, +// { 0x3C9F, "" }, +// { 0x3CA0, "" }, +// { 0x3CA1, "" }, +// { 0x3CA2, "" }, +// { 0x3CA3, "" }, + { 0x3CA4, "updateradiationdosimeter" }, + { 0x3CA5, "updateradiationdosimetercolor" }, +// { 0x3CA6, "" }, +// { 0x3CA7, "" }, +// { 0x3CA8, "" }, +// { 0x3CA9, "" }, +// { 0x3CAA, "" }, + { 0x3CAB, "_sea_org" }, +// { 0x3CAC, "" }, +// { 0x3CAD, "" }, +// { 0x3CAE, "" }, +// { 0x3CAF, "" }, + { 0x3CB0, "sea_logic" }, + { 0x3CB1, "lite_settings" }, +// { 0x3CB2, "" }, +// { 0x3CB3, "" }, +// { 0x3CB4, "" }, +// { 0x3CB5, "" }, +// { 0x3CB6, "" }, +// { 0x3CB7, "" }, +// { 0x3CB8, "" }, + { 0x3CB9, "pratio" }, +// { 0x3CBA, "" }, + { 0x3CBB, "ang" }, + { 0x3CBC, "sea_objectbob" }, + { 0x3CBD, "link" }, +// { 0x3CBE, "" }, +// { 0x3CBF, "" }, + { 0x3CC0, "sea_objectbob_findparent" }, +// { 0x3CC1, "" }, + { 0x3CC2, "sea_bob_reset_loop" }, +// { 0x3CC3, "" }, + { 0x3CC4, "sea_waves" }, +// { 0x3CC5, "" }, + { 0x3CC6, "sea_waves_fx" }, + { 0x3CC7, "sea_waves_fx2" }, + { 0x3CC8, "sea_closestwavearray" }, +// { 0x3CC9, "" }, +// { 0x3CCA, "" }, + { 0x3CCB, "sea_waves_setup" }, +// { 0x3CCC, "" }, + { 0x3CCD, "sea_litebob" }, +// { 0x3CCE, "" }, +// { 0x3CCF, "" }, + { 0x3CD0, "stealth_group_spotted_flag_wait" }, +// { 0x3CD1, "" }, + { 0x3CD2, "ai_message_handler_hidden" }, + { 0x3CD3, "ai_create_behavior_function" }, +// { 0x3CD4, "" }, + { 0x3CD5, "ai_functions" }, +// { 0x3CD6, "" }, +// { 0x3CD7, "" }, + { 0x3CD8, "goback_startfunc" }, +// { 0x3CD9, "" }, +// { 0x3CDA, "" }, +// { 0x3CDB, "" }, +// { 0x3CDC, "" }, +// { 0x3CDD, "" }, + { 0x3CDE, "group_add_to_global_list" }, +// { 0x3CDF, "" }, + { 0x3CE0, "group_get_flagname_from_group" }, +// { 0x3CE1, "" }, +// { 0x3CE2, "" }, +// { 0x3CE3, "" }, +// { 0x3CE4, "" }, +// { 0x3CE5, "" }, +// { 0x3CE6, "" }, +// { 0x3CE7, "" }, +// { 0x3CE8, "" }, + { 0x3CE9, "last_spot" }, +// { 0x3CEA, "" }, +// { 0x3CEB, "" }, +// { 0x3CEC, "" }, +// { 0x3CED, "" }, +// { 0x3CEE, "" }, +// { 0x3CEF, "" }, +// { 0x3CF0, "" }, +// { 0x3CF1, "" }, + { 0x3CF2, "spotted_list" }, + { 0x3CF3, "enemy_stop_current_behavior" }, +// { 0x3CF4, "" }, + { 0x3CF5, "enemy_set_original_goal" }, + { 0x3CF6, "enemy_runto_and_lookaround" }, +// { 0x3CF7, "" }, +// { 0x3CF8, "" }, +// { 0x3CF9, "" }, +// { 0x3CFA, "" }, + { 0x3CFB, "enemy_announce_attack" }, +// { 0x3CFC, "" }, +// { 0x3CFD, "" }, +// { 0x3CFE, "" }, + { 0x3CFF, "enemy_announce_corpse" }, +// { 0x3D00, "" }, +// { 0x3D01, "" }, +// { 0x3D02, "" }, +// { 0x3D03, "" }, +// { 0x3D04, "" }, +// { 0x3D05, "" }, +// { 0x3D06, "" }, +// { 0x3D07, "" }, +// { 0x3D08, "" }, + { 0x3D09, "anim_props_animated" }, +// { 0x3D0A, "" }, + { 0x3D0B, "enemy_animation_pre_anim" }, +// { 0x3D0C, "" }, +// { 0x3D0D, "" }, +// { 0x3D0E, "" }, +// { 0x3D0F, "" }, +// { 0x3D10, "" }, +// { 0x3D11, "" }, +// { 0x3D12, "" }, + { 0x3D13, "event_awareness_main" }, +// { 0x3D14, "" }, +// { 0x3D15, "" }, +// { 0x3D16, "" }, + { 0x3D17, "stealth_is_everything_normal" }, +// { 0x3D18, "" }, +// { 0x3D19, "" }, +// { 0x3D1A, "" }, +// { 0x3D1B, "" }, + { 0x3D1C, "stealth_default" }, +// { 0x3D1D, "" }, + { 0x3D1E, "friendly_visibility_logic" }, +// { 0x3D1F, "" }, +// { 0x3D20, "" }, +// { 0x3D21, "" }, +// { 0x3D22, "" }, +// { 0x3D23, "" }, +// { 0x3D24, "" }, + { 0x3D25, "detect_range" }, +// { 0x3D26, "" }, + { 0x3D27, "_stealth_move_detection_cap" }, +// { 0x3D28, "" }, + { 0x3D29, "friendly_getangles_ai" }, +// { 0x3D2A, "" }, + { 0x3D2B, "getstance_func" }, + { 0x3D2C, "oldstance" }, +// { 0x3D2D, "" }, +// { 0x3D2E, "" }, +// { 0x3D2F, "" }, + { 0x3D30, "movespeed_scale" }, +// { 0x3D31, "" }, +// { 0x3D32, "" }, +// { 0x3D33, "" }, +// { 0x3D34, "" }, +// { 0x3D35, "" }, + { 0x3D36, "friendly_init" }, +// { 0x3D37, "" }, +// { 0x3D38, "" }, +// { 0x3D39, "" }, + { 0x3D3A, "friendly_state_hidden" }, + { 0x3D3B, "oldgrenadeammo" }, +// { 0x3D3C, "" }, + { 0x3D3D, "friendly_spotted_getup_from_prone" }, + { 0x3D3E, "plugins" }, + { 0x3D3F, "friendly_custom_state_behavior" }, +// { 0x3D40, "" }, + { 0x3D41, "clear_animation" }, +// { 0x3D42, "" }, + { 0x3D43, "enemy_animation_nothing" }, + { 0x3D44, "enemy_animation_generic" }, + { 0x3D45, "dog_animation_generic" }, +// { 0x3D46, "" }, + { 0x3D47, "dog_animation_wakeup_slow" }, + { 0x3D48, "enemy_animation_sawcorpse" }, + { 0x3D49, "dog_animation_sawcorpse" }, +// { 0x3D4A, "" }, + { 0x3D4B, "enemy_animation_foundcorpse" }, +// { 0x3D4C, "" }, +// { 0x3D4D, "" }, +// { 0x3D4E, "" }, +// { 0x3D4F, "" }, +// { 0x3D50, "" }, + { 0x3D51, "enemy_threat_logic_dog_wait" }, +// { 0x3D52, "" }, +// { 0x3D53, "" }, +// { 0x3D54, "" }, +// { 0x3D55, "" }, + { 0x3D56, "enemy_lookaround_for_time" }, +// { 0x3D57, "" }, + { 0x3D58, "enemy_alert_level_warning1" }, + { 0x3D59, "enemy_alert_level_warning2" }, +// { 0x3D5A, "" }, + { 0x3D5B, "enemy_alert_level_attack" }, + { 0x3D5C, "enemy_close_in_on_target" }, +// { 0x3D5D, "" }, +// { 0x3D5E, "" }, +// { 0x3D5F, "" }, +// { 0x3D60, "" }, + { 0x3D61, "ai_event" }, + { 0x3D62, "enemy_default_threat_behavior" }, +// { 0x3D63, "" }, + { 0x3D64, "enemy_set_alert_level" }, + { 0x3D65, "enemy_set_threat_behavior" }, +// { 0x3D66, "" }, +// { 0x3D67, "" }, + { 0x3D68, "enemy_alert_level_change" }, +// { 0x3D69, "" }, +// { 0x3D6A, "" }, +// { 0x3D6B, "" }, +// { 0x3D6C, "" }, + { 0x3D6D, "enemy_threat_logic" }, +// { 0x3D6E, "" }, + { 0x3D6F, "enemy_alert_level_logic" }, +// { 0x3D70, "" }, +// { 0x3D71, "" }, +// { 0x3D72, "" }, +// { 0x3D73, "" }, +// { 0x3D74, "" }, + { 0x3D75, "stealth_group_corpse_flag" }, +// { 0x3D76, "" }, +// { 0x3D77, "" }, + { 0x3D78, "enemy_event_listeners_proc" }, + { 0x3D79, "enemy_event_awareness_notify" }, + { 0x3D7A, "awareness_param" }, + { 0x3D7B, "enemy_event_category_awareness" }, +// { 0x3D7C, "" }, +// { 0x3D7D, "" }, +// { 0x3D7E, "" }, + { 0x3D7F, "event_awareness_waitclear_ai" }, + { 0x3D80, "event_awareness_waitclear_ai_proc" }, +// { 0x3D81, "" }, +// { 0x3D82, "" }, + { 0x3D83, "enemy_alert_level_set_pre_spotted_func" }, + { 0x3D84, "enemy_alert_level_default_pre_spotted_func" }, + { 0x3D85, "stealth_behavior_enemy_main" }, + { 0x3D86, "enemy_animation_loop" }, +// { 0x3D87, "" }, + { 0x3D88, "enemy_state_spotted" }, +// { 0x3D89, "" }, +// { 0x3D8A, "" }, +// { 0x3D8B, "" }, + { 0x3D8C, "enemy_default_state_behavior" }, +// { 0x3D8D, "" }, +// { 0x3D8E, "" }, + { 0x3D8F, "enemy_corpse_loop" }, + { 0x3D90, "enemy_found_corpse_loop" }, +// { 0x3D91, "" }, + { 0x3D92, "enemy_saw_corpse_logic" }, + { 0x3D93, "enemy_corpse_saw_wrapper" }, +// { 0x3D94, "" }, +// { 0x3D95, "" }, + { 0x3D96, "stealth_group_corpse_flag_waitopen" }, +// { 0x3D97, "" }, + { 0x3D98, "enemy_corpse_found_behavior" }, +// { 0x3D99, "" }, +// { 0x3D9A, "" }, +// { 0x3D9B, "" }, +// { 0x3D9C, "" }, +// { 0x3D9D, "" }, + { 0x3D9E, "corpse_behavior_doesnt_require_player_sight" }, +// { 0x3D9F, "" }, +// { 0x3DA0, "" }, +// { 0x3DA1, "" }, + { 0x3DA2, "sight_distsqrd" }, + { 0x3DA3, "detect_distsqrd" }, +// { 0x3DA4, "" }, + { 0x3DA5, "enemy_corpse_found_loop" }, +// { 0x3DA6, "" }, +// { 0x3DA7, "" }, + { 0x3DA8, "reset_time" }, + { 0x3DA9, "enemy_corpse_clear" }, + { 0x3DAA, "enemy_default_corpse_anim_behavior" }, +// { 0x3DAB, "" }, + { 0x3DAC, "enemy_custom_corpse_behavior" }, +// { 0x3DAD, "" }, + { 0x3DAE, "collect_func" }, +// { 0x3DAF, "" }, +// { 0x3DB0, "" }, +// { 0x3DB1, "" }, +// { 0x3DB2, "" }, +// { 0x3DB3, "" }, + { 0x3DB4, "stealth_corpse_set_distances" }, +// { 0x3DB5, "" }, + { 0x3DB6, "stealth_corpse_set_reset_time" }, +// { 0x3DB7, "" }, +// { 0x3DB8, "" }, + { 0x3DB9, "forget_time" }, + { 0x3DBA, "stealth_corpse_set_collect_func" }, +// { 0x3DBB, "" }, +// { 0x3DBC, "" }, +// { 0x3DBD, "" }, + { 0x3DBE, "enemy_event_reaction_wrapper" }, + { 0x3DBF, "enemy_event_reaction_heard_scream" }, +// { 0x3DC0, "" }, +// { 0x3DC1, "" }, + { 0x3DC2, "enemy_event_reaction_nothing" }, + { 0x3DC3, "enemy_investigate_position" }, +// { 0x3DC4, "" }, +// { 0x3DC5, "" }, + { 0x3DC6, "stealth_event_defaults" }, +// { 0x3DC7, "" }, + { 0x3DC8, "stealth_event_anim_defaults" }, +// { 0x3DC9, "" }, +// { 0x3DCA, "" }, + { 0x3DCB, "friendly_color_spotted" }, +// { 0x3DCC, "" }, +// { 0x3DCD, "" }, +// { 0x3DCE, "" }, + { 0x3DCF, "stealth_accuracy_friendly_main" }, + { 0x3DD0, "friendly_acc_hidden" }, +// { 0x3DD1, "" }, +// { 0x3DD2, "" }, + { 0x3DD3, "old_baseaccuracy" }, +// { 0x3DD4, "" }, +// { 0x3DD5, "" }, +// { 0x3DD6, "" }, +// { 0x3DD7, "" }, + { 0x3DD8, "stealth_smartstance_friendly_main" }, +// { 0x3DD9, "" }, +// { 0x3DDA, "" }, + { 0x3DDB, "old_fixednodesaferadius" }, +// { 0x3DDC, "" }, +// { 0x3DDD, "" }, +// { 0x3DDE, "" }, + { 0x3DDF, "friendly_stance_handler_return_ai_sight" }, +// { 0x3DE0, "" }, +// { 0x3DE1, "" }, +// { 0x3DE2, "" }, +// { 0x3DE3, "" }, +// { 0x3DE4, "" }, +// { 0x3DE5, "" }, +// { 0x3DE6, "" }, + { 0x3DE7, "smartstance" }, +// { 0x3DE8, "" }, + { 0x3DE9, "friendly_set_stance_handler_distances" }, +// { 0x3DEA, "" }, + { 0x3DEB, "system_message_loop" }, + { 0x3DEC, "system_event_change" }, +// { 0x3DED, "" }, +// { 0x3DEE, "" }, + { 0x3DEF, "system_state_check_no_enemy" }, +// { 0x3DF0, "" }, +// { 0x3DF1, "" }, + { 0x3DF2, "player_grenade_check" }, + { 0x3DF3, "player_grenade_check_dieout" }, +// { 0x3DF4, "" }, +// { 0x3DF5, "" }, +// { 0x3DF6, "" }, + { 0x3DF7, "system_handle_clipbrush" }, + { 0x3DF8, "system_init" }, +// { 0x3DF9, "" }, +// { 0x3DFA, "" }, + { 0x3DFB, "system_set_detect_ranges" }, + { 0x3DFC, "system_default_event_distances" }, + { 0x3DFD, "system_set_event_distances" }, + { 0x3DFE, "stealth_set_default_stealth_function" }, +// { 0x3DFF, "" }, + { 0x3E00, "basic" }, + { 0x3E01, "stealth_basic_states_custom" }, + { 0x3E02, "stealth_basic_states_default" }, +// { 0x3E03, "" }, + { 0x3E04, "stealth_pre_spotted_function_default" }, +// { 0x3E05, "" }, + { 0x3E06, "stealth_enable_seek_player_on_spotted" }, + { 0x3E07, "stealth_disable_seek_player_on_spotted" }, + { 0x3E08, "stealth_threat_behavior_custom" }, +// { 0x3E09, "" }, + { 0x3E0A, "stealth_threat_behavior_default_no_warnings" }, +// { 0x3E0B, "" }, +// { 0x3E0C, "" }, + { 0x3E0D, "stealth_corpse_behavior_custom" }, +// { 0x3E0E, "" }, +// { 0x3E0F, "" }, +// { 0x3E10, "" }, +// { 0x3E11, "" }, +// { 0x3E12, "" }, +// { 0x3E13, "" }, +// { 0x3E14, "" }, +// { 0x3E15, "" }, +// { 0x3E16, "" }, + { 0x3E17, "stealth_plugin_event_heard_scream" }, + { 0x3E18, "stealth_plugin_event_flashbang" }, + { 0x3E19, "stealth_plugin_event_explosion" }, +// { 0x3E1A, "" }, + { 0x3E1B, "stealth_plugin_aicolor" }, + { 0x3E1C, "stealth_color_state_custom" }, + { 0x3E1D, "stealth_color_state_default" }, +// { 0x3E1E, "" }, +// { 0x3E1F, "" }, +// { 0x3E20, "" }, + { 0x3E21, "stealth_plugin_smart_stance" }, +// { 0x3E22, "" }, + { 0x3E23, "disable_stealth_smart_stance" }, +// { 0x3E24, "" }, + { 0x3E25, "stealth_enemy_endon_alert" }, +// { 0x3E26, "" }, +// { 0x3E27, "" }, + { 0x3E28, "stealth_detect_ranges_default" }, +// { 0x3E29, "" }, + { 0x3E2A, "stealth_corpse_ranges_default" }, +// { 0x3E2B, "" }, +// { 0x3E2C, "" }, + { 0x3E2D, "stealth_friendly_movespeed_scale_set" }, +// { 0x3E2E, "" }, + { 0x3E2F, "stealth_friendly_stance_handler_distances_set" }, +// { 0x3E30, "" }, +// { 0x3E31, "" }, +// { 0x3E32, "" }, +// { 0x3E33, "" }, + { 0x3E34, "do_wait_thread" }, +// { 0x3E35, "" }, + { 0x3E36, "stealth_ai_reach_idle_and_react" }, +// { 0x3E37, "" }, +// { 0x3E38, "" }, +// { 0x3E39, "" }, +// { 0x3E3A, "" }, +// { 0x3E3B, "" }, + { 0x3E3C, "stealth_group_return_groups_with_event_flag" }, + { 0x3E3D, "stealth_group_return_groups_with_corpse_flag" }, + { 0x3E3E, "stealth_group_return_ai_with_spotted_flag" }, +// { 0x3E3F, "" }, + { 0x3E40, "stealth_group_return_ai_with_corpse_flag" }, +// { 0x3E41, "" }, +// { 0x3E42, "" }, +// { 0x3E43, "" }, +// { 0x3E44, "" }, + { 0x3E45, "enable_stealth_system" }, + { 0x3E46, "disable_stealth_system" }, + { 0x3E47, "enable_stealth_for_ai" }, + { 0x3E48, "disable_stealth_for_ai" }, + { 0x3E49, "flags_init" }, +// { 0x3E4A, "" }, +// { 0x3E4B, "" }, + { 0x3E4C, "stealth_truck_think" }, +// { 0x3E4D, "" }, +// { 0x3E4E, "" }, +// { 0x3E4F, "" }, +// { 0x3E50, "" }, +// { 0x3E51, "" }, + { 0x3E52, "got_off_truck_origin" }, +// { 0x3E53, "" }, +// { 0x3E54, "" }, + { 0x3E55, "truck_guys_no_enemy_reaction_behavior" }, +// { 0x3E56, "" }, + { 0x3E57, "set_alert_cold_patrol_anims" }, +// { 0x3E58, "" }, +// { 0x3E59, "" }, + { 0x3E5A, "unload_and_attack_if_stealth_broken_and_close" }, + { 0x3E5B, "waittill_player_in_range" }, + { 0x3E5C, "truck_headlights" }, +// { 0x3E5D, "" }, +// { 0x3E5E, "" }, +// { 0x3E5F, "" }, +// { 0x3E60, "" }, +// { 0x3E61, "" }, +// { 0x3E62, "" }, +// { 0x3E63, "" }, +// { 0x3E64, "" }, + { 0x3E65, "draworigin" }, +// { 0x3E66, "" }, + { 0x3E67, "attackradius" }, + { 0x3E68, "cobrapilot_difficulty" }, +// { 0x3E69, "" }, +// { 0x3E6A, "" }, + { 0x3E6B, "missilelaunchnexttag" }, +// { 0x3E6C, "" }, +// { 0x3E6D, "" }, + { 0x3E6E, "draw_missile_target_line" }, +// { 0x3E6F, "" }, +// { 0x3E70, "" }, +// { 0x3E71, "" }, +// { 0x3E72, "" }, +// { 0x3E73, "" }, +// { 0x3E74, "" }, +// { 0x3E75, "" }, +// { 0x3E76, "" }, + { 0x3E77, "bike_score" }, + { 0x3E78, "bike_death_score" }, +// { 0x3E79, "" }, +// { 0x3E7A, "" }, +// { 0x3E7B, "" }, +// { 0x3E7C, "" }, +// { 0x3E7D, "" }, +// { 0x3E7E, "" }, + { 0x3E7F, "next_node" }, + { 0x3E80, "midpoint" }, +// { 0x3E81, "" }, + { 0x3E82, "road_width" }, + { 0x3E83, "col_volumes" }, +// { 0x3E84, "" }, +// { 0x3E85, "" }, + { 0x3E86, "draw_col_vol" }, +// { 0x3E87, "" }, +// { 0x3E88, "" }, + { 0x3E89, "prev_node" }, +// { 0x3E8A, "" }, + { 0x3E8B, "col_radiuses" }, +// { 0x3E8C, "" }, + { 0x3E8D, "dist_to_next_targs" }, +// { 0x3E8E, "" }, +// { 0x3E8F, "" }, + { 0x3E90, "get_offset_percent" }, +// { 0x3E91, "" }, +// { 0x3E92, "" }, +// { 0x3E93, "" }, +// { 0x3E94, "" }, +// { 0x3E95, "" }, +// { 0x3E96, "" }, +// { 0x3E97, "" }, +// { 0x3E98, "" }, + { 0x3E99, "vehicle_line" }, + { 0x3E9A, "spawner_random_team" }, + { 0x3E9B, "get_spawn_position" }, + { 0x3E9C, "debug_enemy_vehicles" }, +// { 0x3E9D, "" }, +// { 0x3E9E, "" }, +// { 0x3E9F, "" }, +// { 0x3EA0, "" }, + { 0x3EA1, "crash_detection" }, +// { 0x3EA2, "" }, +// { 0x3EA3, "" }, +// { 0x3EA4, "" }, +// { 0x3EA5, "" }, + { 0x3EA6, "bike_drives_path" }, +// { 0x3EA7, "" }, +// { 0x3EA8, "" }, + { 0x3EA9, "bike" }, + { 0x3EAA, "progress_targ" }, + { 0x3EAB, "offset_modifier" }, +// { 0x3EAC, "" }, +// { 0x3EAD, "" }, +// { 0x3EAE, "" }, +// { 0x3EAF, "" }, + { 0x3EB0, "get_obstacle_dodge_amount" }, +// { 0x3EB1, "" }, +// { 0x3EB2, "" }, + { 0x3EB3, "difference" }, +// { 0x3EB4, "" }, +// { 0x3EB5, "" }, +// { 0x3EB6, "" }, + { 0x3EB7, "price_match_player_speed" }, + { 0x3EB8, "price_desired_speed" }, +// { 0x3EB9, "" }, + { 0x3EBA, "track_player_progress" }, + { 0x3EBB, "closest_enemy_snowmobile_to_player" }, + { 0x3EBC, "set_bike_position" }, +// { 0x3EBD, "" }, +// { 0x3EBE, "" }, +// { 0x3EBF, "" }, + { 0x3EC0, "get_position_from_spline_unlimited" }, + { 0x3EC1, "get_position_from_spline" }, + { 0x3EC2, "get_position_from_progress" }, +// { 0x3EC3, "" }, +// { 0x3EC4, "" }, + { 0x3EC5, "track_progress" }, +// { 0x3EC6, "" }, +// { 0x3EC7, "" }, + { 0x3EC8, "right_offset" }, +// { 0x3EC9, "" }, + { 0x3ECA, "bike_avoids_obstacles" }, +// { 0x3ECB, "" }, +// { 0x3ECC, "" }, + { 0x3ECD, "dodge_dir" }, + { 0x3ECE, "should_stabilize" }, + { 0x3ECF, "bike_turns" }, + { 0x3ED0, "tilt" }, +// { 0x3ED1, "" }, +// { 0x3ED2, "" }, +// { 0x3ED3, "" }, +// { 0x3ED4, "" }, +// { 0x3ED5, "" }, + { 0x3ED6, "debug_bike_line" }, +// { 0x3ED7, "" }, +// { 0x3ED8, "" }, +// { 0x3ED9, "" }, + { 0x3EDA, "oldthreatbias" }, +// { 0x3EDB, "" }, + { 0x3EDC, "vehiclehud2" }, +// { 0x3EDD, "" }, + { 0x3EDE, "vehicle_enter" }, +// { 0x3EDF, "" }, + { 0x3EE0, "setup_vehicle_other" }, +// { 0x3EE1, "" }, +// { 0x3EE2, "" }, + { 0x3EE3, "vehicle_ridehandle" }, +// { 0x3EE4, "" }, +// { 0x3EE5, "" }, +// { 0x3EE6, "" }, +// { 0x3EE7, "" }, + { 0x3EE8, "vehicle_reloadsound" }, +// { 0x3EE9, "" }, +// { 0x3EEA, "" }, + { 0x3EEB, "ambient_modifier" }, + { 0x3EEC, "rainmedium" }, + { 0x3EED, "rainlight" }, + { 0x3EEE, "rainnone" }, +// { 0x3EEF, "" }, +// { 0x3EF0, "" }, + { 0x3EF1, "lightning" }, +// { 0x3EF2, "" }, +// { 0x3EF3, "" }, +// { 0x3EF4, "" }, + { 0x3EF5, "lightningexploderindex" }, +// { 0x3EF6, "" }, + { 0x3EF7, "rainlevelrandomwait" }, +// { 0x3EF8, "" }, +// { 0x3EF9, "" }, +// { 0x3EFA, "" }, +// { 0x3EFB, "" }, +// { 0x3EFC, "" }, + { 0x3EFD, "thunder" }, +// { 0x3EFE, "" }, +// { 0x3EFF, "" }, +// { 0x3F00, "" }, + { 0x3F01, "go" }, + { 0x3F02, "small_gibs" }, +// { 0x3F03, "" }, + { 0x3F04, "so_msg_handler" }, +// { 0x3F05, "" }, +// { 0x3F06, "" }, +// { 0x3F07, "" }, +// { 0x3F08, "" }, +// { 0x3F09, "" }, +// { 0x3F0A, "" }, +// { 0x3F0B, "" }, + { 0x3F0C, "aud_run_tank_system" }, +// { 0x3F0D, "" }, +// { 0x3F0E, "" }, + { 0x3F0F, "envs" }, + { 0x3F10, "aud_create_drive_envs" }, + { 0x3F11, "aud_ground_veh_deathwatch" }, +// { 0x3F12, "" }, + { 0x3F13, "aud_fade_loop_out_and_delete_temp" }, +// { 0x3F14, "" }, +// { 0x3F15, "" }, + { 0x3F16, "so_mission_min_time" }, +// { 0x3F17, "" }, + { 0x3F18, "achieve_strike" }, + { 0x3F19, "achieve_jack_the_ripper" }, +// { 0x3F1A, "" }, +// { 0x3F1B, "" }, +// { 0x3F1C, "" }, +// { 0x3F1D, "" }, +// { 0x3F1E, "" }, + { 0x3F1F, "character/character_opforce_rushwood_assault_a" }, +// { 0x3F20, "" }, +// { 0x3F21, "" }, +// { 0x3F22, "" }, +// { 0x3F23, "" }, +// { 0x3F24, "" }, + { 0x3F25, "radio_dialogue_queue_single" }, + { 0x3F26, "dialogue_queue_single" }, + { 0x3F27, "dialogue_random_line" }, +// { 0x3F28, "" }, +// { 0x3F29, "" }, +// { 0x3F2A, "" }, +// { 0x3F2B, "" }, + { 0x3F2C, "ignore_suppression_trigger_ai_think" }, +// { 0x3F2D, "" }, +// { 0x3F2E, "" }, + { 0x3F2F, "clear_hints" }, + { 0x3F30, "hintelem" }, +// { 0x3F31, "" }, + { 0x3F32, "iconelem2" }, + { 0x3F33, "iconelem3" }, +// { 0x3F34, "" }, + { 0x3F35, "high_priority_hint" }, +// { 0x3F36, "" }, +// { 0x3F37, "" }, +// { 0x3F38, "" }, +// { 0x3F39, "" }, +// { 0x3F3A, "" }, +// { 0x3F3B, "" }, +// { 0x3F3C, "" }, +// { 0x3F3D, "" }, + { 0x3F3E, "playengineeffects" }, +// { 0x3F3F, "" }, +// { 0x3F40, "" }, + { 0x3F41, "playcontrail12" }, +// { 0x3F42, "" }, +// { 0x3F43, "" }, +// { 0x3F44, "" }, +// { 0x3F45, "" }, +// { 0x3F46, "" }, +// { 0x3F47, "" }, + { 0x3F48, "player_animations" }, + { 0x3F49, "setup_shg_fx" }, +// { 0x3F4A, "" }, + { 0x3F4B, "getentsbyfxid" }, + { 0x3F4C, "pauseexploders" }, +// { 0x3F4D, "" }, + { 0x3F4E, "restartfxid" }, +// { 0x3F4F, "" }, +// { 0x3F50, "" }, + { 0x3F51, "vec3_mult_matrix33" }, +// { 0x3F52, "" }, +// { 0x3F53, "" }, +// { 0x3F54, "" }, +// { 0x3F55, "" }, + { 0x3F56, "spawn_tendril" }, +// { 0x3F57, "" }, +// { 0x3F58, "" }, +// { 0x3F59, "" }, +// { 0x3F5A, "" }, +// { 0x3F5B, "" }, +// { 0x3F5C, "" }, + { 0x3F5D, "g_visionexit" }, + { 0x3F5E, "g_visiondefault" }, +// { 0x3F5F, "" }, +// { 0x3F60, "" }, + { 0x3F61, "vision_zone_manager" }, + { 0x3F62, "fx_zone_watcher" }, +// { 0x3F63, "" }, +// { 0x3F64, "" }, +// { 0x3F65, "" }, +// { 0x3F66, "" }, +// { 0x3F67, "" }, +// { 0x3F68, "" }, +// { 0x3F69, "" }, +// { 0x3F6A, "" }, +// { 0x3F6B, "" }, +// { 0x3F6C, "" }, +// { 0x3F6D, "" }, +// { 0x3F6E, "" }, + { 0x3F6F, "get_exploder_entarray" }, + { 0x3F70, "fx_spot_lens_flare_tag" }, +// { 0x3F71, "" }, + { 0x3F72, "get_exploder_pos" }, + { 0x3F73, "create_exploders_fromlist" }, +// { 0x3F74, "" }, + { 0x3F75, "setup_fx_chain" }, +// { 0x3F76, "" }, + { 0x3F77, "kill_fx_on_chain" }, +// { 0x3F78, "" }, +// { 0x3F79, "" }, +// { 0x3F7A, "" }, +// { 0x3F7B, "" }, +// { 0x3F7C, "" }, +// { 0x3F7D, "" }, +// { 0x3F7E, "" }, + { 0x3F7F, "enable_fx_bombshake_duck" }, +// { 0x3F80, "" }, +// { 0x3F81, "" }, +// { 0x3F82, "" }, +// { 0x3F83, "" }, + { 0x3F84, "aud_register_trigger_callbacks" }, +// { 0x3F85, "" }, + { 0x3F86, "mus_steffanys_combat_start_e3demo_itiot" }, + { 0x3F87, "player_hind" }, + { 0x3F88, "entered_15_broadway" }, +// { 0x3F89, "" }, +// { 0x3F8A, "" }, +// { 0x3F8B, "" }, +// { 0x3F8C, "" }, +// { 0x3F8D, "" }, +// { 0x3F8E, "" }, + { 0x3F8F, "music_cue" }, + { 0x3F90, "music_msg_handler" }, +// { 0x3F91, "" }, +// { 0x3F92, "" }, + { 0x3F93, "mus_stock_exchange_lobby" }, +// { 0x3F94, "" }, +// { 0x3F95, "" }, +// { 0x3F96, "" }, +// { 0x3F97, "" }, +// { 0x3F98, "" }, + { 0x3F99, "aud_mus_between_tiffs_and_stock_exchange" }, +// { 0x3F9A, "" }, + { 0x3F9B, "aud_mus_player_enters_hind" }, +// { 0x3F9C, "" }, +// { 0x3F9D, "" }, + { 0x3F9E, "aud_blownout_heli_mix_progress" }, +// { 0x3F9F, "" }, + { 0x3FA0, "aud_nymn_intro_start" }, +// { 0x3FA1, "" }, +// { 0x3FA2, "" }, + { 0x3FA3, "aud_missile_explode_watch" }, + { 0x3FA4, "aud_ny_predator_explode" }, + { 0x3FA5, "aud_remote_missile_watch" }, +// { 0x3FA6, "" }, +// { 0x3FA7, "" }, +// { 0x3FA8, "" }, + { 0x3FA9, "stryker_revd" }, +// { 0x3FAA, "" }, +// { 0x3FAB, "" }, + { 0x3FAC, "vehicle_oneshots" }, + { 0x3FAD, "aud_ent_fade_out" }, +// { 0x3FAE, "" }, + { 0x3FAF, "aud_ground_vehicle_deathwatch" }, +// { 0x3FB0, "" }, +// { 0x3FB1, "" }, +// { 0x3FB2, "" }, +// { 0x3FB3, "" }, + { 0x3FB4, "aud_15_broad_flourescent_lights" }, + { 0x3FB5, "aud_briefing_done" }, +// { 0x3FB6, "" }, + { 0x3FB7, "bink_ents" }, +// { 0x3FB8, "" }, + { 0x3FB9, "aud_play_tv_syncd" }, +// { 0x3FBA, "" }, +// { 0x3FBB, "" }, + { 0x3FBC, "aud_15th_broad_gasoline_spilling" }, +// { 0x3FBD, "" }, +// { 0x3FBE, "" }, +// { 0x3FBF, "" }, +// { 0x3FC0, "" }, + { 0x3FC1, "aud_intro_taxi_engine_steam" }, + { 0x3FC2, "aud_street_flares" }, + { 0x3FC3, "aud_start_flies_in_dumpsters" }, +// { 0x3FC4, "" }, +// { 0x3FC5, "" }, + { 0x3FC6, "jam_ent_l" }, + { 0x3FC7, "jam_ent_r" }, +// { 0x3FC8, "" }, +// { 0x3FC9, "" }, + { 0x3FCA, "aud_mus_jamming_tower_distance_mix_thread" }, + { 0x3FCB, "aud_explode_jamming_tower" }, +// { 0x3FCC, "" }, +// { 0x3FCD, "" }, +// { 0x3FCE, "" }, +// { 0x3FCF, "" }, + { 0x3FD0, "aud_hind_kill" }, +// { 0x3FD1, "" }, +// { 0x3FD2, "" }, +// { 0x3FD3, "" }, +// { 0x3FD4, "" }, +// { 0x3FD5, "" }, +// { 0x3FD6, "" }, +// { 0x3FD7, "" }, + { 0x3FD8, "is_firing" }, +// { 0x3FD9, "" }, +// { 0x3FDA, "" }, +// { 0x3FDB, "" }, +// { 0x3FDC, "" }, +// { 0x3FDD, "" }, +// { 0x3FDE, "" }, + { 0x3FDF, "hind_missile_audio_control" }, + { 0x3FE0, "contact_explode" }, + { 0x3FE1, "xm25_monitor" }, + { 0x3FE2, "xm25_destroy_hud" }, + { 0x3FE3, "data_value" }, +// { 0x3FE4, "" }, +// { 0x3FE5, "" }, +// { 0x3FE6, "" }, + { 0x3FE7, "watchweaponswitch" }, +// { 0x3FE8, "" }, + { 0x3FE9, "weapon_change_timer" }, +// { 0x3FEA, "" }, +// { 0x3FEB, "" }, +// { 0x3FEC, "" }, +// { 0x3FED, "" }, +// { 0x3FEE, "" }, +// { 0x3FEF, "" }, +// { 0x3FF0, "" }, + { 0x3FF1, "show_range" }, +// { 0x3FF2, "" }, + { 0x3FF3, "watchproximityairburstfire" }, +// { 0x3FF4, "" }, + { 0x3FF5, "airburst" }, + { 0x3FF6, "in_proximity_loop" }, +// { 0x3FF7, "" }, + { 0x3FF8, "create_hud_xm25_screen" }, + { 0x3FF9, "create_hud_xm25_scanlines" }, +// { 0x3FFA, "" }, +// { 0x3FFB, "" }, +// { 0x3FFC, "" }, + { 0x3FFD, "lastpathnode" }, +// { 0x3FFE, "" }, +// { 0x3FFF, "" }, + { 0x4000, "smooth_vehicle_path_set_lookahead" }, +// { 0x4001, "" }, +// { 0x4002, "" }, +// { 0x4003, "" }, +// { 0x4004, "" }, +// { 0x4005, "" }, +// { 0x4006, "" }, +// { 0x4007, "" }, + { 0x4008, "smooth_vehicle_path_cleartargetyaw" }, + { 0x4009, "smooth_vehicle_debug_node" }, + { 0x400A, "ny_start_heli_path" }, + { 0x400B, "curpathstart" }, + { 0x400C, "test_if_smooth_path" }, +// { 0x400D, "" }, + { 0x400E, "curnode_set" }, +// { 0x400F, "" }, +// { 0x4010, "" }, +// { 0x4011, "" }, +// { 0x4012, "" }, + { 0x4013, "smooth_decel" }, +// { 0x4014, "" }, +// { 0x4015, "" }, +// { 0x4016, "" }, +// { 0x4017, "" }, +// { 0x4018, "" }, +// { 0x4019, "" }, +// { 0x401A, "" }, + { 0x401B, "set_usevelang" }, +// { 0x401C, "" }, +// { 0x401D, "" }, + { 0x401E, "follow_enemy_vehicle_thats_using_smoothpath" }, +// { 0x401F, "" }, +// { 0x4020, "" }, +// { 0x4021, "" }, +// { 0x4022, "" }, + { 0x4023, "bezier_vehicle_path" }, +// { 0x4024, "" }, +// { 0x4025, "" }, +// { 0x4026, "" }, +// { 0x4027, "" }, +// { 0x4028, "" }, + { 0x4029, "trackentity" }, + { 0x402A, "startdebugpath" }, +// { 0x402B, "" }, + { 0x402C, "stopdebugpath" }, +// { 0x402D, "" }, + { 0x402E, "adddebugpoint" }, +// { 0x402F, "" }, +// { 0x4030, "" }, +// { 0x4031, "" }, + { 0x4032, "debugcatchhits" }, + { 0x4033, "debug_health_recs" }, + { 0x4034, "debughindhealth" }, + { 0x4035, "nym_burst_fire_settings" }, + { 0x4036, "nym_cleanup_tt" }, +// { 0x4037, "" }, + { 0x4038, "nym_hind_turret_target_around_player" }, +// { 0x4039, "" }, +// { 0x403A, "" }, +// { 0x403B, "" }, +// { 0x403C, "" }, +// { 0x403D, "" }, +// { 0x403E, "" }, +// { 0x403F, "" }, +// { 0x4040, "" }, +// { 0x4041, "" }, +// { 0x4042, "" }, +// { 0x4043, "" }, +// { 0x4044, "" }, +// { 0x4045, "" }, + { 0x4046, "set_idle" }, +// { 0x4047, "" }, +// { 0x4048, "" }, + { 0x4049, "hide_hands" }, +// { 0x404A, "" }, +// { 0x404B, "" }, +// { 0x404C, "" }, + { 0x404D, "firebuttonpressed" }, +// { 0x404E, "" }, + { 0x404F, "player_viewhands_minigun_presed" }, +// { 0x4050, "" }, +// { 0x4051, "" }, +// { 0x4052, "" }, +// { 0x4053, "" }, + { 0x4054, "player_on_minigun" }, + { 0x4055, "minigun_rumble" }, +// { 0x4056, "" }, + { 0x4057, "rumble_ent" }, + { 0x4058, "minigun_fire_sounds" }, + { 0x4059, "allowedtofire" }, +// { 0x405A, "" }, +// { 0x405B, "" }, + { 0x405C, "minigun_used" }, + { 0x405D, "frames" }, +// { 0x405E, "" }, +// { 0x405F, "" }, + { 0x4060, "enable_turret_fire" }, +// { 0x4061, "" }, +// { 0x4062, "" }, +// { 0x4063, "" }, + { 0x4064, "minigun_hints_on" }, + { 0x4065, "minigunhintspin" }, + { 0x4066, "minigunhintfire" }, + { 0x4067, "hintbackground1" }, + { 0x4068, "hintbackground2" }, +// { 0x4069, "" }, + { 0x406A, "spinup_ny_harbor_hind" }, + { 0x406B, "landed_blades" }, + { 0x406C, "flying_blades_tag" }, + { 0x406D, "fix_hind_doors" }, + { 0x406E, "retract_landing_gear" }, + { 0x406F, "swap_hind_guns" }, +// { 0x4070, "" }, +// { 0x4071, "" }, +// { 0x4072, "" }, + { 0x4073, "hind_tvm" }, +// { 0x4074, "" }, + { 0x4075, "onheli" }, + { 0x4076, "setup_turret_with_viewmodel" }, +// { 0x4077, "" }, +// { 0x4078, "" }, +// { 0x4079, "" }, +// { 0x407A, "" }, + { 0x407B, "lerp_on" }, +// { 0x407C, "" }, + { 0x407D, "viewhands" }, +// { 0x407E, "" }, + { 0x407F, "is_occupied" }, +// { 0x4080, "" }, +// { 0x4081, "" }, +// { 0x4082, "" }, + { 0x4083, "turret_viewmodel_model" }, + { 0x4084, "hindgun_fire" }, +// { 0x4085, "" }, +// { 0x4086, "" }, +// { 0x4087, "" }, +// { 0x4088, "" }, +// { 0x4089, "" }, +// { 0x408A, "" }, +// { 0x408B, "" }, + { 0x408C, "animate_turret_with_viewmodel" }, + { 0x408D, "hands_animation" }, + { 0x408E, "gun_animation" }, + { 0x408F, "adjusthindplayersviewarcs" }, + { 0x4090, "right_view_arc" }, + { 0x4091, "left_view_arc" }, + { 0x4092, "top_view_arc" }, + { 0x4093, "bottom_view_arc" }, + { 0x4094, "kill_aircraft_dust" }, +// { 0x4095, "" }, +// { 0x4096, "" }, +// { 0x4097, "" }, +// { 0x4098, "" }, +// { 0x4099, "" }, +// { 0x409A, "" }, + { 0x409B, "hide_hind_wing" }, +// { 0x409C, "" }, +// { 0x409D, "" }, +// { 0x409E, "" }, +// { 0x409F, "" }, +// { 0x40A0, "" }, +// { 0x40A1, "" }, +// { 0x40A2, "" }, +// { 0x40A3, "" }, +// { 0x40A4, "" }, + { 0x40A5, "squad_ignoreme_off" }, + { 0x40A6, "define_squad_leader" }, +// { 0x40A7, "" }, +// { 0x40A8, "" }, +// { 0x40A9, "" }, + { 0x40AA, "reno" }, +// { 0x40AB, "" }, +// { 0x40AC, "" }, +// { 0x40AD, "" }, +// { 0x40AE, "" }, +// { 0x40AF, "" }, +// { 0x40B0, "" }, +// { 0x40B1, "" }, + { 0x40B2, "path_squad_to_destroyed_building" }, +// { 0x40B3, "" }, +// { 0x40B4, "" }, +// { 0x40B5, "" }, +// { 0x40B6, "" }, + { 0x40B7, "monitor_player_first_shot" }, +// { 0x40B8, "" }, +// { 0x40B9, "" }, +// { 0x40BA, "" }, +// { 0x40BB, "" }, +// { 0x40BC, "" }, +// { 0x40BD, "" }, +// { 0x40BE, "" }, +// { 0x40BF, "" }, + { 0x40C0, "first_combat_backup_02" }, +// { 0x40C1, "" }, +// { 0x40C2, "" }, +// { 0x40C3, "" }, +// { 0x40C4, "" }, + { 0x40C5, "hint_hybrid" }, +// { 0x40C6, "" }, +// { 0x40C7, "" }, + { 0x40C8, "truck" }, +// { 0x40C9, "" }, + { 0x40CA, "broad_hind_strafe" }, +// { 0x40CB, "" }, +// { 0x40CC, "" }, +// { 0x40CD, "" }, +// { 0x40CE, "" }, +// { 0x40CF, "" }, +// { 0x40D0, "" }, +// { 0x40D1, "" }, +// { 0x40D2, "" }, +// { 0x40D3, "" }, +// { 0x40D4, "" }, +// { 0x40D5, "" }, + { 0x40D6, "waste_bankers" }, +// { 0x40D7, "" }, +// { 0x40D8, "" }, + { 0x40D9, "wait_for_intro_missile_to_hit" }, +// { 0x40DA, "" }, + { 0x40DB, "intro_stryker" }, + { 0x40DC, "broad_stryker02" }, + { 0x40DD, "stryker_think" }, + { 0x40DE, "strykers" }, + { 0x40DF, "intro_stryker_monitor_player_distance" }, +// { 0x40E0, "" }, +// { 0x40E1, "" }, + { 0x40E2, "stryker_shoot" }, + { 0x40E3, "vehicle_path_disconnect" }, + { 0x40E4, "intro_gazcrash" }, +// { 0x40E5, "" }, +// { 0x40E6, "" }, +// { 0x40E7, "" }, +// { 0x40E8, "" }, + { 0x40E9, "broad_hind_timer" }, +// { 0x40EA, "" }, +// { 0x40EB, "" }, + { 0x40EC, "broad_hind_think" }, + { 0x40ED, "can_shoot" }, +// { 0x40EE, "" }, +// { 0x40EF, "" }, +// { 0x40F0, "" }, +// { 0x40F1, "" }, + { 0x40F2, "gaz_entrance_guys_go" }, + { 0x40F3, "rubble_enemy_entrance_anim" }, + { 0x40F4, "gaz_entrance_guy1_think" }, +// { 0x40F5, "" }, +// { 0x40F6, "" }, +// { 0x40F7, "" }, + { 0x40F8, "vfx_door_kick" }, + { 0x40F9, "cleanup_ai" }, +// { 0x40FA, "" }, + { 0x40FB, "catch_broad_hind_first_shot" }, + { 0x40FC, "broad_stryker_monitor" }, +// { 0x40FD, "" }, +// { 0x40FE, "" }, + { 0x40FF, "hummer_intro" }, + { 0x4100, "humvee_intro_missiles" }, +// { 0x4101, "" }, +// { 0x4102, "" }, +// { 0x4103, "" }, +// { 0x4104, "" }, + { 0x4105, "getadsbinding" }, + { 0x4106, "handle_ads_hint" }, + { 0x4107, "first_combat" }, + { 0x4108, "broad_humvee_02" }, +// { 0x4109, "" }, + { 0x410A, "fc_delay_kill" }, +// { 0x410B, "" }, +// { 0x410C, "" }, + { 0x410D, "monitor_hint_xm25" }, +// { 0x410E, "" }, +// { 0x410F, "" }, + { 0x4110, "enable_awareness" }, + { 0x4111, "suppressionwait_old" }, + { 0x4112, "disable_awareness" }, +// { 0x4113, "" }, +// { 0x4114, "" }, +// { 0x4115, "" }, + { 0x4116, "player_backtrack_fail_setup" }, +// { 0x4117, "" }, +// { 0x4118, "" }, +// { 0x4119, "" }, + { 0x411A, "tv_cinematic_think_broad" }, + { 0x411B, "tv_cinematic_think_nyse" }, +// { 0x411C, "" }, +// { 0x411D, "" }, +// { 0x411E, "" }, +// { 0x411F, "" }, +// { 0x4120, "" }, + { 0x4121, "multiple_c4" }, +// { 0x4122, "" }, + { 0x4123, "c4_count" }, +// { 0x4124, "" }, +// { 0x4125, "" }, +// { 0x4126, "" }, +// { 0x4127, "" }, + { 0x4128, "remove_detonator" }, +// { 0x4129, "" }, +// { 0x412A, "" }, +// { 0x412B, "" }, +// { 0x412C, "" }, +// { 0x412D, "" }, + { 0x412E, "tiff_guys" }, + { 0x412F, "lonely_guys" }, +// { 0x4130, "" }, +// { 0x4131, "" }, +// { 0x4132, "" }, +// { 0x4133, "" }, +// { 0x4134, "" }, + { 0x4135, "tiff_color_progression" }, +// { 0x4136, "" }, + { 0x4137, "tiff_battle_progression" }, +// { 0x4138, "" }, +// { 0x4139, "" }, + { 0x413A, "battle_flava" }, +// { 0x413B, "" }, +// { 0x413C, "" }, + { 0x413D, "delta2_leader" }, + { 0x413E, "dialog_anvil_wall" }, +// { 0x413F, "" }, + { 0x4140, "tiff_sandman_moveout" }, +// { 0x4141, "" }, + { 0x4142, "reno_tiff_shooters_below" }, +// { 0x4143, "" }, +// { 0x4144, "" }, +// { 0x4145, "" }, +// { 0x4146, "" }, +// { 0x4147, "" }, +// { 0x4148, "" }, + { 0x4149, "nyse_reset_ally_colors" }, +// { 0x414A, "" }, +// { 0x414B, "" }, +// { 0x414C, "" }, +// { 0x414D, "" }, +// { 0x414E, "" }, +// { 0x414F, "" }, +// { 0x4150, "" }, + { 0x4151, "exit_animscripted_on_flashbang" }, +// { 0x4152, "" }, +// { 0x4153, "" }, + { 0x4154, "nyse_rooftop_hind" }, + { 0x4155, "balcony_guys" }, +// { 0x4156, "" }, +// { 0x4157, "" }, +// { 0x4158, "" }, + { 0x4159, "jammer_monitor" }, +// { 0x415A, "" }, +// { 0x415B, "" }, +// { 0x415C, "" }, +// { 0x415D, "" }, +// { 0x415E, "" }, +// { 0x415F, "" }, +// { 0x4160, "" }, +// { 0x4161, "" }, + { 0x4162, "jammer_thermite_burn_player" }, +// { 0x4163, "" }, + { 0x4164, "jammer_enemies_fake_death" }, +// { 0x4165, "" }, + { 0x4166, "hint_thermite_switch" }, +// { 0x4167, "" }, +// { 0x4168, "" }, +// { 0x4169, "" }, +// { 0x416A, "" }, + { 0x416B, "predator_defend" }, +// { 0x416C, "" }, +// { 0x416D, "" }, +// { 0x416E, "" }, +// { 0x416F, "" }, + { 0x4170, "enemy_predator_01_nodes" }, +// { 0x4171, "" }, +// { 0x4172, "" }, +// { 0x4173, "" }, + { 0x4174, "dialog_predator_nag" }, + { 0x4175, "enemy_predator_01_assign" }, +// { 0x4176, "" }, +// { 0x4177, "" }, +// { 0x4178, "" }, +// { 0x4179, "" }, + { 0x417A, "predator_hind" }, +// { 0x417B, "" }, + { 0x417C, "preferred_crash_location" }, +// { 0x417D, "" }, +// { 0x417E, "" }, +// { 0x417F, "" }, + { 0x4180, "predator_monitor" }, +// { 0x4181, "" }, +// { 0x4182, "" }, +// { 0x4183, "" }, +// { 0x4184, "" }, + { 0x4185, "nyse_balcony" }, +// { 0x4186, "" }, +// { 0x4187, "" }, +// { 0x4188, "" }, +// { 0x4189, "" }, +// { 0x418A, "" }, +// { 0x418B, "" }, +// { 0x418C, "" }, +// { 0x418D, "" }, +// { 0x418E, "" }, +// { 0x418F, "" }, + { 0x4190, "give_player_predator_drone" }, +// { 0x4191, "" }, +// { 0x4192, "" }, + { 0x4193, "monitor_reaper_usage" }, +// { 0x4194, "" }, +// { 0x4195, "" }, + { 0x4196, "uavrigaiming" }, + { 0x4197, "e3demo_skip_forward" }, + { 0x4198, "e3demo_gaz" }, +// { 0x4199, "" }, +// { 0x419A, "" }, +// { 0x419B, "" }, +// { 0x419C, "" }, +// { 0x419D, "" }, + { 0x419E, "get_vehicle_health" }, +// { 0x419F, "" }, +// { 0x41A0, "" }, +// { 0x41A1, "" }, +// { 0x41A2, "" }, +// { 0x41A3, "" }, + { 0x41A4, "scr_tag" }, + { 0x41A5, "start_squad_on_hind" }, + { 0x41A6, "squad_on_hind" }, +// { 0x41A7, "" }, + { 0x41A8, "ny_heli_crash_locations" }, +// { 0x41A9, "" }, +// { 0x41AA, "" }, +// { 0x41AB, "" }, +// { 0x41AC, "" }, + { 0x41AD, "random_kill_vo_lines" }, + { 0x41AE, "random_kill_vo_index" }, +// { 0x41AF, "" }, + { 0x41B0, "debug_temp" }, + { 0x41B1, "create_attractor" }, + { 0x41B2, "player_head_attractor" }, +// { 0x41B3, "" }, +// { 0x41B4, "" }, + { 0x41B5, "missile_stop" }, + { 0x41B6, "hold_attractor" }, + { 0x41B7, "shoot_scripted" }, + { 0x41B8, "force_shoot" }, +// { 0x41B9, "" }, +// { 0x41BA, "" }, +// { 0x41BB, "" }, +// { 0x41BC, "" }, +// { 0x41BD, "" }, +// { 0x41BE, "" }, +// { 0x41BF, "" }, +// { 0x41C0, "" }, + { 0x41C1, "look_at_cleanup" }, +// { 0x41C2, "" }, +// { 0x41C3, "" }, +// { 0x41C4, "" }, + { 0x41C5, "view_logic_encounter2" }, + { 0x41C6, "view_logic_encounter3" }, +// { 0x41C7, "" }, + { 0x41C8, "view_logic_encounter5" }, + { 0x41C9, "view_logic_encounter6" }, +// { 0x41CA, "" }, +// { 0x41CB, "" }, + { 0x41CC, "bring_the_pain" }, + { 0x41CD, "isdemo" }, + { 0x41CE, "hind_battle_hind06b" }, +// { 0x41CF, "" }, +// { 0x41D0, "" }, +// { 0x41D1, "" }, + { 0x41D2, "draw_crash_locations" }, + { 0x41D3, "monitor_for_safe_crash_location" }, +// { 0x41D4, "" }, + { 0x41D5, "sec_offset" }, +// { 0x41D6, "" }, +// { 0x41D7, "" }, +// { 0x41D8, "" }, +// { 0x41D9, "" }, +// { 0x41DA, "" }, +// { 0x41DB, "" }, +// { 0x41DC, "" }, +// { 0x41DD, "" }, +// { 0x41DE, "" }, +// { 0x41DF, "" }, +// { 0x41E0, "" }, +// { 0x41E1, "" }, +// { 0x41E2, "" }, +// { 0x41E3, "" }, +// { 0x41E4, "" }, +// { 0x41E5, "" }, + { 0x41E6, "playerpath" }, +// { 0x41E7, "" }, + { 0x41E8, "setups_shooter_scene" }, + { 0x41E9, "hind_battle_hind02b" }, + { 0x41EA, "hind_battle_hind02" }, +// { 0x41EB, "" }, + { 0x41EC, "stealthy_kill_logic" }, +// { 0x41ED, "" }, +// { 0x41EE, "" }, +// { 0x41EF, "" }, +// { 0x41F0, "" }, +// { 0x41F1, "" }, +// { 0x41F2, "" }, + { 0x41F3, "final_chase_sequence" }, + { 0x41F4, "hind_battle_hind03c" }, + { 0x41F5, "construction_building_battle" }, +// { 0x41F6, "" }, +// { 0x41F7, "" }, +// { 0x41F8, "" }, +// { 0x41F9, "" }, + { 0x41FA, "construction_building_enemy_phase_2" }, + { 0x41FB, "pause_helicopter" }, + { 0x41FC, "pause_helicopter_until" }, +// { 0x41FD, "" }, + { 0x41FE, "player_enter_hind" }, +// { 0x41FF, "" }, +// { 0x4200, "" }, +// { 0x4201, "" }, + { 0x4202, "show_pos" }, + { 0x4203, "show_axis" }, + { 0x4204, "show_ent_pos" }, +// { 0x4205, "" }, + { 0x4206, "debug_txt_y" }, +// { 0x4207, "" }, +// { 0x4208, "" }, +// { 0x4209, "" }, + { 0x420A, "blur_from_collision" }, + { 0x420B, "hideenemyhindaftercrash" }, +// { 0x420C, "" }, + { 0x420D, "just_finale" }, +// { 0x420E, "" }, +// { 0x420F, "" }, +// { 0x4210, "" }, +// { 0x4211, "" }, + { 0x4212, "do_movie_fadein" }, +// { 0x4213, "" }, + { 0x4214, "ending_fadeout_nextmission" }, +// { 0x4215, "" }, +// { 0x4216, "" }, + { 0x4217, "switch_cool_damage" }, +// { 0x4218, "" }, + { 0x4219, "kill_enemy_hind_cool_damage_effects" }, + { 0x421A, "enemy_hind_cool_damage_effects" }, +// { 0x421B, "" }, +// { 0x421C, "" }, + { 0x421D, "flash_black_blur" }, + { 0x421E, "exp_fade_overlay" }, +// { 0x421F, "" }, + { 0x4220, "black_overlay" }, +// { 0x4221, "" }, +// { 0x4222, "" }, +// { 0x4223, "" }, +// { 0x4224, "" }, +// { 0x4225, "" }, +// { 0x4226, "" }, + { 0x4227, "hind_ride_shadow_vals" }, +// { 0x4228, "" }, + { 0x4229, "stryker_exhaust_tread" }, +// { 0x422A, "" }, + { 0x422B, "signal_debris_atplayer" }, +// { 0x422C, "" }, + { 0x422D, "signal_tower_misc_explosions" }, +// { 0x422E, "" }, +// { 0x422F, "" }, +// { 0x4230, "" }, +// { 0x4231, "" }, + { 0x4232, "signal_tower_climbing_elec" }, +// { 0x4233, "" }, +// { 0x4234, "" }, +// { 0x4235, "" }, + { 0x4236, "init_screffects" }, +// { 0x4237, "" }, + { 0x4238, "start_man_hindexplosions" }, + { 0x4239, "heli_strafe_light" }, +// { 0x423A, "" }, + { 0x423B, "hind_toggle_dlights" }, +// { 0x423C, "" }, +// { 0x423D, "" }, +// { 0x423E, "" }, +// { 0x423F, "" }, + { 0x4240, "do_window_glass" }, + { 0x4241, "launch_taxi_guy" }, +// { 0x4242, "" }, +// { 0x4243, "" }, +// { 0x4244, "" }, +// { 0x4245, "" }, + { 0x4246, "do_hit_contrast" }, + { 0x4247, "chunk_blur" }, +// { 0x4248, "" }, + { 0x4249, "do_chunk_anim" }, +// { 0x424A, "" }, + { 0x424B, "exchnage_missile_prehit" }, +// { 0x424C, "" }, +// { 0x424D, "" }, + { 0x424E, "start_man_landexplosions" }, + { 0x424F, "start_amb_window_exp" }, +// { 0x4250, "" }, +// { 0x4251, "" }, +// { 0x4252, "" }, +// { 0x4253, "" }, + { 0x4254, "check_key_press" }, + { 0x4255, "showtrace" }, + { 0x4256, "spawn_fx_sparks" }, +// { 0x4257, "" }, +// { 0x4258, "" }, + { 0x4259, "heal_fx_room" }, +// { 0x425A, "" }, +// { 0x425B, "" }, +// { 0x425C, "" }, + { 0x425D, "start_fx_room_damage" }, +// { 0x425E, "" }, +// { 0x425F, "" }, +// { 0x4260, "" }, +// { 0x4261, "" }, +// { 0x4262, "" }, +// { 0x4263, "" }, +// { 0x4264, "" }, + { 0x4265, "firecollapsefx" }, +// { 0x4266, "" }, + { 0x4267, "nyse_fx_room_damage" }, + { 0x4268, "update_nyse_fog" }, +// { 0x4269, "" }, + { 0x426A, "kill_all_env_fx" }, +// { 0x426B, "" }, + { 0x426C, "fx_stockexchange_roofdust" }, +// { 0x426D, "" }, +// { 0x426E, "" }, +// { 0x426F, "" }, +// { 0x4270, "" }, + { 0x4271, "heli_dust_moment" }, +// { 0x4272, "" }, +// { 0x4273, "" }, + { 0x4274, "toggle_giant_smoke_column" }, + { 0x4275, "drawlinesforever" }, + { 0x4276, "dline" }, +// { 0x4277, "" }, +// { 0x4278, "" }, + { 0x4279, "laptops_left" }, + { 0x427A, "codes_uploaded" }, + { 0x427B, "upload_trigger" }, +// { 0x427C, "" }, + { 0x427D, "vol_rooftop" }, +// { 0x427E, "" }, + { 0x427F, "objectives" }, + { 0x4280, "obj_nyse" }, + { 0x4281, "obj_upload" }, + { 0x4282, "wait_for_turret_owner_change" }, +// { 0x4283, "" }, + { 0x4284, "rooftop_combat" }, +// { 0x4285, "" }, +// { 0x4286, "" }, +// { 0x4287, "" }, +// { 0x4288, "" }, +// { 0x4289, "" }, +// { 0x428A, "" }, + { 0x428B, "laptop_setup" }, +// { 0x428C, "" }, +// { 0x428D, "" }, + { 0x428E, "encryption_codes" }, +// { 0x428F, "" }, +// { 0x4290, "" }, +// { 0x4291, "" }, +// { 0x4292, "" }, +// { 0x4293, "" }, +// { 0x4294, "" }, +// { 0x4295, "" }, +// { 0x4296, "" }, +// { 0x4297, "" }, + { 0x4298, "upload_title" }, +// { 0x4299, "" }, +// { 0x429A, "" }, +// { 0x429B, "" }, + { 0x429C, "upload_interrupt" }, +// { 0x429D, "" }, +// { 0x429E, "" }, +// { 0x429F, "" }, + { 0x42A0, "nyse_from_street_think" }, + { 0x42A1, "grenade_monitor" }, + { 0x42A2, "chem_grenade" }, +// { 0x42A3, "" }, +// { 0x42A4, "" }, +// { 0x42A5, "" }, +// { 0x42A6, "" }, +// { 0x42A7, "" }, +// { 0x42A8, "" }, + { 0x42A9, "vo_upload" }, + { 0x42AA, "add_radio" }, +// { 0x42AB, "" }, +// { 0x42AC, "" }, +// { 0x42AD, "" }, + { 0x42AE, "maps/createart/so_survival_mp_dome_art" }, + { 0x42AF, "character/character_so_juggernaut_lite" }, +// { 0x42B0, "" }, +// { 0x42B1, "" }, +// { 0x42B2, "" }, + { 0x42B3, "setup_vehicle" }, +// { 0x42B4, "" }, + { 0x42B5, "hind_finale_enemy_tail_hit_vfx_start" }, + { 0x42B6, "hind_finale_dof" }, + { 0x42B7, "hind_finale_player_smk_trail_start" }, +// { 0x42B8, "" }, + { 0x42B9, "hind_finale_chunk_smk_trail_start" }, +// { 0x42BA, "" }, +// { 0x42BB, "" }, + { 0x42BC, "player_anims" }, +// { 0x42BD, "" }, + { 0x42BE, "hind_anims" }, + { 0x42BF, "door_anims" }, +// { 0x42C0, "" }, +// { 0x42C1, "" }, +// { 0x42C2, "" }, + { 0x42C3, "gazcrash_trailsmk_vfx_stop" }, +// { 0x42C4, "" }, +// { 0x42C5, "" }, +// { 0x42C6, "" }, +// { 0x42C7, "" }, +// { 0x42C8, "" }, + { 0x42C9, "uav_huds" }, +// { 0x42CA, "" }, +// { 0x42CB, "" }, +// { 0x42CC, "" }, +// { 0x42CD, "" }, +// { 0x42CE, "" }, +// { 0x42CF, "" }, +// { 0x42D0, "" }, + { 0x42D1, "predator_hud_time" }, + { 0x42D2, "create_hud_time" }, + { 0x42D3, "predator_hud_msl" }, + { 0x42D4, "create_hud_msl" }, +// { 0x42D5, "" }, +// { 0x42D6, "" }, +// { 0x42D7, "" }, +// { 0x42D8, "" }, +// { 0x42D9, "" }, +// { 0x42DA, "" }, +// { 0x42DB, "" }, + { 0x42DC, "create_hud_kias_line" }, +// { 0x42DD, "" }, +// { 0x42DE, "" }, +// { 0x42DF, "" }, +// { 0x42E0, "" }, + { 0x42E1, "predator_hud_heading" }, + { 0x42E2, "minx" }, + { 0x42E3, "maxx" }, + { 0x42E4, "create_hud_heading" }, +// { 0x42E5, "" }, +// { 0x42E6, "" }, +// { 0x42E7, "" }, + { 0x42E8, "start_cluster" }, + { 0x42E9, "cluster_explosion" }, + { 0x42EA, "missile_intro" }, +// { 0x42EB, "" }, +// { 0x42EC, "" }, +// { 0x42ED, "" }, + { 0x42EE, "should_break_use_xm25" }, + { 0x42EF, "should_break_snapto" }, +// { 0x42F0, "" }, +// { 0x42F1, "" }, + { 0x42F2, "should_break_hint_obj" }, +// { 0x42F3, "" }, +// { 0x42F4, "" }, + { 0x42F5, "should_break_predator_shoot_hint" }, + { 0x42F6, "should_break_hint_backtrack" }, +// { 0x42F7, "" }, + { 0x42F8, "monitor_player_in_godmode" }, +// { 0x42F9, "" }, + { 0x42FA, "should_break_open_manhole" }, +// { 0x42FB, "" }, +// { 0x42FC, "" }, +// { 0x42FD, "" }, +// { 0x42FE, "" }, +// { 0x42FF, "" }, +// { 0x4300, "" }, +// { 0x4301, "" }, + { 0x4302, "start_nyse" }, + { 0x4303, "start_jammer" }, +// { 0x4304, "" }, + { 0x4305, "thumper" }, +// { 0x4306, "" }, +// { 0x4307, "" }, +// { 0x4308, "" }, + { 0x4309, "start_hind_finale" }, +// { 0x430A, "" }, +// { 0x430B, "" }, + { 0x430C, "fifteen_broad" }, + { 0x430D, "stephanies_battle" }, + { 0x430E, "nyse" }, + { 0x430F, "jammer" }, +// { 0x4310, "" }, + { 0x4311, "hind_ride_flight" }, + { 0x4312, "hind_finale" }, + { 0x4313, "obj_setup" }, + { 0x4314, "obj_follow_to_exchange" }, +// { 0x4315, "" }, +// { 0x4316, "" }, +// { 0x4317, "" }, +// { 0x4318, "" }, +// { 0x4319, "" }, + { 0x431A, "obj_jammer" }, +// { 0x431B, "" }, +// { 0x431C, "" }, + { 0x431D, "nyse_flag" }, + { 0x431E, "ny_manhattan_exchange_fire" }, +// { 0x431F, "" }, + { 0x4320, "ny_manhattan_15broad_hallway" }, + { 0x4321, "ny_manhattan_15broad_lobby" }, +// { 0x4322, "" }, +// { 0x4323, "" }, +// { 0x4324, "" }, +// { 0x4325, "" }, +// { 0x4326, "" }, + { 0x4327, "get_all_ents_in_chain" }, +// { 0x4328, "" }, +// { 0x4329, "" }, + { 0x432A, "ai_stun" }, + { 0x432B, "start_teleport" }, +// { 0x432C, "" }, + { 0x432D, "truck_headlights_on" }, +// { 0x432E, "" }, +// { 0x432F, "" }, +// { 0x4330, "" }, +// { 0x4331, "" }, +// { 0x4332, "" }, +// { 0x4333, "" }, +// { 0x4334, "" }, +// { 0x4335, "" }, + { 0x4336, "trigarraywait" }, +// { 0x4337, "" }, + { 0x4338, "trigwait" }, +// { 0x4339, "" }, +// { 0x433A, "" }, + { 0x433B, "aa_ai_functions" }, +// { 0x433C, "" }, + { 0x433D, "set_threatbias" }, + { 0x433E, "old_threatbias" }, +// { 0x433F, "" }, + { 0x4340, "set_walkdist" }, +// { 0x4341, "" }, +// { 0x4342, "" }, +// { 0x4343, "" }, + { 0x4344, "reset_health" }, +// { 0x4345, "" }, + { 0x4346, "reset_animname" }, + { 0x4347, "set_maxsightdistsqrd" }, +// { 0x4348, "" }, + { 0x4349, "reset_maxsightdistsqrd" }, +// { 0x434A, "" }, +// { 0x434B, "" }, +// { 0x434C, "" }, +// { 0x434D, "" }, +// { 0x434E, "" }, +// { 0x434F, "" }, +// { 0x4350, "" }, +// { 0x4351, "" }, +// { 0x4352, "" }, +// { 0x4353, "" }, +// { 0x4354, "" }, +// { 0x4355, "" }, + { 0x4356, "get_closest_axis" }, +// { 0x4357, "" }, +// { 0x4358, "" }, +// { 0x4359, "" }, + { 0x435A, "price" }, +// { 0x435B, "" }, +// { 0x435C, "" }, +// { 0x435D, "" }, +// { 0x435E, "" }, +// { 0x435F, "" }, + { 0x4360, "forcetonode" }, +// { 0x4361, "" }, +// { 0x4362, "" }, +// { 0x4363, "" }, +// { 0x4364, "" }, +// { 0x4365, "" }, + { 0x4366, "aa_door_functions" }, + { 0x4367, "player_dismount_blackhawk_gun" }, +// { 0x4368, "" }, +// { 0x4369, "" }, +// { 0x436A, "" }, + { 0x436B, "primaryturretanim" }, +// { 0x436C, "" }, + { 0x436D, "firetime" }, +// { 0x436E, "" }, + { 0x436F, "gunner_pain_init" }, +// { 0x4370, "" }, + { 0x4371, "gunner_pain_reset" }, + { 0x4372, "handle_gunner_pain" }, +// { 0x4373, "" }, +// { 0x4374, "" }, + { 0x4375, "turret_recenter" }, +// { 0x4376, "" }, +// { 0x4377, "" }, + { 0x4378, "turret_cleanup_on_unload" }, +// { 0x4379, "" }, +// { 0x437A, "" }, + { 0x437B, "default_drop_pitch" }, + { 0x437C, "additiveusegunroot" }, + { 0x437D, "additiverotateroot" }, +// { 0x437E, "" }, +// { 0x437F, "" }, +// { 0x4380, "" }, +// { 0x4381, "" }, +// { 0x4382, "" }, +// { 0x4383, "" }, + { 0x4384, "turret_update_rotatedirection" }, +// { 0x4385, "" }, +// { 0x4386, "" }, + { 0x4387, "firetarget" }, + { 0x4388, "additiveturretrotateright" }, + { 0x4389, "additiveturretrotateleft" }, +// { 0x438A, "" }, +// { 0x438B, "" }, +// { 0x438C, "" }, + { 0x438D, "passenger_2_turret_anim" }, +// { 0x438E, "" }, +// { 0x438F, "" }, +// { 0x4390, "" }, +// { 0x4391, "" }, + { 0x4392, "target_confirm" }, + { 0x4393, "dontshoot" }, + { 0x4394, "turret_target_updater" }, + { 0x4395, "turret_target_validate" }, + { 0x4396, "set_manual_target" }, + { 0x4397, "additiveturretfire" }, + { 0x4398, "fire" }, +// { 0x4399, "" }, +// { 0x439A, "" }, +// { 0x439B, "" }, +// { 0x439C, "" }, +// { 0x439D, "" }, +// { 0x439E, "" }, +// { 0x439F, "" }, +// { 0x43A0, "" }, + { 0x43A1, "doreload" }, +// { 0x43A2, "" }, +// { 0x43A3, "" }, +// { 0x43A4, "" }, +// { 0x43A5, "" }, + { 0x43A6, "turret_aim_straight" }, +// { 0x43A7, "" }, +// { 0x43A8, "" }, +// { 0x43A9, "" }, + { 0x43AA, "turret_aiming_near_target" }, +// { 0x43AB, "" }, +// { 0x43AC, "" }, + { 0x43AD, "blend_droppitch" }, + { 0x43AE, "minigun_cleanup_func" }, +// { 0x43AF, "" }, + { 0x43B0, "extrafiretime_min" }, +// { 0x43B1, "" }, +// { 0x43B2, "" }, +// { 0x43B3, "" }, +// { 0x43B4, "" }, +// { 0x43B5, "" }, + { 0x43B6, "minigun_spinup" }, +// { 0x43B7, "" }, +// { 0x43B8, "" }, +// { 0x43B9, "" }, +// { 0x43BA, "" }, +// { 0x43BB, "" }, +// { 0x43BC, "" }, +// { 0x43BD, "" }, +// { 0x43BE, "" }, +// { 0x43BF, "" }, +// { 0x43C0, "" }, + { 0x43C1, "maps/animated_models/fence_tarp_126x76_med_01" }, +// { 0x43C2, "" }, +// { 0x43C3, "" }, + { 0x43C4, "maps/createfx/mp_radar_fx" }, +// { 0x43C5, "" }, +// { 0x43C6, "" }, +// { 0x43C7, "" }, +// { 0x43C8, "" }, +// { 0x43C9, "" }, + { 0x43CA, "maps/createart/mp_village_art" }, +// { 0x43CB, "" }, +// { 0x43CC, "" }, + { 0x43CD, "common_scripts/_destructible_types_anim_security_camera" }, + { 0x43CE, "maps/createart/mp_underground_art" }, + { 0x43CF, "ac130_thread" }, + { 0x43D0, "play_plane_fx" }, + { 0x43D1, "maps/createfx/mp_underground_fx" }, +// { 0x43D2, "" }, + { 0x43D3, "vehicle_scripts/_80s_hatch1" }, +// { 0x43D4, "" }, +// { 0x43D5, "" }, +// { 0x43D6, "" }, +// { 0x43D7, "" }, + { 0x43D8, "maps/animated_models/seatown_canopy_1section_01_sway" }, +// { 0x43D9, "" }, +// { 0x43DA, "" }, + { 0x43DB, "maps/animated_models/seatown_canopy_stand_01_sway" }, +// { 0x43DC, "" }, + { 0x43DD, "maps/animated_models/seatown_lrg_wiregrp_sway" }, +// { 0x43DE, "" }, +// { 0x43DF, "" }, +// { 0x43E0, "" }, +// { 0x43E1, "" }, +// { 0x43E2, "" }, +// { 0x43E3, "" }, + { 0x43E4, "common_scripts/_destructible_types_anim_wallfan" }, + { 0x43E5, "maps/animated_models/mi24p_hind_plaza_destroy_animated" }, + { 0x43E6, "maps/createart/mp_plaza2_art" }, + { 0x43E7, "maps/createfx/mp_plaza2_fx" }, +// { 0x43E8, "" }, + { 0x43E9, "maps/createart/mp_paris_art" }, + { 0x43EA, "maps/createfx/mp_paris_fx" }, +// { 0x43EB, "" }, +// { 0x43EC, "" }, +// { 0x43ED, "" }, +// { 0x43EE, "" }, +// { 0x43EF, "" }, + { 0x43F0, "maps/animated_models/com_roofvent2" }, +// { 0x43F1, "" }, +// { 0x43F2, "" }, + { 0x43F3, "maps/createart/mp_lambeth_art" }, +// { 0x43F4, "" }, +// { 0x43F5, "" }, +// { 0x43F6, "" }, + { 0x43F7, "maps/createfx/mp_interchange_fx" }, + { 0x43F8, "maps/createart/mp_interchange_fog" }, +// { 0x43F9, "" }, +// { 0x43FA, "" }, +// { 0x43FB, "" }, +// { 0x43FC, "" }, +// { 0x43FD, "" }, +// { 0x43FE, "" }, +// { 0x43FF, "" }, + { 0x4400, "maps/animated_models/fence_tarp_352x88_med_01" }, + { 0x4401, "maps/animated_models/fence_tarp_draping_224x116_01" }, +// { 0x4402, "" }, + { 0x4403, "maps/animated_models/fence_tarp_draping_98x94_med_02" }, +// { 0x4404, "" }, +// { 0x4405, "" }, + { 0x4406, "maps/animated_models/plastic_fence_232x88_med_01" }, +// { 0x4407, "" }, +// { 0x4408, "" }, +// { 0x4409, "" }, +// { 0x440A, "" }, +// { 0x440B, "" }, + { 0x440C, "maps/animated_models/plastic_fence_528x88_med_01" }, +// { 0x440D, "" }, +// { 0x440E, "" }, +// { 0x440F, "" }, +// { 0x4410, "" }, + { 0x4411, "maps/createfx/mp_exchange_fx" }, +// { 0x4412, "" }, +// { 0x4413, "" }, +// { 0x4414, "" }, +// { 0x4415, "" }, + { 0x4416, "maps/animated_models/fence_tarp_128x64_med_01" }, + { 0x4417, "maps/animated_models/fence_tarp_130x76_med_01" }, +// { 0x4418, "" }, +// { 0x4419, "" }, + { 0x441A, "maps/animated_models/fence_tarp_132x62_med_01" }, +// { 0x441B, "" }, + { 0x441C, "maps/animated_models/fence_tarp_140x68_med_01" }, +// { 0x441D, "" }, +// { 0x441E, "" }, +// { 0x441F, "" }, +// { 0x4420, "" }, +// { 0x4421, "" }, +// { 0x4422, "" }, +// { 0x4423, "" }, +// { 0x4424, "" }, + { 0x4425, "maps/createart/mp_carbon_art" }, +// { 0x4426, "" }, +// { 0x4427, "" }, + { 0x4428, "teddytimeout" }, +// { 0x4429, "" }, +// { 0x442A, "" }, +// { 0x442B, "" }, +// { 0x442C, "" }, +// { 0x442D, "" }, + { 0x442E, "maps/createart/mp_bravo_art" }, +// { 0x442F, "" }, +// { 0x4430, "" }, +// { 0x4431, "" }, +// { 0x4432, "" }, + { 0x4433, "maps/createfx/mp_bootleg_fx" }, +// { 0x4434, "" }, + { 0x4435, "maps/animated_models/alpha_hanging_civs_animated" }, +// { 0x4436, "" }, +// { 0x4437, "" }, +// { 0x4438, "" }, + { 0x4439, "xmodelalias/alias_russian_naval_bodies" }, +// { 0x443A, "" }, +// { 0x443B, "" }, +// { 0x443C, "" }, +// { 0x443D, "" }, +// { 0x443E, "" }, +// { 0x443F, "" }, +// { 0x4440, "" }, + { 0x4441, "plane_bomb_cluster" }, +// { 0x4442, "" }, +// { 0x4443, "" }, +// { 0x4444, "" }, +// { 0x4445, "" }, +// { 0x4446, "" }, + { 0x4447, "vehicle_scripts/_submarine_sdv" }, +// { 0x4448, "" }, +// { 0x4449, "" }, + { 0x444A, "vehicle_scripts/_super_dvora" }, + { 0x444B, "vehicle_scripts/_zodiac" }, +// { 0x444C, "" }, +// { 0x444D, "" }, +// { 0x444E, "" }, + { 0x444F, "zodiac_splash_rate_min" }, +// { 0x4450, "" }, + { 0x4451, "aud_launch_loops" }, + { 0x4452, "e3" }, +// { 0x4453, "" }, + { 0x4454, "cone_sound" }, +// { 0x4455, "" }, + { 0x4456, "sandman_sound" }, +// { 0x4457, "" }, + { 0x4458, "escape_zodiac" }, +// { 0x4459, "" }, + { 0x445A, "skybattle_hind_playing" }, + { 0x445B, "skybattle_chinook_playing" }, +// { 0x445C, "" }, +// { 0x445D, "" }, +// { 0x445E, "" }, +// { 0x445F, "" }, +// { 0x4460, "" }, + { 0x4461, "aud_stop_city_combat_ambi" }, +// { 0x4462, "" }, +// { 0x4463, "" }, +// { 0x4464, "" }, +// { 0x4465, "" }, +// { 0x4466, "" }, +// { 0x4467, "" }, +// { 0x4468, "" }, +// { 0x4469, "" }, +// { 0x446A, "" }, +// { 0x446B, "" }, +// { 0x446C, "" }, +// { 0x446D, "" }, +// { 0x446E, "" }, + { 0x446F, "aud_building_explode" }, + { 0x4470, "aud_building_explode_02" }, + { 0x4471, "aud_start_subtop_line_emitters" }, + { 0x4472, "aud_steam_emitters" }, +// { 0x4473, "" }, + { 0x4474, "aud_electric_breakerboxes" }, +// { 0x4475, "" }, +// { 0x4476, "" }, +// { 0x4477, "" }, +// { 0x4478, "" }, + { 0x4479, "aud_steamy_vents" }, + { 0x447A, "aud_siren_first" }, + { 0x447B, "aud_scuttle_alarms_start" }, +// { 0x447C, "" }, +// { 0x447D, "" }, + { 0x447E, "aud_flooded_waterfalls" }, + { 0x447F, "aud_sub_waterfalls" }, +// { 0x4480, "" }, + { 0x4481, "aud_fires" }, +// { 0x4482, "" }, + { 0x4483, "aud_velocity_emitters" }, +// { 0x4484, "" }, + { 0x4485, "aud_zodiac_impacts_incoming_lateral" }, +// { 0x4486, "" }, + { 0x4487, "aud_zodiac_water_impacts_lateral" }, + { 0x4488, "aud_patrol_boats_post_indiana_jones" }, +// { 0x4489, "" }, +// { 0x448A, "" }, +// { 0x448B, "" }, + { 0x448C, "aud_zodiac_into_chinook" }, +// { 0x448D, "" }, +// { 0x448E, "" }, +// { 0x448F, "" }, +// { 0x4490, "" }, +// { 0x4491, "" }, + { 0x4492, "aud_player_sdv_outro" }, +// { 0x4493, "" }, + { 0x4494, "aud_player_sdv_se" }, +// { 0x4495, "" }, +// { 0x4496, "" }, + { 0x4497, "aud_player_sdv_speed_callback_temp" }, +// { 0x4498, "" }, +// { 0x4499, "" }, + { 0x449A, "waittill_deathspin" }, +// { 0x449B, "" }, + { 0x449C, "aud_air_vehicle_flyby" }, + { 0x449D, "aud_russian_sub_start" }, +// { 0x449E, "" }, +// { 0x449F, "" }, +// { 0x44A0, "" }, +// { 0x44A1, "" }, +// { 0x44A2, "" }, +// { 0x44A3, "" }, + { 0x44A4, "sdv_player_arms" }, + { 0x44A5, "aud_get_prop_sound_origin" }, +// { 0x44A6, "" }, +// { 0x44A7, "" }, + { 0x44A8, "sound_origin" }, +// { 0x44A9, "" }, + { 0x44AA, "aud_player_sub_surface_breach" }, + { 0x44AB, "aud_do_sub_scuttle_bombshake" }, +// { 0x44AC, "" }, +// { 0x44AD, "" }, +// { 0x44AE, "" }, + { 0x44AF, "mine_pitch" }, + { 0x44B0, "mine_beep_count" }, +// { 0x44B1, "" }, +// { 0x44B2, "" }, + { 0x44B3, "mine_min_dist" }, +// { 0x44B4, "" }, +// { 0x44B5, "" }, +// { 0x44B6, "" }, + { 0x44B7, "aud_minewarn" }, + { 0x44B8, "aud_slava_missile_launch" }, +// { 0x44B9, "" }, +// { 0x44BA, "" }, +// { 0x44BB, "" }, + { 0x44BC, "last_db_time" }, +// { 0x44BD, "" }, +// { 0x44BE, "" }, +// { 0x44BF, "" }, + { 0x44C0, "availablecost" }, +// { 0x44C1, "" }, +// { 0x44C2, "" }, + { 0x44C3, "active" }, +// { 0x44C4, "" }, +// { 0x44C5, "" }, +// { 0x44C6, "" }, +// { 0x44C7, "" }, +// { 0x44C8, "" }, +// { 0x44C9, "" }, +// { 0x44CA, "" }, +// { 0x44CB, "" }, +// { 0x44CC, "" }, +// { 0x44CD, "" }, +// { 0x44CE, "" }, + { 0x44CF, "_active" }, +// { 0x44D0, "" }, +// { 0x44D1, "" }, + { 0x44D2, "ge_createevent" }, + { 0x44D3, "ge_addevent" }, +// { 0x44D4, "" }, +// { 0x44D5, "" }, + { 0x44D6, "_ge_removeevent" }, +// { 0x44D7, "" }, + { 0x44D8, "kill_cb" }, +// { 0x44D9, "" }, +// { 0x44DA, "" }, +// { 0x44DB, "" }, +// { 0x44DC, "" }, +// { 0x44DD, "" }, +// { 0x44DE, "" }, +// { 0x44DF, "" }, +// { 0x44E0, "" }, + { 0x44E1, "ge_countwaitingeventbyname" }, + { 0x44E2, "ge_countactiveeventbyname" }, + { 0x44E3, "ge_addeffect" }, + { 0x44E4, "fxname" }, + { 0x44E5, "lifetime" }, +// { 0x44E6, "" }, + { 0x44E7, "_ge_activateeffect" }, + { 0x44E8, "_ge_canceleffect" }, +// { 0x44E9, "" }, +// { 0x44EA, "" }, +// { 0x44EB, "" }, +// { 0x44EC, "" }, +// { 0x44ED, "" }, +// { 0x44EE, "" }, +// { 0x44EF, "" }, + { 0x44F0, "ge_addnotify" }, +// { 0x44F1, "" }, +// { 0x44F2, "" }, + { 0x44F3, "kill_msg" }, +// { 0x44F4, "" }, + { 0x44F5, "_ge_notify" }, +// { 0x44F6, "" }, +// { 0x44F7, "" }, + { 0x44F8, "_ge_killnotify" }, + { 0x44F9, "ge_addfxnotify" }, +// { 0x44FA, "" }, +// { 0x44FB, "" }, + { 0x44FC, "setup_ocean_perlin" }, + { 0x44FD, "octaves" }, +// { 0x44FE, "" }, +// { 0x44FF, "" }, +// { 0x4500, "" }, + { 0x4501, "refscale" }, +// { 0x4502, "" }, +// { 0x4503, "" }, +// { 0x4504, "" }, +// { 0x4505, "" }, +// { 0x4506, "" }, + { 0x4507, "getperlinnoisesample" }, +// { 0x4508, "" }, +// { 0x4509, "" }, +// { 0x450A, "" }, +// { 0x450B, "" }, + { 0x450C, "uscrollrate" }, +// { 0x450D, "" }, +// { 0x450E, "" }, +// { 0x450F, "" }, +// { 0x4510, "" }, + { 0x4511, "displacement_uvscale" }, + { 0x4512, "setup_ocean" }, + { 0x4513, "oceantextures" }, +// { 0x4514, "" }, +// { 0x4515, "" }, +// { 0x4516, "" }, +// { 0x4517, "" }, +// { 0x4518, "" }, + { 0x4519, "getdisplacementforvertex" }, +// { 0x451A, "" }, +// { 0x451B, "" }, + { 0x451C, "start_harbor_waterexplosions" }, +// { 0x451D, "" }, +// { 0x451E, "" }, +// { 0x451F, "" }, +// { 0x4520, "" }, +// { 0x4521, "" }, + { 0x4522, "sub_interior_extinguisherfx" }, +// { 0x4523, "" }, +// { 0x4524, "" }, +// { 0x4525, "" }, +// { 0x4526, "" }, +// { 0x4527, "" }, +// { 0x4528, "" }, +// { 0x4529, "" }, + { 0x452A, "surface_sub_breach_lerpsunlight" }, + { 0x452B, "surface_sub_breach_sunanim" }, +// { 0x452C, "" }, +// { 0x452D, "" }, + { 0x452E, "maps/_ocean" }, +// { 0x452F, "" }, + { 0x4530, "surface_sub_hatch_moment" }, +// { 0x4531, "" }, +// { 0x4532, "" }, + { 0x4533, "halfresfxon" }, + { 0x4534, "surface_dvora_carrier_fx" }, + { 0x4535, "updatepos" }, +// { 0x4536, "" }, +// { 0x4537, "" }, +// { 0x4538, "" }, + { 0x4539, "surface_dvora_displace_wake" }, +// { 0x453A, "" }, + { 0x453B, "surface_sub_tail_foam" }, +// { 0x453C, "" }, +// { 0x453D, "" }, +// { 0x453E, "" }, +// { 0x453F, "" }, +// { 0x4540, "" }, +// { 0x4541, "" }, +// { 0x4542, "" }, + { 0x4543, "chinook_board_coverpop" }, +// { 0x4544, "" }, +// { 0x4545, "" }, + { 0x4546, "surface_dvora_chunk_splash" }, + { 0x4547, "surface_dvora_chunk_splash_watcher" }, +// { 0x4548, "" }, + { 0x4549, "surface_dvora_chunk_firetrail_watcher" }, +// { 0x454A, "" }, +// { 0x454B, "" }, +// { 0x454C, "" }, + { 0x454D, "water_sheating_time" }, +// { 0x454E, "" }, +// { 0x454F, "" }, +// { 0x4550, "" }, +// { 0x4551, "" }, +// { 0x4552, "" }, + { 0x4553, "ny_harbor_tunnel_taxi_rooftop_ad_blinky_base" }, +// { 0x4554, "" }, + { 0x4555, "intro_player_bubble_fx" }, +// { 0x4556, "" }, +// { 0x4557, "" }, +// { 0x4558, "" }, +// { 0x4559, "" }, +// { 0x455A, "" }, + { 0x455B, "ny_harbor_intro_specular" }, + { 0x455C, "ny_harbor_enter_sub_shadowfix" }, + { 0x455D, "ny_harbor_enter_zodiac_shadowfix" }, + { 0x455E, "torch_grating_rays" }, +// { 0x455F, "" }, +// { 0x4560, "" }, +// { 0x4561, "" }, + { 0x4562, "sinking_ship_vfx_sequence" }, + { 0x4563, "sinking_ship_explosion" }, +// { 0x4564, "" }, +// { 0x4565, "" }, + { 0x4566, "sinking_ship_bubbles_vfx" }, + { 0x4567, "sinking_ship_post_smk_vfx" }, + { 0x4568, "get_sinking_ship_fx" }, + { 0x4569, "sinking_ship_flash_vision" }, +// { 0x456A, "" }, +// { 0x456B, "" }, +// { 0x456C, "" }, +// { 0x456D, "" }, + { 0x456E, "oscar02_propwash_vfx" }, +// { 0x456F, "" }, + { 0x4570, "bubble_transition_entering_mine_plant" }, +// { 0x4571, "" }, +// { 0x4572, "" }, + { 0x4573, "bubble_on_player_mine_plant" }, +// { 0x4574, "" }, +// { 0x4575, "" }, + { 0x4576, "cine_sub_surfacing_explosions" }, + { 0x4577, "mine_sub_model" }, +// { 0x4578, "" }, + { 0x4579, "oscar_cine_water_displacement_vfx" }, +// { 0x457A, "" }, +// { 0x457B, "" }, +// { 0x457C, "" }, + { 0x457D, "player_surfacing_postfx" }, +// { 0x457E, "" }, +// { 0x457F, "" }, +// { 0x4580, "" }, + { 0x4581, "player_sdv_fx" }, + { 0x4582, "npc_sdv_fx" }, +// { 0x4583, "" }, + { 0x4584, "underwater_bleedout" }, + { 0x4585, "knife_blood" }, +// { 0x4586, "" }, +// { 0x4587, "" }, +// { 0x4588, "" }, + { 0x4589, "play_drip_fx" }, + { 0x458A, "door_open_smokeout_vfx" }, +// { 0x458B, "" }, +// { 0x458C, "" }, + { 0x458D, "door_breach_blur" }, +// { 0x458E, "" }, +// { 0x458F, "" }, + { 0x4590, "vfx_pipe_burst" }, +// { 0x4591, "" }, + { 0x4592, "vfx_pipe_burst_cr" }, + { 0x4593, "greenlighton_vfx" }, + { 0x4594, "missile_key_panel_box" }, +// { 0x4595, "" }, +// { 0x4596, "" }, +// { 0x4597, "" }, +// { 0x4598, "" }, + { 0x4599, "footstepeffects" }, +// { 0x459A, "" }, + { 0x459B, "update_fire_reflections_manager" }, +// { 0x459C, "" }, +// { 0x459D, "" }, + { 0x459E, "loop_skybox_hinds" }, + { 0x459F, "loop_skybox_hinds_update" }, +// { 0x45A0, "" }, + { 0x45A1, "loop_skybox_migs_update" }, +// { 0x45A2, "" }, +// { 0x45A3, "" }, + { 0x45A4, "play_wave_fire_fx" }, +// { 0x45A5, "" }, +// { 0x45A6, "" }, +// { 0x45A7, "" }, +// { 0x45A8, "" }, +// { 0x45A9, "" }, +// { 0x45AA, "" }, +// { 0x45AB, "" }, +// { 0x45AC, "" }, +// { 0x45AD, "" }, + { 0x45AE, "exit_chinook" }, +// { 0x45AF, "" }, +// { 0x45B0, "" }, + { 0x45B1, "chinook_interiorfx" }, +// { 0x45B2, "" }, +// { 0x45B3, "" }, +// { 0x45B4, "" }, + { 0x45B5, "disable_ambient_under_docks" }, +// { 0x45B6, "" }, +// { 0x45B7, "" }, + { 0x45B8, "viewdependent_vision_enabled" }, +// { 0x45B9, "" }, +// { 0x45BA, "" }, +// { 0x45BB, "" }, +// { 0x45BC, "" }, +// { 0x45BD, "" }, +// { 0x45BE, "" }, + { 0x45BF, "sdv_follow_nag_lines" }, +// { 0x45C0, "" }, +// { 0x45C1, "" }, +// { 0x45C2, "" }, + { 0x45C3, "sub_truck" }, +// { 0x45C4, "" }, +// { 0x45C5, "" }, + { 0x45C6, "vo_sub_interior_barracks" }, + { 0x45C7, "vo_sub_interior_reactor" }, +// { 0x45C8, "" }, + { 0x45C9, "vo_sub_interior_missile_room_1" }, +// { 0x45CA, "" }, + { 0x45CB, "vo_sub_sandman_got_key" }, +// { 0x45CC, "" }, +// { 0x45CD, "" }, +// { 0x45CE, "" }, +// { 0x45CF, "" }, +// { 0x45D0, "" }, + { 0x45D1, "live_dialog_queue" }, +// { 0x45D2, "" }, +// { 0x45D3, "" }, +// { 0x45D4, "" }, + { 0x45D5, "disable_prone_on_back_of_sub" }, +// { 0x45D6, "" }, + { 0x45D7, "stop_script_anim" }, + { 0x45D8, "generic_surprise_death" }, +// { 0x45D9, "" }, +// { 0x45DA, "" }, + { 0x45DB, "sdv_grinch" }, + { 0x45DC, "debug_playerview" }, + { 0x45DD, "npc_through_water" }, + { 0x45DE, "catch_notetrack_subswap" }, +// { 0x45DF, "" }, + { 0x45E0, "catch_notetrack_stopbob" }, + { 0x45E1, "rockoutside" }, + { 0x45E2, "anim_single_solo_trans" }, +// { 0x45E3, "" }, +// { 0x45E4, "" }, +// { 0x45E5, "" }, +// { 0x45E6, "" }, +// { 0x45E7, "" }, +// { 0x45E8, "" }, +// { 0x45E9, "" }, +// { 0x45EA, "" }, +// { 0x45EB, "" }, + { 0x45EC, "bobbing_ripple" }, + { 0x45ED, "ref_origin" }, + { 0x45EE, "bobbing_actor" }, +// { 0x45EF, "" }, +// { 0x45F0, "" }, + { 0x45F1, "watch_explosions" }, +// { 0x45F2, "" }, +// { 0x45F3, "" }, + { 0x45F4, "bobbing_underwater" }, +// { 0x45F5, "" }, + { 0x45F6, "bobbing_fnc" }, +// { 0x45F7, "" }, +// { 0x45F8, "" }, + { 0x45F9, "tgt_values" }, +// { 0x45FA, "" }, +// { 0x45FB, "" }, +// { 0x45FC, "" }, +// { 0x45FD, "" }, +// { 0x45FE, "" }, +// { 0x45FF, "" }, +// { 0x4600, "" }, + { 0x4601, "min_yaw_period" }, +// { 0x4602, "" }, +// { 0x4603, "" }, +// { 0x4604, "" }, + { 0x4605, "max_roll_period" }, +// { 0x4606, "" }, +// { 0x4607, "" }, +// { 0x4608, "" }, +// { 0x4609, "" }, +// { 0x460A, "" }, +// { 0x460B, "" }, +// { 0x460C, "" }, +// { 0x460D, "" }, +// { 0x460E, "" }, +// { 0x460F, "" }, +// { 0x4610, "" }, + { 0x4611, "isbuoy" }, + { 0x4612, "smoothvalue" }, +// { 0x4613, "" }, +// { 0x4614, "" }, + { 0x4615, "createdefaultsmallbobsettings" }, + { 0x4616, "no_bobbing" }, + { 0x4617, "nobob" }, +// { 0x4618, "" }, + { 0x4619, "org_origin" }, +// { 0x461A, "" }, +// { 0x461B, "" }, + { 0x461C, "stop_bobbing" }, + { 0x461D, "prep_bobbing" }, +// { 0x461E, "" }, +// { 0x461F, "" }, +// { 0x4620, "" }, + { 0x4621, "bobbers" }, +// { 0x4622, "" }, +// { 0x4623, "" }, + { 0x4624, "activatebobbingobjects" }, +// { 0x4625, "" }, +// { 0x4626, "" }, +// { 0x4627, "" }, +// { 0x4628, "" }, + { 0x4629, "onoutsideofsub" }, +// { 0x462A, "" }, +// { 0x462B, "" }, +// { 0x462C, "" }, + { 0x462D, "show_sub_water" }, +// { 0x462E, "" }, +// { 0x462F, "" }, +// { 0x4630, "" }, +// { 0x4631, "" }, +// { 0x4632, "" }, + { 0x4633, "targetangles" }, + { 0x4634, "targettime" }, + { 0x4635, "set_grav" }, +// { 0x4636, "" }, +// { 0x4637, "" }, +// { 0x4638, "" }, +// { 0x4639, "" }, + { 0x463A, "rocker_hangers" }, + { 0x463B, "rock_ents" }, + { 0x463C, "rock_debris" }, +// { 0x463D, "" }, +// { 0x463E, "" }, +// { 0x463F, "" }, +// { 0x4640, "" }, +// { 0x4641, "" }, + { 0x4642, "play_ssn19fx_alt" }, + { 0x4643, "open_ssn19_wings" }, + { 0x4644, "launch_ssn19" }, +// { 0x4645, "" }, +// { 0x4646, "" }, +// { 0x4647, "" }, +// { 0x4648, "" }, +// { 0x4649, "" }, +// { 0x464A, "" }, +// { 0x464B, "" }, +// { 0x464C, "" }, +// { 0x464D, "" }, +// { 0x464E, "" }, +// { 0x464F, "" }, +// { 0x4650, "" }, + { 0x4651, "sub_exterior_hinds" }, + { 0x4652, "sub_exterior_fire_at_hinds" }, + { 0x4653, "sub_exterior_chinook" }, +// { 0x4654, "" }, +// { 0x4655, "" }, + { 0x4656, "sub_exterior_heli_fire_turret" }, + { 0x4657, "sub_entrance" }, + { 0x4658, "hatch_enemies" }, + { 0x4659, "hatch_enemies_dead" }, +// { 0x465A, "" }, +// { 0x465B, "" }, +// { 0x465C, "" }, +// { 0x465D, "" }, +// { 0x465E, "" }, + { 0x465F, "open_hatch" }, + { 0x4660, "open_hatch_rear" }, + { 0x4661, "hatch_sandman_drop_frag" }, +// { 0x4662, "" }, + { 0x4663, "hide_grenade" }, + { 0x4664, "frag" }, + { 0x4665, "flag_set_wrapper" }, +// { 0x4666, "" }, +// { 0x4667, "" }, + { 0x4668, "hatch_player_slide" }, +// { 0x4669, "" }, + { 0x466A, "entrance_vo_timing" }, +// { 0x466B, "" }, + { 0x466C, "sub_extra_friendly" }, +// { 0x466D, "" }, +// { 0x466E, "" }, + { 0x466F, "sub_extra_death" }, +// { 0x4670, "" }, +// { 0x4671, "" }, +// { 0x4672, "" }, +// { 0x4673, "" }, +// { 0x4674, "" }, + { 0x4675, "bulkhead_door_vo" }, +// { 0x4676, "" }, +// { 0x4677, "" }, +// { 0x4678, "" }, +// { 0x4679, "" }, +// { 0x467A, "" }, +// { 0x467B, "" }, +// { 0x467C, "" }, +// { 0x467D, "" }, +// { 0x467E, "" }, +// { 0x467F, "" }, +// { 0x4680, "" }, +// { 0x4681, "" }, +// { 0x4682, "" }, + { 0x4683, "reactor_room_sandman_paired_kill" }, +// { 0x4684, "" }, +// { 0x4685, "" }, + { 0x4686, "monitor_paired_interrupt_sandman" }, +// { 0x4687, "" }, + { 0x4688, "itiot_bridge_breach" }, +// { 0x4689, "" }, + { 0x468A, "monitor_end_loop" }, + { 0x468B, "ignore_extinguisher" }, +// { 0x468C, "" }, +// { 0x468D, "" }, + { 0x468E, "runners" }, +// { 0x468F, "" }, +// { 0x4690, "" }, +// { 0x4691, "" }, +// { 0x4692, "" }, +// { 0x4693, "" }, + { 0x4694, "breachenemies_active" }, +// { 0x4695, "" }, + { 0x4696, "breach_door" }, +// { 0x4697, "" }, +// { 0x4698, "" }, +// { 0x4699, "" }, +// { 0x469A, "" }, + { 0x469B, "breach_setup_player" }, +// { 0x469C, "" }, + { 0x469D, "blow_door" }, + { 0x469E, "breach_destroyed_door" }, + { 0x469F, "breach_slow_down" }, + { 0x46A0, "breach_top_off_weapon" }, + { 0x46A1, "should_topoff_breach_weapon" }, +// { 0x46A2, "" }, +// { 0x46A3, "" }, +// { 0x46A4, "" }, + { 0x46A5, "detach_charge_2" }, +// { 0x46A6, "" }, +// { 0x46A7, "" }, +// { 0x46A8, "" }, +// { 0x46A9, "" }, + { 0x46AA, "forced_slowmo_breach_lerpout" }, + { 0x46AB, "switchedweapons" }, + { 0x46AC, "breach_missionfailed" }, +// { 0x46AD, "" }, + { 0x46AE, "player_heartbeat" }, + { 0x46AF, "catch_weapon_switch" }, +// { 0x46B0, "" }, +// { 0x46B1, "" }, +// { 0x46B2, "" }, +// { 0x46B3, "" }, +// { 0x46B4, "" }, + { 0x46B5, "breach_enemy_waitfor_death" }, +// { 0x46B6, "" }, + { 0x46B7, "breach_enemy_catch_exceptions" }, +// { 0x46B8, "" }, + { 0x46B9, "breach_enemy_monitor_dead" }, +// { 0x46BA, "" }, + { 0x46BB, "sub_captain" }, +// { 0x46BC, "" }, + { 0x46BD, "return_player_body_if_death" }, +// { 0x46BE, "" }, +// { 0x46BF, "" }, +// { 0x46C0, "" }, + { 0x46C1, "captain_animation" }, +// { 0x46C2, "" }, +// { 0x46C3, "" }, +// { 0x46C4, "" }, +// { 0x46C5, "" }, +// { 0x46C6, "" }, +// { 0x46C7, "" }, +// { 0x46C8, "" }, +// { 0x46C9, "" }, +// { 0x46CA, "" }, +// { 0x46CB, "" }, + { 0x46CC, "breach_knife_charger_monitor_death" }, +// { 0x46CD, "" }, +// { 0x46CE, "" }, +// { 0x46CF, "" }, + { 0x46D0, "sub_exit" }, +// { 0x46D1, "" }, +// { 0x46D2, "" }, + { 0x46D3, "dummy_keep_pose" }, +// { 0x46D4, "" }, +// { 0x46D5, "" }, +// { 0x46D6, "" }, +// { 0x46D7, "" }, +// { 0x46D8, "" }, +// { 0x46D9, "" }, +// { 0x46DA, "" }, +// { 0x46DB, "" }, +// { 0x46DC, "" }, + { 0x46DD, "turn_time" }, +// { 0x46DE, "" }, +// { 0x46DF, "" }, +// { 0x46E0, "" }, +// { 0x46E1, "" }, +// { 0x46E2, "" }, +// { 0x46E3, "" }, +// { 0x46E4, "" }, + { 0x46E5, "objective_2_gettoreactor" }, +// { 0x46E6, "" }, +// { 0x46E7, "" }, + { 0x46E8, "obj_crumb_logic" }, +// { 0x46E9, "" }, +// { 0x46EA, "" }, +// { 0x46EB, "" }, +// { 0x46EC, "" }, + { 0x46ED, "sub_interior" }, + { 0x46EE, "setup_thermal_vision" }, +// { 0x46EF, "" }, +// { 0x46F0, "" }, +// { 0x46F1, "" }, + { 0x46F2, "gasmask_on_player_so" }, +// { 0x46F3, "" }, +// { 0x46F4, "" }, +// { 0x46F5, "" }, +// { 0x46F6, "" }, + { 0x46F7, "cosmetic_fx_and_geo_for_harbor" }, + { 0x46F8, "setup_ai_sub" }, +// { 0x46F9, "" }, +// { 0x46FA, "" }, +// { 0x46FB, "" }, +// { 0x46FC, "" }, +// { 0x46FD, "" }, +// { 0x46FE, "" }, +// { 0x46FF, "" }, + { 0x4700, "spawner_cleanup" }, +// { 0x4701, "" }, +// { 0x4702, "" }, +// { 0x4703, "" }, +// { 0x4704, "" }, +// { 0x4705, "" }, +// { 0x4706, "" }, + { 0x4707, "player_on_deck" }, + { 0x4708, "arm_thermite_and_monitor" }, +// { 0x4709, "" }, + { 0x470A, "end_messages_if_both_disarm" }, +// { 0x470B, "" }, +// { 0x470C, "" }, + { 0x470D, "setup_ally_helis" }, +// { 0x470E, "" }, +// { 0x470F, "" }, +// { 0x4710, "" }, +// { 0x4711, "" }, +// { 0x4712, "" }, +// { 0x4713, "" }, +// { 0x4714, "" }, +// { 0x4715, "" }, +// { 0x4716, "" }, +// { 0x4717, "" }, + { 0x4718, "message_on" }, +// { 0x4719, "" }, +// { 0x471A, "" }, + { 0x471B, "wait_for_laststand" }, + { 0x471C, "hint_text_logic" }, +// { 0x471D, "" }, +// { 0x471E, "" }, +// { 0x471F, "" }, +// { 0x4720, "" }, +// { 0x4721, "" }, + { 0x4722, "heli_pos" }, +// { 0x4723, "" }, + { 0x4724, "heli_unload" }, + { 0x4725, "fix_hind_doors_so" }, + { 0x4726, "handle_reactor_setup" }, + { 0x4727, "missing_objective_warning" }, + { 0x4728, "objective_warning_triggers" }, +// { 0x4729, "" }, +// { 0x472A, "" }, + { 0x472B, "setup_timer" }, +// { 0x472C, "" }, +// { 0x472D, "" }, +// { 0x472E, "" }, +// { 0x472F, "" }, +// { 0x4730, "" }, +// { 0x4731, "" }, + { 0x4732, "valve_in_use" }, + { 0x4733, "reset_valve_interaction" }, +// { 0x4734, "" }, +// { 0x4735, "" }, +// { 0x4736, "" }, +// { 0x4737, "" }, + { 0x4738, "reverse_turning" }, + { 0x4739, "players_use_button" }, +// { 0x473A, "" }, + { 0x473B, "monitor_steam_shutoff" }, +// { 0x473C, "" }, +// { 0x473D, "" }, +// { 0x473E, "" }, +// { 0x473F, "" }, +// { 0x4740, "" }, +// { 0x4741, "" }, +// { 0x4742, "" }, + { 0x4743, "get_and_wait_for_trigger" }, +// { 0x4744, "" }, + { 0x4745, "open_doors_with_animations" }, +// { 0x4746, "" }, + { 0x4747, "players_touching" }, +// { 0x4748, "" }, +// { 0x4749, "" }, +// { 0x474A, "" }, + { 0x474B, "anim_open_door" }, + { 0x474C, "stop_anim_if_dead" }, +// { 0x474D, "" }, +// { 0x474E, "" }, +// { 0x474F, "" }, +// { 0x4750, "" }, +// { 0x4751, "" }, +// { 0x4752, "" }, + { 0x4753, "monitor_remaining_bombs" }, +// { 0x4754, "" }, +// { 0x4755, "" }, + { 0x4756, "thermite_timer_reactor_room" }, + { 0x4757, "elements" }, +// { 0x4758, "" }, +// { 0x4759, "" }, +// { 0x475A, "" }, +// { 0x475B, "" }, +// { 0x475C, "" }, + { 0x475D, "teleport_player_so" }, +// { 0x475E, "" }, +// { 0x475F, "" }, + { 0x4760, "enemy_ai_for_sub" }, +// { 0x4761, "" }, +// { 0x4762, "" }, +// { 0x4763, "" }, +// { 0x4764, "" }, +// { 0x4765, "" }, +// { 0x4766, "" }, +// { 0x4767, "" }, +// { 0x4768, "" }, + { 0x4769, "player_using_ladder" }, + { 0x476A, "move_guy_down" }, +// { 0x476B, "" }, + { 0x476C, "handle_exit" }, +// { 0x476D, "" }, +// { 0x476E, "" }, +// { 0x476F, "" }, +// { 0x4770, "" }, +// { 0x4771, "" }, + { 0x4772, "shoot_dude" }, +// { 0x4773, "" }, + { 0x4774, "close_hatch_rear" }, + { 0x4775, "verify_player_in_sub" }, +// { 0x4776, "" }, +// { 0x4777, "" }, +// { 0x4778, "" }, +// { 0x4779, "" }, +// { 0x477A, "" }, +// { 0x477B, "" }, +// { 0x477C, "" }, +// { 0x477D, "" }, + { 0x477E, "angles_and_origin" }, + { 0x477F, "silo_doors_and_missiles" }, + { 0x4780, "right_missile_groups" }, + { 0x4781, "left_missile_groups" }, +// { 0x4782, "" }, +// { 0x4783, "" }, +// { 0x4784, "" }, +// { 0x4785, "" }, +// { 0x4786, "" }, +// { 0x4787, "" }, +// { 0x4788, "" }, +// { 0x4789, "" }, +// { 0x478A, "" }, +// { 0x478B, "" }, +// { 0x478C, "" }, +// { 0x478D, "" }, +// { 0x478E, "" }, + { 0x478F, "script_model_anims" }, + { 0x4790, "door" }, +// { 0x4791, "" }, +// { 0x4792, "" }, +// { 0x4793, "" }, + { 0x4794, "handle_end_of_game_bonuses" }, + { 0x4795, "monitor_damage_type" }, +// { 0x4796, "" }, +// { 0x4797, "" }, +// { 0x4798, "" }, + { 0x4799, "heli_fail_safe_on_death" }, +// { 0x479A, "" }, + { 0x479B, "vehicle_scripts/_zubr" }, +// { 0x479C, "" }, +// { 0x479D, "" }, + { 0x479E, "radio" }, +// { 0x479F, "" }, +// { 0x47A0, "" }, + { 0x47A1, "breachignoreenemy_count" }, + { 0x47A2, "has_special_breach_anim" }, + { 0x47A3, "breach_passive_time" }, +// { 0x47A4, "" }, +// { 0x47A5, "" }, + { 0x47A6, "manhandled_spawners" }, + { 0x47A7, "missing_animation_parameters" }, + { 0x47A8, "missing_animations" }, +// { 0x47A9, "" }, + { 0x47AA, "is_breach_anim_single_setup" }, +// { 0x47AB, "" }, + { 0x47AC, "scr_stub" }, + { 0x47AD, "breach_anims" }, +// { 0x47AE, "" }, + { 0x47AF, "friendly_animations" }, + { 0x47B0, "breach_fx_setup" }, +// { 0x47B1, "" }, +// { 0x47B2, "" }, +// { 0x47B3, "" }, +// { 0x47B4, "" }, + { 0x47B5, "doortype" }, + { 0x47B6, "lookat_triggers" }, +// { 0x47B7, "" }, + { 0x47B8, "door_volume" }, + { 0x47B9, "room_volume" }, +// { 0x47BA, "" }, +// { 0x47BB, "" }, + { 0x47BC, "right_post" }, +// { 0x47BD, "" }, +// { 0x47BE, "" }, +// { 0x47BF, "" }, +// { 0x47C0, "" }, + { 0x47C1, "assign_script_breachgroup_to_ents" }, +// { 0x47C2, "" }, + { 0x47C3, "slowmo_breach_damage_trigger_think" }, + { 0x47C4, "icon_trigger_setup" }, +// { 0x47C5, "" }, +// { 0x47C6, "" }, +// { 0x47C7, "" }, + { 0x47C8, "slowmo_breach_think" }, + { 0x47C9, "breach_use_triggers" }, +// { 0x47CA, "" }, +// { 0x47CB, "" }, + { 0x47CC, "charge" }, +// { 0x47CD, "" }, +// { 0x47CE, "" }, +// { 0x47CF, "" }, +// { 0x47D0, "" }, +// { 0x47D1, "" }, +// { 0x47D2, "" }, +// { 0x47D3, "" }, +// { 0x47D4, "" }, +// { 0x47D5, "" }, + { 0x47D6, "breachfriendlies_can_teleport" }, +// { 0x47D7, "" }, +// { 0x47D8, "" }, + { 0x47D9, "breach_too_many_enemies_hint" }, + { 0x47DA, "breach_reloading_hint" }, + { 0x47DB, "breach_bad_weapon_hint" }, +// { 0x47DC, "" }, +// { 0x47DD, "" }, +// { 0x47DE, "" }, + { 0x47DF, "room_has_multiple_doors" }, +// { 0x47E0, "" }, +// { 0x47E1, "" }, +// { 0x47E2, "" }, +// { 0x47E3, "" }, +// { 0x47E4, "" }, + { 0x47E5, "breach_friendlies_ready_at_other_door" }, +// { 0x47E6, "" }, + { 0x47E7, "add_scene_model" }, +// { 0x47E8, "" }, +// { 0x47E9, "" }, +// { 0x47EA, "" }, +// { 0x47EB, "" }, +// { 0x47EC, "" }, +// { 0x47ED, "" }, +// { 0x47EE, "" }, +// { 0x47EF, "" }, +// { 0x47F0, "" }, +// { 0x47F1, "" }, +// { 0x47F2, "" }, +// { 0x47F3, "" }, +// { 0x47F4, "" }, +// { 0x47F5, "" }, +// { 0x47F6, "" }, +// { 0x47F7, "" }, + { 0x47F8, "play_detpack_plant_sound" }, +// { 0x47F9, "" }, +// { 0x47FA, "" }, +// { 0x47FB, "" }, + { 0x47FC, "enable_passive_weapons" }, +// { 0x47FD, "" }, +// { 0x47FE, "" }, +// { 0x47FF, "" }, + { 0x4800, "get_available_breachfriendlies" }, +// { 0x4801, "" }, +// { 0x4802, "" }, +// { 0x4803, "" }, +// { 0x4804, "" }, +// { 0x4805, "" }, + { 0x4806, "slomo_breach_vision_change" }, +// { 0x4807, "" }, +// { 0x4808, "" }, + { 0x4809, "reference" }, +// { 0x480A, "" }, +// { 0x480B, "" }, +// { 0x480C, "" }, +// { 0x480D, "" }, +// { 0x480E, "" }, +// { 0x480F, "" }, + { 0x4810, "hostage_health_regen" }, +// { 0x4811, "" }, +// { 0x4812, "" }, + { 0x4813, "breach_set_deadquote" }, + { 0x4814, "coop_breached_from_same_door_in_a_muliti_door_room" }, +// { 0x4815, "" }, +// { 0x4816, "" }, + { 0x4817, "slowmo_viewhands" }, + { 0x4818, "_slowmo_breach_funcs" }, + { 0x4819, "add_breach_func" }, + { 0x481A, "breach_functions" }, + { 0x481B, "breach_explosion" }, +// { 0x481C, "" }, +// { 0x481D, "" }, +// { 0x481E, "" }, +// { 0x481F, "" }, +// { 0x4820, "" }, + { 0x4821, "_slomo_breach_executed_guy" }, +// { 0x4822, "" }, +// { 0x4823, "" }, + { 0x4824, "_slomo_breach_c4_hostage" }, +// { 0x4825, "" }, +// { 0x4826, "" }, + { 0x4827, "_slomo_breach_fightback_guy" }, +// { 0x4828, "" }, +// { 0x4829, "" }, +// { 0x482A, "" }, + { 0x482B, "_slomo_breach_chair_guy_animated" }, +// { 0x482C, "" }, +// { 0x482D, "" }, +// { 0x482E, "" }, + { 0x482F, "breach_near_player" }, + { 0x4830, "get_breach_groups" }, + { 0x4831, "make_empty_breach" }, +// { 0x4832, "" }, + { 0x4833, "breach_debug_display_animnames" }, +// { 0x4834, "" }, + { 0x4835, "hostagemanhandle" }, + { 0x4836, "manhandler_hold" }, + { 0x4837, "startmanhandling" }, +// { 0x4838, "" }, + { 0x4839, "readytobemanhandled" }, +// { 0x483A, "" }, +// { 0x483B, "" }, + { 0x483C, "special_gulag_adjustment" }, +// { 0x483D, "" }, +// { 0x483E, "" }, +// { 0x483F, "" }, +// { 0x4840, "" }, +// { 0x4841, "" }, +// { 0x4842, "" }, +// { 0x4843, "" }, + { 0x4844, "anim_exists" }, +// { 0x4845, "" }, +// { 0x4846, "" }, +// { 0x4847, "" }, + { 0x4848, "breach_failed_to_start" }, +// { 0x4849, "" }, + { 0x484A, "slomo_sound_scale_setup" }, + { 0x484B, "trainer_version" }, +// { 0x484C, "" }, + { 0x484D, "challenge_flag_complete" }, + { 0x484E, "challenge_flag_start" }, +// { 0x484F, "" }, +// { 0x4850, "" }, +// { 0x4851, "" }, + { 0x4852, "delete_ents" }, +// { 0x4853, "" }, +// { 0x4854, "" }, +// { 0x4855, "" }, + { 0x4856, "setup_breach" }, + { 0x4857, "breach_charge01_highlight" }, + { 0x4858, "breach_charge01" }, +// { 0x4859, "" }, + { 0x485A, "breach_charge02" }, +// { 0x485B, "" }, +// { 0x485C, "" }, +// { 0x485D, "" }, +// { 0x485E, "" }, +// { 0x485F, "" }, +// { 0x4860, "" }, +// { 0x4861, "" }, + { 0x4862, "setup_dialog" }, + { 0x4863, "dialog_intro" }, + { 0x4864, "dialog_weapons_hidden" }, +// { 0x4865, "" }, + { 0x4866, "on_player_weapon_change" }, +// { 0x4867, "" }, +// { 0x4868, "" }, + { 0x4869, "grinch" }, +// { 0x486A, "" }, + { 0x486B, "look_at_players" }, +// { 0x486C, "" }, +// { 0x486D, "" }, +// { 0x486E, "" }, +// { 0x486F, "" }, +// { 0x4870, "" }, +// { 0x4871, "" }, +// { 0x4872, "" }, +// { 0x4873, "" }, +// { 0x4874, "" }, +// { 0x4875, "" }, +// { 0x4876, "" }, + { 0x4877, "start_mission" }, + { 0x4878, "course_think" }, +// { 0x4879, "" }, + { 0x487A, "trig_required" }, + { 0x487B, "doors_before" }, +// { 0x487C, "" }, +// { 0x487D, "" }, + { 0x487E, "target_rail_start_points" }, + { 0x487F, "target_rail_path_start_points" }, +// { 0x4880, "" }, + { 0x4881, "targets_friendly" }, + { 0x4882, "targets_enemy" }, +// { 0x4883, "" }, + { 0x4884, "course_delete" }, +// { 0x4885, "" }, +// { 0x4886, "" }, +// { 0x4887, "" }, +// { 0x4888, "" }, + { 0x4889, "lateralmovementorgs" }, +// { 0x488A, "" }, +// { 0x488B, "" }, +// { 0x488C, "" }, +// { 0x488D, "" }, +// { 0x488E, "" }, + { 0x488F, "so_player_tooclose_wait" }, +// { 0x4890, "" }, +// { 0x4891, "" }, +// { 0x4892, "" }, +// { 0x4893, "" }, +// { 0x4894, "" }, +// { 0x4895, "" }, +// { 0x4896, "" }, +// { 0x4897, "" }, +// { 0x4898, "" }, +// { 0x4899, "" }, + { 0x489A, "splash_count" }, +// { 0x489B, "" }, +// { 0x489C, "" }, + { 0x489D, "hud_area_cleared" }, +// { 0x489E, "" }, +// { 0x489F, "" }, + { 0x48A0, "get_next_medal_time_string" }, + { 0x48A1, "get_next_medal" }, +// { 0x48A2, "" }, +// { 0x48A3, "" }, +// { 0x48A4, "" }, + { 0x48A5, "brushes" }, +// { 0x48A6, "" }, +// { 0x48A7, "" }, +// { 0x48A8, "" }, +// { 0x48A9, "" }, +// { 0x48AA, "" }, +// { 0x48AB, "" }, + { 0x48AC, "character/character_sp_opforce_e" }, + { 0x48AD, "character/character_sp_opforce_f" }, +// { 0x48AE, "" }, +// { 0x48AF, "" }, + { 0x48B0, "character/character_sp_opforce_derik" }, +// { 0x48B1, "" }, +// { 0x48B2, "" }, +// { 0x48B3, "" }, +// { 0x48B4, "" }, +// { 0x48B5, "" }, +// { 0x48B6, "" }, + { 0x48B7, "a10_goggles_overlay_hi" }, + { 0x48B8, "a10_fx_lifetime_sec" }, +// { 0x48B9, "" }, +// { 0x48BA, "" }, + { 0x48BB, "a10_fly_distance_back_increment" }, +// { 0x48BC, "" }, +// { 0x48BD, "" }, + { 0x48BE, "a10_badplace_radius" }, + { 0x48BF, "a10_friendly_ent_target_check" }, +// { 0x48C0, "" }, + { 0x48C1, "a10_hint_hud_activate" }, +// { 0x48C2, "" }, + { 0x48C3, "a10_targets" }, +// { 0x48C4, "" }, +// { 0x48C5, "" }, + { 0x48C6, "airstrike_setup" }, +// { 0x48C7, "" }, + { 0x48C8, "airstrike_cancelled" }, +// { 0x48C9, "" }, +// { 0x48CA, "" }, +// { 0x48CB, "" }, +// { 0x48CC, "" }, + { 0x48CD, "create_aim_arrow" }, +// { 0x48CE, "" }, +// { 0x48CF, "" }, + { 0x48D0, "draw_target_aim" }, +// { 0x48D1, "" }, + { 0x48D2, "create_second_point" }, +// { 0x48D3, "" }, +// { 0x48D4, "" }, +// { 0x48D5, "" }, +// { 0x48D6, "" }, +// { 0x48D7, "" }, +// { 0x48D8, "" }, + { 0x48D9, "draw_directional_info" }, +// { 0x48DA, "" }, +// { 0x48DB, "" }, + { 0x48DC, "start_delay" }, + { 0x48DD, "direction_line_start_time" }, +// { 0x48DE, "" }, + { 0x48DF, "vfx" }, +// { 0x48E0, "" }, +// { 0x48E1, "" }, +// { 0x48E2, "" }, +// { 0x48E3, "" }, +// { 0x48E4, "" }, +// { 0x48E5, "" }, +// { 0x48E6, "" }, +// { 0x48E7, "" }, + { 0x48E8, "airstrike_get_path" }, +// { 0x48E9, "" }, +// { 0x48EA, "" }, +// { 0x48EB, "" }, +// { 0x48EC, "" }, +// { 0x48ED, "" }, +// { 0x48EE, "" }, +// { 0x48EF, "" }, +// { 0x48F0, "" }, +// { 0x48F1, "" }, +// { 0x48F2, "" }, + { 0x48F3, "checkpath" }, +// { 0x48F4, "" }, +// { 0x48F5, "" }, +// { 0x48F6, "" }, + { 0x48F7, "a10_start_impact" }, + { 0x48F8, "a10_end_impact" }, +// { 0x48F9, "" }, +// { 0x48FA, "" }, + { 0x48FB, "airstrike_animated_rumble" }, +// { 0x48FC, "" }, +// { 0x48FD, "" }, + { 0x48FE, "airstrike_fire" }, + { 0x48FF, "a10_muzzle_flash_fx" }, +// { 0x4900, "" }, + { 0x4901, "a10_kills" }, + { 0x4902, "a10_kill_watcher_ai" }, + { 0x4903, "calculate_target_pos" }, + { 0x4904, "airstrike_clean_up_target_points" }, +// { 0x4905, "" }, +// { 0x4906, "" }, +// { 0x4907, "" }, + { 0x4908, "a10_suppress_ready_vo" }, +// { 0x4909, "" }, +// { 0x490A, "" }, +// { 0x490B, "" }, + { 0x490C, "in_cant_get_there_dialogue" }, + { 0x490D, "airstike_hint_text_points" }, +// { 0x490E, "" }, + { 0x490F, "turn_on_a10_hud_hint" }, + { 0x4910, "monitor_weapon_switch" }, +// { 0x4911, "" }, +// { 0x4912, "" }, +// { 0x4913, "" }, +// { 0x4914, "" }, +// { 0x4915, "" }, + { 0x4916, "a10_interface_fontscale" }, + { 0x4917, "a10_interface_thread" }, +// { 0x4918, "" }, +// { 0x4919, "" }, +// { 0x491A, "" }, +// { 0x491B, "" }, +// { 0x491C, "" }, +// { 0x491D, "" }, +// { 0x491E, "" }, +// { 0x491F, "" }, +// { 0x4920, "" }, + { 0x4921, "a10_interface_enable_playerhud" }, +// { 0x4922, "" }, + { 0x4923, "a10_interface_enable_view" }, +// { 0x4924, "" }, +// { 0x4925, "" }, + { 0x4926, "create_hud_static_overlay" }, +// { 0x4927, "" }, + { 0x4928, "create_hud_vertical_meter" }, + { 0x4929, "a10_set_target_hud_data" }, +// { 0x492A, "" }, + { 0x492B, "create_hud_upper_left" }, +// { 0x492C, "" }, +// { 0x492D, "" }, + { 0x492E, "create_hud_section" }, + { 0x492F, "string_is_valid" }, + { 0x4930, "create_hud_data_value" }, +// { 0x4931, "" }, +// { 0x4932, "" }, +// { 0x4933, "" }, +// { 0x4934, "" }, + { 0x4935, "a10_interface_enable_weapons" }, +// { 0x4936, "" }, +// { 0x4937, "" }, +// { 0x4938, "" }, + { 0x4939, "draw_tracking" }, +// { 0x493A, "" }, +// { 0x493B, "" }, +// { 0x493C, "" }, +// { 0x493D, "" }, +// { 0x493E, "" }, + { 0x493F, "a10_remove_target" }, +// { 0x4940, "" }, +// { 0x4941, "" }, +// { 0x4942, "" }, +// { 0x4943, "" }, +// { 0x4944, "" }, +// { 0x4945, "" }, +// { 0x4946, "" }, + { 0x4947, "rappel_weapon" }, + { 0x4948, "rappel_move_anim_state" }, + { 0x4949, "rappel_move_anim_state_time" }, +// { 0x494A, "" }, +// { 0x494B, "" }, + { 0x494C, "rappelhookup" }, + { 0x494D, "rappelunhook" }, + { 0x494E, "battledrone_spawner_think" }, +// { 0x494F, "" }, + { 0x4950, "destroydrone" }, + { 0x4951, "drone_setup" }, + { 0x4952, "attack_range" }, +// { 0x4953, "" }, +// { 0x4954, "" }, + { 0x4955, "drone_ongoal" }, + { 0x4956, "drone_ondeath" }, + { 0x4957, "get_opposing_team_name" }, + { 0x4958, "get_targets_list" }, +// { 0x4959, "" }, +// { 0x495A, "" }, + { 0x495B, "drone_findtarget" }, + { 0x495C, "battlefield_effects" }, + { 0x495D, "color_volume_advance" }, +// { 0x495E, "" }, +// { 0x495F, "" }, +// { 0x4960, "" }, + { 0x4961, "color_volume_advance_cleanup" }, +// { 0x4962, "" }, +// { 0x4963, "" }, +// { 0x4964, "" }, +// { 0x4965, "" }, +// { 0x4966, "" }, + { 0x4967, "color_volume_dupe_info" }, +// { 0x4968, "" }, +// { 0x4969, "" }, +// { 0x496A, "" }, +// { 0x496B, "" }, +// { 0x496C, "" }, +// { 0x496D, "" }, +// { 0x496E, "" }, +// { 0x496F, "" }, +// { 0x4970, "" }, +// { 0x4971, "" }, +// { 0x4972, "" }, +// { 0x4973, "" }, +// { 0x4974, "" }, +// { 0x4975, "" }, +// { 0x4976, "" }, +// { 0x4977, "" }, +// { 0x4978, "" }, +// { 0x4979, "" }, +// { 0x497A, "" }, +// { 0x497B, "" }, +// { 0x497C, "" }, +// { 0x497D, "" }, + { 0x497E, "anim_single_solo_gravity" }, +// { 0x497F, "" }, +// { 0x4980, "" }, +// { 0x4981, "" }, + { 0x4982, "stanceoffsethelper" }, + { 0x4983, "play_sonic_boom" }, +// { 0x4984, "" }, +// { 0x4985, "" }, +// { 0x4986, "" }, +// { 0x4987, "" }, +// { 0x4988, "" }, +// { 0x4989, "" }, +// { 0x498A, "" }, +// { 0x498B, "" }, + { 0x498C, "kill_vfx_before_building_explode" }, + { 0x498D, "smktrail_giant_flying_debri" }, +// { 0x498E, "" }, + { 0x498F, "falling_dust_player_hand" }, +// { 0x4990, "" }, +// { 0x4991, "" }, + { 0x4992, "building_falling_column_vfx" }, +// { 0x4993, "" }, + { 0x4994, "building_explosion_dof" }, + { 0x4995, "rappel_dof" }, + { 0x4996, "loop_skybox_hinds_alleyway" }, +// { 0x4997, "" }, +// { 0x4998, "" }, +// { 0x4999, "" }, +// { 0x499A, "" }, +// { 0x499B, "" }, +// { 0x499C, "" }, + { 0x499D, "door_kick_vfx_2" }, + { 0x499E, "tank_dirt_vfx" }, +// { 0x499F, "" }, +// { 0x49A0, "" }, +// { 0x49A1, "" }, +// { 0x49A2, "" }, +// { 0x49A3, "" }, +// { 0x49A4, "" }, +// { 0x49A5, "" }, +// { 0x49A6, "" }, +// { 0x49A7, "" }, + { 0x49A8, "monitor_grab_player_missile" }, +// { 0x49A9, "" }, +// { 0x49AA, "" }, +// { 0x49AB, "" }, +// { 0x49AC, "" }, + { 0x49AD, "objective_enemies_index" }, +// { 0x49AE, "" }, +// { 0x49AF, "" }, + { 0x49B0, "remainingenemycounthudelemnum" }, + { 0x49B1, "character/character_opforce_rushwood_ass_dust_a" }, +// { 0x49B2, "" }, + { 0x49B3, "character/character_opforce_rushwood_smg_dust_a" }, + { 0x49B4, "maps/createart/berlin_fog" }, +// { 0x49B5, "" }, +// { 0x49B6, "" }, +// { 0x49B7, "" }, +// { 0x49B8, "" }, +// { 0x49B9, "" }, + { 0x49BA, "mus_intro_flight_music_start_lng" }, + { 0x49BB, "a10_airstrike_ground_impact" }, + { 0x49BC, "granite_breach_ent" }, +// { 0x49BD, "" }, +// { 0x49BE, "" }, +// { 0x49BF, "" }, +// { 0x49C0, "" }, + { 0x49C1, "aud_fade_intro_flight_music_main" }, +// { 0x49C2, "" }, +// { 0x49C3, "" }, +// { 0x49C4, "" }, +// { 0x49C5, "" }, +// { 0x49C6, "" }, +// { 0x49C7, "" }, +// { 0x49C8, "" }, + { 0x49C9, "aud_start_water" }, +// { 0x49CA, "" }, +// { 0x49CB, "" }, +// { 0x49CC, "" }, + { 0x49CD, "aud_num_enemies_near" }, +// { 0x49CE, "" }, +// { 0x49CF, "" }, +// { 0x49D0, "" }, +// { 0x49D1, "" }, + { 0x49D2, "aud_sniper_tank_whizby" }, +// { 0x49D3, "" }, +// { 0x49D4, "" }, + { 0x49D5, "aud_fake_tank_battle" }, + { 0x49D6, "aud_play_fake_tanks" }, + { 0x49D7, "aud_select_pos_set" }, +// { 0x49D8, "" }, + { 0x49D9, "aud_ally_tank_shock_check" }, +// { 0x49DA, "" }, +// { 0x49DB, "" }, +// { 0x49DC, "" }, +// { 0x49DD, "" }, + { 0x49DE, "aud_berlin_finale_helicopter" }, + { 0x49DF, "aud_alena_scream" }, +// { 0x49E0, "" }, +// { 0x49E1, "" }, +// { 0x49E2, "" }, +// { 0x49E3, "" }, +// { 0x49E4, "" }, +// { 0x49E5, "" }, +// { 0x49E6, "" }, +// { 0x49E7, "" }, +// { 0x49E8, "" }, +// { 0x49E9, "" }, +// { 0x49EA, "" }, +// { 0x49EB, "" }, + { 0x49EC, "num_obj_ieds" }, +// { 0x49ED, "" }, +// { 0x49EE, "" }, + { 0x49EF, "allowexplodedeath_health" }, + { 0x49F0, "juggernaut_front_armor" }, +// { 0x49F1, "" }, +// { 0x49F2, "" }, + { 0x49F3, "ieds_active" }, +// { 0x49F4, "" }, +// { 0x49F5, "" }, +// { 0x49F6, "" }, + { 0x49F7, "ied_remove_obj_dot" }, +// { 0x49F8, "" }, + { 0x49F9, "combat_waves" }, +// { 0x49FA, "" }, +// { 0x49FB, "" }, + { 0x49FC, "set_speeds_when_dying" }, + { 0x49FD, "sniper_attractors" }, +// { 0x49FE, "" }, +// { 0x49FF, "" }, + { 0x4A00, "ieds_defused" }, + { 0x4A01, "combat_wave" }, +// { 0x4A02, "" }, +// { 0x4A03, "" }, +// { 0x4A04, "" }, +// { 0x4A05, "" }, +// { 0x4A06, "" }, +// { 0x4A07, "" }, + { 0x4A08, "ied_draw_logic" }, +// { 0x4A09, "" }, +// { 0x4A0A, "" }, +// { 0x4A0B, "" }, +// { 0x4A0C, "" }, +// { 0x4A0D, "" }, +// { 0x4A0E, "" }, +// { 0x4A0F, "" }, +// { 0x4A10, "" }, +// { 0x4A11, "" }, +// { 0x4A12, "" }, + { 0x4A13, "ied_detonate_logic" }, + { 0x4A14, "ied_detonate" }, + { 0x4A15, "ied_badplace_and_cleanup_logic" }, +// { 0x4A16, "" }, + { 0x4A17, "should_uavplayer_use_uav" }, +// { 0x4A18, "" }, + { 0x4A19, "laser_logic" }, +// { 0x4A1A, "" }, + { 0x4A1B, "tank_monitor_jugg_sight" }, +// { 0x4A1C, "" }, + { 0x4A1D, "tank_gunner_monitor_death" }, +// { 0x4A1E, "" }, +// { 0x4A1F, "" }, +// { 0x4A20, "" }, + { 0x4A21, "force_no_prone" }, + { 0x4A22, "make_jug_model" }, + { 0x4A23, "handle_juggernaut_health_dog_bite" }, +// { 0x4A24, "" }, +// { 0x4A25, "" }, + { 0x4A26, "handle_juggernaut_health" }, +// { 0x4A27, "" }, +// { 0x4A28, "" }, +// { 0x4A29, "" }, +// { 0x4A2A, "" }, +// { 0x4A2B, "" }, +// { 0x4A2C, "" }, +// { 0x4A2D, "" }, +// { 0x4A2E, "" }, +// { 0x4A2F, "" }, +// { 0x4A30, "" }, + { 0x4A31, "intro_hint" }, +// { 0x4A32, "" }, +// { 0x4A33, "" }, + { 0x4A34, "track_melee_kills" }, + { 0x4A35, "dog_think" }, +// { 0x4A36, "" }, + { 0x4A37, "vo_reaper_hint" }, +// { 0x4A38, "" }, +// { 0x4A39, "" }, +// { 0x4A3A, "" }, +// { 0x4A3B, "" }, + { 0x4A3C, "tertiary_weapon" }, +// { 0x4A3D, "" }, + { 0x4A3E, "pentacular_weapon" }, + { 0x4A3F, "sextant_weapon" }, +// { 0x4A40, "" }, +// { 0x4A41, "" }, +// { 0x4A42, "" }, +// { 0x4A43, "" }, +// { 0x4A44, "" }, +// { 0x4A45, "" }, +// { 0x4A46, "" }, +// { 0x4A47, "" }, +// { 0x4A48, "" }, +// { 0x4A49, "" }, + { 0x4A4A, "resolve_usable_object_conflicts" }, +// { 0x4A4B, "" }, + { 0x4A4C, "ground_guy" }, + { 0x4A4D, "lilbros" }, +// { 0x4A4E, "" }, +// { 0x4A4F, "" }, +// { 0x4A50, "" }, +// { 0x4A51, "" }, + { 0x4A52, "end_mission_if_downed" }, +// { 0x4A53, "" }, +// { 0x4A54, "" }, +// { 0x4A55, "" }, +// { 0x4A56, "" }, +// { 0x4A57, "" }, +// { 0x4A58, "" }, +// { 0x4A59, "" }, + { 0x4A5A, "setup_difficulty_settings" }, +// { 0x4A5B, "" }, +// { 0x4A5C, "" }, + { 0x4A5D, "if_heli_player_is_doing_all_the_work" }, +// { 0x4A5E, "" }, + { 0x4A5F, "thermal_vision_remove" }, + { 0x4A60, "wait_till_guys_in_lz_are_cleared" }, +// { 0x4A61, "" }, +// { 0x4A62, "" }, + { 0x4A63, "kill_all_close_enemies" }, +// { 0x4A64, "" }, + { 0x4A65, "get_rider_off_heli" }, +// { 0x4A66, "" }, + { 0x4A67, "setup_location0_start" }, + { 0x4A68, "setup_location1_street" }, + { 0x4A69, "rider_shoot_dist" }, +// { 0x4A6A, "" }, +// { 0x4A6B, "" }, +// { 0x4A6C, "" }, +// { 0x4A6D, "" }, +// { 0x4A6E, "" }, +// { 0x4A6F, "" }, +// { 0x4A70, "" }, +// { 0x4A71, "" }, + { 0x4A72, "player2_branch_handler" }, + { 0x4A73, "start_bomb_countdown" }, +// { 0x4A74, "" }, +// { 0x4A75, "" }, +// { 0x4A76, "" }, +// { 0x4A77, "" }, +// { 0x4A78, "" }, +// { 0x4A79, "" }, + { 0x4A7A, "white_out" }, +// { 0x4A7B, "" }, +// { 0x4A7C, "" }, + { 0x4A7D, "show_message_noprone" }, +// { 0x4A7E, "" }, +// { 0x4A7F, "" }, +// { 0x4A80, "" }, +// { 0x4A81, "" }, + { 0x4A82, "show_bomb_on_success" }, +// { 0x4A83, "" }, +// { 0x4A84, "" }, + { 0x4A85, "attach_briefcase_model" }, +// { 0x4A86, "" }, + { 0x4A87, "use_active" }, + { 0x4A88, "defuse_use_bar" }, + { 0x4A89, "defuse_time" }, +// { 0x4A8A, "" }, +// { 0x4A8B, "" }, +// { 0x4A8C, "" }, + { 0x4A8D, "smoke_grenade_ambush" }, + { 0x4A8E, "switch_to_thermal_reminder" }, + { 0x4A8F, "stop_thermal_reminder" }, +// { 0x4A90, "" }, +// { 0x4A91, "" }, + { 0x4A92, "setup_rappel_guys" }, +// { 0x4A93, "" }, + { 0x4A94, "rappel_from_roof" }, +// { 0x4A95, "" }, + { 0x4A96, "onslaught" }, + { 0x4A97, "kill_stragglers" }, + { 0x4A98, "kill_second_floor_guys" }, +// { 0x4A99, "" }, + { 0x4A9A, "handle_equipment" }, +// { 0x4A9B, "" }, +// { 0x4A9C, "" }, +// { 0x4A9D, "" }, +// { 0x4A9E, "" }, + { 0x4A9F, "setup_heli" }, + { 0x4AA0, "heli_set_hover_params" }, +// { 0x4AA1, "" }, +// { 0x4AA2, "" }, +// { 0x4AA3, "" }, +// { 0x4AA4, "" }, + { 0x4AA5, "end_messages" }, + { 0x4AA6, "lock_health_at" }, +// { 0x4AA7, "" }, +// { 0x4AA8, "" }, +// { 0x4AA9, "" }, + { 0x4AAA, "player_seats" }, + { 0x4AAB, "player_seats_jump" }, +// { 0x4AAC, "" }, + { 0x4AAD, "ai_seat" }, +// { 0x4AAE, "" }, +// { 0x4AAF, "" }, + { 0x4AB0, "create_ai_gun_position" }, + { 0x4AB1, "all_isdefined" }, + { 0x4AB2, "setup_playerlink_location" }, + { 0x4AB3, "monitor_goal_yaw_for_heli" }, +// { 0x4AB4, "" }, +// { 0x4AB5, "" }, + { 0x4AB6, "player_movement_limits" }, +// { 0x4AB7, "" }, +// { 0x4AB8, "" }, + { 0x4AB9, "wait_till_all_onboard" }, +// { 0x4ABA, "" }, +// { 0x4ABB, "" }, +// { 0x4ABC, "" }, + { 0x4ABD, "tank3" }, +// { 0x4ABE, "" }, +// { 0x4ABF, "" }, + { 0x4AC0, "monitor_tank_is_dead" }, +// { 0x4AC1, "" }, + { 0x4AC2, "tanks_target_players_when" }, + { 0x4AC3, "fx_setup" }, + { 0x4AC4, "generic_human" }, + { 0x4AC5, "script_prop_anims" }, + { 0x4AC6, "vo_setup" }, +// { 0x4AC7, "" }, +// { 0x4AC8, "" }, + { 0x4AC9, "handle_infinite_ammo_during_intro" }, + { 0x4ACA, "no_pentacular" }, +// { 0x4ACB, "" }, + { 0x4ACC, "end_text_message" }, +// { 0x4ACD, "" }, + { 0x4ACE, "disable_objective_warning" }, +// { 0x4ACF, "" }, +// { 0x4AD0, "" }, +// { 0x4AD1, "" }, + { 0x4AD2, "xmodelalias/alias_russian_military_gasmask_heads" }, + { 0x4AD3, "character/character_opforce_paris_gasmask" }, +// { 0x4AD4, "" }, + { 0x4AD5, "local_init" }, +// { 0x4AD6, "" }, +// { 0x4AD7, "" }, +// { 0x4AD8, "" }, +// { 0x4AD9, "" }, +// { 0x4ADA, "" }, +// { 0x4ADB, "" }, +// { 0x4ADC, "" }, +// { 0x4ADD, "" }, + { 0x4ADE, "play_distant_bombshake" }, +// { 0x4ADF, "" }, +// { 0x4AE0, "" }, +// { 0x4AE1, "" }, +// { 0x4AE2, "" }, + { 0x4AE3, "fx_btr_deathquake" }, + { 0x4AE4, "fx_trigger_manual_bombshake" }, +// { 0x4AE5, "" }, +// { 0x4AE6, "" }, + { 0x4AE7, "paris_aud_msg_handler" }, + { 0x4AE8, "damb_pars_sewer_pipe_stress" }, + { 0x4AE9, "infrastructure_metal_clangs" }, + { 0x4AEA, "first_ac130_bullet" }, +// { 0x4AEB, "" }, + { 0x4AEC, "mus_enter_book_store_done" }, + { 0x4AED, "mus_cross_courtyard2" }, +// { 0x4AEE, "" }, +// { 0x4AEF, "" }, +// { 0x4AF0, "" }, +// { 0x4AF1, "" }, +// { 0x4AF2, "" }, +// { 0x4AF3, "" }, + { 0x4AF4, "vfx_mig_count" }, + { 0x4AF5, "aud_play_vfx_dist_jet" }, +// { 0x4AF6, "" }, +// { 0x4AF7, "" }, +// { 0x4AF8, "" }, + { 0x4AF9, "aud_courtyard2_combat_done" }, + { 0x4AFA, "aud_paris_intro_flight" }, +// { 0x4AFB, "" }, +// { 0x4AFC, "" }, +// { 0x4AFD, "" }, +// { 0x4AFE, "" }, +// { 0x4AFF, "" }, +// { 0x4B00, "" }, +// { 0x4B01, "" }, + { 0x4B02, "aud_ac130_bullet_sound" }, +// { 0x4B03, "" }, +// { 0x4B04, "" }, +// { 0x4B05, "" }, + { 0x4B06, "aud_ac130_debris" }, +// { 0x4B07, "" }, +// { 0x4B08, "" }, + { 0x4B09, "aud_static_tvs_start" }, + { 0x4B0A, "aud_paris_b_positional_start" }, +// { 0x4B0B, "" }, +// { 0x4B0C, "" }, +// { 0x4B0D, "" }, +// { 0x4B0E, "" }, +// { 0x4B0F, "" }, + { 0x4B10, "aud_heli_mi17_kill" }, + { 0x4B11, "aud_uhaul_playskid" }, +// { 0x4B12, "" }, +// { 0x4B13, "" }, +// { 0x4B14, "" }, + { 0x4B15, "sewer_river_sound_handle" }, +// { 0x4B16, "" }, +// { 0x4B17, "" }, +// { 0x4B18, "" }, +// { 0x4B19, "" }, +// { 0x4B1A, "" }, + { 0x4B1B, "damb_paris_fire_start" }, +// { 0x4B1C, "" }, + { 0x4B1D, "rpg_explo_watch" }, +// { 0x4B1E, "" }, +// { 0x4B1F, "" }, +// { 0x4B20, "" }, +// { 0x4B21, "" }, +// { 0x4B22, "" }, + { 0x4B23, "aud_van_canal_part_2" }, + { 0x4B24, "aud_van_entering_tunnel" }, + { 0x4B25, "aud_van_tunnel_turn" }, + { 0x4B26, "aud_van_exiting_tunnel" }, +// { 0x4B27, "" }, + { 0x4B28, "aud_van_over_ledge" }, +// { 0x4B29, "" }, +// { 0x4B2A, "" }, +// { 0x4B2B, "" }, +// { 0x4B2C, "" }, +// { 0x4B2D, "" }, +// { 0x4B2E, "" }, +// { 0x4B2F, "" }, +// { 0x4B30, "" }, + { 0x4B31, "aud_gasmask_chatter_filter_on" }, +// { 0x4B32, "" }, +// { 0x4B33, "" }, +// { 0x4B34, "" }, +// { 0x4B35, "" }, + { 0x4B36, "getent_safe" }, +// { 0x4B37, "" }, +// { 0x4B38, "" }, +// { 0x4B39, "" }, + { 0x4B3A, "spawn_metrics_spawn_func" }, +// { 0x4B3B, "" }, +// { 0x4B3C, "" }, +// { 0x4B3D, "" }, +// { 0x4B3E, "" }, +// { 0x4B3F, "" }, + { 0x4B40, "spawn_metrics_waittill_deaths_reach" }, +// { 0x4B41, "" }, +// { 0x4B42, "" }, +// { 0x4B43, "" }, +// { 0x4B44, "" }, + { 0x4B45, "goto_node" }, +// { 0x4B46, "" }, +// { 0x4B47, "" }, +// { 0x4B48, "" }, +// { 0x4B49, "" }, + { 0x4B4A, "animname_is_overridden" }, + { 0x4B4B, "to_str" }, +// { 0x4B4C, "" }, +// { 0x4B4D, "" }, + { 0x4B4E, "_waittill" }, +// { 0x4B4F, "" }, +// { 0x4B50, "" }, +// { 0x4B51, "" }, +// { 0x4B52, "" }, +// { 0x4B53, "" }, +// { 0x4B54, "" }, +// { 0x4B55, "" }, + { 0x4B56, "vehicle_scripted_animation" }, +// { 0x4B57, "" }, + { 0x4B58, "last_velocity_ips" }, +// { 0x4B59, "" }, +// { 0x4B5A, "" }, + { 0x4B5B, "last_origin" }, +// { 0x4B5C, "" }, +// { 0x4B5D, "" }, +// { 0x4B5E, "" }, +// { 0x4B5F, "" }, +// { 0x4B60, "" }, +// { 0x4B61, "" }, +// { 0x4B62, "" }, +// { 0x4B63, "" }, + { 0x4B64, "player_control_off" }, +// { 0x4B65, "" }, +// { 0x4B66, "" }, +// { 0x4B67, "" }, +// { 0x4B68, "" }, + { 0x4B69, "gasmask_off_player" }, +// { 0x4B6A, "" }, +// { 0x4B6B, "" }, + { 0x4B6C, "gasmask" }, +// { 0x4B6D, "" }, +// { 0x4B6E, "" }, +// { 0x4B6F, "" }, +// { 0x4B70, "" }, +// { 0x4B71, "" }, +// { 0x4B72, "" }, + { 0x4B73, "euler_lerp" }, + { 0x4B74, "fire_while_moving" }, +// { 0x4B75, "" }, +// { 0x4B76, "" }, + { 0x4B77, "windy_tree_system" }, +// { 0x4B78, "" }, + { 0x4B79, "monitor_tree_damage" }, +// { 0x4B7A, "" }, + { 0x4B7B, "entity_blast_wind" }, + { 0x4B7C, "randomizer_create" }, + { 0x4B7D, "randomizer_get_no_repeat" }, +// { 0x4B7E, "" }, +// { 0x4B7F, "" }, +// { 0x4B80, "" }, +// { 0x4B81, "" }, +// { 0x4B82, "" }, +// { 0x4B83, "" }, +// { 0x4B84, "" }, +// { 0x4B85, "" }, +// { 0x4B86, "" }, + { 0x4B87, "wait_time" }, + { 0x4B88, "vehicle_detect_crash" }, +// { 0x4B89, "" }, +// { 0x4B8A, "" }, +// { 0x4B8B, "" }, +// { 0x4B8C, "" }, +// { 0x4B8D, "" }, +// { 0x4B8E, "" }, + { 0x4B8F, "paris_vehicle_death" }, + { 0x4B90, "vehicle_crash_when_driver_dies" }, +// { 0x4B91, "" }, +// { 0x4B92, "" }, +// { 0x4B93, "" }, + { 0x4B94, "vehicle_crash_now" }, +// { 0x4B95, "" }, + { 0x4B96, "crash_speed_ips" }, +// { 0x4B97, "" }, +// { 0x4B98, "" }, + { 0x4B99, "player_smooth_unclamp" }, +// { 0x4B9A, "" }, +// { 0x4B9B, "" }, +// { 0x4B9C, "" }, + { 0x4B9D, "bomb_truck_hide_windshield" }, +// { 0x4B9E, "" }, +// { 0x4B9F, "" }, +// { 0x4BA0, "" }, +// { 0x4BA1, "" }, + { 0x4BA2, "prepare_dialogue" }, + { 0x4BA3, "init_dialogue_flags" }, +// { 0x4BA4, "" }, +// { 0x4BA5, "" }, +// { 0x4BA6, "" }, +// { 0x4BA7, "" }, +// { 0x4BA8, "" }, +// { 0x4BA9, "" }, +// { 0x4BAA, "" }, +// { 0x4BAB, "" }, +// { 0x4BAC, "" }, +// { 0x4BAD, "" }, +// { 0x4BAE, "" }, +// { 0x4BAF, "" }, + { 0x4BB0, "across_the_courtyard_dialogue" }, + { 0x4BB1, "rpg_top_of_stairs_dialogue" }, +// { 0x4BB2, "" }, + { 0x4BB3, "ac130_dialogue" }, + { 0x4BB4, "mark_initial_targets_dialogue" }, + { 0x4BB5, "air_support_strobe_dialogue" }, + { 0x4BB6, "air_support_strobe_kills_dialogue" }, + { 0x4BB7, "last_killed_line" }, + { 0x4BB8, "down_the_alley_dialogue" }, +// { 0x4BB9, "" }, +// { 0x4BBA, "" }, +// { 0x4BBB, "" }, +// { 0x4BBC, "" }, + { 0x4BBD, "courtyard_2_clear_dialogue" }, +// { 0x4BBE, "" }, +// { 0x4BBF, "" }, +// { 0x4BC0, "" }, +// { 0x4BC1, "" }, +// { 0x4BC2, "" }, + { 0x4BC3, "bonus_2_max" }, +// { 0x4BC4, "" }, +// { 0x4BC5, "" }, +// { 0x4BC6, "" }, +// { 0x4BC7, "" }, + { 0x4BC8, "samples_total" }, +// { 0x4BC9, "" }, + { 0x4BCA, "crumbs" }, + { 0x4BCB, "obj_crumb" }, +// { 0x4BCC, "" }, +// { 0x4BCD, "" }, +// { 0x4BCE, "" }, +// { 0x4BCF, "" }, +// { 0x4BD0, "" }, +// { 0x4BD1, "" }, +// { 0x4BD2, "" }, +// { 0x4BD3, "" }, + { 0x4BD4, "explosion_scene" }, + { 0x4BD5, "doexplosion" }, + { 0x4BD6, "forced_magic_strobes" }, +// { 0x4BD7, "" }, +// { 0x4BD8, "" }, +// { 0x4BD9, "" }, + { 0x4BDA, "monitor_friendly_helicopter" }, +// { 0x4BDB, "" }, +// { 0x4BDC, "" }, +// { 0x4BDD, "" }, +// { 0x4BDE, "" }, + { 0x4BDF, "sample2_dudes" }, +// { 0x4BE0, "" }, + { 0x4BE1, "street_dudes3" }, + { 0x4BE2, "alley_gaz" }, + { 0x4BE3, "street_dudes2" }, +// { 0x4BE4, "" }, + { 0x4BE5, "top_street_gaz" }, +// { 0x4BE6, "" }, +// { 0x4BE7, "" }, + { 0x4BE8, "backstreet_dudes" }, + { 0x4BE9, "juggernaut_back_alley" }, +// { 0x4BEA, "" }, + { 0x4BEB, "bookstore_stairs_dudes" }, + { 0x4BEC, "bookstore_bottom_dudes" }, +// { 0x4BED, "" }, +// { 0x4BEE, "" }, +// { 0x4BEF, "" }, + { 0x4BF0, "hotel_stairs_dudes" }, +// { 0x4BF1, "" }, +// { 0x4BF2, "" }, + { 0x4BF3, "exit" }, +// { 0x4BF4, "" }, + { 0x4BF5, "stop_air_support_hint" }, +// { 0x4BF6, "" }, +// { 0x4BF7, "" }, + { 0x4BF8, "using_strobe" }, +// { 0x4BF9, "" }, +// { 0x4BFA, "" }, + { 0x4BFB, "air_support_strobe_fired_dialogue" }, +// { 0x4BFC, "" }, + { 0x4BFD, "give_juggernaut_bonus" }, +// { 0x4BFE, "" }, +// { 0x4BFF, "" }, +// { 0x4C00, "" }, + { 0x4C01, "maps/createart/so_jeep_paris_b_fog" }, + { 0x4C02, "maps/createart/so_jeep_paris_b_art" }, +// { 0x4C03, "" }, +// { 0x4C04, "" }, +// { 0x4C05, "" }, +// { 0x4C06, "" }, +// { 0x4C07, "" }, +// { 0x4C08, "" }, +// { 0x4C09, "" }, + { 0x4C0A, "fx_doorkick_dust" }, +// { 0x4C0B, "" }, +// { 0x4C0C, "" }, +// { 0x4C0D, "" }, +// { 0x4C0E, "" }, + { 0x4C0F, "fx_car_chase" }, +// { 0x4C10, "" }, +// { 0x4C11, "" }, +// { 0x4C12, "" }, +// { 0x4C13, "" }, +// { 0x4C14, "" }, +// { 0x4C15, "" }, +// { 0x4C16, "" }, +// { 0x4C17, "" }, +// { 0x4C18, "" }, + { 0x4C19, "fx_behindview_impact_diningset" }, + { 0x4C1A, "fx_behindview_impact_topiaryright" }, + { 0x4C1B, "fx_behindview_impact_topiaryleft" }, +// { 0x4C1C, "" }, +// { 0x4C1D, "" }, + { 0x4C1E, "fx_van_galleria_physics_wake" }, +// { 0x4C1F, "" }, +// { 0x4C20, "" }, +// { 0x4C21, "" }, + { 0x4C22, "fx_van_hit_fences" }, + { 0x4C23, "fx_sedan_escape_sparks_left" }, +// { 0x4C24, "" }, +// { 0x4C25, "" }, +// { 0x4C26, "" }, + { 0x4C27, "vehicle_scripts/_mig29" }, + { 0x4C28, "vehicle_scripts/_t72" }, +// { 0x4C29, "" }, +// { 0x4C2A, "" }, +// { 0x4C2B, "" }, +// { 0x4C2C, "" }, +// { 0x4C2D, "" }, + { 0x4C2E, "jeep" }, + { 0x4C2F, "setup_driver" }, +// { 0x4C30, "" }, +// { 0x4C31, "" }, +// { 0x4C32, "" }, +// { 0x4C33, "" }, +// { 0x4C34, "" }, +// { 0x4C35, "" }, + { 0x4C36, "obj_intel" }, +// { 0x4C37, "" }, + { 0x4C38, "obj_retrieve_intel" }, +// { 0x4C39, "" }, +// { 0x4C3A, "" }, +// { 0x4C3B, "" }, +// { 0x4C3C, "" }, + { 0x4C3D, "player_seat_create" }, + { 0x4C3E, "objective_index" }, + { 0x4C3F, "objective_additionalposition_index" }, +// { 0x4C40, "" }, +// { 0x4C41, "" }, +// { 0x4C42, "" }, +// { 0x4C43, "" }, +// { 0x4C44, "" }, +// { 0x4C45, "" }, + { 0x4C46, "player_seat_occupied_player_alive_unlinkable" }, +// { 0x4C47, "" }, +// { 0x4C48, "" }, + { 0x4C49, "setup_canal_path" }, +// { 0x4C4A, "" }, +// { 0x4C4B, "" }, + { 0x4C4C, "minimap_switching" }, +// { 0x4C4D, "" }, + { 0x4C4E, "give_claymores" }, +// { 0x4C4F, "" }, + { 0x4C50, "player_died_in_jeep_notify" }, +// { 0x4C51, "" }, +// { 0x4C52, "" }, + { 0x4C53, "stop_vehicle_if_player_dead" }, +// { 0x4C54, "" }, +// { 0x4C55, "" }, + { 0x4C56, "rpg_canal_start" }, +// { 0x4C57, "" }, + { 0x4C58, "set_flag_on_vehicle_death" }, +// { 0x4C59, "" }, + { 0x4C5A, "canal_combat_end" }, +// { 0x4C5B, "" }, +// { 0x4C5C, "" }, +// { 0x4C5D, "" }, +// { 0x4C5E, "" }, +// { 0x4C5F, "" }, +// { 0x4C60, "" }, +// { 0x4C61, "" }, +// { 0x4C62, "" }, +// { 0x4C63, "" }, +// { 0x4C64, "" }, +// { 0x4C65, "" }, +// { 0x4C66, "" }, +// { 0x4C67, "" }, + { 0x4C68, "staging_room_combat" }, +// { 0x4C69, "" }, + { 0x4C6A, "flashbang_staging_room" }, + { 0x4C6B, "flashbang_staging_room_guy_retreats" }, + { 0x4C6C, "flashbang_staging_room_guy_retreats_sprinting" }, +// { 0x4C6D, "" }, +// { 0x4C6E, "" }, + { 0x4C6F, "sewer_corridor_escape_combat" }, +// { 0x4C70, "" }, +// { 0x4C71, "" }, +// { 0x4C72, "" }, +// { 0x4C73, "" }, +// { 0x4C74, "" }, +// { 0x4C75, "" }, + { 0x4C76, "unlink_players_from_jeep" }, +// { 0x4C77, "" }, +// { 0x4C78, "" }, +// { 0x4C79, "" }, + { 0x4C7A, "ambient_helis_end" }, +// { 0x4C7B, "" }, +// { 0x4C7C, "" }, +// { 0x4C7D, "" }, +// { 0x4C7E, "" }, + { 0x4C7F, "download_progress" }, +// { 0x4C80, "" }, +// { 0x4C81, "" }, +// { 0x4C82, "" }, +// { 0x4C83, "" }, + { 0x4C84, "switchtosecs" }, +// { 0x4C85, "" }, +// { 0x4C86, "" }, +// { 0x4C87, "" }, + { 0x4C88, "hudelem_dltimer" }, +// { 0x4C89, "" }, + { 0x4C8A, "so_download_files" }, +// { 0x4C8B, "" }, + { 0x4C8C, "gas_staging_room" }, + { 0x4C8D, "gas_corridor" }, +// { 0x4C8E, "" }, +// { 0x4C8F, "" }, +// { 0x4C90, "" }, +// { 0x4C91, "" }, +// { 0x4C92, "" }, +// { 0x4C93, "" }, + { 0x4C94, "spawn_limit_by_player_count" }, +// { 0x4C95, "" }, + { 0x4C96, "turret_convergence_tweak" }, +// { 0x4C97, "" }, +// { 0x4C98, "" }, +// { 0x4C99, "" }, +// { 0x4C9A, "" }, +// { 0x4C9B, "" }, +// { 0x4C9C, "" }, + { 0x4C9D, "player_puts_gasmask_on" }, + { 0x4C9E, "player_gasmask_breathing" }, + { 0x4C9F, "should_stop_gasmask_hint" }, + { 0x4CA0, "gas_heartbeat" }, +// { 0x4CA1, "" }, + { 0x4CA2, "player_limp" }, + { 0x4CA3, "stumble_ref" }, +// { 0x4CA4, "" }, +// { 0x4CA5, "" }, +// { 0x4CA6, "" }, + { 0x4CA7, "mgon_delay" }, +// { 0x4CA8, "" }, +// { 0x4CA9, "" }, +// { 0x4CAA, "" }, +// { 0x4CAB, "" }, +// { 0x4CAC, "" }, +// { 0x4CAD, "" }, +// { 0x4CAE, "" }, +// { 0x4CAF, "" }, +// { 0x4CB0, "" }, + { 0x4CB1, "get_player_rig" }, +// { 0x4CB2, "" }, +// { 0x4CB3, "" }, +// { 0x4CB4, "" }, + { 0x4CB5, "radio_within_proximity" }, +// { 0x4CB6, "" }, +// { 0x4CB7, "" }, +// { 0x4CB8, "" }, +// { 0x4CB9, "" }, + { 0x4CBA, "wait_for_player" }, +// { 0x4CBB, "" }, +// { 0x4CBC, "" }, +// { 0x4CBD, "" }, +// { 0x4CBE, "" }, + { 0x4CBF, "distance_2d_squared" }, + { 0x4CC0, "trigger_wait_multiple_think" }, +// { 0x4CC1, "" }, +// { 0x4CC2, "" }, +// { 0x4CC3, "" }, +// { 0x4CC4, "" }, +// { 0x4CC5, "" }, +// { 0x4CC6, "" }, +// { 0x4CC7, "" }, +// { 0x4CC8, "" }, +// { 0x4CC9, "" }, +// { 0x4CCA, "" }, +// { 0x4CCB, "" }, +// { 0x4CCC, "" }, + { 0x4CCD, "link_door_to_clips" }, +// { 0x4CCE, "" }, +// { 0x4CCF, "" }, +// { 0x4CD0, "" }, + { 0x4CD1, "kick_door_open" }, + { 0x4CD2, "kick_door_open_reversehinge" }, +// { 0x4CD3, "" }, +// { 0x4CD4, "" }, +// { 0x4CD5, "" }, +// { 0x4CD6, "" }, +// { 0x4CD7, "" }, +// { 0x4CD8, "" }, +// { 0x4CD9, "" }, +// { 0x4CDA, "" }, +// { 0x4CDB, "" }, +// { 0x4CDC, "" }, +// { 0x4CDD, "" }, +// { 0x4CDE, "" }, + { 0x4CDF, "flag_on_damage" }, + { 0x4CE0, "anim_generic_reach_and_animate" }, +// { 0x4CE1, "" }, + { 0x4CE2, "kill_on_death" }, +// { 0x4CE3, "" }, +// { 0x4CE4, "" }, +// { 0x4CE5, "" }, +// { 0x4CE6, "" }, +// { 0x4CE7, "" }, +// { 0x4CE8, "" }, + { 0x4CE9, "nightvision_reflector_effect" }, +// { 0x4CEA, "" }, +// { 0x4CEB, "" }, +// { 0x4CEC, "" }, + { 0x4CED, "nightvision_on" }, + { 0x4CEE, "nightvision_started" }, + { 0x4CEF, "enable_ir_beacon" }, +// { 0x4CF0, "" }, +// { 0x4CF1, "" }, +// { 0x4CF2, "" }, +// { 0x4CF3, "" }, +// { 0x4CF4, "" }, + { 0x4CF5, "usingnvfx" }, + { 0x4CF6, "shouldbreaknvghintprint" }, +// { 0x4CF7, "" }, +// { 0x4CF8, "" }, +// { 0x4CF9, "" }, + { 0x4CFA, "cargo_heli_think" }, + { 0x4CFB, "build_heli_rumble_unique" }, +// { 0x4CFC, "" }, +// { 0x4CFD, "" }, + { 0x4CFE, "spawn_price" }, +// { 0x4CFF, "" }, +// { 0x4D00, "" }, +// { 0x4D01, "" }, +// { 0x4D02, "" }, +// { 0x4D03, "" }, +// { 0x4D04, "" }, + { 0x4D05, "new_intro_setup" }, + { 0x4D06, "docks_talking" }, +// { 0x4D07, "" }, + { 0x4D08, "dock_drag" }, + { 0x4D09, "drone_proper_death" }, +// { 0x4D0A, "" }, +// { 0x4D0B, "" }, +// { 0x4D0C, "" }, +// { 0x4D0D, "" }, +// { 0x4D0E, "" }, +// { 0x4D0F, "" }, +// { 0x4D10, "" }, +// { 0x4D11, "" }, +// { 0x4D12, "" }, + { 0x4D13, "kamarov_guys" }, + { 0x4D14, "enable_player_swim" }, +// { 0x4D15, "" }, +// { 0x4D16, "" }, +// { 0x4D17, "" }, +// { 0x4D18, "" }, +// { 0x4D19, "" }, +// { 0x4D1A, "" }, +// { 0x4D1B, "" }, + { 0x4D1C, "player_water_death" }, +// { 0x4D1D, "" }, +// { 0x4D1E, "" }, +// { 0x4D1F, "" }, +// { 0x4D20, "" }, +// { 0x4D21, "" }, +// { 0x4D22, "" }, +// { 0x4D23, "" }, + { 0x4D24, "team_move_2" }, +// { 0x4D25, "" }, +// { 0x4D26, "" }, +// { 0x4D27, "" }, +// { 0x4D28, "" }, +// { 0x4D29, "" }, + { 0x4D2A, "alert_on_fast_movement" }, +// { 0x4D2B, "" }, +// { 0x4D2C, "" }, + { 0x4D2D, "breathing_civ" }, +// { 0x4D2E, "" }, +// { 0x4D2F, "" }, + { 0x4D30, "docks_enemies_think" }, +// { 0x4D31, "" }, +// { 0x4D32, "" }, +// { 0x4D33, "" }, +// { 0x4D34, "" }, + { 0x4D35, "spot_light" }, +// { 0x4D36, "" }, + { 0x4D37, "pond_dump_bodies_check_abort" }, +// { 0x4D38, "" }, +// { 0x4D39, "" }, +// { 0x4D3A, "" }, +// { 0x4D3B, "" }, +// { 0x4D3C, "" }, + { 0x4D3D, "pond_dump_createbody2" }, + { 0x4D3E, "rocking_items" }, + { 0x4D3F, "water_rock" }, +// { 0x4D40, "" }, + { 0x4D41, "water_rock_angles" }, +// { 0x4D42, "" }, + { 0x4D43, "bridge_civ_think" }, +// { 0x4D44, "" }, +// { 0x4D45, "" }, +// { 0x4D46, "" }, +// { 0x4D47, "" }, +// { 0x4D48, "" }, +// { 0x4D49, "" }, +// { 0x4D4A, "" }, +// { 0x4D4B, "" }, +// { 0x4D4C, "" }, +// { 0x4D4D, "" }, +// { 0x4D4E, "" }, +// { 0x4D4F, "" }, +// { 0x4D50, "" }, +// { 0x4D51, "" }, +// { 0x4D52, "" }, +// { 0x4D53, "" }, + { 0x4D54, "remove_bulletshield" }, + { 0x4D55, "setup_kamarov" }, +// { 0x4D56, "" }, + { 0x4D57, "sewer_gate" }, + { 0x4D58, "kamarov_scene" }, +// { 0x4D59, "" }, +// { 0x4D5A, "" }, +// { 0x4D5B, "" }, +// { 0x4D5C, "" }, +// { 0x4D5D, "" }, + { 0x4D5E, "sewer_price_think" }, +// { 0x4D5F, "" }, +// { 0x4D60, "" }, +// { 0x4D61, "" }, +// { 0x4D62, "" }, +// { 0x4D63, "" }, +// { 0x4D64, "" }, + { 0x4D65, "leave_sewer" }, + { 0x4D66, "enable_sewer_walk" }, +// { 0x4D67, "" }, +// { 0x4D68, "" }, +// { 0x4D69, "" }, +// { 0x4D6A, "" }, +// { 0x4D6B, "" }, +// { 0x4D6C, "" }, +// { 0x4D6D, "" }, +// { 0x4D6E, "" }, +// { 0x4D6F, "" }, +// { 0x4D70, "" }, + { 0x4D71, "sandman_stop_look_convoy" }, + { 0x4D72, "sandman_knife_kill" }, +// { 0x4D73, "" }, +// { 0x4D74, "" }, +// { 0x4D75, "" }, +// { 0x4D76, "" }, +// { 0x4D77, "" }, +// { 0x4D78, "" }, +// { 0x4D79, "" }, +// { 0x4D7A, "" }, + { 0x4D7B, "alcove_sniper_nag" }, +// { 0x4D7C, "" }, +// { 0x4D7D, "" }, + { 0x4D7E, "alcove_snipers_dialogue" }, +// { 0x4D7F, "" }, +// { 0x4D80, "" }, + { 0x4D81, "alley_move_up" }, +// { 0x4D82, "" }, + { 0x4D83, "check_dead_bodies_think" }, +// { 0x4D84, "" }, +// { 0x4D85, "" }, + { 0x4D86, "teleport_on_spotted" }, +// { 0x4D87, "" }, + { 0x4D88, "helicopter_ai_mode" }, + { 0x4D89, "fx_ent" }, +// { 0x4D8A, "" }, + { 0x4D8B, "foot_patrol_incoming" }, + { 0x4D8C, "dog_growl" }, +// { 0x4D8D, "" }, + { 0x4D8E, "foot_patrol_backup" }, +// { 0x4D8F, "" }, + { 0x4D90, "alley_patrol_guys" }, +// { 0x4D91, "" }, +// { 0x4D92, "" }, +// { 0x4D93, "" }, + { 0x4D94, "hotel_room_radio" }, +// { 0x4D95, "" }, +// { 0x4D96, "" }, +// { 0x4D97, "" }, +// { 0x4D98, "" }, +// { 0x4D99, "" }, +// { 0x4D9A, "" }, +// { 0x4D9B, "" }, +// { 0x4D9C, "" }, +// { 0x4D9D, "" }, +// { 0x4D9E, "" }, +// { 0x4D9F, "" }, + { 0x4DA0, "rangetriggeroverride" }, +// { 0x4DA1, "" }, +// { 0x4DA2, "" }, + { 0x4DA3, "long_convoy_backup" }, + { 0x4DA4, "long_convoy_cut_the_player_some_slack" }, +// { 0x4DA5, "" }, +// { 0x4DA6, "" }, + { 0x4DA7, "long_convoy_sandman_exit" }, +// { 0x4DA8, "" }, + { 0x4DA9, "long_convoy_btr_think" }, +// { 0x4DAA, "" }, +// { 0x4DAB, "" }, + { 0x4DAC, "long_convoy_btr_stop" }, + { 0x4DAD, "move_btr_primary_light" }, +// { 0x4DAE, "" }, + { 0x4DAF, "long_convoy_close_tunnel_doors" }, +// { 0x4DB0, "" }, +// { 0x4DB1, "" }, + { 0x4DB2, "long_convoy_foot_think" }, +// { 0x4DB3, "" }, + { 0x4DB4, "clear_run_anim_trigger" }, +// { 0x4DB5, "" }, + { 0x4DB6, "dog_jump" }, +// { 0x4DB7, "" }, +// { 0x4DB8, "" }, +// { 0x4DB9, "" }, +// { 0x4DBA, "" }, +// { 0x4DBB, "" }, +// { 0x4DBC, "" }, +// { 0x4DBD, "" }, +// { 0x4DBE, "" }, + { 0x4DBF, "apt_shake" }, + { 0x4DC0, "apartment_exploder" }, + { 0x4DC1, "apartment_exploder_2" }, + { 0x4DC2, "sandman_apt_react" }, +// { 0x4DC3, "" }, +// { 0x4DC4, "" }, +// { 0x4DC5, "" }, +// { 0x4DC6, "" }, +// { 0x4DC7, "" }, + { 0x4DC8, "wait_for_unsilenced_weapon_pickup" }, +// { 0x4DC9, "" }, +// { 0x4DCA, "" }, +// { 0x4DCB, "" }, + { 0x4DCC, "inside_apt_resistance_anim_think" }, +// { 0x4DCD, "" }, + { 0x4DCE, "inside_apt_resistance_anim_then_idle_think" }, +// { 0x4DCF, "" }, +// { 0x4DD0, "" }, +// { 0x4DD1, "" }, + { 0x4DD2, "gunless_anim_check" }, +// { 0x4DD3, "" }, +// { 0x4DD4, "" }, +// { 0x4DD5, "" }, +// { 0x4DD6, "" }, +// { 0x4DD7, "" }, + { 0x4DD8, "mg_nag" }, +// { 0x4DD9, "" }, +// { 0x4DDA, "" }, +// { 0x4DDB, "" }, +// { 0x4DDC, "" }, + { 0x4DDD, "damage_taken" }, +// { 0x4DDE, "" }, +// { 0x4DDF, "" }, +// { 0x4DE0, "" }, +// { 0x4DE1, "" }, +// { 0x4DE2, "" }, +// { 0x4DE3, "" }, + { 0x4DE4, "tank_death_zone" }, +// { 0x4DE5, "" }, + { 0x4DE6, "tank_big_explosion" }, + { 0x4DE7, "explosion_deaths" }, +// { 0x4DE8, "" }, +// { 0x4DE9, "" }, +// { 0x4DEA, "" }, + { 0x4DEB, "tank_find_targets" }, +// { 0x4DEC, "" }, + { 0x4DED, "stop_the_killing" }, +// { 0x4DEE, "" }, +// { 0x4DEF, "" }, +// { 0x4DF0, "" }, +// { 0x4DF1, "" }, +// { 0x4DF2, "" }, + { 0x4DF3, "spotlight_default_target" }, +// { 0x4DF4, "" }, +// { 0x4DF5, "" }, +// { 0x4DF6, "" }, +// { 0x4DF7, "" }, + { 0x4DF8, "tank_badplace" }, +// { 0x4DF9, "" }, + { 0x4DFA, "btr_randomly_fire" }, + { 0x4DFB, "run_to_square" }, +// { 0x4DFC, "" }, +// { 0x4DFD, "" }, +// { 0x4DFE, "" }, +// { 0x4DFF, "" }, +// { 0x4E00, "" }, +// { 0x4E01, "" }, +// { 0x4E02, "" }, + { 0x4E03, "fake_smoke_grenade" }, + { 0x4E04, "wait_for_player_to_engage" }, + { 0x4E05, "secure_white_building" }, +// { 0x4E06, "" }, +// { 0x4E07, "" }, + { 0x4E08, "bank_backup_think" }, + { 0x4E09, "clear_ignore_on_spotted" }, + { 0x4E0A, "vignette_loop_setup" }, + { 0x4E0B, "run_to_delete_node" }, +// { 0x4E0C, "" }, +// { 0x4E0D, "" }, +// { 0x4E0E, "" }, +// { 0x4E0F, "" }, +// { 0x4E10, "" }, +// { 0x4E11, "" }, +// { 0x4E12, "" }, + { 0x4E13, "patrol_chopper" }, +// { 0x4E14, "" }, + { 0x4E15, "heli_spot_movetime" }, +// { 0x4E16, "" }, + { 0x4E17, "helicopter_searchlight_path" }, + { 0x4E18, "helicopter_searchlight_on" }, + { 0x4E19, "fx_tag" }, +// { 0x4E1A, "" }, +// { 0x4E1B, "" }, + { 0x4E1C, "current_turret_target" }, + { 0x4E1D, "move_dummy_to" }, + { 0x4E1E, "helicopter_setturrettargetent" }, +// { 0x4E1F, "" }, +// { 0x4E20, "" }, + { 0x4E21, "helicopter_searchlight_effect" }, + { 0x4E22, "spot_radius" }, +// { 0x4E23, "" }, + { 0x4E24, "searchlight_target_death" }, + { 0x4E25, "heli_scan_update" }, +// { 0x4E26, "" }, + { 0x4E27, "heli_teleport" }, + { 0x4E28, "heli_default_target_trigger" }, +// { 0x4E29, "" }, +// { 0x4E2A, "" }, +// { 0x4E2B, "" }, +// { 0x4E2C, "" }, + { 0x4E2D, "stop_last_spot_light" }, + { 0x4E2E, "spot_light_death" }, +// { 0x4E2F, "" }, + { 0x4E30, "turn_on_heli_spot" }, +// { 0x4E31, "" }, +// { 0x4E32, "" }, +// { 0x4E33, "" }, +// { 0x4E34, "" }, + { 0x4E35, "paired_death_restart" }, + { 0x4E36, "paired_death_group" }, + { 0x4E37, "paired_death_max_distance" }, +// { 0x4E38, "" }, +// { 0x4E39, "" }, + { 0x4E3A, "paired_death_wait" }, + { 0x4E3B, "paired_death_add" }, +// { 0x4E3C, "" }, +// { 0x4E3D, "" }, +// { 0x4E3E, "" }, +// { 0x4E3F, "" }, +// { 0x4E40, "" }, +// { 0x4E41, "" }, + { 0x4E42, "custom_friendly_spotted" }, + { 0x4E43, "stop_anim_on_spotted" }, + { 0x4E44, "sandman_follow_path" }, + { 0x4E45, "active_patrol" }, + { 0x4E46, "flashlight" }, +// { 0x4E47, "" }, +// { 0x4E48, "" }, + { 0x4E49, "attachflashlight_removeonspotted" }, +// { 0x4E4A, "" }, +// { 0x4E4B, "" }, +// { 0x4E4C, "" }, +// { 0x4E4D, "" }, +// { 0x4E4E, "" }, + { 0x4E4F, "notify_on_death_or_damage" }, +// { 0x4E50, "" }, +// { 0x4E51, "" }, + { 0x4E52, "last_killfirm_time" }, + { 0x4E53, "last_killfirm_timeout" }, + { 0x4E54, "physics_explosion_trigger" }, +// { 0x4E55, "" }, + { 0x4E56, "sandman_spotted_notify" }, +// { 0x4E57, "" }, +// { 0x4E58, "" }, + { 0x4E59, "sandman_end_encounter" }, +// { 0x4E5A, "" }, +// { 0x4E5B, "" }, +// { 0x4E5C, "" }, +// { 0x4E5D, "" }, +// { 0x4E5E, "" }, +// { 0x4E5F, "" }, +// { 0x4E60, "" }, +// { 0x4E61, "" }, + { 0x4E62, "btr_target_player" }, + { 0x4E63, "fire_at_target" }, +// { 0x4E64, "" }, +// { 0x4E65, "" }, +// { 0x4E66, "" }, +// { 0x4E67, "" }, + { 0x4E68, "ripples_on_body" }, + { 0x4E69, "custom_animset_run_move" }, + { 0x4E6A, "turn_on_streetlight_trigger" }, +// { 0x4E6B, "" }, +// { 0x4E6C, "" }, +// { 0x4E6D, "" }, +// { 0x4E6E, "" }, +// { 0x4E6F, "" }, + { 0x4E70, "physics_jolt_trigger" }, +// { 0x4E71, "" }, + { 0x4E72, "_play_fx" }, +// { 0x4E73, "" }, +// { 0x4E74, "" }, +// { 0x4E75, "" }, + { 0x4E76, "fog" }, +// { 0x4E77, "" }, +// { 0x4E78, "" }, + { 0x4E79, "random_bloodspurt" }, +// { 0x4E7A, "" }, + { 0x4E7B, "force_deathquote" }, +// { 0x4E7C, "" }, +// { 0x4E7D, "" }, +// { 0x4E7E, "" }, +// { 0x4E7F, "" }, +// { 0x4E80, "" }, + { 0x4E81, "male_heads" }, +// { 0x4E82, "" }, +// { 0x4E83, "" }, +// { 0x4E84, "" }, + { 0x4E85, "oldignoreall" }, + { 0x4E86, "force_flash_setup" }, +// { 0x4E87, "" }, + { 0x4E88, "force_flash_extra" }, +// { 0x4E89, "" }, +// { 0x4E8A, "" }, +// { 0x4E8B, "" }, +// { 0x4E8C, "" }, + { 0x4E8D, "flashbang_track_setup" }, +// { 0x4E8E, "" }, +// { 0x4E8F, "" }, +// { 0x4E90, "" }, +// { 0x4E91, "" }, +// { 0x4E92, "" }, +// { 0x4E93, "" }, +// { 0x4E94, "" }, +// { 0x4E95, "" }, + { 0x4E96, "stealth_attempt_alert_clear" }, +// { 0x4E97, "" }, +// { 0x4E98, "" }, +// { 0x4E99, "" }, +// { 0x4E9A, "" }, +// { 0x4E9B, "" }, +// { 0x4E9C, "" }, +// { 0x4E9D, "" }, +// { 0x4E9E, "" }, + { 0x4E9F, "active_patrol_light_swap" }, + { 0x4EA0, "patrol_light_swap" }, +// { 0x4EA1, "" }, + { 0x4EA2, "on_path_end_remove_gun_light" }, +// { 0x4EA3, "" }, +// { 0x4EA4, "" }, +// { 0x4EA5, "" }, +// { 0x4EA6, "" }, +// { 0x4EA7, "" }, +// { 0x4EA8, "" }, +// { 0x4EA9, "" }, +// { 0x4EAA, "" }, +// { 0x4EAB, "" }, + { 0x4EAC, "poi_path_get_distance_along" }, +// { 0x4EAD, "" }, + { 0x4EAE, "poi_pathing_calculate_goal_pos" }, +// { 0x4EAF, "" }, +// { 0x4EB0, "" }, + { 0x4EB1, "poi_added_dialog" }, + { 0x4EB2, "poi_team_member_ignore_think" }, + { 0x4EB3, "poi_team_member_scrub" }, +// { 0x4EB4, "" }, +// { 0x4EB5, "" }, +// { 0x4EB6, "" }, +// { 0x4EB7, "" }, +// { 0x4EB8, "" }, +// { 0x4EB9, "" }, + { 0x4EBA, "poi_collectible_add" }, +// { 0x4EBB, "" }, +// { 0x4EBC, "" }, +// { 0x4EBD, "" }, +// { 0x4EBE, "" }, + { 0x4EBF, "test_brake_lights" }, +// { 0x4EC0, "" }, + { 0x4EC1, "vehicle_scripts/_btr80" }, +// { 0x4EC2, "" }, +// { 0x4EC3, "" }, + { 0x4EC4, "maps/createfx/prague_fx" }, +// { 0x4EC5, "" }, +// { 0x4EC6, "" }, +// { 0x4EC7, "" }, +// { 0x4EC8, "" }, +// { 0x4EC9, "" }, +// { 0x4ECA, "" }, +// { 0x4ECB, "" }, + { 0x4ECC, "reaction_sleep" }, + { 0x4ECD, "reaction_sleep_wait_wakeup" }, +// { 0x4ECE, "" }, + { 0x4ECF, "reaction_proc" }, +// { 0x4ED0, "" }, + { 0x4ED1, "special_death_proc" }, +// { 0x4ED2, "" }, + { 0x4ED3, "animate_props_on_death" }, +// { 0x4ED4, "" }, +// { 0x4ED5, "" }, + { 0x4ED6, "get_ent" }, + { 0x4ED7, "get_node" }, +// { 0x4ED8, "" }, +// { 0x4ED9, "" }, +// { 0x4EDA, "" }, +// { 0x4EDB, "" }, + { 0x4EDC, "maps/_stealth_anims" }, +// { 0x4EDD, "" }, +// { 0x4EDE, "" }, + { 0x4EDF, "spec_ops_map_prep" }, + { 0x4EE0, "entity_clean_up" }, +// { 0x4EE1, "" }, +// { 0x4EE2, "" }, +// { 0x4EE3, "" }, + { 0x4EE4, "rotate_door" }, +// { 0x4EE5, "" }, + { 0x4EE6, "disconnect_so_prague_paths" }, + { 0x4EE7, "adjust_lights" }, + { 0x4EE8, "init_mission_flags" }, +// { 0x4EE9, "" }, +// { 0x4EEA, "" }, + { 0x4EEB, "so_prague_ai_prespot_time" }, +// { 0x4EEC, "" }, + { 0x4EED, "so_prague_poi_see_delay" }, +// { 0x4EEE, "" }, +// { 0x4EEF, "" }, +// { 0x4EF0, "" }, +// { 0x4EF1, "" }, +// { 0x4EF2, "" }, +// { 0x4EF3, "" }, +// { 0x4EF4, "" }, + { 0x4EF5, "start_yard" }, +// { 0x4EF6, "" }, +// { 0x4EF7, "" }, +// { 0x4EF8, "" }, +// { 0x4EF9, "" }, +// { 0x4EFA, "" }, + { 0x4EFB, "maps/_idle_lean_smoke" }, +// { 0x4EFC, "" }, +// { 0x4EFD, "" }, + { 0x4EFE, "maps/_idle_sleep" }, +// { 0x4EFF, "" }, + { 0x4F00, "maps/_idle_smoke_balcony" }, + { 0x4F01, "on_spawn_axis" }, +// { 0x4F02, "" }, +// { 0x4F03, "" }, +// { 0x4F04, "" }, +// { 0x4F05, "" }, +// { 0x4F06, "" }, +// { 0x4F07, "" }, +// { 0x4F08, "" }, +// { 0x4F09, "" }, + { 0x4F0A, "on_stealth_spotted_clear_stealth_kill_data" }, +// { 0x4F0B, "" }, + { 0x4F0C, "on_level_alert_spawn_backup" }, +// { 0x4F0D, "" }, + { 0x4F0E, "so_prague_recover_lines" }, + { 0x4F0F, "dialog_on_player_weapon_change" }, +// { 0x4F10, "" }, +// { 0x4F11, "" }, +// { 0x4F12, "" }, +// { 0x4F13, "" }, + { 0x4F14, "setup_stealth" }, +// { 0x4F15, "" }, + { 0x4F16, "stealth_collect_corpse_override" }, + { 0x4F17, "stealth_event_distance_override" }, + { 0x4F18, "stealth_event_distance_override_apartment" }, +// { 0x4F19, "" }, +// { 0x4F1A, "" }, +// { 0x4F1B, "" }, +// { 0x4F1C, "" }, +// { 0x4F1D, "" }, +// { 0x4F1E, "" }, +// { 0x4F1F, "" }, + { 0x4F20, "aim_target" }, + { 0x4F21, "church_enc_street_execution_disable_stealth_events" }, + { 0x4F22, "on_spawn_ai_church_steps" }, +// { 0x4F23, "" }, +// { 0x4F24, "" }, + { 0x4F25, "on_aware_ai_church_street" }, +// { 0x4F26, "" }, +// { 0x4F27, "" }, +// { 0x4F28, "" }, +// { 0x4F29, "" }, +// { 0x4F2A, "" }, +// { 0x4F2B, "" }, +// { 0x4F2C, "" }, +// { 0x4F2D, "" }, + { 0x4F2E, "on_death_ai_alley_civ" }, + { 0x4F2F, "on_escape_ai_alley_civ" }, + { 0x4F30, "on_spawn_ai_alley_dog" }, +// { 0x4F31, "" }, +// { 0x4F32, "" }, +// { 0x4F33, "" }, + { 0x4F34, "encounter_alley_alert" }, + { 0x4F35, "on_enemy_ai_alley_dog" }, +// { 0x4F36, "" }, +// { 0x4F37, "" }, +// { 0x4F38, "" }, +// { 0x4F39, "" }, +// { 0x4F3A, "" }, +// { 0x4F3B, "" }, + { 0x4F3C, "on_spawn_ai_yard_patroller" }, +// { 0x4F3D, "" }, +// { 0x4F3E, "" }, + { 0x4F3F, "encounter_apartment" }, +// { 0x4F40, "" }, + { 0x4F41, "encounter_apartment_spawn_ai" }, + { 0x4F42, "encounter_apartment_spawn_patroller_with_flashlight" }, +// { 0x4F43, "" }, +// { 0x4F44, "" }, +// { 0x4F45, "" }, +// { 0x4F46, "" }, +// { 0x4F47, "" }, +// { 0x4F48, "" }, +// { 0x4F49, "" }, +// { 0x4F4A, "" }, + { 0x4F4B, "poi_mid_fence_hop" }, +// { 0x4F4C, "" }, +// { 0x4F4D, "" }, +// { 0x4F4E, "" }, +// { 0x4F4F, "" }, + { 0x4F50, "poi_fence_loc_index" }, + { 0x4F51, "encounter_quad_spawn_ai" }, +// { 0x4F52, "" }, +// { 0x4F53, "" }, + { 0x4F54, "encounter_quad_execution" }, +// { 0x4F55, "" }, + { 0x4F56, "encounter_quad_execution_shoot" }, +// { 0x4F57, "" }, + { 0x4F58, "on_death_ai_civ_quad" }, +// { 0x4F59, "" }, + { 0x4F5A, "on_saved_ai_quad_execution" }, +// { 0x4F5B, "" }, +// { 0x4F5C, "" }, +// { 0x4F5D, "" }, +// { 0x4F5E, "" }, +// { 0x4F5F, "" }, +// { 0x4F60, "" }, +// { 0x4F61, "" }, +// { 0x4F62, "" }, +// { 0x4F63, "" }, +// { 0x4F64, "" }, +// { 0x4F65, "" }, +// { 0x4F66, "" }, +// { 0x4F67, "" }, +// { 0x4F68, "" }, +// { 0x4F69, "" }, +// { 0x4F6A, "" }, + { 0x4F6B, "build_technical_death_custom_fx" }, +// { 0x4F6C, "" }, + { 0x4F6D, "build_technical_m2_death" }, + { 0x4F6E, "build_technical_instant_death" }, +// { 0x4F6F, "" }, +// { 0x4F70, "" }, +// { 0x4F71, "" }, + { 0x4F72, "vehicle_scripts/_technical_aa" }, +// { 0x4F73, "" }, +// { 0x4F74, "" }, + { 0x4F75, "vehicle_scripts/_technical_payback" }, +// { 0x4F76, "" }, +// { 0x4F77, "" }, +// { 0x4F78, "" }, + { 0x4F79, "maps/animated_models/highrise_fencetarp_03" }, +// { 0x4F7A, "" }, +// { 0x4F7B, "" }, +// { 0x4F7C, "" }, +// { 0x4F7D, "" }, +// { 0x4F7E, "" }, +// { 0x4F7F, "" }, +// { 0x4F80, "" }, +// { 0x4F81, "" }, +// { 0x4F82, "" }, +// { 0x4F83, "" }, +// { 0x4F84, "" }, +// { 0x4F85, "" }, + { 0x4F86, "find_unique_shanty_ent" }, + { 0x4F87, "shanty_mortar_destruct" }, +// { 0x4F88, "" }, +// { 0x4F89, "" }, + { 0x4F8A, "shanty_brush_destruct" }, +// { 0x4F8B, "" }, + { 0x4F8C, "afr_fence_rattle" }, +// { 0x4F8D, "" }, +// { 0x4F8E, "" }, +// { 0x4F8F, "" }, + { 0x4F90, "fx_africa_dustrunners" }, +// { 0x4F91, "" }, +// { 0x4F92, "" }, +// { 0x4F93, "" }, + { 0x4F94, "set_guy_on_fire" }, + { 0x4F95, "introsandstorm" }, +// { 0x4F96, "" }, +// { 0x4F97, "" }, +// { 0x4F98, "" }, +// { 0x4F99, "" }, + { 0x4F9A, "enable_river_dof_condition" }, +// { 0x4F9B, "" }, +// { 0x4F9C, "" }, +// { 0x4F9D, "" }, +// { 0x4F9E, "" }, +// { 0x4F9F, "" }, +// { 0x4FA0, "" }, +// { 0x4FA1, "" }, + { 0x4FA2, "fx_stop_dust" }, + { 0x4FA3, "church_breach_vfx" }, +// { 0x4FA4, "" }, + { 0x4FA5, "hyena_attack_fx" }, +// { 0x4FA6, "" }, +// { 0x4FA7, "" }, + { 0x4FA8, "hyena_camera_shake" }, + { 0x4FA9, "shadow_mortar_lerp" }, +// { 0x4FAA, "" }, + { 0x4FAB, "mortar_explosion_0_fx" }, +// { 0x4FAC, "" }, + { 0x4FAD, "mortar_explosion_2_fx" }, +// { 0x4FAE, "" }, +// { 0x4FAF, "" }, +// { 0x4FB0, "" }, + { 0x4FB1, "mortar_explosion_6_fx" }, +// { 0x4FB2, "" }, +// { 0x4FB3, "" }, +// { 0x4FB4, "" }, +// { 0x4FB5, "" }, +// { 0x4FB6, "" }, +// { 0x4FB7, "" }, +// { 0x4FB8, "" }, +// { 0x4FB9, "" }, +// { 0x4FBA, "" }, +// { 0x4FBB, "" }, + { 0x4FBC, "aud_config" }, +// { 0x4FBD, "" }, +// { 0x4FBE, "" }, +// { 0x4FBF, "" }, +// { 0x4FC0, "" }, +// { 0x4FC1, "" }, +// { 0x4FC2, "" }, + { 0x4FC3, "aud_init_level_flags" }, +// { 0x4FC4, "" }, + { 0x4FC5, "rbm_tech2" }, +// { 0x4FC6, "" }, +// { 0x4FC7, "" }, +// { 0x4FC8, "" }, +// { 0x4FC9, "" }, +// { 0x4FCA, "" }, +// { 0x4FCB, "" }, + { 0x4FCC, "aud_mortar_run_shell_incoming" }, +// { 0x4FCD, "" }, +// { 0x4FCE, "" }, +// { 0x4FCF, "" }, +// { 0x4FD0, "" }, + { 0x4FD1, "snoring_guard_deathwatch" }, +// { 0x4FD2, "" }, +// { 0x4FD3, "" }, +// { 0x4FD4, "" }, +// { 0x4FD5, "" }, +// { 0x4FD6, "" }, + { 0x4FD7, "aud_tech_explode_watch" }, +// { 0x4FD8, "" }, +// { 0x4FD9, "" }, +// { 0x4FDA, "" }, +// { 0x4FDB, "" }, +// { 0x4FDC, "" }, +// { 0x4FDD, "" }, + { 0x4FDE, "aud_warl_start_river_rain_drops" }, + { 0x4FDF, "aud_warl_stop_river_rain_drops" }, + { 0x4FE0, "aud_warl_start_sewer_pipe_interiorflow" }, + { 0x4FE1, "aud_warl_stop_sewer_pipe_interiorflow" }, + { 0x4FE2, "aud_warl_play_sound_at" }, + { 0x4FE3, "aud_prepare_church_breach" }, + { 0x4FE4, "aud_tech_loops" }, +// { 0x4FE5, "" }, +// { 0x4FE6, "" }, +// { 0x4FE7, "" }, +// { 0x4FE8, "" }, +// { 0x4FE9, "" }, +// { 0x4FEA, "" }, + { 0x4FEB, "mi17_circle_overhead" }, +// { 0x4FEC, "" }, +// { 0x4FED, "" }, + { 0x4FEE, "aud_warl_finale" }, +// { 0x4FEF, "" }, +// { 0x4FF0, "" }, +// { 0x4FF1, "" }, + { 0x4FF2, "aud_delay_scale_up" }, +// { 0x4FF3, "" }, +// { 0x4FF4, "" }, +// { 0x4FF5, "" }, +// { 0x4FF6, "" }, +// { 0x4FF7, "" }, + { 0x4FF8, "remove_hint" }, + { 0x4FF9, "loot_vo" }, +// { 0x4FFA, "" }, + { 0x4FFB, "play_vo_line" }, +// { 0x4FFC, "" }, +// { 0x4FFD, "" }, +// { 0x4FFE, "" }, +// { 0x4FFF, "" }, + { 0x5000, "open_warlord_path_blockers" }, +// { 0x5001, "" }, +// { 0x5002, "" }, +// { 0x5003, "" }, +// { 0x5004, "" }, +// { 0x5005, "" }, +// { 0x5006, "" }, +// { 0x5007, "" }, +// { 0x5008, "" }, + { 0x5009, "maxlootcount" }, +// { 0x500A, "" }, + { 0x500B, "maxkillsrequired" }, +// { 0x500C, "" }, +// { 0x500D, "" }, +// { 0x500E, "" }, + { 0x500F, "numlootfound" }, + { 0x5010, "create_loot_hud" }, +// { 0x5011, "" }, +// { 0x5012, "" }, +// { 0x5013, "" }, +// { 0x5014, "" }, +// { 0x5015, "" }, +// { 0x5016, "" }, + { 0x5017, "so_warlord_hardened" }, + { 0x5018, "so_warlord_veteran" }, + { 0x5019, "setup_enemy_spawn_settings" }, +// { 0x501A, "" }, +// { 0x501B, "" }, + { 0x501C, "add_death_function" }, +// { 0x501D, "" }, +// { 0x501E, "" }, +// { 0x501F, "" }, +// { 0x5020, "" }, +// { 0x5021, "" }, +// { 0x5022, "" }, + { 0x5023, "setup_player_settings" }, +// { 0x5024, "" }, +// { 0x5025, "" }, +// { 0x5026, "" }, +// { 0x5027, "" }, +// { 0x5028, "" }, +// { 0x5029, "" }, +// { 0x502A, "" }, +// { 0x502B, "" }, +// { 0x502C, "" }, +// { 0x502D, "" }, +// { 0x502E, "" }, +// { 0x502F, "" }, +// { 0x5030, "" }, +// { 0x5031, "" }, +// { 0x5032, "" }, +// { 0x5033, "" }, +// { 0x5034, "" }, +// { 0x5035, "" }, +// { 0x5036, "" }, + { 0x5037, "monitor_laser_fire" }, + { 0x5038, "lasertarget" }, + { 0x5039, "warlord_laser_designate_target" }, +// { 0x503A, "" }, + { 0x503B, "laserlockstarted" }, +// { 0x503C, "" }, +// { 0x503D, "" }, + { 0x503E, "isstillvalidtarget" }, + { 0x503F, "cleartarget" }, +// { 0x5040, "" }, +// { 0x5041, "" }, + { 0x5042, "target_org" }, +// { 0x5043, "" }, +// { 0x5044, "" }, +// { 0x5045, "" }, + { 0x5046, "run_church_ai" }, +// { 0x5047, "" }, +// { 0x5048, "" }, + { 0x5049, "run_random_dog_spawner" }, + { 0x504A, "church_intial_ai" }, +// { 0x504B, "" }, +// { 0x504C, "" }, +// { 0x504D, "" }, +// { 0x504E, "" }, +// { 0x504F, "" }, +// { 0x5050, "" }, + { 0x5051, "targetname_spawn" }, +// { 0x5052, "" }, +// { 0x5053, "" }, +// { 0x5054, "" }, +// { 0x5055, "" }, +// { 0x5056, "" }, +// { 0x5057, "" }, +// { 0x5058, "" }, +// { 0x5059, "" }, +// { 0x505A, "" }, + { 0x505B, "rocket_lfe" }, +// { 0x505C, "" }, + { 0x505D, "max_bullets" }, +// { 0x505E, "" }, + { 0x505F, "is_chopper_zoomout_playing" }, +// { 0x5060, "" }, + { 0x5061, "voprimeindex" }, + { 0x5062, "voprime" }, +// { 0x5063, "" }, +// { 0x5064, "" }, +// { 0x5065, "" }, + { 0x5066, "prime1" }, +// { 0x5067, "" }, + { 0x5068, "bstormstarted" }, +// { 0x5069, "" }, +// { 0x506A, "" }, + { 0x506B, "intro_unmute" }, +// { 0x506C, "" }, +// { 0x506D, "" }, +// { 0x506E, "" }, + { 0x506F, "intro_chopper_flyby" }, + { 0x5070, "intro_chopper_missile" }, +// { 0x5071, "" }, +// { 0x5072, "" }, + { 0x5073, "jeepsound" }, +// { 0x5074, "" }, + { 0x5075, "hummer_alpha_audio" }, +// { 0x5076, "" }, + { 0x5077, "hummer_bravo_acceleration" }, + { 0x5078, "intro_time_begin" }, + { 0x5079, "hummer_bravo_audio" }, + { 0x507A, "hummer_bravo_audio_idle" }, +// { 0x507B, "" }, +// { 0x507C, "" }, +// { 0x507D, "" }, + { 0x507E, "compound_update" }, + { 0x507F, "update_whiz_filter" }, +// { 0x5080, "" }, + { 0x5081, "aud_mortar_impact_dirt" }, +// { 0x5082, "" }, + { 0x5083, "set_mortar_mix" }, + { 0x5084, "attack_siren" }, +// { 0x5085, "" }, + { 0x5086, "chopperzone" }, +// { 0x5087, "" }, +// { 0x5088, "" }, +// { 0x5089, "" }, + { 0x508A, "aud_start_compound" }, +// { 0x508B, "" }, +// { 0x508C, "" }, +// { 0x508D, "" }, +// { 0x508E, "" }, +// { 0x508F, "" }, +// { 0x5090, "" }, +// { 0x5091, "" }, +// { 0x5092, "" }, + { 0x5093, "aud_play_pybk_slowmo_gunshot" }, +// { 0x5094, "" }, +// { 0x5095, "" }, +// { 0x5096, "" }, +// { 0x5097, "" }, +// { 0x5098, "" }, +// { 0x5099, "" }, + { 0x509A, "turn_down_mix_pre_shot" }, +// { 0x509B, "" }, +// { 0x509C, "" }, +// { 0x509D, "" }, + { 0x509E, "play_roll_car_loop" }, + { 0x509F, "pybk_wallfall" }, + { 0x50A0, "wallquad" }, +// { 0x50A1, "" }, +// { 0x50A2, "" }, +// { 0x50A3, "" }, +// { 0x50A4, "" }, + { 0x50A5, "chopper_audio_damaged" }, +// { 0x50A6, "" }, +// { 0x50A7, "" }, +// { 0x50A8, "" }, + { 0x50A9, "chopper_audio_damaged5" }, +// { 0x50AA, "" }, +// { 0x50AB, "" }, +// { 0x50AC, "" }, +// { 0x50AD, "" }, +// { 0x50AE, "" }, +// { 0x50AF, "" }, +// { 0x50B0, "" }, +// { 0x50B1, "" }, +// { 0x50B2, "" }, +// { 0x50B3, "" }, + { 0x50B4, "play_random_rumble" }, +// { 0x50B5, "" }, +// { 0x50B6, "" }, +// { 0x50B7, "" }, +// { 0x50B8, "" }, +// { 0x50B9, "" }, +// { 0x50BA, "" }, +// { 0x50BB, "" }, +// { 0x50BC, "" }, + { 0x50BD, "aud_downhill_slide" }, +// { 0x50BE, "" }, +// { 0x50BF, "" }, +// { 0x50C0, "" }, +// { 0x50C1, "" }, + { 0x50C2, "delete_chopper_audio" }, + { 0x50C3, "rpg_listener" }, +// { 0x50C4, "" }, +// { 0x50C5, "" }, + { 0x50C6, "loop_rpg" }, +// { 0x50C7, "" }, +// { 0x50C8, "" }, +// { 0x50C9, "" }, +// { 0x50CA, "" }, + { 0x50CB, "aud_primevo" }, + { 0x50CC, "so_fixup_all_createfx" }, +// { 0x50CD, "" }, +// { 0x50CE, "" }, +// { 0x50CF, "" }, + { 0x50D0, "delete_basemap_ents" }, + { 0x50D1, "add_to_delete_model_list" }, +// { 0x50D2, "" }, +// { 0x50D3, "" }, +// { 0x50D4, "" }, + { 0x50D5, "ground_player" }, +// { 0x50D6, "" }, +// { 0x50D7, "" }, +// { 0x50D8, "" }, +// { 0x50D9, "" }, +// { 0x50DA, "" }, +// { 0x50DB, "" }, +// { 0x50DC, "" }, +// { 0x50DD, "" }, + { 0x50DE, "run_intro_truck" }, +// { 0x50DF, "" }, + { 0x50E0, "exit_point" }, +// { 0x50E1, "" }, +// { 0x50E2, "" }, +// { 0x50E3, "" }, +// { 0x50E4, "" }, +// { 0x50E5, "" }, +// { 0x50E6, "" }, +// { 0x50E7, "" }, +// { 0x50E8, "" }, + { 0x50E9, "damage_scale" }, + { 0x50EA, "run_player_damage" }, + { 0x50EB, "vo_wait" }, +// { 0x50EC, "" }, + { 0x50ED, "show_grenade_weapon_hint" }, + { 0x50EE, "run_path_01" }, + { 0x50EF, "monitor_ai_wave" }, + { 0x50F0, "islongdeath" }, + { 0x50F1, "ai_wave_cleanup" }, + { 0x50F2, "run_path_02" }, +// { 0x50F3, "" }, +// { 0x50F4, "" }, +// { 0x50F5, "" }, +// { 0x50F6, "" }, + { 0x50F7, "enable_revive" }, + { 0x50F8, "player_exit_littlebird" }, +// { 0x50F9, "" }, +// { 0x50FA, "" }, + { 0x50FB, "stay_on_littlebird" }, +// { 0x50FC, "" }, +// { 0x50FD, "" }, +// { 0x50FE, "" }, +// { 0x50FF, "" }, + { 0x5100, "run_ground_assault" }, + { 0x5101, "missile_repulsor" }, +// { 0x5102, "" }, + { 0x5103, "run_buildingb_assault" }, +// { 0x5104, "" }, +// { 0x5105, "" }, + { 0x5106, "flag_wait_and_flood_spawn" }, + { 0x5107, "maps/createart/so_littlebird_payback_fog" }, +// { 0x5108, "" }, + { 0x5109, "sandstormspawnrate" }, +// { 0x510A, "" }, + { 0x510B, "blizzard_flags" }, +// { 0x510C, "" }, +// { 0x510D, "" }, +// { 0x510E, "" }, +// { 0x510F, "" }, + { 0x5110, "set_sandstorm_spawnrate" }, + { 0x5111, "lerp_sandstorm_spawnrate" }, + { 0x5112, "fx_init" }, +// { 0x5113, "" }, +// { 0x5114, "" }, +// { 0x5115, "" }, +// { 0x5116, "" }, +// { 0x5117, "" }, +// { 0x5118, "" }, +// { 0x5119, "" }, + { 0x511A, "blizzard_level_transition_med" }, +// { 0x511B, "" }, + { 0x511C, "blizzard_level_transition_extreme" }, +// { 0x511D, "" }, +// { 0x511E, "" }, + { 0x511F, "blizzard_level_transition_extreme_sat" }, +// { 0x5120, "" }, +// { 0x5121, "" }, +// { 0x5122, "" }, + { 0x5123, "blizzard_set_culldist" }, + { 0x5124, "blizzard_culldist" }, +// { 0x5125, "" }, +// { 0x5126, "" }, + { 0x5127, "blizzard_culldist_check_trigger" }, +// { 0x5128, "" }, +// { 0x5129, "" }, +// { 0x512A, "" }, + { 0x512B, "blizzard_level_transition" }, +// { 0x512C, "" }, + { 0x512D, "blizzard_level_get_count" }, +// { 0x512E, "" }, +// { 0x512F, "" }, +// { 0x5130, "" }, +// { 0x5131, "" }, +// { 0x5132, "" }, +// { 0x5133, "" }, +// { 0x5134, "" }, +// { 0x5135, "" }, +// { 0x5136, "" }, +// { 0x5137, "" }, +// { 0x5138, "" }, + { 0x5139, "remote_turret_terminal_think" }, +// { 0x513A, "" }, +// { 0x513B, "" }, +// { 0x513C, "" }, +// { 0x513D, "" }, +// { 0x513E, "" }, +// { 0x513F, "" }, +// { 0x5140, "" }, +// { 0x5141, "" }, +// { 0x5142, "" }, +// { 0x5143, "" }, +// { 0x5144, "" }, +// { 0x5145, "" }, + { 0x5146, "remote_turret_next" }, +// { 0x5147, "" }, +// { 0x5148, "" }, + { 0x5149, "remote_turret_badplace" }, +// { 0x514A, "" }, +// { 0x514B, "" }, + { 0x514C, "uav_enable_view" }, +// { 0x514D, "" }, +// { 0x514E, "" }, + { 0x514F, "hud_fade_in_time" }, +// { 0x5150, "" }, +// { 0x5151, "" }, +// { 0x5152, "" }, +// { 0x5153, "" }, +// { 0x5154, "" }, +// { 0x5155, "" }, +// { 0x5156, "" }, +// { 0x5157, "" }, +// { 0x5158, "" }, +// { 0x5159, "" }, +// { 0x515A, "" }, +// { 0x515B, "" }, +// { 0x515C, "" }, +// { 0x515D, "" }, +// { 0x515E, "" }, +// { 0x515F, "" }, +// { 0x5160, "" }, +// { 0x5161, "" }, +// { 0x5162, "" }, +// { 0x5163, "" }, +// { 0x5164, "" }, +// { 0x5165, "" }, +// { 0x5166, "" }, +// { 0x5167, "" }, +// { 0x5168, "" }, + { 0x5169, "vehicle_scripts/_uk_delivery_truck" }, + { 0x516A, "vehicle_scripts/_uk_utility_truck" }, +// { 0x516B, "" }, +// { 0x516C, "" }, +// { 0x516D, "" }, +// { 0x516E, "" }, + { 0x516F, "ambient_fx" }, +// { 0x5170, "" }, +// { 0x5171, "" }, +// { 0x5172, "" }, +// { 0x5173, "" }, +// { 0x5174, "" }, +// { 0x5175, "" }, +// { 0x5176, "" }, +// { 0x5177, "" }, +// { 0x5178, "" }, +// { 0x5179, "" }, +// { 0x517A, "" }, +// { 0x517B, "" }, +// { 0x517C, "" }, +// { 0x517D, "" }, + { 0x517E, "sas_guy" }, +// { 0x517F, "" }, +// { 0x5180, "" }, + { 0x5181, "forklift_down" }, + { 0x5182, "delivery_truck" }, +// { 0x5183, "" }, +// { 0x5184, "" }, + { 0x5185, "props" }, +// { 0x5186, "" }, +// { 0x5187, "" }, +// { 0x5188, "" }, +// { 0x5189, "" }, +// { 0x518A, "" }, + { 0x518B, "melee_attacker" }, +// { 0x518C, "" }, +// { 0x518D, "" }, + { 0x518E, "anim_drop_weapon" }, +// { 0x518F, "" }, +// { 0x5190, "" }, + { 0x5191, "warehouse_window_kick" }, +// { 0x5192, "" }, +// { 0x5193, "" }, +// { 0x5194, "" }, +// { 0x5195, "" }, +// { 0x5196, "" }, +// { 0x5197, "" }, +// { 0x5198, "" }, +// { 0x5199, "" }, +// { 0x519A, "" }, +// { 0x519B, "" }, +// { 0x519C, "" }, +// { 0x519D, "" }, +// { 0x519E, "" }, + { 0x519F, "set_start_location_internal" }, +// { 0x51A0, "" }, +// { 0x51A1, "" }, +// { 0x51A2, "" }, +// { 0x51A3, "" }, +// { 0x51A4, "" }, +// { 0x51A5, "" }, + { 0x51A6, "spot_light_effect_pause" }, + { 0x51A7, "can_show_wip" }, +// { 0x51A8, "" }, + { 0x51A9, "wait_for_animtime_percent" }, +// { 0x51AA, "" }, +// { 0x51AB, "" }, +// { 0x51AC, "" }, +// { 0x51AD, "" }, + { 0x51AE, "is_start_point_after" }, +// { 0x51AF, "" }, +// { 0x51B0, "" }, +// { 0x51B1, "" }, + { 0x51B2, "postspawn_rpg_vehicle" }, +// { 0x51B3, "" }, +// { 0x51B4, "" }, + { 0x51B5, "limping" }, +// { 0x51B6, "" }, +// { 0x51B7, "" }, +// { 0x51B8, "" }, +// { 0x51B9, "" }, + { 0x51BA, "level_callback" }, + { 0x51BB, "add_callback" }, +// { 0x51BC, "" }, +// { 0x51BD, "" }, +// { 0x51BE, "" }, +// { 0x51BF, "" }, + { 0x51C0, "chopper_extra_strafe_damage" }, +// { 0x51C1, "" }, +// { 0x51C2, "" }, +// { 0x51C3, "" }, +// { 0x51C4, "" }, +// { 0x51C5, "" }, + { 0x51C6, "pathpoint" }, +// { 0x51C7, "" }, +// { 0x51C8, "" }, +// { 0x51C9, "" }, + { 0x51CA, "chopper_get_pathpoint" }, + { 0x51CB, "hover_point" }, +// { 0x51CC, "" }, +// { 0x51CD, "" }, + { 0x51CE, "uav_init" }, +// { 0x51CF, "" }, +// { 0x51D0, "" }, +// { 0x51D1, "" }, +// { 0x51D2, "" }, +// { 0x51D3, "" }, + { 0x51D4, "fake_controller" }, +// { 0x51D5, "" }, + { 0x51D6, "update_controller_pos" }, +// { 0x51D7, "" }, + { 0x51D8, "uav_hud_thread" }, + { 0x51D9, "base_latitude" }, +// { 0x51DA, "" }, +// { 0x51DB, "" }, +// { 0x51DC, "" }, + { 0x51DD, "uav_update_hud_arrows" }, + { 0x51DE, "update_current_degrees" }, + { 0x51DF, "update_target_degrees" }, +// { 0x51E0, "" }, +// { 0x51E1, "" }, + { 0x51E2, "get_float_from_degrees" }, +// { 0x51E3, "" }, +// { 0x51E4, "" }, + { 0x51E5, "uav_enable_playerhud" }, + { 0x51E6, "uav_disable_playerhud" }, +// { 0x51E7, "" }, +// { 0x51E8, "" }, + { 0x51E9, "create_degree_value" }, +// { 0x51EA, "" }, + { 0x51EB, "uav_view_cone_open" }, +// { 0x51EC, "" }, + { 0x51ED, "uav_thermal_on" }, +// { 0x51EE, "" }, +// { 0x51EF, "" }, +// { 0x51F0, "" }, +// { 0x51F1, "" }, +// { 0x51F2, "" }, +// { 0x51F3, "" }, +// { 0x51F4, "" }, +// { 0x51F5, "" }, +// { 0x51F6, "" }, +// { 0x51F7, "" }, +// { 0x51F8, "" }, +// { 0x51F9, "" }, +// { 0x51FA, "" }, +// { 0x51FB, "" }, +// { 0x51FC, "" }, +// { 0x51FD, "" }, +// { 0x51FE, "" }, +// { 0x51FF, "" }, + { 0x5200, "alley_quick_kills" }, +// { 0x5201, "" }, +// { 0x5202, "" }, +// { 0x5203, "" }, +// { 0x5204, "" }, +// { 0x5205, "" }, +// { 0x5206, "" }, + { 0x5207, "print3d_on_ent" }, + { 0x5208, "debug_sound_positional" }, +// { 0x5209, "" }, + { 0x520A, "start_warehouse_breach" }, +// { 0x520B, "" }, + { 0x520C, "start_docks_assault" }, +// { 0x520D, "" }, +// { 0x520E, "" }, + { 0x520F, "set_littlebird_start" }, +// { 0x5210, "" }, +// { 0x5211, "" }, +// { 0x5212, "" }, +// { 0x5213, "" }, +// { 0x5214, "" }, + { 0x5215, "ground_origin" }, + { 0x5216, "ground_angles" }, +// { 0x5217, "" }, +// { 0x5218, "" }, + { 0x5219, "uav_slamzoom" }, +// { 0x521A, "" }, + { 0x521B, "intro_scene_forklift" }, +// { 0x521C, "" }, +// { 0x521D, "" }, +// { 0x521E, "" }, + { 0x521F, "flir_ents" }, +// { 0x5220, "" }, +// { 0x5221, "" }, +// { 0x5222, "" }, +// { 0x5223, "" }, +// { 0x5224, "" }, + { 0x5225, "warehouse_exit_reach" }, +// { 0x5226, "" }, +// { 0x5227, "" }, +// { 0x5228, "" }, +// { 0x5229, "" }, +// { 0x522A, "" }, +// { 0x522B, "" }, + { 0x522C, "docks_assault_guy_reset" }, +// { 0x522D, "" }, + { 0x522E, "docks_entrance" }, +// { 0x522F, "" }, +// { 0x5230, "" }, +// { 0x5231, "" }, +// { 0x5232, "" }, +// { 0x5233, "" }, + { 0x5234, "littlebird_ambush_earlyout" }, +// { 0x5235, "" }, +// { 0x5236, "" }, +// { 0x5237, "" }, +// { 0x5238, "" }, + { 0x5239, "truck_wallcroft_nag" }, +// { 0x523A, "" }, +// { 0x523B, "" }, +// { 0x523C, "" }, + { 0x523D, "docks_ambush" }, + { 0x523E, "garage_door_open" }, +// { 0x523F, "" }, +// { 0x5240, "" }, +// { 0x5241, "" }, +// { 0x5242, "" }, +// { 0x5243, "" }, +// { 0x5244, "" }, +// { 0x5245, "" }, +// { 0x5246, "" }, + { 0x5247, "docks_end_dialogue" }, +// { 0x5248, "" }, +// { 0x5249, "" }, + { 0x524A, "trucks" }, + { 0x524B, "docks_truck" }, +// { 0x524C, "" }, +// { 0x524D, "" }, +// { 0x524E, "" }, + { 0x524F, "forklift_lights" }, + { 0x5250, "intro_get_forklift_cargo" }, + { 0x5251, "truck_door_idle" }, +// { 0x5252, "" }, +// { 0x5253, "" }, +// { 0x5254, "" }, +// { 0x5255, "" }, +// { 0x5256, "" }, + { 0x5257, "alley_movement_think" }, +// { 0x5258, "" }, +// { 0x5259, "" }, +// { 0x525A, "" }, + { 0x525B, "alley_quick_kill_enemy_cellphone" }, +// { 0x525C, "" }, + { 0x525D, "kill_now" }, +// { 0x525E, "" }, +// { 0x525F, "" }, +// { 0x5260, "" }, +// { 0x5261, "" }, + { 0x5262, "last_alley_cleared" }, +// { 0x5263, "" }, +// { 0x5264, "" }, + { 0x5265, "alley_sprint" }, +// { 0x5266, "" }, +// { 0x5267, "" }, +// { 0x5268, "" }, + { 0x5269, "conditional_anim_add_alert_friends" }, +// { 0x526A, "" }, +// { 0x526B, "" }, +// { 0x526C, "" }, + { 0x526D, "conditional_anim_death" }, +// { 0x526E, "" }, + { 0x526F, "conditional_anim_kill" }, + { 0x5270, "do_ragdoll" }, +// { 0x5271, "" }, +// { 0x5272, "" }, +// { 0x5273, "" }, +// { 0x5274, "" }, +// { 0x5275, "" }, + { 0x5276, "reaction_delay" }, +// { 0x5277, "" }, +// { 0x5278, "" }, + { 0x5279, "conditional_anim_radius_reaction" }, +// { 0x527A, "" }, +// { 0x527B, "" }, + { 0x527C, "warehouse_breacher" }, +// { 0x527D, "" }, +// { 0x527E, "" }, +// { 0x527F, "" }, +// { 0x5280, "" }, +// { 0x5281, "" }, +// { 0x5282, "" }, +// { 0x5283, "" }, +// { 0x5284, "" }, +// { 0x5285, "" }, +// { 0x5286, "" }, + { 0x5287, "scripted_movement_disable_exits" }, +// { 0x5288, "" }, +// { 0x5289, "" }, +// { 0x528A, "" }, + { 0x528B, "warehouse_exit_anim" }, +// { 0x528C, "" }, + { 0x528D, "warehouse_exit" }, +// { 0x528E, "" }, + { 0x528F, "sas_van_rpg" }, +// { 0x5290, "" }, +// { 0x5291, "" }, +// { 0x5292, "" }, +// { 0x5293, "" }, +// { 0x5294, "" }, +// { 0x5295, "" }, +// { 0x5296, "" }, +// { 0x5297, "" }, +// { 0x5298, "" }, +// { 0x5299, "" }, +// { 0x529A, "" }, +// { 0x529B, "" }, +// { 0x529C, "" }, +// { 0x529D, "" }, +// { 0x529E, "" }, +// { 0x529F, "" }, +// { 0x52A0, "" }, +// { 0x52A1, "" }, + { 0x52A2, "warehouse_hallway_enemy_reaction" }, +// { 0x52A3, "" }, + { 0x52A4, "postspawn_warehouse_sniper_target" }, + { 0x52A5, "warehouse_sniper_think" }, +// { 0x52A6, "" }, +// { 0x52A7, "" }, +// { 0x52A8, "" }, +// { 0x52A9, "" }, + { 0x52AA, "postspawn_warehouse_melee_enemy" }, +// { 0x52AB, "" }, +// { 0x52AC, "" }, +// { 0x52AD, "" }, +// { 0x52AE, "" }, +// { 0x52AF, "" }, + { 0x52B0, "warehouse2_wait" }, +// { 0x52B1, "" }, +// { 0x52B2, "" }, +// { 0x52B3, "" }, +// { 0x52B4, "" }, + { 0x52B5, "docks_van_target" }, +// { 0x52B6, "" }, +// { 0x52B7, "" }, +// { 0x52B8, "" }, +// { 0x52B9, "" }, +// { 0x52BA, "" }, +// { 0x52BB, "" }, + { 0x52BC, "postspawn_littlebird_death" }, +// { 0x52BD, "" }, + { 0x52BE, "littlebird_rpger_death" }, + { 0x52BF, "littlebird_rpg_dialogue" }, +// { 0x52C0, "" }, +// { 0x52C1, "" }, + { 0x52C2, "littlebird_target_move" }, +// { 0x52C3, "" }, +// { 0x52C4, "" }, +// { 0x52C5, "" }, + { 0x52C6, "littlebird_line_to_target" }, +// { 0x52C7, "" }, +// { 0x52C8, "" }, +// { 0x52C9, "" }, +// { 0x52CA, "" }, + { 0x52CB, "littlebird_get_enemy_targets" }, +// { 0x52CC, "" }, +// { 0x52CD, "" }, +// { 0x52CE, "" }, + { 0x52CF, "docks_laser_think" }, +// { 0x52D0, "" }, +// { 0x52D1, "" }, + { 0x52D2, "sniper_ent_linkto" }, +// { 0x52D3, "" }, +// { 0x52D4, "" }, +// { 0x52D5, "" }, +// { 0x52D6, "" }, +// { 0x52D7, "" }, +// { 0x52D8, "" }, +// { 0x52D9, "" }, +// { 0x52DA, "" }, +// { 0x52DB, "" }, + { 0x52DC, "sewer_pipe_fx" }, + { 0x52DD, "sewer_pipe_end_anim" }, +// { 0x52DE, "" }, + { 0x52DF, "sewer_pip_ragdoll" }, +// { 0x52E0, "" }, + { 0x52E1, "footstep_splash_trigger" }, +// { 0x52E2, "" }, +// { 0x52E3, "" }, +// { 0x52E4, "" }, + { 0x52E5, "nag_single_solo" }, +// { 0x52E6, "" }, +// { 0x52E7, "" }, + { 0x52E8, "radio_dialogue_and_notify" }, + { 0x52E9, "radio_dialogue_and_notify_internal" }, + { 0x52EA, "radio_overlap_wrapper" }, +// { 0x52EB, "" }, + { 0x52EC, "opened" }, +// { 0x52ED, "" }, +// { 0x52EE, "" }, + { 0x52EF, "wait_for_match_or_death" }, +// { 0x52F0, "" }, + { 0x52F1, "waittillmatch_timeout" }, + { 0x52F2, "is_valid_anim" }, +// { 0x52F3, "" }, +// { 0x52F4, "" }, +// { 0x52F5, "" }, +// { 0x52F6, "" }, +// { 0x52F7, "" }, +// { 0x52F8, "" }, +// { 0x52F9, "" }, + { 0x52FA, "maps/createart/london_art" }, + { 0x52FB, "maps/_nightvision" }, +// { 0x52FC, "" }, +// { 0x52FD, "" }, +// { 0x52FE, "" }, +// { 0x52FF, "" }, +// { 0x5300, "" }, +// { 0x5301, "" }, +// { 0x5302, "" }, +// { 0x5303, "" }, +// { 0x5304, "" }, +// { 0x5305, "" }, +// { 0x5306, "" }, +// { 0x5307, "" }, + { 0x5308, "dialogue_think" }, +// { 0x5309, "" }, +// { 0x530A, "" }, + { 0x530B, "player_ground_seek_enable" }, +// { 0x530C, "" }, + { 0x530D, "ai_think" }, +// { 0x530E, "" }, + { 0x530F, "start_intro" }, +// { 0x5310, "" }, +// { 0x5311, "" }, +// { 0x5312, "" }, +// { 0x5313, "" }, + { 0x5314, "start_the_party" }, + { 0x5315, "blockers_think" }, +// { 0x5316, "" }, +// { 0x5317, "" }, +// { 0x5318, "" }, +// { 0x5319, "" }, + { 0x531A, "terminal_0_think" }, +// { 0x531B, "" }, + { 0x531C, "terminal_2_think" }, +// { 0x531D, "" }, +// { 0x531E, "" }, + { 0x531F, "startprogressbar" }, +// { 0x5320, "" }, +// { 0x5321, "" }, + { 0x5322, "endprogressbar" }, +// { 0x5323, "" }, +// { 0x5324, "" }, +// { 0x5325, "" }, + { 0x5326, "turret_kick_it" }, +// { 0x5327, "" }, + { 0x5328, "switch_camera_hint" }, +// { 0x5329, "" }, +// { 0x532A, "" }, +// { 0x532B, "" }, + { 0x532C, "maps/createart/so_timetrial_london_art" }, +// { 0x532D, "" }, +// { 0x532E, "" }, + { 0x532F, "character/character_fso_vest_nopacks_alt" }, +// { 0x5330, "" }, +// { 0x5331, "" }, +// { 0x5332, "" }, + { 0x5333, "blizzard_flake_proc" }, + { 0x5334, "playfx_follow_player" }, +// { 0x5335, "" }, +// { 0x5336, "" }, +// { 0x5337, "" }, +// { 0x5338, "" }, +// { 0x5339, "" }, +// { 0x533A, "" }, +// { 0x533B, "" }, +// { 0x533C, "" }, +// { 0x533D, "" }, +// { 0x533E, "" }, +// { 0x533F, "" }, + { 0x5340, "bfailingengineplayed" }, + { 0x5341, "bjetfallingstarted" }, + { 0x5342, "bcrashsequenceendplayed" }, +// { 0x5343, "" }, +// { 0x5344, "" }, + { 0x5345, "bpreexplosionplayed" }, + { 0x5346, "bdebriswait" }, + { 0x5347, "bplatewait" }, +// { 0x5348, "" }, +// { 0x5349, "" }, +// { 0x534A, "" }, +// { 0x534B, "" }, +// { 0x534C, "" }, +// { 0x534D, "" }, +// { 0x534E, "" }, +// { 0x534F, "" }, +// { 0x5350, "" }, +// { 0x5351, "" }, +// { 0x5352, "" }, + { 0x5353, "jet_1b" }, +// { 0x5354, "" }, +// { 0x5355, "" }, + { 0x5356, "paper_drop" }, +// { 0x5357, "" }, + { 0x5358, "hijk_cart_moves" }, + { 0x5359, "radio_com_intro" }, +// { 0x535A, "" }, +// { 0x535B, "" }, + { 0x535C, "debate_bumps" }, +// { 0x535D, "" }, +// { 0x535E, "" }, + { 0x535F, "news_broadcast" }, + { 0x5360, "debate_door_close" }, +// { 0x5361, "" }, +// { 0x5362, "" }, +// { 0x5363, "" }, +// { 0x5364, "" }, +// { 0x5365, "" }, +// { 0x5366, "" }, +// { 0x5367, "" }, +// { 0x5368, "" }, +// { 0x5369, "" }, + { 0x536A, "agent_1_rumble_foley" }, +// { 0x536B, "" }, +// { 0x536C, "" }, +// { 0x536D, "" }, + { 0x536E, "hijk_agent_stumblehit" }, +// { 0x536F, "" }, +// { 0x5370, "" }, +// { 0x5371, "" }, +// { 0x5372, "" }, +// { 0x5373, "" }, +// { 0x5374, "" }, +// { 0x5375, "" }, +// { 0x5376, "" }, +// { 0x5377, "" }, +// { 0x5378, "" }, +// { 0x5379, "" }, +// { 0x537A, "" }, +// { 0x537B, "" }, +// { 0x537C, "" }, +// { 0x537D, "" }, +// { 0x537E, "" }, +// { 0x537F, "" }, +// { 0x5380, "" }, +// { 0x5381, "" }, +// { 0x5382, "" }, + { 0x5383, "post_zero_g_rumble" }, +// { 0x5384, "" }, + { 0x5385, "conf_room_shots_prime" }, +// { 0x5386, "" }, + { 0x5387, "seatbeltsign" }, +// { 0x5388, "" }, +// { 0x5389, "" }, +// { 0x538A, "" }, +// { 0x538B, "" }, +// { 0x538C, "" }, +// { 0x538D, "" }, +// { 0x538E, "" }, +// { 0x538F, "" }, +// { 0x5390, "" }, + { 0x5391, "c4_l" }, +// { 0x5392, "" }, +// { 0x5393, "" }, +// { 0x5394, "" }, +// { 0x5395, "" }, +// { 0x5396, "" }, +// { 0x5397, "" }, +// { 0x5398, "" }, + { 0x5399, "turbine_wind_c" }, + { 0x539A, "turbine_wind_d" }, + { 0x539B, "turbine_wind_e" }, +// { 0x539C, "" }, + { 0x539D, "jet_roll_v02" }, + { 0x539E, "cargo_room_zone_on" }, + { 0x539F, "metal_tanks" }, +// { 0x53A0, "" }, +// { 0x53A1, "" }, + { 0x53A2, "crash_sequence" }, + { 0x53A3, "crash_explosion" }, + { 0x53A4, "crash_explosion_origin" }, +// { 0x53A5, "" }, +// { 0x53A6, "" }, +// { 0x53A7, "" }, +// { 0x53A8, "" }, +// { 0x53A9, "" }, +// { 0x53AA, "" }, +// { 0x53AB, "" }, + { 0x53AC, "crazy_guy_goes_flying" }, +// { 0x53AD, "" }, +// { 0x53AE, "" }, + { 0x53AF, "crash_sequence_end" }, + { 0x53B0, "music_cue_postcrash" }, +// { 0x53B1, "" }, +// { 0x53B2, "" }, +// { 0x53B3, "" }, + { 0x53B4, "debris_shift2" }, +// { 0x53B5, "" }, +// { 0x53B6, "" }, +// { 0x53B7, "" }, +// { 0x53B8, "" }, +// { 0x53B9, "" }, + { 0x53BA, "debris_shift8" }, +// { 0x53BB, "" }, +// { 0x53BC, "" }, +// { 0x53BD, "" }, +// { 0x53BE, "" }, + { 0x53BF, "debris_shift13" }, +// { 0x53C0, "" }, +// { 0x53C1, "" }, + { 0x53C2, "debris_shift16" }, +// { 0x53C3, "" }, + { 0x53C4, "plate_shift1" }, +// { 0x53C5, "" }, + { 0x53C6, "music_reveal_exterior" }, +// { 0x53C7, "" }, + { 0x53C8, "wing_settle" }, +// { 0x53C9, "" }, + { 0x53CA, "engine_explosion" }, + { 0x53CB, "flare_gun" }, +// { 0x53CC, "" }, +// { 0x53CD, "" }, +// { 0x53CE, "" }, +// { 0x53CF, "" }, +// { 0x53D0, "" }, + { 0x53D1, "tarmac_combat_music" }, + { 0x53D2, "first_suv" }, + { 0x53D3, "siren_mayhem" }, +// { 0x53D4, "" }, +// { 0x53D5, "" }, + { 0x53D6, "end_area_chopper_begin" }, +// { 0x53D7, "" }, +// { 0x53D8, "" }, + { 0x53D9, "ambiguns3" }, +// { 0x53DA, "" }, +// { 0x53DB, "" }, +// { 0x53DC, "" }, + { 0x53DD, "end_scene_foley1" }, +// { 0x53DE, "" }, +// { 0x53DF, "" }, + { 0x53E0, "makarov_heli" }, +// { 0x53E1, "" }, +// { 0x53E2, "" }, +// { 0x53E3, "" }, +// { 0x53E4, "" }, +// { 0x53E5, "" }, + { 0x53E6, "start_logic" }, +// { 0x53E7, "" }, +// { 0x53E8, "" }, + { 0x53E9, "try_activate_trigger_targetname" }, +// { 0x53EA, "" }, +// { 0x53EB, "" }, +// { 0x53EC, "" }, +// { 0x53ED, "" }, +// { 0x53EE, "" }, +// { 0x53EF, "" }, + { 0x53F0, "plane_rumbling" }, +// { 0x53F1, "" }, +// { 0x53F2, "" }, + { 0x53F3, "background_chatter" }, +// { 0x53F4, "" }, +// { 0x53F5, "" }, +// { 0x53F6, "" }, +// { 0x53F7, "" }, +// { 0x53F8, "" }, +// { 0x53F9, "" }, +// { 0x53FA, "" }, + { 0x53FB, "hjk_endsliding" }, + { 0x53FC, "rockingplane" }, +// { 0x53FD, "" }, +// { 0x53FE, "" }, + { 0x53FF, "turbulence" }, +// { 0x5400, "" }, +// { 0x5401, "" }, +// { 0x5402, "" }, +// { 0x5403, "" }, + { 0x5404, "objectmass" }, +// { 0x5405, "" }, +// { 0x5406, "" }, +// { 0x5407, "" }, +// { 0x5408, "" }, + { 0x5409, "ai_array_killcount_flag_set" }, +// { 0x540A, "" }, +// { 0x540B, "" }, +// { 0x540C, "" }, + { 0x540D, "hjk_red_light_pulsing" }, + { 0x540E, "pulsing_light_fx" }, +// { 0x540F, "" }, +// { 0x5410, "" }, +// { 0x5411, "" }, +// { 0x5412, "" }, +// { 0x5413, "" }, +// { 0x5414, "" }, +// { 0x5415, "" }, +// { 0x5416, "" }, +// { 0x5417, "" }, +// { 0x5418, "" }, +// { 0x5419, "" }, + { 0x541A, "fluorescentflicker" }, + { 0x541B, "handle_pre_sled_lights" }, +// { 0x541C, "" }, +// { 0x541D, "" }, + { 0x541E, "sled_emergency_light_post_impact_flicker" }, +// { 0x541F, "" }, +// { 0x5420, "" }, +// { 0x5421, "" }, + { 0x5422, "aftermath_style_walking" }, +// { 0x5423, "" }, +// { 0x5424, "" }, +// { 0x5425, "" }, + { 0x5426, "heartbeat_blood_func" }, +// { 0x5427, "" }, +// { 0x5428, "" }, +// { 0x5429, "" }, + { 0x542A, "unsteady_scale" }, +// { 0x542B, "" }, +// { 0x542C, "" }, + { 0x542D, "swivel_stunplayer" }, + { 0x542E, "setslowmotion_overtime" }, +// { 0x542F, "" }, +// { 0x5430, "" }, +// { 0x5431, "" }, +// { 0x5432, "" }, +// { 0x5433, "" }, + { 0x5434, "recover" }, +// { 0x5435, "" }, +// { 0x5436, "" }, +// { 0x5437, "" }, +// { 0x5438, "" }, +// { 0x5439, "" }, +// { 0x543A, "" }, + { 0x543B, "player_grenade_watcher" }, +// { 0x543C, "" }, + { 0x543D, "intro_origin" }, +// { 0x543E, "" }, +// { 0x543F, "" }, + { 0x5440, "chopper_land_node" }, +// { 0x5441, "" }, +// { 0x5442, "" }, +// { 0x5443, "" }, +// { 0x5444, "" }, + { 0x5445, "cronie2" }, + { 0x5446, "makarov_heli_door" }, + { 0x5447, "ending_distant_combat1" }, + { 0x5448, "snd_index" }, + { 0x5449, "ending_distant_combat2" }, + { 0x544A, "handle_commander_move_to_end" }, +// { 0x544B, "" }, +// { 0x544C, "" }, +// { 0x544D, "" }, +// { 0x544E, "" }, +// { 0x544F, "" }, +// { 0x5450, "" }, +// { 0x5451, "" }, +// { 0x5452, "" }, + { 0x5453, "spawn_and_move_extras" }, +// { 0x5454, "" }, +// { 0x5455, "" }, +// { 0x5456, "" }, +// { 0x5457, "" }, + { 0x5458, "guys_approach_heli" }, +// { 0x5459, "" }, +// { 0x545A, "" }, + { 0x545B, "spotlight_monitor_end" }, + { 0x545C, "spotlight_target_final" }, +// { 0x545D, "" }, +// { 0x545E, "" }, +// { 0x545F, "" }, +// { 0x5460, "" }, +// { 0x5461, "" }, +// { 0x5462, "" }, +// { 0x5463, "" }, +// { 0x5464, "" }, +// { 0x5465, "" }, +// { 0x5466, "" }, +// { 0x5467, "" }, + { 0x5468, "tarmac_combat_wave4" }, +// { 0x5469, "" }, + { 0x546A, "check_endsceneguys_commander_advance" }, +// { 0x546B, "" }, +// { 0x546C, "" }, +// { 0x546D, "" }, + { 0x546E, "tarmac_combat_vo" }, +// { 0x546F, "" }, +// { 0x5470, "" }, +// { 0x5471, "" }, +// { 0x5472, "" }, + { 0x5473, "start_tarmac" }, + { 0x5474, "remove_all_weapons_post_crash" }, + { 0x5475, "animated_telephone" }, +// { 0x5476, "" }, +// { 0x5477, "" }, +// { 0x5478, "" }, +// { 0x5479, "" }, +// { 0x547A, "" }, +// { 0x547B, "" }, +// { 0x547C, "" }, + { 0x547D, "daughter" }, +// { 0x547E, "" }, +// { 0x547F, "" }, +// { 0x5480, "" }, + { 0x5481, "commander_base_move_speed" }, +// { 0x5482, "" }, + { 0x5483, "needs_to_catch_up" }, +// { 0x5484, "" }, +// { 0x5485, "" }, +// { 0x5486, "" }, +// { 0x5487, "" }, + { 0x5488, "tarmac_flare_event" }, +// { 0x5489, "" }, +// { 0x548A, "" }, +// { 0x548B, "" }, + { 0x548C, "tarmac_radio_org" }, +// { 0x548D, "" }, +// { 0x548E, "" }, + { 0x548F, "tarmac_events" }, +// { 0x5490, "" }, + { 0x5491, "blend_player_move_speed" }, +// { 0x5492, "" }, +// { 0x5493, "" }, +// { 0x5494, "" }, +// { 0x5495, "" }, +// { 0x5496, "" }, + { 0x5497, "post_crash_explosions" }, +// { 0x5498, "" }, +// { 0x5499, "" }, +// { 0x549A, "" }, +// { 0x549B, "" }, +// { 0x549C, "" }, +// { 0x549D, "" }, +// { 0x549E, "" }, +// { 0x549F, "" }, +// { 0x54A0, "" }, +// { 0x54A1, "" }, +// { 0x54A2, "" }, + { 0x54A3, "fso_check_deadguy" }, +// { 0x54A4, "" }, +// { 0x54A5, "" }, + { 0x54A6, "fso_tail_explosion_react" }, +// { 0x54A7, "" }, +// { 0x54A8, "" }, +// { 0x54A9, "" }, + { 0x54AA, "setup_spotlight" }, +// { 0x54AB, "" }, +// { 0x54AC, "" }, +// { 0x54AD, "" }, +// { 0x54AE, "" }, +// { 0x54AF, "" }, +// { 0x54B0, "" }, + { 0x54B1, "setup_vehicle_light_types" }, +// { 0x54B2, "" }, + { 0x54B3, "daughter_struct" }, +// { 0x54B4, "" }, + { 0x54B5, "crash_init_flags" }, + { 0x54B6, "crash_objectives" }, +// { 0x54B7, "" }, +// { 0x54B8, "" }, +// { 0x54B9, "" }, + { 0x54BA, "crash_room_door_blocker" }, + { 0x54BB, "open_cargo_door" }, + { 0x54BC, "start_plane_crash" }, +// { 0x54BD, "" }, + { 0x54BE, "airplane_cleanup" }, +// { 0x54BF, "" }, +// { 0x54C0, "" }, + { 0x54C1, "attach_tag" }, +// { 0x54C2, "" }, +// { 0x54C3, "" }, +// { 0x54C4, "" }, +// { 0x54C5, "" }, +// { 0x54C6, "" }, + { 0x54C7, "hero_agent_prepare_for_crash" }, +// { 0x54C8, "" }, +// { 0x54C9, "" }, + { 0x54CA, "quickfade" }, + { 0x54CB, "thread_spin" }, + { 0x54CC, "plane_crash_anim_firstframe" }, +// { 0x54CD, "" }, +// { 0x54CE, "" }, +// { 0x54CF, "" }, + { 0x54D0, "handle_engine_swap" }, +// { 0x54D1, "" }, + { 0x54D2, "transition_to_tarmac" }, +// { 0x54D3, "" }, +// { 0x54D4, "" }, +// { 0x54D5, "" }, +// { 0x54D6, "" }, + { 0x54D7, "pushing_at_edge_measure_time" }, +// { 0x54D8, "" }, +// { 0x54D9, "" }, +// { 0x54DA, "" }, +// { 0x54DB, "" }, +// { 0x54DC, "" }, +// { 0x54DD, "" }, +// { 0x54DE, "" }, +// { 0x54DF, "" }, +// { 0x54E0, "" }, +// { 0x54E1, "" }, + { 0x54E2, "handle_commander_crash" }, +// { 0x54E3, "" }, +// { 0x54E4, "" }, +// { 0x54E5, "" }, +// { 0x54E6, "" }, +// { 0x54E7, "" }, +// { 0x54E8, "" }, + { 0x54E9, "crash_light_scale_max" }, +// { 0x54EA, "" }, +// { 0x54EB, "" }, + { 0x54EC, "sunlight_flicker_lifetime_values" }, +// { 0x54ED, "" }, +// { 0x54EE, "" }, +// { 0x54EF, "" }, +// { 0x54F0, "" }, +// { 0x54F1, "" }, + { 0x54F2, "commander_wake_up" }, +// { 0x54F3, "" }, +// { 0x54F4, "" }, +// { 0x54F5, "" }, + { 0x54F6, "handle_runner_lights" }, +// { 0x54F7, "" }, +// { 0x54F8, "" }, + { 0x54F9, "runner_lights_seton" }, + { 0x54FA, "maps/createart/hijack_art" }, + { 0x54FB, "start_airplane" }, + { 0x54FC, "start_debate" }, + { 0x54FD, "start_pre_zero_g" }, + { 0x54FE, "start_lower_level_combat" }, +// { 0x54FF, "" }, +// { 0x5500, "" }, + { 0x5501, "level_init_assets" }, +// { 0x5502, "" }, +// { 0x5503, "" }, + { 0x5504, "debate_laptop_off" }, +// { 0x5505, "" }, +// { 0x5506, "" }, + { 0x5507, "orig_wakeupradius" }, +// { 0x5508, "" }, + { 0x5509, "orig_sundirection" }, +// { 0x550A, "" }, + { 0x550B, "seatbeltsigns" }, +// { 0x550C, "" }, +// { 0x550D, "" }, +// { 0x550E, "" }, +// { 0x550F, "" }, +// { 0x5510, "" }, +// { 0x5511, "" }, + { 0x5512, "setup_object_mass" }, + { 0x5513, "setup_tarmac_triggers" }, +// { 0x5514, "" }, +// { 0x5515, "" }, + { 0x5516, "godrays" }, +// { 0x5517, "" }, +// { 0x5518, "" }, +// { 0x5519, "" }, +// { 0x551A, "" }, + { 0x551B, "agent_death" }, +// { 0x551C, "" }, +// { 0x551D, "" }, +// { 0x551E, "" }, +// { 0x551F, "" }, +// { 0x5520, "" }, +// { 0x5521, "" }, + { 0x5522, "setup_hero_agent_01" }, +// { 0x5523, "" }, +// { 0x5524, "" }, +// { 0x5525, "" }, +// { 0x5526, "" }, +// { 0x5527, "" }, +// { 0x5528, "" }, +// { 0x5529, "" }, + { 0x552A, "manage_tail_models" }, + { 0x552B, "hide_tail_models" }, +// { 0x552C, "" }, +// { 0x552D, "" }, +// { 0x552E, "" }, +// { 0x552F, "" }, +// { 0x5530, "" }, +// { 0x5531, "" }, +// { 0x5532, "" }, + { 0x5533, "secretary" }, +// { 0x5534, "" }, +// { 0x5535, "" }, + { 0x5536, "hallway_roller" }, +// { 0x5537, "" }, + { 0x5538, "hallway_rumble_low" }, +// { 0x5539, "" }, +// { 0x553A, "" }, +// { 0x553B, "" }, +// { 0x553C, "" }, +// { 0x553D, "" }, +// { 0x553E, "" }, +// { 0x553F, "" }, + { 0x5540, "jet_2a" }, +// { 0x5541, "" }, +// { 0x5542, "" }, +// { 0x5543, "" }, +// { 0x5544, "" }, +// { 0x5545, "" }, +// { 0x5546, "" }, + { 0x5547, "intro_vo" }, + { 0x5548, "intro_pres_notes" }, +// { 0x5549, "" }, + { 0x554A, "door_rig2" }, +// { 0x554B, "" }, +// { 0x554C, "" }, +// { 0x554D, "" }, +// { 0x554E, "" }, + { 0x554F, "intro_env" }, + { 0x5550, "intro_doors" }, +// { 0x5551, "" }, +// { 0x5552, "" }, +// { 0x5553, "" }, + { 0x5554, "door_rig3" }, + { 0x5555, "door4" }, + { 0x5556, "door_rig4" }, +// { 0x5557, "" }, +// { 0x5558, "" }, + { 0x5559, "debate_chair_anim" }, + { 0x555A, "debate_chair_destroy" }, +// { 0x555B, "" }, +// { 0x555C, "" }, +// { 0x555D, "" }, + { 0x555E, "debate" }, +// { 0x555F, "" }, + { 0x5560, "debate_hallway_screams" }, +// { 0x5561, "" }, +// { 0x5562, "" }, + { 0x5563, "debate_prep_agent2_gun" }, +// { 0x5564, "" }, + { 0x5565, "debate_hijacker_vo" }, +// { 0x5566, "" }, +// { 0x5567, "" }, + { 0x5568, "debate_lurch_props" }, +// { 0x5569, "" }, +// { 0x556A, "" }, +// { 0x556B, "" }, +// { 0x556C, "" }, +// { 0x556D, "" }, +// { 0x556E, "" }, + { 0x556F, "debate_commander_fx" }, +// { 0x5570, "" }, +// { 0x5571, "" }, +// { 0x5572, "" }, +// { 0x5573, "" }, +// { 0x5574, "" }, +// { 0x5575, "" }, +// { 0x5576, "" }, +// { 0x5577, "" }, +// { 0x5578, "" }, + { 0x5579, "debate_agent2_end_loop" }, +// { 0x557A, "" }, +// { 0x557B, "" }, + { 0x557C, "screen_movies" }, +// { 0x557D, "" }, + { 0x557E, "tv_movies" }, +// { 0x557F, "" }, +// { 0x5580, "" }, +// { 0x5581, "" }, +// { 0x5582, "" }, +// { 0x5583, "" }, +// { 0x5584, "" }, +// { 0x5585, "" }, +// { 0x5586, "" }, +// { 0x5587, "" }, +// { 0x5588, "" }, +// { 0x5589, "" }, +// { 0x558A, "" }, + { 0x558B, "hallway_carnage" }, +// { 0x558C, "" }, + { 0x558D, "pre_zerog_behavior" }, +// { 0x558E, "" }, + { 0x558F, "stop_pre_zerog_behavior" }, +// { 0x5590, "" }, +// { 0x5591, "" }, +// { 0x5592, "" }, +// { 0x5593, "" }, +// { 0x5594, "" }, +// { 0x5595, "" }, + { 0x5596, "zerog_guys" }, +// { 0x5597, "" }, +// { 0x5598, "" }, + { 0x5599, "anim_1" }, +// { 0x559A, "" }, +// { 0x559B, "" }, +// { 0x559C, "" }, +// { 0x559D, "" }, +// { 0x559E, "" }, +// { 0x559F, "" }, + { 0x55A0, "zerog_props" }, +// { 0x55A1, "" }, + { 0x55A2, "extra_props_left" }, +// { 0x55A3, "" }, + { 0x55A4, "zerog_swap_destruct_fx" }, +// { 0x55A5, "" }, +// { 0x55A6, "" }, +// { 0x55A7, "" }, + { 0x55A8, "zerog_door_behavior" }, +// { 0x55A9, "" }, +// { 0x55AA, "" }, +// { 0x55AB, "" }, +// { 0x55AC, "" }, + { 0x55AD, "zerog_planedive" }, +// { 0x55AE, "" }, +// { 0x55AF, "" }, + { 0x55B0, "zerog_bigshake" }, + { 0x55B1, "zerog_planerollleft" }, + { 0x55B2, "zerog_thirdhit" }, +// { 0x55B3, "" }, +// { 0x55B4, "" }, +// { 0x55B5, "" }, +// { 0x55B6, "" }, +// { 0x55B7, "" }, +// { 0x55B8, "" }, +// { 0x55B9, "" }, +// { 0x55BA, "" }, +// { 0x55BB, "" }, +// { 0x55BC, "" }, +// { 0x55BD, "" }, + { 0x55BE, "start_lower_combat" }, +// { 0x55BF, "" }, + { 0x55C0, "lower_comm_cargo_enemies" }, +// { 0x55C1, "" }, +// { 0x55C2, "" }, + { 0x55C3, "try_move_commander_through_dining_room" }, +// { 0x55C4, "" }, +// { 0x55C5, "" }, + { 0x55C6, "commander_initial_moves" }, + { 0x55C7, "lower_level_dead_allies" }, + { 0x55C8, "lower_level_radio_chatter" }, +// { 0x55C9, "" }, +// { 0x55CA, "" }, +// { 0x55CB, "" }, +// { 0x55CC, "" }, +// { 0x55CD, "" }, + { 0x55CE, "enemies_stumble" }, +// { 0x55CF, "" }, +// { 0x55D0, "" }, +// { 0x55D1, "" }, +// { 0x55D2, "" }, + { 0x55D3, "door_terrorist" }, + { 0x55D4, "allow_stumbling_terrorists_to_die" }, +// { 0x55D5, "" }, +// { 0x55D6, "" }, + { 0x55D7, "cargo_room_lurch" }, +// { 0x55D8, "" }, + { 0x55D9, "cargo_move_props" }, +// { 0x55DA, "" }, +// { 0x55DB, "" }, +// { 0x55DC, "" }, +// { 0x55DD, "" }, +// { 0x55DE, "" }, +// { 0x55DF, "" }, +// { 0x55E0, "" }, +// { 0x55E1, "" }, +// { 0x55E2, "" }, +// { 0x55E3, "" }, +// { 0x55E4, "" }, +// { 0x55E5, "" }, +// { 0x55E6, "" }, + { 0x55E7, "commander_post_crash_animset" }, +// { 0x55E8, "" }, +// { 0x55E9, "" }, +// { 0x55EA, "" }, + { 0x55EB, "setupsp" }, + { 0x55EC, "setupplane" }, + { 0x55ED, "setupglass" }, +// { 0x55EE, "" }, +// { 0x55EF, "" }, + { 0x55F0, "playerdetectdamage" }, +// { 0x55F1, "" }, +// { 0x55F2, "" }, +// { 0x55F3, "" }, +// { 0x55F4, "" }, +// { 0x55F5, "" }, +// { 0x55F6, "" }, +// { 0x55F7, "" }, +// { 0x55F8, "" }, +// { 0x55F9, "" }, +// { 0x55FA, "" }, +// { 0x55FB, "" }, + { 0x55FC, "new_enemy_accuracy" }, +// { 0x55FD, "" }, +// { 0x55FE, "" }, + { 0x55FF, "setupenemyanims" }, + { 0x5600, "setupplayeranims" }, + { 0x5601, "playerplaycoopslideanim" }, +// { 0x5602, "" }, +// { 0x5603, "" }, +// { 0x5604, "" }, +// { 0x5605, "" }, + { 0x5606, "somilehighveteran" }, +// { 0x5607, "" }, + { 0x5608, "so_president" }, + { 0x5609, "presidentupdatecaptureobjective" }, +// { 0x560A, "" }, +// { 0x560B, "" }, + { 0x560C, "customeogsummary" }, +// { 0x560D, "" }, +// { 0x560E, "" }, +// { 0x560F, "" }, + { 0x5610, "spawnenemiesbyname" }, +// { 0x5611, "" }, +// { 0x5612, "" }, +// { 0x5613, "" }, +// { 0x5614, "" }, +// { 0x5615, "" }, + { 0x5616, "stopslidingplayers" }, + { 0x5617, "animateplanetiltview" }, + { 0x5618, "throwdiningroomitems" }, + { 0x5619, "putrollersbacktozero" }, +// { 0x561A, "" }, +// { 0x561B, "" }, +// { 0x561C, "" }, + { 0x561D, "debateroomitemsduringbreach" }, + { 0x561E, "chairsetup" }, + { 0x561F, "chairdestroy" }, + { 0x5620, "enemydienoragdoll" }, +// { 0x5621, "" }, + { 0x5622, "commandersetup" }, + { 0x5623, "enemyremovegun" }, + { 0x5624, "enemyplayendloopinganimation" }, +// { 0x5625, "" }, +// { 0x5626, "" }, +// { 0x5627, "" }, + { 0x5628, "anim_play_at_time" }, +// { 0x5629, "" }, + { 0x562A, "cancapturepresident" }, +// { 0x562B, "" }, +// { 0x562C, "" }, +// { 0x562D, "" }, +// { 0x562E, "" }, +// { 0x562F, "" }, +// { 0x5630, "" }, +// { 0x5631, "" }, + { 0x5632, "character/character_africa_militia_assault_a" }, + { 0x5633, "character/character_africa_militia_assault_b" }, +// { 0x5634, "" }, +// { 0x5635, "" }, +// { 0x5636, "" }, +// { 0x5637, "" }, +// { 0x5638, "" }, +// { 0x5639, "" }, + { 0x563A, "character/character_africa_militia_rpg_a" }, +// { 0x563B, "" }, +// { 0x563C, "" }, +// { 0x563D, "" }, +// { 0x563E, "" }, + { 0x563F, "clearirtarget" }, + { 0x5640, "stinger" }, + { 0x5641, "stingerlockstarted" }, +// { 0x5642, "" }, +// { 0x5643, "" }, + { 0x5644, "stingerfirednotify" }, + { 0x5645, "stingertoggleloop" }, + { 0x5646, "stingerirtloop" }, +// { 0x5647, "" }, + { 0x5648, "insidestingerreticlenolock" }, +// { 0x5649, "" }, +// { 0x564A, "" }, +// { 0x564B, "" }, + { 0x564C, "targettoclose" }, + { 0x564D, "maps/_stinger" }, + { 0x564E, "vehicle_scripts/_cobra" }, +// { 0x564F, "" }, + { 0x5650, "showing_hostage_hint_array" }, +// { 0x5651, "" }, +// { 0x5652, "" }, + { 0x5653, "enemy_array_group_1" }, + { 0x5654, "enemy_array_group_2" }, +// { 0x5655, "" }, +// { 0x5656, "" }, + { 0x5657, "hostage_guards" }, +// { 0x5658, "" }, +// { 0x5659, "" }, +// { 0x565A, "" }, +// { 0x565B, "" }, +// { 0x565C, "" }, +// { 0x565D, "" }, +// { 0x565E, "" }, + { 0x565F, "waves_spawned" }, +// { 0x5660, "" }, +// { 0x5661, "" }, +// { 0x5662, "" }, +// { 0x5663, "" }, +// { 0x5664, "" }, +// { 0x5665, "" }, +// { 0x5666, "" }, +// { 0x5667, "" }, +// { 0x5668, "" }, +// { 0x5669, "" }, +// { 0x566A, "" }, + { 0x566B, "max_score_time" }, + { 0x566C, "escape_vehicle" }, +// { 0x566D, "" }, +// { 0x566E, "" }, + { 0x566F, "initialguardsightrangesqrd" }, +// { 0x5670, "" }, + { 0x5671, "stage" }, +// { 0x5672, "" }, + { 0x5673, "fog_brushes" }, +// { 0x5674, "" }, +// { 0x5675, "" }, +// { 0x5676, "" }, +// { 0x5677, "" }, +// { 0x5678, "" }, + { 0x5679, "setfixednode" }, + { 0x567A, "hostage_death_count" }, +// { 0x567B, "" }, +// { 0x567C, "" }, +// { 0x567D, "" }, +// { 0x567E, "" }, + { 0x567F, "wake" }, +// { 0x5680, "" }, +// { 0x5681, "" }, +// { 0x5682, "" }, + { 0x5683, "advance_to_stage" }, +// { 0x5684, "" }, +// { 0x5685, "" }, + { 0x5686, "triggered_alert_1" }, + { 0x5687, "triggered_alert_3" }, +// { 0x5688, "" }, +// { 0x5689, "" }, +// { 0x568A, "" }, +// { 0x568B, "" }, +// { 0x568C, "" }, +// { 0x568D, "" }, +// { 0x568E, "" }, +// { 0x568F, "" }, + { 0x5690, "heli_timer" }, +// { 0x5691, "" }, +// { 0x5692, "" }, + { 0x5693, "hud_so_seen_count" }, +// { 0x5694, "" }, +// { 0x5695, "" }, + { 0x5696, "enable_hostage_trigger" }, +// { 0x5697, "" }, + { 0x5698, "cobra_think" }, +// { 0x5699, "" }, +// { 0x569A, "" }, + { 0x569B, "individual_vip_objective" }, +// { 0x569C, "" }, +// { 0x569D, "" }, + { 0x569E, "guard_path" }, +// { 0x569F, "" }, +// { 0x56A0, "" }, +// { 0x56A1, "" }, +// { 0x56A2, "" }, +// { 0x56A3, "" }, +// { 0x56A4, "" }, + { 0x56A5, "character/character_opforce_rescue_assault_b" }, +// { 0x56A6, "" }, +// { 0x56A7, "" }, +// { 0x56A8, "" }, +// { 0x56A9, "" }, +// { 0x56AA, "" }, +// { 0x56AB, "" }, +// { 0x56AC, "" }, + { 0x56AD, "ac130_weapon_tag" }, +// { 0x56AE, "" }, + { 0x56AF, "ac130_player_view_controller_ref" }, +// { 0x56B0, "" }, +// { 0x56B1, "" }, +// { 0x56B2, "" }, +// { 0x56B3, "" }, +// { 0x56B4, "" }, +// { 0x56B5, "" }, +// { 0x56B6, "" }, + { 0x56B7, "weapon_reload_time" }, + { 0x56B8, "weapon_input_cooldown_active" }, + { 0x56B9, "weapon_input_cooldown_time" }, +// { 0x56BA, "" }, +// { 0x56BB, "" }, +// { 0x56BC, "" }, +// { 0x56BD, "" }, +// { 0x56BE, "" }, +// { 0x56BF, "" }, +// { 0x56C0, "" }, +// { 0x56C1, "" }, +// { 0x56C2, "" }, + { 0x56C3, "weapon_cooldown_time" }, + { 0x56C4, "ac130_weapon_tag_offset" }, +// { 0x56C5, "" }, +// { 0x56C6, "" }, +// { 0x56C7, "" }, +// { 0x56C8, "" }, +// { 0x56C9, "" }, +// { 0x56CA, "" }, +// { 0x56CB, "" }, +// { 0x56CC, "" }, +// { 0x56CD, "" }, +// { 0x56CE, "" }, +// { 0x56CF, "" }, +// { 0x56D0, "" }, + { 0x56D1, "ac130_hud_target_hide_queue" }, + { 0x56D2, "ac130_current_fov" }, + { 0x56D3, "ac130_friendly_fire_dialogue_priority" }, + { 0x56D4, "ac130_projectile_callback" }, +// { 0x56D5, "" }, + { 0x56D6, "weapon_name" }, +// { 0x56D7, "" }, + { 0x56D8, "hudelem_y" }, +// { 0x56D9, "" }, +// { 0x56DA, "" }, +// { 0x56DB, "" }, +// { 0x56DC, "" }, +// { 0x56DD, "" }, + { 0x56DE, "ac130_hud_weapon_fontscale" }, + { 0x56DF, "ac130_hud_data_fontscale" }, + { 0x56E0, "ac130_hudtargetsize" }, +// { 0x56E1, "" }, +// { 0x56E2, "" }, +// { 0x56E3, "" }, + { 0x56E4, "ac130_hudtargetscreenedgeclampbufferbottom" }, +// { 0x56E5, "" }, +// { 0x56E6, "" }, + { 0x56E7, "ac130_default_hudtargetscreenedgeclampbufferright" }, +// { 0x56E8, "" }, +// { 0x56E9, "" }, +// { 0x56EA, "" }, +// { 0x56EB, "" }, +// { 0x56EC, "" }, +// { 0x56ED, "" }, + { 0x56EE, "ac130_thermal_sun_color" }, +// { 0x56EF, "" }, + { 0x56F0, "ac130_thermal_sun_begin_fade_angle" }, +// { 0x56F1, "" }, + { 0x56F2, "ac130_thermal_sun_fog_scale" }, +// { 0x56F3, "" }, +// { 0x56F4, "" }, + { 0x56F5, "ac130_enhanced_fog_halfway_dist" }, +// { 0x56F6, "" }, +// { 0x56F7, "" }, +// { 0x56F8, "" }, +// { 0x56F9, "" }, +// { 0x56FA, "" }, +// { 0x56FB, "" }, +// { 0x56FC, "" }, +// { 0x56FD, "" }, +// { 0x56FE, "" }, +// { 0x56FF, "" }, +// { 0x5700, "" }, + { 0x5701, "ac130_enhanced_blur" }, +// { 0x5702, "" }, +// { 0x5703, "" }, +// { 0x5704, "" }, +// { 0x5705, "" }, + { 0x5706, "current_shell_shock" }, +// { 0x5707, "" }, +// { 0x5708, "" }, + { 0x5709, "_ac130_init_hints" }, + { 0x570A, "_ac130_set_dvar" }, +// { 0x570B, "" }, + { 0x570C, "_ac130_init_player" }, +// { 0x570D, "" }, + { 0x570E, "player_angles_at_last_ac130_fire" }, +// { 0x570F, "" }, + { 0x5710, "ac130_view_rig" }, + { 0x5711, "ac130_rig_controller" }, + { 0x5712, "setup_coop_ac130_model" }, +// { 0x5713, "" }, +// { 0x5714, "" }, +// { 0x5715, "" }, +// { 0x5716, "" }, +// { 0x5717, "" }, +// { 0x5718, "" }, +// { 0x5719, "" }, +// { 0x571A, "" }, +// { 0x571B, "" }, +// { 0x571C, "" }, +// { 0x571D, "" }, +// { 0x571E, "" }, + { 0x571F, "hud_update_player_data" }, + { 0x5720, "hud_update_player_pitch" }, +// { 0x5721, "" }, +// { 0x5722, "" }, +// { 0x5723, "" }, +// { 0x5724, "" }, +// { 0x5725, "" }, +// { 0x5726, "" }, +// { 0x5727, "" }, +// { 0x5728, "" }, +// { 0x5729, "" }, +// { 0x572A, "" }, +// { 0x572B, "" }, +// { 0x572C, "" }, + { 0x572D, "hud_blink_reloading" }, +// { 0x572E, "" }, +// { 0x572F, "" }, + { 0x5730, "hud_lock_on_flash_stop" }, + { 0x5731, "hud_recording_start" }, +// { 0x5732, "" }, +// { 0x5733, "" }, +// { 0x5734, "" }, + { 0x5735, "hud_target_active_mode" }, +// { 0x5736, "" }, +// { 0x5737, "" }, +// { 0x5738, "" }, +// { 0x5739, "" }, + { 0x573A, "hud_monitor_target" }, + { 0x573B, "hud_target_toggle_visibility_queue" }, +// { 0x573C, "" }, +// { 0x573D, "" }, +// { 0x573E, "" }, +// { 0x573F, "" }, +// { 0x5740, "" }, +// { 0x5741, "" }, +// { 0x5742, "" }, +// { 0x5743, "" }, +// { 0x5744, "" }, +// { 0x5745, "" }, + { 0x5746, "monitor_change_weapons" }, + { 0x5747, "monitor_25mm_sound" }, +// { 0x5748, "" }, +// { 0x5749, "" }, +// { 0x574A, "" }, +// { 0x574B, "" }, +// { 0x574C, "" }, + { 0x574D, "hint_zoom" }, + { 0x574E, "ac130_set_view_arc" }, +// { 0x574F, "" }, + { 0x5750, "ac130_set_thermal_shock" }, + { 0x5751, "ac130_set_enhanced_shock" }, + { 0x5752, "ac130_set_thermal_vision_set" }, +// { 0x5753, "" }, +// { 0x5754, "" }, +// { 0x5755, "" }, +// { 0x5756, "" }, +// { 0x5757, "" }, +// { 0x5758, "" }, + { 0x5759, "fade_to_white" }, + { 0x575A, "fade_in_from_white" }, +// { 0x575B, "" }, + { 0x575C, "weapon_fire_notify" }, + { 0x575D, "weapon_fire" }, +// { 0x575E, "" }, +// { 0x575F, "" }, +// { 0x5760, "" }, +// { 0x5761, "" }, +// { 0x5762, "" }, +// { 0x5763, "" }, +// { 0x5764, "" }, +// { 0x5765, "" }, + { 0x5766, "set_badplace_max" }, + { 0x5767, "shotfiredfriendlyproximity" }, +// { 0x5768, "" }, +// { 0x5769, "" }, +// { 0x576A, "" }, +// { 0x576B, "" }, +// { 0x576C, "" }, + { 0x576D, "add_ac130_vehicle_beacon_effect" }, +// { 0x576E, "" }, +// { 0x576F, "" }, +// { 0x5770, "" }, +// { 0x5771, "" }, +// { 0x5772, "" }, + { 0x5773, "context_sensitive_dialog_guy_pain" }, +// { 0x5774, "" }, +// { 0x5775, "" }, + { 0x5776, "context_sensitive_dialog_locations" }, + { 0x5777, "context_sensitive_dialog_locations_thread" }, +// { 0x5778, "" }, +// { 0x5779, "" }, +// { 0x577A, "" }, +// { 0x577B, "" }, +// { 0x577C, "" }, +// { 0x577D, "" }, +// { 0x577E, "" }, +// { 0x577F, "" }, +// { 0x5780, "" }, + { 0x5781, "give_p99" }, +// { 0x5782, "" }, + { 0x5783, "spawn_grinch" }, + { 0x5784, "counter" }, + { 0x5785, "setup_grinch" }, +// { 0x5786, "" }, +// { 0x5787, "" }, +// { 0x5788, "" }, + { 0x5789, "delta_two" }, + { 0x578A, "nightvision_setup" }, + { 0x578B, "elevator_down_setup" }, + { 0x578C, "warp_elevator" }, +// { 0x578D, "" }, +// { 0x578E, "" }, +// { 0x578F, "" }, +// { 0x5790, "" }, + { 0x5791, "elevator_rocket_guys" }, +// { 0x5792, "" }, +// { 0x5793, "" }, +// { 0x5794, "" }, +// { 0x5795, "" }, +// { 0x5796, "" }, +// { 0x5797, "" }, +// { 0x5798, "" }, +// { 0x5799, "" }, + { 0x579A, "elevator_doors" }, + { 0x579B, "crash_dialogue" }, +// { 0x579C, "" }, +// { 0x579D, "" }, +// { 0x579E, "" }, +// { 0x579F, "" }, +// { 0x57A0, "" }, +// { 0x57A1, "" }, + { 0x57A2, "elevator_ambush" }, +// { 0x57A3, "" }, +// { 0x57A4, "" }, +// { 0x57A5, "" }, +// { 0x57A6, "" }, +// { 0x57A7, "" }, +// { 0x57A8, "" }, +// { 0x57A9, "" }, +// { 0x57AA, "" }, + { 0x57AB, "spark_lighters" }, +// { 0x57AC, "" }, +// { 0x57AD, "" }, + { 0x57AE, "elevator_rotation" }, +// { 0x57AF, "" }, +// { 0x57B0, "" }, + { 0x57B1, "delete_tunnel_ai" }, + { 0x57B2, "quick_elevator_reactions" }, +// { 0x57B3, "" }, + { 0x57B4, "quick_elevator_reactions_two" }, +// { 0x57B5, "" }, +// { 0x57B6, "" }, + { 0x57B7, "ele_sparks" }, +// { 0x57B8, "" }, +// { 0x57B9, "" }, +// { 0x57BA, "" }, +// { 0x57BB, "" }, +// { 0x57BC, "" }, +// { 0x57BD, "" }, + { 0x57BE, "cave_lead_player_eye_top_think" }, + { 0x57BF, "cave_lead_player_eye_ground_left" }, +// { 0x57C0, "" }, + { 0x57C1, "zipline_dialouge" }, +// { 0x57C2, "" }, +// { 0x57C3, "" }, +// { 0x57C4, "" }, + { 0x57C5, "cave_rappel_think" }, +// { 0x57C6, "" }, +// { 0x57C7, "" }, +// { 0x57C8, "" }, + { 0x57C9, "cave_rappel_rpg_think" }, + { 0x57CA, "bay_runner_think" }, +// { 0x57CB, "" }, +// { 0x57CC, "" }, +// { 0x57CD, "" }, +// { 0x57CE, "" }, +// { 0x57CF, "" }, + { 0x57D0, "saw_sparks" }, +// { 0x57D1, "" }, +// { 0x57D2, "" }, +// { 0x57D3, "" }, +// { 0x57D4, "" }, +// { 0x57D5, "" }, +// { 0x57D6, "" }, +// { 0x57D7, "" }, + { 0x57D8, "kill_my_fx" }, + { 0x57D9, "bay_snowmobile_kill" }, +// { 0x57DA, "" }, + { 0x57DB, "bay_exit_double_door" }, +// { 0x57DC, "" }, + { 0x57DD, "bay_top_outside_two_think" }, +// { 0x57DE, "" }, +// { 0x57DF, "" }, +// { 0x57E0, "" }, +// { 0x57E1, "" }, +// { 0x57E2, "" }, +// { 0x57E3, "" }, +// { 0x57E4, "" }, +// { 0x57E5, "" }, +// { 0x57E6, "" }, + { 0x57E7, "yard_one_setup" }, +// { 0x57E8, "" }, +// { 0x57E9, "" }, +// { 0x57EA, "" }, +// { 0x57EB, "" }, +// { 0x57EC, "" }, +// { 0x57ED, "" }, +// { 0x57EE, "" }, +// { 0x57EF, "" }, +// { 0x57F0, "" }, + { 0x57F1, "metal_railings_damaged" }, +// { 0x57F2, "" }, + { 0x57F3, "ambient_paths" }, +// { 0x57F4, "" }, +// { 0x57F5, "" }, + { 0x57F6, "friends_drop_off" }, + { 0x57F7, "custom_script_anim_slide" }, +// { 0x57F8, "" }, + { 0x57F9, "littlebird_hero" }, +// { 0x57FA, "" }, + { 0x57FB, "littlebird_ambient_left_right" }, +// { 0x57FC, "" }, + { 0x57FD, "littlebird_trigger" }, +// { 0x57FE, "" }, + { 0x57FF, "heli_yard_attack_suburbans" }, +// { 0x5800, "" }, +// { 0x5801, "" }, + { 0x5802, "littlebird_minigun" }, +// { 0x5803, "" }, + { 0x5804, "fire_missile_setup" }, +// { 0x5805, "" }, +// { 0x5806, "" }, +// { 0x5807, "" }, +// { 0x5808, "" }, + { 0x5809, "delta_yard_right_think" }, +// { 0x580A, "" }, + { 0x580B, "snow" }, +// { 0x580C, "" }, +// { 0x580D, "" }, +// { 0x580E, "" }, +// { 0x580F, "" }, +// { 0x5810, "" }, +// { 0x5811, "" }, + { 0x5812, "heli_one" }, +// { 0x5813, "" }, + { 0x5814, "left_heli_amb_path_one" }, +// { 0x5815, "" }, +// { 0x5816, "" }, +// { 0x5817, "" }, +// { 0x5818, "" }, +// { 0x5819, "" }, +// { 0x581A, "" }, +// { 0x581B, "" }, +// { 0x581C, "" }, + { 0x581D, "kill_ai" }, +// { 0x581E, "" }, +// { 0x581F, "" }, + { 0x5820, "yard_high_road_support_think" }, +// { 0x5821, "" }, +// { 0x5822, "" }, +// { 0x5823, "" }, +// { 0x5824, "" }, +// { 0x5825, "" }, +// { 0x5826, "" }, +// { 0x5827, "" }, + { 0x5828, "new_yard_beggining_battle" }, + { 0x5829, "random_crash_location" }, + { 0x582A, "yard_sniper_think" }, +// { 0x582B, "" }, +// { 0x582C, "" }, + { 0x582D, "delete_chopper" }, +// { 0x582E, "" }, +// { 0x582F, "" }, +// { 0x5830, "" }, +// { 0x5831, "" }, + { 0x5832, "end_sub" }, +// { 0x5833, "" }, +// { 0x5834, "" }, +// { 0x5835, "" }, +// { 0x5836, "" }, + { 0x5837, "in_bound_missle_strike" }, +// { 0x5838, "" }, +// { 0x5839, "" }, + { 0x583A, "power_tower_damage_tracker" }, +// { 0x583B, "" }, +// { 0x583C, "" }, + { 0x583D, "stumble_alot" }, + { 0x583E, "track_tanks" }, +// { 0x583F, "" }, +// { 0x5840, "" }, + { 0x5841, "set_start_positions_two" }, +// { 0x5842, "" }, +// { 0x5843, "" }, +// { 0x5844, "" }, + { 0x5845, "cave_shake_sound" }, + { 0x5846, "cave_shake_source" }, + { 0x5847, "shake_fx_num" }, + { 0x5848, "cave_shake" }, + { 0x5849, "shake_light_flicker" }, +// { 0x584A, "" }, + { 0x584B, "give_player_predator_reaper" }, + { 0x584C, "uav_target" }, +// { 0x584D, "" }, + { 0x584E, "do_random_stunned_anim" }, + { 0x584F, "stun_anims" }, +// { 0x5850, "" }, +// { 0x5851, "" }, +// { 0x5852, "" }, + { 0x5853, "array_spawn_allow_fail" }, +// { 0x5854, "" }, + { 0x5855, "array_spawn_targetname_allow_fail" }, +// { 0x5856, "" }, +// { 0x5857, "" }, +// { 0x5858, "" }, +// { 0x5859, "" }, + { 0x585A, "move_spawn_and_go" }, +// { 0x585B, "" }, +// { 0x585C, "" }, + { 0x585D, "fake_helis_above_tier_one" }, + { 0x585E, "fake_helis_above_tier_two" }, +// { 0x585F, "" }, +// { 0x5860, "" }, +// { 0x5861, "" }, +// { 0x5862, "" }, +// { 0x5863, "" }, +// { 0x5864, "" }, +// { 0x5865, "" }, +// { 0x5866, "" }, +// { 0x5867, "" }, +// { 0x5868, "" }, +// { 0x5869, "" }, + { 0x586A, "cavern_bottom_pres_defend_setup" }, +// { 0x586B, "" }, +// { 0x586C, "" }, + { 0x586D, "rescue_heli" }, +// { 0x586E, "" }, +// { 0x586F, "" }, + { 0x5870, "heli_falling_rocks" }, +// { 0x5871, "" }, +// { 0x5872, "" }, +// { 0x5873, "" }, +// { 0x5874, "" }, +// { 0x5875, "" }, + { 0x5876, "floor_breach_setup" }, + { 0x5877, "floor_breach_charge" }, +// { 0x5878, "" }, + { 0x5879, "chase_timer" }, +// { 0x587A, "" }, +// { 0x587B, "" }, +// { 0x587C, "" }, + { 0x587D, "crew_in_elevator" }, +// { 0x587E, "" }, +// { 0x587F, "" }, +// { 0x5880, "" }, + { 0x5881, "kick_upper_door" }, +// { 0x5882, "" }, +// { 0x5883, "" }, + { 0x5884, "stop_door_open" }, + { 0x5885, "start_elevator_sparks" }, + { 0x5886, "rappel_down_cavern" }, +// { 0x5887, "" }, +// { 0x5888, "" }, + { 0x5889, "ropenode" }, +// { 0x588A, "" }, +// { 0x588B, "" }, +// { 0x588C, "" }, +// { 0x588D, "" }, +// { 0x588E, "" }, +// { 0x588F, "" }, + { 0x5890, "animnode" }, + { 0x5891, "breach_floor_explosion" }, + { 0x5892, "slabs" }, + { 0x5893, "packs" }, +// { 0x5894, "" }, +// { 0x5895, "" }, +// { 0x5896, "" }, + { 0x5897, "player_stumble" }, +// { 0x5898, "" }, + { 0x5899, "cavern_defend_wave_1" }, +// { 0x589A, "" }, +// { 0x589B, "" }, + { 0x589C, "cavern_heli_arrives" }, + { 0x589D, "cavern_heli_spawn" }, + { 0x589E, "rescue_heli_backup" }, + { 0x589F, "low_earthquake_intensify" }, +// { 0x58A0, "" }, +// { 0x58A1, "" }, +// { 0x58A2, "" }, +// { 0x58A3, "" }, +// { 0x58A4, "" }, +// { 0x58A5, "" }, +// { 0x58A6, "" }, +// { 0x58A7, "" }, +// { 0x58A8, "" }, +// { 0x58A9, "" }, +// { 0x58AA, "" }, + { 0x58AB, "rescue_heli_backup_death" }, + { 0x58AC, "bottom_ambush_dialogue" }, + { 0x58AD, "bottom_player_shellshock" }, +// { 0x58AE, "" }, + { 0x58AF, "player_shock_delta" }, +// { 0x58B0, "" }, +// { 0x58B1, "" }, +// { 0x58B2, "" }, +// { 0x58B3, "" }, +// { 0x58B4, "" }, + { 0x58B5, "argue_dialogue" }, +// { 0x58B6, "" }, +// { 0x58B7, "" }, +// { 0x58B8, "" }, + { 0x58B9, "retreat_rpgs" }, +// { 0x58BA, "" }, + { 0x58BB, "sandman_knife_guy" }, +// { 0x58BC, "" }, + { 0x58BD, "player_shellshock_blur" }, + { 0x58BE, "player_shellshock_breathing" }, + { 0x58BF, "cavern_helicopter_scene" }, + { 0x58C0, "ending_mortars" }, +// { 0x58C1, "" }, +// { 0x58C2, "" }, +// { 0x58C3, "" }, +// { 0x58C4, "" }, +// { 0x58C5, "" }, +// { 0x58C6, "" }, + { 0x58C7, "die_on_death" }, +// { 0x58C8, "" }, +// { 0x58C9, "" }, +// { 0x58CA, "" }, +// { 0x58CB, "" }, +// { 0x58CC, "" }, +// { 0x58CD, "" }, +// { 0x58CE, "" }, +// { 0x58CF, "" }, +// { 0x58D0, "" }, +// { 0x58D1, "" }, +// { 0x58D2, "" }, +// { 0x58D3, "" }, + { 0x58D4, "get_door_from_targetname" }, + { 0x58D5, "president_breach_spawners_think" }, +// { 0x58D6, "" }, + { 0x58D7, "president_holder_dies" }, +// { 0x58D8, "" }, +// { 0x58D9, "" }, + { 0x58DA, "disable_defend_triggers" }, +// { 0x58DB, "" }, +// { 0x58DC, "" }, +// { 0x58DD, "" }, + { 0x58DE, "cavern_start_dialogue" }, +// { 0x58DF, "" }, +// { 0x58E0, "" }, +// { 0x58E1, "" }, +// { 0x58E2, "" }, +// { 0x58E3, "" }, +// { 0x58E4, "" }, +// { 0x58E5, "" }, + { 0x58E6, "cavern_shake_trigger" }, + { 0x58E7, "swinging_light" }, + { 0x58E8, "cavern_defend_stay_close" }, +// { 0x58E9, "" }, +// { 0x58EA, "" }, +// { 0x58EB, "" }, +// { 0x58EC, "" }, +// { 0x58ED, "" }, + { 0x58EE, "put_player_on_heli" }, +// { 0x58EF, "" }, +// { 0x58F0, "" }, +// { 0x58F1, "" }, +// { 0x58F2, "" }, +// { 0x58F3, "" }, + { 0x58F4, "chopper_spawn_pilot" }, + { 0x58F5, "cavern_end_drone_think" }, +// { 0x58F6, "" }, +// { 0x58F7, "" }, +// { 0x58F8, "" }, +// { 0x58F9, "" }, +// { 0x58FA, "" }, +// { 0x58FB, "" }, +// { 0x58FC, "" }, + { 0x58FD, "disable_autoaim_think" }, +// { 0x58FE, "" }, +// { 0x58FF, "" }, +// { 0x5900, "" }, +// { 0x5901, "" }, +// { 0x5902, "" }, + { 0x5903, "player_kill_trigger" }, +// { 0x5904, "" }, +// { 0x5905, "" }, +// { 0x5906, "" }, +// { 0x5907, "" }, +// { 0x5908, "" }, + { 0x5909, "watchvelocity" }, +// { 0x590A, "" }, +// { 0x590B, "" }, +// { 0x590C, "" }, +// { 0x590D, "" }, +// { 0x590E, "" }, +// { 0x590F, "" }, +// { 0x5910, "" }, +// { 0x5911, "" }, +// { 0x5912, "" }, +// { 0x5913, "" }, +// { 0x5914, "" }, +// { 0x5915, "" }, +// { 0x5916, "" }, +// { 0x5917, "" }, +// { 0x5918, "" }, +// { 0x5919, "" }, + { 0x591A, "enemy_btr_killed" }, + { 0x591B, "enemy_hind_killed" }, +// { 0x591C, "" }, +// { 0x591D, "" }, +// { 0x591E, "" }, +// { 0x591F, "" }, + { 0x5920, "temp_obj_ent" }, +// { 0x5921, "" }, +// { 0x5922, "" }, +// { 0x5923, "" }, +// { 0x5924, "" }, +// { 0x5925, "" }, +// { 0x5926, "" }, +// { 0x5927, "" }, +// { 0x5928, "" }, +// { 0x5929, "" }, +// { 0x592A, "" }, +// { 0x592B, "" }, + { 0x592C, "c4" }, + { 0x592D, "setup_objectives" }, +// { 0x592E, "" }, +// { 0x592F, "" }, +// { 0x5930, "" }, +// { 0x5931, "" }, +// { 0x5932, "" }, + { 0x5933, "setup_so" }, +// { 0x5934, "" }, +// { 0x5935, "" }, + { 0x5936, "ac130_vehicle" }, +// { 0x5937, "" }, +// { 0x5938, "" }, +// { 0x5939, "" }, +// { 0x593A, "" }, +// { 0x593B, "" }, + { 0x593C, "shoot_missile_from_me" }, + { 0x593D, "obj1_fail_monitor" }, + { 0x593E, "launch_vo" }, + { 0x593F, "c130_missile_launch" }, + { 0x5940, "missile_announcements" }, +// { 0x5941, "" }, +// { 0x5942, "" }, + { 0x5943, "c130_detonation" }, +// { 0x5944, "" }, + { 0x5945, "player_basement_check" }, +// { 0x5946, "" }, + { 0x5947, "make_me_ac130_target" }, +// { 0x5948, "" }, +// { 0x5949, "" }, +// { 0x594A, "" }, +// { 0x594B, "" }, + { 0x594C, "make_my_riders_c130_targets" }, + { 0x594D, "spawn_attack_hinds" }, +// { 0x594E, "" }, + { 0x594F, "hind_attack_player" }, +// { 0x5950, "" }, +// { 0x5951, "" }, + { 0x5952, "minigun" }, +// { 0x5953, "" }, +// { 0x5954, "" }, + { 0x5955, "hind_attach_turret" }, +// { 0x5956, "" }, +// { 0x5957, "" }, +// { 0x5958, "" }, +// { 0x5959, "" }, + { 0x595A, "client_fade_out_in_on_flag" }, + { 0x595B, "print3d_on_me" }, + { 0x595C, "random_chance" }, +// { 0x595D, "" }, + { 0x595E, "override_array_call" }, + { 0x595F, "override_is_in_array" }, +// { 0x5960, "" }, +// { 0x5961, "" }, + { 0x5962, "override_delaythread_internal" }, +// { 0x5963, "" }, +// { 0x5964, "" }, +// { 0x5965, "" }, +// { 0x5966, "" }, +// { 0x5967, "" }, +// { 0x5968, "" }, +// { 0x5969, "" }, +// { 0x596A, "" }, +// { 0x596B, "" }, +// { 0x596C, "" }, +// { 0x596D, "" }, + { 0x596E, "flag_wait_any_set_flags" }, +// { 0x596F, "" }, + { 0x5970, "flag_wait_all_set_flags" }, +// { 0x5971, "" }, +// { 0x5972, "" }, +// { 0x5973, "" }, +// { 0x5974, "" }, +// { 0x5975, "" }, +// { 0x5976, "" }, + { 0x5977, "is_struct" }, +// { 0x5978, "" }, + { 0x5979, "show_and_solid" }, + { 0x597A, "random_sign" }, +// { 0x597B, "" }, +// { 0x597C, "" }, + { 0x597D, "array_remove_keys" }, + { 0x597E, "array_remove_values" }, + { 0x597F, "array_keep_keys" }, + { 0x5980, "array_keep_values" }, + { 0x5981, "array_keep_key_values" }, +// { 0x5982, "" }, +// { 0x5983, "" }, + { 0x5984, "spawn_struct_array" }, +// { 0x5985, "" }, +// { 0x5986, "" }, +// { 0x5987, "" }, +// { 0x5988, "" }, +// { 0x5989, "" }, +// { 0x598A, "" }, +// { 0x598B, "" }, +// { 0x598C, "" }, +// { 0x598D, "" }, + { 0x598E, "lt_op" }, +// { 0x598F, "" }, +// { 0x5990, "" }, + { 0x5991, "dsq_2d_ents_gt" }, +// { 0x5992, "" }, +// { 0x5993, "" }, +// { 0x5994, "" }, +// { 0x5995, "" }, + { 0x5996, "dsq_ents_gt" }, +// { 0x5997, "" }, + { 0x5998, "delete_createfxent_fx" }, +// { 0x5999, "" }, + { 0x599A, "pip_test" }, +// { 0x599B, "" }, +// { 0x599C, "" }, +// { 0x599D, "" }, +// { 0x599E, "" }, +// { 0x599F, "" }, +// { 0x59A0, "" }, +// { 0x59A1, "" }, +// { 0x59A2, "" }, +// { 0x59A3, "" }, +// { 0x59A4, "" }, +// { 0x59A5, "" }, +// { 0x59A6, "" }, + { 0x59A7, "get_rotation_matrix33_y" }, + { 0x59A8, "get_rotation_matrix33_z" }, +// { 0x59A9, "" }, + { 0x59AA, "vector_rotate_y" }, +// { 0x59AB, "" }, + { 0x59AC, "vector_rotate" }, +// { 0x59AD, "" }, + { 0x59AE, "old_badplaceawareness" }, + { 0x59AF, "unset_badplaceawareness" }, +// { 0x59B0, "" }, +// { 0x59B1, "" }, +// { 0x59B2, "" }, +// { 0x59B3, "" }, +// { 0x59B4, "" }, +// { 0x59B5, "" }, + { 0x59B6, "reset_player_sprint_speed_scale" }, +// { 0x59B7, "" }, +// { 0x59B8, "" }, +// { 0x59B9, "" }, +// { 0x59BA, "" }, +// { 0x59BB, "" }, +// { 0x59BC, "" }, +// { 0x59BD, "" }, +// { 0x59BE, "" }, +// { 0x59BF, "" }, + { 0x59C0, "random_int_vector" }, +// { 0x59C1, "" }, +// { 0x59C2, "" }, + { 0x59C3, "get_random_x_from_array" }, +// { 0x59C4, "" }, +// { 0x59C5, "" }, + { 0x59C6, "add_unique_to_array" }, + { 0x59C7, "at_least_x_alive_array" }, + { 0x59C8, "is_alive_array" }, +// { 0x59C9, "" }, +// { 0x59CA, "" }, +// { 0x59CB, "" }, + { 0x59CC, "get_random_defined_from_array" }, +// { 0x59CD, "" }, +// { 0x59CE, "" }, +// { 0x59CF, "" }, + { 0x59D0, "get_connected_ents" }, +// { 0x59D1, "" }, +// { 0x59D2, "" }, +// { 0x59D3, "" }, +// { 0x59D4, "" }, +// { 0x59D5, "" }, +// { 0x59D6, "" }, +// { 0x59D7, "" }, +// { 0x59D8, "" }, +// { 0x59D9, "" }, +// { 0x59DA, "" }, +// { 0x59DB, "" }, +// { 0x59DC, "" }, +// { 0x59DD, "" }, + { 0x59DE, "look_at_ent_over_time" }, +// { 0x59DF, "" }, +// { 0x59E0, "" }, +// { 0x59E1, "" }, +// { 0x59E2, "" }, +// { 0x59E3, "" }, + { 0x59E4, "set_flag_ent1_in_range_of_ent2" }, +// { 0x59E5, "" }, +// { 0x59E6, "" }, +// { 0x59E7, "" }, + { 0x59E8, "set_flag_ai_in_2d_range_of_ent" }, +// { 0x59E9, "" }, +// { 0x59EA, "" }, +// { 0x59EB, "" }, +// { 0x59EC, "" }, +// { 0x59ED, "" }, +// { 0x59EE, "" }, +// { 0x59EF, "" }, + { 0x59F0, "waittill_ai_in_range_of_ent" }, +// { 0x59F1, "" }, +// { 0x59F2, "" }, +// { 0x59F3, "" }, + { 0x59F4, "waittill_ent1_in_range_of_ent2" }, + { 0x59F5, "waittill_ent1_in_range_of_ent2_timeout" }, +// { 0x59F6, "" }, + { 0x59F7, "waittill_ent_in_range_of_point" }, + { 0x59F8, "waittill_ent_in_range_of_point_timeout" }, +// { 0x59F9, "" }, + { 0x59FA, "waittill_ents_notified_set_flag_timeout" }, +// { 0x59FB, "" }, +// { 0x59FC, "" }, +// { 0x59FD, "" }, +// { 0x59FE, "" }, + { 0x59FF, "waittill_x_ents_notified" }, +// { 0x5A00, "" }, +// { 0x5A01, "" }, + { 0x5A02, "waittill_all" }, +// { 0x5A03, "" }, +// { 0x5A04, "" }, +// { 0x5A05, "" }, +// { 0x5A06, "" }, +// { 0x5A07, "" }, +// { 0x5A08, "" }, +// { 0x5A09, "" }, +// { 0x5A0A, "" }, +// { 0x5A0B, "" }, +// { 0x5A0C, "" }, +// { 0x5A0D, "" }, +// { 0x5A0E, "" }, + { 0x5A0F, "get_ent_array_with_prefix_1_to_1" }, + { 0x5A10, "get_ent_array_with_prefix_range" }, +// { 0x5A11, "" }, +// { 0x5A12, "" }, +// { 0x5A13, "" }, +// { 0x5A14, "" }, +// { 0x5A15, "" }, +// { 0x5A16, "" }, + { 0x5A17, "array_spawn_function_prefix_suffix" }, + { 0x5A18, "setanimknoball_gh" }, + { 0x5A19, "setanimknoball_player" }, +// { 0x5A1A, "" }, +// { 0x5A1B, "" }, +// { 0x5A1C, "" }, +// { 0x5A1D, "" }, +// { 0x5A1E, "" }, + { 0x5A1F, "character/character_hero_delta_sandman" }, +// { 0x5A20, "" }, +// { 0x5A21, "" }, + { 0x5A22, "character/character_delta_elite_snow_assault_aa" }, +// { 0x5A23, "" }, +// { 0x5A24, "" }, +// { 0x5A25, "" }, + { 0x5A26, "vehicle_scripts/_bm21" }, +// { 0x5A27, "" }, +// { 0x5A28, "" }, +// { 0x5A29, "" }, +// { 0x5A2A, "" }, +// { 0x5A2B, "" }, +// { 0x5A2C, "" }, +// { 0x5A2D, "" }, +// { 0x5A2E, "" }, +// { 0x5A2F, "" }, +// { 0x5A30, "" }, +// { 0x5A31, "" }, +// { 0x5A32, "" }, + { 0x5A33, "mission_secondary_dialog_play" }, + { 0x5A34, "on_spawn_set_threat_group" }, +// { 0x5A35, "" }, +// { 0x5A36, "" }, +// { 0x5A37, "" }, + { 0x5A38, "debug_ai_spawned" }, + { 0x5A39, "start_assault" }, +// { 0x5A3A, "" }, + { 0x5A3B, "assault_enc_spawn_fight" }, +// { 0x5A3C, "" }, +// { 0x5A3D, "" }, +// { 0x5A3E, "" }, + { 0x5A3F, "assault_enc_pre_breach" }, +// { 0x5A40, "" }, +// { 0x5A41, "" }, + { 0x5A42, "pre_breach_ai_count" }, +// { 0x5A43, "" }, +// { 0x5A44, "" }, +// { 0x5A45, "" }, + { 0x5A46, "min_btr_cooldown" }, +// { 0x5A47, "" }, +// { 0x5A48, "" }, +// { 0x5A49, "" }, +// { 0x5A4A, "" }, +// { 0x5A4B, "" }, +// { 0x5A4C, "" }, +// { 0x5A4D, "" }, +// { 0x5A4E, "" }, +// { 0x5A4F, "" }, +// { 0x5A50, "" }, + { 0x5A51, "fire_at_player" }, +// { 0x5A52, "" }, +// { 0x5A53, "" }, + { 0x5A54, "xmodelalias/alias_henchmen_heads" }, +// { 0x5A55, "" }, +// { 0x5A56, "" }, +// { 0x5A57, "" }, +// { 0x5A58, "" }, +// { 0x5A59, "" }, +// { 0x5A5A, "" }, + { 0x5A5B, "init_level_vars" }, +// { 0x5A5C, "" }, +// { 0x5A5D, "" }, + { 0x5A5E, "remove_entities_by_script_difficulty" }, + { 0x5A5F, "precache_all" }, +// { 0x5A60, "" }, +// { 0x5A61, "" }, +// { 0x5A62, "" }, +// { 0x5A63, "" }, +// { 0x5A64, "" }, +// { 0x5A65, "" }, +// { 0x5A66, "" }, +// { 0x5A67, "" }, +// { 0x5A68, "" }, +// { 0x5A69, "" }, +// { 0x5A6A, "" }, +// { 0x5A6B, "" }, +// { 0x5A6C, "" }, +// { 0x5A6D, "" }, +// { 0x5A6E, "" }, +// { 0x5A6F, "" }, +// { 0x5A70, "" }, +// { 0x5A71, "" }, +// { 0x5A72, "" }, +// { 0x5A73, "" }, +// { 0x5A74, "" }, + { 0x5A75, "total_seen_time" }, +// { 0x5A76, "" }, +// { 0x5A77, "" }, +// { 0x5A78, "" }, +// { 0x5A79, "" }, +// { 0x5A7A, "" }, +// { 0x5A7B, "" }, +// { 0x5A7C, "" }, +// { 0x5A7D, "" }, + { 0x5A7E, "score_time_limit" }, +// { 0x5A7F, "" }, +// { 0x5A80, "" }, +// { 0x5A81, "" }, +// { 0x5A82, "" }, +// { 0x5A83, "" }, +// { 0x5A84, "" }, + { 0x5A85, "is_ai_calm" }, +// { 0x5A86, "" }, +// { 0x5A87, "" }, +// { 0x5A88, "" }, +// { 0x5A89, "" }, +// { 0x5A8A, "" }, +// { 0x5A8B, "" }, +// { 0x5A8C, "" }, +// { 0x5A8D, "" }, +// { 0x5A8E, "" }, +// { 0x5A8F, "" }, +// { 0x5A90, "" }, + { 0x5A91, "so_rescue_hijack_init" }, +// { 0x5A92, "" }, + { 0x5A93, "init_quotes" }, +// { 0x5A94, "" }, +// { 0x5A95, "" }, +// { 0x5A96, "" }, +// { 0x5A97, "" }, +// { 0x5A98, "" }, +// { 0x5A99, "" }, +// { 0x5A9A, "" }, +// { 0x5A9B, "" }, +// { 0x5A9C, "" }, + { 0x5A9D, "get_last_known_player_position" }, +// { 0x5A9E, "" }, +// { 0x5A9F, "" }, +// { 0x5AA0, "" }, +// { 0x5AA1, "" }, +// { 0x5AA2, "" }, + { 0x5AA3, "start_so_rescue_hijack" }, +// { 0x5AA4, "" }, +// { 0x5AA5, "" }, +// { 0x5AA6, "" }, +// { 0x5AA7, "" }, +// { 0x5AA8, "" }, +// { 0x5AA9, "" }, +// { 0x5AAA, "" }, + { 0x5AAB, "update_reinforcement_spawners" }, +// { 0x5AAC, "" }, +// { 0x5AAD, "" }, + { 0x5AAE, "update_alena_marker_pos" }, + { 0x5AAF, "hostage" }, +// { 0x5AB0, "" }, +// { 0x5AB1, "" }, + { 0x5AB2, "enable_player_weapons" }, +// { 0x5AB3, "" }, +// { 0x5AB4, "" }, +// { 0x5AB5, "" }, +// { 0x5AB6, "" }, +// { 0x5AB7, "" }, + { 0x5AB8, "heli_exit" }, + { 0x5AB9, "attack_heli_so" }, + { 0x5ABA, "helicopter_time_to_lose_player" }, + { 0x5ABB, "attack_heli_so_think" }, +// { 0x5ABC, "" }, +// { 0x5ABD, "" }, +// { 0x5ABE, "" }, +// { 0x5ABF, "" }, + { 0x5AC0, "last_known_pos" }, + { 0x5AC1, "attack_heli_exit" }, +// { 0x5AC2, "" }, +// { 0x5AC3, "" }, + { 0x5AC4, "heli_destroy_objective" }, + { 0x5AC5, "heli_watch_for_damage" }, +// { 0x5AC6, "" }, + { 0x5AC7, "heli_watch_for_crash" }, +// { 0x5AC8, "" }, +// { 0x5AC9, "" }, +// { 0x5ACA, "" }, +// { 0x5ACB, "" }, +// { 0x5ACC, "" }, +// { 0x5ACD, "" }, +// { 0x5ACE, "" }, + { 0x5ACF, "targetplayer" }, +// { 0x5AD0, "" }, + { 0x5AD1, "target_offset_angle" }, +// { 0x5AD2, "" }, +// { 0x5AD3, "" }, + { 0x5AD4, "heli_target_player" }, +// { 0x5AD5, "" }, +// { 0x5AD6, "" }, +// { 0x5AD7, "" }, +// { 0x5AD8, "" }, +// { 0x5AD9, "" }, +// { 0x5ADA, "" }, +// { 0x5ADB, "" }, +// { 0x5ADC, "" }, +// { 0x5ADD, "" }, +// { 0x5ADE, "" }, +// { 0x5ADF, "" }, +// { 0x5AE0, "" }, +// { 0x5AE1, "" }, +// { 0x5AE2, "" }, +// { 0x5AE3, "" }, +// { 0x5AE4, "" }, + { 0x5AE5, "spot_light_delay_on" }, + { 0x5AE6, "heli_broken_light_fx" }, + { 0x5AE7, "spot_light_death_so" }, +// { 0x5AE8, "" }, +// { 0x5AE9, "" }, +// { 0x5AEA, "" }, +// { 0x5AEB, "" }, +// { 0x5AEC, "" }, +// { 0x5AED, "" }, +// { 0x5AEE, "" }, +// { 0x5AEF, "" }, +// { 0x5AF0, "" }, +// { 0x5AF1, "" }, +// { 0x5AF2, "" }, + { 0x5AF3, "stealth_so_rescue_hijack_prespotted" }, +// { 0x5AF4, "" }, +// { 0x5AF5, "" }, +// { 0x5AF6, "" }, +// { 0x5AF7, "" }, +// { 0x5AF8, "" }, +// { 0x5AF9, "" }, +// { 0x5AFA, "" }, +// { 0x5AFB, "" }, +// { 0x5AFC, "" }, +// { 0x5AFD, "" }, + { 0x5AFE, "hand_flashlight_watch_for_drop" }, +// { 0x5AFF, "" }, +// { 0x5B00, "" }, + { 0x5B01, "hand_flashlight_remove" }, +// { 0x5B02, "" }, +// { 0x5B03, "" }, +// { 0x5B04, "" }, +// { 0x5B05, "" }, +// { 0x5B06, "" }, +// { 0x5B07, "" }, +// { 0x5B08, "" }, +// { 0x5B09, "" }, +// { 0x5B0A, "" }, + { 0x5B0B, "disable_shooting" }, +// { 0x5B0C, "" }, +// { 0x5B0D, "" }, + { 0x5B0E, "terrorist" }, +// { 0x5B0F, "" }, +// { 0x5B10, "" }, + { 0x5B11, "dog_ignore_all" }, +// { 0x5B12, "" }, + { 0x5B13, "human_shield_end" }, +// { 0x5B14, "" }, +// { 0x5B15, "" }, +// { 0x5B16, "" }, +// { 0x5B17, "" }, +// { 0x5B18, "" }, +// { 0x5B19, "" }, +// { 0x5B1A, "" }, +// { 0x5B1B, "" }, + { 0x5B1C, "human_shield_fail_timer" }, +// { 0x5B1D, "" }, + { 0x5B1E, "waittill_flag_or_timeout" }, +// { 0x5B1F, "" }, +// { 0x5B20, "" }, +// { 0x5B21, "" }, +// { 0x5B22, "" }, + { 0x5B23, "setallplayersnormal" }, +// { 0x5B24, "" }, +// { 0x5B25, "" }, +// { 0x5B26, "" }, + { 0x5B27, "hostage_human_shield_play_death_anim" }, +// { 0x5B28, "" }, +// { 0x5B29, "" }, +// { 0x5B2A, "" }, + { 0x5B2B, "human_shield_hostage_pain_monitor" }, +// { 0x5B2C, "" }, +// { 0x5B2D, "" }, +// { 0x5B2E, "" }, +// { 0x5B2F, "" }, + { 0x5B30, "spawn_first_hostage" }, +// { 0x5B31, "" }, + { 0x5B32, "spawn_second_hostage" }, +// { 0x5B33, "" }, +// { 0x5B34, "" }, +// { 0x5B35, "" }, +// { 0x5B36, "" }, +// { 0x5B37, "" }, +// { 0x5B38, "" }, +// { 0x5B39, "" }, +// { 0x5B3A, "" }, +// { 0x5B3B, "" }, + { 0x5B3C, "executor_anim_node" }, +// { 0x5B3D, "" }, +// { 0x5B3E, "" }, + { 0x5B3F, "executor_init" }, +// { 0x5B40, "" }, +// { 0x5B41, "" }, +// { 0x5B42, "" }, +// { 0x5B43, "" }, +// { 0x5B44, "" }, +// { 0x5B45, "" }, +// { 0x5B46, "" }, +// { 0x5B47, "" }, +// { 0x5B48, "" }, + { 0x5B49, "is_in_any_players_fov" }, +// { 0x5B4A, "" }, +// { 0x5B4B, "" }, +// { 0x5B4C, "" }, +// { 0x5B4D, "" }, + { 0x5B4E, "hostage_drop_to_knees" }, +// { 0x5B4F, "" }, +// { 0x5B50, "" }, + { 0x5B51, "disable_stealth_events" }, +// { 0x5B52, "" }, +// { 0x5B53, "" }, +// { 0x5B54, "" }, +// { 0x5B55, "" }, +// { 0x5B56, "" }, +// { 0x5B57, "" }, + { 0x5B58, "character/character_russian_military_rpg_a_a" }, +// { 0x5B59, "" }, +// { 0x5B5A, "" }, +// { 0x5B5B, "" }, + { 0x5B5C, "character/character_delta_urban_assault_b" }, +// { 0x5B5D, "" }, +// { 0x5B5E, "" }, +// { 0x5B5F, "" }, +// { 0x5B60, "" }, +// { 0x5B61, "" }, +// { 0x5B62, "" }, +// { 0x5B63, "" }, +// { 0x5B64, "" }, +// { 0x5B65, "" }, +// { 0x5B66, "" }, +// { 0x5B67, "" }, + { 0x5B68, "opened_width" }, + { 0x5B69, "closed_height" }, +// { 0x5B6A, "" }, +// { 0x5B6B, "" }, +// { 0x5B6C, "" }, +// { 0x5B6D, "" }, +// { 0x5B6E, "" }, +// { 0x5B6F, "" }, +// { 0x5B70, "" }, +// { 0x5B71, "" }, + { 0x5B72, "pip_display_timer" }, + { 0x5B73, "pip_timer" }, +// { 0x5B74, "" }, +// { 0x5B75, "" }, +// { 0x5B76, "" }, +// { 0x5B77, "" }, +// { 0x5B78, "" }, +// { 0x5B79, "" }, + { 0x5B7A, "pip_border" }, +// { 0x5B7B, "" }, +// { 0x5B7C, "" }, +// { 0x5B7D, "" }, +// { 0x5B7E, "" }, +// { 0x5B7F, "" }, +// { 0x5B80, "" }, +// { 0x5B81, "" }, + { 0x5B82, "ac130_pip_close" }, + { 0x5B83, "linked_ent" }, +// { 0x5B84, "" }, +// { 0x5B85, "" }, +// { 0x5B86, "" }, +// { 0x5B87, "" }, + { 0x5B88, "insidejavelinreticlelocked" }, +// { 0x5B89, "" }, +// { 0x5B8A, "" }, +// { 0x5B8B, "" }, +// { 0x5B8C, "" }, +// { 0x5B8D, "" }, +// { 0x5B8E, "" }, +// { 0x5B8F, "" }, +// { 0x5B90, "" }, +// { 0x5B91, "" }, + { 0x5B92, "dshk_player_anims" }, +// { 0x5B93, "" }, +// { 0x5B94, "" }, +// { 0x5B95, "" }, + { 0x5B96, "custom_mount_hint_return_when_mounted" }, +// { 0x5B97, "" }, +// { 0x5B98, "" }, +// { 0x5B99, "" }, +// { 0x5B9A, "" }, +// { 0x5B9B, "" }, +// { 0x5B9C, "" }, + { 0x5B9D, "cleanup_on_death" }, + { 0x5B9E, "dshk_shells" }, + { 0x5B9F, "intro_fx" }, +// { 0x5BA0, "" }, +// { 0x5BA1, "" }, + { 0x5BA2, "new_intro_ambient_jets" }, +// { 0x5BA3, "" }, +// { 0x5BA4, "" }, + { 0x5BA5, "makarov_number_2" }, +// { 0x5BA6, "" }, +// { 0x5BA7, "" }, + { 0x5BA8, "delete_me_on_flag" }, +// { 0x5BA9, "" }, + { 0x5BAA, "intro_osprey_fx" }, +// { 0x5BAB, "" }, +// { 0x5BAC, "" }, +// { 0x5BAD, "" }, +// { 0x5BAE, "" }, +// { 0x5BAF, "" }, +// { 0x5BB0, "" }, +// { 0x5BB1, "" }, +// { 0x5BB2, "" }, +// { 0x5BB3, "" }, +// { 0x5BB4, "" }, +// { 0x5BB5, "" }, +// { 0x5BB6, "" }, +// { 0x5BB7, "" }, +// { 0x5BB8, "" }, +// { 0x5BB9, "" }, +// { 0x5BBA, "" }, +// { 0x5BBB, "" }, +// { 0x5BBC, "" }, +// { 0x5BBD, "" }, +// { 0x5BBE, "" }, +// { 0x5BBF, "" }, +// { 0x5BC0, "" }, + { 0x5BC1, "rpg_at_osprey" }, +// { 0x5BC2, "" }, +// { 0x5BC3, "" }, +// { 0x5BC4, "" }, +// { 0x5BC5, "" }, + { 0x5BC6, "notetrack_osprey_engine_smoke" }, +// { 0x5BC7, "" }, + { 0x5BC8, "intro_enemies" }, + { 0x5BC9, "intro_enemy_logic" }, +// { 0x5BCA, "" }, + { 0x5BCB, "chase_main_vehicle" }, + { 0x5BCC, "chase_second_vehicle" }, +// { 0x5BCD, "" }, + { 0x5BCE, "thermal_on_ents" }, + { 0x5BCF, "thermal_on_til_destroyed" }, +// { 0x5BD0, "" }, +// { 0x5BD1, "" }, +// { 0x5BD2, "" }, +// { 0x5BD3, "" }, +// { 0x5BD4, "" }, +// { 0x5BD5, "" }, +// { 0x5BD6, "" }, +// { 0x5BD7, "" }, +// { 0x5BD8, "" }, + { 0x5BD9, "c130_tank_dialogue" }, + { 0x5BDA, "sandman_moveup_line" }, + { 0x5BDB, "moveup_lines" }, + { 0x5BDC, "used_moveup_lines" }, +// { 0x5BDD, "" }, +// { 0x5BDE, "" }, +// { 0x5BDF, "" }, +// { 0x5BE0, "" }, +// { 0x5BE1, "" }, +// { 0x5BE2, "" }, +// { 0x5BE3, "" }, +// { 0x5BE4, "" }, +// { 0x5BE5, "" }, +// { 0x5BE6, "" }, +// { 0x5BE7, "" }, +// { 0x5BE8, "" }, +// { 0x5BE9, "" }, +// { 0x5BEA, "" }, +// { 0x5BEB, "" }, +// { 0x5BEC, "" }, +// { 0x5BED, "" }, +// { 0x5BEE, "" }, +// { 0x5BEF, "" }, +// { 0x5BF0, "" }, +// { 0x5BF1, "" }, +// { 0x5BF2, "" }, +// { 0x5BF3, "" }, +// { 0x5BF4, "" }, + { 0x5BF5, "maps/_javelin" }, +// { 0x5BF6, "" }, +// { 0x5BF7, "" }, + { 0x5BF8, "current_retreat_pos" }, +// { 0x5BF9, "" }, + { 0x5BFA, "area3_guys_logic" }, +// { 0x5BFB, "" }, +// { 0x5BFC, "" }, +// { 0x5BFD, "" }, +// { 0x5BFE, "" }, +// { 0x5BFF, "" }, +// { 0x5C00, "" }, +// { 0x5C01, "" }, +// { 0x5C02, "" }, + { 0x5C03, "current_player_loadout" }, +// { 0x5C04, "" }, +// { 0x5C05, "" }, +// { 0x5C06, "" }, +// { 0x5C07, "" }, +// { 0x5C08, "" }, + { 0x5C09, "final_bridge_vehicles" }, + { 0x5C0A, "final_bridge_vehicle_logic" }, +// { 0x5C0B, "" }, +// { 0x5C0C, "" }, +// { 0x5C0D, "" }, + { 0x5C0E, "c130_attack_logic" }, +// { 0x5C0F, "" }, +// { 0x5C10, "" }, + { 0x5C11, "defend_btr" }, +// { 0x5C12, "" }, + { 0x5C13, "chopper_crash_cowbell" }, +// { 0x5C14, "" }, +// { 0x5C15, "" }, +// { 0x5C16, "" }, +// { 0x5C17, "" }, +// { 0x5C18, "" }, +// { 0x5C19, "" }, +// { 0x5C1A, "" }, +// { 0x5C1B, "" }, +// { 0x5C1C, "" }, +// { 0x5C1D, "" }, +// { 0x5C1E, "" }, +// { 0x5C1F, "" }, + { 0x5C20, "vehicle_god_until_flag" }, +// { 0x5C21, "" }, +// { 0x5C22, "" }, + { 0x5C23, "hint_not_using_25" }, +// { 0x5C24, "" }, +// { 0x5C25, "" }, + { 0x5C26, "yellow_building_shoot_detection" }, + { 0x5C27, "yellow_building_destruction" }, +// { 0x5C28, "" }, + { 0x5C29, "hvt_slam_zoom" }, +// { 0x5C2A, "" }, +// { 0x5C2B, "" }, +// { 0x5C2C, "" }, +// { 0x5C2D, "" }, +// { 0x5C2E, "" }, +// { 0x5C2F, "" }, +// { 0x5C30, "" }, +// { 0x5C31, "" }, +// { 0x5C32, "" }, + { 0x5C33, "bridge_tank_shoot_until_slamzoom" }, +// { 0x5C34, "" }, + { 0x5C35, "player_close_to_tanks" }, +// { 0x5C36, "" }, +// { 0x5C37, "" }, + { 0x5C38, "make_me_javelin_target" }, +// { 0x5C39, "" }, +// { 0x5C3A, "" }, +// { 0x5C3B, "" }, + { 0x5C3C, "c130_inform_player_attacking" }, +// { 0x5C3D, "" }, +// { 0x5C3E, "" }, + { 0x5C3F, "fade_in_on_flag" }, + { 0x5C40, "attack_choppers" }, +// { 0x5C41, "" }, +// { 0x5C42, "" }, + { 0x5C43, "crash_chopper_assets" }, +// { 0x5C44, "" }, +// { 0x5C45, "" }, +// { 0x5C46, "" }, +// { 0x5C47, "" }, + { 0x5C48, "epic_jets_timing" }, + { 0x5C49, "jet1" }, +// { 0x5C4A, "" }, +// { 0x5C4B, "" }, +// { 0x5C4C, "" }, +// { 0x5C4D, "" }, +// { 0x5C4E, "" }, +// { 0x5C4F, "" }, +// { 0x5C50, "" }, +// { 0x5C51, "" }, +// { 0x5C52, "" }, +// { 0x5C53, "" }, +// { 0x5C54, "" }, +// { 0x5C55, "" }, +// { 0x5C56, "" }, +// { 0x5C57, "" }, +// { 0x5C58, "" }, +// { 0x5C59, "" }, +// { 0x5C5A, "" }, +// { 0x5C5B, "" }, +// { 0x5C5C, "" }, +// { 0x5C5D, "" }, +// { 0x5C5E, "" }, +// { 0x5C5F, "" }, +// { 0x5C60, "" }, +// { 0x5C61, "" }, + { 0x5C62, "play_tower_stress_fx" }, +// { 0x5C63, "" }, +// { 0x5C64, "" }, +// { 0x5C65, "" }, +// { 0x5C66, "" }, +// { 0x5C67, "" }, +// { 0x5C68, "" }, +// { 0x5C69, "" }, +// { 0x5C6A, "" }, +// { 0x5C6B, "" }, + { 0x5C6C, "aa_fire" }, +// { 0x5C6D, "" }, +// { 0x5C6E, "" }, +// { 0x5C6F, "" }, +// { 0x5C70, "" }, +// { 0x5C71, "" }, +// { 0x5C72, "" }, +// { 0x5C73, "" }, +// { 0x5C74, "" }, +// { 0x5C75, "" }, +// { 0x5C76, "" }, +// { 0x5C77, "" }, +// { 0x5C78, "" }, +// { 0x5C79, "" }, +// { 0x5C7A, "" }, +// { 0x5C7B, "" }, +// { 0x5C7C, "" }, +// { 0x5C7D, "" }, +// { 0x5C7E, "" }, +// { 0x5C7F, "" }, +// { 0x5C80, "" }, +// { 0x5C81, "" }, +// { 0x5C82, "" }, +// { 0x5C83, "" }, +// { 0x5C84, "" }, +// { 0x5C85, "" }, +// { 0x5C86, "" }, + { 0x5C87, "hvt_did_player_go_to_bedroom" }, +// { 0x5C88, "" }, +// { 0x5C89, "" }, +// { 0x5C8A, "" }, + { 0x5C8B, "rpg_roof_guy_logic" }, +// { 0x5C8C, "" }, + { 0x5C8D, "tank_guys_logic" }, + { 0x5C8E, "main_courtyard_guys_retreat_logic" }, +// { 0x5C8F, "" }, +// { 0x5C90, "" }, +// { 0x5C91, "" }, + { 0x5C92, "turret_tracer_increase" }, +// { 0x5C93, "" }, +// { 0x5C94, "" }, +// { 0x5C95, "" }, +// { 0x5C96, "" }, +// { 0x5C97, "" }, + { 0x5C98, "hvt_turret_barrel" }, + { 0x5C99, "launch_me" }, + { 0x5C9A, "hvy_street_threat_bias" }, + { 0x5C9B, "hvt_player_turret_threat_bias" }, +// { 0x5C9C, "" }, +// { 0x5C9D, "" }, + { 0x5C9E, "hvt_dialogue" }, +// { 0x5C9F, "" }, +// { 0x5CA0, "" }, +// { 0x5CA1, "" }, +// { 0x5CA2, "" }, +// { 0x5CA3, "" }, +// { 0x5CA4, "" }, +// { 0x5CA5, "" }, +// { 0x5CA6, "" }, +// { 0x5CA7, "" }, +// { 0x5CA8, "" }, +// { 0x5CA9, "" }, +// { 0x5CAA, "" }, +// { 0x5CAB, "" }, +// { 0x5CAC, "" }, +// { 0x5CAD, "" }, +// { 0x5CAE, "" }, + { 0x5CAF, "encounter_special_enemies" }, +// { 0x5CB0, "" }, +// { 0x5CB1, "" }, +// { 0x5CB2, "" }, +// { 0x5CB3, "" }, +// { 0x5CB4, "" }, +// { 0x5CB5, "" }, + { 0x5CB6, "mission_fail_points" }, +// { 0x5CB7, "" }, +// { 0x5CB8, "" }, +// { 0x5CB9, "" }, +// { 0x5CBA, "" }, +// { 0x5CBB, "" }, +// { 0x5CBC, "" }, + { 0x5CBD, "sandman_fps_pip" }, + { 0x5CBE, "sandman_shoulder_pip" }, +// { 0x5CBF, "" }, +// { 0x5CC0, "" }, + { 0x5CC1, "hitman_fps_pip" }, + { 0x5CC2, "hitman_shoulder_pip" }, +// { 0x5CC3, "" }, +// { 0x5CC4, "" }, +// { 0x5CC5, "" }, + { 0x5CC6, "bishop_shoulder_pip" }, +// { 0x5CC7, "" }, +// { 0x5CC8, "" }, + { 0x5CC9, "player_hit_building" }, +// { 0x5CCA, "" }, + { 0x5CCB, "city_area_current_battle_line" }, +// { 0x5CCC, "" }, +// { 0x5CCD, "" }, +// { 0x5CCE, "" }, +// { 0x5CCF, "" }, +// { 0x5CD0, "" }, + { 0x5CD1, "end_timed_mission_failed" }, + { 0x5CD2, "reset_deltas_health" }, +// { 0x5CD3, "" }, +// { 0x5CD4, "" }, +// { 0x5CD5, "" }, +// { 0x5CD6, "" }, +// { 0x5CD7, "" }, +// { 0x5CD8, "" }, +// { 0x5CD9, "" }, +// { 0x5CDA, "" }, + { 0x5CDB, "monitor_encounter_enemies_percent" }, +// { 0x5CDC, "" }, +// { 0x5CDD, "" }, +// { 0x5CDE, "" }, + { 0x5CDF, "kill_encounter_enemies" }, +// { 0x5CE0, "" }, +// { 0x5CE1, "" }, +// { 0x5CE2, "" }, +// { 0x5CE3, "" }, +// { 0x5CE4, "" }, +// { 0x5CE5, "" }, + { 0x5CE6, "monitor_encounter_primary_enemy_on_death" }, +// { 0x5CE7, "" }, +// { 0x5CE8, "" }, + { 0x5CE9, "monitor_encounter_special_enemies_all" }, +// { 0x5CEA, "" }, +// { 0x5CEB, "" }, +// { 0x5CEC, "" }, +// { 0x5CED, "" }, + { 0x5CEE, "monitor_encounter_special_ai_on_death" }, +// { 0x5CEF, "" }, + { 0x5CF0, "burst_infinite_spawn_ai" }, + { 0x5CF1, "burst_spawn_ai_callback" }, + { 0x5CF2, "street_enemy_spawner" }, +// { 0x5CF3, "" }, +// { 0x5CF4, "" }, +// { 0x5CF5, "" }, + { 0x5CF6, "target_point" }, +// { 0x5CF7, "" }, +// { 0x5CF8, "" }, +// { 0x5CF9, "" }, +// { 0x5CFA, "" }, + { 0x5CFB, "building_trigger_reminder" }, + { 0x5CFC, "building_trigger_mission_failed" }, +// { 0x5CFD, "" }, +// { 0x5CFE, "" }, + { 0x5CFF, "monitor_ai_mission_fail_points" }, +// { 0x5D00, "" }, +// { 0x5D01, "" }, +// { 0x5D02, "" }, +// { 0x5D03, "" }, +// { 0x5D04, "" }, +// { 0x5D05, "" }, +// { 0x5D06, "" }, +// { 0x5D07, "" }, +// { 0x5D08, "" }, +// { 0x5D09, "" }, +// { 0x5D0A, "" }, +// { 0x5D0B, "" }, + { 0x5D0C, "ac130_angel_flare_jets_shooting" }, +// { 0x5D0D, "" }, +// { 0x5D0E, "" }, +// { 0x5D0F, "" }, +// { 0x5D10, "" }, +// { 0x5D11, "" }, +// { 0x5D12, "" }, +// { 0x5D13, "" }, +// { 0x5D14, "" }, + { 0x5D15, "friendly_m1a1_init" }, +// { 0x5D16, "" }, +// { 0x5D17, "" }, + { 0x5D18, "friendly_m1a1_canon_randomly_shoot_on_notify" }, +// { 0x5D19, "" }, + { 0x5D1A, "friendly_m1a1_end_randomly_shoot_canon" }, +// { 0x5D1B, "" }, +// { 0x5D1C, "" }, +// { 0x5D1D, "" }, +// { 0x5D1E, "" }, +// { 0x5D1F, "" }, +// { 0x5D20, "" }, +// { 0x5D21, "" }, +// { 0x5D22, "" }, + { 0x5D23, "friendly_hummer_mission_failed" }, +// { 0x5D24, "" }, + { 0x5D25, "friendly_hummer_fire_mg" }, +// { 0x5D26, "" }, +// { 0x5D27, "" }, +// { 0x5D28, "" }, + { 0x5D29, "friendly_hummer_jolt" }, + { 0x5D2A, "friendly_f15_init" }, +// { 0x5D2B, "" }, + { 0x5D2C, "f15_current_node" }, +// { 0x5D2D, "" }, +// { 0x5D2E, "" }, + { 0x5D2F, "friendly_f15_init_fake" }, +// { 0x5D30, "" }, +// { 0x5D31, "" }, + { 0x5D32, "friendly_f15_shoot_mg_until_target_dead" }, +// { 0x5D33, "" }, +// { 0x5D34, "" }, +// { 0x5D35, "" }, +// { 0x5D36, "" }, + { 0x5D37, "friendly_f15_sonic_boom" }, +// { 0x5D38, "" }, +// { 0x5D39, "" }, + { 0x5D3A, "friendly_f15_delete_on_path_end" }, +// { 0x5D3B, "" }, +// { 0x5D3C, "" }, +// { 0x5D3D, "" }, +// { 0x5D3E, "" }, +// { 0x5D3F, "" }, +// { 0x5D40, "" }, +// { 0x5D41, "" }, +// { 0x5D42, "" }, +// { 0x5D43, "" }, +// { 0x5D44, "" }, +// { 0x5D45, "" }, +// { 0x5D46, "" }, +// { 0x5D47, "" }, +// { 0x5D48, "" }, + { 0x5D49, "enemy_truck_a_on_damage" }, + { 0x5D4A, "enemy_maz_a_drive" }, +// { 0x5D4B, "" }, +// { 0x5D4C, "" }, +// { 0x5D4D, "" }, + { 0x5D4E, "enemy_btr_on_damage" }, + { 0x5D4F, "enemy_btr_monitor_ac130_fire" }, +// { 0x5D50, "" }, + { 0x5D51, "enemy_btr_load_passengers_alt" }, +// { 0x5D52, "" }, +// { 0x5D53, "" }, + { 0x5D54, "enemy_btr_set_passenger_callbacks_on_unload" }, +// { 0x5D55, "" }, +// { 0x5D56, "" }, +// { 0x5D57, "" }, +// { 0x5D58, "" }, +// { 0x5D59, "" }, +// { 0x5D5A, "" }, +// { 0x5D5B, "" }, + { 0x5D5C, "enemy_t72_shell_on_death" }, + { 0x5D5D, "enemy_t72_randomly_look_ahead" }, +// { 0x5D5E, "" }, +// { 0x5D5F, "" }, +// { 0x5D60, "" }, +// { 0x5D61, "" }, +// { 0x5D62, "" }, +// { 0x5D63, "" }, +// { 0x5D64, "" }, +// { 0x5D65, "" }, + { 0x5D66, "mi17_attached_helis" }, +// { 0x5D67, "" }, + { 0x5D68, "enemy_mi17_on_damage" }, +// { 0x5D69, "" }, +// { 0x5D6A, "" }, +// { 0x5D6B, "" }, +// { 0x5D6C, "" }, +// { 0x5D6D, "" }, +// { 0x5D6E, "" }, +// { 0x5D6F, "" }, +// { 0x5D70, "" }, +// { 0x5D71, "" }, +// { 0x5D72, "" }, +// { 0x5D73, "" }, +// { 0x5D74, "" }, + { 0x5D75, "script_node_occupied" }, + { 0x5D76, "enemy_mi17_gopath_and_die" }, + { 0x5D77, "enemy_mi17_delete_on_path_end" }, +// { 0x5D78, "" }, +// { 0x5D79, "" }, +// { 0x5D7A, "" }, +// { 0x5D7B, "" }, +// { 0x5D7C, "" }, +// { 0x5D7D, "" }, +// { 0x5D7E, "" }, +// { 0x5D7F, "" }, +// { 0x5D80, "" }, +// { 0x5D81, "" }, +// { 0x5D82, "" }, +// { 0x5D83, "" }, +// { 0x5D84, "" }, +// { 0x5D85, "" }, +// { 0x5D86, "" }, +// { 0x5D87, "" }, +// { 0x5D88, "" }, +// { 0x5D89, "" }, + { 0x5D8A, "enemy_bm21_init" }, + { 0x5D8B, "enemy_bm21_on_damage" }, +// { 0x5D8C, "" }, +// { 0x5D8D, "" }, +// { 0x5D8E, "" }, +// { 0x5D8F, "" }, + { 0x5D90, "enemy_bm21_unload" }, +// { 0x5D91, "" }, +// { 0x5D92, "" }, +// { 0x5D93, "" }, + { 0x5D94, "enemy_bm21_last_crash_path" }, +// { 0x5D95, "" }, +// { 0x5D96, "" }, + { 0x5D97, "hind_path" }, +// { 0x5D98, "" }, +// { 0x5D99, "" }, + { 0x5D9A, "enemy_hind_monitor_ac130_instant_death" }, +// { 0x5D9B, "" }, +// { 0x5D9C, "" }, +// { 0x5D9D, "" }, +// { 0x5D9E, "" }, +// { 0x5D9F, "" }, +// { 0x5DA0, "" }, +// { 0x5DA1, "" }, +// { 0x5DA2, "" }, +// { 0x5DA3, "" }, +// { 0x5DA4, "" }, + { 0x5DA5, "enemy_mig29_init_cheap" }, +// { 0x5DA6, "" }, +// { 0x5DA7, "" }, + { 0x5DA8, "enemy_mig29_fake_play_afterburner" }, + { 0x5DA9, "enemy_mig29_fake_sonic_boom" }, + { 0x5DAA, "enemy_mig29_fake_damage_and_explode" }, +// { 0x5DAB, "" }, +// { 0x5DAC, "" }, +// { 0x5DAD, "" }, +// { 0x5DAE, "" }, +// { 0x5DAF, "" }, +// { 0x5DB0, "" }, +// { 0x5DB1, "" }, + { 0x5DB2, "mig29_parent" }, +// { 0x5DB3, "" }, +// { 0x5DB4, "" }, +// { 0x5DB5, "" }, + { 0x5DB6, "script_default_goalradius" }, +// { 0x5DB7, "" }, +// { 0x5DB8, "" }, +// { 0x5DB9, "" }, +// { 0x5DBA, "" }, +// { 0x5DBB, "" }, +// { 0x5DBC, "" }, +// { 0x5DBD, "" }, + { 0x5DBE, "set_parent_ai" }, +// { 0x5DBF, "" }, +// { 0x5DC0, "" }, + { 0x5DC1, "parent_ai_node" }, +// { 0x5DC2, "" }, +// { 0x5DC3, "" }, +// { 0x5DC4, "" }, +// { 0x5DC5, "" }, +// { 0x5DC6, "" }, +// { 0x5DC7, "" }, + { 0x5DC8, "link_child_ai" }, +// { 0x5DC9, "" }, +// { 0x5DCA, "" }, + { 0x5DCB, "ai_enemy_rpg_init" }, +// { 0x5DCC, "" }, +// { 0x5DCD, "" }, + { 0x5DCE, "ai_enemy_rpg_hide_and_shoot" }, + { 0x5DCF, "ai_enemy_rpg_stand_loop" }, +// { 0x5DD0, "" }, +// { 0x5DD1, "" }, +// { 0x5DD2, "" }, + { 0x5DD3, "ai_enemy_rpg_drone_on_damage" }, +// { 0x5DD4, "" }, +// { 0x5DD5, "" }, +// { 0x5DD6, "" }, +// { 0x5DD7, "" }, +// { 0x5DD8, "" }, +// { 0x5DD9, "" }, +// { 0x5DDA, "" }, +// { 0x5DDB, "" }, +// { 0x5DDC, "" }, + { 0x5DDD, "ai_enemy_roundabout_on_damage" }, +// { 0x5DDE, "" }, +// { 0x5DDF, "" }, +// { 0x5DE0, "" }, + { 0x5DE1, "ai_enemy_street_patrol_monitor_battle_line" }, +// { 0x5DE2, "" }, +// { 0x5DE3, "" }, +// { 0x5DE4, "" }, + { 0x5DE5, "ai_enemy_street_flanking_init" }, + { 0x5DE6, "ai_enemy_street_flanking_on_damage" }, +// { 0x5DE7, "" }, +// { 0x5DE8, "" }, +// { 0x5DE9, "" }, +// { 0x5DEA, "" }, +// { 0x5DEB, "" }, +// { 0x5DEC, "" }, + { 0x5DED, "ai_set_goal_on_notify" }, + { 0x5DEE, "ai_ignoreall" }, +// { 0x5DEF, "" }, +// { 0x5DF0, "" }, + { 0x5DF1, "opentop_anims" }, +// { 0x5DF2, "" }, + { 0x5DF3, "set_turret_animtree" }, +// { 0x5DF4, "" }, +// { 0x5DF5, "" }, +// { 0x5DF6, "" }, +// { 0x5DF7, "" }, +// { 0x5DF8, "" }, +// { 0x5DF9, "" }, + { 0x5DFA, "common_scripts/_destructible_types_anim_prop_radar_maz" }, + { 0x5DFB, "scripted_anims" }, + { 0x5DFC, "open_area_vehicle_objects" }, + { 0x5DFD, "open_area_script_objects" }, + { 0x5DFE, "angel_flare_rig_anims" }, +// { 0x5DFF, "" }, +// { 0x5E00, "" }, + { 0x5E01, "plane_body_scrape_stop" }, +// { 0x5E02, "" }, +// { 0x5E03, "" }, + { 0x5E04, "level_manager" }, + { 0x5E05, "catch_up_manager" }, +// { 0x5E06, "" }, +// { 0x5E07, "" }, +// { 0x5E08, "" }, +// { 0x5E09, "" }, +// { 0x5E0A, "" }, + { 0x5E0B, "level_thermal_objects" }, + { 0x5E0C, "level_death_fx" }, + { 0x5E0D, "delta_spawn_at_fast_point" }, + { 0x5E0E, "setup_sandman_pip" }, +// { 0x5E0F, "" }, +// { 0x5E10, "" }, +// { 0x5E11, "" }, +// { 0x5E12, "" }, + { 0x5E13, "init_building_triggers" }, +// { 0x5E14, "" }, +// { 0x5E15, "" }, +// { 0x5E16, "" }, +// { 0x5E17, "" }, + { 0x5E18, "catch_up_ac130" }, +// { 0x5E19, "" }, +// { 0x5E1A, "" }, +// { 0x5E1B, "" }, +// { 0x5E1C, "" }, +// { 0x5E1D, "" }, +// { 0x5E1E, "" }, +// { 0x5E1F, "" }, +// { 0x5E20, "" }, + { 0x5E21, "ac130_minimap" }, +// { 0x5E22, "" }, +// { 0x5E23, "" }, +// { 0x5E24, "" }, +// { 0x5E25, "" }, +// { 0x5E26, "" }, +// { 0x5E27, "" }, + { 0x5E28, "ambient_aa_fire_short" }, +// { 0x5E29, "" }, +// { 0x5E2A, "" }, +// { 0x5E2B, "" }, +// { 0x5E2C, "" }, +// { 0x5E2D, "" }, +// { 0x5E2E, "" }, +// { 0x5E2F, "" }, +// { 0x5E30, "" }, + { 0x5E31, "fdr_osprey_setup" }, +// { 0x5E32, "" }, + { 0x5E33, "fdr_delta_mark" }, +// { 0x5E34, "" }, +// { 0x5E35, "" }, +// { 0x5E36, "" }, + { 0x5E37, "fdr_btrs" }, +// { 0x5E38, "" }, +// { 0x5E39, "" }, +// { 0x5E3A, "" }, + { 0x5E3B, "fdr_carpet_bomb_timeout" }, +// { 0x5E3C, "" }, + { 0x5E3D, "used_spots" }, +// { 0x5E3E, "" }, +// { 0x5E3F, "" }, + { 0x5E40, "fdr_bm21s" }, +// { 0x5E41, "" }, + { 0x5E42, "fdr_enemies" }, +// { 0x5E43, "" }, +// { 0x5E44, "" }, +// { 0x5E45, "" }, +// { 0x5E46, "" }, +// { 0x5E47, "" }, +// { 0x5E48, "" }, +// { 0x5E49, "" }, + { 0x5E4A, "street_enemy_spawners" }, +// { 0x5E4B, "" }, + { 0x5E4C, "start_street" }, +// { 0x5E4D, "" }, + { 0x5E4E, "street_ma_1_delta_move_down" }, +// { 0x5E4F, "" }, +// { 0x5E50, "" }, +// { 0x5E51, "" }, +// { 0x5E52, "" }, + { 0x5E53, "street_ma_1_enemies_monitor" }, +// { 0x5E54, "" }, +// { 0x5E55, "" }, +// { 0x5E56, "" }, +// { 0x5E57, "" }, +// { 0x5E58, "" }, +// { 0x5E59, "" }, +// { 0x5E5A, "" }, +// { 0x5E5B, "" }, +// { 0x5E5C, "" }, +// { 0x5E5D, "" }, + { 0x5E5E, "street_ma_2_encounter" }, +// { 0x5E5F, "" }, + { 0x5E60, "street_ma_2_enemies_monitor" }, +// { 0x5E61, "" }, +// { 0x5E62, "" }, + { 0x5E63, "street_ma_3_delta_move_down" }, +// { 0x5E64, "" }, +// { 0x5E65, "" }, +// { 0x5E66, "" }, +// { 0x5E67, "" }, + { 0x5E68, "street_ma_3_enemies_monitor" }, +// { 0x5E69, "" }, +// { 0x5E6A, "" }, +// { 0x5E6B, "" }, +// { 0x5E6C, "" }, +// { 0x5E6D, "" }, + { 0x5E6E, "street_ma_3_mi17_2_enemies_monitor" }, +// { 0x5E6F, "" }, +// { 0x5E70, "" }, +// { 0x5E71, "" }, +// { 0x5E72, "" }, +// { 0x5E73, "" }, +// { 0x5E74, "" }, +// { 0x5E75, "" }, +// { 0x5E76, "" }, +// { 0x5E77, "" }, +// { 0x5E78, "" }, +// { 0x5E79, "" }, +// { 0x5E7A, "" }, +// { 0x5E7B, "" }, +// { 0x5E7C, "" }, +// { 0x5E7D, "" }, +// { 0x5E7E, "" }, +// { 0x5E7F, "" }, +// { 0x5E80, "" }, + { 0x5E81, "rpg_angel_flar_moment_monitor_ac130_position" }, +// { 0x5E82, "" }, + { 0x5E83, "rpg_delta_move_down" }, +// { 0x5E84, "" }, +// { 0x5E85, "" }, +// { 0x5E86, "" }, + { 0x5E87, "rpg_pip_event" }, + { 0x5E88, "rpg_building" }, +// { 0x5E89, "" }, +// { 0x5E8A, "" }, +// { 0x5E8B, "" }, + { 0x5E8C, "rpg_building_trigger_monitor" }, +// { 0x5E8D, "" }, +// { 0x5E8E, "" }, +// { 0x5E8F, "" }, +// { 0x5E90, "" }, +// { 0x5E91, "" }, +// { 0x5E92, "" }, +// { 0x5E93, "" }, +// { 0x5E94, "" }, +// { 0x5E95, "" }, + { 0x5E96, "rpg_delete_structs" }, + { 0x5E97, "catch_up_courtyard" }, + { 0x5E98, "start_courtyard" }, +// { 0x5E99, "" }, +// { 0x5E9A, "" }, + { 0x5E9B, "courtyard_cleanup_outside" }, +// { 0x5E9C, "" }, +// { 0x5E9D, "" }, + { 0x5E9E, "catch_up_chase" }, +// { 0x5E9F, "" }, +// { 0x5EA0, "" }, +// { 0x5EA1, "" }, +// { 0x5EA2, "" }, +// { 0x5EA3, "" }, +// { 0x5EA4, "" }, + { 0x5EA5, "chase_pfr_mission_failed" }, + { 0x5EA6, "chase_pfr_enemy_spawn" }, +// { 0x5EA7, "" }, +// { 0x5EA8, "" }, +// { 0x5EA9, "" }, +// { 0x5EAA, "" }, +// { 0x5EAB, "" }, +// { 0x5EAC, "" }, +// { 0x5EAD, "" }, +// { 0x5EAE, "" }, +// { 0x5EAF, "" }, +// { 0x5EB0, "" }, + { 0x5EB1, "chase_clear_fx" }, +// { 0x5EB2, "" }, +// { 0x5EB3, "" }, +// { 0x5EB4, "" }, +// { 0x5EB5, "" }, +// { 0x5EB6, "" }, +// { 0x5EB7, "" }, +// { 0x5EB8, "" }, +// { 0x5EB9, "" }, +// { 0x5EBA, "" }, +// { 0x5EBB, "" }, +// { 0x5EBC, "" }, + { 0x5EBD, "chase_rpgs" }, +// { 0x5EBE, "" }, +// { 0x5EBF, "" }, +// { 0x5EC0, "" }, + { 0x5EC1, "chase_hind_hints" }, +// { 0x5EC2, "" }, +// { 0x5EC3, "" }, +// { 0x5EC4, "" }, + { 0x5EC5, "chase_t72_mobilize_group_2" }, +// { 0x5EC6, "" }, + { 0x5EC7, "chase_mi17s" }, + { 0x5EC8, "chase_mi17_enemy_management" }, +// { 0x5EC9, "" }, +// { 0x5ECA, "" }, +// { 0x5ECB, "" }, +// { 0x5ECC, "" }, +// { 0x5ECD, "" }, +// { 0x5ECE, "" }, +// { 0x5ECF, "" }, +// { 0x5ED0, "" }, + { 0x5ED1, "land_structs_think" }, +// { 0x5ED2, "" }, + { 0x5ED3, "waittimeoruntilturretstatechange" }, +// { 0x5ED4, "" }, +// { 0x5ED5, "" }, +// { 0x5ED6, "" }, +// { 0x5ED7, "" }, +// { 0x5ED8, "" }, +// { 0x5ED9, "" }, + { 0x5EDA, "turretdoaimanims" }, +// { 0x5EDB, "" }, +// { 0x5EDC, "" }, +// { 0x5EDD, "" }, + { 0x5EDE, "character/character_hero_africa_price" }, +// { 0x5EDF, "" }, +// { 0x5EE0, "" }, +// { 0x5EE1, "" }, +// { 0x5EE2, "" }, +// { 0x5EE3, "" }, +// { 0x5EE4, "" }, + { 0x5EE5, "debug_no_sandstorm" }, +// { 0x5EE6, "" }, + { 0x5EE7, "handle_vehicle_lights" }, +// { 0x5EE8, "" }, + { 0x5EE9, "flashlight_tag" }, +// { 0x5EEA, "" }, + { 0x5EEB, "flashlight_off_guy" }, +// { 0x5EEC, "" }, +// { 0x5EED, "" }, + { 0x5EEE, "bravo_invulnerability" }, +// { 0x5EEF, "" }, + { 0x5EF0, "barracus" }, + { 0x5EF1, "hannibal" }, +// { 0x5EF2, "" }, +// { 0x5EF3, "" }, +// { 0x5EF4, "" }, +// { 0x5EF5, "" }, +// { 0x5EF6, "" }, +// { 0x5EF7, "" }, +// { 0x5EF8, "" }, +// { 0x5EF9, "" }, +// { 0x5EFA, "" }, +// { 0x5EFB, "" }, +// { 0x5EFC, "" }, +// { 0x5EFD, "" }, +// { 0x5EFE, "" }, +// { 0x5EFF, "" }, +// { 0x5F00, "" }, +// { 0x5F01, "" }, +// { 0x5F02, "" }, +// { 0x5F03, "" }, +// { 0x5F04, "" }, +// { 0x5F05, "" }, + { 0x5F06, "hide_hud_for_scripted_sequence" }, +// { 0x5F07, "" }, + { 0x5F08, "move_player_to_scriptstruct" }, +// { 0x5F09, "" }, + { 0x5F0A, "custom_spawn_funcs" }, +// { 0x5F0B, "" }, +// { 0x5F0C, "" }, + { 0x5F0D, "spawn_func_respawn_on_death_flashlights" }, +// { 0x5F0E, "" }, +// { 0x5F0F, "" }, + { 0x5F10, "spawn_func_crushplayer" }, +// { 0x5F11, "" }, +// { 0x5F12, "" }, +// { 0x5F13, "" }, +// { 0x5F14, "" }, +// { 0x5F15, "" }, +// { 0x5F16, "" }, +// { 0x5F17, "" }, +// { 0x5F18, "" }, + { 0x5F19, "chase_ignore_til_pathend_or_damage" }, +// { 0x5F1A, "" }, +// { 0x5F1B, "" }, +// { 0x5F1C, "" }, + { 0x5F1D, "spawn_func_respawn_on_death" }, +// { 0x5F1E, "" }, +// { 0x5F1F, "" }, +// { 0x5F20, "" }, +// { 0x5F21, "" }, +// { 0x5F22, "" }, +// { 0x5F23, "" }, +// { 0x5F24, "" }, + { 0x5F25, "custom_move_reset" }, +// { 0x5F26, "" }, +// { 0x5F27, "" }, +// { 0x5F28, "" }, +// { 0x5F29, "" }, + { 0x5F2A, "activate_crush_player_mode_all" }, +// { 0x5F2B, "" }, +// { 0x5F2C, "" }, +// { 0x5F2D, "" }, + { 0x5F2E, "payback_color_trigger_disable_previous" }, +// { 0x5F2F, "" }, +// { 0x5F30, "" }, +// { 0x5F31, "" }, +// { 0x5F32, "" }, + { 0x5F33, "chopper_fog_brushes" }, + { 0x5F34, "notify_on_trigger" }, +// { 0x5F35, "" }, + { 0x5F36, "explosion_ragdoll_fling" }, + { 0x5F37, "randomize_normal" }, +// { 0x5F38, "" }, +// { 0x5F39, "" }, + { 0x5F3A, "oscillate_entity_debug" }, +// { 0x5F3B, "" }, +// { 0x5F3C, "" }, + { 0x5F3D, "combat_runner_disable" }, +// { 0x5F3E, "" }, +// { 0x5F3F, "" }, +// { 0x5F40, "" }, + { 0x5F41, "dot" }, + { 0x5F42, "lesser_dot" }, +// { 0x5F43, "" }, +// { 0x5F44, "" }, +// { 0x5F45, "" }, +// { 0x5F46, "" }, +// { 0x5F47, "" }, +// { 0x5F48, "" }, + { 0x5F49, "friendly_endpoint" }, +// { 0x5F4A, "" }, + { 0x5F4B, "try_balcony_death" }, +// { 0x5F4C, "" }, +// { 0x5F4D, "" }, +// { 0x5F4E, "" }, +// { 0x5F4F, "" }, +// { 0x5F50, "" }, + { 0x5F51, "payback_waittill_combat_internal" }, +// { 0x5F52, "" }, + { 0x5F53, "play_vo_internal" }, + { 0x5F54, "raven_player_can_see_ai" }, +// { 0x5F55, "" }, +// { 0x5F56, "" }, +// { 0x5F57, "" }, + { 0x5F58, "tv_sound_name" }, +// { 0x5F59, "" }, +// { 0x5F5A, "" }, +// { 0x5F5B, "" }, +// { 0x5F5C, "" }, +// { 0x5F5D, "" }, +// { 0x5F5E, "" }, +// { 0x5F5F, "" }, +// { 0x5F60, "" }, +// { 0x5F61, "" }, + { 0x5F62, "setup_sandstorm_replacement_fx" }, +// { 0x5F63, "" }, + { 0x5F64, "start_s3_rescue" }, +// { 0x5F65, "" }, + { 0x5F66, "moroccan_lamp_thread" }, + { 0x5F67, "lighten_sandstorm" }, +// { 0x5F68, "" }, +// { 0x5F69, "" }, + { 0x5F6A, "rescue_init" }, +// { 0x5F6B, "" }, +// { 0x5F6C, "" }, + { 0x5F6D, "minimap_change_watcher" }, + { 0x5F6E, "rescue_begin" }, +// { 0x5F6F, "" }, +// { 0x5F70, "" }, +// { 0x5F71, "" }, + { 0x5F72, "spawn_echo_team_near_chopper" }, +// { 0x5F73, "" }, + { 0x5F74, "dust_fx" }, +// { 0x5F75, "" }, +// { 0x5F76, "" }, +// { 0x5F77, "" }, +// { 0x5F78, "" }, +// { 0x5F79, "" }, + { 0x5F7A, "rescue_advance_to_chopper" }, +// { 0x5F7B, "" }, +// { 0x5F7C, "" }, +// { 0x5F7D, "" }, +// { 0x5F7E, "" }, +// { 0x5F7F, "" }, + { 0x5F80, "rescue_exit_setup" }, +// { 0x5F81, "" }, +// { 0x5F82, "" }, +// { 0x5F83, "" }, +// { 0x5F84, "" }, +// { 0x5F85, "" }, +// { 0x5F86, "" }, +// { 0x5F87, "" }, + { 0x5F88, "rescue_exit_sequence_soap" }, +// { 0x5F89, "" }, +// { 0x5F8A, "" }, +// { 0x5F8B, "" }, +// { 0x5F8C, "" }, +// { 0x5F8D, "" }, +// { 0x5F8E, "" }, + { 0x5F8F, "price_run_part_1" }, +// { 0x5F90, "" }, +// { 0x5F91, "" }, + { 0x5F92, "player_enter_jeep_trigger" }, +// { 0x5F93, "" }, + { 0x5F94, "new_jeep_escape_setup" }, +// { 0x5F95, "" }, +// { 0x5F96, "" }, +// { 0x5F97, "" }, +// { 0x5F98, "" }, +// { 0x5F99, "" }, +// { 0x5F9A, "" }, +// { 0x5F9B, "" }, +// { 0x5F9C, "" }, + { 0x5F9D, "nikolai_jeep_escape" }, + { 0x5F9E, "escape_player_arms" }, +// { 0x5F9F, "" }, + { 0x5FA0, "jeep_player_arms" }, +// { 0x5FA1, "" }, +// { 0x5FA2, "" }, +// { 0x5FA3, "" }, +// { 0x5FA4, "" }, +// { 0x5FA5, "" }, +// { 0x5FA6, "" }, +// { 0x5FA7, "" }, + { 0x5FA8, "ridge_contain" }, +// { 0x5FA9, "" }, +// { 0x5FAA, "" }, +// { 0x5FAB, "" }, + { 0x5FAC, "final_technical_2" }, +// { 0x5FAD, "" }, +// { 0x5FAE, "" }, +// { 0x5FAF, "" }, +// { 0x5FB0, "" }, + { 0x5FB1, "nikolai_attach_to_jeep" }, +// { 0x5FB2, "" }, +// { 0x5FB3, "" }, +// { 0x5FB4, "" }, +// { 0x5FB5, "" }, +// { 0x5FB6, "" }, +// { 0x5FB7, "" }, +// { 0x5FB8, "" }, +// { 0x5FB9, "" }, +// { 0x5FBA, "" }, + { 0x5FBB, "jeep_escape_final_technical_1" }, +// { 0x5FBC, "" }, + { 0x5FBD, "jeep_escape_uaz" }, +// { 0x5FBE, "" }, +// { 0x5FBF, "" }, +// { 0x5FC0, "" }, + { 0x5FC1, "pickup_nikolai_enable_and_disable_weapons" }, +// { 0x5FC2, "" }, + { 0x5FC3, "ignore_player_until_looking_at_target" }, + { 0x5FC4, "rescue_nikolai" }, +// { 0x5FC5, "" }, +// { 0x5FC6, "" }, +// { 0x5FC7, "" }, +// { 0x5FC8, "" }, +// { 0x5FC9, "" }, +// { 0x5FCA, "" }, + { 0x5FCB, "pickup_nikolai_and_escape_radio_vo" }, +// { 0x5FCC, "" }, + { 0x5FCD, "crashed_chopper_prop" }, +// { 0x5FCE, "" }, +// { 0x5FCF, "" }, +// { 0x5FD0, "" }, + { 0x5FD1, "payback_stance_carry_icon_enable" }, +// { 0x5FD2, "" }, + { 0x5FD3, "rescue_carry_nikolai_drop" }, +// { 0x5FD4, "" }, +// { 0x5FD5, "" }, +// { 0x5FD6, "" }, +// { 0x5FD7, "" }, +// { 0x5FD8, "" }, +// { 0x5FD9, "" }, + { 0x5FDA, "slide_fx_off" }, +// { 0x5FDB, "" }, +// { 0x5FDC, "" }, + { 0x5FDD, "rescue_phantom_trigger_wait" }, +// { 0x5FDE, "" }, +// { 0x5FDF, "" }, +// { 0x5FE0, "" }, +// { 0x5FE1, "" }, +// { 0x5FE2, "" }, +// { 0x5FE3, "" }, +// { 0x5FE4, "" }, +// { 0x5FE5, "" }, +// { 0x5FE6, "" }, +// { 0x5FE7, "" }, +// { 0x5FE8, "" }, +// { 0x5FE9, "" }, +// { 0x5FEA, "" }, +// { 0x5FEB, "" }, +// { 0x5FEC, "" }, +// { 0x5FED, "" }, +// { 0x5FEE, "" }, +// { 0x5FEF, "" }, +// { 0x5FF0, "" }, +// { 0x5FF1, "" }, +// { 0x5FF2, "" }, +// { 0x5FF3, "" }, +// { 0x5FF4, "" }, + { 0x5FF5, "sandstorm_allies_sprint" }, + { 0x5FF6, "sandstorm_allies_cqb" }, +// { 0x5FF7, "" }, +// { 0x5FF8, "" }, + { 0x5FF9, "sandstorm_runners_thread" }, +// { 0x5FFA, "" }, +// { 0x5FFB, "" }, + { 0x5FFC, "sandstorm_runner_runner_vo" }, +// { 0x5FFD, "" }, +// { 0x5FFE, "" }, +// { 0x5FFF, "" }, +// { 0x6000, "" }, +// { 0x6001, "" }, +// { 0x6002, "" }, +// { 0x6003, "" }, +// { 0x6004, "" }, +// { 0x6005, "" }, +// { 0x6006, "" }, +// { 0x6007, "" }, +// { 0x6008, "" }, +// { 0x6009, "" }, +// { 0x600A, "" }, +// { 0x600B, "" }, + { 0x600C, "uaz1_handler" }, +// { 0x600D, "" }, +// { 0x600E, "" }, +// { 0x600F, "" }, +// { 0x6010, "" }, +// { 0x6011, "" }, +// { 0x6012, "" }, +// { 0x6013, "" }, + { 0x6014, "blackout_takedown_vo" }, +// { 0x6015, "" }, +// { 0x6016, "" }, +// { 0x6017, "" }, +// { 0x6018, "" }, +// { 0x6019, "" }, +// { 0x601A, "" }, +// { 0x601B, "" }, +// { 0x601C, "" }, +// { 0x601D, "" }, +// { 0x601E, "" }, +// { 0x601F, "" }, + { 0x6020, "do_end_runners" }, + { 0x6021, "do_end_wavers" }, +// { 0x6022, "" }, +// { 0x6023, "" }, + { 0x6024, "handle_unaware_shot" }, + { 0x6025, "unawares_attack" }, +// { 0x6026, "" }, +// { 0x6027, "" }, +// { 0x6028, "" }, +// { 0x6029, "" }, +// { 0x602A, "" }, +// { 0x602B, "" }, +// { 0x602C, "" }, +// { 0x602D, "" }, +// { 0x602E, "" }, + { 0x602F, "chopper_current_slow_pitch" }, +// { 0x6030, "" }, +// { 0x6031, "" }, +// { 0x6032, "" }, +// { 0x6033, "" }, +// { 0x6034, "" }, +// { 0x6035, "" }, +// { 0x6036, "" }, +// { 0x6037, "" }, +// { 0x6038, "" }, +// { 0x6039, "" }, +// { 0x603A, "" }, + { 0x603B, "chopper_strafe_ready_vo_index" }, +// { 0x603C, "" }, +// { 0x603D, "" }, +// { 0x603E, "" }, +// { 0x603F, "" }, + { 0x6040, "payback_chopper_hint" }, +// { 0x6041, "" }, +// { 0x6042, "" }, +// { 0x6043, "" }, +// { 0x6044, "" }, +// { 0x6045, "" }, +// { 0x6046, "" }, +// { 0x6047, "" }, + { 0x6048, "chopper_text" }, + { 0x6049, "chopper_hint_text_delete" }, +// { 0x604A, "" }, +// { 0x604B, "" }, +// { 0x604C, "" }, +// { 0x604D, "" }, +// { 0x604E, "" }, + { 0x604F, "handle_firing" }, + { 0x6050, "handle_projectile_impact" }, +// { 0x6051, "" }, +// { 0x6052, "" }, +// { 0x6053, "" }, +// { 0x6054, "" }, + { 0x6055, "handle_firing_sound" }, + { 0x6056, "chopper_gun_sound" }, + { 0x6057, "handle_firing_aim_slowdown" }, + { 0x6058, "lerp_dof" }, +// { 0x6059, "" }, +// { 0x605A, "" }, +// { 0x605B, "" }, + { 0x605C, "init_fake_player_model" }, +// { 0x605D, "" }, +// { 0x605E, "" }, +// { 0x605F, "" }, + { 0x6060, "delete_fake_player_model" }, + { 0x6061, "chopper_thermal_on" }, +// { 0x6062, "" }, + { 0x6063, "chopper_thermal_off" }, +// { 0x6064, "" }, +// { 0x6065, "" }, +// { 0x6066, "" }, +// { 0x6067, "" }, +// { 0x6068, "" }, +// { 0x6069, "" }, +// { 0x606A, "" }, +// { 0x606B, "" }, +// { 0x606C, "" }, +// { 0x606D, "" }, +// { 0x606E, "" }, +// { 0x606F, "" }, +// { 0x6070, "" }, +// { 0x6071, "" }, + { 0x6072, "chopper_grain_overlay" }, +// { 0x6073, "" }, +// { 0x6074, "" }, + { 0x6075, "chopper_angles_overlay" }, +// { 0x6076, "" }, +// { 0x6077, "" }, +// { 0x6078, "" }, +// { 0x6079, "" }, +// { 0x607A, "" }, +// { 0x607B, "" }, +// { 0x607C, "" }, +// { 0x607D, "" }, +// { 0x607E, "" }, +// { 0x607F, "" }, + { 0x6080, "remove_chopper_targets" }, +// { 0x6081, "" }, +// { 0x6082, "" }, + { 0x6083, "update_rpg" }, +// { 0x6084, "" }, +// { 0x6085, "" }, + { 0x6086, "monitor_for_damage" }, +// { 0x6087, "" }, +// { 0x6088, "" }, +// { 0x6089, "" }, + { 0x608A, "chopper_strafe_next_index" }, +// { 0x608B, "" }, +// { 0x608C, "" }, +// { 0x608D, "" }, +// { 0x608E, "" }, +// { 0x608F, "" }, +// { 0x6090, "" }, +// { 0x6091, "" }, +// { 0x6092, "" }, + { 0x6093, "chopper_create_missile_attractor" }, +// { 0x6094, "" }, + { 0x6095, "fire_rpgs_from_ai" }, +// { 0x6096, "" }, +// { 0x6097, "" }, +// { 0x6098, "" }, + { 0x6099, "kruger_interrogation_init" }, +// { 0x609A, "" }, + { 0x609B, "maps/_slowmo_breach_payback" }, +// { 0x609C, "" }, +// { 0x609D, "" }, +// { 0x609E, "" }, +// { 0x609F, "" }, +// { 0x60A0, "" }, +// { 0x60A1, "" }, +// { 0x60A2, "" }, + { 0x60A3, "move_barracus_by_kruger_door" }, +// { 0x60A4, "" }, +// { 0x60A5, "" }, +// { 0x60A6, "" }, + { 0x60A7, "spawn_kruger_with_spawn_funcs" }, +// { 0x60A8, "" }, + { 0x60A9, "dummy_prop_1" }, +// { 0x60AA, "" }, +// { 0x60AB, "" }, +// { 0x60AC, "" }, +// { 0x60AD, "" }, +// { 0x60AE, "" }, +// { 0x60AF, "" }, +// { 0x60B0, "" }, + { 0x60B1, "fake_waraabe_death" }, +// { 0x60B2, "" }, + { 0x60B3, "price_pre_breach_accuracy" }, +// { 0x60B4, "" }, +// { 0x60B5, "" }, + { 0x60B6, "soap_pre_breach_accuracy" }, +// { 0x60B7, "" }, +// { 0x60B8, "" }, +// { 0x60B9, "" }, +// { 0x60BA, "" }, +// { 0x60BB, "" }, +// { 0x60BC, "" }, +// { 0x60BD, "" }, +// { 0x60BE, "" }, +// { 0x60BF, "" }, +// { 0x60C0, "" }, +// { 0x60C1, "" }, + { 0x60C2, "gas_kill_player_fast" }, + { 0x60C3, "price_start_interrogation" }, + { 0x60C4, "swap_model" }, +// { 0x60C5, "" }, +// { 0x60C6, "" }, + { 0x60C7, "price_shoot_kruger" }, +// { 0x60C8, "" }, + { 0x60C9, "crate_blood_decal_model" }, +// { 0x60CA, "" }, +// { 0x60CB, "" }, +// { 0x60CC, "" }, + { 0x60CD, "dummy_prop_6" }, +// { 0x60CE, "" }, +// { 0x60CF, "" }, +// { 0x60D0, "" }, +// { 0x60D1, "" }, +// { 0x60D2, "" }, +// { 0x60D3, "" }, +// { 0x60D4, "" }, +// { 0x60D5, "" }, +// { 0x60D6, "" }, + { 0x60D7, "waraabe_clipboard" }, +// { 0x60D8, "" }, +// { 0x60D9, "" }, +// { 0x60DA, "" }, + { 0x60DB, "interrogation_room_shutters" }, + { 0x60DC, "interrogation_room_curtains" }, +// { 0x60DD, "" }, +// { 0x60DE, "" }, +// { 0x60DF, "" }, +// { 0x60E0, "" }, +// { 0x60E1, "" }, +// { 0x60E2, "" }, + { 0x60E3, "fx_initial_spew" }, + { 0x60E4, "fx_big_spew" }, +// { 0x60E5, "" }, +// { 0x60E6, "" }, +// { 0x60E7, "" }, +// { 0x60E8, "" }, +// { 0x60E9, "" }, + { 0x60EA, "price_unholster_pistol" }, +// { 0x60EB, "" }, +// { 0x60EC, "" }, +// { 0x60ED, "" }, +// { 0x60EE, "" }, +// { 0x60EF, "" }, +// { 0x60F0, "" }, + { 0x60F1, "gasmask_hud_off" }, +// { 0x60F2, "" }, +// { 0x60F3, "" }, +// { 0x60F4, "" }, +// { 0x60F5, "" }, +// { 0x60F6, "" }, +// { 0x60F7, "" }, +// { 0x60F8, "" }, +// { 0x60F9, "" }, +// { 0x60FA, "" }, + { 0x60FB, "streets_construction" }, +// { 0x60FC, "" }, +// { 0x60FD, "" }, +// { 0x60FE, "" }, +// { 0x60FF, "" }, +// { 0x6100, "" }, +// { 0x6101, "" }, +// { 0x6102, "" }, +// { 0x6103, "" }, +// { 0x6104, "" }, +// { 0x6105, "" }, +// { 0x6106, "" }, +// { 0x6107, "" }, +// { 0x6108, "" }, +// { 0x6109, "" }, +// { 0x610A, "" }, +// { 0x610B, "" }, + { 0x610C, "streets_fakerpg" }, +// { 0x610D, "" }, +// { 0x610E, "" }, +// { 0x610F, "" }, +// { 0x6110, "" }, +// { 0x6111, "" }, +// { 0x6112, "" }, +// { 0x6113, "" }, +// { 0x6114, "" }, +// { 0x6115, "" }, +// { 0x6116, "" }, +// { 0x6117, "" }, +// { 0x6118, "" }, +// { 0x6119, "" }, +// { 0x611A, "" }, +// { 0x611B, "" }, +// { 0x611C, "" }, +// { 0x611D, "" }, +// { 0x611E, "" }, +// { 0x611F, "" }, +// { 0x6120, "" }, +// { 0x6121, "" }, +// { 0x6122, "" }, +// { 0x6123, "" }, +// { 0x6124, "" }, +// { 0x6125, "" }, +// { 0x6126, "" }, +// { 0x6127, "" }, + { 0x6128, "stopwatch" }, +// { 0x6129, "" }, +// { 0x612A, "" }, + { 0x612B, "sandstorm_killtimer" }, +// { 0x612C, "" }, +// { 0x612D, "" }, +// { 0x612E, "" }, +// { 0x612F, "" }, + { 0x6130, "sandstorm_timer_tick" }, +// { 0x6131, "" }, +// { 0x6132, "" }, +// { 0x6133, "" }, +// { 0x6134, "" }, +// { 0x6135, "" }, +// { 0x6136, "" }, +// { 0x6137, "" }, +// { 0x6138, "" }, +// { 0x6139, "" }, +// { 0x613A, "" }, +// { 0x613B, "" }, +// { 0x613C, "" }, +// { 0x613D, "" }, +// { 0x613E, "" }, +// { 0x613F, "" }, +// { 0x6140, "" }, +// { 0x6141, "" }, +// { 0x6142, "" }, + { 0x6143, "handler_ambush_cleanup" }, +// { 0x6144, "" }, +// { 0x6145, "" }, +// { 0x6146, "" }, +// { 0x6147, "" }, + { 0x6148, "spawn_area2_narrowstreet" }, +// { 0x6149, "" }, +// { 0x614A, "" }, +// { 0x614B, "" }, +// { 0x614C, "" }, + { 0x614D, "streets_vo_010" }, +// { 0x614E, "" }, +// { 0x614F, "" }, +// { 0x6150, "" }, +// { 0x6151, "" }, +// { 0x6152, "" }, + { 0x6153, "make_murdock_mortal" }, +// { 0x6154, "" }, +// { 0x6155, "" }, + { 0x6156, "streets_speed_reset" }, +// { 0x6157, "" }, + { 0x6158, "const_anims" }, +// { 0x6159, "" }, +// { 0x615A, "" }, + { 0x615B, "construction_spawned" }, + { 0x615C, "construction_waves" }, + { 0x615D, "spawn_construction_models" }, + { 0x615E, "spawn_model_from_struct" }, +// { 0x615F, "" }, +// { 0x6160, "" }, +// { 0x6161, "" }, +// { 0x6162, "" }, +// { 0x6163, "" }, + { 0x6164, "iwrunners" }, +// { 0x6165, "" }, +// { 0x6166, "" }, +// { 0x6167, "" }, +// { 0x6168, "" }, +// { 0x6169, "" }, +// { 0x616A, "" }, + { 0x616B, "watch_player_stairs" }, +// { 0x616C, "" }, +// { 0x616D, "" }, +// { 0x616E, "" }, +// { 0x616F, "" }, +// { 0x6170, "" }, +// { 0x6171, "" }, +// { 0x6172, "" }, +// { 0x6173, "" }, + { 0x6174, "rappel_chaser" }, +// { 0x6175, "" }, +// { 0x6176, "" }, +// { 0x6177, "" }, +// { 0x6178, "" }, + { 0x6179, "allow_chopper_gunner" }, +// { 0x617A, "" }, + { 0x617B, "disable_const_roof_obj" }, +// { 0x617C, "" }, +// { 0x617D, "" }, +// { 0x617E, "" }, + { 0x617F, "manage_animation_blocking_vol" }, +// { 0x6180, "" }, + { 0x6181, "enable_jump_objective" }, +// { 0x6182, "" }, +// { 0x6183, "" }, +// { 0x6184, "" }, + { 0x6185, "chopper_hit_tower_fx" }, +// { 0x6186, "" }, +// { 0x6187, "" }, + { 0x6188, "const_player_rig_1" }, + { 0x6189, "const_player_rig_2" }, +// { 0x618A, "" }, + { 0x618B, "const_player_rig_ledge_2" }, +// { 0x618C, "" }, +// { 0x618D, "" }, +// { 0x618E, "" }, +// { 0x618F, "" }, +// { 0x6190, "" }, +// { 0x6191, "" }, +// { 0x6192, "" }, +// { 0x6193, "" }, +// { 0x6194, "" }, + { 0x6195, "gate_chain" }, +// { 0x6196, "" }, +// { 0x6197, "" }, +// { 0x6198, "" }, + { 0x6199, "rappel_player_jumped_off_ledge" }, +// { 0x619A, "" }, +// { 0x619B, "" }, +// { 0x619C, "" }, +// { 0x619D, "" }, +// { 0x619E, "" }, +// { 0x619F, "" }, +// { 0x61A0, "" }, +// { 0x61A1, "" }, + { 0x61A2, "const_rappel_soap" }, +// { 0x61A3, "" }, +// { 0x61A4, "" }, +// { 0x61A5, "" }, +// { 0x61A6, "" }, +// { 0x61A7, "" }, +// { 0x61A8, "" }, +// { 0x61A9, "" }, + { 0x61AA, "move_soap_to_vo_position" }, +// { 0x61AB, "" }, +// { 0x61AC, "" }, +// { 0x61AD, "" }, +// { 0x61AE, "" }, +// { 0x61AF, "" }, +// { 0x61B0, "" }, +// { 0x61B1, "" }, +// { 0x61B2, "" }, +// { 0x61B3, "" }, +// { 0x61B4, "" }, +// { 0x61B5, "" }, +// { 0x61B6, "" }, + { 0x61B7, "wall_fx" }, + { 0x61B8, "handle_wall_collapse" }, +// { 0x61B9, "" }, +// { 0x61BA, "" }, +// { 0x61BB, "" }, +// { 0x61BC, "" }, +// { 0x61BD, "" }, +// { 0x61BE, "" }, +// { 0x61BF, "" }, +// { 0x61C0, "" }, +// { 0x61C1, "" }, + { 0x61C2, "handle_spawning_of_sandstorm_models" }, + { 0x61C3, "handle_sandstorm_env_effects" }, +// { 0x61C4, "" }, + { 0x61C5, "handle_construction_effects" }, + { 0x61C6, "handle_sandstorm_effects" }, +// { 0x61C7, "" }, +// { 0x61C8, "" }, +// { 0x61C9, "" }, + { 0x61CA, "grass_wind" }, +// { 0x61CB, "" }, +// { 0x61CC, "" }, +// { 0x61CD, "" }, +// { 0x61CE, "" }, +// { 0x61CF, "" }, + { 0x61D0, "fences_wind_high" }, +// { 0x61D1, "" }, +// { 0x61D2, "" }, +// { 0x61D3, "" }, +// { 0x61D4, "" }, +// { 0x61D5, "" }, +// { 0x61D6, "" }, +// { 0x61D7, "" }, +// { 0x61D8, "" }, +// { 0x61D9, "" }, +// { 0x61DA, "" }, +// { 0x61DB, "" }, +// { 0x61DC, "" }, +// { 0x61DD, "" }, +// { 0x61DE, "" }, + { 0x61DF, "tarps_wind_med" }, +// { 0x61E0, "" }, +// { 0x61E1, "" }, + { 0x61E2, "crates_wind_low" }, +// { 0x61E3, "" }, +// { 0x61E4, "" }, +// { 0x61E5, "" }, +// { 0x61E6, "" }, +// { 0x61E7, "" }, +// { 0x61E8, "" }, +// { 0x61E9, "" }, +// { 0x61EA, "" }, + { 0x61EB, "handle_moving_objects" }, +// { 0x61EC, "" }, + { 0x61ED, "south_dir" }, + { 0x61EE, "impulse_trigger" }, + { 0x61EF, "rolling_object_trigger" }, + { 0x61F0, "soundalias" }, +// { 0x61F1, "" }, +// { 0x61F2, "" }, +// { 0x61F3, "" }, + { 0x61F4, "compound_c_jumpto" }, +// { 0x61F5, "" }, + { 0x61F6, "compound_fire_rpg" }, +// { 0x61F7, "" }, +// { 0x61F8, "" }, +// { 0x61F9, "" }, + { 0x61FA, "soap_vo_lines" }, +// { 0x61FB, "" }, +// { 0x61FC, "" }, + { 0x61FD, "breach_lead_up_vo" }, + { 0x61FE, "wilhelm" }, + { 0x61FF, "balcony_room_dynamic_accuracy" }, +// { 0x6200, "" }, +// { 0x6201, "" }, +// { 0x6202, "" }, + { 0x6203, "enable_interior_compound_behavior" }, +// { 0x6204, "" }, +// { 0x6205, "" }, +// { 0x6206, "" }, + { 0x6207, "init_kick_doors" }, + { 0x6208, "close_kick_doors" }, +// { 0x6209, "" }, +// { 0x620A, "" }, +// { 0x620B, "" }, +// { 0x620C, "" }, +// { 0x620D, "" }, +// { 0x620E, "" }, +// { 0x620F, "" }, + { 0x6210, "autosave_heli_check" }, +// { 0x6211, "" }, +// { 0x6212, "" }, +// { 0x6213, "" }, +// { 0x6214, "" }, + { 0x6215, "sprint_to_goal" }, +// { 0x6216, "" }, +// { 0x6217, "" }, + { 0x6218, "find_threatbias_guys" }, + { 0x6219, "price_go_rambo" }, +// { 0x621A, "" }, +// { 0x621B, "" }, +// { 0x621C, "" }, +// { 0x621D, "" }, +// { 0x621E, "" }, +// { 0x621F, "" }, +// { 0x6220, "" }, +// { 0x6221, "" }, +// { 0x6222, "" }, + { 0x6223, "compound_find_mortar_source" }, +// { 0x6224, "" }, +// { 0x6225, "" }, + { 0x6226, "water" }, + { 0x6227, "mortar_goes_off" }, +// { 0x6228, "" }, +// { 0x6229, "" }, +// { 0x622A, "" }, +// { 0x622B, "" }, +// { 0x622C, "" }, + { 0x622D, "technical_vo" }, +// { 0x622E, "" }, + { 0x622F, "roofie_handler" }, +// { 0x6230, "" }, +// { 0x6231, "" }, + { 0x6232, "wait_for_chopper" }, + { 0x6233, "heli_guy_timer" }, +// { 0x6234, "" }, +// { 0x6235, "" }, +// { 0x6236, "" }, + { 0x6237, "kill_balcony_guys" }, +// { 0x6238, "" }, +// { 0x6239, "" }, +// { 0x623A, "" }, +// { 0x623B, "" }, +// { 0x623C, "" }, +// { 0x623D, "" }, +// { 0x623E, "" }, +// { 0x623F, "" }, +// { 0x6240, "" }, +// { 0x6241, "" }, + { 0x6242, "compound_defend" }, +// { 0x6243, "" }, +// { 0x6244, "" }, + { 0x6245, "watch_for_close_player" }, + { 0x6246, "outercompound_enemyvignettes" }, +// { 0x6247, "" }, +// { 0x6248, "" }, + { 0x6249, "animate_then_path" }, +// { 0x624A, "" }, +// { 0x624B, "" }, +// { 0x624C, "" }, +// { 0x624D, "" }, + { 0x624E, "chopper_barrel_hack" }, +// { 0x624F, "" }, +// { 0x6250, "" }, + { 0x6251, "do_path" }, +// { 0x6252, "" }, +// { 0x6253, "" }, + { 0x6254, "vehicle_node_trigger_wait" }, +// { 0x6255, "" }, +// { 0x6256, "" }, +// { 0x6257, "" }, +// { 0x6258, "" }, +// { 0x6259, "" }, +// { 0x625A, "" }, +// { 0x625B, "" }, +// { 0x625C, "" }, +// { 0x625D, "" }, +// { 0x625E, "" }, +// { 0x625F, "" }, +// { 0x6260, "" }, +// { 0x6261, "" }, +// { 0x6262, "" }, + { 0x6263, "override_treadfx_killthread" }, +// { 0x6264, "" }, +// { 0x6265, "" }, +// { 0x6266, "" }, +// { 0x6267, "" }, + { 0x6268, "handle_chopper_destructables" }, + { 0x6269, "handle_guard_tower_explosion" }, +// { 0x626A, "" }, +// { 0x626B, "" }, +// { 0x626C, "" }, +// { 0x626D, "" }, +// { 0x626E, "" }, +// { 0x626F, "" }, +// { 0x6270, "" }, +// { 0x6271, "" }, +// { 0x6272, "" }, +// { 0x6273, "" }, +// { 0x6274, "" }, +// { 0x6275, "" }, +// { 0x6276, "" }, + { 0x6277, "notify_remove_wall" }, +// { 0x6278, "" }, +// { 0x6279, "" }, +// { 0x627A, "" }, +// { 0x627B, "" }, +// { 0x627C, "" }, + { 0x627D, "price_killguy_setup" }, +// { 0x627E, "" }, + { 0x627F, "gatecrash_price_victims_anims" }, +// { 0x6280, "" }, +// { 0x6281, "" }, +// { 0x6282, "" }, +// { 0x6283, "" }, +// { 0x6284, "" }, +// { 0x6285, "" }, +// { 0x6286, "" }, +// { 0x6287, "" }, + { 0x6288, "alpha_screensplash" }, +// { 0x6289, "" }, +// { 0x628A, "" }, + { 0x628B, "nikolai_missiles" }, + { 0x628C, "set_introguys_ignoreme" }, +// { 0x628D, "" }, +// { 0x628E, "" }, +// { 0x628F, "" }, +// { 0x6290, "" }, + { 0x6291, "setup_wheel_rubicon_treadmark_tag" }, +// { 0x6292, "" }, + { 0x6293, "snap_zoom_start_ent" }, +// { 0x6294, "" }, +// { 0x6295, "" }, +// { 0x6296, "" }, +// { 0x6297, "" }, +// { 0x6298, "" }, +// { 0x6299, "" }, +// { 0x629A, "" }, +// { 0x629B, "" }, +// { 0x629C, "" }, +// { 0x629D, "" }, +// { 0x629E, "" }, +// { 0x629F, "" }, + { 0x62A0, "init_flags_compound" }, +// { 0x62A1, "" }, +// { 0x62A2, "" }, + { 0x62A3, "no_breach" }, + { 0x62A4, "init_objectives" }, +// { 0x62A5, "" }, +// { 0x62A6, "" }, +// { 0x62A7, "" }, + { 0x62A8, "setup_soap" }, +// { 0x62A9, "" }, +// { 0x62AA, "" }, + { 0x62AB, "remove_funcs_from" }, + { 0x62AC, "setup_hannibal" }, +// { 0x62AD, "" }, +// { 0x62AE, "" }, +// { 0x62AF, "" }, +// { 0x62B0, "" }, +// { 0x62B1, "" }, + { 0x62B2, "createstaticsound" }, + { 0x62B3, "static_sounds" }, + { 0x62B4, "audio_properties" }, +// { 0x62B5, "" }, +// { 0x62B6, "" }, +// { 0x62B7, "" }, +// { 0x62B8, "" }, +// { 0x62B9, "" }, +// { 0x62BA, "" }, +// { 0x62BB, "" }, +// { 0x62BC, "" }, +// { 0x62BD, "" }, +// { 0x62BE, "" }, +// { 0x62BF, "" }, +// { 0x62C0, "" }, +// { 0x62C1, "" }, +// { 0x62C2, "" }, +// { 0x62C3, "" }, +// { 0x62C4, "" }, +// { 0x62C5, "" }, +// { 0x62C6, "" }, +// { 0x62C7, "" }, +// { 0x62C8, "" }, +// { 0x62C9, "" }, +// { 0x62CA, "" }, +// { 0x62CB, "" }, + { 0x62CC, "ch46e_ny_harbor_anims" }, + { 0x62CD, "russian_sub_anims" }, + { 0x62CE, "zodiac_anims" }, +// { 0x62CF, "" }, + { 0x62D0, "prop_anims" }, + { 0x62D1, "debug_setup" }, +// { 0x62D2, "" }, +// { 0x62D3, "" }, + { 0x62D4, "zodiac_ticked" }, +// { 0x62D5, "" }, +// { 0x62D6, "" }, +// { 0x62D7, "" }, +// { 0x62D8, "" }, +// { 0x62D9, "" }, + { 0x62DA, "center" }, +// { 0x62DB, "" }, +// { 0x62DC, "" }, +// { 0x62DD, "" }, +// { 0x62DE, "" }, +// { 0x62DF, "" }, +// { 0x62E0, "" }, +// { 0x62E1, "" }, +// { 0x62E2, "" }, +// { 0x62E3, "" }, +// { 0x62E4, "" }, + { 0x62E5, "boat_pose" }, +// { 0x62E6, "" }, +// { 0x62E7, "" }, +// { 0x62E8, "" }, +// { 0x62E9, "" }, +// { 0x62EA, "" }, +// { 0x62EB, "" }, +// { 0x62EC, "" }, +// { 0x62ED, "" }, +// { 0x62EE, "" }, +// { 0x62EF, "" }, +// { 0x62F0, "" }, +// { 0x62F1, "" }, +// { 0x62F2, "" }, +// { 0x62F3, "" }, +// { 0x62F4, "" }, +// { 0x62F5, "" }, +// { 0x62F6, "" }, +// { 0x62F7, "" }, +// { 0x62F8, "" }, + { 0x62F9, "shoulddotwitch" }, + { 0x62FA, "wait_for_animcomplete_or_react" }, +// { 0x62FB, "" }, +// { 0x62FC, "" }, +// { 0x62FD, "" }, +// { 0x62FE, "" }, +// { 0x62FF, "" }, + { 0x6300, "idleaimdir" }, +// { 0x6301, "" }, + { 0x6302, "getboataimyawtoshootpos" }, +// { 0x6303, "" }, +// { 0x6304, "" }, + { 0x6305, "updateboataim" }, +// { 0x6306, "" }, +// { 0x6307, "" }, +// { 0x6308, "" }, +// { 0x6309, "" }, + { 0x630A, "needtochangepose" }, + { 0x630B, "use_auto_pose" }, + { 0x630C, "scripted_boat_pose" }, + { 0x630D, "setup_anim_array_boat" }, +// { 0x630E, "" }, + { 0x630F, "zodiac_preload" }, +// { 0x6310, "" }, +// { 0x6311, "" }, +// { 0x6312, "" }, +// { 0x6313, "" }, +// { 0x6314, "" }, +// { 0x6315, "" }, + { 0x6316, "zodiac_sound_overrides" }, + { 0x6317, "drive_vehicle" }, + { 0x6318, "zodiac_3rdpersonmodel" }, +// { 0x6319, "" }, + { 0x631A, "get_ai_for_player" }, +// { 0x631B, "" }, +// { 0x631C, "" }, + { 0x631D, "ideal" }, +// { 0x631E, "" }, +// { 0x631F, "" }, + { 0x6320, "enemy_boat" }, + { 0x6321, "drive_crash_detection" }, +// { 0x6322, "" }, +// { 0x6323, "" }, +// { 0x6324, "" }, +// { 0x6325, "" }, +// { 0x6326, "" }, + { 0x6327, "firstperson" }, +// { 0x6328, "" }, +// { 0x6329, "" }, +// { 0x632A, "" }, +// { 0x632B, "" }, +// { 0x632C, "" }, + { 0x632D, "drive_magic_bullet_get_end" }, +// { 0x632E, "" }, +// { 0x632F, "" }, +// { 0x6330, "" }, +// { 0x6331, "" }, +// { 0x6332, "" }, + { 0x6333, "drive_magic_bullet_trace" }, +// { 0x6334, "" }, +// { 0x6335, "" }, +// { 0x6336, "" }, + { 0x6337, "drive_shooting_update_anims" }, +// { 0x6338, "" }, +// { 0x6339, "" }, +// { 0x633A, "" }, +// { 0x633B, "" }, +// { 0x633C, "" }, +// { 0x633D, "" }, +// { 0x633E, "" }, + { 0x633F, "wait_for_vehicle_to_move" }, + { 0x6340, "should_stop_zodiac_reverse_hint" }, +// { 0x6341, "" }, +// { 0x6342, "" }, + { 0x6343, "dv_counts" }, +// { 0x6344, "" }, +// { 0x6345, "" }, +// { 0x6346, "" }, +// { 0x6347, "" }, +// { 0x6348, "" }, +// { 0x6349, "" }, +// { 0x634A, "" }, + { 0x634B, "volumes" }, +// { 0x634C, "" }, +// { 0x634D, "" }, + { 0x634E, "wait_for_debris_volume_trigger" }, +// { 0x634F, "" }, + { 0x6350, "debris_list" }, +// { 0x6351, "" }, +// { 0x6352, "" }, + { 0x6353, "spawnentinvolume" }, +// { 0x6354, "" }, + { 0x6355, "spawn_static" }, +// { 0x6356, "" }, +// { 0x6357, "" }, + { 0x6358, "sinking" }, +// { 0x6359, "" }, +// { 0x635A, "" }, +// { 0x635B, "" }, +// { 0x635C, "" }, +// { 0x635D, "" }, +// { 0x635E, "" }, +// { 0x635F, "" }, +// { 0x6360, "" }, + { 0x6361, "deadbody" }, +// { 0x6362, "" }, + { 0x6363, "draw_bounding_volume" }, + { 0x6364, "maps/_underwater_debris" }, +// { 0x6365, "" }, + { 0x6366, "character/character_hero_delta_sandman_udt" }, + { 0x6367, "vehicle_scripts/_russian_torpedo" }, +// { 0x6368, "" }, +// { 0x6369, "" }, +// { 0x636A, "" }, +// { 0x636B, "" }, +// { 0x636C, "" }, +// { 0x636D, "" }, + { 0x636E, "water_z" }, + { 0x636F, "zodiac_wheel_blend" }, +// { 0x6370, "" }, +// { 0x6371, "" }, +// { 0x6372, "" }, +// { 0x6373, "" }, +// { 0x6374, "" }, +// { 0x6375, "" }, +// { 0x6376, "" }, +// { 0x6377, "" }, +// { 0x6378, "" }, +// { 0x6379, "" }, +// { 0x637A, "" }, +// { 0x637B, "" }, +// { 0x637C, "" }, +// { 0x637D, "" }, +// { 0x637E, "" }, +// { 0x637F, "" }, +// { 0x6380, "" }, +// { 0x6381, "" }, +// { 0x6382, "" }, +// { 0x6383, "" }, +// { 0x6384, "" }, +// { 0x6385, "" }, + { 0x6386, "ramp_displacement_scale" }, +// { 0x6387, "" }, + { 0x6388, "clear_start_from_cinematic" }, + { 0x6389, "draw_tag_axis" }, +// { 0x638A, "" }, + { 0x638B, "match_origin_to_tag" }, +// { 0x638C, "" }, +// { 0x638D, "" }, +// { 0x638E, "" }, +// { 0x638F, "" }, +// { 0x6390, "" }, +// { 0x6391, "" }, +// { 0x6392, "" }, + { 0x6393, "zodiac_fail" }, +// { 0x6394, "" }, + { 0x6395, "zodiac_fail_monitor_speed_clear" }, +// { 0x6396, "" }, +// { 0x6397, "" }, + { 0x6398, "chinook_extraction_fail" }, +// { 0x6399, "" }, +// { 0x639A, "" }, + { 0x639B, "missile_timing" }, + { 0x639C, "missile_timing2" }, +// { 0x639D, "" }, +// { 0x639E, "" }, +// { 0x639F, "" }, +// { 0x63A0, "" }, +// { 0x63A1, "" }, +// { 0x63A2, "" }, +// { 0x63A3, "" }, +// { 0x63A4, "" }, + { 0x63A5, "destroyer_zubr_driveby" }, +// { 0x63A6, "" }, +// { 0x63A7, "" }, + { 0x63A8, "open_ssn12_wings" }, +// { 0x63A9, "" }, +// { 0x63AA, "" }, +// { 0x63AB, "" }, +// { 0x63AC, "" }, +// { 0x63AD, "" }, +// { 0x63AE, "" }, +// { 0x63AF, "" }, +// { 0x63B0, "" }, +// { 0x63B1, "" }, +// { 0x63B2, "" }, +// { 0x63B3, "" }, +// { 0x63B4, "" }, +// { 0x63B5, "" }, +// { 0x63B6, "" }, + { 0x63B7, "rollinfluence" }, + { 0x63B8, "matching" }, +// { 0x63B9, "" }, +// { 0x63BA, "" }, +// { 0x63BB, "" }, +// { 0x63BC, "" }, +// { 0x63BD, "" }, +// { 0x63BE, "" }, +// { 0x63BF, "" }, +// { 0x63C0, "" }, +// { 0x63C1, "" }, +// { 0x63C2, "" }, +// { 0x63C3, "" }, +// { 0x63C4, "" }, +// { 0x63C5, "" }, +// { 0x63C6, "" }, +// { 0x63C7, "" }, +// { 0x63C8, "" }, +// { 0x63C9, "" }, +// { 0x63CA, "" }, +// { 0x63CB, "" }, +// { 0x63CC, "" }, +// { 0x63CD, "" }, +// { 0x63CE, "" }, +// { 0x63CF, "" }, +// { 0x63D0, "" }, +// { 0x63D1, "" }, +// { 0x63D2, "" }, +// { 0x63D3, "" }, +// { 0x63D4, "" }, +// { 0x63D5, "" }, + { 0x63D6, "dvora_shots" }, +// { 0x63D7, "" }, +// { 0x63D8, "" }, +// { 0x63D9, "" }, +// { 0x63DA, "" }, +// { 0x63DB, "" }, +// { 0x63DC, "" }, +// { 0x63DD, "" }, +// { 0x63DE, "" }, + { 0x63DF, "switch_to_flyout_water" }, + { 0x63E0, "adjust_fov_to_default" }, +// { 0x63E1, "" }, +// { 0x63E2, "" }, +// { 0x63E3, "" }, +// { 0x63E4, "" }, + { 0x63E5, "ch_guy2" }, +// { 0x63E6, "" }, +// { 0x63E7, "" }, +// { 0x63E8, "" }, +// { 0x63E9, "" }, +// { 0x63EA, "" }, + { 0x63EB, "ship_squeeze_event" }, + { 0x63EC, "make_falling_debris" }, +// { 0x63ED, "" }, + { 0x63EE, "make_zubrs" }, + { 0x63EF, "make_swimmers" }, + { 0x63F0, "make_fallers" }, +// { 0x63F1, "" }, +// { 0x63F2, "" }, + { 0x63F3, "setup_swimmers" }, +// { 0x63F4, "" }, +// { 0x63F5, "" }, +// { 0x63F6, "" }, +// { 0x63F7, "" }, +// { 0x63F8, "" }, + { 0x63F9, "rescue_seaknight" }, + { 0x63FA, "ally_zodiac_wake_control" }, + { 0x63FB, "keep_zodiac_ahead" }, + { 0x63FC, "handle_allies_zodiac" }, + { 0x63FD, "zodiac_treadfx_chaser" }, +// { 0x63FE, "" }, +// { 0x63FF, "" }, +// { 0x6400, "" }, +// { 0x6401, "" }, +// { 0x6402, "" }, +// { 0x6403, "" }, +// { 0x6404, "" }, +// { 0x6405, "" }, + { 0x6406, "playersride" }, +// { 0x6407, "" }, +// { 0x6408, "" }, +// { 0x6409, "" }, +// { 0x640A, "" }, +// { 0x640B, "" }, +// { 0x640C, "" }, + { 0x640D, "water_bump" }, +// { 0x640E, "" }, + { 0x640F, "listen_turn_spray" }, +// { 0x6410, "" }, +// { 0x6411, "" }, +// { 0x6412, "" }, +// { 0x6413, "" }, + { 0x6414, "fullautorangesq" }, +// { 0x6415, "" }, +// { 0x6416, "" }, +// { 0x6417, "" }, +// { 0x6418, "" }, + { 0x6419, "player_reload_silently" }, +// { 0x641A, "" }, +// { 0x641B, "" }, +// { 0x641C, "" }, +// { 0x641D, "" }, +// { 0x641E, "" }, +// { 0x641F, "" }, + { 0x6420, "prv_hidden" }, +// { 0x6421, "" }, +// { 0x6422, "" }, + { 0x6423, "patches_hide" }, + { 0x6424, "setup_water_patch_triggers" }, +// { 0x6425, "" }, +// { 0x6426, "" }, + { 0x6427, "sky_battle" }, +// { 0x6428, "" }, +// { 0x6429, "" }, +// { 0x642A, "" }, +// { 0x642B, "" }, +// { 0x642C, "" }, +// { 0x642D, "" }, + { 0x642E, "player_scuba" }, + { 0x642F, "player_scuba_breathe_sound" }, +// { 0x6430, "" }, +// { 0x6431, "" }, +// { 0x6432, "" }, + { 0x6433, "scuba_fx_cleanup" }, +// { 0x6434, "" }, +// { 0x6435, "" }, +// { 0x6436, "" }, +// { 0x6437, "" }, +// { 0x6438, "" }, + { 0x6439, "mine_1" }, +// { 0x643A, "" }, +// { 0x643B, "" }, +// { 0x643C, "" }, +// { 0x643D, "" }, +// { 0x643E, "" }, +// { 0x643F, "" }, + { 0x6440, "sub_panel_fx_failsafe" }, +// { 0x6441, "" }, + { 0x6442, "monitor_mine_detonation" }, +// { 0x6443, "" }, +// { 0x6444, "" }, +// { 0x6445, "" }, +// { 0x6446, "" }, +// { 0x6447, "" }, +// { 0x6448, "" }, +// { 0x6449, "" }, + { 0x644A, "setup_player_usable_vehicle" }, +// { 0x644B, "" }, +// { 0x644C, "" }, +// { 0x644D, "" }, +// { 0x644E, "" }, +// { 0x644F, "" }, +// { 0x6450, "" }, +// { 0x6451, "" }, +// { 0x6452, "" }, +// { 0x6453, "" }, +// { 0x6454, "" }, +// { 0x6455, "" }, +// { 0x6456, "" }, +// { 0x6457, "" }, +// { 0x6458, "" }, +// { 0x6459, "" }, + { 0x645A, "calculateangularrotation" }, +// { 0x645B, "" }, +// { 0x645C, "" }, +// { 0x645D, "" }, +// { 0x645E, "" }, + { 0x645F, "handlesonartargetdeath" }, + { 0x6460, "handlesonarsubdeath" }, +// { 0x6461, "" }, +// { 0x6462, "" }, +// { 0x6463, "" }, +// { 0x6464, "" }, + { 0x6465, "addsonarsubtarget" }, +// { 0x6466, "" }, +// { 0x6467, "" }, + { 0x6468, "sonar_still_active" }, + { 0x6469, "sonar_active" }, + { 0x646A, "sonar_type" }, + { 0x646B, "sonar_effect" }, +// { 0x646C, "" }, +// { 0x646D, "" }, +// { 0x646E, "" }, +// { 0x646F, "" }, +// { 0x6470, "" }, +// { 0x6471, "" }, +// { 0x6472, "" }, +// { 0x6473, "" }, +// { 0x6474, "" }, +// { 0x6475, "" }, +// { 0x6476, "" }, +// { 0x6477, "" }, +// { 0x6478, "" }, +// { 0x6479, "" }, +// { 0x647A, "" }, +// { 0x647B, "" }, +// { 0x647C, "" }, +// { 0x647D, "" }, +// { 0x647E, "" }, +// { 0x647F, "" }, +// { 0x6480, "" }, +// { 0x6481, "" }, +// { 0x6482, "" }, +// { 0x6483, "" }, +// { 0x6484, "" }, +// { 0x6485, "" }, +// { 0x6486, "" }, +// { 0x6487, "" }, +// { 0x6488, "" }, +// { 0x6489, "" }, +// { 0x648A, "" }, +// { 0x648B, "" }, +// { 0x648C, "" }, +// { 0x648D, "" }, +// { 0x648E, "" }, +// { 0x648F, "" }, + { 0x6490, "sonar_init_lrsignal" }, +// { 0x6491, "" }, +// { 0x6492, "" }, +// { 0x6493, "" }, +// { 0x6494, "" }, + { 0x6495, "ref_tag" }, +// { 0x6496, "" }, +// { 0x6497, "" }, + { 0x6498, "sdvfontwidth" }, + { 0x6499, "debugaxis" }, +// { 0x649A, "" }, +// { 0x649B, "" }, +// { 0x649C, "" }, +// { 0x649D, "" }, +// { 0x649E, "" }, +// { 0x649F, "" }, +// { 0x64A0, "" }, +// { 0x64A1, "" }, + { 0x64A2, "transfersdvhud" }, +// { 0x64A3, "" }, + { 0x64A4, "sdv_with_hud" }, +// { 0x64A5, "" }, + { 0x64A6, "flush_sdv_hud" }, +// { 0x64A7, "" }, +// { 0x64A8, "" }, +// { 0x64A9, "" }, +// { 0x64AA, "" }, +// { 0x64AB, "" }, +// { 0x64AC, "" }, +// { 0x64AD, "" }, +// { 0x64AE, "" }, +// { 0x64AF, "" }, +// { 0x64B0, "" }, +// { 0x64B1, "" }, +// { 0x64B2, "" }, +// { 0x64B3, "" }, + { 0x64B4, "sub_ride_turn_settings_afterburner" }, + { 0x64B5, "sub_ride_init" }, +// { 0x64B6, "" }, +// { 0x64B7, "" }, +// { 0x64B8, "" }, + { 0x64B9, "alterfloatsaveddvar" }, +// { 0x64BA, "" }, +// { 0x64BB, "" }, +// { 0x64BC, "" }, +// { 0x64BD, "" }, +// { 0x64BE, "" }, +// { 0x64BF, "" }, +// { 0x64C0, "" }, +// { 0x64C1, "" }, + { 0x64C2, "other_sdv02" }, + { 0x64C3, "sdvarray_alt" }, +// { 0x64C4, "" }, +// { 0x64C5, "" }, + { 0x64C6, "realtime_light_tag" }, + { 0x64C7, "hide_zodiac_ships" }, + { 0x64C8, "populate_floaters" }, +// { 0x64C9, "" }, +// { 0x64CA, "" }, +// { 0x64CB, "" }, +// { 0x64CC, "" }, +// { 0x64CD, "" }, +// { 0x64CE, "" }, +// { 0x64CF, "" }, +// { 0x64D0, "" }, +// { 0x64D1, "" }, + { 0x64D2, "allow_player_to_lookaround_during_tunnel_intro" }, +// { 0x64D3, "" }, + { 0x64D4, "not_driving" }, + { 0x64D5, "wait_to_delete_grate" }, + { 0x64D6, "fix_stances" }, +// { 0x64D7, "" }, +// { 0x64D8, "" }, +// { 0x64D9, "" }, +// { 0x64DA, "" }, +// { 0x64DB, "" }, +// { 0x64DC, "" }, +// { 0x64DD, "" }, + { 0x64DE, "throttlebuttonpressedxenon_cb" }, +// { 0x64DF, "" }, +// { 0x64E0, "" }, +// { 0x64E1, "" }, +// { 0x64E2, "" }, +// { 0x64E3, "" }, +// { 0x64E4, "" }, + { 0x64E5, "throttle_pressed_fnc" }, +// { 0x64E6, "" }, +// { 0x64E7, "" }, +// { 0x64E8, "" }, +// { 0x64E9, "" }, +// { 0x64EA, "" }, + { 0x64EB, "move_player_out_of_vent" }, +// { 0x64EC, "" }, +// { 0x64ED, "" }, +// { 0x64EE, "" }, +// { 0x64EF, "" }, +// { 0x64F0, "" }, +// { 0x64F1, "" }, +// { 0x64F2, "" }, + { 0x64F3, "scubamask_on_player" }, +// { 0x64F4, "" }, +// { 0x64F5, "" }, + { 0x64F6, "scubamask_breathing" }, +// { 0x64F7, "" }, + { 0x64F8, "submine_waitfor_trigger" }, +// { 0x64F9, "" }, +// { 0x64FA, "" }, +// { 0x64FB, "" }, +// { 0x64FC, "" }, +// { 0x64FD, "" }, +// { 0x64FE, "" }, +// { 0x64FF, "" }, + { 0x6500, "watch_object" }, +// { 0x6501, "" }, +// { 0x6502, "" }, +// { 0x6503, "" }, + { 0x6504, "turn_on_light_on_mine" }, + { 0x6505, "getbodyspaceposition" }, +// { 0x6506, "" }, +// { 0x6507, "" }, +// { 0x6508, "" }, + { 0x6509, "submine_waitfor_plant" }, +// { 0x650A, "" }, + { 0x650B, "sub_breach_sub" }, +// { 0x650C, "" }, +// { 0x650D, "" }, + { 0x650E, "sub_breach_player" }, + { 0x650F, "sub_breach_ally" }, +// { 0x6510, "" }, +// { 0x6511, "" }, +// { 0x6512, "" }, + { 0x6513, "grinch_submine_plant" }, +// { 0x6514, "" }, +// { 0x6515, "" }, + { 0x6516, "ally_submine_plant" }, + { 0x6517, "move_close_and_link_end_early" }, +// { 0x6518, "" }, +// { 0x6519, "" }, +// { 0x651A, "" }, +// { 0x651B, "" }, +// { 0x651C, "" }, + { 0x651D, "toggle_lights" }, +// { 0x651E, "" }, +// { 0x651F, "" }, +// { 0x6520, "" }, +// { 0x6521, "" }, +// { 0x6522, "" }, +// { 0x6523, "" }, +// { 0x6524, "" }, +// { 0x6525, "" }, +// { 0x6526, "" }, + { 0x6527, "bob_player_sdv" }, +// { 0x6528, "" }, + { 0x6529, "monitor_propeller_vibration" }, +// { 0x652A, "" }, +// { 0x652B, "" }, +// { 0x652C, "" }, + { 0x652D, "submarine_spawn02" }, +// { 0x652E, "" }, +// { 0x652F, "" }, +// { 0x6530, "" }, + { 0x6531, "set_dvar_overtime" }, +// { 0x6532, "" }, +// { 0x6533, "" }, + { 0x6534, "wait_to_turn_on_players_light" }, + { 0x6535, "wait_player_enter" }, + { 0x6536, "lead_sdv_beacon" }, +// { 0x6537, "" }, +// { 0x6538, "" }, +// { 0x6539, "" }, + { 0x653A, "initiate_friendly_sdvs" }, +// { 0x653B, "" }, +// { 0x653C, "" }, +// { 0x653D, "" }, +// { 0x653E, "" }, + { 0x653F, "sdv_wait_for_player_dist" }, +// { 0x6540, "" }, +// { 0x6541, "" }, +// { 0x6542, "" }, +// { 0x6543, "" }, +// { 0x6544, "" }, +// { 0x6545, "" }, +// { 0x6546, "" }, +// { 0x6547, "" }, +// { 0x6548, "" }, + { 0x6549, "wait_for_lead_sdv_to_reach_end" }, +// { 0x654A, "" }, + { 0x654B, "control_sdv_lights" }, +// { 0x654C, "" }, +// { 0x654D, "" }, +// { 0x654E, "" }, +// { 0x654F, "" }, +// { 0x6550, "" }, + { 0x6551, "cull_dist" }, + { 0x6552, "underwater_fog_approaching_rig" }, + { 0x6553, "setup_viewdependent_fog_vision" }, +// { 0x6554, "" }, + { 0x6555, "dp_depths" }, +// { 0x6556, "" }, +// { 0x6557, "" }, +// { 0x6558, "" }, + { 0x6559, "debug_fdfv" }, +// { 0x655A, "" }, +// { 0x655B, "" }, +// { 0x655C, "" }, +// { 0x655D, "" }, +// { 0x655E, "" }, +// { 0x655F, "" }, +// { 0x6560, "" }, +// { 0x6561, "" }, + { 0x6562, "move_ent_along_entpath" }, +// { 0x6563, "" }, +// { 0x6564, "" }, +// { 0x6565, "" }, +// { 0x6566, "" }, +// { 0x6567, "" }, +// { 0x6568, "" }, +// { 0x6569, "" }, + { 0x656A, "sub_mine_planted" }, + { 0x656B, "should_break_drive_zodiac" }, +// { 0x656C, "" }, +// { 0x656D, "" }, +// { 0x656E, "" }, +// { 0x656F, "" }, +// { 0x6570, "" }, +// { 0x6571, "" }, +// { 0x6572, "" }, +// { 0x6573, "" }, +// { 0x6574, "" }, +// { 0x6575, "" }, +// { 0x6576, "" }, +// { 0x6577, "" }, + { 0x6578, "ny_harbor_exit_dof" }, +// { 0x6579, "" }, +// { 0x657A, "" }, + { 0x657B, "obj_capture_sub" }, +// { 0x657C, "" }, +// { 0x657D, "" }, +// { 0x657E, "" }, +// { 0x657F, "" }, +// { 0x6580, "" }, +// { 0x6581, "" }, +// { 0x6582, "" }, +// { 0x6583, "" }, +// { 0x6584, "" }, +// { 0x6585, "" }, +// { 0x6586, "" }, +// { 0x6587, "" }, +// { 0x6588, "" }, +// { 0x6589, "" }, +// { 0x658A, "" }, +// { 0x658B, "" }, +// { 0x658C, "" }, +// { 0x658D, "" }, +// { 0x658E, "" }, +// { 0x658F, "" }, +// { 0x6590, "" }, + { 0x6591, "play_custom_animation" }, +// { 0x6592, "" }, +// { 0x6593, "" }, +// { 0x6594, "" }, +// { 0x6595, "" }, +// { 0x6596, "" }, + { 0x6597, "reset_breach" }, + { 0x6598, "close_door" }, + { 0x6599, "debug_breach_done" }, +// { 0x659A, "" }, +// { 0x659B, "" }, + { 0x659C, "load_vehicle_anims" }, + { 0x659D, "load_script_model_anims" }, +// { 0x659E, "" }, +// { 0x659F, "" }, +// { 0x65A0, "" }, +// { 0x65A1, "" }, +// { 0x65A2, "" }, +// { 0x65A3, "" }, +// { 0x65A4, "" }, +// { 0x65A5, "" }, +// { 0x65A6, "" }, +// { 0x65A7, "" }, +// { 0x65A8, "" }, +// { 0x65A9, "" }, + { 0x65AA, "attach_knife" }, +// { 0x65AB, "" }, + { 0x65AC, "detach_knife" }, + { 0x65AD, "stab_knife" }, +// { 0x65AE, "" }, +// { 0x65AF, "" }, +// { 0x65B0, "" }, + { 0x65B1, "kick_church_doors" }, +// { 0x65B2, "" }, +// { 0x65B3, "" }, +// { 0x65B4, "" }, +// { 0x65B5, "" }, +// { 0x65B6, "" }, + { 0x65B7, "intro_line_1" }, +// { 0x65B8, "" }, +// { 0x65B9, "" }, + { 0x65BA, "play_splash_2" }, + { 0x65BB, "roof_fall_land" }, + { 0x65BC, "roof_fall_slowmo" }, +// { 0x65BD, "" }, +// { 0x65BE, "" }, +// { 0x65BF, "" }, +// { 0x65C0, "" }, + { 0x65C1, "debug_draw_point" }, + { 0x65C2, "create_exploder_id" }, +// { 0x65C3, "" }, +// { 0x65C4, "" }, +// { 0x65C5, "" }, +// { 0x65C6, "" }, + { 0x65C7, "show_warning_indicator" }, +// { 0x65C8, "" }, +// { 0x65C9, "" }, +// { 0x65CA, "" }, +// { 0x65CB, "" }, +// { 0x65CC, "" }, + { 0x65CD, "move_entity_to_start" }, +// { 0x65CE, "" }, + { 0x65CF, "wait_use_button_down" }, + { 0x65D0, "warlord_waterfx" }, +// { 0x65D1, "" }, + { 0x65D2, "sbmodel_rotate" }, + { 0x65D3, "og_angles" }, +// { 0x65D4, "" }, +// { 0x65D5, "" }, +// { 0x65D6, "" }, +// { 0x65D7, "" }, +// { 0x65D8, "" }, +// { 0x65D9, "" }, +// { 0x65DA, "" }, +// { 0x65DB, "" }, +// { 0x65DC, "" }, +// { 0x65DD, "" }, +// { 0x65DE, "" }, +// { 0x65DF, "" }, +// { 0x65E0, "" }, +// { 0x65E1, "" }, +// { 0x65E2, "" }, + { 0x65E3, "marked_for_death" }, +// { 0x65E4, "" }, +// { 0x65E5, "" }, + { 0x65E6, "field_count" }, +// { 0x65E7, "" }, +// { 0x65E8, "" }, +// { 0x65E9, "" }, +// { 0x65EA, "" }, +// { 0x65EB, "" }, +// { 0x65EC, "" }, +// { 0x65ED, "" }, +// { 0x65EE, "" }, +// { 0x65EF, "" }, + { 0x65F0, "manage_overlapping_flag_trigger" }, + { 0x65F1, "flag_trigger_count" }, +// { 0x65F2, "" }, +// { 0x65F3, "" }, +// { 0x65F4, "" }, +// { 0x65F5, "" }, +// { 0x65F6, "" }, + { 0x65F7, "stealth_technical_rider" }, +// { 0x65F8, "" }, +// { 0x65F9, "" }, +// { 0x65FA, "" }, +// { 0x65FB, "" }, +// { 0x65FC, "" }, +// { 0x65FD, "" }, +// { 0x65FE, "" }, +// { 0x65FF, "" }, +// { 0x6600, "" }, +// { 0x6601, "" }, +// { 0x6602, "" }, +// { 0x6603, "" }, +// { 0x6604, "" }, +// { 0x6605, "" }, +// { 0x6606, "" }, +// { 0x6607, "" }, +// { 0x6608, "" }, +// { 0x6609, "" }, +// { 0x660A, "" }, +// { 0x660B, "" }, +// { 0x660C, "" }, +// { 0x660D, "" }, +// { 0x660E, "" }, +// { 0x660F, "" }, +// { 0x6610, "" }, +// { 0x6611, "" }, +// { 0x6612, "" }, +// { 0x6613, "" }, +// { 0x6614, "" }, +// { 0x6615, "" }, +// { 0x6616, "" }, +// { 0x6617, "" }, +// { 0x6618, "" }, +// { 0x6619, "" }, +// { 0x661A, "" }, +// { 0x661B, "" }, +// { 0x661C, "" }, +// { 0x661D, "" }, +// { 0x661E, "" }, +// { 0x661F, "" }, +// { 0x6620, "" }, +// { 0x6621, "" }, +// { 0x6622, "" }, +// { 0x6623, "" }, +// { 0x6624, "" }, +// { 0x6625, "" }, +// { 0x6626, "" }, + { 0x6627, "technical_rider_animation_wrapper" }, +// { 0x6628, "" }, +// { 0x6629, "" }, +// { 0x662A, "" }, +// { 0x662B, "" }, +// { 0x662C, "" }, + { 0x662D, "objective_overwatch" }, +// { 0x662E, "" }, +// { 0x662F, "" }, +// { 0x6630, "" }, +// { 0x6631, "" }, + { 0x6632, "objective_evade_mortar" }, + { 0x6633, "objective_use_mortar" }, +// { 0x6634, "" }, +// { 0x6635, "" }, +// { 0x6636, "" }, +// { 0x6637, "" }, +// { 0x6638, "" }, +// { 0x6639, "" }, +// { 0x663A, "" }, +// { 0x663B, "" }, +// { 0x663C, "" }, + { 0x663D, "hint_string" }, +// { 0x663E, "" }, +// { 0x663F, "" }, +// { 0x6640, "" }, + { 0x6641, "camera_view_angle_bottom" }, +// { 0x6642, "" }, +// { 0x6643, "" }, +// { 0x6644, "" }, +// { 0x6645, "" }, +// { 0x6646, "" }, +// { 0x6647, "" }, +// { 0x6648, "" }, +// { 0x6649, "" }, + { 0x664A, "damage_range" }, +// { 0x664B, "" }, + { 0x664C, "damage_min" }, + { 0x664D, "max_ammo" }, +// { 0x664E, "" }, +// { 0x664F, "" }, +// { 0x6650, "" }, +// { 0x6651, "" }, +// { 0x6652, "" }, +// { 0x6653, "" }, +// { 0x6654, "" }, +// { 0x6655, "" }, + { 0x6656, "wait_until_done" }, +// { 0x6657, "" }, +// { 0x6658, "" }, +// { 0x6659, "" }, +// { 0x665A, "" }, +// { 0x665B, "" }, +// { 0x665C, "" }, +// { 0x665D, "" }, +// { 0x665E, "" }, +// { 0x665F, "" }, +// { 0x6660, "" }, +// { 0x6661, "" }, +// { 0x6662, "" }, +// { 0x6663, "" }, +// { 0x6664, "" }, + { 0x6665, "unequip_mortar" }, +// { 0x6666, "" }, +// { 0x6667, "" }, +// { 0x6668, "" }, +// { 0x6669, "" }, +// { 0x666A, "" }, +// { 0x666B, "" }, +// { 0x666C, "" }, +// { 0x666D, "" }, + { 0x666E, "play_crank_idle" }, +// { 0x666F, "" }, +// { 0x6670, "" }, +// { 0x6671, "" }, +// { 0x6672, "" }, +// { 0x6673, "" }, +// { 0x6674, "" }, +// { 0x6675, "" }, +// { 0x6676, "" }, +// { 0x6677, "" }, +// { 0x6678, "" }, + { 0x6679, "total_air_time" }, + { 0x667A, "mortar_aim_fire_velocity" }, +// { 0x667B, "" }, +// { 0x667C, "" }, +// { 0x667D, "" }, +// { 0x667E, "" }, +// { 0x667F, "" }, + { 0x6680, "fire_blur" }, + { 0x6681, "fire_mortar" }, + { 0x6682, "mortar_shots" }, +// { 0x6683, "" }, +// { 0x6684, "" }, +// { 0x6685, "" }, +// { 0x6686, "" }, +// { 0x6687, "" }, +// { 0x6688, "" }, +// { 0x6689, "" }, + { 0x668A, "draw_circle" }, +// { 0x668B, "" }, +// { 0x668C, "" }, +// { 0x668D, "" }, +// { 0x668E, "" }, +// { 0x668F, "" }, +// { 0x6690, "" }, +// { 0x6691, "" }, +// { 0x6692, "" }, +// { 0x6693, "" }, +// { 0x6694, "" }, +// { 0x6695, "" }, + { 0x6696, "intro_lock_player_view" }, +// { 0x6697, "" }, +// { 0x6698, "" }, + { 0x6699, "player_in_water_trigger" }, +// { 0x669A, "" }, +// { 0x669B, "" }, +// { 0x669C, "" }, +// { 0x669D, "" }, +// { 0x669E, "" }, +// { 0x669F, "" }, +// { 0x66A0, "" }, +// { 0x66A1, "" }, +// { 0x66A2, "" }, +// { 0x66A3, "" }, + { 0x66A4, "river_mantle_brush" }, + { 0x66A5, "monitor_river_mantle_brush" }, + { 0x66A6, "stealth_death_hint_technicals" }, +// { 0x66A7, "" }, + { 0x66A8, "play_soap_crouch_idle" }, + { 0x66A9, "ally_can_push_player" }, +// { 0x66AA, "" }, +// { 0x66AB, "" }, + { 0x66AC, "path_after_vehicle_exit" }, + { 0x66AD, "river_technicals_encounter_ranges" }, + { 0x66AE, "reset_on_enemy_bad_event" }, +// { 0x66AF, "" }, +// { 0x66B0, "" }, +// { 0x66B1, "" }, +// { 0x66B2, "" }, +// { 0x66B3, "" }, +// { 0x66B4, "" }, + { 0x66B5, "monitor_river_encounter_end" }, +// { 0x66B6, "" }, + { 0x66B7, "dummy_turret_target" }, +// { 0x66B8, "" }, +// { 0x66B9, "" }, +// { 0x66BA, "" }, +// { 0x66BB, "" }, +// { 0x66BC, "" }, + { 0x66BD, "play_pulldown_kill" }, +// { 0x66BE, "" }, +// { 0x66BF, "" }, +// { 0x66C0, "" }, + { 0x66C1, "switch_run_on_alert" }, + { 0x66C2, "river_technical_patroller_end" }, +// { 0x66C3, "" }, +// { 0x66C4, "" }, +// { 0x66C5, "" }, +// { 0x66C6, "" }, +// { 0x66C7, "" }, + { 0x66C8, "get_hint_from_map" }, +// { 0x66C9, "" }, + { 0x66CA, "display_hint_from_map" }, +// { 0x66CB, "" }, +// { 0x66CC, "" }, +// { 0x66CD, "" }, +// { 0x66CE, "" }, + { 0x66CF, "price_play_log_anims" }, + { 0x66D0, "soap_play_log_anims" }, +// { 0x66D1, "" }, +// { 0x66D2, "" }, +// { 0x66D3, "" }, +// { 0x66D4, "" }, +// { 0x66D5, "" }, +// { 0x66D6, "" }, +// { 0x66D7, "" }, +// { 0x66D8, "" }, +// { 0x66D9, "" }, +// { 0x66DA, "" }, +// { 0x66DB, "" }, +// { 0x66DC, "" }, +// { 0x66DD, "" }, + { 0x66DE, "price_sees_enemy" }, +// { 0x66DF, "" }, +// { 0x66E0, "" }, +// { 0x66E1, "" }, +// { 0x66E2, "" }, + { 0x66E3, "play_jeer_anims" }, + { 0x66E4, "play_jeer_loop" }, +// { 0x66E5, "" }, +// { 0x66E6, "" }, +// { 0x66E7, "" }, +// { 0x66E8, "" }, + { 0x66E9, "ally_get_to_burn" }, + { 0x66EA, "wait_for_burn_to_end" }, + { 0x66EB, "village_corpse" }, +// { 0x66EC, "" }, + { 0x66ED, "burn_guard" }, +// { 0x66EE, "" }, +// { 0x66EF, "" }, +// { 0x66F0, "" }, +// { 0x66F1, "" }, +// { 0x66F2, "" }, +// { 0x66F3, "" }, +// { 0x66F4, "" }, +// { 0x66F5, "" }, +// { 0x66F6, "" }, +// { 0x66F7, "" }, +// { 0x66F8, "" }, +// { 0x66F9, "" }, +// { 0x66FA, "" }, +// { 0x66FB, "" }, +// { 0x66FC, "" }, +// { 0x66FD, "" }, +// { 0x66FE, "" }, +// { 0x66FF, "" }, + { 0x6700, "wait_to_unlink_gas_can" }, +// { 0x6701, "" }, +// { 0x6702, "" }, +// { 0x6703, "" }, + { 0x6704, "river_house_burn_watchers_setup" }, +// { 0x6705, "" }, +// { 0x6706, "" }, +// { 0x6707, "" }, +// { 0x6708, "" }, + { 0x6709, "ignoreme_while_stealth" }, +// { 0x670A, "" }, + { 0x670B, "river_big_moment" }, +// { 0x670C, "" }, +// { 0x670D, "" }, +// { 0x670E, "" }, +// { 0x670F, "" }, +// { 0x6710, "" }, +// { 0x6711, "" }, + { 0x6712, "wait_for_execution_interrupt" }, +// { 0x6713, "" }, + { 0x6714, "post_execution_patrol" }, +// { 0x6715, "" }, + { 0x6716, "river_big_moment_music_busted" }, +// { 0x6717, "" }, + { 0x6718, "river_big_moment_detected" }, +// { 0x6719, "" }, +// { 0x671A, "" }, +// { 0x671B, "" }, +// { 0x671C, "" }, +// { 0x671D, "" }, +// { 0x671E, "" }, +// { 0x671F, "" }, +// { 0x6720, "" }, +// { 0x6721, "" }, + { 0x6722, "setup_river_big_moment_guys" }, +// { 0x6723, "" }, +// { 0x6724, "" }, +// { 0x6725, "" }, +// { 0x6726, "" }, +// { 0x6727, "" }, +// { 0x6728, "" }, +// { 0x6729, "" }, +// { 0x672A, "" }, +// { 0x672B, "" }, +// { 0x672C, "" }, +// { 0x672D, "" }, +// { 0x672E, "" }, +// { 0x672F, "" }, +// { 0x6730, "" }, +// { 0x6731, "" }, +// { 0x6732, "" }, +// { 0x6733, "" }, +// { 0x6734, "" }, +// { 0x6735, "" }, +// { 0x6736, "" }, +// { 0x6737, "" }, +// { 0x6738, "" }, +// { 0x6739, "" }, +// { 0x673A, "" }, + { 0x673B, "no_prone_hint" }, +// { 0x673C, "" }, +// { 0x673D, "" }, + { 0x673E, "prone_autosave" }, +// { 0x673F, "" }, + { 0x6740, "aud_river_big_moment_grass_player_prone" }, +// { 0x6741, "" }, +// { 0x6742, "" }, + { 0x6743, "river_prone_patrol_setup" }, +// { 0x6744, "" }, +// { 0x6745, "" }, +// { 0x6746, "" }, +// { 0x6747, "" }, +// { 0x6748, "" }, + { 0x6749, "river_moment_end_guys_setup" }, +// { 0x674A, "" }, +// { 0x674B, "" }, +// { 0x674C, "" }, +// { 0x674D, "" }, +// { 0x674E, "" }, +// { 0x674F, "" }, +// { 0x6750, "" }, +// { 0x6751, "" }, +// { 0x6752, "" }, + { 0x6753, "watch_for_premature_bridge_death" }, +// { 0x6754, "" }, +// { 0x6755, "" }, +// { 0x6756, "" }, +// { 0x6757, "" }, + { 0x6758, "river_cleanup" }, +// { 0x6759, "" }, + { 0x675A, "wait_and_play_anim" }, +// { 0x675B, "" }, +// { 0x675C, "" }, +// { 0x675D, "" }, +// { 0x675E, "" }, +// { 0x675F, "" }, +// { 0x6760, "" }, +// { 0x6761, "" }, +// { 0x6762, "" }, +// { 0x6763, "" }, +// { 0x6764, "" }, +// { 0x6765, "" }, +// { 0x6766, "" }, +// { 0x6767, "" }, +// { 0x6768, "" }, +// { 0x6769, "" }, + { 0x676A, "start_inf_stealth" }, +// { 0x676B, "" }, +// { 0x676C, "" }, +// { 0x676D, "" }, +// { 0x676E, "" }, +// { 0x676F, "" }, +// { 0x6770, "" }, +// { 0x6771, "" }, + { 0x6772, "reach_price_corner_kill" }, + { 0x6773, "enemy_reach_price_corner_kill" }, +// { 0x6774, "" }, + { 0x6775, "monitor_price_door_trigger" }, + { 0x6776, "ally_post_corner_kill_move" }, +// { 0x6777, "" }, +// { 0x6778, "" }, +// { 0x6779, "" }, +// { 0x677A, "" }, +// { 0x677B, "" }, +// { 0x677C, "" }, +// { 0x677D, "" }, +// { 0x677E, "" }, +// { 0x677F, "" }, +// { 0x6780, "" }, +// { 0x6781, "" }, + { 0x6782, "anim_sleep" }, +// { 0x6783, "" }, + { 0x6784, "wait_for_waking_event" }, +// { 0x6785, "" }, +// { 0x6786, "" }, +// { 0x6787, "" }, +// { 0x6788, "" }, +// { 0x6789, "" }, + { 0x678A, "inf_guys" }, +// { 0x678B, "" }, +// { 0x678C, "" }, +// { 0x678D, "" }, + { 0x678E, "inf_house_guys_setup" }, + { 0x678F, "house_guy_ai" }, +// { 0x6790, "" }, +// { 0x6791, "" }, +// { 0x6792, "" }, +// { 0x6793, "" }, +// { 0x6794, "" }, +// { 0x6795, "" }, +// { 0x6796, "" }, +// { 0x6797, "" }, +// { 0x6798, "" }, +// { 0x6799, "" }, +// { 0x679A, "" }, +// { 0x679B, "" }, +// { 0x679C, "" }, +// { 0x679D, "" }, + { 0x679E, "inf_reinforce_end_guys" }, +// { 0x679F, "" }, +// { 0x67A0, "" }, +// { 0x67A1, "" }, +// { 0x67A2, "" }, +// { 0x67A3, "" }, +// { 0x67A4, "" }, + { 0x67A5, "show_switch_hint" }, + { 0x67A6, "yuri_advance" }, +// { 0x67A7, "" }, +// { 0x67A8, "" }, +// { 0x67A9, "" }, +// { 0x67AA, "" }, +// { 0x67AB, "" }, + { 0x67AC, "shoot_around_target" }, +// { 0x67AD, "" }, + { 0x67AE, "wait_til_advance_intro_over" }, +// { 0x67AF, "" }, +// { 0x67B0, "" }, + { 0x67B1, "move_guys_forward" }, +// { 0x67B2, "" }, +// { 0x67B3, "" }, + { 0x67B4, "monitor_advance_skip" }, +// { 0x67B5, "" }, +// { 0x67B6, "" }, +// { 0x67B7, "" }, +// { 0x67B8, "" }, +// { 0x67B9, "" }, +// { 0x67BA, "" }, +// { 0x67BB, "" }, +// { 0x67BC, "" }, +// { 0x67BD, "" }, +// { 0x67BE, "" }, +// { 0x67BF, "" }, + { 0x67C0, "monitor_path_end" }, +// { 0x67C1, "" }, +// { 0x67C2, "" }, +// { 0x67C3, "" }, +// { 0x67C4, "" }, + { 0x67C5, "setup_technical_technical" }, +// { 0x67C6, "" }, +// { 0x67C7, "" }, + { 0x67C8, "wait_for_path_end_or_death" }, +// { 0x67C9, "" }, +// { 0x67CA, "" }, +// { 0x67CB, "" }, +// { 0x67CC, "" }, +// { 0x67CD, "" }, +// { 0x67CE, "" }, +// { 0x67CF, "" }, +// { 0x67D0, "" }, + { 0x67D1, "spawn_behind_truck_guys" }, + { 0x67D2, "technical_combat_dialogue" }, +// { 0x67D3, "" }, +// { 0x67D4, "" }, +// { 0x67D5, "" }, +// { 0x67D6, "" }, +// { 0x67D7, "" }, +// { 0x67D8, "" }, + { 0x67D9, "technical_mortar_explosions" }, +// { 0x67DA, "" }, +// { 0x67DB, "" }, +// { 0x67DC, "" }, +// { 0x67DD, "" }, +// { 0x67DE, "" }, +// { 0x67DF, "" }, + { 0x67E0, "manage_wave_guy_count" }, + { 0x67E1, "manage_total_foot_guy_count" }, + { 0x67E2, "set_turret_death_anim" }, +// { 0x67E3, "" }, +// { 0x67E4, "" }, +// { 0x67E5, "" }, +// { 0x67E6, "" }, +// { 0x67E7, "" }, +// { 0x67E8, "" }, + { 0x67E9, "dead_gunner" }, +// { 0x67EA, "" }, +// { 0x67EB, "" }, +// { 0x67EC, "" }, + { 0x67ED, "player_use_technical_turret" }, +// { 0x67EE, "" }, +// { 0x67EF, "" }, +// { 0x67F0, "" }, +// { 0x67F1, "" }, + { 0x67F2, "crash_player_technical" }, +// { 0x67F3, "" }, +// { 0x67F4, "" }, +// { 0x67F5, "" }, +// { 0x67F6, "" }, +// { 0x67F7, "" }, +// { 0x67F8, "" }, +// { 0x67F9, "" }, +// { 0x67FA, "" }, + { 0x67FB, "clear_corpses" }, +// { 0x67FC, "" }, +// { 0x67FD, "" }, + { 0x67FE, "mortar_extend_timer_triggers" }, +// { 0x67FF, "" }, +// { 0x6800, "" }, +// { 0x6801, "" }, +// { 0x6802, "" }, + { 0x6803, "setup_mortar_badguys" }, + { 0x6804, "mortar_run_scripted_explosions" }, +// { 0x6805, "" }, +// { 0x6806, "" }, +// { 0x6807, "" }, +// { 0x6808, "" }, +// { 0x6809, "" }, + { 0x680A, "last_mortar_hit_react_time" }, + { 0x680B, "mortar_explosion_generic" }, +// { 0x680C, "" }, +// { 0x680D, "" }, +// { 0x680E, "" }, +// { 0x680F, "" }, +// { 0x6810, "" }, + { 0x6811, "mortar_roof" }, +// { 0x6812, "" }, + { 0x6813, "last_house" }, +// { 0x6814, "" }, +// { 0x6815, "" }, +// { 0x6816, "" }, +// { 0x6817, "" }, + { 0x6818, "fall_through_roof" }, +// { 0x6819, "" }, +// { 0x681A, "" }, +// { 0x681B, "" }, +// { 0x681C, "" }, + { 0x681D, "disonnect_path_on_death" }, + { 0x681E, "setup_mortar_motivation_guys" }, + { 0x681F, "mortar_motivation_guys" }, +// { 0x6820, "" }, +// { 0x6821, "" }, +// { 0x6822, "" }, +// { 0x6823, "" }, +// { 0x6824, "" }, +// { 0x6825, "" }, +// { 0x6826, "" }, + { 0x6827, "try_mortar_death" }, + { 0x6828, "setup_mortar_wave_guy" }, +// { 0x6829, "" }, +// { 0x682A, "" }, +// { 0x682B, "" }, +// { 0x682C, "" }, +// { 0x682D, "" }, +// { 0x682E, "" }, +// { 0x682F, "" }, +// { 0x6830, "" }, +// { 0x6831, "" }, +// { 0x6832, "" }, +// { 0x6833, "" }, +// { 0x6834, "" }, +// { 0x6835, "" }, +// { 0x6836, "" }, +// { 0x6837, "" }, +// { 0x6838, "" }, +// { 0x6839, "" }, +// { 0x683A, "" }, + { 0x683B, "assault_door_kick" }, +// { 0x683C, "" }, +// { 0x683D, "" }, +// { 0x683E, "" }, +// { 0x683F, "" }, + { 0x6840, "ally_heat_behavior" }, +// { 0x6841, "" }, +// { 0x6842, "" }, +// { 0x6843, "" }, + { 0x6844, "assault_door_spawners" }, +// { 0x6845, "" }, +// { 0x6846, "" }, +// { 0x6847, "" }, +// { 0x6848, "" }, +// { 0x6849, "" }, +// { 0x684A, "" }, +// { 0x684B, "" }, +// { 0x684C, "" }, +// { 0x684D, "" }, +// { 0x684E, "" }, + { 0x684F, "barrel_alternate_delay" }, +// { 0x6850, "" }, +// { 0x6851, "" }, +// { 0x6852, "" }, +// { 0x6853, "" }, +// { 0x6854, "" }, +// { 0x6855, "" }, +// { 0x6856, "" }, +// { 0x6857, "" }, +// { 0x6858, "" }, + { 0x6859, "change_goal_radius_on_goal" }, +// { 0x685A, "" }, +// { 0x685B, "" }, +// { 0x685C, "" }, + { 0x685D, "delete_roof_ai" }, +// { 0x685E, "" }, + { 0x685F, "turn_off_compound_triggers" }, +// { 0x6860, "" }, +// { 0x6861, "" }, +// { 0x6862, "" }, + { 0x6863, "church_guys" }, +// { 0x6864, "" }, +// { 0x6865, "" }, +// { 0x6866, "" }, +// { 0x6867, "" }, +// { 0x6868, "" }, +// { 0x6869, "" }, +// { 0x686A, "" }, +// { 0x686B, "" }, + { 0x686C, "warlord_confrontation" }, +// { 0x686D, "" }, +// { 0x686E, "" }, +// { 0x686F, "" }, +// { 0x6870, "" }, +// { 0x6871, "" }, +// { 0x6872, "" }, +// { 0x6873, "" }, +// { 0x6874, "" }, +// { 0x6875, "" }, +// { 0x6876, "" }, +// { 0x6877, "" }, +// { 0x6878, "" }, +// { 0x6879, "" }, +// { 0x687A, "" }, +// { 0x687B, "" }, +// { 0x687C, "" }, +// { 0x687D, "" }, + { 0x687E, "river_dialogue" }, +// { 0x687F, "" }, +// { 0x6880, "" }, +// { 0x6881, "" }, +// { 0x6882, "" }, +// { 0x6883, "" }, + { 0x6884, "stop_speaking" }, +// { 0x6885, "" }, + { 0x6886, "executing_civilians_dialogue" }, +// { 0x6887, "" }, +// { 0x6888, "" }, + { 0x6889, "river_big_moment_dialogue" }, +// { 0x688A, "" }, +// { 0x688B, "" }, +// { 0x688C, "" }, +// { 0x688D, "" }, +// { 0x688E, "" }, +// { 0x688F, "" }, + { 0x6890, "rally_on_me_dialogue" }, +// { 0x6891, "" }, +// { 0x6892, "" }, +// { 0x6893, "" }, +// { 0x6894, "" }, +// { 0x6895, "" }, +// { 0x6896, "" }, +// { 0x6897, "" }, + { 0x6898, "mortar_run_dialogue" }, +// { 0x6899, "" }, + { 0x689A, "vo_mortar_line" }, +// { 0x689B, "" }, +// { 0x689C, "" }, +// { 0x689D, "" }, +// { 0x689E, "" }, +// { 0x689F, "" }, +// { 0x68A0, "" }, +// { 0x68A1, "" }, +// { 0x68A2, "" }, +// { 0x68A3, "" }, +// { 0x68A4, "" }, +// { 0x68A5, "" }, +// { 0x68A6, "" }, +// { 0x68A7, "" }, + { 0x68A8, "warlord_stealth_intro" }, +// { 0x68A9, "" }, +// { 0x68AA, "" }, +// { 0x68AB, "" }, +// { 0x68AC, "" }, +// { 0x68AD, "" }, + { 0x68AE, "warlord_river_big_moment" }, +// { 0x68AF, "" }, +// { 0x68B0, "" }, +// { 0x68B1, "" }, +// { 0x68B2, "" }, +// { 0x68B3, "" }, +// { 0x68B4, "" }, +// { 0x68B5, "" }, +// { 0x68B6, "" }, +// { 0x68B7, "" }, +// { 0x68B8, "" }, +// { 0x68B9, "" }, +// { 0x68BA, "" }, +// { 0x68BB, "" }, +// { 0x68BC, "" }, + { 0x68BD, "start_super_technical" }, +// { 0x68BE, "" }, +// { 0x68BF, "" }, +// { 0x68C0, "" }, + { 0x68C1, "start_autosave" }, +// { 0x68C2, "" }, +// { 0x68C3, "" }, +// { 0x68C4, "" }, +// { 0x68C5, "" }, +// { 0x68C6, "" }, +// { 0x68C7, "" }, +// { 0x68C8, "" }, + { 0x68C9, "courtyard_dialog_intro" }, +// { 0x68CA, "" }, +// { 0x68CB, "" }, +// { 0x68CC, "" }, +// { 0x68CD, "" }, + { 0x68CE, "courtyard_dialog_watch_breach" }, +// { 0x68CF, "" }, +// { 0x68D0, "" }, +// { 0x68D1, "" }, +// { 0x68D2, "" }, +// { 0x68D3, "" }, +// { 0x68D4, "" }, +// { 0x68D5, "" }, +// { 0x68D6, "" }, +// { 0x68D7, "" }, +// { 0x68D8, "" }, +// { 0x68D9, "" }, +// { 0x68DA, "" }, +// { 0x68DB, "" }, +// { 0x68DC, "" }, +// { 0x68DD, "" }, + { 0x68DE, "regroup_dialog_get_to_shed_nag" }, +// { 0x68DF, "" }, +// { 0x68E0, "" }, +// { 0x68E1, "" }, +// { 0x68E2, "" }, +// { 0x68E3, "" }, +// { 0x68E4, "" }, +// { 0x68E5, "" }, +// { 0x68E6, "" }, +// { 0x68E7, "" }, + { 0x68E8, "maars_control_dialog_moving" }, +// { 0x68E9, "" }, +// { 0x68EA, "" }, +// { 0x68EB, "" }, +// { 0x68EC, "" }, +// { 0x68ED, "" }, +// { 0x68EE, "" }, +// { 0x68EF, "" }, +// { 0x68F0, "" }, +// { 0x68F1, "" }, +// { 0x68F2, "" }, +// { 0x68F3, "" }, +// { 0x68F4, "" }, +// { 0x68F5, "" }, +// { 0x68F6, "" }, + { 0x68F7, "specialkeys" }, +// { 0x68F8, "" }, +// { 0x68F9, "" }, +// { 0x68FA, "" }, +// { 0x68FB, "" }, +// { 0x68FC, "" }, +// { 0x68FD, "" }, +// { 0x68FE, "" }, +// { 0x68FF, "" }, +// { 0x6900, "" }, +// { 0x6901, "" }, + { 0x6902, "play_loop_solo_stoppable" }, + { 0x6903, "also_stop_loop_on" }, +// { 0x6904, "" }, +// { 0x6905, "" }, +// { 0x6906, "" }, +// { 0x6907, "" }, +// { 0x6908, "" }, +// { 0x6909, "" }, +// { 0x690A, "" }, + { 0x690B, "custom_glass_think" }, +// { 0x690C, "" }, +// { 0x690D, "" }, +// { 0x690E, "" }, +// { 0x690F, "" }, +// { 0x6910, "" }, +// { 0x6911, "" }, +// { 0x6912, "" }, +// { 0x6913, "" }, +// { 0x6914, "" }, +// { 0x6915, "" }, +// { 0x6916, "" }, + { 0x6917, "price_pistolfire" }, +// { 0x6918, "" }, +// { 0x6919, "" }, +// { 0x691A, "" }, +// { 0x691B, "" }, + { 0x691C, "courtyard_brick_impacts" }, + { 0x691D, "enemies_compound_door_breach" }, +// { 0x691E, "" }, +// { 0x691F, "" }, +// { 0x6920, "" }, +// { 0x6921, "" }, +// { 0x6922, "" }, +// { 0x6923, "" }, +// { 0x6924, "" }, +// { 0x6925, "" }, +// { 0x6926, "" }, + { 0x6927, "price_compound_door_breach" }, +// { 0x6928, "" }, + { 0x6929, "slide_window_fires_explosions" }, +// { 0x692A, "" }, +// { 0x692B, "" }, +// { 0x692C, "" }, +// { 0x692D, "" }, + { 0x692E, "slide_player_dust_hands" }, +// { 0x692F, "" }, +// { 0x6930, "" }, +// { 0x6931, "" }, +// { 0x6932, "" }, +// { 0x6933, "" }, +// { 0x6934, "" }, +// { 0x6935, "" }, +// { 0x6936, "" }, +// { 0x6937, "" }, +// { 0x6938, "" }, +// { 0x6939, "" }, +// { 0x693A, "" }, +// { 0x693B, "" }, +// { 0x693C, "" }, +// { 0x693D, "" }, +// { 0x693E, "" }, +// { 0x693F, "" }, +// { 0x6940, "" }, +// { 0x6941, "" }, +// { 0x6942, "" }, + { 0x6943, "fxwaterheater" }, +// { 0x6944, "" }, +// { 0x6945, "" }, +// { 0x6946, "" }, + { 0x6947, "maars_buildingslide_dirtchunkfx" }, + { 0x6948, "maars_buildingslide_moment_windows" }, +// { 0x6949, "" }, +// { 0x694A, "" }, +// { 0x694B, "" }, +// { 0x694C, "" }, +// { 0x694D, "" }, + { 0x694E, "maars_buildingslide_chunkshadowsthread" }, + { 0x694F, "maars_buildingslide_chunkshadows" }, +// { 0x6950, "" }, +// { 0x6951, "" }, +// { 0x6952, "" }, + { 0x6953, "maars_buildingslide_moment" }, +// { 0x6954, "" }, +// { 0x6955, "" }, + { 0x6956, "water_emerge" }, +// { 0x6957, "" }, +// { 0x6958, "" }, +// { 0x6959, "" }, +// { 0x695A, "" }, +// { 0x695B, "" }, +// { 0x695C, "" }, +// { 0x695D, "" }, +// { 0x695E, "" }, +// { 0x695F, "" }, +// { 0x6960, "" }, +// { 0x6961, "" }, +// { 0x6962, "" }, +// { 0x6963, "" }, +// { 0x6964, "" }, +// { 0x6965, "" }, +// { 0x6966, "" }, +// { 0x6967, "" }, +// { 0x6968, "" }, +// { 0x6969, "" }, +// { 0x696A, "" }, +// { 0x696B, "" }, +// { 0x696C, "" }, +// { 0x696D, "" }, +// { 0x696E, "" }, + { 0x696F, "handle_idle_wounded_anims" }, + { 0x6970, "play_carry_wounded_idle" }, + { 0x6971, "synchronize_carry_anim" }, +// { 0x6972, "" }, +// { 0x6973, "" }, +// { 0x6974, "" }, +// { 0x6975, "" }, +// { 0x6976, "" }, +// { 0x6977, "" }, +// { 0x6978, "" }, +// { 0x6979, "" }, +// { 0x697A, "" }, +// { 0x697B, "" }, + { 0x697C, "animated_props" }, +// { 0x697D, "" }, + { 0x697E, "drone_anim" }, +// { 0x697F, "" }, +// { 0x6980, "" }, + { 0x6981, "maars_control_flashlight_on" }, +// { 0x6982, "" }, +// { 0x6983, "" }, +// { 0x6984, "" }, +// { 0x6985, "" }, +// { 0x6986, "" }, + { 0x6987, "fx_blood_cough" }, + { 0x6988, "start_slowmo" }, + { 0x6989, "end_slowmo" }, +// { 0x698A, "" }, +// { 0x698B, "" }, +// { 0x698C, "" }, +// { 0x698D, "" }, +// { 0x698E, "" }, +// { 0x698F, "" }, +// { 0x6990, "" }, +// { 0x6991, "" }, +// { 0x6992, "" }, +// { 0x6993, "" }, +// { 0x6994, "" }, +// { 0x6995, "" }, +// { 0x6996, "" }, +// { 0x6997, "" }, +// { 0x6998, "" }, +// { 0x6999, "" }, +// { 0x699A, "" }, +// { 0x699B, "" }, +// { 0x699C, "" }, +// { 0x699D, "" }, + { 0x699E, "set_casual_killer_run_n_gun" }, +// { 0x699F, "" }, +// { 0x69A0, "" }, +// { 0x69A1, "" }, +// { 0x69A2, "" }, +// { 0x69A3, "" }, +// { 0x69A4, "" }, +// { 0x69A5, "" }, +// { 0x69A6, "" }, +// { 0x69A7, "" }, +// { 0x69A8, "" }, +// { 0x69A9, "" }, +// { 0x69AA, "" }, +// { 0x69AB, "" }, +// { 0x69AC, "" }, +// { 0x69AD, "" }, +// { 0x69AE, "" }, + { 0x69AF, "detach_player_from_turret" }, +// { 0x69B0, "" }, +// { 0x69B1, "" }, +// { 0x69B2, "" }, +// { 0x69B3, "" }, +// { 0x69B4, "" }, + { 0x69B5, "player_ugv_health_hurtagain" }, +// { 0x69B6, "" }, +// { 0x69B7, "" }, +// { 0x69B8, "" }, +// { 0x69B9, "" }, +// { 0x69BA, "" }, +// { 0x69BB, "" }, +// { 0x69BC, "" }, +// { 0x69BD, "" }, + { 0x69BE, "detect_drone_death" }, +// { 0x69BF, "" }, +// { 0x69C0, "" }, +// { 0x69C1, "" }, +// { 0x69C2, "" }, +// { 0x69C3, "" }, +// { 0x69C4, "" }, +// { 0x69C5, "" }, +// { 0x69C6, "" }, + { 0x69C7, "maars_interface_boot_up" }, +// { 0x69C8, "" }, +// { 0x69C9, "" }, +// { 0x69CA, "" }, +// { 0x69CB, "" }, +// { 0x69CC, "" }, +// { 0x69CD, "" }, +// { 0x69CE, "" }, +// { 0x69CF, "" }, + { 0x69D0, "line_offset" }, +// { 0x69D1, "" }, +// { 0x69D2, "" }, +// { 0x69D3, "" }, +// { 0x69D4, "" }, +// { 0x69D5, "" }, +// { 0x69D6, "" }, + { 0x69D7, "update_loading_bar" }, +// { 0x69D8, "" }, + { 0x69D9, "maars_update_hud_arrows" }, + { 0x69DA, "maars_fire_m203" }, +// { 0x69DB, "" }, +// { 0x69DC, "" }, +// { 0x69DD, "" }, +// { 0x69DE, "" }, +// { 0x69DF, "" }, +// { 0x69E0, "" }, + { 0x69E1, "maars_damage_bullet" }, +// { 0x69E2, "" }, +// { 0x69E3, "" }, +// { 0x69E4, "" }, +// { 0x69E5, "" }, +// { 0x69E6, "" }, +// { 0x69E7, "" }, +// { 0x69E8, "" }, +// { 0x69E9, "" }, +// { 0x69EA, "" }, +// { 0x69EB, "" }, +// { 0x69EC, "" }, +// { 0x69ED, "" }, +// { 0x69EE, "" }, +// { 0x69EF, "" }, + { 0x69F0, "maars_interface_thermal_on" }, + { 0x69F1, "maars_interface_thermal_off" }, + { 0x69F2, "maars_setup_thermal" }, +// { 0x69F3, "" }, +// { 0x69F4, "" }, + { 0x69F5, "fire_grenade_hint" }, + { 0x69F6, "fire_grenade_hint_done" }, + { 0x69F7, "zoom_hint" }, + { 0x69F8, "maars_target_tracking" }, +// { 0x69F9, "" }, +// { 0x69FA, "" }, +// { 0x69FB, "" }, +// { 0x69FC, "" }, +// { 0x69FD, "" }, + { 0x69FE, "maars_remove_target" }, +// { 0x69FF, "" }, +// { 0x6A00, "" }, +// { 0x6A01, "" }, + { 0x6A02, "maars_incoming_missile" }, + { 0x6A03, "maars_incoming_missile_hud_flash" }, +// { 0x6A04, "" }, + { 0x6A05, "set_control_hint_string" }, +// { 0x6A06, "" }, +// { 0x6A07, "" }, +// { 0x6A08, "" }, +// { 0x6A09, "" }, + { 0x6A0A, "setup_hero_generic" }, +// { 0x6A0B, "" }, +// { 0x6A0C, "" }, +// { 0x6A0D, "" }, +// { 0x6A0E, "" }, +// { 0x6A0F, "" }, +// { 0x6A10, "" }, +// { 0x6A11, "" }, +// { 0x6A12, "" }, +// { 0x6A13, "" }, +// { 0x6A14, "" }, + { 0x6A15, "bystander4" }, +// { 0x6A16, "" }, +// { 0x6A17, "" }, +// { 0x6A18, "" }, +// { 0x6A19, "" }, +// { 0x6A1A, "" }, +// { 0x6A1B, "" }, +// { 0x6A1C, "" }, +// { 0x6A1D, "" }, + { 0x6A1E, "intro_shot_5" }, +// { 0x6A1F, "" }, +// { 0x6A20, "" }, +// { 0x6A21, "" }, +// { 0x6A22, "" }, +// { 0x6A23, "" }, +// { 0x6A24, "" }, + { 0x6A25, "cart" }, +// { 0x6A26, "" }, + { 0x6A27, "gauze" }, +// { 0x6A28, "" }, +// { 0x6A29, "" }, +// { 0x6A2A, "" }, +// { 0x6A2B, "" }, + { 0x6A2C, "intro_shot_anim_first_frame" }, +// { 0x6A2D, "" }, +// { 0x6A2E, "" }, + { 0x6A2F, "bloom_fadein" }, + { 0x6A30, "rotate_sun" }, +// { 0x6A31, "" }, +// { 0x6A32, "" }, +// { 0x6A33, "" }, +// { 0x6A34, "" }, +// { 0x6A35, "" }, +// { 0x6A36, "" }, +// { 0x6A37, "" }, + { 0x6A38, "dofstart" }, +// { 0x6A39, "" }, +// { 0x6A3A, "" }, +// { 0x6A3B, "" }, +// { 0x6A3C, "" }, +// { 0x6A3D, "" }, +// { 0x6A3E, "" }, +// { 0x6A3F, "" }, +// { 0x6A40, "" }, +// { 0x6A41, "" }, + { 0x6A42, "intro_fade_out_to_black" }, +// { 0x6A43, "" }, +// { 0x6A44, "" }, +// { 0x6A45, "" }, +// { 0x6A46, "" }, +// { 0x6A47, "" }, +// { 0x6A48, "" }, +// { 0x6A49, "" }, +// { 0x6A4A, "" }, +// { 0x6A4B, "" }, +// { 0x6A4C, "" }, +// { 0x6A4D, "" }, +// { 0x6A4E, "" }, +// { 0x6A4F, "" }, +// { 0x6A50, "" }, +// { 0x6A51, "" }, +// { 0x6A52, "" }, +// { 0x6A53, "" }, +// { 0x6A54, "" }, + { 0x6A55, "intro_tutorial_stand" }, + { 0x6A56, "intro_tutorial_shoot" }, +// { 0x6A57, "" }, +// { 0x6A58, "" }, + { 0x6A59, "intro_tutorial_shoot_ads_done" }, +// { 0x6A5A, "" }, +// { 0x6A5B, "" }, +// { 0x6A5C, "" }, +// { 0x6A5D, "" }, +// { 0x6A5E, "" }, +// { 0x6A5F, "" }, +// { 0x6A60, "" }, +// { 0x6A61, "" }, +// { 0x6A62, "" }, +// { 0x6A63, "" }, +// { 0x6A64, "" }, +// { 0x6A65, "" }, + { 0x6A66, "intro_tutorial_objectives_done" }, + { 0x6A67, "intro_tutorial_switch_weapons" }, +// { 0x6A68, "" }, + { 0x6A69, "courtyard_save" }, +// { 0x6A6A, "" }, +// { 0x6A6B, "" }, +// { 0x6A6C, "" }, + { 0x6A6D, "courtyard_combat" }, +// { 0x6A6E, "" }, +// { 0x6A6F, "" }, +// { 0x6A70, "" }, +// { 0x6A71, "" }, +// { 0x6A72, "" }, + { 0x6A73, "courtyard_spawn_cleanup" }, +// { 0x6A74, "" }, + { 0x6A75, "wait_until_player_looking_at_courtyard" }, +// { 0x6A76, "" }, +// { 0x6A77, "" }, + { 0x6A78, "courtyard_helicopters" }, +// { 0x6A79, "" }, +// { 0x6A7A, "" }, +// { 0x6A7B, "" }, +// { 0x6A7C, "" }, +// { 0x6A7D, "" }, +// { 0x6A7E, "" }, +// { 0x6A7F, "" }, +// { 0x6A80, "" }, +// { 0x6A81, "" }, + { 0x6A82, "courtyard_attack_helicopter_second_pass" }, +// { 0x6A83, "" }, +// { 0x6A84, "" }, +// { 0x6A85, "" }, +// { 0x6A86, "" }, + { 0x6A87, "courtyard_helicopter4_fire_missiles" }, +// { 0x6A88, "" }, +// { 0x6A89, "" }, +// { 0x6A8A, "" }, +// { 0x6A8B, "" }, +// { 0x6A8C, "" }, +// { 0x6A8D, "" }, +// { 0x6A8E, "" }, +// { 0x6A8F, "" }, +// { 0x6A90, "" }, +// { 0x6A91, "" }, +// { 0x6A92, "" }, +// { 0x6A93, "" }, +// { 0x6A94, "" }, +// { 0x6A95, "" }, +// { 0x6A96, "" }, +// { 0x6A97, "" }, +// { 0x6A98, "" }, +// { 0x6A99, "" }, +// { 0x6A9A, "" }, +// { 0x6A9B, "" }, +// { 0x6A9C, "" }, +// { 0x6A9D, "" }, +// { 0x6A9E, "" }, +// { 0x6A9F, "" }, +// { 0x6AA0, "" }, + { 0x6AA1, "escort_help_soap_breach" }, +// { 0x6AA2, "" }, +// { 0x6AA3, "" }, +// { 0x6AA4, "" }, +// { 0x6AA5, "" }, +// { 0x6AA6, "" }, +// { 0x6AA7, "" }, +// { 0x6AA8, "" }, +// { 0x6AA9, "" }, +// { 0x6AAA, "" }, +// { 0x6AAB, "" }, +// { 0x6AAC, "" }, +// { 0x6AAD, "" }, +// { 0x6AAE, "" }, +// { 0x6AAF, "" }, +// { 0x6AB0, "" }, + { 0x6AB1, "regroup_price_to_nikolai" }, +// { 0x6AB2, "" }, +// { 0x6AB3, "" }, +// { 0x6AB4, "" }, +// { 0x6AB5, "" }, +// { 0x6AB6, "" }, +// { 0x6AB7, "" }, +// { 0x6AB8, "" }, +// { 0x6AB9, "" }, +// { 0x6ABA, "" }, +// { 0x6ABB, "" }, +// { 0x6ABC, "" }, +// { 0x6ABD, "" }, +// { 0x6ABE, "" }, +// { 0x6ABF, "" }, +// { 0x6AC0, "" }, +// { 0x6AC1, "" }, +// { 0x6AC2, "" }, +// { 0x6AC3, "" }, + { 0x6AC4, "regroup_carry_soap" }, + { 0x6AC5, "regroup_civilians" }, + { 0x6AC6, "regroup_looping_runners" }, +// { 0x6AC7, "" }, +// { 0x6AC8, "" }, +// { 0x6AC9, "" }, + { 0x6ACA, "regroup_drone_stop_loopers" }, + { 0x6ACB, "regroup_civ_setup" }, + { 0x6ACC, "regroup_civ_magic_bullets" }, +// { 0x6ACD, "" }, +// { 0x6ACE, "" }, +// { 0x6ACF, "" }, +// { 0x6AD0, "" }, +// { 0x6AD1, "" }, + { 0x6AD2, "regroup_ending" }, +// { 0x6AD3, "" }, +// { 0x6AD4, "" }, +// { 0x6AD5, "" }, +// { 0x6AD6, "" }, +// { 0x6AD7, "" }, +// { 0x6AD8, "" }, +// { 0x6AD9, "" }, +// { 0x6ADA, "" }, +// { 0x6ADB, "" }, +// { 0x6ADC, "" }, +// { 0x6ADD, "" }, +// { 0x6ADE, "" }, +// { 0x6ADF, "" }, +// { 0x6AE0, "" }, +// { 0x6AE1, "" }, +// { 0x6AE2, "" }, +// { 0x6AE3, "" }, +// { 0x6AE4, "" }, +// { 0x6AE5, "" }, +// { 0x6AE6, "" }, +// { 0x6AE7, "" }, +// { 0x6AE8, "" }, +// { 0x6AE9, "" }, + { 0x6AEA, "regroup_building_destruct_c_destroy" }, +// { 0x6AEB, "" }, + { 0x6AEC, "regroup_building_destructs_setup" }, +// { 0x6AED, "" }, +// { 0x6AEE, "" }, +// { 0x6AEF, "" }, +// { 0x6AF0, "" }, +// { 0x6AF1, "" }, +// { 0x6AF2, "" }, +// { 0x6AF3, "" }, +// { 0x6AF4, "" }, +// { 0x6AF5, "" }, +// { 0x6AF6, "" }, +// { 0x6AF7, "" }, + { 0x6AF8, "regroup_damage_cars" }, +// { 0x6AF9, "" }, +// { 0x6AFA, "" }, +// { 0x6AFB, "" }, +// { 0x6AFC, "" }, +// { 0x6AFD, "" }, +// { 0x6AFE, "" }, +// { 0x6AFF, "" }, + { 0x6B00, "maars_control_intro" }, +// { 0x6B01, "" }, +// { 0x6B02, "" }, +// { 0x6B03, "" }, +// { 0x6B04, "" }, +// { 0x6B05, "" }, +// { 0x6B06, "" }, + { 0x6B07, "wait_for_trigger_use_maars" }, +// { 0x6B08, "" }, + { 0x6B09, "maars_control_setup_allied_targets" }, +// { 0x6B0A, "" }, +// { 0x6B0B, "" }, +// { 0x6B0C, "" }, +// { 0x6B0D, "" }, +// { 0x6B0E, "" }, +// { 0x6B0F, "" }, +// { 0x6B10, "" }, +// { 0x6B11, "" }, +// { 0x6B12, "" }, +// { 0x6B13, "" }, +// { 0x6B14, "" }, +// { 0x6B15, "" }, +// { 0x6B16, "" }, +// { 0x6B17, "" }, +// { 0x6B18, "" }, +// { 0x6B19, "" }, +// { 0x6B1A, "" }, + { 0x6B1B, "maars_control_threat_groups" }, +// { 0x6B1C, "" }, +// { 0x6B1D, "" }, +// { 0x6B1E, "" }, +// { 0x6B1F, "" }, +// { 0x6B20, "" }, +// { 0x6B21, "" }, +// { 0x6B22, "" }, +// { 0x6B23, "" }, +// { 0x6B24, "" }, + { 0x6B25, "maars_control_helicopter_death_count" }, +// { 0x6B26, "" }, + { 0x6B27, "maars_control_mi28_4" }, +// { 0x6B28, "" }, + { 0x6B29, "maars_control_mi28_4_detour" }, +// { 0x6B2A, "" }, +// { 0x6B2B, "" }, +// { 0x6B2C, "" }, +// { 0x6B2D, "" }, +// { 0x6B2E, "" }, +// { 0x6B2F, "" }, +// { 0x6B30, "" }, +// { 0x6B31, "" }, +// { 0x6B32, "" }, + { 0x6B33, "building_slide_remove_player_clip" }, +// { 0x6B34, "" }, +// { 0x6B35, "" }, +// { 0x6B36, "" }, +// { 0x6B37, "" }, +// { 0x6B38, "" }, +// { 0x6B39, "" }, +// { 0x6B3A, "" }, +// { 0x6B3B, "" }, +// { 0x6B3C, "" }, +// { 0x6B3D, "" }, +// { 0x6B3E, "" }, +// { 0x6B3F, "" }, +// { 0x6B40, "" }, +// { 0x6B41, "" }, +// { 0x6B42, "" }, +// { 0x6B43, "" }, +// { 0x6B44, "" }, +// { 0x6B45, "" }, + { 0x6B46, "building_slide_begins" }, + { 0x6B47, "building_slide_anim" }, +// { 0x6B48, "" }, +// { 0x6B49, "" }, +// { 0x6B4A, "" }, +// { 0x6B4B, "" }, +// { 0x6B4C, "" }, +// { 0x6B4D, "" }, +// { 0x6B4E, "" }, +// { 0x6B4F, "" }, +// { 0x6B50, "" }, + { 0x6B51, "building_slide_player_slide_end" }, +// { 0x6B52, "" }, +// { 0x6B53, "" }, +// { 0x6B54, "" }, +// { 0x6B55, "" }, +// { 0x6B56, "" }, +// { 0x6B57, "" }, + { 0x6B58, "building_slide_control_hint" }, +// { 0x6B59, "" }, +// { 0x6B5A, "" }, +// { 0x6B5B, "" }, +// { 0x6B5C, "" }, +// { 0x6B5D, "" }, + { 0x6B5E, "building_slide_destroy_tree" }, +// { 0x6B5F, "" }, +// { 0x6B60, "" }, +// { 0x6B61, "" }, +// { 0x6B62, "" }, +// { 0x6B63, "" }, +// { 0x6B64, "" }, + { 0x6B65, "pull_scale" }, +// { 0x6B66, "" }, +// { 0x6B67, "" }, +// { 0x6B68, "" }, + { 0x6B69, "auto_occumulator_base" }, +// { 0x6B6A, "" }, +// { 0x6B6B, "" }, +// { 0x6B6C, "" }, +// { 0x6B6D, "" }, +// { 0x6B6E, "" }, + { 0x6B6F, "occumulator" }, +// { 0x6B70, "" }, +// { 0x6B71, "" }, +// { 0x6B72, "" }, +// { 0x6B73, "" }, +// { 0x6B74, "" }, +// { 0x6B75, "" }, +// { 0x6B76, "" }, +// { 0x6B77, "" }, +// { 0x6B78, "" }, +// { 0x6B79, "" }, + { 0x6B7A, "set_default_hud_stuff" }, +// { 0x6B7B, "" }, +// { 0x6B7C, "" }, + { 0x6B7D, "new_pull_earthquake" }, +// { 0x6B7E, "" }, +// { 0x6B7F, "" }, +// { 0x6B80, "" }, +// { 0x6B81, "" }, +// { 0x6B82, "" }, +// { 0x6B83, "" }, +// { 0x6B84, "" }, +// { 0x6B85, "" }, +// { 0x6B86, "" }, +// { 0x6B87, "" }, +// { 0x6B88, "" }, +// { 0x6B89, "" }, +// { 0x6B8A, "" }, +// { 0x6B8B, "" }, +// { 0x6B8C, "" }, +// { 0x6B8D, "" }, +// { 0x6B8E, "" }, +// { 0x6B8F, "" }, +// { 0x6B90, "" }, + { 0x6B91, "drone_runner_combat_think" }, +// { 0x6B92, "" }, +// { 0x6B93, "" }, +// { 0x6B94, "" }, +// { 0x6B95, "" }, +// { 0x6B96, "" }, + { 0x6B97, "drones_wounded" }, +// { 0x6B98, "" }, +// { 0x6B99, "" }, + { 0x6B9A, "objective_take_position_on_balcony" }, +// { 0x6B9B, "" }, +// { 0x6B9C, "" }, +// { 0x6B9D, "" }, +// { 0x6B9E, "" }, +// { 0x6B9F, "" }, +// { 0x6BA0, "" }, +// { 0x6BA1, "" }, +// { 0x6BA2, "" }, +// { 0x6BA3, "" }, +// { 0x6BA4, "" }, + { 0x6BA5, "flashback_aliases" }, +// { 0x6BA6, "" }, +// { 0x6BA7, "" }, + { 0x6BA8, "first_attack_heli_played" }, +// { 0x6BA9, "" }, +// { 0x6BAA, "" }, + { 0x6BAB, "aud_play_flashback2_gunshot" }, +// { 0x6BAC, "" }, +// { 0x6BAD, "" }, +// { 0x6BAE, "" }, +// { 0x6BAF, "" }, + { 0x6BB0, "aud_prime_flashback" }, +// { 0x6BB1, "" }, +// { 0x6BB2, "" }, +// { 0x6BB3, "" }, +// { 0x6BB4, "" }, + { 0x6BB5, "play_flashback_whoosh" }, +// { 0x6BB6, "" }, +// { 0x6BB7, "" }, +// { 0x6BB8, "" }, + { 0x6BB9, "aud_heli_death_watch" }, + { 0x6BBA, "aud_heli_print_msg" }, +// { 0x6BBB, "" }, +// { 0x6BBC, "" }, +// { 0x6BBD, "" }, +// { 0x6BBE, "" }, +// { 0x6BBF, "" }, +// { 0x6BC0, "" }, +// { 0x6BC1, "" }, +// { 0x6BC2, "" }, +// { 0x6BC3, "" }, +// { 0x6BC4, "" }, +// { 0x6BC5, "" }, +// { 0x6BC6, "" }, +// { 0x6BC7, "" }, +// { 0x6BC8, "" }, +// { 0x6BC9, "" }, +// { 0x6BCA, "" }, +// { 0x6BCB, "" }, +// { 0x6BCC, "" }, +// { 0x6BCD, "" }, +// { 0x6BCE, "" }, +// { 0x6BCF, "" }, + { 0x6BD0, "courtyard" }, +// { 0x6BD1, "" }, +// { 0x6BD2, "" }, + { 0x6BD3, "start_regroup" }, +// { 0x6BD4, "" }, +// { 0x6BD5, "" }, +// { 0x6BD6, "" }, +// { 0x6BD7, "" }, +// { 0x6BD8, "" }, + { 0x6BD9, "start_maars_control" }, +// { 0x6BDA, "" }, +// { 0x6BDB, "" }, +// { 0x6BDC, "" }, +// { 0x6BDD, "" }, +// { 0x6BDE, "" }, +// { 0x6BDF, "" }, +// { 0x6BE0, "" }, +// { 0x6BE1, "" }, + { 0x6BE2, "intro_sequence" }, +// { 0x6BE3, "" }, + { 0x6BE4, "intro_flashback_slowmo" }, +// { 0x6BE5, "" }, +// { 0x6BE6, "" }, +// { 0x6BE7, "" }, +// { 0x6BE8, "" }, +// { 0x6BE9, "" }, +// { 0x6BEA, "" }, + { 0x6BEB, "do_intro_text" }, +// { 0x6BEC, "" }, +// { 0x6BED, "" }, +// { 0x6BEE, "" }, +// { 0x6BEF, "" }, +// { 0x6BF0, "" }, +// { 0x6BF1, "" }, +// { 0x6BF2, "" }, +// { 0x6BF3, "" }, +// { 0x6BF4, "" }, +// { 0x6BF5, "" }, +// { 0x6BF6, "" }, +// { 0x6BF7, "" }, +// { 0x6BF8, "" }, +// { 0x6BF9, "" }, +// { 0x6BFA, "" }, +// { 0x6BFB, "" }, +// { 0x6BFC, "" }, +// { 0x6BFD, "" }, +// { 0x6BFE, "" }, +// { 0x6BFF, "" }, +// { 0x6C00, "" }, +// { 0x6C01, "" }, + { 0x6C02, "heli_fire" }, +// { 0x6C03, "" }, +// { 0x6C04, "" }, +// { 0x6C05, "" }, +// { 0x6C06, "" }, +// { 0x6C07, "" }, +// { 0x6C08, "" }, +// { 0x6C09, "" }, +// { 0x6C0A, "" }, +// { 0x6C0B, "" }, +// { 0x6C0C, "" }, +// { 0x6C0D, "" }, + { 0x6C0E, "monitor_indoor_think" }, +// { 0x6C0F, "" }, +// { 0x6C10, "" }, + { 0x6C11, "clear_enemies_in_volume" }, +// { 0x6C12, "" }, +// { 0x6C13, "" }, +// { 0x6C14, "" }, +// { 0x6C15, "" }, +// { 0x6C16, "" }, +// { 0x6C17, "" }, +// { 0x6C18, "" }, +// { 0x6C19, "" }, + { 0x6C1A, "removepriority" }, + { 0x6C1B, "airspace_list" }, +// { 0x6C1C, "" }, +// { 0x6C1D, "" }, +// { 0x6C1E, "" }, + { 0x6C1F, "berlin_reload_airspace_locked" }, +// { 0x6C20, "" }, + { 0x6C21, "release_airspacelock" }, +// { 0x6C22, "" }, +// { 0x6C23, "" }, +// { 0x6C24, "" }, +// { 0x6C25, "" }, +// { 0x6C26, "" }, +// { 0x6C27, "" }, + { 0x6C28, "monitoraabuildingwest" }, + { 0x6C29, "roof_top_sniper" }, +// { 0x6C2A, "" }, +// { 0x6C2B, "" }, +// { 0x6C2C, "" }, +// { 0x6C2D, "" }, +// { 0x6C2E, "" }, +// { 0x6C2F, "" }, +// { 0x6C30, "" }, +// { 0x6C31, "" }, +// { 0x6C32, "" }, +// { 0x6C33, "" }, +// { 0x6C34, "" }, +// { 0x6C35, "" }, +// { 0x6C36, "" }, +// { 0x6C37, "" }, +// { 0x6C38, "" }, + { 0x6C39, "sniper_patrollers" }, +// { 0x6C3A, "" }, +// { 0x6C3B, "" }, +// { 0x6C3C, "" }, +// { 0x6C3D, "" }, +// { 0x6C3E, "" }, +// { 0x6C3F, "" }, + { 0x6C40, "air_support_obj_num" }, + { 0x6C41, "sniper_tank_1" }, +// { 0x6C42, "" }, +// { 0x6C43, "" }, +// { 0x6C44, "" }, + { 0x6C45, "avg_pos_cleanup" }, + { 0x6C46, "setup_hotel_rooftop_battle" }, +// { 0x6C47, "" }, +// { 0x6C48, "" }, +// { 0x6C49, "" }, + { 0x6C4A, "spawn_ambient_ally_helis" }, + { 0x6C4B, "rooftop_ally_helis" }, +// { 0x6C4C, "" }, + { 0x6C4D, "rpg_enemies_shoot_ambient_helis" }, +// { 0x6C4E, "" }, +// { 0x6C4F, "" }, +// { 0x6C50, "" }, +// { 0x6C51, "" }, + { 0x6C52, "ai_random_fire_at_ents" }, + { 0x6C53, "spawn_delta_support_squad" }, +// { 0x6C54, "" }, +// { 0x6C55, "" }, +// { 0x6C56, "" }, +// { 0x6C57, "" }, +// { 0x6C58, "" }, +// { 0x6C59, "" }, +// { 0x6C5A, "" }, + { 0x6C5B, "setup_sniper_tank" }, +// { 0x6C5C, "" }, +// { 0x6C5D, "" }, +// { 0x6C5E, "" }, +// { 0x6C5F, "" }, + { 0x6C60, "berlin_reload_events" }, +// { 0x6C61, "" }, +// { 0x6C62, "" }, +// { 0x6C63, "" }, +// { 0x6C64, "" }, +// { 0x6C65, "" }, +// { 0x6C66, "" }, + { 0x6C67, "delta_squad_ready_to_rappel" }, +// { 0x6C68, "" }, +// { 0x6C69, "" }, +// { 0x6C6A, "" }, +// { 0x6C6B, "" }, +// { 0x6C6C, "" }, +// { 0x6C6D, "" }, + { 0x6C6E, "a10_decal_sniper_fix" }, +// { 0x6C6F, "" }, +// { 0x6C70, "" }, +// { 0x6C71, "" }, +// { 0x6C72, "" }, +// { 0x6C73, "" }, +// { 0x6C74, "" }, +// { 0x6C75, "" }, +// { 0x6C76, "" }, +// { 0x6C77, "" }, +// { 0x6C78, "" }, +// { 0x6C79, "" }, +// { 0x6C7A, "" }, +// { 0x6C7B, "" }, +// { 0x6C7C, "" }, + { 0x6C7D, "delta_support_rappel" }, +// { 0x6C7E, "" }, +// { 0x6C7F, "" }, +// { 0x6C80, "" }, +// { 0x6C81, "" }, +// { 0x6C82, "" }, +// { 0x6C83, "" }, +// { 0x6C84, "" }, +// { 0x6C85, "" }, +// { 0x6C86, "" }, +// { 0x6C87, "" }, +// { 0x6C88, "" }, + { 0x6C89, "spawn_rappel_ropes" }, +// { 0x6C8A, "" }, +// { 0x6C8B, "" }, +// { 0x6C8C, "" }, +// { 0x6C8D, "" }, +// { 0x6C8E, "" }, + { 0x6C8F, "reached_rappel_start_spot" }, +// { 0x6C90, "" }, +// { 0x6C91, "" }, +// { 0x6C92, "" }, +// { 0x6C93, "" }, +// { 0x6C94, "" }, +// { 0x6C95, "" }, +// { 0x6C96, "" }, +// { 0x6C97, "" }, +// { 0x6C98, "" }, +// { 0x6C99, "" }, +// { 0x6C9A, "" }, +// { 0x6C9B, "" }, + { 0x6C9C, "flag_name" }, +// { 0x6C9D, "" }, +// { 0x6C9E, "" }, +// { 0x6C9F, "" }, +// { 0x6CA0, "" }, +// { 0x6CA1, "" }, +// { 0x6CA2, "" }, +// { 0x6CA3, "" }, +// { 0x6CA4, "" }, +// { 0x6CA5, "" }, +// { 0x6CA6, "" }, +// { 0x6CA7, "" }, +// { 0x6CA8, "" }, +// { 0x6CA9, "" }, +// { 0x6CAA, "" }, +// { 0x6CAB, "" }, +// { 0x6CAC, "" }, +// { 0x6CAD, "" }, + { 0x6CAE, "bridge_ignore_friendlies" }, +// { 0x6CAF, "" }, + { 0x6CB0, "bridge_fighter_dead" }, +// { 0x6CB1, "" }, +// { 0x6CB2, "" }, + { 0x6CB3, "bridge_fighter_wake_up" }, +// { 0x6CB4, "" }, + { 0x6CB5, "bridge_sleeper_set_bias_group" }, +// { 0x6CB6, "" }, +// { 0x6CB7, "" }, +// { 0x6CB8, "" }, +// { 0x6CB9, "" }, +// { 0x6CBA, "" }, +// { 0x6CBB, "" }, +// { 0x6CBC, "" }, +// { 0x6CBD, "" }, +// { 0x6CBE, "" }, +// { 0x6CBF, "" }, + { 0x6CC0, "check_for_rpg" }, +// { 0x6CC1, "" }, +// { 0x6CC2, "" }, +// { 0x6CC3, "" }, +// { 0x6CC4, "" }, +// { 0x6CC5, "" }, +// { 0x6CC6, "" }, +// { 0x6CC7, "" }, +// { 0x6CC8, "" }, +// { 0x6CC9, "" }, + { 0x6CCA, "bridge_activate_a10_hint" }, +// { 0x6CCB, "" }, +// { 0x6CCC, "" }, +// { 0x6CCD, "" }, + { 0x6CCE, "basic_ai_respawn" }, +// { 0x6CCF, "" }, +// { 0x6CD0, "" }, +// { 0x6CD1, "" }, +// { 0x6CD2, "" }, +// { 0x6CD3, "" }, +// { 0x6CD4, "" }, + { 0x6CD5, "survive_friendly_rocket" }, + { 0x6CD6, "ally_tank_2_go_over_barricade" }, + { 0x6CD7, "tank_stop_shooting" }, +// { 0x6CD8, "" }, +// { 0x6CD9, "" }, +// { 0x6CDA, "" }, +// { 0x6CDB, "" }, +// { 0x6CDC, "" }, +// { 0x6CDD, "" }, +// { 0x6CDE, "" }, +// { 0x6CDF, "" }, +// { 0x6CE0, "" }, +// { 0x6CE1, "" }, +// { 0x6CE2, "" }, +// { 0x6CE3, "" }, +// { 0x6CE4, "" }, +// { 0x6CE5, "" }, +// { 0x6CE6, "" }, +// { 0x6CE7, "" }, +// { 0x6CE8, "" }, +// { 0x6CE9, "" }, +// { 0x6CEA, "" }, +// { 0x6CEB, "" }, +// { 0x6CEC, "" }, +// { 0x6CED, "" }, +// { 0x6CEE, "" }, +// { 0x6CEF, "" }, +// { 0x6CF0, "" }, +// { 0x6CF1, "" }, +// { 0x6CF2, "" }, +// { 0x6CF3, "" }, +// { 0x6CF4, "" }, +// { 0x6CF5, "" }, +// { 0x6CF6, "" }, +// { 0x6CF7, "" }, +// { 0x6CF8, "" }, + { 0x6CF9, "incoming_artillery" }, +// { 0x6CFA, "" }, +// { 0x6CFB, "" }, +// { 0x6CFC, "" }, +// { 0x6CFD, "" }, +// { 0x6CFE, "" }, +// { 0x6CFF, "" }, +// { 0x6D00, "" }, +// { 0x6D01, "" }, +// { 0x6D02, "" }, +// { 0x6D03, "" }, +// { 0x6D04, "" }, +// { 0x6D05, "" }, + { 0x6D06, "playfx_collapse" }, +// { 0x6D07, "" }, +// { 0x6D08, "" }, +// { 0x6D09, "" }, +// { 0x6D0A, "" }, + { 0x6D0B, "force_crouch" }, +// { 0x6D0C, "" }, +// { 0x6D0D, "" }, + { 0x6D0E, "force_slide" }, +// { 0x6D0F, "" }, +// { 0x6D10, "" }, +// { 0x6D11, "" }, +// { 0x6D12, "" }, +// { 0x6D13, "" }, +// { 0x6D14, "" }, +// { 0x6D15, "" }, +// { 0x6D16, "" }, +// { 0x6D17, "" }, +// { 0x6D18, "" }, +// { 0x6D19, "" }, +// { 0x6D1A, "" }, +// { 0x6D1B, "" }, + { 0x6D1C, "monitor_friendly_at_emerge_door" }, +// { 0x6D1D, "" }, +// { 0x6D1E, "" }, +// { 0x6D1F, "" }, +// { 0x6D20, "" }, +// { 0x6D21, "" }, +// { 0x6D22, "" }, +// { 0x6D23, "" }, +// { 0x6D24, "" }, +// { 0x6D25, "" }, +// { 0x6D26, "" }, +// { 0x6D27, "" }, + { 0x6D28, "scripted_tank" }, +// { 0x6D29, "" }, +// { 0x6D2A, "" }, +// { 0x6D2B, "" }, +// { 0x6D2C, "" }, +// { 0x6D2D, "" }, + { 0x6D2E, "set_random_turret_target" }, +// { 0x6D2F, "" }, +// { 0x6D30, "" }, +// { 0x6D31, "" }, +// { 0x6D32, "" }, +// { 0x6D33, "" }, +// { 0x6D34, "" }, +// { 0x6D35, "" }, +// { 0x6D36, "" }, +// { 0x6D37, "" }, +// { 0x6D38, "" }, +// { 0x6D39, "" }, +// { 0x6D3A, "" }, +// { 0x6D3B, "" }, +// { 0x6D3C, "" }, +// { 0x6D3D, "" }, + { 0x6D3E, "setup_reverse_breach" }, +// { 0x6D3F, "" }, +// { 0x6D40, "" }, + { 0x6D41, "player_body" }, +// { 0x6D42, "" }, + { 0x6D43, "reverse_breach_cleanup_weapons" }, +// { 0x6D44, "" }, + { 0x6D45, "reverse_breach_getup_regular_speed" }, +// { 0x6D46, "" }, +// { 0x6D47, "" }, +// { 0x6D48, "" }, +// { 0x6D49, "" }, +// { 0x6D4A, "" }, +// { 0x6D4B, "" }, +// { 0x6D4C, "" }, +// { 0x6D4D, "" }, + { 0x6D4E, "reverse_breach_door_breach" }, + { 0x6D4F, "reverse_breach_enemies_dead" }, +// { 0x6D50, "" }, + { 0x6D51, "reverse_breach_draw_pistol" }, +// { 0x6D52, "" }, +// { 0x6D53, "" }, + { 0x6D54, "monitor_end_mission" }, +// { 0x6D55, "" }, +// { 0x6D56, "" }, +// { 0x6D57, "" }, +// { 0x6D58, "" }, +// { 0x6D59, "" }, +// { 0x6D5A, "" }, +// { 0x6D5B, "" }, +// { 0x6D5C, "" }, +// { 0x6D5D, "" }, +// { 0x6D5E, "" }, +// { 0x6D5F, "" }, +// { 0x6D60, "" }, + { 0x6D61, "self_delete_on_flag_set" }, + { 0x6D62, "smart_createthreatbiasgroup" }, +// { 0x6D63, "" }, + { 0x6D64, "tank_fire_at_targets" }, +// { 0x6D65, "" }, +// { 0x6D66, "" }, +// { 0x6D67, "" }, + { 0x6D68, "fake_javelin_earthquake" }, +// { 0x6D69, "" }, +// { 0x6D6A, "" }, +// { 0x6D6B, "" }, +// { 0x6D6C, "" }, +// { 0x6D6D, "" }, +// { 0x6D6E, "" }, +// { 0x6D6F, "" }, +// { 0x6D70, "" }, +// { 0x6D71, "" }, +// { 0x6D72, "" }, +// { 0x6D73, "" }, +// { 0x6D74, "" }, +// { 0x6D75, "" }, +// { 0x6D76, "" }, +// { 0x6D77, "" }, +// { 0x6D78, "" }, +// { 0x6D79, "" }, +// { 0x6D7A, "" }, +// { 0x6D7B, "" }, +// { 0x6D7C, "" }, + { 0x6D7D, "berlin_heli_ride_dialog" }, +// { 0x6D7E, "" }, + { 0x6D7F, "create_nag_prompt" }, + { 0x6D80, "generic_nag_loop" }, +// { 0x6D81, "" }, + { 0x6D82, "berlin_aa_roof_clear_dialog" }, +// { 0x6D83, "" }, +// { 0x6D84, "" }, +// { 0x6D85, "" }, +// { 0x6D86, "" }, + { 0x6D87, "sniper_rooftop_wave_2_nag" }, + { 0x6D88, "monitor_sniper_player_kills_wave_1" }, +// { 0x6D89, "" }, + { 0x6D8A, "monitor_sniper_kills" }, +// { 0x6D8B, "" }, +// { 0x6D8C, "" }, + { 0x6D8D, "monitor_ignore_sniper_tank_nag" }, +// { 0x6D8E, "" }, +// { 0x6D8F, "" }, +// { 0x6D90, "" }, + { 0x6D91, "nag_sniper_rifle_pickup" }, +// { 0x6D92, "" }, +// { 0x6D93, "" }, +// { 0x6D94, "" }, +// { 0x6D95, "" }, +// { 0x6D96, "" }, +// { 0x6D97, "" }, +// { 0x6D98, "" }, +// { 0x6D99, "" }, +// { 0x6D9A, "" }, +// { 0x6D9B, "" }, +// { 0x6D9C, "" }, +// { 0x6D9D, "" }, +// { 0x6D9E, "" }, +// { 0x6D9F, "" }, +// { 0x6DA0, "" }, + { 0x6DA1, "berlin_shared_ambush_dialog" }, +// { 0x6DA2, "" }, +// { 0x6DA3, "" }, +// { 0x6DA4, "" }, +// { 0x6DA5, "" }, +// { 0x6DA6, "" }, +// { 0x6DA7, "" }, +// { 0x6DA8, "" }, +// { 0x6DA9, "" }, +// { 0x6DAA, "" }, +// { 0x6DAB, "" }, +// { 0x6DAC, "" }, +// { 0x6DAD, "" }, +// { 0x6DAE, "" }, + { 0x6DAF, "throw_victim_kill" }, +// { 0x6DB0, "" }, +// { 0x6DB1, "" }, +// { 0x6DB2, "" }, + { 0x6DB3, "sniper_rooftop_attacker_fire_rocket" }, +// { 0x6DB4, "" }, +// { 0x6DB5, "" }, +// { 0x6DB6, "" }, +// { 0x6DB7, "" }, +// { 0x6DB8, "" }, +// { 0x6DB9, "" }, +// { 0x6DBA, "" }, + { 0x6DBB, "start_clear_bridge" }, +// { 0x6DBC, "" }, +// { 0x6DBD, "" }, + { 0x6DBE, "start_building_collapse" }, +// { 0x6DBF, "" }, +// { 0x6DC0, "" }, +// { 0x6DC1, "" }, +// { 0x6DC2, "" }, +// { 0x6DC3, "" }, + { 0x6DC4, "breach_spot_light" }, +// { 0x6DC5, "" }, +// { 0x6DC6, "" }, + { 0x6DC7, "berlin_chopper_crash" }, +// { 0x6DC8, "" }, +// { 0x6DC9, "" }, +// { 0x6DCA, "" }, +// { 0x6DCB, "" }, + { 0x6DCC, "berlin_clear_bridge" }, + { 0x6DCD, "berlin_advance_pkway" }, + { 0x6DCE, "berlin_building_collapse" }, +// { 0x6DCF, "" }, + { 0x6DD0, "berlin_emerge" }, + { 0x6DD1, "berlin_last_stand" }, +// { 0x6DD2, "" }, +// { 0x6DD3, "" }, +// { 0x6DD4, "" }, +// { 0x6DD5, "" }, +// { 0x6DD6, "" }, +// { 0x6DD7, "" }, + { 0x6DD8, "main_anim" }, +// { 0x6DD9, "" }, +// { 0x6DDA, "" }, +// { 0x6DDB, "" }, +// { 0x6DDC, "" }, + { 0x6DDD, "copilot_blood_vfx" }, +// { 0x6DDE, "" }, + { 0x6DDF, "ignore_all" }, +// { 0x6DE0, "" }, +// { 0x6DE1, "" }, +// { 0x6DE2, "" }, +// { 0x6DE3, "" }, +// { 0x6DE4, "" }, +// { 0x6DE5, "" }, +// { 0x6DE6, "" }, +// { 0x6DE7, "" }, +// { 0x6DE8, "" }, +// { 0x6DE9, "" }, +// { 0x6DEA, "" }, +// { 0x6DEB, "" }, + { 0x6DEC, "zippo_fire_vfx" }, +// { 0x6DED, "" }, +// { 0x6DEE, "" }, +// { 0x6DEF, "" }, +// { 0x6DF0, "" }, +// { 0x6DF1, "" }, +// { 0x6DF2, "" }, +// { 0x6DF3, "" }, +// { 0x6DF4, "" }, + { 0x6DF5, "exterior_suv_skid3" }, +// { 0x6DF6, "" }, +// { 0x6DF7, "" }, +// { 0x6DF8, "" }, +// { 0x6DF9, "" }, +// { 0x6DFA, "" }, +// { 0x6DFB, "" }, +// { 0x6DFC, "" }, +// { 0x6DFD, "" }, +// { 0x6DFE, "" }, +// { 0x6DFF, "" }, +// { 0x6E00, "" }, +// { 0x6E01, "" }, +// { 0x6E02, "" }, +// { 0x6E03, "" }, +// { 0x6E04, "" }, +// { 0x6E05, "" }, + { 0x6E06, "topfloor_room_dmg_start" }, + { 0x6E07, "topfloor_def_room" }, +// { 0x6E08, "" }, +// { 0x6E09, "" }, +// { 0x6E0A, "" }, +// { 0x6E0B, "" }, +// { 0x6E0C, "" }, +// { 0x6E0D, "" }, + { 0x6E0E, "restaurant_halfresparticles_off" }, +// { 0x6E0F, "" }, + { 0x6E10, "restaurant_falling_character_lighting" }, +// { 0x6E11, "" }, +// { 0x6E12, "" }, + { 0x6E13, "restaurant_structure_cable_explosion" }, +// { 0x6E14, "" }, +// { 0x6E15, "" }, +// { 0x6E16, "" }, +// { 0x6E17, "" }, +// { 0x6E18, "" }, + { 0x6E19, "restaurant_detach_init_vfx" }, +// { 0x6E1A, "" }, +// { 0x6E1B, "" }, +// { 0x6E1C, "" }, + { 0x6E1D, "restaurant_ceilingbeam01_pipesteam_vfx" }, +// { 0x6E1E, "" }, + { 0x6E1F, "fx_dummy_1" }, +// { 0x6E20, "" }, +// { 0x6E21, "" }, +// { 0x6E22, "" }, +// { 0x6E23, "" }, +// { 0x6E24, "" }, +// { 0x6E25, "" }, +// { 0x6E26, "" }, +// { 0x6E27, "" }, +// { 0x6E28, "" }, +// { 0x6E29, "" }, + { 0x6E2A, "yuri_blood_vfx" }, +// { 0x6E2B, "" }, +// { 0x6E2C, "" }, +// { 0x6E2D, "" }, +// { 0x6E2E, "" }, +// { 0x6E2F, "" }, +// { 0x6E30, "" }, +// { 0x6E31, "" }, +// { 0x6E32, "" }, +// { 0x6E33, "" }, +// { 0x6E34, "" }, +// { 0x6E35, "" }, +// { 0x6E36, "" }, +// { 0x6E37, "" }, +// { 0x6E38, "" }, +// { 0x6E39, "" }, +// { 0x6E3A, "" }, +// { 0x6E3B, "" }, +// { 0x6E3C, "" }, +// { 0x6E3D, "" }, +// { 0x6E3E, "" }, +// { 0x6E3F, "" }, + { 0x6E40, "setup_heli_fire_flicker_light" }, +// { 0x6E41, "" }, +// { 0x6E42, "" }, +// { 0x6E43, "" }, +// { 0x6E44, "" }, +// { 0x6E45, "" }, +// { 0x6E46, "" }, +// { 0x6E47, "" }, +// { 0x6E48, "" }, +// { 0x6E49, "" }, +// { 0x6E4A, "" }, +// { 0x6E4B, "" }, +// { 0x6E4C, "" }, +// { 0x6E4D, "" }, + { 0x6E4E, "showdown_yuri_vfx" }, +// { 0x6E4F, "" }, +// { 0x6E50, "" }, + { 0x6E51, "calc_heli_fire_reflection" }, +// { 0x6E52, "" }, +// { 0x6E53, "" }, +// { 0x6E54, "" }, +// { 0x6E55, "" }, +// { 0x6E56, "" }, +// { 0x6E57, "" }, +// { 0x6E58, "" }, +// { 0x6E59, "" }, +// { 0x6E5A, "" }, +// { 0x6E5B, "" }, +// { 0x6E5C, "" }, +// { 0x6E5D, "" }, +// { 0x6E5E, "" }, +// { 0x6E5F, "" }, +// { 0x6E60, "" }, +// { 0x6E61, "" }, +// { 0x6E62, "" }, +// { 0x6E63, "" }, +// { 0x6E64, "" }, +// { 0x6E65, "" }, +// { 0x6E66, "" }, +// { 0x6E67, "" }, +// { 0x6E68, "" }, +// { 0x6E69, "" }, +// { 0x6E6A, "" }, +// { 0x6E6B, "" }, + { 0x6E6C, "civilian_drone_stationary_think" }, +// { 0x6E6D, "" }, +// { 0x6E6E, "" }, + { 0x6E6F, "civilian_drone_run_and_hide_kill_if_player_hit" }, + { 0x6E70, "elevator_floor_numbers" }, +// { 0x6E71, "" }, +// { 0x6E72, "" }, +// { 0x6E73, "" }, +// { 0x6E74, "" }, +// { 0x6E75, "" }, + { 0x6E76, "initmw3iw_shgcredits" }, + { 0x6E77, "maps/_credits" }, +// { 0x6E78, "" }, +// { 0x6E79, "" }, + { 0x6E7A, "addheadermw3" }, + { 0x6E7B, "addcreditmw3" }, +// { 0x6E7C, "" }, + { 0x6E7D, "addcreditrmw3" }, +// { 0x6E7E, "" }, +// { 0x6E7F, "" }, + { 0x6E80, "initmw3credits" }, +// { 0x6E81, "" }, +// { 0x6E82, "" }, +// { 0x6E83, "" }, + { 0x6E84, "linelist" }, +// { 0x6E85, "" }, +// { 0x6E86, "" }, +// { 0x6E87, "" }, +// { 0x6E88, "" }, +// { 0x6E89, "" }, +// { 0x6E8A, "" }, +// { 0x6E8B, "" }, +// { 0x6E8C, "" }, +// { 0x6E8D, "" }, +// { 0x6E8E, "" }, +// { 0x6E8F, "" }, +// { 0x6E90, "" }, +// { 0x6E91, "" }, + { 0x6E92, "loc1" }, + { 0x6E93, "format1" }, +// { 0x6E94, "" }, +// { 0x6E95, "" }, +// { 0x6E96, "" }, +// { 0x6E97, "" }, + { 0x6E98, "subtitle" }, +// { 0x6E99, "" }, +// { 0x6E9A, "" }, +// { 0x6E9B, "" }, +// { 0x6E9C, "" }, +// { 0x6E9D, "" }, +// { 0x6E9E, "" }, +// { 0x6E9F, "" }, +// { 0x6EA0, "" }, + { 0x6EA1, "addrighttitle" }, +// { 0x6EA2, "" }, +// { 0x6EA3, "" }, +// { 0x6EA4, "" }, + { 0x6EA5, "addcastname" }, +// { 0x6EA6, "" }, + { 0x6EA7, "addcenternamedouble" }, + { 0x6EA8, "name1" }, +// { 0x6EA9, "" }, +// { 0x6EAA, "" }, +// { 0x6EAB, "" }, +// { 0x6EAC, "" }, +// { 0x6EAD, "" }, +// { 0x6EAE, "" }, + { 0x6EAF, "addcenterimage" }, +// { 0x6EB0, "" }, +// { 0x6EB1, "" }, + { 0x6EB2, "mw3credithudelem" }, +// { 0x6EB3, "" }, +// { 0x6EB4, "" }, +// { 0x6EB5, "" }, +// { 0x6EB6, "" }, +// { 0x6EB7, "" }, +// { 0x6EB8, "" }, +// { 0x6EB9, "" }, +// { 0x6EBA, "" }, +// { 0x6EBB, "" }, +// { 0x6EBC, "" }, +// { 0x6EBD, "" }, +// { 0x6EBE, "" }, +// { 0x6EBF, "" }, +// { 0x6EC0, "" }, + { 0x6EC1, "addsubtitleiw" }, +// { 0x6EC2, "" }, +// { 0x6EC3, "" }, +// { 0x6EC4, "" }, + { 0x6EC5, "addnameiw" }, +// { 0x6EC6, "" }, +// { 0x6EC7, "" }, +// { 0x6EC8, "" }, +// { 0x6EC9, "" }, +// { 0x6ECA, "" }, +// { 0x6ECB, "" }, +// { 0x6ECC, "" }, +// { 0x6ECD, "" }, +// { 0x6ECE, "" }, +// { 0x6ECF, "" }, +// { 0x6ED0, "" }, + { 0x6ED1, "initatvicredits_business" }, +// { 0x6ED2, "" }, +// { 0x6ED3, "" }, + { 0x6ED4, "initatvicredits_qa3" }, +// { 0x6ED5, "" }, +// { 0x6ED6, "" }, +// { 0x6ED7, "" }, +// { 0x6ED8, "" }, +// { 0x6ED9, "" }, +// { 0x6EDA, "" }, +// { 0x6EDB, "" }, +// { 0x6EDC, "" }, + { 0x6EDD, "finale_end_mission" }, +// { 0x6EDE, "" }, +// { 0x6EDF, "" }, +// { 0x6EE0, "" }, +// { 0x6EE1, "" }, +// { 0x6EE2, "" }, +// { 0x6EE3, "" }, + { 0x6EE4, "finale_chopper_sequence" }, + { 0x6EE5, "stabbed" }, + { 0x6EE6, "stab_failure" }, +// { 0x6EE7, "" }, +// { 0x6EE8, "" }, +// { 0x6EE9, "" }, +// { 0x6EEA, "" }, +// { 0x6EEB, "" }, +// { 0x6EEC, "" }, +// { 0x6EED, "" }, +// { 0x6EEE, "" }, +// { 0x6EEF, "" }, +// { 0x6EF0, "" }, +// { 0x6EF1, "" }, + { 0x6EF2, "finale_jump_missed_check" }, +// { 0x6EF3, "" }, +// { 0x6EF4, "" }, +// { 0x6EF5, "" }, + { 0x6EF6, "finale_chopper_hint_and_catch_stab" }, + { 0x6EF7, "finale_crash_site_wait_to_crash" }, +// { 0x6EF8, "" }, +// { 0x6EF9, "" }, +// { 0x6EFA, "" }, +// { 0x6EFB, "" }, +// { 0x6EFC, "" }, +// { 0x6EFD, "" }, +// { 0x6EFE, "" }, + { 0x6EFF, "player_crawling_shell_shock" }, +// { 0x6F00, "" }, + { 0x6F01, "finale_moving" }, +// { 0x6F02, "" }, +// { 0x6F03, "" }, +// { 0x6F04, "" }, +// { 0x6F05, "" }, +// { 0x6F06, "" }, +// { 0x6F07, "" }, +// { 0x6F08, "" }, +// { 0x6F09, "" }, +// { 0x6F0A, "" }, +// { 0x6F0B, "" }, +// { 0x6F0C, "" }, +// { 0x6F0D, "" }, +// { 0x6F0E, "" }, + { 0x6F0F, "finale_start" }, +// { 0x6F10, "" }, + { 0x6F11, "finale_crash_final_crawl_player_blend" }, +// { 0x6F12, "" }, +// { 0x6F13, "" }, +// { 0x6F14, "" }, +// { 0x6F15, "" }, +// { 0x6F16, "" }, +// { 0x6F17, "" }, +// { 0x6F18, "" }, + { 0x6F19, "makarov_aimref" }, +// { 0x6F1A, "" }, +// { 0x6F1B, "" }, +// { 0x6F1C, "" }, +// { 0x6F1D, "" }, +// { 0x6F1E, "" }, + { 0x6F1F, "create_plane" }, + { 0x6F20, "test_plane" }, +// { 0x6F21, "" }, +// { 0x6F22, "" }, + { 0x6F23, "calc_barycentric_coords" }, + { 0x6F24, "finale_chopper_crash_aim2" }, +// { 0x6F25, "" }, +// { 0x6F26, "" }, +// { 0x6F27, "" }, + { 0x6F28, "finale_chopper_crash_fail_stopcrawl" }, +// { 0x6F29, "" }, +// { 0x6F2A, "" }, +// { 0x6F2B, "" }, +// { 0x6F2C, "" }, +// { 0x6F2D, "" }, +// { 0x6F2E, "" }, +// { 0x6F2F, "" }, +// { 0x6F30, "" }, +// { 0x6F31, "" }, +// { 0x6F32, "" }, +// { 0x6F33, "" }, +// { 0x6F34, "" }, +// { 0x6F35, "" }, +// { 0x6F36, "" }, + { 0x6F37, "current_actors" }, +// { 0x6F38, "" }, + { 0x6F39, "debug_lr_pressed" }, +// { 0x6F3A, "" }, +// { 0x6F3B, "" }, + { 0x6F3C, "buttonmashpressed" }, +// { 0x6F3D, "" }, +// { 0x6F3E, "" }, +// { 0x6F3F, "" }, +// { 0x6F40, "" }, +// { 0x6F41, "" }, +// { 0x6F42, "" }, + { 0x6F43, "loop_on_dupd_node_solo" }, +// { 0x6F44, "" }, +// { 0x6F45, "" }, + { 0x6F46, "hold_choke_hint" }, +// { 0x6F47, "" }, +// { 0x6F48, "" }, +// { 0x6F49, "" }, + { 0x6F4A, "finale_beatdown_player" }, +// { 0x6F4B, "" }, + { 0x6F4C, "beatdown_debugstart" }, +// { 0x6F4D, "" }, +// { 0x6F4E, "" }, +// { 0x6F4F, "" }, +// { 0x6F50, "" }, +// { 0x6F51, "" }, +// { 0x6F52, "" }, +// { 0x6F53, "" }, +// { 0x6F54, "" }, +// { 0x6F55, "" }, +// { 0x6F56, "" }, +// { 0x6F57, "" }, +// { 0x6F58, "" }, + { 0x6F59, "finale_beatdown_break_glass_rail" }, +// { 0x6F5A, "" }, +// { 0x6F5B, "" }, +// { 0x6F5C, "" }, +// { 0x6F5D, "" }, +// { 0x6F5E, "" }, +// { 0x6F5F, "" }, +// { 0x6F60, "" }, +// { 0x6F61, "" }, +// { 0x6F62, "" }, +// { 0x6F63, "" }, +// { 0x6F64, "" }, + { 0x6F65, "choke_hint_blinks" }, + { 0x6F66, "fade_out_choke_hint" }, +// { 0x6F67, "" }, + { 0x6F68, "use_hint" }, +// { 0x6F69, "" }, + { 0x6F6A, "use_hint_blink" }, +// { 0x6F6B, "" }, +// { 0x6F6C, "" }, +// { 0x6F6D, "" }, +// { 0x6F6E, "" }, + { 0x6F6F, "dof_crossfade_delta" }, +// { 0x6F70, "" }, +// { 0x6F71, "" }, +// { 0x6F72, "" }, +// { 0x6F73, "" }, +// { 0x6F74, "" }, +// { 0x6F75, "" }, +// { 0x6F76, "" }, + { 0x6F77, "setup_pip" }, +// { 0x6F78, "" }, +// { 0x6F79, "" }, +// { 0x6F7A, "" }, +// { 0x6F7B, "" }, +// { 0x6F7C, "" }, +// { 0x6F7D, "" }, +// { 0x6F7E, "" }, +// { 0x6F7F, "" }, + { 0x6F80, "pip_cam_lounge_scene" }, +// { 0x6F81, "" }, +// { 0x6F82, "" }, +// { 0x6F83, "" }, + { 0x6F84, "pip_cam_restaurant_scene" }, +// { 0x6F85, "" }, +// { 0x6F86, "" }, +// { 0x6F87, "" }, +// { 0x6F88, "" }, +// { 0x6F89, "" }, +// { 0x6F8A, "" }, +// { 0x6F8B, "" }, +// { 0x6F8C, "" }, +// { 0x6F8D, "" }, +// { 0x6F8E, "" }, + { 0x6F8F, "juggernaut_yuri" }, +// { 0x6F90, "" }, +// { 0x6F91, "" }, +// { 0x6F92, "" }, +// { 0x6F93, "" }, +// { 0x6F94, "" }, +// { 0x6F95, "" }, + { 0x6F96, "intro_yuri" }, + { 0x6F97, "intro_squibs" }, +// { 0x6F98, "" }, + { 0x6F99, "juggernaut_player" }, +// { 0x6F9A, "" }, +// { 0x6F9B, "" }, +// { 0x6F9C, "" }, +// { 0x6F9D, "" }, + { 0x6F9E, "intro_starting_enemies" }, +// { 0x6F9F, "" }, +// { 0x6FA0, "" }, +// { 0x6FA1, "" }, +// { 0x6FA2, "" }, +// { 0x6FA3, "" }, +// { 0x6FA4, "" }, +// { 0x6FA5, "" }, + { 0x6FA6, "exterior_initial_enemies_monitor_death" }, +// { 0x6FA7, "" }, +// { 0x6FA8, "" }, +// { 0x6FA9, "" }, +// { 0x6FAA, "" }, +// { 0x6FAB, "" }, +// { 0x6FAC, "" }, +// { 0x6FAD, "" }, +// { 0x6FAE, "" }, + { 0x6FAF, "exterior_suv_ai_think" }, +// { 0x6FB0, "" }, +// { 0x6FB1, "" }, +// { 0x6FB2, "" }, +// { 0x6FB3, "" }, +// { 0x6FB4, "" }, +// { 0x6FB5, "" }, +// { 0x6FB6, "" }, +// { 0x6FB7, "" }, +// { 0x6FB8, "" }, +// { 0x6FB9, "" }, +// { 0x6FBA, "" }, + { 0x6FBB, "lobby_combat_ascent" }, +// { 0x6FBC, "" }, +// { 0x6FBD, "" }, +// { 0x6FBE, "" }, + { 0x6FBF, "lobby_combat_top_right" }, +// { 0x6FC0, "" }, +// { 0x6FC1, "" }, +// { 0x6FC2, "" }, +// { 0x6FC3, "" }, +// { 0x6FC4, "" }, +// { 0x6FC5, "" }, +// { 0x6FC6, "" }, +// { 0x6FC7, "" }, +// { 0x6FC8, "" }, +// { 0x6FC9, "" }, +// { 0x6FCA, "" }, +// { 0x6FCB, "" }, +// { 0x6FCC, "" }, +// { 0x6FCD, "" }, +// { 0x6FCE, "" }, +// { 0x6FCF, "" }, +// { 0x6FD0, "" }, +// { 0x6FD1, "" }, +// { 0x6FD2, "" }, +// { 0x6FD3, "" }, +// { 0x6FD4, "" }, +// { 0x6FD5, "" }, +// { 0x6FD6, "" }, +// { 0x6FD7, "" }, +// { 0x6FD8, "" }, + { 0x6FD9, "keep_player_away_from_yuri" }, +// { 0x6FDA, "" }, +// { 0x6FDB, "" }, +// { 0x6FDC, "" }, +// { 0x6FDD, "" }, +// { 0x6FDE, "" }, +// { 0x6FDF, "" }, +// { 0x6FE0, "" }, +// { 0x6FE1, "" }, +// { 0x6FE2, "" }, +// { 0x6FE3, "" }, +// { 0x6FE4, "" }, +// { 0x6FE5, "" }, +// { 0x6FE6, "" }, +// { 0x6FE7, "" }, +// { 0x6FE8, "" }, +// { 0x6FE9, "" }, +// { 0x6FEA, "" }, +// { 0x6FEB, "" }, +// { 0x6FEC, "" }, +// { 0x6FED, "" }, +// { 0x6FEE, "" }, +// { 0x6FEF, "" }, +// { 0x6FF0, "" }, +// { 0x6FF1, "" }, +// { 0x6FF2, "" }, + { 0x6FF3, "elevator_attack_chopper_debug_health" }, +// { 0x6FF4, "" }, +// { 0x6FF5, "" }, +// { 0x6FF6, "" }, +// { 0x6FF7, "" }, +// { 0x6FF8, "" }, +// { 0x6FF9, "" }, +// { 0x6FFA, "" }, +// { 0x6FFB, "" }, +// { 0x6FFC, "" }, +// { 0x6FFD, "" }, +// { 0x6FFE, "" }, +// { 0x6FFF, "" }, + { 0x7000, "elevator_ambient_chopper_think" }, + { 0x7001, "top_floor_yuri_throw_grenade" }, +// { 0x7002, "" }, +// { 0x7003, "" }, + { 0x7004, "start_outdoor_lighting_roof_override" }, +// { 0x7005, "" }, + { 0x7006, "top_floor_lounge_combat_enemies_killed" }, +// { 0x7007, "" }, +// { 0x7008, "" }, +// { 0x7009, "" }, +// { 0x700A, "" }, +// { 0x700B, "" }, +// { 0x700C, "" }, +// { 0x700D, "" }, +// { 0x700E, "" }, +// { 0x700F, "" }, +// { 0x7010, "" }, +// { 0x7011, "" }, +// { 0x7012, "" }, +// { 0x7013, "" }, +// { 0x7014, "" }, +// { 0x7015, "" }, +// { 0x7016, "" }, +// { 0x7017, "" }, + { 0x7018, "top_floor_civilians_ambient_runners" }, +// { 0x7019, "" }, + { 0x701A, "restaurant_yuri_movement" }, +// { 0x701B, "" }, +// { 0x701C, "" }, +// { 0x701D, "" }, +// { 0x701E, "" }, +// { 0x701F, "" }, + { 0x7020, "restaurant_fix_pathing_remove_models" }, +// { 0x7021, "" }, +// { 0x7022, "" }, +// { 0x7023, "" }, +// { 0x7024, "" }, + { 0x7025, "restaurant_enemies_ai_think" }, +// { 0x7026, "" }, +// { 0x7027, "" }, +// { 0x7028, "" }, +// { 0x7029, "" }, +// { 0x702A, "" }, +// { 0x702B, "" }, +// { 0x702C, "" }, +// { 0x702D, "" }, +// { 0x702E, "" }, +// { 0x702F, "" }, +// { 0x7030, "" }, +// { 0x7031, "" }, +// { 0x7032, "" }, +// { 0x7033, "" }, +// { 0x7034, "" }, +// { 0x7035, "" }, +// { 0x7036, "" }, +// { 0x7037, "" }, +// { 0x7038, "" }, + { 0x7039, "restaurant_chopper_loop_path_think" }, +// { 0x703A, "" }, +// { 0x703B, "" }, +// { 0x703C, "" }, +// { 0x703D, "" }, +// { 0x703E, "" }, +// { 0x703F, "" }, +// { 0x7040, "" }, +// { 0x7041, "" }, +// { 0x7042, "" }, +// { 0x7043, "" }, +// { 0x7044, "" }, + { 0x7045, "handle_suv_damage" }, +// { 0x7046, "" }, +// { 0x7047, "" }, +// { 0x7048, "" }, +// { 0x7049, "" }, +// { 0x704A, "" }, + { 0x704B, "draw_label" }, +// { 0x704C, "" }, +// { 0x704D, "" }, +// { 0x704E, "" }, +// { 0x704F, "" }, +// { 0x7050, "" }, +// { 0x7051, "" }, +// { 0x7052, "" }, +// { 0x7053, "" }, +// { 0x7054, "" }, +// { 0x7055, "" }, +// { 0x7056, "" }, +// { 0x7057, "" }, +// { 0x7058, "" }, +// { 0x7059, "" }, +// { 0x705A, "" }, + { 0x705B, "dubai_restaurant_dialogue" }, +// { 0x705C, "" }, +// { 0x705D, "" }, +// { 0x705E, "" }, +// { 0x705F, "" }, + { 0x7060, "outside_fountain_pts" }, +// { 0x7061, "" }, +// { 0x7062, "" }, +// { 0x7063, "" }, + { 0x7064, "buttons_punched" }, +// { 0x7065, "" }, + { 0x7066, "aud_restaurant_destruction" }, +// { 0x7067, "" }, +// { 0x7068, "" }, +// { 0x7069, "" }, +// { 0x706A, "" }, +// { 0x706B, "" }, + { 0x706C, "aud_stop_outside_fountain" }, +// { 0x706D, "" }, +// { 0x706E, "" }, +// { 0x706F, "" }, +// { 0x7070, "" }, +// { 0x7071, "" }, +// { 0x7072, "" }, +// { 0x7073, "" }, +// { 0x7074, "" }, +// { 0x7075, "" }, +// { 0x7076, "" }, +// { 0x7077, "" }, + { 0x7078, "aud_elevator_chopper" }, + { 0x7079, "aud_elevator_move" }, + { 0x707A, "aud_elevator_oneshots" }, +// { 0x707B, "" }, +// { 0x707C, "" }, +// { 0x707D, "" }, +// { 0x707E, "" }, +// { 0x707F, "" }, + { 0x7080, "aud_whoosh_sweetner" }, +// { 0x7081, "" }, +// { 0x7082, "" }, +// { 0x7083, "" }, +// { 0x7084, "" }, + { 0x7085, "aud_handle_stick_pos" }, +// { 0x7086, "" }, +// { 0x7087, "" }, +// { 0x7088, "" }, +// { 0x7089, "" }, +// { 0x708A, "" }, +// { 0x708B, "" }, +// { 0x708C, "" }, +// { 0x708D, "" }, +// { 0x708E, "" }, +// { 0x708F, "" }, + { 0x7090, "set_completed_objective_flags" }, +// { 0x7091, "" }, +// { 0x7092, "" }, +// { 0x7093, "" }, + { 0x7094, "start_elevator" }, +// { 0x7095, "" }, +// { 0x7096, "" }, +// { 0x7097, "" }, +// { 0x7098, "" }, +// { 0x7099, "" }, + { 0x709A, "start_restaurant_exit" }, +// { 0x709B, "" }, + { 0x709C, "start_finale_crash_site" }, +// { 0x709D, "" }, + { 0x709E, "start_finale_ending" }, +// { 0x709F, "" }, +// { 0x70A0, "" }, +// { 0x70A1, "" }, +// { 0x70A2, "" }, +// { 0x70A3, "" }, + { 0x70A4, "paris_intro_screen" }, + { 0x70A5, "little_bird_fly_away" }, +// { 0x70A6, "" }, + { 0x70A7, "hero_reno" }, +// { 0x70A8, "" }, + { 0x70A9, "little_bird_camera_shake_stop" }, +// { 0x70AA, "" }, + { 0x70AB, "intro_roof_jumpdown_lone_star" }, +// { 0x70AC, "" }, +// { 0x70AD, "" }, +// { 0x70AE, "" }, +// { 0x70AF, "" }, + { 0x70B0, "check_vitals_corpse" }, + { 0x70B1, "move_debris_model" }, + { 0x70B2, "move_debris_model_model" }, +// { 0x70B3, "" }, +// { 0x70B4, "" }, +// { 0x70B5, "" }, +// { 0x70B6, "" }, +// { 0x70B7, "" }, + { 0x70B8, "shimmy_moment_register_npc" }, + { 0x70B9, "shimmy_users" }, + { 0x70BA, "shimmy_moment_get_closest_npc" }, + { 0x70BB, "jets_flyby_01" }, +// { 0x70BC, "" }, +// { 0x70BD, "" }, +// { 0x70BE, "" }, +// { 0x70BF, "" }, +// { 0x70C0, "" }, +// { 0x70C1, "" }, +// { 0x70C2, "" }, +// { 0x70C3, "" }, + { 0x70C4, "balcony_death_notetrack_intercept" }, +// { 0x70C5, "" }, +// { 0x70C6, "" }, + { 0x70C7, "bookstore_runners" }, +// { 0x70C8, "" }, +// { 0x70C9, "" }, +// { 0x70CA, "" }, +// { 0x70CB, "" }, +// { 0x70CC, "" }, +// { 0x70CD, "" }, +// { 0x70CE, "" }, +// { 0x70CF, "" }, +// { 0x70D0, "" }, + { 0x70D1, "alley_gign" }, +// { 0x70D2, "" }, +// { 0x70D3, "" }, +// { 0x70D4, "" }, +// { 0x70D5, "" }, +// { 0x70D6, "" }, +// { 0x70D7, "" }, +// { 0x70D8, "" }, +// { 0x70D9, "" }, +// { 0x70DA, "" }, +// { 0x70DB, "" }, +// { 0x70DC, "" }, +// { 0x70DD, "" }, +// { 0x70DE, "" }, +// { 0x70DF, "" }, +// { 0x70E0, "" }, +// { 0x70E1, "" }, +// { 0x70E2, "" }, + { 0x70E3, "conversation_blocker_guard" }, +// { 0x70E4, "" }, + { 0x70E5, "frenchie_exit_kitchen" }, +// { 0x70E6, "" }, +// { 0x70E7, "" }, + { 0x70E8, "restaurant_meeting_random_shots" }, +// { 0x70E9, "" }, + { 0x70EA, "courtyard_1_wave_4" }, +// { 0x70EB, "" }, + { 0x70EC, "tanks_side_alley_01" }, +// { 0x70ED, "" }, + { 0x70EE, "tank_side_alley_01_think" }, +// { 0x70EF, "" }, + { 0x70F0, "spawn_civ_corpses_ac_alley" }, +// { 0x70F1, "" }, + { 0x70F2, "ac_alley_ai_blocker" }, +// { 0x70F3, "" }, +// { 0x70F4, "" }, +// { 0x70F5, "" }, +// { 0x70F6, "" }, +// { 0x70F7, "" }, +// { 0x70F8, "" }, + { 0x70F9, "air_support_strobe_fire_hint" }, +// { 0x70FA, "" }, +// { 0x70FB, "" }, +// { 0x70FC, "" }, +// { 0x70FD, "" }, +// { 0x70FE, "" }, +// { 0x70FF, "" }, +// { 0x7100, "" }, +// { 0x7101, "" }, +// { 0x7102, "" }, +// { 0x7103, "" }, +// { 0x7104, "" }, +// { 0x7105, "" }, +// { 0x7106, "" }, +// { 0x7107, "" }, +// { 0x7108, "" }, +// { 0x7109, "" }, +// { 0x710A, "" }, +// { 0x710B, "" }, +// { 0x710C, "" }, +// { 0x710D, "" }, +// { 0x710E, "" }, +// { 0x710F, "" }, + { 0x7110, "frenchie_goto_manhole" }, +// { 0x7111, "" }, +// { 0x7112, "" }, + { 0x7113, "gaz_crash_site_back_alley" }, + { 0x7114, "enemies_ignore_player_until_shot_or_hot" }, +// { 0x7115, "" }, +// { 0x7116, "" }, +// { 0x7117, "" }, +// { 0x7118, "" }, + { 0x7119, "max_left" }, +// { 0x711A, "" }, + { 0x711B, "dir_to_next" }, +// { 0x711C, "" }, +// { 0x711D, "" }, + { 0x711E, "unlink_beginning_angles" }, +// { 0x711F, "" }, +// { 0x7120, "" }, + { 0x7121, "segment_forward" }, +// { 0x7122, "" }, + { 0x7123, "decel_time" }, + { 0x7124, "accel_time" }, +// { 0x7125, "" }, +// { 0x7126, "" }, +// { 0x7127, "" }, +// { 0x7128, "" }, +// { 0x7129, "" }, +// { 0x712A, "" }, +// { 0x712B, "" }, +// { 0x712C, "" }, +// { 0x712D, "" }, +// { 0x712E, "" }, +// { 0x712F, "" }, +// { 0x7130, "" }, +// { 0x7131, "" }, + { 0x7132, "generic_human_anims" }, +// { 0x7133, "" }, +// { 0x7134, "" }, +// { 0x7135, "" }, +// { 0x7136, "" }, + { 0x7137, "maps/createart/paris_a_art" }, +// { 0x7138, "" }, + { 0x7139, "debug_start_stairwell" }, +// { 0x713A, "" }, +// { 0x713B, "" }, +// { 0x713C, "" }, +// { 0x713D, "" }, +// { 0x713E, "" }, +// { 0x713F, "" }, +// { 0x7140, "" }, +// { 0x7141, "" }, +// { 0x7142, "" }, + { 0x7143, "obj_meet_with_gign" }, + { 0x7144, "obj_follow_gign" }, +// { 0x7145, "" }, +// { 0x7146, "" }, +// { 0x7147, "" }, +// { 0x7148, "" }, +// { 0x7149, "" }, +// { 0x714A, "" }, +// { 0x714B, "" }, +// { 0x714C, "" }, + { 0x714D, "catacombs_nag_in_progress" }, +// { 0x714E, "" }, + { 0x714F, "catacombs_nag_dialogue_stop" }, +// { 0x7150, "" }, + { 0x7151, "catacombs_bodies_dialogue" }, +// { 0x7152, "" }, +// { 0x7153, "" }, +// { 0x7154, "" }, +// { 0x7155, "" }, +// { 0x7156, "" }, + { 0x7157, "volk_up_ahead_dialogue" }, +// { 0x7158, "" }, +// { 0x7159, "" }, +// { 0x715A, "" }, +// { 0x715B, "" }, +// { 0x715C, "" }, +// { 0x715D, "" }, +// { 0x715E, "" }, + { 0x715F, "proceed_canal_dialogue" }, + { 0x7160, "hind_gallery_dialogue" }, +// { 0x7161, "" }, +// { 0x7162, "" }, +// { 0x7163, "" }, +// { 0x7164, "" }, +// { 0x7165, "" }, +// { 0x7166, "" }, +// { 0x7167, "" }, +// { 0x7168, "" }, +// { 0x7169, "" }, +// { 0x716A, "" }, +// { 0x716B, "" }, +// { 0x716C, "" }, +// { 0x716D, "" }, +// { 0x716E, "" }, +// { 0x716F, "" }, +// { 0x7170, "" }, +// { 0x7171, "" }, +// { 0x7172, "" }, +// { 0x7173, "" }, +// { 0x7174, "" }, +// { 0x7175, "" }, +// { 0x7176, "" }, +// { 0x7177, "" }, +// { 0x7178, "" }, +// { 0x7179, "" }, +// { 0x717A, "" }, + { 0x717B, "fx_climber_shot" }, +// { 0x717C, "" }, +// { 0x717D, "" }, + { 0x717E, "fx_glass_drag_start" }, +// { 0x717F, "" }, +// { 0x7180, "" }, +// { 0x7181, "" }, +// { 0x7182, "" }, +// { 0x7183, "" }, +// { 0x7184, "" }, +// { 0x7185, "" }, +// { 0x7186, "" }, +// { 0x7187, "" }, + { 0x7188, "catacombs_lone_star_logic" }, +// { 0x7189, "" }, +// { 0x718A, "" }, +// { 0x718B, "" }, +// { 0x718C, "" }, +// { 0x718D, "" }, +// { 0x718E, "" }, +// { 0x718F, "" }, + { 0x7190, "flashlight_guy_start" }, + { 0x7191, "flashlight_guy_stop" }, +// { 0x7192, "" }, +// { 0x7193, "" }, +// { 0x7194, "" }, +// { 0x7195, "" }, + { 0x7196, "catacombs_enemy_gate_gag" }, +// { 0x7197, "" }, +// { 0x7198, "" }, +// { 0x7199, "" }, +// { 0x719A, "" }, +// { 0x719B, "" }, +// { 0x719C, "" }, +// { 0x719D, "" }, +// { 0x719E, "" }, +// { 0x719F, "" }, +// { 0x71A0, "" }, +// { 0x71A1, "" }, +// { 0x71A2, "" }, +// { 0x71A3, "" }, +// { 0x71A4, "" }, +// { 0x71A5, "" }, +// { 0x71A6, "" }, +// { 0x71A7, "" }, +// { 0x71A8, "" }, +// { 0x71A9, "" }, + { 0x71AA, "infrastructure_hall_complete" }, +// { 0x71AB, "" }, +// { 0x71AC, "" }, + { 0x71AD, "combat_boiler_room_exit" }, +// { 0x71AE, "" }, +// { 0x71AF, "" }, +// { 0x71B0, "" }, +// { 0x71B1, "" }, +// { 0x71B2, "" }, + { 0x71B3, "unblock_ai_path_volk_sedan_escape" }, + { 0x71B4, "ali_convoy_vehicle_2" }, + { 0x71B5, "ali_convoy_vehicle_3" }, +// { 0x71B6, "" }, +// { 0x71B7, "" }, + { 0x71B8, "ai_enemy_chase_encounter_spawn_function" }, + { 0x71B9, "van_ride_set_view_clamp" }, +// { 0x71BA, "" }, + { 0x71BB, "arc_right" }, +// { 0x71BC, "" }, +// { 0x71BD, "" }, +// { 0x71BE, "" }, +// { 0x71BF, "" }, +// { 0x71C0, "" }, +// { 0x71C1, "" }, +// { 0x71C2, "" }, +// { 0x71C3, "" }, +// { 0x71C4, "" }, + { 0x71C5, "chase_vehicles_initial_combat" }, +// { 0x71C6, "" }, +// { 0x71C7, "" }, +// { 0x71C8, "" }, +// { 0x71C9, "" }, +// { 0x71CA, "" }, +// { 0x71CB, "" }, + { 0x71CC, "van_climb_paired_deathfunc" }, +// { 0x71CD, "" }, + { 0x71CE, "tank_aim_turret_local" }, +// { 0x71CF, "" }, +// { 0x71D0, "" }, + { 0x71D1, "tank_aim_turret" }, +// { 0x71D2, "" }, +// { 0x71D3, "" }, +// { 0x71D4, "" }, +// { 0x71D5, "" }, +// { 0x71D6, "" }, +// { 0x71D7, "" }, +// { 0x71D8, "" }, +// { 0x71D9, "" }, +// { 0x71DA, "" }, +// { 0x71DB, "" }, + { 0x71DC, "fake_rpg_chase_2" }, +// { 0x71DD, "" }, +// { 0x71DE, "" }, +// { 0x71DF, "" }, +// { 0x71E0, "" }, +// { 0x71E1, "" }, + { 0x71E2, "ai_clean_up_mid_canal" }, +// { 0x71E3, "" }, +// { 0x71E4, "" }, +// { 0x71E5, "" }, + { 0x71E6, "heli_canal_pass_01" }, +// { 0x71E7, "" }, +// { 0x71E8, "" }, +// { 0x71E9, "" }, +// { 0x71EA, "" }, +// { 0x71EB, "" }, +// { 0x71EC, "" }, +// { 0x71ED, "" }, +// { 0x71EE, "" }, +// { 0x71EF, "" }, +// { 0x71F0, "" }, + { 0x71F1, "hide_destruct_parts" }, + { 0x71F2, "final_crash_moment_player" }, + { 0x71F3, "final_crash_moment_player_notetracks" }, +// { 0x71F4, "" }, +// { 0x71F5, "" }, +// { 0x71F6, "" }, +// { 0x71F7, "" }, +// { 0x71F8, "" }, +// { 0x71F9, "" }, +// { 0x71FA, "" }, +// { 0x71FB, "" }, + { 0x71FC, "final_crash_moment_driver" }, +// { 0x71FD, "" }, +// { 0x71FE, "" }, +// { 0x71FF, "" }, +// { 0x7200, "" }, +// { 0x7201, "" }, +// { 0x7202, "" }, + { 0x7203, "chase_ending_moment" }, + { 0x7204, "anim_single_solo_and_stop" }, +// { 0x7205, "" }, +// { 0x7206, "" }, +// { 0x7207, "" }, +// { 0x7208, "" }, +// { 0x7209, "" }, +// { 0x720A, "" }, +// { 0x720B, "" }, +// { 0x720C, "" }, +// { 0x720D, "" }, +// { 0x720E, "" }, +// { 0x720F, "" }, + { 0x7210, "escape_timer_countdown" }, +// { 0x7211, "" }, +// { 0x7212, "" }, +// { 0x7213, "" }, +// { 0x7214, "" }, +// { 0x7215, "" }, + { 0x7216, "reduce_turret_accuracy" }, +// { 0x7217, "" }, +// { 0x7218, "" }, +// { 0x7219, "" }, +// { 0x721A, "" }, + { 0x721B, "flare_flicker" }, +// { 0x721C, "" }, +// { 0x721D, "" }, +// { 0x721E, "" }, + { 0x721F, "player_enters_truck" }, +// { 0x7220, "" }, + { 0x7221, "spawn_van_ride_weapon" }, +// { 0x7222, "" }, +// { 0x7223, "" }, +// { 0x7224, "" }, + { 0x7225, "player_move_to_back" }, +// { 0x7226, "" }, +// { 0x7227, "" }, +// { 0x7228, "" }, +// { 0x7229, "" }, +// { 0x722A, "" }, +// { 0x722B, "" }, + { 0x722C, "best_enemy_pos" }, +// { 0x722D, "" }, +// { 0x722E, "" }, +// { 0x722F, "" }, +// { 0x7230, "" }, +// { 0x7231, "" }, +// { 0x7232, "" }, +// { 0x7233, "" }, +// { 0x7234, "" }, + { 0x7235, "lonestar_choose_anim" }, +// { 0x7236, "" }, +// { 0x7237, "" }, +// { 0x7238, "" }, +// { 0x7239, "" }, +// { 0x723A, "" }, +// { 0x723B, "" }, + { 0x723C, "camera_shake_small" }, +// { 0x723D, "" }, +// { 0x723E, "" }, +// { 0x723F, "" }, + { 0x7240, "show_van_door" }, +// { 0x7241, "" }, +// { 0x7242, "" }, +// { 0x7243, "" }, +// { 0x7244, "" }, +// { 0x7245, "" }, +// { 0x7246, "" }, +// { 0x7247, "" }, +// { 0x7248, "" }, +// { 0x7249, "" }, +// { 0x724A, "" }, +// { 0x724B, "" }, +// { 0x724C, "" }, +// { 0x724D, "" }, +// { 0x724E, "" }, +// { 0x724F, "" }, +// { 0x7250, "" }, +// { 0x7251, "" }, + { 0x7252, "catacombs_logic" }, +// { 0x7253, "" }, +// { 0x7254, "" }, +// { 0x7255, "" }, +// { 0x7256, "" }, +// { 0x7257, "" }, +// { 0x7258, "" }, +// { 0x7259, "" }, +// { 0x725A, "" }, +// { 0x725B, "" }, +// { 0x725C, "" }, +// { 0x725D, "" }, +// { 0x725E, "" }, +// { 0x725F, "" }, +// { 0x7260, "" }, +// { 0x7261, "" }, +// { 0x7262, "" }, +// { 0x7263, "" }, +// { 0x7264, "" }, +// { 0x7265, "" }, +// { 0x7266, "" }, +// { 0x7267, "" }, +// { 0x7268, "" }, +// { 0x7269, "" }, +// { 0x726A, "" }, +// { 0x726B, "" }, +// { 0x726C, "" }, +// { 0x726D, "" }, +// { 0x726E, "" }, +// { 0x726F, "" }, +// { 0x7270, "" }, +// { 0x7271, "" }, +// { 0x7272, "" }, + { 0x7273, "victim_roof" }, +// { 0x7274, "" }, +// { 0x7275, "" }, + { 0x7276, "stab_fx_function" }, + { 0x7277, "roof_sniper_nag_lines" }, +// { 0x7278, "" }, +// { 0x7279, "" }, +// { 0x727A, "" }, +// { 0x727B, "" }, + { 0x727C, "guys_on_roof_stealth_alerted" }, +// { 0x727D, "" }, +// { 0x727E, "" }, +// { 0x727F, "" }, +// { 0x7280, "" }, +// { 0x7281, "" }, +// { 0x7282, "" }, +// { 0x7283, "" }, +// { 0x7284, "" }, +// { 0x7285, "" }, +// { 0x7286, "" }, +// { 0x7287, "" }, +// { 0x7288, "" }, +// { 0x7289, "" }, +// { 0x728A, "" }, +// { 0x728B, "" }, +// { 0x728C, "" }, +// { 0x728D, "" }, +// { 0x728E, "" }, +// { 0x728F, "" }, +// { 0x7290, "" }, +// { 0x7291, "" }, +// { 0x7292, "" }, +// { 0x7293, "" }, +// { 0x7294, "" }, + { 0x7295, "pre_courtyard_think" }, +// { 0x7296, "" }, +// { 0x7297, "" }, + { 0x7298, "interrupt_anim_on_alert_or_damage_courtyard_kill" }, +// { 0x7299, "" }, +// { 0x729A, "" }, +// { 0x729B, "" }, +// { 0x729C, "" }, +// { 0x729D, "" }, +// { 0x729E, "" }, +// { 0x729F, "" }, +// { 0x72A0, "" }, + { 0x72A1, "shoot_cars_so_their_dead" }, +// { 0x72A2, "" }, +// { 0x72A3, "" }, +// { 0x72A4, "" }, +// { 0x72A5, "" }, +// { 0x72A6, "" }, +// { 0x72A7, "" }, +// { 0x72A8, "" }, +// { 0x72A9, "" }, +// { 0x72AA, "" }, +// { 0x72AB, "" }, + { 0x72AC, "price_exhales" }, +// { 0x72AD, "" }, +// { 0x72AE, "" }, +// { 0x72AF, "" }, +// { 0x72B0, "" }, + { 0x72B1, "plaza_setup" }, +// { 0x72B2, "" }, +// { 0x72B3, "" }, +// { 0x72B4, "" }, +// { 0x72B5, "" }, +// { 0x72B6, "" }, +// { 0x72B7, "" }, + { 0x72B8, "kill_player_if_waits_too_long" }, +// { 0x72B9, "" }, +// { 0x72BA, "" }, +// { 0x72BB, "" }, +// { 0x72BC, "" }, +// { 0x72BD, "" }, +// { 0x72BE, "" }, +// { 0x72BF, "" }, +// { 0x72C0, "" }, +// { 0x72C1, "" }, +// { 0x72C2, "" }, +// { 0x72C3, "" }, +// { 0x72C4, "" }, +// { 0x72C5, "" }, +// { 0x72C6, "" }, +// { 0x72C7, "" }, +// { 0x72C8, "" }, + { 0x72C9, "child_of_men" }, + { 0x72CA, "plaza_clean_up" }, + { 0x72CB, "btr_target_player_two" }, +// { 0x72CC, "" }, +// { 0x72CD, "" }, +// { 0x72CE, "" }, +// { 0x72CF, "" }, +// { 0x72D0, "" }, +// { 0x72D1, "" }, +// { 0x72D2, "" }, +// { 0x72D3, "" }, +// { 0x72D4, "" }, +// { 0x72D5, "" }, +// { 0x72D6, "" }, + { 0x72D7, "grab_rpg_nag_lines" }, +// { 0x72D8, "" }, +// { 0x72D9, "" }, + { 0x72DA, "player_has_rpg" }, +// { 0x72DB, "" }, +// { 0x72DC, "" }, + { 0x72DD, "should_break_scope_hint" }, + { 0x72DE, "cqb_trigger" }, +// { 0x72DF, "" }, +// { 0x72E0, "" }, +// { 0x72E1, "" }, +// { 0x72E2, "" }, +// { 0x72E3, "" }, +// { 0x72E4, "" }, +// { 0x72E5, "" }, +// { 0x72E6, "" }, + { 0x72E7, "church_tank_crush" }, +// { 0x72E8, "" }, +// { 0x72E9, "" }, +// { 0x72EA, "" }, +// { 0x72EB, "" }, +// { 0x72EC, "" }, +// { 0x72ED, "" }, +// { 0x72EE, "" }, + { 0x72EF, "kick_boards_over" }, +// { 0x72F0, "" }, +// { 0x72F1, "" }, +// { 0x72F2, "" }, +// { 0x72F3, "" }, +// { 0x72F4, "" }, +// { 0x72F5, "" }, +// { 0x72F6, "" }, +// { 0x72F7, "" }, +// { 0x72F8, "" }, +// { 0x72F9, "" }, + { 0x72FA, "if_damage_notify_all" }, + { 0x72FB, "if_damage_clear_settings_and_attack" }, +// { 0x72FC, "" }, + { 0x72FD, "dead_body_spawner_trigger_ludes_think" }, +// { 0x72FE, "" }, +// { 0x72FF, "" }, +// { 0x7300, "" }, +// { 0x7301, "" }, +// { 0x7302, "" }, +// { 0x7303, "" }, +// { 0x7304, "" }, +// { 0x7305, "" }, +// { 0x7306, "" }, +// { 0x7307, "" }, +// { 0x7308, "" }, +// { 0x7309, "" }, +// { 0x730A, "" }, +// { 0x730B, "" }, +// { 0x730C, "" }, +// { 0x730D, "" }, +// { 0x730E, "" }, +// { 0x730F, "" }, +// { 0x7310, "" }, +// { 0x7311, "" }, +// { 0x7312, "" }, +// { 0x7313, "" }, +// { 0x7314, "" }, +// { 0x7315, "" }, +// { 0x7316, "" }, +// { 0x7317, "" }, +// { 0x7318, "" }, +// { 0x7319, "" }, +// { 0x731A, "" }, +// { 0x731B, "" }, +// { 0x731C, "" }, +// { 0x731D, "" }, + { 0x731E, "start_apartments" }, +// { 0x731F, "" }, +// { 0x7320, "" }, +// { 0x7321, "" }, +// { 0x7322, "" }, +// { 0x7323, "" }, + { 0x7324, "alley_setup" }, +// { 0x7325, "" }, +// { 0x7326, "" }, +// { 0x7327, "" }, +// { 0x7328, "" }, +// { 0x7329, "" }, +// { 0x732A, "" }, +// { 0x732B, "" }, +// { 0x732C, "" }, +// { 0x732D, "" }, +// { 0x732E, "" }, +// { 0x732F, "" }, +// { 0x7330, "" }, +// { 0x7331, "" }, +// { 0x7332, "" }, +// { 0x7333, "" }, +// { 0x7334, "" }, +// { 0x7335, "" }, +// { 0x7336, "" }, +// { 0x7337, "" }, +// { 0x7338, "" }, +// { 0x7339, "" }, +// { 0x733A, "" }, + { 0x733B, "xmodelalias/alias_chemwar_russian_heads" }, +// { 0x733C, "" }, +// { 0x733D, "" }, +// { 0x733E, "" }, +// { 0x733F, "" }, +// { 0x7340, "" }, +// { 0x7341, "" }, + { 0x7342, "character/character_chemwar_russian_assault_dd" }, +// { 0x7343, "" }, + { 0x7344, "xmodelalias/alias_civilian_bodies_female" }, +// { 0x7345, "" }, +// { 0x7346, "" }, +// { 0x7347, "" }, +// { 0x7348, "" }, +// { 0x7349, "" }, +// { 0x734A, "" }, +// { 0x734B, "" }, +// { 0x734C, "" }, +// { 0x734D, "" }, +// { 0x734E, "" }, +// { 0x734F, "" }, +// { 0x7350, "" }, +// { 0x7351, "" }, +// { 0x7352, "" }, +// { 0x7353, "" }, +// { 0x7354, "" }, +// { 0x7355, "" }, + { 0x7356, "train_get_targeting_train_node" }, +// { 0x7357, "" }, +// { 0x7358, "" }, +// { 0x7359, "" }, +// { 0x735A, "" }, +// { 0x735B, "" }, +// { 0x735C, "" }, +// { 0x735D, "" }, +// { 0x735E, "" }, +// { 0x735F, "" }, + { 0x7360, "needs_to_take_detours" }, +// { 0x7361, "" }, + { 0x7362, "pillar_flag" }, +// { 0x7363, "" }, + { 0x7364, "pillar_exploders" }, +// { 0x7365, "" }, +// { 0x7366, "" }, + { 0x7367, "ontrain" }, +// { 0x7368, "" }, +// { 0x7369, "" }, +// { 0x736A, "" }, +// { 0x736B, "" }, +// { 0x736C, "" }, +// { 0x736D, "" }, +// { 0x736E, "" }, +// { 0x736F, "" }, +// { 0x7370, "" }, + { 0x7371, "cleanup_post_ride" }, +// { 0x7372, "" }, + { 0x7373, "restore_when_get_to_goal" }, +// { 0x7374, "" }, +// { 0x7375, "" }, +// { 0x7376, "" }, +// { 0x7377, "" }, + { 0x7378, "get_vehicle_node_by_origin" }, +// { 0x7379, "" }, +// { 0x737A, "" }, +// { 0x737B, "" }, + { 0x737C, "player_truck_ghost" }, +// { 0x737D, "" }, +// { 0x737E, "" }, +// { 0x737F, "" }, + { 0x7380, "start_train_mid" }, +// { 0x7381, "" }, +// { 0x7382, "" }, +// { 0x7383, "" }, + { 0x7384, "script_vehicle_subway_engine_destructible_think" }, +// { 0x7385, "" }, +// { 0x7386, "" }, +// { 0x7387, "" }, +// { 0x7388, "" }, +// { 0x7389, "" }, +// { 0x738A, "" }, +// { 0x738B, "" }, +// { 0x738C, "" }, +// { 0x738D, "" }, +// { 0x738E, "" }, +// { 0x738F, "" }, +// { 0x7390, "" }, +// { 0x7391, "" }, +// { 0x7392, "" }, +// { 0x7393, "" }, +// { 0x7394, "" }, +// { 0x7395, "" }, +// { 0x7396, "" }, +// { 0x7397, "" }, + { 0x7398, "train_spawn_guy_intro" }, +// { 0x7399, "" }, +// { 0x739A, "" }, +// { 0x739B, "" }, +// { 0x739C, "" }, +// { 0x739D, "" }, +// { 0x739E, "" }, +// { 0x739F, "" }, + { 0x73A0, "guy_gets_on_new_node" }, +// { 0x73A1, "" }, + { 0x73A2, "guy_get_on_train" }, +// { 0x73A3, "" }, +// { 0x73A4, "" }, +// { 0x73A5, "" }, +// { 0x73A6, "" }, +// { 0x73A7, "" }, +// { 0x73A8, "" }, +// { 0x73A9, "" }, + { 0x73AA, "train_civilians_go_think" }, +// { 0x73AB, "" }, +// { 0x73AC, "" }, +// { 0x73AD, "" }, +// { 0x73AE, "" }, +// { 0x73AF, "" }, +// { 0x73B0, "" }, +// { 0x73B1, "" }, +// { 0x73B2, "" }, +// { 0x73B3, "" }, +// { 0x73B4, "" }, +// { 0x73B5, "" }, +// { 0x73B6, "" }, +// { 0x73B7, "" }, +// { 0x73B8, "" }, +// { 0x73B9, "" }, +// { 0x73BA, "" }, +// { 0x73BB, "" }, +// { 0x73BC, "" }, +// { 0x73BD, "" }, +// { 0x73BE, "" }, + { 0x73BF, "ground_ent_to_tag" }, +// { 0x73C0, "" }, +// { 0x73C1, "" }, +// { 0x73C2, "" }, +// { 0x73C3, "" }, +// { 0x73C4, "" }, +// { 0x73C5, "" }, +// { 0x73C6, "" }, +// { 0x73C7, "" }, +// { 0x73C8, "" }, + { 0x73C9, "littlebird_shoot_train" }, +// { 0x73CA, "" }, +// { 0x73CB, "" }, +// { 0x73CC, "" }, +// { 0x73CD, "" }, +// { 0x73CE, "" }, +// { 0x73CF, "" }, + { 0x73D0, "rocky_road_trigger" }, +// { 0x73D1, "" }, +// { 0x73D2, "" }, +// { 0x73D3, "" }, +// { 0x73D4, "" }, +// { 0x73D5, "" }, +// { 0x73D6, "" }, +// { 0x73D7, "" }, +// { 0x73D8, "" }, +// { 0x73D9, "" }, +// { 0x73DA, "" }, +// { 0x73DB, "" }, +// { 0x73DC, "" }, +// { 0x73DD, "" }, +// { 0x73DE, "" }, +// { 0x73DF, "" }, + { 0x73E0, "init_tunnels" }, + { 0x73E1, "truck_trigger_by_jump" }, +// { 0x73E2, "" }, +// { 0x73E3, "" }, +// { 0x73E4, "" }, +// { 0x73E5, "" }, +// { 0x73E6, "" }, +// { 0x73E7, "" }, +// { 0x73E8, "" }, +// { 0x73E9, "" }, + { 0x73EA, "train_chase_transition" }, +// { 0x73EB, "" }, +// { 0x73EC, "" }, +// { 0x73ED, "" }, + { 0x73EE, "player_ride_link_player" }, + { 0x73EF, "player_crash_truck" }, +// { 0x73F0, "" }, +// { 0x73F1, "" }, +// { 0x73F2, "" }, +// { 0x73F3, "" }, +// { 0x73F4, "" }, +// { 0x73F5, "" }, +// { 0x73F6, "" }, +// { 0x73F7, "" }, + { 0x73F8, "friend_truck_gunner" }, +// { 0x73F9, "" }, +// { 0x73FA, "" }, +// { 0x73FB, "" }, +// { 0x73FC, "" }, +// { 0x73FD, "" }, +// { 0x73FE, "" }, +// { 0x73FF, "" }, +// { 0x7400, "" }, +// { 0x7401, "" }, +// { 0x7402, "" }, + { 0x7403, "disable_weapons_on_explode" }, +// { 0x7404, "" }, +// { 0x7405, "" }, +// { 0x7406, "" }, +// { 0x7407, "" }, +// { 0x7408, "" }, +// { 0x7409, "" }, +// { 0x740A, "" }, +// { 0x740B, "" }, +// { 0x740C, "" }, +// { 0x740D, "" }, +// { 0x740E, "" }, +// { 0x740F, "" }, +// { 0x7410, "" }, + { 0x7411, "anim_vehicles" }, + { 0x7412, "force_door_shut" }, +// { 0x7413, "" }, +// { 0x7414, "" }, + { 0x7415, "subway_fallover" }, +// { 0x7416, "" }, +// { 0x7417, "" }, +// { 0x7418, "" }, +// { 0x7419, "" }, + { 0x741A, "sparks_stop_half" }, +// { 0x741B, "" }, +// { 0x741C, "" }, +// { 0x741D, "" }, +// { 0x741E, "" }, +// { 0x741F, "" }, +// { 0x7420, "" }, +// { 0x7421, "" }, +// { 0x7422, "" }, +// { 0x7423, "" }, +// { 0x7424, "" }, + { 0x7425, "broken_front_2_impact" }, +// { 0x7426, "" }, +// { 0x7427, "" }, +// { 0x7428, "" }, +// { 0x7429, "" }, +// { 0x742A, "" }, +// { 0x742B, "" }, + { 0x742C, "glass_break" }, +// { 0x742D, "" }, +// { 0x742E, "" }, +// { 0x742F, "" }, + { 0x7430, "character/character_sp_hyena" }, + { 0x7431, "xmodelalias/alias_africa_civilian_male_heads" }, +// { 0x7432, "" }, +// { 0x7433, "" }, +// { 0x7434, "" }, +// { 0x7435, "" }, + { 0x7436, "character/character_africa_militia_assault_d" }, +// { 0x7437, "" }, +// { 0x7438, "" }, +// { 0x7439, "" }, +// { 0x743A, "" }, +// { 0x743B, "" }, +// { 0x743C, "" }, +// { 0x743D, "" }, +// { 0x743E, "" }, + { 0x743F, "get_hero_by_name" }, +// { 0x7440, "" }, +// { 0x7441, "" }, +// { 0x7442, "" }, + { 0x7443, "get_new_anim_node" }, +// { 0x7444, "" }, +// { 0x7445, "" }, + { 0x7446, "prague_objective_add_on_ai" }, +// { 0x7447, "" }, +// { 0x7448, "" }, +// { 0x7449, "" }, +// { 0x744A, "" }, +// { 0x744B, "" }, +// { 0x744C, "" }, + { 0x744D, "set_screen_fade_shader" }, +// { 0x744E, "" }, +// { 0x744F, "" }, +// { 0x7450, "" }, +// { 0x7451, "" }, +// { 0x7452, "" }, +// { 0x7453, "" }, +// { 0x7454, "" }, +// { 0x7455, "" }, + { 0x7456, "play_heavy_rumble" }, +// { 0x7457, "" }, +// { 0x7458, "" }, +// { 0x7459, "" }, +// { 0x745A, "" }, + { 0x745B, "elevator_rumble_blood" }, +// { 0x745C, "" }, +// { 0x745D, "" }, +// { 0x745E, "" }, + { 0x745F, "hide_player_hud" }, +// { 0x7460, "" }, +// { 0x7461, "" }, +// { 0x7462, "" }, + { 0x7463, "monitor_player_distance" }, +// { 0x7464, "" }, +// { 0x7465, "" }, +// { 0x7466, "" }, + { 0x7467, "price_soap_kill" }, +// { 0x7468, "" }, +// { 0x7469, "" }, +// { 0x746A, "" }, +// { 0x746B, "" }, +// { 0x746C, "" }, + { 0x746D, "start_airport" }, +// { 0x746E, "" }, +// { 0x746F, "" }, + { 0x7470, "init_airlift" }, +// { 0x7471, "" }, + { 0x7472, "nuke_flashback" }, + { 0x7473, "nuke_explosion" }, +// { 0x7474, "" }, +// { 0x7475, "" }, +// { 0x7476, "" }, +// { 0x7477, "" }, +// { 0x7478, "" }, +// { 0x7479, "" }, +// { 0x747A, "" }, + { 0x747B, "xmodelalias/alias_russian_military_prague_heads" }, +// { 0x747C, "" }, +// { 0x747D, "" }, +// { 0x747E, "" }, +// { 0x747F, "" }, +// { 0x7480, "" }, +// { 0x7481, "" }, +// { 0x7482, "" }, +// { 0x7483, "" }, +// { 0x7484, "" }, +// { 0x7485, "" }, +// { 0x7486, "" }, +// { 0x7487, "" }, +// { 0x7488, "" }, +// { 0x7489, "" }, +// { 0x748A, "" }, +// { 0x748B, "" }, + { 0x748C, "character/character_prague_civilian_male_dd" }, +// { 0x748D, "" }, +// { 0x748E, "" }, +// { 0x748F, "" }, +// { 0x7490, "" }, +// { 0x7491, "" }, +// { 0x7492, "" }, +// { 0x7493, "" }, +// { 0x7494, "" }, +// { 0x7495, "" }, +// { 0x7496, "" }, +// { 0x7497, "" }, +// { 0x7498, "" }, + { 0x7499, "character/character_airport_a" }, +// { 0x749A, "" }, +// { 0x749B, "" }, +// { 0x749C, "" }, +// { 0x749D, "" }, + { 0x749E, "character/character_sp_spetsnaz_yuri" }, +// { 0x749F, "" }, + { 0x74A0, "character_character_sp_spetsnaz_geoff" }, +// { 0x74A1, "" }, +// { 0x74A2, "" }, +// { 0x74A3, "" }, +// { 0x74A4, "" }, +// { 0x74A5, "" }, +// { 0x74A6, "" }, +// { 0x74A7, "" }, +// { 0x74A8, "" }, +// { 0x74A9, "" }, +// { 0x74AA, "" }, +// { 0x74AB, "" }, +// { 0x74AC, "" }, +// { 0x74AD, "" }, +// { 0x74AE, "" }, +// { 0x74AF, "" }, +// { 0x74B0, "" }, +// { 0x74B1, "" }, +// { 0x74B2, "" }, + { 0x74B3, "player_fired_too_early_listener" }, +// { 0x74B4, "" }, +// { 0x74B5, "" }, + { 0x74B6, "m_sniper_model" }, + { 0x74B7, "btr_fire_main_gun_loop" }, +// { 0x74B8, "" }, +// { 0x74B9, "" }, +// { 0x74BA, "" }, +// { 0x74BB, "" }, +// { 0x74BC, "" }, +// { 0x74BD, "" }, +// { 0x74BE, "" }, +// { 0x74BF, "" }, +// { 0x74C0, "" }, + { 0x74C1, "btrs_drive_off" }, + { 0x74C2, "suv_add_lights_and_tread_fx" }, +// { 0x74C3, "" }, +// { 0x74C4, "" }, +// { 0x74C5, "" }, +// { 0x74C6, "" }, +// { 0x74C7, "" }, +// { 0x74C8, "" }, +// { 0x74C9, "" }, +// { 0x74CA, "" }, +// { 0x74CB, "" }, +// { 0x74CC, "" }, +// { 0x74CD, "" }, +// { 0x74CE, "" }, +// { 0x74CF, "" }, +// { 0x74D0, "" }, +// { 0x74D1, "" }, + { 0x74D2, "balcony_ai_react" }, +// { 0x74D3, "" }, +// { 0x74D4, "" }, + { 0x74D5, "balcony_snipe_vo" }, +// { 0x74D6, "" }, +// { 0x74D7, "" }, +// { 0x74D8, "" }, +// { 0x74D9, "" }, +// { 0x74DA, "" }, +// { 0x74DB, "" }, + { 0x74DC, "price_window_breach_ai_animate" }, +// { 0x74DD, "" }, +// { 0x74DE, "" }, +// { 0x74DF, "" }, +// { 0x74E0, "" }, +// { 0x74E1, "" }, +// { 0x74E2, "" }, +// { 0x74E3, "" }, +// { 0x74E4, "" }, +// { 0x74E5, "" }, +// { 0x74E6, "" }, +// { 0x74E7, "" }, +// { 0x74E8, "" }, +// { 0x74E9, "" }, +// { 0x74EA, "" }, +// { 0x74EB, "" }, +// { 0x74EC, "" }, +// { 0x74ED, "" }, +// { 0x74EE, "" }, +// { 0x74EF, "" }, +// { 0x74F0, "" }, + { 0x74F1, "sniper_nag_lines" }, +// { 0x74F2, "" }, +// { 0x74F3, "" }, +// { 0x74F4, "" }, +// { 0x74F5, "" }, +// { 0x74F6, "" }, +// { 0x74F7, "" }, +// { 0x74F8, "" }, +// { 0x74F9, "" }, +// { 0x74FA, "" }, +// { 0x74FB, "" }, +// { 0x74FC, "" }, +// { 0x74FD, "" }, +// { 0x74FE, "" }, +// { 0x74FF, "" }, +// { 0x7500, "" }, + { 0x7501, "soap_carry_death_listener" }, +// { 0x7502, "" }, +// { 0x7503, "" }, +// { 0x7504, "" }, +// { 0x7505, "" }, +// { 0x7506, "" }, +// { 0x7507, "" }, +// { 0x7508, "" }, +// { 0x7509, "" }, +// { 0x750A, "" }, + { 0x750B, "n_obj_follow" }, +// { 0x750C, "" }, +// { 0x750D, "" }, + { 0x750E, "player_god_while_moving" }, +// { 0x750F, "" }, + { 0x7510, "follow_price_through_street" }, +// { 0x7511, "" }, +// { 0x7512, "" }, +// { 0x7513, "" }, + { 0x7514, "make_sure_dies" }, +// { 0x7515, "" }, +// { 0x7516, "" }, +// { 0x7517, "" }, +// { 0x7518, "" }, +// { 0x7519, "" }, +// { 0x751A, "" }, + { 0x751B, "spawn_chopper" }, +// { 0x751C, "" }, +// { 0x751D, "" }, +// { 0x751E, "" }, +// { 0x751F, "" }, +// { 0x7520, "" }, +// { 0x7521, "" }, +// { 0x7522, "" }, +// { 0x7523, "" }, +// { 0x7524, "" }, +// { 0x7525, "" }, +// { 0x7526, "" }, +// { 0x7527, "" }, +// { 0x7528, "" }, +// { 0x7529, "" }, +// { 0x752A, "" }, +// { 0x752B, "" }, +// { 0x752C, "" }, +// { 0x752D, "" }, +// { 0x752E, "" }, +// { 0x752F, "" }, +// { 0x7530, "" }, +// { 0x7531, "" }, + { 0x7532, "fire_m203_at_wall" }, + { 0x7533, "fire_m203_b_dialogue" }, +// { 0x7534, "" }, +// { 0x7535, "" }, +// { 0x7536, "" }, +// { 0x7537, "" }, +// { 0x7538, "" }, +// { 0x7539, "" }, +// { 0x753A, "" }, + { 0x753B, "price_open_wall" }, + { 0x753C, "start_scaffold" }, +// { 0x753D, "" }, +// { 0x753E, "" }, +// { 0x753F, "" }, +// { 0x7540, "" }, +// { 0x7541, "" }, +// { 0x7542, "" }, +// { 0x7543, "" }, +// { 0x7544, "" }, +// { 0x7545, "" }, +// { 0x7546, "" }, +// { 0x7547, "" }, + { 0x7548, "explosion_behind_price" }, + { 0x7549, "scaffold_debris_anims" }, +// { 0x754A, "" }, +// { 0x754B, "" }, +// { 0x754C, "" }, +// { 0x754D, "" }, + { 0x754E, "tower_explosion_anim" }, +// { 0x754F, "" }, +// { 0x7550, "" }, +// { 0x7551, "" }, +// { 0x7552, "" }, + { 0x7553, "scaffold_bell_impact" }, +// { 0x7554, "" }, +// { 0x7555, "" }, +// { 0x7556, "" }, + { 0x7557, "scaffold_player_hit_board_2" }, +// { 0x7558, "" }, +// { 0x7559, "" }, +// { 0x755A, "" }, +// { 0x755B, "" }, +// { 0x755C, "" }, +// { 0x755D, "" }, +// { 0x755E, "" }, +// { 0x755F, "" }, + { 0x7560, "player_loadout" }, +// { 0x7561, "" }, +// { 0x7562, "" }, +// { 0x7563, "" }, +// { 0x7564, "" }, +// { 0x7565, "" }, +// { 0x7566, "" }, +// { 0x7567, "" }, +// { 0x7568, "" }, +// { 0x7569, "" }, + { 0x756A, "clear_room_battle" }, + { 0x756B, "player_spotted_timer" }, +// { 0x756C, "" }, + { 0x756D, "ai_door_breacher" }, + { 0x756E, "vo_dumpster" }, +// { 0x756F, "" }, +// { 0x7570, "" }, + { 0x7571, "spawnfunc_store_runner" }, +// { 0x7572, "" }, +// { 0x7573, "" }, +// { 0x7574, "" }, +// { 0x7575, "" }, +// { 0x7576, "" }, +// { 0x7577, "" }, + { 0x7578, "soap_shoots_breacher" }, +// { 0x7579, "" }, +// { 0x757A, "" }, +// { 0x757B, "" }, +// { 0x757C, "" }, +// { 0x757D, "" }, +// { 0x757E, "" }, +// { 0x757F, "" }, + { 0x7580, "door_dumpster" }, +// { 0x7581, "" }, +// { 0x7582, "" }, +// { 0x7583, "" }, +// { 0x7584, "" }, +// { 0x7585, "" }, +// { 0x7586, "" }, +// { 0x7587, "" }, + { 0x7588, "door_store" }, +// { 0x7589, "" }, +// { 0x758A, "" }, +// { 0x758B, "" }, + { 0x758C, "dumpster_spawnfuncs" }, +// { 0x758D, "" }, +// { 0x758E, "" }, +// { 0x758F, "" }, +// { 0x7590, "" }, +// { 0x7591, "" }, +// { 0x7592, "" }, +// { 0x7593, "" }, + { 0x7594, "hedge_courtyard_destruction" }, +// { 0x7595, "" }, + { 0x7596, "start_store" }, +// { 0x7597, "" }, +// { 0x7598, "" }, +// { 0x7599, "" }, +// { 0x759A, "" }, + { 0x759B, "ai_victim1" }, +// { 0x759C, "" }, +// { 0x759D, "" }, +// { 0x759E, "" }, +// { 0x759F, "" }, +// { 0x75A0, "" }, +// { 0x75A1, "" }, +// { 0x75A2, "" }, +// { 0x75A3, "" }, +// { 0x75A4, "" }, +// { 0x75A5, "" }, +// { 0x75A6, "" }, +// { 0x75A7, "" }, +// { 0x75A8, "" }, +// { 0x75A9, "" }, +// { 0x75AA, "" }, +// { 0x75AB, "" }, +// { 0x75AC, "" }, +// { 0x75AD, "" }, +// { 0x75AE, "" }, + { 0x75AF, "spawnfunc_flanker" }, +// { 0x75B0, "" }, +// { 0x75B1, "" }, +// { 0x75B2, "" }, +// { 0x75B3, "" }, + { 0x75B4, "hail_of_bullets" }, +// { 0x75B5, "" }, +// { 0x75B6, "" }, +// { 0x75B7, "" }, +// { 0x75B8, "" }, +// { 0x75B9, "" }, +// { 0x75BA, "" }, +// { 0x75BB, "" }, +// { 0x75BC, "" }, +// { 0x75BD, "" }, +// { 0x75BE, "" }, +// { 0x75BF, "" }, +// { 0x75C0, "" }, +// { 0x75C1, "" }, +// { 0x75C2, "" }, +// { 0x75C3, "" }, +// { 0x75C4, "" }, +// { 0x75C5, "" }, +// { 0x75C6, "" }, +// { 0x75C7, "" }, +// { 0x75C8, "" }, +// { 0x75C9, "" }, +// { 0x75CA, "" }, +// { 0x75CB, "" }, +// { 0x75CC, "" }, +// { 0x75CD, "" }, +// { 0x75CE, "" }, +// { 0x75CF, "" }, +// { 0x75D0, "" }, +// { 0x75D1, "" }, +// { 0x75D2, "" }, +// { 0x75D3, "" }, +// { 0x75D4, "" }, +// { 0x75D5, "" }, +// { 0x75D6, "" }, +// { 0x75D7, "" }, +// { 0x75D8, "" }, +// { 0x75D9, "" }, +// { 0x75DA, "" }, +// { 0x75DB, "" }, +// { 0x75DC, "" }, +// { 0x75DD, "" }, +// { 0x75DE, "" }, +// { 0x75DF, "" }, +// { 0x75E0, "" }, +// { 0x75E1, "" }, +// { 0x75E2, "" }, +// { 0x75E3, "" }, +// { 0x75E4, "" }, +// { 0x75E5, "" }, +// { 0x75E6, "" }, +// { 0x75E7, "" }, +// { 0x75E8, "" }, +// { 0x75E9, "" }, + { 0x75EA, "m_escape_door" }, +// { 0x75EB, "" }, +// { 0x75EC, "" }, +// { 0x75ED, "" }, +// { 0x75EE, "" }, +// { 0x75EF, "" }, +// { 0x75F0, "" }, +// { 0x75F1, "" }, +// { 0x75F2, "" }, +// { 0x75F3, "" }, +// { 0x75F4, "" }, + { 0x75F5, "ai_resistance_guy2" }, +// { 0x75F6, "" }, +// { 0x75F7, "" }, +// { 0x75F8, "" }, +// { 0x75F9, "" }, +// { 0x75FA, "" }, +// { 0x75FB, "" }, + { 0x75FC, "do_vo_nag_loop" }, +// { 0x75FD, "" }, +// { 0x75FE, "" }, +// { 0x75FF, "" }, +// { 0x7600, "" }, +// { 0x7601, "" }, +// { 0x7602, "" }, +// { 0x7603, "" }, +// { 0x7604, "" }, +// { 0x7605, "" }, +// { 0x7606, "" }, +// { 0x7607, "" }, +// { 0x7608, "" }, +// { 0x7609, "" }, +// { 0x760A, "" }, +// { 0x760B, "" }, +// { 0x760C, "" }, +// { 0x760D, "" }, +// { 0x760E, "" }, +// { 0x760F, "" }, +// { 0x7610, "" }, +// { 0x7611, "" }, +// { 0x7612, "" }, +// { 0x7613, "" }, +// { 0x7614, "" }, +// { 0x7615, "" }, +// { 0x7616, "" }, +// { 0x7617, "" }, +// { 0x7618, "" }, +// { 0x7619, "" }, +// { 0x761A, "" }, +// { 0x761B, "" }, +// { 0x761C, "" }, +// { 0x761D, "" }, + { 0x761E, "medic_resistance_stop_carry_anims" }, +// { 0x761F, "" }, + { 0x7620, "medic_resistance_ai_leader_stop_carry_anim" }, +// { 0x7621, "" }, + { 0x7622, "medic_area_init" }, +// { 0x7623, "" }, +// { 0x7624, "" }, +// { 0x7625, "" }, +// { 0x7626, "" }, +// { 0x7627, "" }, +// { 0x7628, "" }, +// { 0x7629, "" }, + { 0x762A, "m_link_cup3" }, +// { 0x762B, "" }, +// { 0x762C, "" }, +// { 0x762D, "" }, +// { 0x762E, "" }, + { 0x762F, "defend_replenish_enemies" }, +// { 0x7630, "" }, +// { 0x7631, "" }, +// { 0x7632, "" }, +// { 0x7633, "" }, +// { 0x7634, "" }, +// { 0x7635, "" }, + { 0x7636, "spawn_btr" }, +// { 0x7637, "" }, +// { 0x7638, "" }, +// { 0x7639, "" }, +// { 0x763A, "" }, +// { 0x763B, "" }, +// { 0x763C, "" }, +// { 0x763D, "" }, + { 0x763E, "btr_attack_rooftop" }, +// { 0x763F, "" }, +// { 0x7640, "" }, +// { 0x7641, "" }, +// { 0x7642, "" }, +// { 0x7643, "" }, + { 0x7644, "suv_init" }, +// { 0x7645, "" }, +// { 0x7646, "" }, + { 0x7647, "suv_toggle_invulnerability" }, +// { 0x7648, "" }, +// { 0x7649, "" }, +// { 0x764A, "" }, +// { 0x764B, "" }, +// { 0x764C, "" }, +// { 0x764D, "" }, + { 0x764E, "resistance_grenade_attack" }, +// { 0x764F, "" }, +// { 0x7650, "" }, +// { 0x7651, "" }, +// { 0x7652, "" }, + { 0x7653, "spawnfunc_team" }, +// { 0x7654, "" }, +// { 0x7655, "" }, +// { 0x7656, "" }, +// { 0x7657, "" }, +// { 0x7658, "" }, +// { 0x7659, "" }, +// { 0x765A, "" }, +// { 0x765B, "" }, +// { 0x765C, "" }, +// { 0x765D, "" }, +// { 0x765E, "" }, +// { 0x765F, "" }, +// { 0x7660, "" }, +// { 0x7661, "" }, +// { 0x7662, "" }, +// { 0x7663, "" }, +// { 0x7664, "" }, +// { 0x7665, "" }, +// { 0x7666, "" }, +// { 0x7667, "" }, +// { 0x7668, "" }, +// { 0x7669, "" }, +// { 0x766A, "" }, +// { 0x766B, "" }, +// { 0x766C, "" }, +// { 0x766D, "" }, +// { 0x766E, "" }, + { 0x766F, "court_chunk_1" }, +// { 0x7670, "" }, +// { 0x7671, "" }, +// { 0x7672, "" }, +// { 0x7673, "" }, +// { 0x7674, "" }, +// { 0x7675, "" }, + { 0x7676, "sprint_for_time" }, +// { 0x7677, "" }, +// { 0x7678, "" }, +// { 0x7679, "" }, +// { 0x767A, "" }, +// { 0x767B, "" }, +// { 0x767C, "" }, +// { 0x767D, "" }, +// { 0x767E, "" }, +// { 0x767F, "" }, +// { 0x7680, "" }, +// { 0x7681, "" }, +// { 0x7682, "" }, + { 0x7683, "hedge_on_damage" }, + { 0x7684, "defend_clean_up" }, + { 0x7685, "start_flashback_sniper" }, +// { 0x7686, "" }, +// { 0x7687, "" }, +// { 0x7688, "" }, +// { 0x7689, "" }, + { 0x768A, "setup_no_time_scene" }, +// { 0x768B, "" }, +// { 0x768C, "" }, + { 0x768D, "zakhaev_onearm" }, +// { 0x768E, "" }, +// { 0x768F, "" }, +// { 0x7690, "" }, +// { 0x7691, "" }, +// { 0x7692, "" }, +// { 0x7693, "" }, + { 0x7694, "exchanger_surprise_time" }, +// { 0x7695, "" }, +// { 0x7696, "" }, +// { 0x7697, "" }, +// { 0x7698, "" }, +// { 0x7699, "" }, +// { 0x769A, "" }, +// { 0x769B, "" }, +// { 0x769C, "" }, +// { 0x769D, "" }, +// { 0x769E, "" }, +// { 0x769F, "" }, +// { 0x76A0, "" }, +// { 0x76A1, "" }, +// { 0x76A2, "" }, +// { 0x76A3, "" }, + { 0x76A4, "stand_cellphone_bored" }, +// { 0x76A5, "" }, +// { 0x76A6, "" }, +// { 0x76A7, "" }, +// { 0x76A8, "" }, +// { 0x76A9, "" }, +// { 0x76AA, "" }, +// { 0x76AB, "" }, +// { 0x76AC, "" }, +// { 0x76AD, "" }, +// { 0x76AE, "" }, +// { 0x76AF, "" }, +// { 0x76B0, "" }, +// { 0x76B1, "" }, +// { 0x76B2, "" }, +// { 0x76B3, "" }, +// { 0x76B4, "" }, +// { 0x76B5, "" }, +// { 0x76B6, "" }, +// { 0x76B7, "" }, +// { 0x76B8, "" }, +// { 0x76B9, "" }, +// { 0x76BA, "" }, +// { 0x76BB, "" }, +// { 0x76BC, "" }, +// { 0x76BD, "" }, +// { 0x76BE, "" }, +// { 0x76BF, "" }, +// { 0x76C0, "" }, +// { 0x76C1, "" }, +// { 0x76C2, "" }, + { 0x76C3, "take_care_of_fake_weapon_tag" }, +// { 0x76C4, "" }, +// { 0x76C5, "" }, +// { 0x76C6, "" }, +// { 0x76C7, "" }, +// { 0x76C8, "" }, + { 0x76C9, "no_sound_bullets" }, +// { 0x76CA, "" }, +// { 0x76CB, "" }, +// { 0x76CC, "" }, +// { 0x76CD, "" }, + { 0x76CE, "punch_blink_blur" }, +// { 0x76CF, "" }, +// { 0x76D0, "" }, +// { 0x76D1, "" }, +// { 0x76D2, "" }, +// { 0x76D3, "" }, +// { 0x76D4, "" }, +// { 0x76D5, "" }, +// { 0x76D6, "" }, +// { 0x76D7, "" }, +// { 0x76D8, "" }, +// { 0x76D9, "" }, +// { 0x76DA, "" }, +// { 0x76DB, "" }, +// { 0x76DC, "" }, +// { 0x76DD, "" }, +// { 0x76DE, "" }, +// { 0x76DF, "" }, +// { 0x76E0, "" }, +// { 0x76E1, "" }, + { 0x76E2, "nuke_tree_sway" }, + { 0x76E3, "start_tree_sway_anim" }, +// { 0x76E4, "" }, +// { 0x76E5, "" }, +// { 0x76E6, "" }, +// { 0x76E7, "" }, +// { 0x76E8, "" }, +// { 0x76E9, "" }, +// { 0x76EA, "" }, +// { 0x76EB, "" }, +// { 0x76EC, "" }, +// { 0x76ED, "" }, +// { 0x76EE, "" }, +// { 0x76EF, "" }, +// { 0x76F0, "" }, +// { 0x76F1, "" }, +// { 0x76F2, "" }, +// { 0x76F3, "" }, + { 0x76F4, "monitor_ads" }, +// { 0x76F5, "" }, +// { 0x76F6, "" }, +// { 0x76F7, "" }, +// { 0x76F8, "" }, + { 0x76F9, "button_hints" }, +// { 0x76FA, "" }, +// { 0x76FB, "" }, +// { 0x76FC, "" }, +// { 0x76FD, "" }, +// { 0x76FE, "" }, + { 0x76FF, "crawl_breath_recover" }, +// { 0x7700, "" }, +// { 0x7701, "" }, +// { 0x7702, "" }, +// { 0x7703, "" }, +// { 0x7704, "" }, +// { 0x7705, "" }, +// { 0x7706, "" }, +// { 0x7707, "" }, +// { 0x7708, "" }, + { 0x7709, "limp_internal" }, +// { 0x770A, "" }, +// { 0x770B, "" }, +// { 0x770C, "" }, +// { 0x770D, "" }, +// { 0x770E, "" }, +// { 0x770F, "" }, +// { 0x7710, "" }, +// { 0x7711, "" }, +// { 0x7712, "" }, +// { 0x7713, "" }, +// { 0x7714, "" }, +// { 0x7715, "" }, +// { 0x7716, "" }, +// { 0x7717, "" }, +// { 0x7718, "" }, +// { 0x7719, "" }, +// { 0x771A, "" }, +// { 0x771B, "" }, +// { 0x771C, "" }, +// { 0x771D, "" }, +// { 0x771E, "" }, +// { 0x771F, "" }, +// { 0x7720, "" }, +// { 0x7721, "" }, +// { 0x7722, "" }, +// { 0x7723, "" }, +// { 0x7724, "" }, +// { 0x7725, "" }, +// { 0x7726, "" }, +// { 0x7727, "" }, + { 0x7728, "wakeup_in_elevator_civ_falling_getting_shot" }, +// { 0x7729, "" }, + { 0x772A, "waittill_player_exit_elevator" }, +// { 0x772B, "" }, +// { 0x772C, "" }, +// { 0x772D, "" }, +// { 0x772E, "" }, +// { 0x772F, "" }, + { 0x7730, "swinging_airport_light" }, +// { 0x7731, "" }, +// { 0x7732, "" }, +// { 0x7733, "" }, +// { 0x7734, "" }, +// { 0x7735, "" }, +// { 0x7736, "" }, +// { 0x7737, "" }, + { 0x7738, "casual_killers_init" }, +// { 0x7739, "" }, +// { 0x773A, "" }, +// { 0x773B, "" }, +// { 0x773C, "" }, +// { 0x773D, "" }, +// { 0x773E, "" }, +// { 0x773F, "" }, +// { 0x7740, "" }, + { 0x7741, "player_blackout_in_place" }, +// { 0x7742, "" }, + { 0x7743, "player_emt_anim" }, +// { 0x7744, "" }, +// { 0x7745, "" }, +// { 0x7746, "" }, +// { 0x7747, "" }, +// { 0x7748, "" }, +// { 0x7749, "" }, +// { 0x774A, "" }, + { 0x774B, "spray_and_pray" }, +// { 0x774C, "" }, +// { 0x774D, "" }, +// { 0x774E, "" }, +// { 0x774F, "" }, +// { 0x7750, "" }, +// { 0x7751, "" }, +// { 0x7752, "" }, + { 0x7753, "lobby_dead_bodies" }, +// { 0x7754, "" }, +// { 0x7755, "" }, +// { 0x7756, "" }, +// { 0x7757, "" }, +// { 0x7758, "" }, +// { 0x7759, "" }, +// { 0x775A, "" }, + { 0x775B, "start_statue" }, +// { 0x775C, "" }, +// { 0x775D, "" }, +// { 0x775E, "" }, +// { 0x775F, "" }, +// { 0x7760, "" }, +// { 0x7761, "" }, +// { 0x7762, "" }, +// { 0x7763, "" }, +// { 0x7764, "" }, +// { 0x7765, "" }, +// { 0x7766, "" }, + { 0x7767, "spawn_tunnel_groups" }, +// { 0x7768, "" }, +// { 0x7769, "" }, +// { 0x776A, "" }, +// { 0x776B, "" }, +// { 0x776C, "" }, +// { 0x776D, "" }, +// { 0x776E, "" }, +// { 0x776F, "" }, +// { 0x7770, "" }, +// { 0x7771, "" }, +// { 0x7772, "" }, +// { 0x7773, "" }, +// { 0x7774, "" }, +// { 0x7775, "" }, +// { 0x7776, "" }, +// { 0x7777, "" }, +// { 0x7778, "" }, +// { 0x7779, "" }, +// { 0x777A, "" }, +// { 0x777B, "" }, +// { 0x777C, "" }, +// { 0x777D, "" }, +// { 0x777E, "" }, +// { 0x777F, "" }, +// { 0x7780, "" }, +// { 0x7781, "" }, +// { 0x7782, "" }, +// { 0x7783, "" }, + { 0x7784, "character_character_opforce_germany_rpg" }, +// { 0x7785, "" }, +// { 0x7786, "" }, +// { 0x7787, "" }, +// { 0x7788, "" }, +// { 0x7789, "" }, +// { 0x778A, "" }, +// { 0x778B, "" }, +// { 0x778C, "" }, +// { 0x778D, "" }, +// { 0x778E, "" }, +// { 0x778F, "" }, +// { 0x7790, "" }, + { 0x7791, "tank_drive_out" }, +// { 0x7792, "" }, +// { 0x7793, "" }, + { 0x7794, "aud_breach_free_hostage" }, +// { 0x7795, "" }, +// { 0x7796, "" }, +// { 0x7797, "" }, +// { 0x7798, "" }, +// { 0x7799, "" }, +// { 0x779A, "" }, +// { 0x779B, "" }, +// { 0x779C, "" }, +// { 0x779D, "" }, + { 0x779E, "turret_attack_think_hamburg" }, +// { 0x779F, "" }, +// { 0x77A0, "" }, +// { 0x77A1, "" }, +// { 0x77A2, "" }, +// { 0x77A3, "" }, + { 0x77A4, "tank_mgs_stop_targeting_drones" }, + { 0x77A5, "update_turret_fire_timer" }, +// { 0x77A6, "" }, +// { 0x77A7, "" }, +// { 0x77A8, "" }, +// { 0x77A9, "" }, +// { 0x77AA, "" }, + { 0x77AB, "tank_queue_remove_dead_and_undefined" }, + { 0x77AC, "tank_queue_add" }, +// { 0x77AD, "" }, + { 0x77AE, "turret_on_vistarget" }, +// { 0x77AF, "" }, +// { 0x77B0, "" }, +// { 0x77B1, "" }, +// { 0x77B2, "" }, +// { 0x77B3, "" }, +// { 0x77B4, "" }, +// { 0x77B5, "" }, +// { 0x77B6, "" }, +// { 0x77B7, "" }, +// { 0x77B8, "" }, +// { 0x77B9, "" }, +// { 0x77BA, "" }, +// { 0x77BB, "" }, +// { 0x77BC, "" }, +// { 0x77BD, "" }, +// { 0x77BE, "" }, +// { 0x77BF, "" }, +// { 0x77C0, "" }, +// { 0x77C1, "" }, +// { 0x77C2, "" }, +// { 0x77C3, "" }, +// { 0x77C4, "" }, +// { 0x77C5, "" }, +// { 0x77C6, "" }, +// { 0x77C7, "" }, +// { 0x77C8, "" }, +// { 0x77C9, "" }, +// { 0x77CA, "" }, + { 0x77CB, "tank_player_refresh_link" }, + { 0x77CC, "tank_dead_kill_player" }, +// { 0x77CD, "" }, +// { 0x77CE, "" }, +// { 0x77CF, "" }, + { 0x77D0, "tank_link_crew" }, +// { 0x77D1, "" }, +// { 0x77D2, "" }, + { 0x77D3, "tank_aim_arrow_valid" }, +// { 0x77D4, "" }, +// { 0x77D5, "" }, +// { 0x77D6, "" }, +// { 0x77D7, "" }, +// { 0x77D8, "" }, +// { 0x77D9, "" }, +// { 0x77DA, "" }, +// { 0x77DB, "" }, +// { 0x77DC, "" }, +// { 0x77DD, "" }, +// { 0x77DE, "" }, +// { 0x77DF, "" }, +// { 0x77E0, "" }, +// { 0x77E1, "" }, +// { 0x77E2, "" }, +// { 0x77E3, "" }, +// { 0x77E4, "" }, +// { 0x77E5, "" }, + { 0x77E6, "precache_tank" }, +// { 0x77E7, "" }, +// { 0x77E8, "" }, +// { 0x77E9, "" }, +// { 0x77EA, "" }, +// { 0x77EB, "" }, +// { 0x77EC, "" }, +// { 0x77ED, "" }, +// { 0x77EE, "" }, +// { 0x77EF, "" }, +// { 0x77F0, "" }, +// { 0x77F1, "" }, +// { 0x77F2, "" }, + { 0x77F3, "reset_player_stuff_after_tank" }, +// { 0x77F4, "" }, +// { 0x77F5, "" }, +// { 0x77F6, "" }, +// { 0x77F7, "" }, +// { 0x77F8, "" }, +// { 0x77F9, "" }, +// { 0x77FA, "" }, +// { 0x77FB, "" }, +// { 0x77FC, "" }, + { 0x77FD, "exit_flag_catchup" }, +// { 0x77FE, "" }, +// { 0x77FF, "" }, +// { 0x7800, "" }, +// { 0x7801, "" }, +// { 0x7802, "" }, +// { 0x7803, "" }, + { 0x7804, "freetimescale_slomo_junk" }, +// { 0x7805, "" }, +// { 0x7806, "" }, +// { 0x7807, "" }, +// { 0x7808, "" }, + { 0x7809, "script_vehicle_t90_tank_woodlandthink" }, +// { 0x780A, "" }, +// { 0x780B, "" }, +// { 0x780C, "" }, +// { 0x780D, "" }, + { 0x780E, "add_spawn_function_if_is_spawner" }, +// { 0x780F, "" }, +// { 0x7810, "" }, +// { 0x7811, "" }, +// { 0x7812, "" }, +// { 0x7813, "" }, +// { 0x7814, "" }, +// { 0x7815, "" }, +// { 0x7816, "" }, +// { 0x7817, "" }, + { 0x7818, "water_splash_reset_tank" }, +// { 0x7819, "" }, +// { 0x781A, "" }, + { 0x781B, "water_fx_ring" }, +// { 0x781C, "" }, +// { 0x781D, "" }, + { 0x781E, "water_splash" }, + { 0x781F, "touching_water_trigger" }, + { 0x7820, "water_height" }, +// { 0x7821, "" }, +// { 0x7822, "" }, + { 0x7823, "set_water_func" }, + { 0x7824, "water_splash_test" }, +// { 0x7825, "" }, +// { 0x7826, "" }, +// { 0x7827, "" }, +// { 0x7828, "" }, +// { 0x7829, "" }, +// { 0x782A, "" }, +// { 0x782B, "" }, +// { 0x782C, "" }, +// { 0x782D, "" }, +// { 0x782E, "" }, +// { 0x782F, "" }, +// { 0x7830, "" }, +// { 0x7831, "" }, +// { 0x7832, "" }, +// { 0x7833, "" }, +// { 0x7834, "" }, +// { 0x7835, "" }, + { 0x7836, "og_turret_damage_min" }, +// { 0x7837, "" }, +// { 0x7838, "" }, +// { 0x7839, "" }, +// { 0x783A, "" }, +// { 0x783B, "" }, +// { 0x783C, "" }, +// { 0x783D, "" }, +// { 0x783E, "" }, +// { 0x783F, "" }, +// { 0x7840, "" }, +// { 0x7841, "" }, + { 0x7842, "crawl_while_axis_alivethink_no_crawl" }, +// { 0x7843, "" }, +// { 0x7844, "" }, +// { 0x7845, "" }, +// { 0x7846, "" }, +// { 0x7847, "" }, +// { 0x7848, "" }, +// { 0x7849, "" }, + { 0x784A, "riders_godoff" }, +// { 0x784B, "" }, +// { 0x784C, "" }, +// { 0x784D, "" }, +// { 0x784E, "" }, +// { 0x784F, "" }, +// { 0x7850, "" }, +// { 0x7851, "" }, +// { 0x7852, "" }, +// { 0x7853, "" }, +// { 0x7854, "" }, +// { 0x7855, "" }, + { 0x7856, "tank_gate_open_trigger" }, + { 0x7857, "hamburg_badplace" }, +// { 0x7858, "" }, +// { 0x7859, "" }, +// { 0x785A, "" }, +// { 0x785B, "" }, +// { 0x785C, "" }, +// { 0x785D, "" }, +// { 0x785E, "" }, + { 0x785F, "guys_to_spawn" }, +// { 0x7860, "" }, +// { 0x7861, "" }, +// { 0x7862, "" }, + { 0x7863, "veh_node_tank_stop_for_enemiesthink" }, +// { 0x7864, "" }, + { 0x7865, "trigger_when_ai_clearthink" }, +// { 0x7866, "" }, +// { 0x7867, "" }, +// { 0x7868, "" }, +// { 0x7869, "" }, +// { 0x786A, "" }, +// { 0x786B, "" }, +// { 0x786C, "" }, +// { 0x786D, "" }, +// { 0x786E, "" }, +// { 0x786F, "" }, +// { 0x7870, "" }, + { 0x7871, "delete_on_goal_respawn" }, +// { 0x7872, "" }, +// { 0x7873, "" }, +// { 0x7874, "" }, +// { 0x7875, "" }, +// { 0x7876, "" }, + { 0x7877, "vehicle_turret_restore_old_mode" }, + { 0x7878, "show_me_the_drones" }, +// { 0x7879, "" }, +// { 0x787A, "" }, +// { 0x787B, "" }, +// { 0x787C, "" }, +// { 0x787D, "" }, +// { 0x787E, "" }, +// { 0x787F, "" }, +// { 0x7880, "" }, +// { 0x7881, "" }, +// { 0x7882, "" }, +// { 0x7883, "" }, + { 0x7884, "garage_crash_light_exit_ray" }, +// { 0x7885, "" }, +// { 0x7886, "" }, +// { 0x7887, "" }, +// { 0x7888, "" }, +// { 0x7889, "" }, +// { 0x788A, "" }, + { 0x788B, "flicker_the_light" }, +// { 0x788C, "" }, +// { 0x788D, "" }, + { 0x788E, "do_exit_sequence" }, +// { 0x788F, "" }, + { 0x7890, "driver_exit_idle" }, +// { 0x7891, "" }, +// { 0x7892, "" }, +// { 0x7893, "" }, +// { 0x7894, "" }, +// { 0x7895, "" }, +// { 0x7896, "" }, +// { 0x7897, "" }, +// { 0x7898, "" }, + { 0x7899, "tank_crew_1" }, +// { 0x789A, "" }, +// { 0x789B, "" }, +// { 0x789C, "" }, +// { 0x789D, "" }, +// { 0x789E, "" }, +// { 0x789F, "" }, + { 0x78A0, "post_crash_tank" }, +// { 0x78A1, "" }, +// { 0x78A2, "" }, +// { 0x78A3, "" }, +// { 0x78A4, "" }, +// { 0x78A5, "" }, +// { 0x78A6, "" }, +// { 0x78A7, "" }, +// { 0x78A8, "" }, + { 0x78A9, "human_anims" }, + { 0x78AA, "hamburg_player_anims" }, +// { 0x78AB, "" }, +// { 0x78AC, "" }, +// { 0x78AD, "" }, +// { 0x78AE, "" }, +// { 0x78AF, "" }, +// { 0x78B0, "" }, +// { 0x78B1, "" }, +// { 0x78B2, "" }, +// { 0x78B3, "" }, +// { 0x78B4, "" }, +// { 0x78B5, "" }, +// { 0x78B6, "" }, + { 0x78B7, "only_one_heli_fire" }, +// { 0x78B8, "" }, +// { 0x78B9, "" }, +// { 0x78BA, "" }, +// { 0x78BB, "" }, +// { 0x78BC, "" }, +// { 0x78BD, "" }, + { 0x78BE, "hot_buildings_one" }, +// { 0x78BF, "" }, +// { 0x78C0, "" }, +// { 0x78C1, "" }, +// { 0x78C2, "" }, +// { 0x78C3, "" }, +// { 0x78C4, "" }, +// { 0x78C5, "" }, +// { 0x78C6, "" }, +// { 0x78C7, "" }, + { 0x78C8, "tank_path_pre_bridge" }, +// { 0x78C9, "" }, + { 0x78CA, "tank_path_bridge" }, + { 0x78CB, "do_tank_mount" }, +// { 0x78CC, "" }, + { 0x78CD, "friend_tank_blasts_at_helis" }, +// { 0x78CE, "" }, +// { 0x78CF, "" }, +// { 0x78D0, "" }, +// { 0x78D1, "" }, + { 0x78D2, "tank_path_after_blackout" }, +// { 0x78D3, "" }, +// { 0x78D4, "" }, +// { 0x78D5, "" }, + { 0x78D6, "hot_buidlings_get_attacked" }, +// { 0x78D7, "" }, +// { 0x78D8, "" }, +// { 0x78D9, "" }, +// { 0x78DA, "" }, + { 0x78DB, "spawn_struct_drone_pool" }, +// { 0x78DC, "" }, +// { 0x78DD, "" }, +// { 0x78DE, "" }, + { 0x78DF, "afterdust_setup_wounded" }, +// { 0x78E0, "" }, +// { 0x78E1, "" }, +// { 0x78E2, "" }, +// { 0x78E3, "" }, +// { 0x78E4, "" }, + { 0x78E5, "player_tank_reloads_while_in_shock" }, +// { 0x78E6, "" }, +// { 0x78E7, "" }, +// { 0x78E8, "" }, +// { 0x78E9, "" }, +// { 0x78EA, "" }, +// { 0x78EB, "" }, +// { 0x78EC, "" }, +// { 0x78ED, "" }, + { 0x78EE, "missile_chain_clean" }, +// { 0x78EF, "" }, +// { 0x78F0, "" }, +// { 0x78F1, "" }, +// { 0x78F2, "" }, +// { 0x78F3, "" }, +// { 0x78F4, "" }, +// { 0x78F5, "" }, + { 0x78F6, "move_hangout_helithink" }, + { 0x78F7, "catchup_allies_helper_think" }, +// { 0x78F8, "" }, +// { 0x78F9, "" }, + { 0x78FA, "do_rockety_dodge" }, +// { 0x78FB, "" }, +// { 0x78FC, "" }, +// { 0x78FD, "" }, +// { 0x78FE, "" }, +// { 0x78FF, "" }, + { 0x7900, "nearby_hovercraft" }, + { 0x7901, "use_big_splash" }, +// { 0x7902, "" }, + { 0x7903, "add_hovercraft" }, +// { 0x7904, "" }, +// { 0x7905, "" }, +// { 0x7906, "" }, + { 0x7907, "add_rocket_detection" }, +// { 0x7908, "" }, +// { 0x7909, "" }, +// { 0x790A, "" }, + { 0x790B, "do_reinforcement_flyin" }, +// { 0x790C, "" }, +// { 0x790D, "" }, + { 0x790E, "crash_blackhawk_think" }, +// { 0x790F, "" }, + { 0x7910, "do_f15s" }, +// { 0x7911, "" }, +// { 0x7912, "" }, +// { 0x7913, "" }, +// { 0x7914, "" }, +// { 0x7915, "" }, +// { 0x7916, "" }, +// { 0x7917, "" }, +// { 0x7918, "" }, +// { 0x7919, "" }, +// { 0x791A, "" }, + { 0x791B, "player_blackhawk" }, +// { 0x791C, "" }, +// { 0x791D, "" }, +// { 0x791E, "" }, + { 0x791F, "do_crane_event" }, +// { 0x7920, "" }, +// { 0x7921, "" }, +// { 0x7922, "" }, +// { 0x7923, "" }, +// { 0x7924, "" }, + { 0x7925, "get_mortar_time" }, +// { 0x7926, "" }, + { 0x7927, "flak_burst" }, +// { 0x7928, "" }, +// { 0x7929, "" }, +// { 0x792A, "" }, + { 0x792B, "can_mortar_front" }, + { 0x792C, "get_bullet_time" }, + { 0x792D, "fly_in_percent" }, +// { 0x792E, "" }, + { 0x792F, "mortar_delay" }, + { 0x7930, "get_delay_percent" }, +// { 0x7931, "" }, + { 0x7932, "safe_randomfloatrange" }, +// { 0x7933, "" }, +// { 0x7934, "" }, +// { 0x7935, "" }, +// { 0x7936, "" }, +// { 0x7937, "" }, +// { 0x7938, "" }, +// { 0x7939, "" }, +// { 0x793A, "" }, +// { 0x793B, "" }, + { 0x793C, "helis_duke_it_out" }, +// { 0x793D, "" }, +// { 0x793E, "" }, +// { 0x793F, "" }, +// { 0x7940, "" }, + { 0x7941, "beach_color_triggers_touch" }, +// { 0x7942, "" }, + { 0x7943, "swing_light_org_think" }, +// { 0x7944, "" }, + { 0x7945, "swing_lamp_get_nearby_primary" }, +// { 0x7946, "" }, +// { 0x7947, "" }, +// { 0x7948, "" }, +// { 0x7949, "" }, +// { 0x794A, "" }, +// { 0x794B, "" }, +// { 0x794C, "" }, + { 0x794D, "ai_set_goalvolume" }, +// { 0x794E, "" }, +// { 0x794F, "" }, +// { 0x7950, "" }, +// { 0x7951, "" }, +// { 0x7952, "" }, +// { 0x7953, "" }, +// { 0x7954, "" }, +// { 0x7955, "" }, +// { 0x7956, "" }, + { 0x7957, "init_garage" }, +// { 0x7958, "" }, +// { 0x7959, "" }, +// { 0x795A, "" }, +// { 0x795B, "" }, +// { 0x795C, "" }, + { 0x795D, "init_level_flag" }, + { 0x795E, "tank_color_thread" }, +// { 0x795F, "" }, +// { 0x7960, "" }, +// { 0x7961, "" }, +// { 0x7962, "" }, +// { 0x7963, "" }, + { 0x7964, "garage_rondevu_infantry" }, +// { 0x7965, "" }, +// { 0x7966, "" }, +// { 0x7967, "" }, +// { 0x7968, "" }, +// { 0x7969, "" }, +// { 0x796A, "" }, +// { 0x796B, "" }, +// { 0x796C, "" }, +// { 0x796D, "" }, + { 0x796E, "hero_tank_rpg_attack" }, +// { 0x796F, "" }, +// { 0x7970, "" }, +// { 0x7971, "" }, +// { 0x7972, "" }, +// { 0x7973, "" }, + { 0x7974, "common_garage_player_on_tank" }, +// { 0x7975, "" }, +// { 0x7976, "" }, +// { 0x7977, "" }, +// { 0x7978, "" }, +// { 0x7979, "" }, +// { 0x797A, "" }, +// { 0x797B, "" }, + { 0x797C, "f15_bomber" }, + { 0x797D, "setup_end" }, +// { 0x797E, "" }, +// { 0x797F, "" }, +// { 0x7980, "" }, + { 0x7981, "setup_battle2_to_hvts" }, +// { 0x7982, "" }, +// { 0x7983, "" }, +// { 0x7984, "" }, +// { 0x7985, "" }, + { 0x7986, "setup_end_street_combat" }, +// { 0x7987, "" }, + { 0x7988, "green2" }, +// { 0x7989, "" }, +// { 0x798A, "" }, +// { 0x798B, "" }, +// { 0x798C, "" }, + { 0x798D, "endstreetguys1" }, +// { 0x798E, "" }, +// { 0x798F, "" }, +// { 0x7990, "" }, +// { 0x7991, "" }, +// { 0x7992, "" }, + { 0x7993, "suvbody1" }, +// { 0x7994, "" }, +// { 0x7995, "" }, +// { 0x7996, "" }, +// { 0x7997, "" }, +// { 0x7998, "" }, + { 0x7999, "blue2" }, +// { 0x799A, "" }, +// { 0x799B, "" }, + { 0x799C, "breach_door_nag" }, +// { 0x799D, "" }, +// { 0x799E, "" }, +// { 0x799F, "" }, +// { 0x79A0, "" }, + { 0x79A1, "gaz3" }, +// { 0x79A2, "" }, +// { 0x79A3, "" }, +// { 0x79A4, "" }, +// { 0x79A5, "" }, +// { 0x79A6, "" }, +// { 0x79A7, "" }, +// { 0x79A8, "" }, +// { 0x79A9, "" }, +// { 0x79AA, "" }, + { 0x79AB, "suvbody6" }, + { 0x79AC, "suvbody7" }, +// { 0x79AD, "" }, +// { 0x79AE, "" }, +// { 0x79AF, "" }, +// { 0x79B0, "" }, +// { 0x79B1, "" }, +// { 0x79B2, "" }, +// { 0x79B3, "" }, +// { 0x79B4, "" }, +// { 0x79B5, "" }, +// { 0x79B6, "" }, +// { 0x79B7, "" }, +// { 0x79B8, "" }, +// { 0x79B9, "" }, + { 0x79BA, "rogers_into_breach_room" }, + { 0x79BB, "blue1_pre_breach_accuracy" }, +// { 0x79BC, "" }, +// { 0x79BD, "" }, +// { 0x79BE, "" }, +// { 0x79BF, "" }, +// { 0x79C0, "" }, +// { 0x79C1, "" }, +// { 0x79C2, "" }, +// { 0x79C3, "" }, +// { 0x79C4, "" }, +// { 0x79C5, "" }, +// { 0x79C6, "" }, +// { 0x79C7, "" }, +// { 0x79C8, "" }, +// { 0x79C9, "" }, +// { 0x79CA, "" }, +// { 0x79CB, "" }, +// { 0x79CC, "" }, +// { 0x79CD, "" }, + { 0x79CE, "setup_streets" }, + { 0x79CF, "begin_streets" }, +// { 0x79D0, "" }, +// { 0x79D1, "" }, +// { 0x79D2, "" }, +// { 0x79D3, "" }, +// { 0x79D4, "" }, +// { 0x79D5, "" }, +// { 0x79D6, "" }, +// { 0x79D7, "" }, +// { 0x79D8, "" }, +// { 0x79D9, "" }, +// { 0x79DA, "" }, +// { 0x79DB, "" }, +// { 0x79DC, "" }, +// { 0x79DD, "" }, + { 0x79DE, "watch_low_enemy_count" }, +// { 0x79DF, "" }, + { 0x79E0, "streets_reset_obj" }, +// { 0x79E1, "" }, +// { 0x79E2, "" }, +// { 0x79E3, "" }, +// { 0x79E4, "" }, + { 0x79E5, "monitor_street_player" }, +// { 0x79E6, "" }, +// { 0x79E7, "" }, +// { 0x79E8, "" }, +// { 0x79E9, "" }, +// { 0x79EA, "" }, + { 0x79EB, "spawn_room_dregs" }, +// { 0x79EC, "" }, +// { 0x79ED, "" }, +// { 0x79EE, "" }, +// { 0x79EF, "" }, +// { 0x79F0, "" }, +// { 0x79F1, "" }, +// { 0x79F2, "" }, +// { 0x79F3, "" }, +// { 0x79F4, "" }, +// { 0x79F5, "" }, + { 0x79F6, "handle_heli_intro" }, + { 0x79F7, "monitor_tankstops" }, +// { 0x79F8, "" }, +// { 0x79F9, "" }, +// { 0x79FA, "" }, +// { 0x79FB, "" }, +// { 0x79FC, "" }, +// { 0x79FD, "" }, +// { 0x79FE, "" }, +// { 0x79FF, "" }, +// { 0x7A00, "" }, +// { 0x7A01, "" }, +// { 0x7A02, "" }, +// { 0x7A03, "" }, +// { 0x7A04, "" }, +// { 0x7A05, "" }, +// { 0x7A06, "" }, +// { 0x7A07, "" }, +// { 0x7A08, "" }, +// { 0x7A09, "" }, +// { 0x7A0A, "" }, +// { 0x7A0B, "" }, +// { 0x7A0C, "" }, +// { 0x7A0D, "" }, +// { 0x7A0E, "" }, +// { 0x7A0F, "" }, +// { 0x7A10, "" }, +// { 0x7A11, "" }, + { 0x7A12, "outside_count" }, +// { 0x7A13, "" }, +// { 0x7A14, "" }, +// { 0x7A15, "" }, +// { 0x7A16, "" }, +// { 0x7A17, "" }, +// { 0x7A18, "" }, +// { 0x7A19, "" }, +// { 0x7A1A, "" }, +// { 0x7A1B, "" }, +// { 0x7A1C, "" }, +// { 0x7A1D, "" }, +// { 0x7A1E, "" }, + { 0x7A1F, "send_to_active_vol" }, + { 0x7A20, "handle_enemy_tank_advance" }, +// { 0x7A21, "" }, +// { 0x7A22, "" }, +// { 0x7A23, "" }, +// { 0x7A24, "" }, +// { 0x7A25, "" }, +// { 0x7A26, "" }, +// { 0x7A27, "" }, +// { 0x7A28, "" }, +// { 0x7A29, "" }, +// { 0x7A2A, "" }, +// { 0x7A2B, "" }, +// { 0x7A2C, "" }, +// { 0x7A2D, "" }, +// { 0x7A2E, "" }, + { 0x7A2F, "assign_allies" }, +// { 0x7A30, "" }, +// { 0x7A31, "" }, +// { 0x7A32, "" }, +// { 0x7A33, "" }, +// { 0x7A34, "" }, +// { 0x7A35, "" }, + { 0x7A36, "water_fx_plume" }, +// { 0x7A37, "" }, +// { 0x7A38, "" }, +// { 0x7A39, "" }, +// { 0x7A3A, "" }, +// { 0x7A3B, "" }, +// { 0x7A3C, "" }, +// { 0x7A3D, "" }, +// { 0x7A3E, "" }, +// { 0x7A3F, "" }, +// { 0x7A40, "" }, +// { 0x7A41, "" }, +// { 0x7A42, "" }, +// { 0x7A43, "" }, +// { 0x7A44, "" }, +// { 0x7A45, "" }, +// { 0x7A46, "" }, +// { 0x7A47, "" }, +// { 0x7A48, "" }, +// { 0x7A49, "" }, +// { 0x7A4A, "" }, +// { 0x7A4B, "" }, +// { 0x7A4C, "" }, +// { 0x7A4D, "" }, +// { 0x7A4E, "" }, +// { 0x7A4F, "" }, +// { 0x7A50, "" }, +// { 0x7A51, "" }, +// { 0x7A52, "" }, +// { 0x7A53, "" }, +// { 0x7A54, "" }, + { 0x7A55, "setup_thermal_vents" }, +// { 0x7A56, "" }, +// { 0x7A57, "" }, +// { 0x7A58, "" }, +// { 0x7A59, "" }, +// { 0x7A5A, "" }, +// { 0x7A5B, "" }, +// { 0x7A5C, "" }, +// { 0x7A5D, "" }, +// { 0x7A5E, "" }, + { 0x7A5F, "parachute_clamp_angles" }, +// { 0x7A60, "" }, +// { 0x7A61, "" }, +// { 0x7A62, "" }, + { 0x7A63, "setup_altimeter" }, +// { 0x7A64, "" }, +// { 0x7A65, "" }, +// { 0x7A66, "" }, +// { 0x7A67, "" }, +// { 0x7A68, "" }, + { 0x7A69, "steer_max" }, +// { 0x7A6A, "" }, +// { 0x7A6B, "" }, +// { 0x7A6C, "" }, +// { 0x7A6D, "" }, +// { 0x7A6E, "" }, +// { 0x7A6F, "" }, + { 0x7A70, "parachute_thermal_fullscreen_fx" }, +// { 0x7A71, "" }, +// { 0x7A72, "" }, +// { 0x7A73, "" }, +// { 0x7A74, "" }, +// { 0x7A75, "" }, +// { 0x7A76, "" }, +// { 0x7A77, "" }, +// { 0x7A78, "" }, +// { 0x7A79, "" }, +// { 0x7A7A, "" }, +// { 0x7A7B, "" }, +// { 0x7A7C, "" }, + { 0x7A7D, "start_platform" }, +// { 0x7A7E, "" }, +// { 0x7A7F, "" }, +// { 0x7A80, "" }, +// { 0x7A81, "" }, +// { 0x7A82, "" }, +// { 0x7A83, "" }, +// { 0x7A84, "" }, +// { 0x7A85, "" }, +// { 0x7A86, "" }, +// { 0x7A87, "" }, +// { 0x7A88, "" }, +// { 0x7A89, "" }, +// { 0x7A8A, "" }, +// { 0x7A8B, "" }, +// { 0x7A8C, "" }, + { 0x7A8D, "dont_shoot_the_trucks" }, + { 0x7A8E, "truck_shot" }, +// { 0x7A8F, "" }, +// { 0x7A90, "" }, +// { 0x7A91, "" }, +// { 0x7A92, "" }, +// { 0x7A93, "" }, + { 0x7A94, "stop_current_anim" }, +// { 0x7A95, "" }, +// { 0x7A96, "" }, +// { 0x7A97, "" }, +// { 0x7A98, "" }, +// { 0x7A99, "" }, +// { 0x7A9A, "" }, +// { 0x7A9B, "" }, +// { 0x7A9C, "" }, +// { 0x7A9D, "" }, +// { 0x7A9E, "" }, + { 0x7A9F, "dont_break_anim" }, +// { 0x7AA0, "" }, +// { 0x7AA1, "" }, +// { 0x7AA2, "" }, +// { 0x7AA3, "" }, +// { 0x7AA4, "" }, +// { 0x7AA5, "" }, +// { 0x7AA6, "" }, +// { 0x7AA7, "" }, +// { 0x7AA8, "" }, +// { 0x7AA9, "" }, +// { 0x7AAA, "" }, +// { 0x7AAB, "" }, +// { 0x7AAC, "" }, +// { 0x7AAD, "" }, +// { 0x7AAE, "" }, +// { 0x7AAF, "" }, +// { 0x7AB0, "" }, +// { 0x7AB1, "" }, +// { 0x7AB2, "" }, +// { 0x7AB3, "" }, +// { 0x7AB4, "" }, +// { 0x7AB5, "" }, +// { 0x7AB6, "" }, +// { 0x7AB7, "" }, +// { 0x7AB8, "" }, +// { 0x7AB9, "" }, +// { 0x7ABA, "" }, +// { 0x7ABB, "" }, + { 0x7ABC, "is_looping" }, +// { 0x7ABD, "" }, +// { 0x7ABE, "" }, +// { 0x7ABF, "" }, +// { 0x7AC0, "" }, +// { 0x7AC1, "" }, +// { 0x7AC2, "" }, +// { 0x7AC3, "" }, +// { 0x7AC4, "" }, + { 0x7AC5, "price_indicate_guard" }, + { 0x7AC6, "price_wait_vo" }, +// { 0x7AC7, "" }, +// { 0x7AC8, "" }, +// { 0x7AC9, "" }, +// { 0x7ACA, "" }, +// { 0x7ACB, "" }, +// { 0x7ACC, "" }, +// { 0x7ACD, "" }, +// { 0x7ACE, "" }, +// { 0x7ACF, "" }, +// { 0x7AD0, "" }, + { 0x7AD1, "spotlight_road" }, +// { 0x7AD2, "" }, +// { 0x7AD3, "" }, + { 0x7AD4, "dead" }, + { 0x7AD5, "road_spotlight_fx" }, + { 0x7AD6, "wait_across_the_road" }, +// { 0x7AD7, "" }, +// { 0x7AD8, "" }, +// { 0x7AD9, "" }, +// { 0x7ADA, "" }, + { 0x7ADB, "spotlight_override_pos" }, +// { 0x7ADC, "" }, +// { 0x7ADD, "" }, + { 0x7ADE, "price_skip_ahead" }, +// { 0x7ADF, "" }, + { 0x7AE0, "cleanup" }, +// { 0x7AE1, "" }, + { 0x7AE2, "custom_price_loop_anim" }, +// { 0x7AE3, "" }, + { 0x7AE4, "stinger_fire_break_stealth" }, +// { 0x7AE5, "" }, +// { 0x7AE6, "" }, +// { 0x7AE7, "" }, + { 0x7AE8, "do_stealth_check_on_stealth_guards" }, +// { 0x7AE9, "" }, +// { 0x7AEA, "" }, +// { 0x7AEB, "" }, +// { 0x7AEC, "" }, +// { 0x7AED, "" }, +// { 0x7AEE, "" }, +// { 0x7AEF, "" }, +// { 0x7AF0, "" }, +// { 0x7AF1, "" }, +// { 0x7AF2, "" }, +// { 0x7AF3, "" }, +// { 0x7AF4, "" }, + { 0x7AF5, "run_thread_when_spawned" }, + { 0x7AF6, "courtyard_remove_guys_for_stealth" }, +// { 0x7AF7, "" }, +// { 0x7AF8, "" }, +// { 0x7AF9, "" }, +// { 0x7AFA, "" }, +// { 0x7AFB, "" }, +// { 0x7AFC, "" }, +// { 0x7AFD, "" }, +// { 0x7AFE, "" }, +// { 0x7AFF, "" }, +// { 0x7B00, "" }, +// { 0x7B01, "" }, +// { 0x7B02, "" }, +// { 0x7B03, "" }, +// { 0x7B04, "" }, +// { 0x7B05, "" }, +// { 0x7B06, "" }, +// { 0x7B07, "" }, +// { 0x7B08, "" }, +// { 0x7B09, "" }, +// { 0x7B0A, "" }, + { 0x7B0B, "price_vo_ruins_1" }, +// { 0x7B0C, "" }, +// { 0x7B0D, "" }, +// { 0x7B0E, "" }, +// { 0x7B0F, "" }, +// { 0x7B10, "" }, +// { 0x7B11, "" }, +// { 0x7B12, "" }, +// { 0x7B13, "" }, +// { 0x7B14, "" }, + { 0x7B15, "ruins_setup_stealth_patrol_alerts" }, + { 0x7B16, "ruins_grenade_throw_break_stealth" }, +// { 0x7B17, "" }, +// { 0x7B18, "" }, +// { 0x7B19, "" }, +// { 0x7B1A, "" }, +// { 0x7B1B, "" }, +// { 0x7B1C, "" }, + { 0x7B1D, "watch_first_patrol" }, + { 0x7B1E, "puddle_splashes" }, + { 0x7B1F, "unsetfootstepeffect" }, +// { 0x7B20, "" }, +// { 0x7B21, "" }, +// { 0x7B22, "" }, +// { 0x7B23, "" }, +// { 0x7B24, "" }, +// { 0x7B25, "" }, +// { 0x7B26, "" }, +// { 0x7B27, "" }, +// { 0x7B28, "" }, +// { 0x7B29, "" }, +// { 0x7B2A, "" }, +// { 0x7B2B, "" }, + { 0x7B2C, "fail_thread" }, +// { 0x7B2D, "" }, +// { 0x7B2E, "" }, +// { 0x7B2F, "" }, +// { 0x7B30, "" }, +// { 0x7B31, "" }, +// { 0x7B32, "" }, +// { 0x7B33, "" }, +// { 0x7B34, "" }, +// { 0x7B35, "" }, +// { 0x7B36, "" }, +// { 0x7B37, "" }, +// { 0x7B38, "" }, +// { 0x7B39, "" }, +// { 0x7B3A, "" }, +// { 0x7B3B, "" }, +// { 0x7B3C, "" }, +// { 0x7B3D, "" }, +// { 0x7B3E, "" }, +// { 0x7B3F, "" }, + { 0x7B40, "player_mounts_truck" }, +// { 0x7B41, "" }, +// { 0x7B42, "" }, +// { 0x7B43, "" }, +// { 0x7B44, "" }, +// { 0x7B45, "" }, +// { 0x7B46, "" }, +// { 0x7B47, "" }, +// { 0x7B48, "" }, +// { 0x7B49, "" }, +// { 0x7B4A, "" }, +// { 0x7B4B, "" }, +// { 0x7B4C, "" }, + { 0x7B4D, "price_idles_in_truck" }, + { 0x7B4E, "start_cliff" }, +// { 0x7B4F, "" }, + { 0x7B50, "player_slide" }, +// { 0x7B51, "" }, +// { 0x7B52, "" }, +// { 0x7B53, "" }, + { 0x7B54, "player_dirt_overlay" }, +// { 0x7B55, "" }, +// { 0x7B56, "" }, +// { 0x7B57, "" }, +// { 0x7B58, "" }, +// { 0x7B59, "" }, +// { 0x7B5A, "" }, +// { 0x7B5B, "" }, +// { 0x7B5C, "" }, +// { 0x7B5D, "" }, +// { 0x7B5E, "" }, +// { 0x7B5F, "" }, +// { 0x7B60, "" }, +// { 0x7B61, "" }, +// { 0x7B62, "" }, +// { 0x7B63, "" }, +// { 0x7B64, "" }, +// { 0x7B65, "" }, +// { 0x7B66, "" }, +// { 0x7B67, "" }, +// { 0x7B68, "" }, +// { 0x7B69, "" }, + { 0x7B6A, "helicopter_attack_think" }, +// { 0x7B6B, "" }, +// { 0x7B6C, "" }, +// { 0x7B6D, "" }, +// { 0x7B6E, "" }, +// { 0x7B6F, "" }, + { 0x7B70, "tree_clip_fx" }, +// { 0x7B71, "" }, +// { 0x7B72, "" }, +// { 0x7B73, "" }, +// { 0x7B74, "" }, +// { 0x7B75, "" }, +// { 0x7B76, "" }, +// { 0x7B77, "" }, +// { 0x7B78, "" }, +// { 0x7B79, "" }, +// { 0x7B7A, "" }, +// { 0x7B7B, "" }, +// { 0x7B7C, "" }, +// { 0x7B7D, "" }, +// { 0x7B7E, "" }, +// { 0x7B7F, "" }, +// { 0x7B80, "" }, +// { 0x7B81, "" }, +// { 0x7B82, "" }, +// { 0x7B83, "" }, +// { 0x7B84, "" }, +// { 0x7B85, "" }, + { 0x7B86, "price_turning" }, + { 0x7B87, "escape_doors_set_open" }, +// { 0x7B88, "" }, +// { 0x7B89, "" }, +// { 0x7B8A, "" }, +// { 0x7B8B, "" }, +// { 0x7B8C, "" }, +// { 0x7B8D, "" }, +// { 0x7B8E, "" }, +// { 0x7B8F, "" }, +// { 0x7B90, "" }, +// { 0x7B91, "" }, + { 0x7B92, "nikolai_end_line" }, + { 0x7B93, "cliffjump_crash" }, + { 0x7B94, "truck_lights_on" }, +// { 0x7B95, "" }, +// { 0x7B96, "" }, +// { 0x7B97, "" }, +// { 0x7B98, "" }, +// { 0x7B99, "" }, + { 0x7B9A, "start_bridge_explode" }, +// { 0x7B9B, "" }, + { 0x7B9C, "bridge_mantle" }, +// { 0x7B9D, "" }, +// { 0x7B9E, "" }, +// { 0x7B9F, "" }, +// { 0x7BA0, "" }, +// { 0x7BA1, "" }, +// { 0x7BA2, "" }, + { 0x7BA3, "handle_bridge_jump" }, +// { 0x7BA4, "" }, +// { 0x7BA5, "" }, +// { 0x7BA6, "" }, +// { 0x7BA7, "" }, +// { 0x7BA8, "" }, +// { 0x7BA9, "" }, +// { 0x7BAA, "" }, +// { 0x7BAB, "" }, +// { 0x7BAC, "" }, +// { 0x7BAD, "" }, +// { 0x7BAE, "" }, +// { 0x7BAF, "" }, +// { 0x7BB0, "" }, +// { 0x7BB1, "" }, + { 0x7BB2, "price_courtyard_vo" }, +// { 0x7BB3, "" }, +// { 0x7BB4, "" }, +// { 0x7BB5, "" }, +// { 0x7BB6, "" }, +// { 0x7BB7, "" }, +// { 0x7BB8, "" }, +// { 0x7BB9, "" }, +// { 0x7BBA, "" }, +// { 0x7BBB, "" }, +// { 0x7BBC, "" }, +// { 0x7BBD, "" }, +// { 0x7BBE, "" }, +// { 0x7BBF, "" }, +// { 0x7BC0, "" }, +// { 0x7BC1, "" }, +// { 0x7BC2, "" }, +// { 0x7BC3, "" }, +// { 0x7BC4, "" }, +// { 0x7BC5, "" }, +// { 0x7BC6, "" }, +// { 0x7BC7, "" }, +// { 0x7BC8, "" }, +// { 0x7BC9, "" }, +// { 0x7BCA, "" }, +// { 0x7BCB, "" }, +// { 0x7BCC, "" }, +// { 0x7BCD, "" }, +// { 0x7BCE, "" }, +// { 0x7BCF, "" }, +// { 0x7BD0, "" }, +// { 0x7BD1, "" }, +// { 0x7BD2, "" }, +// { 0x7BD3, "" }, + { 0x7BD4, "price_time_explosion" }, +// { 0x7BD5, "" }, +// { 0x7BD6, "" }, +// { 0x7BD7, "" }, +// { 0x7BD8, "" }, +// { 0x7BD9, "" }, +// { 0x7BDA, "" }, +// { 0x7BDB, "" }, +// { 0x7BDC, "" }, +// { 0x7BDD, "" }, +// { 0x7BDE, "" }, +// { 0x7BDF, "" }, +// { 0x7BE0, "" }, +// { 0x7BE1, "" }, +// { 0x7BE2, "" }, +// { 0x7BE3, "" }, +// { 0x7BE4, "" }, +// { 0x7BE5, "" }, +// { 0x7BE6, "" }, +// { 0x7BE7, "" }, +// { 0x7BE8, "" }, +// { 0x7BE9, "" }, +// { 0x7BEA, "" }, +// { 0x7BEB, "" }, + { 0x7BEC, "ai_makarov" }, +// { 0x7BED, "" }, +// { 0x7BEE, "" }, +// { 0x7BEF, "" }, +// { 0x7BF0, "" }, +// { 0x7BF1, "" }, +// { 0x7BF2, "" }, + { 0x7BF3, "alarm_start" }, +// { 0x7BF4, "" }, +// { 0x7BF5, "" }, +// { 0x7BF6, "" }, + { 0x7BF7, "price_destroy_wet_wall_dialog" }, +// { 0x7BF8, "" }, + { 0x7BF9, "n_lightning_misses" }, + { 0x7BFA, "alexi_vo1" }, +// { 0x7BFB, "" }, +// { 0x7BFC, "" }, +// { 0x7BFD, "" }, +// { 0x7BFE, "" }, + { 0x7BFF, "start_prison_battle_start" }, +// { 0x7C00, "" }, + { 0x7C01, "security_office" }, + { 0x7C02, "prison_battle_start" }, +// { 0x7C03, "" }, +// { 0x7C04, "" }, + { 0x7C05, "top_right_destructible" }, +// { 0x7C06, "" }, +// { 0x7C07, "" }, +// { 0x7C08, "" }, +// { 0x7C09, "" }, +// { 0x7C0A, "" }, +// { 0x7C0B, "" }, +// { 0x7C0C, "" }, +// { 0x7C0D, "" }, +// { 0x7C0E, "" }, +// { 0x7C0F, "" }, +// { 0x7C10, "" }, + { 0x7C11, "old_maxvisibledist" }, +// { 0x7C12, "" }, +// { 0x7C13, "" }, +// { 0x7C14, "" }, +// { 0x7C15, "" }, + { 0x7C16, "a_m_flares" }, +// { 0x7C17, "" }, +// { 0x7C18, "" }, +// { 0x7C19, "" }, +// { 0x7C1A, "" }, +// { 0x7C1B, "" }, +// { 0x7C1C, "" }, +// { 0x7C1D, "" }, +// { 0x7C1E, "" }, +// { 0x7C1F, "" }, +// { 0x7C20, "" }, +// { 0x7C21, "" }, +// { 0x7C22, "" }, +// { 0x7C23, "" }, +// { 0x7C24, "" }, +// { 0x7C25, "" }, + { 0x7C26, "security_guard_2" }, + { 0x7C27, "hide_knife" }, +// { 0x7C28, "" }, + { 0x7C29, "security_office_guards" }, +// { 0x7C2A, "" }, +// { 0x7C2B, "" }, +// { 0x7C2C, "" }, + { 0x7C2D, "stop_animation_on_grenade_prison" }, + { 0x7C2E, "stop_animation_on_prison_guard_if_flashbang" }, +// { 0x7C2F, "" }, +// { 0x7C30, "" }, +// { 0x7C31, "" }, + { 0x7C32, "stab_enter" }, +// { 0x7C33, "" }, +// { 0x7C34, "" }, +// { 0x7C35, "" }, +// { 0x7C36, "" }, +// { 0x7C37, "" }, +// { 0x7C38, "" }, +// { 0x7C39, "" }, +// { 0x7C3A, "" }, +// { 0x7C3B, "" }, +// { 0x7C3C, "" }, +// { 0x7C3D, "" }, +// { 0x7C3E, "" }, +// { 0x7C3F, "" }, +// { 0x7C40, "" }, +// { 0x7C41, "" }, +// { 0x7C42, "" }, +// { 0x7C43, "" }, +// { 0x7C44, "" }, +// { 0x7C45, "" }, +// { 0x7C46, "" }, +// { 0x7C47, "" }, +// { 0x7C48, "" }, +// { 0x7C49, "" }, +// { 0x7C4A, "" }, +// { 0x7C4B, "" }, +// { 0x7C4C, "" }, +// { 0x7C4D, "" }, +// { 0x7C4E, "" }, +// { 0x7C4F, "" }, + { 0x7C50, "move_price_into_multipath_start" }, + { 0x7C51, "shoot_at_fake_target" }, +// { 0x7C52, "" }, +// { 0x7C53, "" }, +// { 0x7C54, "" }, +// { 0x7C55, "" }, + { 0x7C56, "animate_harass_guards" }, +// { 0x7C57, "" }, + { 0x7C58, "harassed_prisoner_react" }, +// { 0x7C59, "" }, +// { 0x7C5A, "" }, +// { 0x7C5B, "" }, +// { 0x7C5C, "" }, +// { 0x7C5D, "" }, +// { 0x7C5E, "" }, + { 0x7C5F, "spawn_stair_stumble_forward_guard" }, +// { 0x7C60, "" }, +// { 0x7C61, "" }, +// { 0x7C62, "" }, + { 0x7C63, "spawn_stair_stumble_back_guard" }, +// { 0x7C64, "" }, +// { 0x7C65, "" }, +// { 0x7C66, "" }, +// { 0x7C67, "" }, +// { 0x7C68, "" }, + { 0x7C69, "guard_covercrouch_blindfire_idle_anims" }, +// { 0x7C6A, "" }, +// { 0x7C6B, "" }, +// { 0x7C6C, "" }, +// { 0x7C6D, "" }, +// { 0x7C6E, "" }, +// { 0x7C6F, "" }, +// { 0x7C70, "" }, +// { 0x7C71, "" }, +// { 0x7C72, "" }, +// { 0x7C73, "" }, + { 0x7C74, "check_player_distance" }, +// { 0x7C75, "" }, +// { 0x7C76, "" }, +// { 0x7C77, "" }, +// { 0x7C78, "" }, +// { 0x7C79, "" }, +// { 0x7C7A, "" }, +// { 0x7C7B, "" }, +// { 0x7C7C, "" }, +// { 0x7C7D, "" }, +// { 0x7C7E, "" }, +// { 0x7C7F, "" }, +// { 0x7C80, "" }, + { 0x7C81, "price_dialogue_security_office" }, +// { 0x7C82, "" }, +// { 0x7C83, "" }, + { 0x7C84, "price_impulsive_vo" }, +// { 0x7C85, "" }, +// { 0x7C86, "" }, + { 0x7C87, "swap_nvg_fx" }, +// { 0x7C88, "" }, +// { 0x7C89, "" }, +// { 0x7C8A, "" }, + { 0x7C8B, "generator_stumble" }, +// { 0x7C8C, "" }, +// { 0x7C8D, "" }, +// { 0x7C8E, "" }, +// { 0x7C8F, "" }, +// { 0x7C90, "" }, +// { 0x7C91, "" }, +// { 0x7C92, "" }, +// { 0x7C93, "" }, +// { 0x7C94, "" }, +// { 0x7C95, "" }, +// { 0x7C96, "" }, +// { 0x7C97, "" }, +// { 0x7C98, "" }, +// { 0x7C99, "" }, +// { 0x7C9A, "" }, +// { 0x7C9B, "" }, +// { 0x7C9C, "" }, +// { 0x7C9D, "" }, +// { 0x7C9E, "" }, +// { 0x7C9F, "" }, +// { 0x7CA0, "" }, +// { 0x7CA1, "" }, +// { 0x7CA2, "" }, +// { 0x7CA3, "" }, +// { 0x7CA4, "" }, +// { 0x7CA5, "" }, +// { 0x7CA6, "" }, + { 0x7CA7, "dialog_lines" }, +// { 0x7CA8, "" }, +// { 0x7CA9, "" }, +// { 0x7CAA, "" }, +// { 0x7CAB, "" }, +// { 0x7CAC, "" }, + { 0x7CAD, "forestfireeffectson" }, +// { 0x7CAE, "" }, +// { 0x7CAF, "" }, + { 0x7CB0, "monitor_player_speed" }, +// { 0x7CB1, "" }, +// { 0x7CB2, "" }, + { 0x7CB3, "pause_forest_fire_fx" }, +// { 0x7CB4, "" }, +// { 0x7CB5, "" }, +// { 0x7CB6, "" }, +// { 0x7CB7, "" }, +// { 0x7CB8, "" }, +// { 0x7CB9, "" }, +// { 0x7CBA, "" }, +// { 0x7CBB, "" }, +// { 0x7CBC, "" }, +// { 0x7CBD, "" }, +// { 0x7CBE, "" }, +// { 0x7CBF, "" }, +// { 0x7CC0, "" }, +// { 0x7CC1, "" }, +// { 0x7CC2, "" }, +// { 0x7CC3, "" }, +// { 0x7CC4, "" }, +// { 0x7CC5, "" }, + { 0x7CC6, "v_color_base" }, +// { 0x7CC7, "" }, +// { 0x7CC8, "" }, +// { 0x7CC9, "" }, +// { 0x7CCA, "" }, +// { 0x7CCB, "" }, +// { 0x7CCC, "" }, +// { 0x7CCD, "" }, +// { 0x7CCE, "" }, +// { 0x7CCF, "" }, +// { 0x7CD0, "" }, +// { 0x7CD1, "" }, +// { 0x7CD2, "" }, +// { 0x7CD3, "" }, +// { 0x7CD4, "" }, + { 0x7CD5, "nag_evaluation" }, +// { 0x7CD6, "" }, +// { 0x7CD7, "" }, +// { 0x7CD8, "" }, +// { 0x7CD9, "" }, +// { 0x7CDA, "" }, +// { 0x7CDB, "" }, +// { 0x7CDC, "" }, + { 0x7CDD, "_dual_stinger_loading" }, +// { 0x7CDE, "" }, +// { 0x7CDF, "" }, +// { 0x7CE0, "" }, +// { 0x7CE1, "" }, +// { 0x7CE2, "" }, +// { 0x7CE3, "" }, + { 0x7CE4, "_use_button_think_threaded" }, +// { 0x7CE5, "" }, +// { 0x7CE6, "" }, +// { 0x7CE7, "" }, +// { 0x7CE8, "" }, +// { 0x7CE9, "" }, + { 0x7CEA, "use_button_pressed" }, +// { 0x7CEB, "" }, +// { 0x7CEC, "" }, +// { 0x7CED, "" }, +// { 0x7CEE, "" }, +// { 0x7CEF, "" }, +// { 0x7CF0, "" }, +// { 0x7CF1, "" }, +// { 0x7CF2, "" }, +// { 0x7CF3, "" }, +// { 0x7CF4, "" }, +// { 0x7CF5, "" }, +// { 0x7CF6, "" }, +// { 0x7CF7, "" }, +// { 0x7CF8, "" }, +// { 0x7CF9, "" }, +// { 0x7CFA, "" }, +// { 0x7CFB, "" }, +// { 0x7CFC, "" }, +// { 0x7CFD, "" }, +// { 0x7CFE, "" }, +// { 0x7CFF, "" }, +// { 0x7D00, "" }, +// { 0x7D01, "" }, +// { 0x7D02, "" }, +// { 0x7D03, "" }, +// { 0x7D04, "" }, +// { 0x7D05, "" }, +// { 0x7D06, "" }, +// { 0x7D07, "" }, +// { 0x7D08, "" }, +// { 0x7D09, "" }, +// { 0x7D0A, "" }, +// { 0x7D0B, "" }, +// { 0x7D0C, "" }, +// { 0x7D0D, "" }, +// { 0x7D0E, "" }, +// { 0x7D0F, "" }, + { 0x7D10, "bridge_crossing" }, + { 0x7D11, "btr_drives_across_bridge" }, + { 0x7D12, "scaffold_shake" }, +// { 0x7D13, "" }, +// { 0x7D14, "" }, + { 0x7D15, "price_watch_bomb_plant" }, +// { 0x7D16, "" }, +// { 0x7D17, "" }, +// { 0x7D18, "" }, +// { 0x7D19, "" }, +// { 0x7D1A, "" }, +// { 0x7D1B, "" }, +// { 0x7D1C, "" }, +// { 0x7D1D, "" }, + { 0x7D1E, "player_fall" }, +// { 0x7D1F, "" }, +// { 0x7D20, "" }, +// { 0x7D21, "" }, +// { 0x7D22, "" }, +// { 0x7D23, "" }, +// { 0x7D24, "" }, + { 0x7D25, "cart_clip_failsafe" }, +// { 0x7D26, "" }, +// { 0x7D27, "" }, +// { 0x7D28, "" }, +// { 0x7D29, "" }, +// { 0x7D2A, "" }, +// { 0x7D2B, "" }, +// { 0x7D2C, "" }, +// { 0x7D2D, "" }, +// { 0x7D2E, "" }, +// { 0x7D2F, "" }, +// { 0x7D30, "" }, +// { 0x7D31, "" }, +// { 0x7D32, "" }, +// { 0x7D33, "" }, +// { 0x7D34, "" }, +// { 0x7D35, "" }, +// { 0x7D36, "" }, +// { 0x7D37, "" }, +// { 0x7D38, "" }, +// { 0x7D39, "" }, + { 0x7D3A, "initial_reinforcement_think" }, +// { 0x7D3B, "" }, +// { 0x7D3C, "" }, +// { 0x7D3D, "" }, +// { 0x7D3E, "" }, +// { 0x7D3F, "" }, +// { 0x7D40, "" }, +// { 0x7D41, "" }, +// { 0x7D42, "" }, + { 0x7D43, "watch_price_right_color" }, +// { 0x7D44, "" }, +// { 0x7D45, "" }, +// { 0x7D46, "" }, + { 0x7D47, "handle_environmental_fx" }, +// { 0x7D48, "" }, + { 0x7D49, "handle_water_splash_fx" }, +// { 0x7D4A, "" }, +// { 0x7D4B, "" }, +// { 0x7D4C, "" }, +// { 0x7D4D, "" }, +// { 0x7D4E, "" }, +// { 0x7D4F, "" }, + { 0x7D50, "character/character_hero_delta_grinch_snow" }, + { 0x7D51, "character/character_hero_arctic_price" }, +// { 0x7D52, "" }, +// { 0x7D53, "" }, +// { 0x7D54, "" }, + { 0x7D55, "character/character_russian_pres_daughter_iw" }, +// { 0x7D56, "" }, +// { 0x7D57, "" }, +// { 0x7D58, "" }, +// { 0x7D59, "" }, +// { 0x7D5A, "" }, + { 0x7D5B, "maps/createfx/rescue_2_fx" }, + { 0x7D5C, "generic_fx" }, + { 0x7D5D, "suburban_minigun_overrides" }, +// { 0x7D5E, "" }, +// { 0x7D5F, "" }, +// { 0x7D60, "" }, +// { 0x7D61, "" }, +// { 0x7D62, "" }, +// { 0x7D63, "" }, +// { 0x7D64, "" }, +// { 0x7D65, "" }, +// { 0x7D66, "" }, +// { 0x7D67, "" }, +// { 0x7D68, "" }, +// { 0x7D69, "" }, +// { 0x7D6A, "" }, +// { 0x7D6B, "" }, +// { 0x7D6C, "" }, +// { 0x7D6D, "" }, +// { 0x7D6E, "" }, +// { 0x7D6F, "" }, +// { 0x7D70, "" }, + { 0x7D71, "cavern_top_fight" }, +// { 0x7D72, "" }, +// { 0x7D73, "" }, +// { 0x7D74, "" }, +// { 0x7D75, "" }, +// { 0x7D76, "" }, +// { 0x7D77, "" }, +// { 0x7D78, "" }, +// { 0x7D79, "" }, +// { 0x7D7A, "" }, +// { 0x7D7B, "" }, +// { 0x7D7C, "" }, +// { 0x7D7D, "" }, +// { 0x7D7E, "" }, +// { 0x7D7F, "" }, +// { 0x7D80, "" }, +// { 0x7D81, "" }, +// { 0x7D82, "" }, +// { 0x7D83, "" }, +// { 0x7D84, "" }, +// { 0x7D85, "" }, +// { 0x7D86, "" }, +// { 0x7D87, "" }, +// { 0x7D88, "" }, +// { 0x7D89, "" }, +// { 0x7D8A, "" }, + { 0x7D8B, "character/character_fso_vest_nopacks_dirty" }, +// { 0x7D8C, "" }, +// { 0x7D8D, "" }, +// { 0x7D8E, "" }, +// { 0x7D8F, "" }, + { 0x7D90, "character/character_civilian_london_fem_c" }, +// { 0x7D91, "" }, +// { 0x7D92, "" }, +// { 0x7D93, "" }, + { 0x7D94, "xmodelalias/alias_russian_military_black_heads" }, +// { 0x7D95, "" }, +// { 0x7D96, "" }, +// { 0x7D97, "" }, +// { 0x7D98, "" }, +// { 0x7D99, "" }, +// { 0x7D9A, "" }, +// { 0x7D9B, "" }, +// { 0x7D9C, "" }, +// { 0x7D9D, "" }, +// { 0x7D9E, "" }, +// { 0x7D9F, "" }, +// { 0x7DA0, "" }, +// { 0x7DA1, "" }, +// { 0x7DA2, "" }, +// { 0x7DA3, "" }, +// { 0x7DA4, "" }, +// { 0x7DA5, "" }, +// { 0x7DA6, "" }, +// { 0x7DA7, "" }, + { 0x7DA8, "character/character_opforce_berlin_assault_a" }, + { 0x7DA9, "character/character_opforce_berlin_assault_b" }, +// { 0x7DAA, "" }, +// { 0x7DAB, "" }, +// { 0x7DAC, "" }, +// { 0x7DAD, "" }, + { 0x7DAE, "character/character_opforce_berlin_ass_b_dusty" }, +// { 0x7DAF, "" }, +// { 0x7DB0, "" }, +// { 0x7DB1, "" }, +// { 0x7DB2, "" }, +// { 0x7DB3, "" }, +// { 0x7DB4, "" }, +// { 0x7DB5, "" }, +// { 0x7DB6, "" }, +// { 0x7DB7, "" }, +// { 0x7DB8, "" }, +// { 0x7DB9, "" }, +// { 0x7DBA, "" }, +// { 0x7DBB, "" }, +// { 0x7DBC, "" }, +// { 0x7DBD, "" }, + { 0x7DBE, "character/character_hero_delta_sandman_noglasses" }, +// { 0x7DBF, "" }, +// { 0x7DC0, "" }, +// { 0x7DC1, "" }, +// { 0x7DC2, "" }, +// { 0x7DC3, "" }, +// { 0x7DC4, "" }, +// { 0x7DC5, "" }, +// { 0x7DC6, "" }, +// { 0x7DC7, "" }, +// { 0x7DC8, "" }, +// { 0x7DC9, "" }, + { 0x7DCA, "xmodelalias/alias_civilian_dubai_heads_female" }, + { 0x7DCB, "character/character_civilian_dubai_females" }, + { 0x7DCC, "character/character_vil_makarov_prague" }, +// { 0x7DCD, "" }, +// { 0x7DCE, "" }, +// { 0x7DCF, "" }, +// { 0x7DD0, "" }, +// { 0x7DD1, "" }, +// { 0x7DD2, "" }, +// { 0x7DD3, "" }, +// { 0x7DD4, "" }, +// { 0x7DD5, "" }, +// { 0x7DD6, "" }, +// { 0x7DD7, "" }, +// { 0x7DD8, "" }, +// { 0x7DD9, "" }, + { 0x7DDA, "maps/createart/so_survival_mp_bootleg_fog" }, +// { 0x7DDB, "" }, +// { 0x7DDC, "" }, +// { 0x7DDD, "" }, + { 0x7DDE, "maps/createart/so_survival_mp_carbon_fog" }, +// { 0x7DDF, "" }, +// { 0x7DE0, "" }, +// { 0x7DE1, "" }, +// { 0x7DE2, "" }, +// { 0x7DE3, "" }, +// { 0x7DE4, "" }, + { 0x7DE5, "maps/createart/so_survival_mp_lambeth_art" }, +// { 0x7DE6, "" }, +// { 0x7DE7, "" }, +// { 0x7DE8, "" }, +// { 0x7DE9, "" }, +// { 0x7DEA, "" }, +// { 0x7DEB, "" }, +// { 0x7DEC, "" }, +// { 0x7DED, "" }, +// { 0x7DEE, "" }, +// { 0x7DEF, "" }, +// { 0x7DF0, "" }, +// { 0x7DF1, "" }, +// { 0x7DF2, "" }, +// { 0x7DF3, "" }, +// { 0x7DF4, "" }, +// { 0x7DF5, "" }, +// { 0x7DF6, "" }, +// { 0x7DF7, "" }, +// { 0x7DF8, "" }, +// { 0x7DF9, "" }, +// { 0x7DFA, "" }, +// { 0x7DFB, "" }, +// { 0x7DFC, "" }, +// { 0x7DFD, "" }, +// { 0x7DFE, "" }, +// { 0x7DFF, "" }, +// { 0x7E00, "" }, +// { 0x7E01, "" }, +// { 0x7E02, "" }, +// { 0x7E03, "" }, +// { 0x7E04, "" }, +// { 0x7E05, "" }, +// { 0x7E06, "" }, +// { 0x7E07, "" }, +// { 0x7E08, "" }, +// { 0x7E09, "" }, +// { 0x7E0A, "" }, +// { 0x7E0B, "" }, +// { 0x7E0C, "" }, +// { 0x7E0D, "" }, + { 0x7E0E, "script_attackpattern" }, +// { 0x7E0F, "" }, +// { 0x7E10, "" }, +// { 0x7E11, "" }, +// { 0x7E12, "" }, +// { 0x7E13, "" }, +// { 0x7E14, "" }, +// { 0x7E15, "" }, +// { 0x7E16, "" }, +// { 0x7E17, "" }, +// { 0x7E18, "" }, +// { 0x7E19, "" }, +// { 0x7E1A, "" }, +// { 0x7E1B, "" }, +// { 0x7E1C, "" }, +// { 0x7E1D, "" }, +// { 0x7E1E, "" }, +// { 0x7E1F, "" }, +// { 0x7E20, "" }, + { 0x7E21, "script_vehicledetourtype" }, +// { 0x7E22, "" }, +// { 0x7E23, "" }, +// { 0x7E24, "" }, +// { 0x7E25, "" }, +// { 0x7E26, "" }, +// { 0x7E27, "" }, +// { 0x7E28, "" }, +// { 0x7E29, "" }, +// { 0x7E2A, "" }, +// { 0x7E2B, "" }, +// { 0x7E2C, "" }, +// { 0x7E2D, "" }, +// { 0x7E2E, "" }, +// { 0x7E2F, "" }, +// { 0x7E30, "" }, +// { 0x7E31, "" }, +// { 0x7E32, "" }, +// { 0x7E33, "" }, +// { 0x7E34, "" }, +// { 0x7E35, "" }, + { 0x7E36, "script_nohealth" }, +// { 0x7E37, "" }, +// { 0x7E38, "" }, +// { 0x7E39, "" }, +// { 0x7E3A, "" }, +// { 0x7E3B, "" }, +// { 0x7E3C, "" }, +// { 0x7E3D, "" }, +// { 0x7E3E, "" }, +// { 0x7E3F, "" }, +// { 0x7E40, "" }, +// { 0x7E41, "" }, +// { 0x7E42, "" }, +// { 0x7E43, "" }, +// { 0x7E44, "" }, +// { 0x7E45, "" }, +// { 0x7E46, "" }, +// { 0x7E47, "" }, +// { 0x7E48, "" }, +// { 0x7E49, "" }, +// { 0x7E4A, "" }, + { 0x7E4B, "lighttarget" }, +// { 0x7E4C, "" }, +// { 0x7E4D, "" }, +// { 0x7E4E, "" }, + { 0x7E4F, "def" }, +// { 0x7E50, "" }, +// { 0x7E51, "" }, + { 0x7E52, "fov_outer" }, +// { 0x7E53, "" }, +// { 0x7E54, "" }, +// { 0x7E55, "" }, +// { 0x7E56, "" }, +// { 0x7E57, "" }, +// { 0x7E58, "" }, +// { 0x7E59, "" }, +// { 0x7E5A, "" }, +// { 0x7E5B, "" }, +// { 0x7E5C, "" }, +// { 0x7E5D, "" }, +// { 0x7E5E, "" }, +// { 0x7E5F, "" }, +// { 0x7E60, "" }, +// { 0x7E61, "" }, +// { 0x7E62, "" }, +// { 0x7E63, "" }, +// { 0x7E64, "" }, +// { 0x7E65, "" }, + { 0x7E66, "target_not" }, +// { 0x7E67, "" }, + { 0x7E68, "searchfor" }, +// { 0x7E69, "" }, +// { 0x7E6A, "" }, +// { 0x7E6B, "" }, +// { 0x7E6C, "" }, +// { 0x7E6D, "" }, +// { 0x7E6E, "" }, +// { 0x7E6F, "" }, +// { 0x7E70, "" }, +// { 0x7E71, "" }, +// { 0x7E72, "" }, +// { 0x7E73, "" }, +// { 0x7E74, "" }, +// { 0x7E75, "" }, +// { 0x7E76, "" }, +// { 0x7E77, "" }, + { 0x7E78, "script_connectpaths" }, +// { 0x7E79, "" }, +// { 0x7E7A, "" }, +// { 0x7E7B, "" }, +// { 0x7E7C, "" }, +// { 0x7E7D, "" }, +// { 0x7E7E, "" }, +// { 0x7E7F, "" }, +// { 0x7E80, "" }, +// { 0x7E81, "" }, +// { 0x7E82, "" }, +// { 0x7E83, "" }, +// { 0x7E84, "" }, +// { 0x7E85, "" }, +// { 0x7E86, "" }, +// { 0x7E87, "" }, + { 0x7E88, "character/character_city_civ_male_a" }, +// { 0x7E89, "" }, +// { 0x7E8A, "" }, + { 0x7E8B, "character/character_civilian_urban_male_ab_wht" }, +// { 0x7E8C, "" }, + { 0x7E8D, "character/character_civilian_urban_male_ba_wht" }, + { 0x7E8E, "character/character_civilian_urban_male_bb_wht" }, +// { 0x7E8F, "" }, +// { 0x7E90, "" }, +// { 0x7E91, "" }, +// { 0x7E92, "" }, +// { 0x7E93, "" }, +// { 0x7E94, "" }, +// { 0x7E95, "" }, +// { 0x7E96, "" }, +// { 0x7E97, "" }, +// { 0x7E98, "" }, +// { 0x7E99, "" }, +// { 0x7E9A, "" }, + { 0x7E9B, "script_lookahead" }, + { 0x7E9C, "script_animname" }, + { 0x7E9D, "script_goalradius" }, +// { 0x7E9E, "" }, +// { 0x7E9F, "" }, +// { 0x7EA0, "" }, +// { 0x7EA1, "" }, +// { 0x7EA2, "" }, +// { 0x7EA3, "" }, + { 0x7EA4, "radois" }, +// { 0x7EA5, "" }, +// { 0x7EA6, "" }, +// { 0x7EA7, "" }, +// { 0x7EA8, "" }, +// { 0x7EA9, "" }, +// { 0x7EAA, "" }, +// { 0x7EAB, "" }, +// { 0x7EAC, "" }, +// { 0x7EAD, "" }, +// { 0x7EAE, "" }, + { 0x7EAF, "script_slomobreach" }, +// { 0x7EB0, "" }, +// { 0x7EB1, "" }, +// { 0x7EB2, "" }, +// { 0x7EB3, "" }, +// { 0x7EB4, "" }, +// { 0x7EB5, "" }, +// { 0x7EB6, "" }, +// { 0x7EB7, "" }, +// { 0x7EB8, "" }, +// { 0x7EB9, "" }, +// { 0x7EBA, "" }, +// { 0x7EBB, "" }, +// { 0x7EBC, "" }, +// { 0x7EBD, "" }, +// { 0x7EBE, "" }, +// { 0x7EBF, "" }, +// { 0x7EC0, "" }, +// { 0x7EC1, "" }, +// { 0x7EC2, "" }, +// { 0x7EC3, "" }, +// { 0x7EC4, "" }, +// { 0x7EC5, "" }, +// { 0x7EC6, "" }, +// { 0x7EC7, "" }, +// { 0x7EC8, "" }, +// { 0x7EC9, "" }, +// { 0x7ECA, "" }, + { 0x7ECB, "sas_turnstile" }, + { 0x7ECC, "poster_bink" }, +// { 0x7ECD, "" }, +// { 0x7ECE, "" }, +// { 0x7ECF, "" }, +// { 0x7ED0, "" }, +// { 0x7ED1, "" }, +// { 0x7ED2, "" }, +// { 0x7ED3, "" }, +// { 0x7ED4, "" }, +// { 0x7ED5, "" }, +// { 0x7ED6, "" }, +// { 0x7ED7, "" }, +// { 0x7ED8, "" }, +// { 0x7ED9, "" }, + { 0x7EDA, "takedown_ent_on_ai_death" }, +// { 0x7EDB, "" }, +// { 0x7EDC, "" }, +// { 0x7EDD, "" }, +// { 0x7EDE, "" }, +// { 0x7EDF, "" }, +// { 0x7EE0, "" }, +// { 0x7EE1, "" }, +// { 0x7EE2, "" }, +// { 0x7EE3, "" }, +// { 0x7EE4, "" }, + { 0x7EE5, "truck_targets" }, +// { 0x7EE6, "" }, + { 0x7EE7, "truck_shoot_start" }, +// { 0x7EE8, "" }, +// { 0x7EE9, "" }, +// { 0x7EEA, "" }, +// { 0x7EEB, "" }, +// { 0x7EEC, "" }, +// { 0x7EED, "" }, +// { 0x7EEE, "" }, +// { 0x7EEF, "" }, +// { 0x7EF0, "" }, +// { 0x7EF1, "" }, +// { 0x7EF2, "" }, +// { 0x7EF3, "" }, +// { 0x7EF4, "" }, +// { 0x7EF5, "" }, +// { 0x7EF6, "" }, +// { 0x7EF7, "" }, +// { 0x7EF8, "" }, +// { 0x7EF9, "" }, +// { 0x7EFA, "" }, +// { 0x7EFB, "" }, +// { 0x7EFC, "" }, +// { 0x7EFD, "" }, +// { 0x7EFE, "" }, +// { 0x7EFF, "" }, +// { 0x7F00, "" }, +// { 0x7F01, "" }, +// { 0x7F02, "" }, +// { 0x7F03, "" }, +// { 0x7F04, "" }, + { 0x7F05, "primary_light_flicker" }, +// { 0x7F06, "" }, +// { 0x7F07, "" }, +// { 0x7F08, "" }, + { 0x7F09, "interrupt_anim_if_shot" }, +// { 0x7F0A, "" }, +// { 0x7F0B, "" }, + { 0x7F0C, "stairs_guys" }, +// { 0x7F0D, "" }, +// { 0x7F0E, "" }, +// { 0x7F0F, "" }, +// { 0x7F10, "" }, +// { 0x7F11, "" }, + { 0x7F12, "ending_police_cars" }, +// { 0x7F13, "" }, +// { 0x7F14, "" }, +// { 0x7F15, "" }, +// { 0x7F16, "" }, +// { 0x7F17, "" }, +// { 0x7F18, "" }, +// { 0x7F19, "" }, +// { 0x7F1A, "" }, +// { 0x7F1B, "" }, +// { 0x7F1C, "" }, +// { 0x7F1D, "" }, +// { 0x7F1E, "" }, +// { 0x7F1F, "" }, +// { 0x7F20, "" }, +// { 0x7F21, "" }, +// { 0x7F22, "" }, +// { 0x7F23, "" }, +// { 0x7F24, "" }, +// { 0x7F25, "" }, + { 0x7F26, "trigger_with_targetname_dronespawn" }, +// { 0x7F27, "" }, +// { 0x7F28, "" }, +// { 0x7F29, "" }, +// { 0x7F2A, "" }, + { 0x7F2B, "safe_gun_remove" }, +// { 0x7F2C, "" }, +// { 0x7F2D, "" }, + { 0x7F2E, "waiting_for_sound" }, +// { 0x7F2F, "" }, +// { 0x7F30, "" }, + { 0x7F31, "vehicles_print_stopped_positions" }, +// { 0x7F32, "" }, +// { 0x7F33, "" }, +// { 0x7F34, "" }, +// { 0x7F35, "" }, +// { 0x7F36, "" }, +// { 0x7F37, "" }, +// { 0x7F38, "" }, +// { 0x7F39, "" }, + { 0x7F3A, "friendly_explosion_reaction" }, +// { 0x7F3B, "" }, +// { 0x7F3C, "" }, +// { 0x7F3D, "" }, +// { 0x7F3E, "" }, + { 0x7F3F, "post_train_crash_dialogue" }, +// { 0x7F40, "" }, +// { 0x7F41, "" }, +// { 0x7F42, "" }, +// { 0x7F43, "" }, +// { 0x7F44, "" }, +// { 0x7F45, "" }, +// { 0x7F46, "" }, + { 0x7F47, "train_crash_open_view" }, +// { 0x7F48, "" }, +// { 0x7F49, "" }, +// { 0x7F4A, "" }, + { 0x7F4B, "sas_leader_init" }, + { 0x7F4C, "station_dialogue" }, +// { 0x7F4D, "" }, +// { 0x7F4E, "" }, +// { 0x7F4F, "" }, +// { 0x7F50, "" }, + { 0x7F51, "west_ending" }, + { 0x7F52, "west_ending_dialogue" }, +// { 0x7F53, "" }, +// { 0x7F54, "" }, + { 0x7F55, "entity_cleanup" }, +// { 0x7F56, "" }, +// { 0x7F57, "" }, +// { 0x7F58, "" }, + { 0x7F59, "enemy_takedown_scene" }, +// { 0x7F5A, "" }, + { 0x7F5B, "default_sort" }, +// { 0x7F5C, "" }, +// { 0x7F5D, "" }, +// { 0x7F5E, "" }, +// { 0x7F5F, "" }, +// { 0x7F60, "" }, + { 0x7F61, "camera_fall" }, + { 0x7F62, "wife" }, +// { 0x7F63, "" }, +// { 0x7F64, "" }, +// { 0x7F65, "" }, + { 0x7F66, "camera_cut" }, + { 0x7F67, "wife_origin" }, +// { 0x7F68, "" }, +// { 0x7F69, "" }, +// { 0x7F6A, "" }, + { 0x7F6B, "create_cut_hud" }, +// { 0x7F6C, "" }, +// { 0x7F6D, "" }, +// { 0x7F6E, "" }, +// { 0x7F6F, "" }, +// { 0x7F70, "" }, +// { 0x7F71, "" }, +// { 0x7F72, "" }, +// { 0x7F73, "" }, +// { 0x7F74, "" }, +// { 0x7F75, "" }, +// { 0x7F76, "" }, +// { 0x7F77, "" }, +// { 0x7F78, "" }, + { 0x7F79, "splashscreen_off" }, +// { 0x7F7A, "" }, +// { 0x7F7B, "" }, +// { 0x7F7C, "" }, +// { 0x7F7D, "" }, + { 0x7F7E, "touch_ent" }, +// { 0x7F7F, "" }, +// { 0x7F80, "" }, +// { 0x7F81, "" }, +// { 0x7F82, "" }, +// { 0x7F83, "" }, +// { 0x7F84, "" }, +// { 0x7F85, "" }, +// { 0x7F86, "" }, +// { 0x7F87, "" }, +// { 0x7F88, "" }, +// { 0x7F89, "" }, +// { 0x7F8A, "" }, +// { 0x7F8B, "" }, + { 0x7F8C, "delete_pigeons" }, + { 0x7F8D, "couple_walking" }, +// { 0x7F8E, "" }, +// { 0x7F8F, "" }, +// { 0x7F90, "" }, +// { 0x7F91, "" }, +// { 0x7F92, "" }, + { 0x7F93, "westminster_fx" }, +// { 0x7F94, "" }, +// { 0x7F95, "" }, +// { 0x7F96, "" }, +// { 0x7F97, "" }, +// { 0x7F98, "" }, +// { 0x7F99, "" }, +// { 0x7F9A, "" }, +// { 0x7F9B, "" }, +// { 0x7F9C, "" }, +// { 0x7F9D, "" }, +// { 0x7F9E, "" }, +// { 0x7F9F, "" }, +// { 0x7FA0, "" }, +// { 0x7FA1, "" }, + { 0x7FA2, "cleanup_weestminster" }, +// { 0x7FA3, "" }, +// { 0x7FA4, "" }, +// { 0x7FA5, "" }, +// { 0x7FA6, "" }, +// { 0x7FA7, "" }, +// { 0x7FA8, "" }, +// { 0x7FA9, "" }, +// { 0x7FAA, "" }, +// { 0x7FAB, "" }, +// { 0x7FAC, "" }, +// { 0x7FAD, "" }, +// { 0x7FAE, "" }, +// { 0x7FAF, "" }, + { 0x7FB0, "array_thread_mod_delayed" }, +// { 0x7FB1, "" }, +// { 0x7FB2, "" }, +// { 0x7FB3, "" }, +// { 0x7FB4, "" }, +// { 0x7FB5, "" }, +// { 0x7FB6, "" }, +// { 0x7FB7, "" }, +// { 0x7FB8, "" }, + { 0x7FB9, "check_for_player_touching" }, +// { 0x7FBA, "" }, +// { 0x7FBB, "" }, +// { 0x7FBC, "" }, +// { 0x7FBD, "" }, +// { 0x7FBE, "" }, +// { 0x7FBF, "" }, +// { 0x7FC0, "" }, +// { 0x7FC1, "" }, +// { 0x7FC2, "" }, +// { 0x7FC3, "" }, + { 0x7FC4, "maps/paris_ac130_precache" }, +// { 0x7FC5, "" }, +// { 0x7FC6, "" }, +// { 0x7FC7, "" }, +// { 0x7FC8, "" }, + { 0x7FC9, "maps/mp/mp_radar_precache" }, +// { 0x7FCA, "" }, +// { 0x7FCB, "" }, +// { 0x7FCC, "" }, +// { 0x7FCD, "" }, + { 0x7FCE, "maps/mp/mp_bravo_fx" }, +// { 0x7FCF, "" }, +// { 0x7FD0, "" }, +// { 0x7FD1, "" }, +// { 0x7FD2, "" }, +// { 0x7FD3, "" }, +// { 0x7FD4, "" }, +// { 0x7FD5, "" }, +// { 0x7FD6, "" }, +// { 0x7FD7, "" }, +// { 0x7FD8, "" }, +// { 0x7FD9, "" }, +// { 0x7FDA, "" }, +// { 0x7FDB, "" }, + { 0x7FDC, "maps/mp/mp_lambeth_precache" }, +// { 0x7FDD, "" }, +// { 0x7FDE, "" }, +// { 0x7FDF, "" }, +// { 0x7FE0, "" }, +// { 0x7FE1, "" }, +// { 0x7FE2, "" }, +// { 0x7FE3, "" }, +// { 0x7FE4, "" }, +// { 0x7FE5, "" }, +// { 0x7FE6, "" }, +// { 0x7FE7, "" }, +// { 0x7FE8, "" }, +// { 0x7FE9, "" }, +// { 0x7FEA, "" }, +// { 0x7FEB, "" }, +// { 0x7FEC, "" }, +// { 0x7FED, "" }, +// { 0x7FEE, "" }, +// { 0x7FEF, "" }, +// { 0x7FF0, "" }, + { 0x7FF1, "maps/so_deltacamp_fx" }, + { 0x7FF2, "maps/so_deltacamp_precache" }, +// { 0x7FF3, "" }, +// { 0x7FF4, "" }, + { 0x7FF5, "maps/sp_paris_b_precache" }, +// { 0x7FF6, "" }, +// { 0x7FF7, "" }, +// { 0x7FF8, "" }, +// { 0x7FF9, "" }, +// { 0x7FFA, "" }, +// { 0x7FFB, "" }, +// { 0x7FFC, "" }, +// { 0x7FFD, "" }, +// { 0x7FFE, "" }, +// { 0x7FFF, "" }, +// { 0x8000, "" }, +// { 0x8001, "" }, +// { 0x8002, "" }, +// { 0x8003, "" }, +// { 0x8004, "" }, +// { 0x8005, "" }, +// { 0x8006, "" }, +// { 0x8007, "" }, +// { 0x8008, "" }, +// { 0x8009, "" }, +// { 0x800A, "" }, +// { 0x800B, "" }, +// { 0x800C, "" }, +// { 0x800D, "" }, +// { 0x800E, "" }, +// { 0x800F, "" }, + { 0x8010, "delete_on_trigger" }, +// { 0x8011, "" }, +// { 0x8012, "" }, +// { 0x8013, "" }, +// { 0x8014, "" }, +// { 0x8015, "" }, +// { 0x8016, "" }, +// { 0x8017, "" }, +// { 0x8018, "" }, +// { 0x8019, "" }, +// { 0x801A, "" }, +// { 0x801B, "" }, +// { 0x801C, "" }, +// { 0x801D, "" }, +// { 0x801E, "" }, +// { 0x801F, "" }, +// { 0x8020, "" }, + { 0x8021, "tire_squeaking" }, +// { 0x8022, "" }, +// { 0x8023, "" }, + { 0x8024, "maps/hamburg_precache" }, + { 0x8025, "maps/so_survival_mp_underground_precache" }, +// { 0x8026, "" }, +// { 0x8027, "" }, + { 0x8028, "disconnect_specops_paths" }, + { 0x8029, "lookat_player" }, +// { 0x802A, "" }, +// { 0x802B, "" }, +// { 0x802C, "" }, +// { 0x802D, "" }, +// { 0x802E, "" }, +// { 0x802F, "" }, +// { 0x8030, "" }, +// { 0x8031, "" }, +// { 0x8032, "" }, +// { 0x8033, "" }, +// { 0x8034, "" }, +// { 0x8035, "" }, +// { 0x8036, "" }, +// { 0x8037, "" }, +// { 0x8038, "" }, +// { 0x8039, "" }, +// { 0x803A, "" }, +// { 0x803B, "" }, +// { 0x803C, "" }, +// { 0x803D, "" }, +// { 0x803E, "" }, +// { 0x803F, "" }, +// { 0x8040, "" }, +// { 0x8041, "" }, +// { 0x8042, "" }, +// { 0x8043, "" }, +// { 0x8044, "" }, +// { 0x8045, "" }, +// { 0x8046, "" }, +// { 0x8047, "" }, +// { 0x8048, "" }, +// { 0x8049, "" }, +// { 0x804A, "" }, +// { 0x804B, "" }, +// { 0x804C, "" }, +// { 0x804D, "" }, + { 0x804E, "new_cave_door_collision" }, +// { 0x804F, "" }, +// { 0x8050, "" }, +// { 0x8051, "" }, +// { 0x8052, "" }, +// { 0x8053, "" }, +// { 0x8054, "" }, +// { 0x8055, "" }, +// { 0x8056, "" }, +// { 0x8057, "" }, +// { 0x8058, "" }, +// { 0x8059, "" }, +// { 0x805A, "" }, +// { 0x805B, "" }, +// { 0x805C, "" }, +// { 0x805D, "" }, +// { 0x805E, "" }, +// { 0x805F, "" }, +// { 0x8060, "" }, +// { 0x8061, "" }, +// { 0x8062, "" }, +// { 0x8063, "" }, +// { 0x8064, "" }, +// { 0x8065, "" }, +// { 0x8066, "" }, +// { 0x8067, "" }, +// { 0x8068, "" }, +// { 0x8069, "" }, +// { 0x806A, "" }, +// { 0x806B, "" }, +// { 0x806C, "" }, +// { 0x806D, "" }, +// { 0x806E, "" }, + { 0x806F, "character/mp_character_delta_woodland_shotgun" }, +// { 0x8070, "" }, +// { 0x8071, "" }, + { 0x8072, "character/mp_character_delta_woodland_smg_c" }, +// { 0x8073, "" }, +// { 0x8074, "" }, + { 0x8075, "maps/so_survival_mp_hardhat_precache" }, + { 0x8076, "setup_road_patrollers" }, +// { 0x8077, "" }, +// { 0x8078, "" }, +// { 0x8079, "" }, +// { 0x807A, "" }, +// { 0x807B, "" }, +// { 0x807C, "" }, +// { 0x807D, "" }, +// { 0x807E, "" }, +// { 0x807F, "" }, +// { 0x8080, "" }, +// { 0x8081, "" }, +// { 0x8082, "" }, +// { 0x8083, "" }, +// { 0x8084, "" }, +// { 0x8085, "" }, +// { 0x8086, "" }, +// { 0x8087, "" }, + { 0x8088, "henchman3_vo" }, +// { 0x8089, "" }, +// { 0x808A, "" }, +// { 0x808B, "" }, +// { 0x808C, "" }, +// { 0x808D, "" }, +// { 0x808E, "" }, +// { 0x808F, "" }, +// { 0x8090, "" }, +// { 0x8091, "" }, +// { 0x8092, "" }, +// { 0x8093, "" }, +// { 0x8094, "" }, +// { 0x8095, "" }, +// { 0x8096, "" }, +// { 0x8097, "" }, +// { 0x8098, "" }, +// { 0x8099, "" }, + { 0x809A, "check_for_sniper" }, +// { 0x809B, "" }, + { 0x809C, "monitor_death" }, + { 0x809D, "sniper_granite_death_scene_nag" }, +// { 0x809E, "" }, +// { 0x809F, "" }, +// { 0x80A0, "" }, +// { 0x80A1, "" }, +// { 0x80A2, "" }, +// { 0x80A3, "" }, +// { 0x80A4, "" }, +// { 0x80A5, "" }, +// { 0x80A6, "" }, +// { 0x80A7, "" }, +// { 0x80A8, "" }, + { 0x80A9, "bridge_player_stays_back_nag" }, +// { 0x80AA, "" }, +// { 0x80AB, "" }, +// { 0x80AC, "" }, +// { 0x80AD, "" }, + { 0x80AE, "last_stand_get_to_roof_nag" }, +// { 0x80AF, "" }, +// { 0x80B0, "" }, +// { 0x80B1, "" }, +// { 0x80B2, "" }, +// { 0x80B3, "" }, +// { 0x80B4, "" }, +// { 0x80B5, "" }, +// { 0x80B6, "" }, +// { 0x80B7, "" }, +// { 0x80B8, "" }, +// { 0x80B9, "" }, +// { 0x80BA, "" }, +// { 0x80BB, "" }, +// { 0x80BC, "" }, +// { 0x80BD, "" }, +// { 0x80BE, "" }, +// { 0x80BF, "" }, + { 0x80C0, "finale_should_break_hit_melee_yank" }, +// { 0x80C1, "" }, +// { 0x80C2, "" }, +// { 0x80C3, "" }, +// { 0x80C4, "" }, + { 0x80C5, "hideworldiconongameend" }, +// { 0x80C6, "" }, +// { 0x80C7, "" }, +// { 0x80C8, "" }, +// { 0x80C9, "" }, +// { 0x80CA, "" }, +// { 0x80CB, "" }, + { 0x80CC, "maps/so_survival_mp_paris_precache" }, +// { 0x80CD, "" }, +// { 0x80CE, "" }, +// { 0x80CF, "" }, +// { 0x80D0, "" }, +// { 0x80D1, "" }, + { 0x80D2, "bookstore_heavy_fire_dialogue_1" }, +// { 0x80D3, "" }, +// { 0x80D4, "" }, +// { 0x80D5, "" }, +// { 0x80D6, "" }, +// { 0x80D7, "" }, +// { 0x80D8, "" }, +// { 0x80D9, "" }, +// { 0x80DA, "" }, +// { 0x80DB, "" }, +// { 0x80DC, "" }, +// { 0x80DD, "" }, +// { 0x80DE, "" }, +// { 0x80DF, "" }, +// { 0x80E0, "" }, +// { 0x80E1, "" }, +// { 0x80E2, "" }, +// { 0x80E3, "" }, +// { 0x80E4, "" }, +// { 0x80E5, "" }, +// { 0x80E6, "" }, +// { 0x80E7, "" }, +// { 0x80E8, "" }, + { 0x80E9, "achievement_completed" }, +// { 0x80EA, "" }, +// { 0x80EB, "" }, +// { 0x80EC, "" }, +// { 0x80ED, "" }, +// { 0x80EE, "" }, +// { 0x80EF, "" }, +// { 0x80F0, "" }, + { 0x80F1, "ispainted" }, +// { 0x80F2, "" }, +// { 0x80F3, "" }, +// { 0x80F4, "" }, + { 0x80F5, "emptimeremaining" }, +// { 0x80F6, "" }, +// { 0x80F7, "" }, +// { 0x80F8, "" }, +// { 0x80F9, "" }, +// { 0x80FA, "" }, +// { 0x80FB, "" }, +// { 0x80FC, "" }, +// { 0x80FD, "" }, + { 0x80FE, "hintpickup" }, + { 0x80FF, "pickup_message_deleted" }, + { 0x8100, "getcustomclassloc" }, +// { 0x8101, "" }, +// { 0x8102, "" }, +// { 0x8103, "" }, +// { 0x8104, "" }, +// { 0x8105, "" }, +// { 0x8106, "" }, +// { 0x8107, "" }, +// { 0x8108, "" }, +// { 0x8109, "" }, +// { 0x810A, "" }, +// { 0x810B, "" }, +// { 0x810C, "" }, +// { 0x810D, "" }, +// { 0x810E, "" }, +// { 0x810F, "" }, +// { 0x8110, "" }, +// { 0x8111, "" }, +// { 0x8112, "" }, +// { 0x8113, "" }, +// { 0x8114, "" }, +// { 0x8115, "" }, +// { 0x8116, "" }, +// { 0x8117, "" }, +// { 0x8118, "" }, +// { 0x8119, "" }, +// { 0x811A, "" }, +// { 0x811B, "" }, +// { 0x811C, "" }, +// { 0x811D, "" }, + { 0x811E, "small_bay_door_safety_clip" }, +// { 0x811F, "" }, + { 0x8120, "cleanup_rope" }, + { 0x8121, "truck_hold_door_new" }, +// { 0x8122, "" }, +// { 0x8123, "" }, +// { 0x8124, "" }, +// { 0x8125, "" }, +// { 0x8126, "" }, +// { 0x8127, "" }, +// { 0x8128, "" }, +// { 0x8129, "" }, + { 0x812A, "rappel_anims" }, +// { 0x812B, "" }, +// { 0x812C, "" }, +// { 0x812D, "" }, +// { 0x812E, "" }, +// { 0x812F, "" }, + { 0x8130, "addonstart_animsound_chopsaw_foley" }, +// { 0x8131, "" }, +// { 0x8132, "" }, +// { 0x8133, "" }, +// { 0x8134, "" }, +// { 0x8135, "" }, +// { 0x8136, "" }, + { 0x8137, "ruins_spotted" }, +// { 0x8138, "" }, +// { 0x8139, "" }, +// { 0x813A, "" }, +// { 0x813B, "" }, +// { 0x813C, "" }, +// { 0x813D, "" }, +// { 0x813E, "" }, +// { 0x813F, "" }, +// { 0x8140, "" }, + { 0x8141, "prisoner_count_kill_max" }, +// { 0x8142, "" }, +// { 0x8143, "" }, +// { 0x8144, "" }, +// { 0x8145, "" }, + { 0x8146, "guard_max_wait" }, + { 0x8147, "guard_ambient_vo" }, +// { 0x8148, "" }, +// { 0x8149, "" }, +// { 0x814A, "" }, +// { 0x814B, "" }, +// { 0x814C, "" }, +// { 0x814D, "" }, +// { 0x814E, "" }, +// { 0x814F, "" }, +// { 0x8150, "" }, +// { 0x8151, "" }, +// { 0x8152, "" }, +// { 0x8153, "" }, +// { 0x8154, "" }, +// { 0x8155, "" }, +// { 0x8156, "" }, +// { 0x8157, "" }, +// { 0x8158, "" }, + { 0x8159, "setupdialogoverrides" }, +// { 0x815A, "" }, +// { 0x815B, "" }, +// { 0x815C, "" }, +// { 0x815D, "" }, + { 0x815E, "dialogfailedgeneric" }, +// { 0x815F, "" }, +// { 0x8160, "" }, +// { 0x8161, "" }, +// { 0x8162, "" }, +// { 0x8163, "" }, +// { 0x8164, "" }, + { 0x8165, "cleanupenemiesonfinalbreach" }, +// { 0x8166, "" }, +// { 0x8167, "" }, +// { 0x8168, "" }, +// { 0x8169, "" }, +// { 0x816A, "" }, +// { 0x816B, "" }, +// { 0x816C, "" }, + { 0x816D, "change_anim_interrupt_state" }, +// { 0x816E, "" }, +// { 0x816F, "" }, +// { 0x8170, "" }, + { 0x8171, "river_prone_patrol" }, +// { 0x8172, "" }, +// { 0x8173, "" }, +// { 0x8174, "" }, + { 0x8175, "river_technical_stealth_broken_vo" }, +// { 0x8176, "" }, + { 0x8177, "church_nag_lines" }, +// { 0x8178, "" }, +// { 0x8179, "" }, +// { 0x817A, "" }, +// { 0x817B, "" }, +// { 0x817C, "" }, +// { 0x817D, "" }, +// { 0x817E, "" }, +// { 0x817F, "" }, +// { 0x8180, "" }, + { 0x8181, "green1_dialogue_queue" }, +// { 0x8182, "" }, +// { 0x8183, "" }, +// { 0x8184, "" }, +// { 0x8185, "" }, +// { 0x8186, "" }, +// { 0x8187, "" }, +// { 0x8188, "" }, +// { 0x8189, "" }, +// { 0x818A, "" }, +// { 0x818B, "" }, +// { 0x818C, "" }, +// { 0x818D, "" }, +// { 0x818E, "" }, +// { 0x818F, "" }, +// { 0x8190, "" }, +// { 0x8191, "" }, +// { 0x8192, "" }, +// { 0x8193, "" }, +// { 0x8194, "" }, +// { 0x8195, "" }, +// { 0x8196, "" }, +// { 0x8197, "" }, +// { 0x8198, "" }, + { 0x8199, "dumb_sprinter" }, +// { 0x819A, "" }, +// { 0x819B, "" }, +// { 0x819C, "" }, +// { 0x819D, "" }, +// { 0x819E, "" }, +// { 0x819F, "" }, +// { 0x81A0, "" }, +// { 0x81A1, "" }, +// { 0x81A2, "" }, +// { 0x81A3, "" }, +// { 0x81A4, "" }, +// { 0x81A5, "" }, +// { 0x81A6, "" }, +// { 0x81A7, "" }, +// { 0x81A8, "" }, +// { 0x81A9, "" }, +// { 0x81AA, "" }, + { 0x81AB, "defend_force_ai_to_reload" }, +// { 0x81AC, "" }, + { 0x81AD, "nuke_unhide_phone" }, + { 0x81AE, "nuke_background_explosions" }, +// { 0x81AF, "" }, +// { 0x81B0, "" }, +// { 0x81B1, "" }, +// { 0x81B2, "" }, +// { 0x81B3, "" }, +// { 0x81B4, "" }, + { 0x81B5, "survival_dialog_radio_sentry_underattack" }, +// { 0x81B6, "" }, +// { 0x81B7, "" }, +// { 0x81B8, "" }, +// { 0x81B9, "" }, +// { 0x81BA, "" }, +// { 0x81BB, "" }, +// { 0x81BC, "" }, +// { 0x81BD, "" }, +// { 0x81BE, "" }, +// { 0x81BF, "" }, +// { 0x81C0, "" }, +// { 0x81C1, "" }, + { 0x81C2, "remove_chopper_hints" }, +// { 0x81C3, "" }, +// { 0x81C4, "" }, +// { 0x81C5, "" }, +// { 0x81C6, "" }, +// { 0x81C7, "" }, +// { 0x81C8, "" }, +// { 0x81C9, "" }, +// { 0x81CA, "" }, +// { 0x81CB, "" }, +// { 0x81CC, "" }, +// { 0x81CD, "" }, +// { 0x81CE, "" }, +// { 0x81CF, "" }, +// { 0x81D0, "" }, +// { 0x81D1, "" }, + { 0x81D2, "warehouse_tv_thread" }, +// { 0x81D3, "" }, +// { 0x81D4, "" }, +// { 0x81D5, "" }, +// { 0x81D6, "" }, +// { 0x81D7, "" }, +// { 0x81D8, "" }, +// { 0x81D9, "" }, +// { 0x81DA, "" }, +// { 0x81DB, "" }, +// { 0x81DC, "" }, +// { 0x81DD, "" }, +// { 0x81DE, "" }, +// { 0x81DF, "" }, +// { 0x81E0, "" }, +// { 0x81E1, "" }, +// { 0x81E2, "" }, +// { 0x81E3, "" }, +// { 0x81E4, "" }, + { 0x81E5, "heartbeat_rumble_off" }, +// { 0x81E6, "" }, +// { 0x81E7, "" }, +// { 0x81E8, "" }, +// { 0x81E9, "" }, +// { 0x81EA, "" }, +// { 0x81EB, "" }, + { 0x81EC, "enemy_hind_monitor_death" }, +// { 0x81ED, "" }, + { 0x81EE, "construction_crash_trigger_monitor" }, +// { 0x81EF, "" }, +// { 0x81F0, "" }, +// { 0x81F1, "" }, + { 0x81F2, "gaz_switch_mode" }, +// { 0x81F3, "" }, +// { 0x81F4, "" }, +// { 0x81F5, "" }, +// { 0x81F6, "" }, +// { 0x81F7, "" }, + { 0x81F8, "prone_on_goal" }, +// { 0x81F9, "" }, +// { 0x81FA, "" }, +// { 0x81FB, "" }, +// { 0x81FC, "" }, +// { 0x81FD, "" }, +// { 0x81FE, "" }, +// { 0x81FF, "" }, + { 0x8200, "target_hide" }, +// { 0x8201, "" }, +// { 0x8202, "" }, +// { 0x8203, "" }, + { 0x8204, "prep_wait_for_forward" }, +// { 0x8205, "" }, +// { 0x8206, "" }, +// { 0x8207, "" }, +// { 0x8208, "" }, +// { 0x8209, "" }, +// { 0x820A, "" }, + { 0x820B, "gasmask_hud_elem1" }, +// { 0x820C, "" }, +// { 0x820D, "" }, +// { 0x820E, "" }, +// { 0x820F, "" }, +// { 0x8210, "" }, +// { 0x8211, "" }, +// { 0x8212, "" }, +// { 0x8213, "" }, +// { 0x8214, "" }, +// { 0x8215, "" }, +// { 0x8216, "" }, +// { 0x8217, "" }, +// { 0x8218, "" }, +// { 0x8219, "" }, +// { 0x821A, "" }, +// { 0x821B, "" }, +// { 0x821C, "" }, +// { 0x821D, "" }, +// { 0x821E, "" }, +// { 0x821F, "" }, +// { 0x8220, "" }, +// { 0x8221, "" }, +// { 0x8222, "" }, +// { 0x8223, "" }, +// { 0x8224, "" }, +// { 0x8225, "" }, + { 0x8226, "outside_reveal_chatter" }, +// { 0x8227, "" }, +// { 0x8228, "" }, +// { 0x8229, "" }, +// { 0x822A, "" }, +// { 0x822B, "" }, +// { 0x822C, "" }, +// { 0x822D, "" }, +// { 0x822E, "" }, +// { 0x822F, "" }, +// { 0x8230, "" }, +// { 0x8231, "" }, +// { 0x8232, "" }, +// { 0x8233, "" }, +// { 0x8234, "" }, +// { 0x8235, "" }, +// { 0x8236, "" }, +// { 0x8237, "" }, +// { 0x8238, "" }, +// { 0x8239, "" }, +// { 0x823A, "" }, +// { 0x823B, "" }, +// { 0x823C, "" }, + { 0x823D, "formats" }, +// { 0x823E, "" }, +// { 0x823F, "" }, +// { 0x8240, "" }, +// { 0x8241, "" }, +// { 0x8242, "" }, + { 0x8243, "bombsquadmodel" }, +// { 0x8244, "" }, + { 0x8245, "aud_price_gun_sweetener" }, +// { 0x8246, "" }, +// { 0x8247, "" }, +// { 0x8248, "" }, +// { 0x8249, "" }, +// { 0x824A, "" }, + { 0x824B, "uaz_on_death_set_flags" }, +// { 0x824C, "" }, +// { 0x824D, "" }, + { 0x824E, "gaz_turret_disable" }, +// { 0x824F, "" }, +// { 0x8250, "" }, +}}; + +} // namespace xsk::gsc::iw5_xb diff --git a/src/iw5/stdafx.cpp b/src/iw5/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/iw5/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/iw5/stdafx.hpp b/src/iw5/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/iw5/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/iw5/xsk/assembler.cpp b/src/iw5/xsk/assembler.cpp deleted file mode 100644 index 926bf9e9..00000000 --- a/src/iw5/xsk/assembler.cpp +++ /dev/null @@ -1,553 +0,0 @@ -// 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 "iw5.hpp" - -namespace xsk::gsc::iw5 -{ - -auto assembler::output_script() -> std::vector -{ - std::vector script; - - if (script_ == nullptr) return script; - - script.resize(script_->pos()); - std::memcpy(script.data(), script_->buffer().data(), script.size()); - - return script; -} - -auto assembler::output_stack() -> std::vector -{ - std::vector stack; - - if (stack_ == nullptr) return stack; - - stack.resize(stack_->pos()); - std::memcpy(stack.data(), stack_->buffer().data(), stack.size()); - - return stack; -} - -void assembler::assemble(const std::string& file, std::vector& data) -{ - std::vector assembly = utils::string::clean_buffer_lines(data); - std::vector functions; - function::ptr func = nullptr; - std::uint32_t index = 1; - std::uint16_t switchnum = 0; - - for (auto& line : assembly) - { - if (line == "" || line.substr(0, 2) == "//") - { - continue; - } - else if (line.substr(0, 4) == "sub_") - { - func = std::make_unique(); - func->index = index; - func->name = line.substr(4); - } - else if (line.substr(0, 4) == "end_") - { - if (func != nullptr) - { - func->size = index - func->index; - functions.push_back(std::move(func)); - } - } - else if (line.substr(0, 4) == "loc_") - { - func->labels[index] = line; - } - else - { - auto opdata = utils::string::parse_code(line); - - if (switchnum) - { - if (opdata[0] == "case" || opdata[0] == "default") - { - for (auto& entry : opdata) - { - func->instructions.back()->data.push_back(entry); - } - switchnum--; - continue; - } - - throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); - } - else - { - auto inst = std::make_unique(); - inst->index = index; - inst->opcode = resolver::opcode_id(opdata[0]); - inst->size = opcode_size(inst->opcode); - opdata.erase(opdata.begin()); - inst->data = std::move(opdata); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = inst->data[0].substr(4); - break; - case opcode::OP_endswitch: - switchnum = static_cast(std::stoi(inst->data[0])); - inst->size += 7 * switchnum; - break; - default: - break; - } - - index += inst->size; - func->instructions.push_back(std::move(inst)); - } - } - } - - assemble(file, functions); -} - -void assembler::assemble(const std::string& file, std::vector& funcs) -{ - script_ = std::make_unique(0x100000); - stack_ = std::make_unique(0x100000); - filename_ = file; - functions_ = std::move(funcs); - - script_->write(static_cast(opcode::OP_End)); - - for (const auto& func : functions_) - { - assemble_function(func); - } -} - -void assembler::assemble_function(const function::ptr& func) -{ - labels_ = func->labels; - - func->id = resolver::token_id(func->name); - - stack_->write(func->size); - stack_->write(static_cast(func->id)); - - if (func->id == 0) - { - stack_->write_c_string(func->name); - } - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - case opcode::OP_Return: - case opcode::OP_GetUndefined: - case opcode::OP_GetZero: - case opcode::OP_waittillFrameEnd: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_EvalArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_ClearArray: - case opcode::OP_EmptyArray: - case opcode::OP_AddArray: - case opcode::OP_PreScriptCall: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_GetLevelObject: - case opcode::OP_GetAnimObject: - case opcode::OP_GetSelf: - case opcode::OP_GetThisthread: - case opcode::OP_GetLevel: - case opcode::OP_GetGame: - case opcode::OP_GetAnim: - case opcode::OP_GetGameRef: - case opcode::OP_inc: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_bit_ex_or: - case opcode::OP_bit_and: - case opcode::OP_equality: - case opcode::OP_inequality: - case opcode::OP_less: - case opcode::OP_greater: - case opcode::OP_less_equal: - case opcode::OP_waittillmatch2: - case opcode::OP_waittill: - case opcode::OP_notify: - case opcode::OP_endon: - case opcode::OP_voidCodepos: - case opcode::OP_vector: - case opcode::OP_greater_equal: - case opcode::OP_shift_left: - case opcode::OP_shift_right: - case opcode::OP_plus: - case opcode::OP_minus: - case opcode::OP_multiply: - case opcode::OP_divide: - case opcode::OP_mod: - case opcode::OP_size: - case opcode::OP_GetSelfObject: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_clearparams: - case opcode::OP_checkclearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_SetVariableField: - case opcode::OP_ClearVariableField: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_wait: - case opcode::OP_DecTop: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_BoolNot: - case opcode::OP_BoolComplement: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->write(std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->write(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - 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(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_GetAnimation: - script_->write(0); - stack_->write_c_string(inst->data[0]); - stack_->write_c_string(inst->data[1]); - break; - case opcode::OP_GetAnimTree: - script_->write(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_waittillmatch: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_CreateLocalVariable: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_EvalLocalVariableObjectCached: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - assemble_field_variable(inst); - break; - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_GetLocalFunction: - assemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - case opcode::OP_GetFarFunction: - assemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - assemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - assemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - assemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - assemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - assemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - assemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - assemble_jump(inst, false, true); - break; - case opcode::OP_jump: - assemble_jump(inst, false, false); - break; - case opcode::OP_switch: - assemble_switch(inst); - break; - case opcode::OP_endswitch: - assemble_end_switch(inst); - break; - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } - - const auto id = method ? resolver::method_id(inst->data[0]) : resolver::function_id(inst->data[0]); - - script_->write(id); -} - -void assembler::assemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto addr = resolve_function(inst->data[0]); - const auto offset = static_cast(addr - inst->index - 1); - - assemble_offset(offset); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } -} - -void assembler::assemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->write(0); - script_->write(0); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[2]))); - } - - const auto file_id = resolver::token_id(inst->data[0]); - const auto func_id = resolver::token_id(inst->data[1]); - - stack_->write(file_id); - if (file_id == 0) stack_->write_c_string(inst->data[0]); - stack_->write(func_id); - if (func_id == 0) stack_->write_c_string(inst->data[1]); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const auto addr = resolve_label(inst->data[0]); - - script_->write(addr - inst->index - 4); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - - script_->write(static_cast(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); - stack_->write_c_string(inst->data[1 + (3 * i) + 1]); - } - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 2]); - - assemble_offset(addr - index); - - index += 3; - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write(0); - stack_->write_c_string("\x01"); - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 1]); - - assemble_offset(addr - index); - - index += 3; - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::assemble_field_variable(const instruction::ptr& inst) -{ - auto id = resolver::token_id(inst->data[0]); - - if (id == 0) id = 0xFFFF; - - script_->write(id); - - if (id > max_string_id) - { - stack_->write(0); - stack_->write_c_string(inst->data[0]); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - const auto addr = resolve_label(inst->data[0]); - - if (expr) - { - script_->write(static_cast(addr - inst->index - 3)); - } - else if (back) - { - script_->write(static_cast((inst->index + 3) - addr)); - } - else - { - script_->write(static_cast(addr - inst->index - 5)); - } -} - -void assembler::assemble_offset(std::int32_t offset) -{ - std::array bytes = {}; - - offset = (offset << 10) >> 8; - - *reinterpret_cast(bytes.data()) = offset; - - script_->write(bytes[0]); - script_->write(bytes[1]); - script_->write(bytes[2]); -} - -auto assembler::resolve_function(const std::string& name) -> std::int32_t -{ - for (const auto& entry : functions_) - { - if (entry->name == name) - { - return entry->index; - } - } - - throw asm_error("couldn't resolve local function address of '" + name + "'!"); -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/assembler.hpp b/src/iw5/xsk/assembler.hpp deleted file mode 100644 index e0489d6f..00000000 --- a/src/iw5/xsk/assembler.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::iw5 -{ - -class assembler : public gsc::assembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output_script() -> std::vector; - auto output_stack() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, std::vector& funcs); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void assemble_local_call(const instruction::ptr& inst, bool thread); - void assemble_far_call(const instruction::ptr& inst, bool thread); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void assemble_field_variable(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst, bool expr, bool back); - void assemble_offset(std::int32_t offset); - auto resolve_function(const std::string& name) -> std::int32_t; - auto resolve_label(const std::string& name) -> std::int32_t; -}; - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/compiler.cpp b/src/iw5/xsk/compiler.cpp deleted file mode 100644 index 958863d7..00000000 --- a/src/iw5/xsk/compiler.cpp +++ /dev/null @@ -1,3544 +0,0 @@ -// 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 "iw5.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -namespace xsk::gsc::iw5 -{ - -auto compiler::output() -> std::vector -{ - return std::move(assembly_); -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "an unknown error ocurred while parsing gsc file"); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_.clear(); - includes_.clear(); - animtrees_.clear(); - constants_.clear(); - local_functions_.clear(); - index_ = 1; - 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& inc : includes_) - { - if (inc.name == path) - { - throw comp_error(include->loc(), "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(), "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 developer block comment"); - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) -{ - const auto itr = constants_.find(constant->name->value); - - if (itr != constants_.end()) - throw comp_error(constant->loc(), "duplicated constant '" + constant->name->value + "'"); - - 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; - - auto blk = std::make_unique(); - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - break_blks_.clear(); - continue_blks_.clear(); - - process_thread(thread, blk); - - emit_expr_parameters(thread->params, blk); - emit_stmt_list(thread->stmt, blk, true); - emit_opcode(opcode::OP_End); - - function_->size = index_ - function_->index; - assembly_.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list, blk, last); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev, blk, last); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend, blk); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if, blk, last); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse, blk, last); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case, blk); - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default, blk); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return, blk); - break; - case ast::kind::stmt_breakpoint: - emit_stmt_breakpoint(stmt.as_breakpoint, blk); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin, blk); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end, blk); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last) -{ - for (const auto& entry : stmt->list) - { - bool last_ = (&entry == &stmt->list.back() && last) ? true : false; - emit_stmt(entry, blk, last_); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last) -{ - emit_stmt_list(stmt->list, blk, last); -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - 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, const block::ptr& blk) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, blk, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, blk, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_endon); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } - - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->time, blk); - emit_opcode(opcode::OP_wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittill); - - for (const auto& entry : stmt->args->list) - { - variable_create(entry.as_identifier, blk); - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(entry.as_identifier, blk)); - } - - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - emit_expr_arguments(stmt->args, blk); - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_waittillmatch2); - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waittillFrameEnd); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - blk->transfer(stmt->blk); - - emit_stmt(stmt->stmt, stmt->blk, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last) -{ - std::vector childs; - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - blk->transfer(stmt->blk_if); - - emit_stmt(stmt->stmt_if, stmt->blk_if, last); - - emit_remove_local_vars(stmt->blk_if); - - if (stmt->blk_if->abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - - last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - - blk->transfer(stmt->blk_else); - - emit_stmt(stmt->stmt_else, stmt->blk_else, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk_else); - - if (stmt->blk_else->abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - - insert_label(end_loc); - - blk->init_from_child(childs); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_stmt(stmt->init, blk, false); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->blk_iter); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - can_break_ = true; - can_continue_ = true; - - emit_stmt(stmt->stmt, stmt->blk, false); - - if (stmt->blk->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->blk.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->blk_iter->init_from_child(continue_blks_); - - emit_stmt(stmt->iter, stmt->blk_iter, false); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_expr(stmt->array_expr, blk); - emit_expr_variable_ref(stmt->array, blk, true); - emit_expr_variable(stmt->array, blk); - emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); - emit_expr_variable_ref(stmt->key_expr, blk, true); - - blk->transfer(stmt->ctx); - stmt->ctx->loc_break = break_loc; - stmt->ctx->loc_continue = continue_loc; - - emit_create_local_vars(stmt->ctx); - - blk->local_vars_create_count = stmt->ctx->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->ctx_post); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr, blk); - emit_opcode(opcode::OP_CallBuiltin1, "isdefined"); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr, stmt->ctx); - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->array.as_identifier, stmt->ctx)); - emit_expr_variable_ref(stmt->value_expr, stmt->ctx, true); - emit_stmt(stmt->stmt, stmt->ctx, false); - - if (stmt->ctx->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->ctx.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->ctx_post->init_from_child(continue_blks_); - - emit_expr_variable(stmt->key_expr, stmt->ctx_post); - emit_expr_variable(stmt->array, stmt->ctx_post); - emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); - emit_expr_variable_ref(stmt->key_expr, stmt->ctx_post, true); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - emit_expr_clear_local(stmt->array.as_identifier, blk); - if (!stmt->use_key) emit_expr_clear_local(stmt->key_expr.as_identifier, blk); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_break = can_break_; - break_blks_.clear(); - can_break_ = false; - - auto jmptable_loc = create_label(); - auto break_loc = create_label(); - - emit_expr(stmt->test, blk); - 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; - block* default_ctx = nullptr; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - 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"); - } - - blk->transfer(case_->blk); - case_->blk->loc_break = break_loc; - emit_stmt_list(case_->stmt, case_->blk, false); - if (case_->stmt->list.size() > 0) - emit_remove_local_vars(case_->blk); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - - has_default = true; - default_ctx = entry.as_default->blk.get(); - - blk->transfer(entry.as_default->blk); - entry.as_default->blk->loc_break = break_loc; - emit_stmt_list(entry.as_default->stmt, entry.as_default->blk, false); - if (entry.as_default->stmt->list.size() > 0) - emit_remove_local_vars(entry.as_default->blk); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - } - blk->init_from_child(break_blks_); - } - - insert_label(jmptable_loc); - - emit_opcode(opcode::OP_endswitch, data); - - auto offset = static_cast(7 * stmt->stmt->list.size()); - function_->instructions.back()->size += offset; - index_ += offset; - - insert_label(break_loc); - - can_break_ = old_break; - break_blks_ = old_breaks; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) -{ - if (!can_break_ || blk->abort != abort_t::abort_none || blk->loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - break_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_break; - emit_opcode(opcode::OP_jump, blk->loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) -{ - if (!can_continue_ || blk->abort != abort_t::abort_none || blk->loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - continue_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_continue; - emit_opcode(opcode::OP_jump, blk->loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - blk->abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr, blk); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child, blk); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate, blk); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference, blk); - break; - case ast::kind::expr_add_array: - emit_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_thisthread: - emit_opcode(opcode::OP_GetThisthread); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - 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, blk); - 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, const block::ptr& blk) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue, blk); - } - else if (expr->lvalue == ast::kind::expr_tuple) - { - emit_expr(expr->rvalue, blk); - emit_expr_tuple(expr->lvalue.as_tuple, blk); - } - else - { - emit_expr(expr->rvalue, blk); - emit_expr_variable_ref(expr->lvalue, blk, true); - } - - return; - } - - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - 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_mod); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_ex_or); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, blk, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key, blk); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, blk, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj, blk); - 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, blk, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk) -{ - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); - else - emit_opcode(opcode::OP_ClearLocalVariableFieldCached, variable_access_index(expr, blk)); -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_inc); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_dec); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr, blk); - emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr, blk); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_equality); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_inequality); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_less); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_greater); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_less_equal); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_greater_equal); - 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_ex_or); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_mod); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt && mode_ == gsc::build::prod) - { - const auto& name = expr->name->value; - if (name == "assert" || name == "assertex" || name == "assertmsg") return; - } - - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal && expr->args->list.size() > 0) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptLocalFunctionCall, expr->name->value); - else - emit_opcode(opcode::OP_ScriptLocalFunctionCall2, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptFarFunctionCall, { expr->path->value, expr->name->value }); - else - emit_opcode(opcode::OP_ScriptFarFunctionCall2, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltin0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltin1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltin2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltin3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltin4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltin5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltin, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptLocalMethodCall, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFarMethodCall, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltinMethod0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltinMethod1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltinMethod2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltinMethod3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltinMethod4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltinMethod5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltinMethod, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_EmptyArray); - - for (const auto& arg : expr->args->list) - { - emit_expr(arg, blk); - emit_opcode(opcode::OP_AddArray); - } -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) -{ - for (const auto& entry : expr->list) - { - variable_initialize(entry, blk); - emit_opcode(opcode::OP_SafeCreateVariableFieldCached, variable_create_index(entry, blk)); - } - - emit_opcode(opcode::OP_checkclearparams); -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry, blk); - } -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) -{ - bool method = false; - auto type = resolve_reference_type(expr, method); - - switch (type) - { - case ast::call::type::local: - emit_opcode(opcode::OP_GetLocalFunction, expr->name->value); - break; - case ast::call::type::far: - emit_opcode(opcode::OP_GetFarFunction, { expr->path->value, expr->name->value }); - break; - case ast::call::type::builtin: - if (method) - emit_opcode(opcode::OP_GetBuiltinMethod, expr->name->value); - else - emit_opcode(opcode::OP_GetBuiltinFunction, expr->name->value); - break; - } -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_size); -} - -void compiler::emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - emit_expr_variable_ref(expr->temp, blk, true); - - auto index = 0; - - for (const auto& entry : expr->list) - { - if (index == 0) - emit_opcode(opcode::OP_GetZero); - else - emit_opcode(opcode::OP_GetByte, utils::string::va("%d", index)); - - index++; - - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->temp.as_identifier, blk)); - - emit_expr_variable_ref(entry, blk, true); - } - - emit_expr_clear_local(expr->temp.as_identifier, blk); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, blk, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, blk, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, blk, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set) -{ - emit_expr(expr->key, blk); - - 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, blk, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - { - if (!variable_initialized(expr->obj.as_identifier, blk)) - { - variable_initialize(expr->obj.as_identifier, blk); - emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(expr->obj.as_identifier, blk)); - - if (!set) throw comp_error(expr->loc(), "INTERNAL: VAR CREATED BUT NOT SET!"); - } - else if (variable_stack_index(expr->obj.as_identifier, blk) == 0) - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached0); - } - else - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access_index(expr->obj.as_identifier, blk)); - } - - 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, const block::ptr& blk, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); - break; - case ast::kind::expr_anim: - set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); - break; - case ast::kind::expr_self: - set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - 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, blk); - 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_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, 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 + "'"); - } - - if (set) - { - if (!variable_initialized(expr, blk)) - { - variable_initialize(expr, blk); - emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(expr, blk)); - } - else if (variable_stack_index(expr, blk) == 0) - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached0); - } - else - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached, variable_access_index(expr, blk)); - } - } - else - { - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_EvalLocalVariableRefCached0); - else - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access_index(expr, blk)); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->key, blk); - - if (expr->obj == ast::kind::expr_identifier) - { - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->obj.as_identifier, blk)); - } - else - { - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_EvalArray); - } -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_EvalLevelFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_EvalAnimFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_EvalSelfFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, const block::ptr& blk) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - emit_expr(itr->second, blk); - return; - } - - // is local var - auto index = variable_stack_index(expr, blk); - - switch (index) - { - case 0: - emit_opcode(opcode::OP_EvalLocalVariableCached0); - break; - case 1: - emit_opcode(opcode::OP_EvalLocalVariableCached1); - break; - case 2: - emit_opcode(opcode::OP_EvalLocalVariableCached2); - break; - case 3: - emit_opcode(opcode::OP_EvalLocalVariableCached3); - break; - case 4: - emit_opcode(opcode::OP_EvalLocalVariableCached4); - break; - case 5: - emit_opcode(opcode::OP_EvalLocalVariableCached5); - break; - default: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access_index(expr, blk)); - break; - } -} - -void compiler::emit_expr_object(const ast::expr& expr, const block::ptr& blk) -{ - 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, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr.as_identifier, blk)); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk) -{ - std::vector data; - - bool isexpr = false; - - 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, blk); - emit_expr(expr->y, blk); - emit_expr(expr->x, blk); - 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(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimation, { "", expr->value }); - } - else - { - emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); - tree.loaded = true; - } -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error(expr->loc(), "trying to use animtree without specified using animtree"); - } - - auto& tree = animtrees_.back(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimTree, ""); - } - else - { - emit_opcode(opcode::OP_GetAnimTree, tree.name); - tree.loaded = true; - } -} - -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_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_create_local_vars(const block::ptr& blk) -{ - if ( blk->local_vars_create_count != blk->local_vars_public_count ) - { - for (auto i = blk->local_vars_create_count; i < blk->local_vars_public_count; i++) - { - auto data = utils::string::va("%d", blk->local_vars.at(i).create); - emit_opcode(opcode::OP_CreateLocalVariable, data); - blk->local_vars.at(i).init = true; - } - blk->local_vars_create_count = blk->local_vars_public_count; - } -} - -void compiler::emit_remove_local_vars(const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - auto count = blk->local_vars_create_count - blk->local_vars_public_count; - - if (count > 0) - { - auto data = utils::string::va("%d", count); - emit_opcode(opcode::OP_RemoveLocalVariables, data); - } - } -} - -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, const block::ptr& blk) -{ - process_expr_parameters(decl->params, blk); - process_stmt_list(decl->stmt, blk); -} - -void compiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - 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_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, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk) -{ - process_stmt_list(stmt->list, blk); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - 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, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - blk->merge(childs); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - stmt->blk_if = std::make_unique(); - stmt->blk_else = std::make_unique(); - - blk->copy(stmt->blk_if); - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - blk->copy(stmt->blk_else); - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - blk->merge(childs); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - stmt->blk = std::make_unique(); - stmt->blk_iter = std::make_unique(); - - process_stmt(stmt->init, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->blk); - blk->copy(stmt->blk_iter); - - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_stmt(stmt->iter, stmt->blk_iter); - - blk->append({ stmt->blk_iter.get() }); - blk->merge({ stmt->blk_iter.get() }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto array_name = utils::string::va("_temp_%d", ++label_idx_); - auto key_name = utils::string::va("_temp_%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; - - // calculate variables - - stmt->ctx = std::make_unique(); - stmt->ctx_post = std::make_unique(); - - // calculate pre_expr variables - process_expr(stmt->array, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->ctx); - blk->copy(stmt->ctx_post); - - // calculate stmt variables & add missing array access as first stmt - process_expr(stmt->value_expr, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - continue_blks_.push_back(stmt->ctx.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_expr(stmt->key_expr, stmt->ctx_post); - - blk->append({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - // calculate variables - stmt->ctx = std::make_unique(); - std::vector childs; - auto abort = abort_t::abort_return; - bool has_default = false; - block* default_ctx = nullptr; - auto old_breaks = break_blks_; - break_blks_.clear(); - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->copy(entry.as_case->blk); - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort != abort_t::abort_none) - { - if (entry.as_case->blk->abort == abort_t::abort_break ) - { - entry.as_case->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_case->blk.get()); - } - else if (entry.as_case->blk->abort <= abort ) - { - abort = entry.as_case->blk->abort; - } - } - } - else if (entry == ast::kind::stmt_default) - { - entry.as_default->blk = std::make_unique(); - blk->copy(entry.as_default->blk); - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - has_default = true; - default_ctx = entry.as_default->blk.get(); - - if (entry.as_default->blk->abort != abort_t::abort_none) - { - if (entry.as_default->blk->abort == abort_t::abort_break ) - { - entry.as_default->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_default->blk.get()); - } - else if (entry.as_default->blk->abort <= abort ) - { - abort = entry.as_default->blk->abort; - } - } - } - } - - stmt->stmt =std::move(stmt_list); - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - } - - blk->append(break_blks_); - blk->merge(childs); - } - - break_blks_ = old_breaks; -} - -void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - break_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_break; - } -} - -void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - continue_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_continue; - } -} - -void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } -} - -void compiler::process_expr(const ast::expr& expr, const block::ptr& blk) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value, blk); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj, blk); - } - else if (expr == ast::kind::expr_tuple) - { - process_expr_tuple(expr.as_tuple, blk); - } -} - -void compiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - auto array = utils::string::va("_temp_%d", ++label_idx_); - expr->temp = ast::expr(std::make_unique(expr->loc(), array)); - - process_expr(expr->temp, blk); - - for (const auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk) -{ - for (const auto& entry : decl->list) - { - variable_register(entry->value, blk); - } -} - -void compiler::variable_register(const std::string& name, const block::ptr& blk) -{ - auto it = std::find_if (blk->local_vars.begin(), blk->local_vars.end(), - [&](const gsc::local_var& v) { return v.name == name; }); - - if (it == blk->local_vars.end()) - { - auto found = false; - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - blk->local_vars.push_back({ name, static_cast(i), false }); - found = true; - break; - } - } - - if (!found) - { - blk->local_vars.push_back({ name, stack_idx_, false }); - local_stack_.push_back(name); - stack_idx_++; - } - } -} - -void compiler::variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::uint32_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (!blk->local_vars[i].init) - { - for (std::uint32_t j = 0; j < i; j++) - { - if (!blk->local_vars[j].init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", blk->local_vars[j].create)); - blk->local_vars[j].init = true; - } - } - blk->local_vars[i].init = true; - blk->local_vars_create_count = i + 1; - return; - } - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -void compiler::variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - auto& var = blk->local_vars.at(i); - if (var.name == name->value) - { - if (!var.init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); - var.init = true; - blk->local_vars_create_count++; - } - return; - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return static_cast(blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - return utils::string::va("%d", blk->local_vars[i].create); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return utils::string::va("%d", blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - return blk->local_vars.at(i).init; - } - } - - 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_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jump: - case opcode::OP_jumpback: - case opcode::OP_switch: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_endswitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - - -gsc::include_t compiler::include_maps_mp_utility_ = -{ - "maps/mp/_utility", - { - "exploder_sound", - "_beginlocationselection", - "stoplocationselection", - "endselectiononemp", - "endselectiononaction", - "endselectiononendgame", - "isattachment", - "getattachmenttype", - "delaythread", - "delaythread_proc", - "getplant", - "orienttonormal", - "deleteplacedentity", - "playsoundonplayers", - "sortlowermessages", - "addlowermessage", - "removelowermessage", - "getlowermessage", - "setlowermessage", - "updatelowermessage", - "clearondeath", - "clearafterfade", - "clearlowermessage", - "clearlowermessages", - "printonteam", - "printboldonteam", - "printboldonteamarg", - "printonteamarg", - "printonplayers", - "printandsoundoneveryone", - "printandsoundonteam", - "printandsoundonplayer", - "_playlocalsound", - "dvarintvalue", - "dvarfloatvalue", - "play_sound_on_tag", - "getotherteam", - "wait_endon", - "initpersstat", - "getpersstat", - "incpersstat", - "setpersstat", - "initplayerstat", - "incplayerstat", - "setplayerstat", - "getplayerstat", - "getplayerstattime", - "setplayerstatifgreater", - "setplayerstatiflower", - "updatepersratio", - "updatepersratiobuffered", - "waittillslowprocessallowed", - "waitfortimeornotify", - "isexcluded", - "leaderdialog", - "leaderdialogbothteams", - "leaderdialogonplayers", - "leaderdialogonplayer", - "playleaderdialogonplayer", - "updatemainmenu", - "updateobjectivetext", - "setobjectivetext", - "setobjectivescoretext", - "setobjectivehinttext", - "getobjectivetext", - "getobjectivescoretext", - "getobjectivehinttext", - "gettimepassed", - "getsecondspassed", - "getminutespassed", - "clearkillcamstate", - "isinkillcam", - "isvalidclass", - "getvalueinrange", - "waitfortimeornotifies", - "closemenus", - "logxpgains", - "registerroundswitchdvar", - "registerroundlimitdvar", - "registerwinlimitdvar", - "registerscorelimitdvar", - "registertimelimitdvar", - "registerhalftimedvar", - "registernumlivesdvar", - "setovertimelimitdvar", - "get_damageable_player", - "get_damageable_sentry", - "get_damageable_grenade", - "get_damageable_mine", - "get_damageable_player_pos", - "getstancecenter", - "get_damageable_grenade_pos", - "getdvarvec", - "strip_suffix", - "_takeweaponsexcept", - "savedata", - "restoredata", - "_setactionslot", - "isfloat", - "registerwatchdvarint", - "registerwatchdvarfloat", - "registerwatchdvar", - "setoverridewatchdvar", - "getwatcheddvar", - "updatewatcheddvars", - "isroundbased", - "islastround", - "wasonlyround", - "waslastround", - "hitroundlimit", - "hitscorelimit", - "hitwinlimit", - "getscorelimit", - "getroundswon", - "isobjectivebased", - "gettimelimit", - "gethalftime", - "inovertime", - "gamehasstarted", - "getaverageorigin", - "getlivingplayers", - "setusingremote", - "getremotename", - "freezecontrolswrapper", - "clearusingremote", - "isusingremote", - "queuecreate", - "queueadd", - "queueremovefirst", - "_giveweapon", - "_hasperk", - "giveperk", - "_setperk", - "_setextraperks", - "_unsetperk", - "_unsetextraperks", - "_clearperks", - "quicksort", - "quicksortmid", - "swap", - "_suicide", - "isreallyalive", - "playdeathsound", - "rankingenabled", - "privatematch", - "matchmakinggame", - "setaltsceneobj", - "endsceneondeath", - "getgametypenumlives", - "givecombathigh", - "arrayinsertion", - "getproperty", - "getintproperty", - "getfloatproperty", - "statusmenu", - "ischangingweapon", - "killshouldaddtokillstreak", - "streakshouldchain", - "isjuggernaut", - "iskillstreakweapon", - "isenvironmentweapon", - "getweaponclass", - "isdeathstreakweapon", - "getbaseweaponname", - "fixakimbostring", - "playsoundinspace", - "limitdecimalplaces", - "rounddecimalplaces", - "playerforclientid", - "isrested", - "stringtofloat", - "setselfusable", - "maketeamusable", - "_updateteamusable", - "makeenemyusable", - "_updateenemyusable", - "getnextlifeid", - "initgameflags", - "gameflaginit", - "gameflag", - "gameflagset", - "gameflagclear", - "gameflagwait", - "isprimarydamage", - "isbulletdamage", - "initlevelflags", - "levelflaginit", - "levelflag", - "levelflagset", - "levelflagclear", - "levelflagwait", - "levelflagwaitopen", - "getweaponattachments", - "isemped", - "isairdenied", - "isnuked", - "getplayerforguid", - "teamplayercardsplash", - "iscacprimaryweapon", - "iscacsecondaryweapon", - "getlastlivingplayer", - "getpotentiallivingplayers", - "waittillrecoveredhealth", - "attachmentmap", - "validateattachment", - "_objective_delete", - "touchingbadtrigger", - "setthirdpersondof", - "killtrigger", - "findisfacing", - "combinearrays", - "setrecoilscale", - "cleanarray", - "notusableforjoiningplayers", - "isstrstart", - "validateusestreak", - "currentactivevehiclecount", - "maxvehiclesallowed", - "incrementfauxvehiclecount", - "decrementfauxvehiclecount", - "lightweightscalar", - "allowteamchoice", - "allowclasschoice", - "isbuffunlockedforweapon", - "isbuffequippedonweapon", - "setcommonrulesfrommatchrulesdata", - "reinitializematchrulesonmigration", - "getmatchrulesspecialclass", - "recipeclassapplyjuggernaut", - } -}; - -gsc::include_t compiler::include_common_scripts_createfx_ = -{ - "common_scripts/_createfx", - { - "createeffect", - "getloopeffectdelaydefault", - "getoneshoteffectdelaydefault", - "getexploderdelaydefault", - "getintervalsounddelaymindefault", - "getintervalsounddelaymaxdefault", - "add_effect", - "createloopsound", - "createintervalsound", - "createnewexploder", - "createexploderex", - "set_origin_and_angles", - "set_forward_and_up_vectors", - "createfx_common", - "createfxlogic", - "copy_angles_of_selected_ents", - "reset_axis_of_selected_ents", - "last_selected_entity_has_changed", - "createfx_showorigin", - "drop_selection_to_ground", - "set_off_exploders", - "draw_distance", - "createfx_autosave", - "rotate_over_time", - "delete_pressed", - "remove_selected_option", - "remove_option", - "delete_selection", - "move_selection_to_cursor", - "insert_effect", - "show_help", - "select_last_entity", - "select_all_exploders_of_currently_selected", - "copy_ents", - "post_entity_creation_function", - "paste_ents", - "add_and_select_entity", - "get_center_of_array", - "ent_draw_axis", - "rotation_is_occuring", - "print_fx_options", - "entity_highlight_disable", - "entity_highlight_enable", - "toggle_createfx_drawing", - "manipulate_createfx_ents", - "clear_settable_fx", - "reset_fx_hud_colors", - "button_is_held", - "button_is_clicked", - "toggle_entity_selection", - "select_entity", - "ent_is_highlighted", - "deselect_entity", - "index_is_selected", - "ent_is_selected", - "clear_entity_selection", - "draw_axis", - "clear_fx_hudelements", - "set_fx_hudelement", - "createfx_centerprint", - "createfx_centerprint_thread", - "buttondown", - "buttonpressed_internal", - "get_selected_move_vector", - "process_button_held_and_clicked", - "locked", - "kb_locked", - "add_button", - "add_kb_button", - "set_anglemod_move_vector", - "cfxprintlnstart", - "cfxprintln", - "cfxprintlnend", - "update_selected_entities", - "hack_start", - "get_player", - "createfx_orgranize_array", - "stop_fx_looper", - "stop_loopsound", - "func_get_level_fx", - "restart_fx_looper", - "process_fx_rotater", - "generate_fx_log", - } -}; - -gsc::include_t compiler::include_common_scripts_utility_ = -{ - "common_scripts/utility", - { - "scriptprintln", - "debugprintln", - "draw_debug_line", - "waittillend", - "noself_func", - "self_func", - "randomvector", - "randomvectorrange", - "angle_dif", - "sign", - "track", - "get_enemy_team", - "clear_exception", - "set_exception", - "set_all_exceptions", - "cointoss", - "choose_from_weighted_array", - "get_cumulative_weights", - "waittill_string", - "waittill_multiple", - "waittill_multiple_ents", - "waittill_any_return", - "waittill_any_timeout", - "_timeout", - "waittill_any", - "waittill_any_ents", - "isflashed", - "flag_exist", - "flag", - "init_flags", - "flag_init", - "empty_init_func", - "issuffix", - "flag_set", - "assign_unique_id", - "flag_wait", - "flag_clear", - "flag_waitopen", - "waittill_either", - "array_thread", - "array_call", - "array_thread4", - "array_thread5", - "trigger_on", - "trigger_on_proc", - "trigger_off", - "trigger_off_proc", - "set_trigger_flag_permissions", - "update_trigger_based_on_flags", - "create_flags_and_return_tokens", - "init_trigger_flags", - "getstruct", - "getstructarray", - "struct_class_init", - "fileprint_start", - "fileprint_map_start", - "fileprint_map_header", - "fileprint_map_keypairprint", - "fileprint_map_entity_start", - "fileprint_map_entity_end", - "fileprint_radiant_vec", - "array_remove", - "array_remove_array", - "array_removeundefined", - "array_levelthread", - "array_levelcall", - "add_to_array", - "flag_assert", - "flag_wait_either", - "flag_wait_either_return", - "flag_wait_any", - "flag_wait_any_return", - "flag_wait_all", - "flag_wait_or_timeout", - "flag_waitopen_or_timeout", - "wait_for_flag_or_time_elapses", - "delaycall", - "delaycall_proc", - "noself_delaycall", - "noself_delaycall_proc", - "issp", - "issp_towerdefense", - "string_starts_with", - "plot_points", - "draw_line_for_time", - "array_combine", - "flat_angle", - "flat_origin", - "draw_arrow_time", - "get_linked_ents", - "get_linked_vehicle_nodes", - "get_linked_ent", - "get_linked_vehicle_node", - "get_links", - "run_thread_on_targetname", - "run_thread_on_noteworthy", - "draw_arrow", - "getfx", - "fxexists", - "print_csv_asset", - "fileprint_csv_start", - "_loadfx", - "getlastweapon", - "playerunlimitedammothread", - "isusabilityenabled", - "_disableusability", - "_enableusability", - "resetusability", - "_disableweapon", - "_enableweapon", - "isweaponenabled", - "_disableweaponswitch", - "_enableweaponswitch", - "isweaponswitchenabled", - "_disableoffhandweapons", - "_enableoffhandweapons", - "isoffhandweaponenabled", - "random", - "spawn_tag_origin", - "waittill_notify_or_timeout", - "fileprint_launcher_start_file", - "fileprint_launcher", - "fileprint_launcher_end_file", - "launcher_write_clipboard", - "isdestructible", - "pauseeffect", - "activate_individual_exploder", - "waitframe", - "brush_delete", - "brush_throw", - "get_target_ent", - "brush_show", - "exploder_earthquake", - "do_earthquake", - "exploder_rumble", - "exploder_delay", - "exploder_damage", - "effect_loopsound", - "play_loopsound_in_space", - "sound_effect", - "effect_soundalias", - "play_sound_in_space", - "cannon_effect", - "exploder_playsound", - "fire_effect", - "loop_fx_sound", - "loop_fx_sound_interval", - "loop_sound_delete", - "exploder_before_load", - "exploder_after_load", - "activate_exploder", - "createloopeffect", - "createoneshoteffect", - "createexploder", - "alphabetize", - "is_later_in_alphabet", - "alphabet_compare", - "play_loop_sound_on_entity", - "stop_loop_sound_on_entity", - "delete_on_death", - "error", - "exploder", - "create_dvar", - "void", - "tag_project", - "ter_op", - "create_lock", - "lock", - "is_locked", - "unlock_wait", - "unlock", - "unlock_thread", - "get_template_level", - } -}; - -gsc::include_t compiler::include_maps_mp_gametypes_hud_util_ = -{ - "maps/mp/gametypes/_hud_util", - { - "setparent", - "getparent", - "addchild", - "removechild", - "setpoint", - "setpointbar", - "updatebar", - "updatebarscale", - "createfontstring", - "createserverfontstring", - "createservertimer", - "createtimer", - "createicon", - "createservericon", - "createserverbar", - "createbar", - "getcurrentfraction", - "createprimaryprogressbar", - "createprimaryprogressbartext", - "createteamprogressbar", - "createteamprogressbartext", - "setflashfrac", - "hideelem", - "showelem", - "flashthread", - "destroyelem", - "seticonshader", - "geticonshader", - "seticonsize", - "setwidth", - "setheight", - "setsize", - "updatechildren", - "transitionreset", - "transitionzoomin", - "transitionpulsefxin", - "transitionslidein", - "transitionslideout", - "transitionzoomout", - "transitionfadein", - "transitionfadeout", - "getweeklyref", - "getdailyref", - "ch_getprogress", - "ch_getstate", - "ch_setprogress", - "ch_setstate", - "ch_gettarget", - } -}; - -auto compiler::map_known_includes(const std::string& include) -> bool -{ - if (include == "maps/mp/_utility") - { - includes_.push_back(include_maps_mp_utility_); - return true; - } - else if (include == "common_scripts/utility") - { - includes_.push_back(include_common_scripts_utility_); - return true; - } - else if (include == "common_scripts/_createfx") - { - includes_.push_back(include_common_scripts_createfx_); - return true; - } - else if (include == "maps/mp/gametypes/_hud_util") - { - includes_.push_back(include_maps_mp_gametypes_hud_util_); - return true; - } - - return false; -} - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/compiler.hpp b/src/iw5/xsk/compiler.hpp deleted file mode 100644 index 21853616..00000000 --- a/src/iw5/xsk/compiler.hpp +++ /dev/null @@ -1,163 +0,0 @@ -// 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::gsc::iw5 -{ - -enum class opcode : std::uint8_t; - -class compiler : public gsc::compiler -{ - build mode_; - std::string filename_; - std::vector assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector break_blks_; - std::vector continue_blks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - -public: - auto output() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_constant(const ast::decl_constant::ptr& constant); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last); - void emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void emit_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt, const block::ptr& blk); - void emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk); - void emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk); - void emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk); - void emit_expr(const ast::expr& expr, const block::ptr& blk); - void emit_expr_assign(const ast::expr_assign::ptr& expr, const block::ptr& blk); - void emit_expr_clear(const ast::expr& expr, const block::ptr& blk); - void emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk); - void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk); - void emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_variable(const ast::expr& expr, const block::ptr& blk); - void emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void emit_expr_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_object(const ast::expr& expr, const block::ptr& blk); - void emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_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_create_local_vars(const block::ptr& blk); - void emit_remove_local_vars(const block::ptr& blk); - 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, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(const ast::expr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk); - void variable_register(const std::string& name, const block::ptr& blk); - void variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk); - void variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk); - auto variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t; - auto variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool; - 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); - - static gsc::include_t include_maps_mp_utility_; - static gsc::include_t include_common_scripts_utility_; - static gsc::include_t include_common_scripts_createfx_; - static gsc::include_t include_maps_mp_gametypes_hud_util_; - auto map_known_includes(const std::string& include) -> bool; -}; - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/context.cpp b/src/iw5/xsk/context.cpp deleted file mode 100644 index 2a81edf5..00000000 --- a/src/iw5/xsk/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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 "iw5.hpp" - -namespace xsk::gsc::iw5 -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/context.hpp b/src/iw5/xsk/context.hpp deleted file mode 100644 index 881d3863..00000000 --- a/src/iw5/xsk/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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::gsc::iw5 -{ - -class context : public gsc::context -{ - iw5::assembler assembler_; - iw5::disassembler disassembler_; - iw5::compiler compiler_; - iw5::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { return assembler_; } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { return compiler_; } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/decompiler.cpp b/src/iw5/xsk/decompiler.cpp deleted file mode 100644 index 8e0a7b89..00000000 --- a/src/iw5/xsk/decompiler.cpp +++ /dev/null @@ -1,3436 +0,0 @@ -// 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 "iw5.hpp" - -namespace xsk::gsc::iw5 -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// IW5 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetLocalFunction: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalFunctionCall2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - 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_ScriptLocalFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalMethodCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodChildThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall2: - { - 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 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_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin1: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin3: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin4: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin5: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod1: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod2: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod3: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod4: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod5: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_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 node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // jump is referenced, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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 - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - auto use_key = true; - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - use_key = false; - } - - 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)), use_key)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(std::stoi(entry->value.substr(4))), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - auto var = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - auto var1 = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); - blk->local_vars_create_count++; - } - - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/decompiler.hpp b/src/iw5/xsk/decompiler.hpp deleted file mode 100644 index 8c8506eb..00000000 --- a/src/iw5/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::iw5 -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/disassembler.cpp b/src/iw5/xsk/disassembler.cpp deleted file mode 100644 index 50c0961c..00000000 --- a/src/iw5/xsk/disassembler.cpp +++ /dev/null @@ -1,572 +0,0 @@ -// 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 "iw5.hpp" - -namespace xsk::gsc::iw5 -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// IW5 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read(); - func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - case opcode::OP_Return: - case opcode::OP_GetUndefined: - case opcode::OP_GetZero: - case opcode::OP_waittillFrameEnd: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_EvalArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_ClearArray: - case opcode::OP_EmptyArray: - case opcode::OP_AddArray: - case opcode::OP_PreScriptCall: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_GetLevelObject: - case opcode::OP_GetAnimObject: - case opcode::OP_GetSelf: - case opcode::OP_GetThisthread: - case opcode::OP_GetLevel: - case opcode::OP_GetGame: - case opcode::OP_GetAnim: - case opcode::OP_GetGameRef: - case opcode::OP_inc: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_bit_ex_or: - case opcode::OP_bit_and: - case opcode::OP_equality: - case opcode::OP_inequality: - case opcode::OP_less: - case opcode::OP_greater: - case opcode::OP_less_equal: - case opcode::OP_waittillmatch2: - case opcode::OP_waittill: - case opcode::OP_notify: - case opcode::OP_endon: - case opcode::OP_voidCodepos: - case opcode::OP_vector: - case opcode::OP_greater_equal: - case opcode::OP_shift_left: - case opcode::OP_shift_right: - case opcode::OP_plus: - case opcode::OP_minus: - case opcode::OP_multiply: - case opcode::OP_divide: - case opcode::OP_mod: - case opcode::OP_size: - case opcode::OP_GetSelfObject: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_clearparams: - case opcode::OP_checkclearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_SetVariableField: - case opcode::OP_ClearVariableField: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_wait: - case opcode::OP_DecTop: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_BoolNot: - case opcode::OP_BoolComplement: - 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->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetVector: - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(2); - inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); - break; - case opcode::OP_GetAnimation: - script_->seek(4); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_CreateLocalVariable: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_EvalLocalVariableObjectCached: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - disassemble_field_variable(inst); - break; - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto id = script_->read(); - const auto name = method ? resolver::method_name(id) : resolver::function_name(id); - inst->data.emplace(inst->data.begin(), name); -} - -void disassembler::disassemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto offset = disassemble_offset(); - - inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(3); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto file_id = stack_->read(); - const auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::token_name(file_id); - const auto func_id = stack_->read(); - const auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); - - inst->data.emplace(inst->data.begin(), func_name); - inst->data.emplace(inst->data.begin(), file_name); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read(); - 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) -{ - const auto count = script_->read(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read(); - - if (value < 0x40000) - { - const auto data = stack_->read_c_string(); - - if (data.data()[0] != 0x01) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(data, false)); - } - else - inst->data.push_back("default"); - } - else - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - index += 4; - - const auto addr = disassemble_offset() + index; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 3; - inst->size += 7; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - const auto id = script_->read(); - std::string name; - - if (id > max_string_id) - { - auto temp = stack_->read(); - name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); - } - else - { - name = resolver::token_name(id); - } - - inst->data.push_back(name); -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read(); - } - else if (back) - { - addr = inst->index + 3 - script_->read(); - } - else - { - addr = inst->index + 5 + script_->read(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -auto disassembler::disassemble_offset() -> std::int32_t -{ - std::array bytes = {}; - - for (auto i = 0; i < 3; i++) - { - bytes[i] = script_->read(); - } - - auto offset = *reinterpret_cast(bytes.data()); - - offset = (offset << 8) >> 10; - - return offset; -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = resolve_function(inst->data[0]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s\n", func->name.data())); - - 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())); - } - - print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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 (auto& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - - output_->write_string("\n"); - break; - } -} - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/disassembler.hpp b/src/iw5/xsk/disassembler.hpp deleted file mode 100644 index 6ea4f864..00000000 --- a/src/iw5/xsk/disassembler.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc::iw5 -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_local_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - auto disassemble_offset() -> std::int32_t; - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/iw5.cpp b/src/iw5/xsk/iw5.cpp deleted file mode 100644 index 161f0176..00000000 --- a/src/iw5/xsk/iw5.cpp +++ /dev/null @@ -1,179 +0,0 @@ -// 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 "iw5.hpp" - -namespace xsk::gsc::iw5 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_End: - case opcode::OP_Return: - case opcode::OP_GetUndefined: - case opcode::OP_GetZero: - case opcode::OP_waittillFrameEnd: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_EvalArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_ClearArray: - case opcode::OP_EmptyArray: - case opcode::OP_AddArray: - case opcode::OP_PreScriptCall: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_GetLevelObject: - case opcode::OP_GetAnimObject: - case opcode::OP_GetSelf: - case opcode::OP_GetThisthread: - case opcode::OP_GetLevel: - case opcode::OP_GetGame: - case opcode::OP_GetAnim: - case opcode::OP_GetGameRef: - case opcode::OP_inc: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_bit_ex_or: - case opcode::OP_bit_and: - case opcode::OP_equality: - case opcode::OP_inequality: - case opcode::OP_less: - case opcode::OP_greater: - case opcode::OP_less_equal: - case opcode::OP_waittillmatch2: - case opcode::OP_waittill: - case opcode::OP_notify: - case opcode::OP_endon: - case opcode::OP_voidCodepos: - case opcode::OP_vector: - case opcode::OP_greater_equal: - case opcode::OP_shift_left: - case opcode::OP_shift_right: - case opcode::OP_plus: - case opcode::OP_minus: - case opcode::OP_multiply: - case opcode::OP_divide: - case opcode::OP_mod: - case opcode::OP_size: - case opcode::OP_GetSelfObject: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_clearparams: - case opcode::OP_checkclearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_SetVariableField: - case opcode::OP_ClearVariableField: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_wait: - case opcode::OP_DecTop: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_BoolNot: - case opcode::OP_BoolComplement: - return 1; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - case opcode::OP_CreateLocalVariable: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_waittillmatch: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_GetAnimTree: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_EvalLocalVariableObjectCached: - return 2; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_GetString: - case opcode::OP_GetIString: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jumpback: - case opcode::OP_endswitch: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - return 3; - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_GetLocalFunction: - case opcode::OP_CallBuiltin: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - case opcode::OP_GetFarFunction: - return 4; - case opcode::OP_GetInteger: - case opcode::OP_GetFloat: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_GetAnimation: - case opcode::OP_switch: - case opcode::OP_jump: - return 5; - case opcode::OP_GetVector: - return 13; - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/iw5.hpp b/src/iw5/xsk/iw5.hpp deleted file mode 100644 index 93386a99..00000000 --- a/src/iw5/xsk/iw5.hpp +++ /dev/null @@ -1,182 +0,0 @@ -// 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 "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::iw5 -{ - -constexpr std::uint16_t max_string_id = 0x826A; - -enum class opcode : std::uint8_t -{ - OP_End = 0x0, - OP_Return = 0x1, - OP_GetByte = 0x2, - OP_GetNegByte = 0x3, - OP_GetUnsignedShort = 0x4, - OP_GetNegUnsignedShort = 0x5, - OP_GetInteger = 0x6, - OP_GetBuiltinFunction = 0x7, - OP_GetBuiltinMethod = 0x8, - OP_GetFloat = 0x9, - OP_GetString = 0xA, - OP_GetUndefined = 0xB, - OP_GetZero = 0xC, - OP_waittillFrameEnd = 0xD, - OP_CreateLocalVariable = 0xE, - OP_RemoveLocalVariables = 0xF, - OP_EvalLocalVariableCached0 = 0x10, - OP_EvalLocalVariableCached1 = 0x11, - OP_EvalLocalVariableCached2 = 0x12, - OP_EvalLocalVariableCached3 = 0x13, - OP_EvalLocalVariableCached4 = 0x14, - OP_EvalLocalVariableCached5 = 0x15, - OP_EvalLocalVariableCached = 0x16, - OP_EvalLocalArrayCached = 0x17, - OP_EvalArray = 0x18, - OP_EvalLocalArrayRefCached0 = 0x19, - OP_EvalNewLocalArrayRefCached0 = 0x1A, - OP_EvalLocalArrayRefCached = 0x1B, - OP_EvalArrayRef = 0x1C, - OP_ClearArray = 0x1D, - OP_EmptyArray = 0x1E, - OP_AddArray = 0x1F, - OP_PreScriptCall = 0x20, - OP_ScriptLocalFunctionCall2 = 0x21, - OP_ScriptLocalFunctionCall = 0x22, - OP_ScriptLocalMethodCall = 0x23, - OP_ScriptLocalThreadCall = 0x24, - OP_ScriptLocalChildThreadCall = 0x25, - OP_ScriptLocalMethodThreadCall = 0x26, - OP_ScriptLocalMethodChildThreadCall = 0x27, - OP_ScriptFarFunctionCall2 = 0x28, - OP_ScriptFarFunctionCall = 0x29, - OP_ScriptFarMethodCall = 0x2A, - OP_ScriptFarThreadCall = 0x2B, - OP_ScriptFarChildThreadCall = 0x2C, - OP_ScriptFarMethodThreadCall = 0x2D, - OP_ScriptFarMethodChildThreadCall = 0x2E, - OP_ScriptFunctionCallPointer = 0x2F, - OP_ScriptMethodCallPointer = 0x30, - OP_ScriptThreadCallPointer = 0x31, - OP_ScriptChildThreadCallPointer = 0x32, - OP_ScriptMethodThreadCallPointer = 0x33, - OP_ScriptMethodChildThreadCallPointer = 0x34, - OP_CallBuiltinPointer = 0x35, - OP_CallBuiltinMethodPointer = 0x36, - OP_GetIString = 0x37, - OP_GetVector = 0x38, - OP_GetLevelObject = 0x39, - OP_GetAnimObject = 0x3A, - OP_GetSelf = 0x3B, - OP_GetThisthread = 0x3C, - OP_GetLevel = 0x3D, - OP_GetGame = 0x3E, - OP_GetAnim = 0x3F, - OP_GetAnimation = 0x40, - OP_GetGameRef = 0x41, - OP_inc = 0x42, - OP_dec = 0x43, - OP_bit_or = 0x44, - OP_JumpOnFalseExpr = 0x45, - OP_bit_ex_or = 0x46, - OP_bit_and = 0x47, - OP_equality = 0x48, - OP_inequality = 0x49, - OP_less = 0x4A, - OP_greater = 0x4B, - OP_JumpOnTrueExpr = 0x4C, - OP_less_equal = 0x4D, - OP_jumpback = 0x4E, - OP_waittillmatch2 = 0x4F, - OP_waittill = 0x50, - OP_notify = 0x51, - OP_endon = 0x52, - OP_voidCodepos = 0x53, - OP_switch = 0x54, - OP_endswitch = 0x55, - OP_vector = 0x56, - OP_JumpOnFalse = 0x57, - OP_greater_equal = 0x58, - OP_shift_left = 0x59, - OP_shift_right = 0x5A, - OP_plus = 0x5B, - OP_jump = 0x5C, - OP_minus = 0x5D, - OP_multiply = 0x5E, - OP_divide = 0x5F, - OP_mod = 0x60, - OP_JumpOnTrue = 0x61, - OP_size = 0x62, - OP_waittillmatch = 0x63, - OP_GetLocalFunction = 0x64, - OP_GetFarFunction = 0x65, - OP_GetSelfObject = 0x66, - OP_EvalLevelFieldVariable = 0x67, - OP_EvalAnimFieldVariable = 0x68, - OP_EvalSelfFieldVariable = 0x69, - OP_EvalFieldVariable = 0x6A, - OP_EvalLevelFieldVariableRef = 0x6B, - OP_EvalAnimFieldVariableRef = 0x6C, - OP_EvalSelfFieldVariableRef = 0x6D, - OP_EvalFieldVariableRef = 0x6E, - OP_ClearFieldVariable = 0x6F, - OP_SafeCreateVariableFieldCached = 0x70, - OP_SafeSetVariableFieldCached0 = 0x71, - OP_SafeSetVariableFieldCached = 0x72, - OP_SafeSetWaittillVariableFieldCached = 0x73, - OP_GetAnimTree = 0x74, - OP_clearparams = 0x75, - OP_checkclearparams = 0x76, - OP_EvalLocalVariableRefCached0 = 0x77, - OP_EvalNewLocalVariableRefCached0 = 0x78, - OP_EvalLocalVariableRefCached = 0x79, - OP_SetLevelFieldVariableField = 0x7A, - OP_SetVariableField = 0x7B, - OP_ClearVariableField = 0x7C, - OP_SetAnimFieldVariableField = 0x7D, - OP_SetSelfFieldVariableField = 0x7E, - OP_SetLocalVariableFieldCached0 = 0x7F, - OP_SetNewLocalVariableFieldCached0 = 0x80, - OP_SetLocalVariableFieldCached = 0x81, - OP_ClearLocalVariableFieldCached = 0x82, - OP_ClearLocalVariableFieldCached0 = 0x83, - OP_CallBuiltin0 = 0x84, - OP_CallBuiltin1 = 0x85, - OP_CallBuiltin2 = 0x86, - OP_CallBuiltin3 = 0x87, - OP_CallBuiltin4 = 0x88, - OP_CallBuiltin5 = 0x89, - OP_CallBuiltin = 0x8A, - OP_CallBuiltinMethod0 = 0x8B, - OP_CallBuiltinMethod1 = 0x8C, - OP_CallBuiltinMethod2 = 0x8D, - OP_CallBuiltinMethod3 = 0x8E, - OP_CallBuiltinMethod4 = 0x8F, - OP_CallBuiltinMethod5 = 0x90, - OP_CallBuiltinMethod = 0x91, - OP_wait = 0x92, - OP_DecTop = 0x93, - OP_CastFieldObject = 0x94, - OP_EvalLocalVariableObjectCached = 0x95, - OP_CastBool = 0x96, - OP_BoolNot = 0x97, - OP_BoolComplement = 0x98, - OP_Count = 0x99, -}; - -auto opcode_size(std::uint8_t id) -> std::uint32_t; - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/lexer.cpp b/src/iw5/xsk/lexer.cpp deleted file mode 100644 index b731f2fb..00000000 --- a/src/iw5/xsk/lexer.cpp +++ /dev/null @@ -1,848 +0,0 @@ -// 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 "iw5.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -xsk::gsc::iw5::parser::symbol_type IW5lex(xsk::gsc::iw5::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::gsc::iw5 -{ - -const std::unordered_map keyword_map -{{ - { "#define", parser::token::SH_DEFINE }, - { "#undef", parser::token::SH_UNDEF }, - { "#ifdef", parser::token::SH_IFDEF }, - { "#ifndef", parser::token::SH_IFNDEF }, - { "#if", parser::token::SH_IF }, - { "#elif", parser::token::SH_ELIF }, - { "#else", parser::token::SH_ELSE }, - { "#endif", parser::token::SH_ENDIF }, - { "#inline", parser::token::INLINE }, - { "#include", parser::token::INCLUDE }, - { "#using_animtree", parser::token::USINGTREE }, - { "#animtree", parser::token::ANIMTREE }, - { "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 }, - { "childthread", parser::token::CHILDTHREAD }, - { "thisthread", parser::token::THISTHREAD }, - { "call", parser::token::CALL }, - { "true", parser::token::TRUE }, - { "false", parser::token::FALSE }, - { "undefined", parser::token::UNDEFINED }, - { "size", parser::token::SIZE }, - { "game", parser::token::GAME }, - { "self", parser::token::SELF }, - { "anim", parser::token::ANIM }, - { "level", parser::token::LEVEL }, -}}; - -buffer::buffer() : length(0) -{ - data = static_cast(std::malloc(max_buf_size)); -} - -buffer::~buffer() -{ - if (data) std::free(data); -} - -bool buffer::push(char c) -{ - if (length >= max_buf_size) - return false; - - data[length++] = c; - return true; -} - -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) -{ - -} - -void reader::init(const char* data, size_t size) -{ - if (data && size) - { - state = reader::ok; - buffer_pos = data; - bytes_remaining = static_cast(size); - last_byte = 0; - current_byte = *data; - } - else - { - state = reader::end; - buffer_pos = 0; - bytes_remaining = 0; - last_byte = 0; - current_byte = 0; - } -} - -void reader::advance() -{ - ++buffer_pos; - - if (bytes_remaining-- == 1) - { - state = reader::end; - bytes_remaining = 0; - last_byte = current_byte; - current_byte = 0; - } - else - { - last_byte = current_byte; - current_byte = *buffer_pos; - } -} - -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) -{ - reader_.init(data, size); -} - -void lexer::push_header(const std::string& file) -{ - try - { - if (header_top_++ >= 10) - throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - - auto data = resolver::file_data(file + ".gsh"); - - readers_.push(reader_); - locs_.push(loc_); - loc_.initialize(std::get<0>(data)); - reader_.init(std::get<1>(data), std::get<2>(data)); - clean_ = true; - } - catch (const std::exception& e) - { - throw error("parsing header file '" + file + "': " + e.what()); - } -} - -void lexer::pop_header() -{ - header_top_--; - loc_ = locs_.top(); - locs_.pop(); - reader_ = readers_.top(); - readers_.pop(); -} - -void lexer::ban_header(const location& loc) -{ - if (header_top_ > 0) - { - throw comp_error(loc, "not allowed inside a gsh file"); - } -} - -auto lexer::lex() -> parser::symbol_type -{ - buffer_.length = 0; - state_ = state::start; - - while (true) - { - const auto& state = reader_.state; - auto& last = reader_.last_byte; - auto& curr = reader_.current_byte; - auto path = false; - loc_.step(); - - if (state == reader::end) - { - if (indev_) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (header_top_ > 0) - pop_header(); - else - return parser::make_IW5EOF(loc_); - } - - if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') - clean_ = false; - - advance(); - - switch (last) - { - case ' ': - case '\t': - case '\r': - loc_.step(); - continue; - case '\n': - loc_.lines(); - loc_.step(); - clean_ = true; - continue; - case '\\': - throw comp_error(loc_, "invalid token ('\\')"); - case '/': - if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') - return parser::make_DIV(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_DIV(loc_); - - if (last == '#') - { - if (indev_) - throw comp_error(loc_, "cannot recurse devblock ('/#')"); - - if (mode_ == build::dev) - { - indev_ = true; - return parser::make_DEVBEGIN(loc_); - } - else - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '#' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - } - else if (last == '@') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched script doc comment start ('/@')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '@' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '*') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched multiline comment start ('/*')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '*' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '/') - { - while (true) - { - if (state == reader::end) - break; - - if (curr == '\n') - break; - - advance(); - } - } - continue; - case '#': - if (curr == '/') - { - if (!indev_) - throw comp_error(loc_, "unmatched devblock end ('#/')"); - - advance(); - indev_ = false; - return parser::make_DEVEND(loc_); - } - - buffer_.push(last); - advance(); - - while (state == reader::ok) - { - if (last != ' ' || last != '\t') - break; - - advance(); - } - - if (state == reader::end || !((last > 64 && last < 91) || (last > 96 && last < 123))) - throw comp_error(loc_, "invalid preprocessor directive ('#')"); - - state_ = state::preprocessor; - goto lex_name; - case '*': - if (curr != '=' && curr != '/') - return parser::make_MUL(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_MUL(loc_); - - throw comp_error(loc_, "unmatched multiline comment end ('*/')"); - case '"': - state_ = state::string; - goto lex_string; - case '.': - if (curr < '0' || curr > '9') - return parser::make_DOT(loc_); - goto lex_number; - case '(': - return parser::make_LPAREN(loc_); - case ')': - return parser::make_RPAREN(loc_); - case '{': - return parser::make_LBRACE(loc_); - case '}': - return parser::make_RBRACE(loc_); - case '[': - return parser::make_LBRACKET(loc_); - case ']': - return parser::make_RBRACKET(loc_); - case ',': - return parser::make_COMMA(loc_); - case ';': - return parser::make_SEMICOLON(loc_); - case ':': - if (curr != ':') - return parser::make_COLON(loc_); - - advance(); - return parser::make_DOUBLECOLON(loc_); - case '?': - return parser::make_QMARK(loc_); - case '=': - if (curr != '=') - return parser::make_ASSIGN(loc_); - - advance(); - return parser::make_EQUALITY(loc_); - case '+': - if (curr != '+' && curr != '=') - return parser::make_ADD(loc_); - - advance(); - - if (last == '+') - return parser::make_INCREMENT(loc_); - - return parser::make_ASSIGN_ADD(loc_); - case '-': - if (curr != '-' && curr != '=') - return parser::make_SUB(loc_); - - advance(); - - if (last == '-') - return parser::make_DECREMENT(loc_); - - return parser::make_ASSIGN_SUB(loc_); - case '%': - if (curr != '=') - return parser::make_MOD(loc_); - - advance(); - - return parser::make_ASSIGN_MOD(loc_); - case '|': - if (curr != '|' && curr != '=') - return parser::make_BITWISE_OR(loc_); - - advance(); - - if (last == '|') - return parser::make_OR(loc_); - - return parser::make_ASSIGN_BW_OR(loc_); - case '&': - if (curr != '&' && curr != '=' && curr != '"') - return parser::make_BITWISE_AND(loc_); - - advance(); - - if (last == '&') - return parser::make_AND(loc_); - - if (last == '=') - return parser::make_ASSIGN_BW_AND(loc_); - - state_ = state::localize; - goto lex_string; - case '^': - if (curr != '=') - return parser::make_BITWISE_EXOR(loc_); - - advance(); - return parser::make_ASSIGN_BW_EXOR(loc_); - case '!': - if (curr != '=') - return parser::make_NOT(loc_); - - advance(); - return parser::make_INEQUALITY(loc_); - case '~': - return parser::make_COMPLEMENT(loc_); - case '<': - if (curr != '<' && curr != '=') - return parser::make_LESS(loc_); - - advance(); - if (last == '=') - return parser::make_LESS_EQUAL(loc_); - - if (curr != '=') - return parser::make_LSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_LSHIFT(loc_); - case '>': - if (curr != '>' && curr != '=') - return parser::make_GREATER(loc_); - - advance(); - - if (last == '=') - return parser::make_GREATER_EQUAL(loc_); - - if (curr != '=') - return parser::make_RSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_RSHIFT(loc_); - default: - if (last >= '0' && last <= '9') - goto lex_number; - else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) - goto lex_name; - - throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); - } - -lex_string: - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched string start ('\"')"); - - if (curr == '"') - { - advance(); - break; - } - - if (curr == '\n') - throw comp_error(loc_, "unterminated string literal"); - - if (curr == '\\') - { - advance(); - - if (state == reader::end) - throw comp_error(loc_, "invalid token ('\')"); - - char c = curr; - switch (curr) - { - case 't': c = '\t'; break; - case 'r': c = '\r'; break; - case 'n': c = '\n'; break; - case '"': c = '\"'; break; - case '\\': c = '\\'; break; - default: break; - } - - if (!buffer_.push(c)) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); - -lex_name: - buffer_.push(last); - - while (true) - { - if (state == reader::end) - break; - - if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) - break; - - if (curr == '\\') - { - if (last == '\\') - throw comp_error(loc_, "invalid path '\\\\'"); - - path = true; - if (!buffer_.push('/')) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::preprocessor) - { - auto token = parser::token::IW5UNDEF; - - if (buffer_.length < 16) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - { - if (itr->second > parser::token::SH_ENDIF) - return parser::symbol_type(itr->second, loc_); - - token = itr->second; - } - } - - preprocessor_run(token); - - state_ = state::start; - continue; - } - else - { - 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_); - } - - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - -lex_number: - if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) - { - buffer_.push(last); - - auto dot = last == '.' ? 1 : 0; - auto flt = 0; - - while (true) - { - if (state == reader::end) - break; - - if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) - throw comp_error(loc_, "invalid number literal"); - - if ((curr == '.' || curr == 'f') && last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr == 'f') - flt++; - else if (curr == '.') - dot++; - else if (!(curr > 47 && curr < 58)) - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f')) - throw comp_error(loc_, "invalid number literal"); - - if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); - } - else if (curr == 'o') - { - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) - throw comp_error(loc_, "invalid octal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!(curr > 47 && curr < 56)) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length <= 0) - throw comp_error(loc_, "invalid octal literal"); - - return parser::make_INTEGER(utils::string::oct_to_dec(buffer_.data), loc_); - } - else if (curr == 'b') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) - throw comp_error(loc_, "invalid binary literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr != '0' && curr != '1') - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid binary literal"); - - return parser::make_INTEGER(utils::string::bin_to_dec(buffer_.data), loc_); - } - else if (curr == 'x') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) - throw comp_error(loc_, "invalid hexadecimal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid hexadecimal literal"); - - return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); - } - - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); - } -} - -void lexer::advance() -{ - reader_.advance(); - loc_.end.column++; - - if (reader_.current_byte == '\\') [[unlikely]] - preprocessor_wrap(); -} - -void lexer::preprocessor_wrap() -{ - while (reader_.current_byte == '\\') - { - if (reader_.bytes_remaining == 1) - throw comp_error(loc_, "invalid token ('\\')"); - - if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') - break; - - if (reader_.buffer_pos[1] == '\r') - { - if (reader_.bytes_remaining <= 3 || reader_.buffer_pos[2] != '\n') - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 3; - reader_.bytes_remaining -= 3; - } - - if ((reader_.buffer_pos[1] == '\n')) - { - if (reader_.bytes_remaining == 2) - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 2; - reader_.bytes_remaining -= 2; - } - - if (reader_.bytes_remaining == 0) - { - reader_.state = reader::end; - reader_.current_byte = 0; - } - else - { - reader_.current_byte = *reader_.buffer_pos; - } - - loc_.lines(); - loc_.step(); - } -} - -void lexer::preprocessor_run(parser::token::token_kind_type token) -{ - if (!clean_) - throw comp_error(loc_, "invalid token ('#')"); - - switch (token) - { - case parser::token::SH_DEFINE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_UNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELSE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ENDIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - default: - throw comp_error(loc_, "unknown preprocessor directive"); - } -} - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/lexer.hpp b/src/iw5/xsk/lexer.hpp deleted file mode 100644 index 259221a8..00000000 --- a/src/iw5/xsk/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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::gsc::iw5 -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/parser.cpp b/src/iw5/xsk/parser.cpp deleted file mode 100644 index 4e409cc8..00000000 --- a/src/iw5/xsk/parser.cpp +++ /dev/null @@ -1,4668 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw5::parser::symbol_type IW5lex(xsk::gsc::iw5::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex IW5lex - - - -#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 IW5DEBUG - -// 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 // !IW5DEBUG - -# 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 // !IW5DEBUG - -#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 gsc { namespace iw5 { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::gsc::iw5::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg) -#if IW5DEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - 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_add_array: // expr_add_array - value.YY_MOVE_OR_COPY< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.YY_MOVE_OR_COPY< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.YY_MOVE_OR_COPY< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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 IW5DEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if IW5DEBUG - 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 // IW5DEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - yylhs.value.emplace< ast::expr_add_array::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - yylhs.value.emplace< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - yylhs.value.emplace< ast::expr_tuple::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_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_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_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 261 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2020 "parser.cpp" - break; - - case 3: // root: %empty -#line 262 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2026 "parser.cpp" - break; - - case 4: // program: program inline -#line 267 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2032 "parser.cpp" - break; - - case 5: // program: program include -#line 269 "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 2038 "parser.cpp" - break; - - case 6: // program: program declaration -#line 271 "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 2044 "parser.cpp" - break; - - case 7: // program: inline -#line 273 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2050 "parser.cpp" - break; - - case 8: // program: include -#line 275 "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 2056 "parser.cpp" - break; - - case 9: // program: declaration -#line 277 "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 2062 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 281 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2068 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 286 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2074 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 290 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2080 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 291 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2086 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 292 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2092 "parser.cpp" - break; - - case 15: // declaration: decl_constant -#line 293 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } -#line 2098 "parser.cpp" - break; - - case 16: // declaration: decl_thread -#line 294 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2104 "parser.cpp" - break; - - case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 299 "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 2110 "parser.cpp" - break; - - case 18: // decl_constant: expr_identifier "=" expr ";" -#line 304 "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 2116 "parser.cpp" - break; - - case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 309 "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 2122 "parser.cpp" - break; - - case 20: // stmt: stmt_block -#line 313 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2128 "parser.cpp" - break; - - case 21: // stmt: stmt_call -#line 314 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2134 "parser.cpp" - break; - - case 22: // stmt: stmt_assign -#line 315 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2140 "parser.cpp" - break; - - case 23: // stmt: stmt_endon -#line 316 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2146 "parser.cpp" - break; - - case 24: // stmt: stmt_notify -#line 317 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2152 "parser.cpp" - break; - - case 25: // stmt: stmt_wait -#line 318 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2158 "parser.cpp" - break; - - case 26: // stmt: stmt_waittill -#line 319 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2164 "parser.cpp" - break; - - case 27: // stmt: stmt_waittillmatch -#line 320 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2170 "parser.cpp" - break; - - case 28: // stmt: stmt_waittillframeend -#line 321 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2176 "parser.cpp" - break; - - case 29: // stmt: stmt_if -#line 322 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2182 "parser.cpp" - break; - - case 30: // stmt: stmt_ifelse -#line 323 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2188 "parser.cpp" - break; - - case 31: // stmt: stmt_while -#line 324 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2194 "parser.cpp" - break; - - case 32: // stmt: stmt_dowhile -#line 325 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2200 "parser.cpp" - break; - - case 33: // stmt: stmt_for -#line 326 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2206 "parser.cpp" - break; - - case 34: // stmt: stmt_foreach -#line 327 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2212 "parser.cpp" - break; - - case 35: // stmt: stmt_switch -#line 328 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2218 "parser.cpp" - break; - - case 36: // stmt: stmt_case -#line 329 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2224 "parser.cpp" - break; - - case 37: // stmt: stmt_default -#line 330 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2230 "parser.cpp" - break; - - case 38: // stmt: stmt_break -#line 331 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2236 "parser.cpp" - break; - - case 39: // stmt: stmt_continue -#line 332 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2242 "parser.cpp" - break; - - case 40: // stmt: stmt_return -#line 333 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2248 "parser.cpp" - break; - - case 41: // stmt: stmt_breakpoint -#line 334 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } -#line 2254 "parser.cpp" - break; - - case 42: // stmt: stmt_prof_begin -#line 335 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2260 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_end -#line 336 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2266 "parser.cpp" - break; - - case 44: // stmt_or_dev: stmt -#line 340 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2272 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt_dev -#line 341 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2278 "parser.cpp" - break; - - case 46: // stmt_list: stmt_list stmt -#line 346 "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 2284 "parser.cpp" - break; - - case 47: // stmt_list: stmt -#line 348 "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 2290 "parser.cpp" - break; - - case 48: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 353 "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 2296 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev -#line 355 "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 2302 "parser.cpp" - break; - - case 50: // stmt_dev: "/#" stmt_list "#/" -#line 359 "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 2308 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" "#/" -#line 360 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2314 "parser.cpp" - break; - - case 52: // stmt_block: "{" stmt_or_dev_list "}" -#line 364 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2320 "parser.cpp" - break; - - case 53: // stmt_block: "{" "}" -#line 365 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2326 "parser.cpp" - break; - - case 54: // stmt_expr: expr_assign -#line 370 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2332 "parser.cpp" - break; - - case 55: // stmt_expr: expr_increment -#line 372 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2338 "parser.cpp" - break; - - case 56: // stmt_expr: expr_decrement -#line 374 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2344 "parser.cpp" - break; - - case 57: // stmt_expr: %empty -#line 376 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2350 "parser.cpp" - break; - - case 58: // stmt_call: expr_call ";" -#line 381 "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 2356 "parser.cpp" - break; - - case 59: // stmt_call: expr_method ";" -#line 383 "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 2362 "parser.cpp" - break; - - case 60: // stmt_assign: expr_assign ";" -#line 388 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2368 "parser.cpp" - break; - - case 61: // stmt_assign: expr_increment ";" -#line 390 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2374 "parser.cpp" - break; - - case 62: // stmt_assign: expr_decrement ";" -#line 392 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2380 "parser.cpp" - break; - - case 63: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 397 "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 2386 "parser.cpp" - break; - - case 64: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 402 "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 2392 "parser.cpp" - break; - - case 65: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 404 "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 2398 "parser.cpp" - break; - - case 66: // stmt_wait: "wait" expr ";" -#line 409 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2404 "parser.cpp" - break; - - case 67: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 414 "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 2410 "parser.cpp" - break; - - case 68: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 416 "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 2416 "parser.cpp" - break; - - case 69: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 421 "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 2422 "parser.cpp" - break; - - case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 423 "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 2428 "parser.cpp" - break; - - case 71: // stmt_waittillframeend: "waittillframeend" ";" -#line 428 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2434 "parser.cpp" - break; - - case 72: // stmt_if: "if" "(" expr ")" stmt -#line 433 "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 2440 "parser.cpp" - break; - - case 73: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 438 "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 2446 "parser.cpp" - break; - - case 74: // stmt_while: "while" "(" expr ")" stmt -#line 443 "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 2452 "parser.cpp" - break; - - case 75: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 448 "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 2458 "parser.cpp" - break; - - case 76: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 453 "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 2464 "parser.cpp" - break; - - case 77: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 458 "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 2470 "parser.cpp" - break; - - case 78: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 460 "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 2476 "parser.cpp" - break; - - case 79: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 465 "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 2482 "parser.cpp" - break; - - case 80: // stmt_case: "case" expr_integer ":" -#line 470 "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 2488 "parser.cpp" - break; - - case 81: // stmt_case: "case" expr_string ":" -#line 472 "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 2494 "parser.cpp" - break; - - case 82: // stmt_default: "default" ":" -#line 477 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2500 "parser.cpp" - break; - - case 83: // stmt_break: "break" ";" -#line 482 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2506 "parser.cpp" - break; - - case 84: // stmt_continue: "continue" ";" -#line 487 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2512 "parser.cpp" - break; - - case 85: // stmt_return: "return" expr ";" -#line 492 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2518 "parser.cpp" - break; - - case 86: // stmt_return: "return" ";" -#line 494 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2524 "parser.cpp" - break; - - case 87: // stmt_breakpoint: "breakpoint" ";" -#line 499 "parser.ypp" - { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } -#line 2530 "parser.cpp" - break; - - case 88: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 504 "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 2536 "parser.cpp" - break; - - case 89: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 509 "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 2542 "parser.cpp" - break; - - case 90: // expr: expr_ternary -#line 513 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2548 "parser.cpp" - break; - - case 91: // expr: expr_binary -#line 514 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2554 "parser.cpp" - break; - - case 92: // expr: expr_primitive -#line 515 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2560 "parser.cpp" - break; - - case 93: // expr_or_empty: expr -#line 519 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2566 "parser.cpp" - break; - - case 94: // expr_or_empty: %empty -#line 520 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2572 "parser.cpp" - break; - - case 95: // expr_assign: expr_tuple "=" expr -#line 525 "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 2578 "parser.cpp" - break; - - case 96: // expr_assign: expr_object "=" expr -#line 527 "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 2584 "parser.cpp" - break; - - case 97: // expr_assign: expr_object "|=" expr -#line 529 "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 2590 "parser.cpp" - break; - - case 98: // expr_assign: expr_object "&=" expr -#line 531 "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 2596 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "^=" expr -#line 533 "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 2602 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "<<=" expr -#line 535 "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 2608 "parser.cpp" - break; - - case 101: // expr_assign: expr_object ">>=" expr -#line 537 "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 2614 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "+=" expr -#line 539 "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 2620 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "-=" expr -#line 541 "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 2626 "parser.cpp" - break; - - case 104: // expr_assign: expr_object "*=" expr -#line 543 "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 2632 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "/=" expr -#line 545 "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 2638 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "%=" expr -#line 547 "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 2644 "parser.cpp" - break; - - case 107: // expr_increment: "++" expr_object -#line 552 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2650 "parser.cpp" - break; - - case 108: // expr_increment: expr_object "++" -#line 554 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2656 "parser.cpp" - break; - - case 109: // expr_decrement: "--" expr_object -#line 559 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2662 "parser.cpp" - break; - - case 110: // expr_decrement: expr_object "--" -#line 561 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2668 "parser.cpp" - break; - - case 111: // expr_ternary: expr "?" expr ":" expr -#line 566 "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 2674 "parser.cpp" - break; - - case 112: // expr_binary: expr "||" expr -#line 571 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2680 "parser.cpp" - break; - - case 113: // expr_binary: expr "&&" expr -#line 573 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2686 "parser.cpp" - break; - - case 114: // expr_binary: expr "==" expr -#line 575 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2692 "parser.cpp" - break; - - case 115: // expr_binary: expr "!=" expr -#line 577 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2698 "parser.cpp" - break; - - case 116: // expr_binary: expr "<=" expr -#line 579 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2704 "parser.cpp" - break; - - case 117: // expr_binary: expr ">=" expr -#line 581 "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 2710 "parser.cpp" - break; - - case 118: // expr_binary: expr "<" expr -#line 583 "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 2716 "parser.cpp" - break; - - case 119: // expr_binary: expr ">" expr -#line 585 "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 2722 "parser.cpp" - break; - - case 120: // expr_binary: expr "|" expr -#line 587 "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 2728 "parser.cpp" - break; - - case 121: // expr_binary: expr "&" expr -#line 589 "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 2734 "parser.cpp" - break; - - case 122: // expr_binary: expr "^" expr -#line 591 "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 2740 "parser.cpp" - break; - - case 123: // expr_binary: expr "<<" expr -#line 593 "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 2746 "parser.cpp" - break; - - case 124: // expr_binary: expr ">>" expr -#line 595 "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 2752 "parser.cpp" - break; - - case 125: // expr_binary: expr "+" expr -#line 597 "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 2758 "parser.cpp" - break; - - case 126: // expr_binary: expr "-" expr -#line 599 "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 2764 "parser.cpp" - break; - - case 127: // expr_binary: expr "*" expr -#line 601 "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 2770 "parser.cpp" - break; - - case 128: // expr_binary: expr "/" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2776 "parser.cpp" - break; - - case 129: // expr_binary: expr "%" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2782 "parser.cpp" - break; - - case 130: // expr_primitive: expr_complement -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 2788 "parser.cpp" - break; - - case 131: // expr_primitive: expr_negate -#line 610 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 2794 "parser.cpp" - break; - - case 132: // expr_primitive: expr_not -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 2800 "parser.cpp" - break; - - case 133: // expr_primitive: expr_call -#line 612 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 2806 "parser.cpp" - break; - - case 134: // expr_primitive: expr_method -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 2812 "parser.cpp" - break; - - case 135: // expr_primitive: expr_add_array -#line 614 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } -#line 2818 "parser.cpp" - break; - - case 136: // expr_primitive: expr_reference -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 2824 "parser.cpp" - break; - - case 137: // expr_primitive: expr_array -#line 616 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 2830 "parser.cpp" - break; - - case 138: // expr_primitive: expr_field -#line 617 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 2836 "parser.cpp" - break; - - case 139: // expr_primitive: expr_size -#line 618 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 2842 "parser.cpp" - break; - - case 140: // expr_primitive: expr_paren -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 2848 "parser.cpp" - break; - - case 141: // expr_primitive: expr_thisthread -#line 620 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } -#line 2854 "parser.cpp" - break; - - case 142: // expr_primitive: expr_empty_array -#line 621 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 2860 "parser.cpp" - break; - - case 143: // expr_primitive: expr_undefined -#line 622 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 2866 "parser.cpp" - break; - - case 144: // expr_primitive: expr_game -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 2872 "parser.cpp" - break; - - case 145: // expr_primitive: expr_self -#line 624 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 2878 "parser.cpp" - break; - - case 146: // expr_primitive: expr_anim -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 2884 "parser.cpp" - break; - - case 147: // expr_primitive: expr_level -#line 626 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 2890 "parser.cpp" - break; - - case 148: // expr_primitive: expr_animation -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 2896 "parser.cpp" - break; - - case 149: // expr_primitive: expr_animtree -#line 628 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 2902 "parser.cpp" - break; - - case 150: // expr_primitive: expr_identifier -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 2908 "parser.cpp" - break; - - case 151: // expr_primitive: expr_istring -#line 630 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 2914 "parser.cpp" - break; - - case 152: // expr_primitive: expr_string -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 2920 "parser.cpp" - break; - - case 153: // expr_primitive: expr_vector -#line 632 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 2926 "parser.cpp" - break; - - case 154: // expr_primitive: expr_float -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 2932 "parser.cpp" - break; - - case 155: // expr_primitive: expr_integer -#line 634 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 2938 "parser.cpp" - break; - - case 156: // expr_primitive: expr_false -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 2944 "parser.cpp" - break; - - case 157: // expr_primitive: expr_true -#line 636 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 2950 "parser.cpp" - break; - - case 158: // expr_complement: "~" expr -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2956 "parser.cpp" - break; - - case 159: // expr_negate: "-" expr_identifier -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 2962 "parser.cpp" - break; - - case 160: // expr_negate: "-" expr_paren -#line 648 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 2968 "parser.cpp" - break; - - case 161: // expr_negate: "-" expr_array -#line 650 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 2974 "parser.cpp" - break; - - case 162: // expr_negate: "-" expr_field -#line 652 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 2980 "parser.cpp" - break; - - case 163: // expr_not: "!" expr -#line 657 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2986 "parser.cpp" - break; - - case 164: // expr_call: expr_function -#line 661 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 2992 "parser.cpp" - break; - - case 165: // expr_call: expr_pointer -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 2998 "parser.cpp" - break; - - case 166: // expr_method: expr_object expr_function -#line 665 "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 3004 "parser.cpp" - break; - - case 167: // expr_method: expr_object expr_pointer -#line 666 "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 3010 "parser.cpp" - break; - - case 168: // expr_function: expr_identifier "(" expr_arguments ")" -#line 671 "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 3016 "parser.cpp" - break; - - case 169: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 673 "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 3022 "parser.cpp" - break; - - case 170: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 675 "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 3028 "parser.cpp" - break; - - case 171: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 677 "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 3034 "parser.cpp" - break; - - case 172: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 679 "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::childthread); } -#line 3040 "parser.cpp" - break; - - case 173: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 681 "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::childthread); } -#line 3046 "parser.cpp" - break; - - case 174: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 686 "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 3052 "parser.cpp" - break; - - case 175: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 688 "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 3058 "parser.cpp" - break; - - case 176: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 690 "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::childthread); } -#line 3064 "parser.cpp" - break; - - case 177: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 692 "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::builtin); } -#line 3070 "parser.cpp" - break; - - case 178: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 697 "parser.ypp" - { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } -#line 3076 "parser.cpp" - break; - - case 179: // expr_parameters: expr_parameters "," expr_identifier -#line 702 "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 3082 "parser.cpp" - break; - - case 180: // expr_parameters: expr_identifier -#line 704 "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 3088 "parser.cpp" - break; - - case 181: // expr_parameters: %empty -#line 706 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3094 "parser.cpp" - break; - - case 182: // expr_arguments: expr_arguments_no_empty -#line 711 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3100 "parser.cpp" - break; - - case 183: // expr_arguments: %empty -#line 713 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3106 "parser.cpp" - break; - - case 184: // expr_arguments_no_empty: expr_arguments "," expr -#line 718 "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 3112 "parser.cpp" - break; - - case 185: // expr_arguments_no_empty: expr -#line 720 "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 3118 "parser.cpp" - break; - - case 186: // expr_reference: "::" expr_identifier -#line 725 "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 3124 "parser.cpp" - break; - - case 187: // expr_reference: expr_path "::" expr_identifier -#line 727 "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 3130 "parser.cpp" - break; - - case 188: // expr_tuple: "[" expr_tuple_arguments "]" -#line 732 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[1].value.as < ast::expr_tuple::ptr > ()); } -#line 3136 "parser.cpp" - break; - - case 189: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types -#line 737 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::move(yystack_[2].value.as < ast::expr_tuple::ptr > ()); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3142 "parser.cpp" - break; - - case 190: // expr_tuple_arguments: expr_tuple_types -#line 739 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3148 "parser.cpp" - break; - - case 191: // expr_tuple_types: expr_array -#line 743 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3154 "parser.cpp" - break; - - case 192: // expr_tuple_types: expr_field -#line 744 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3160 "parser.cpp" - break; - - case 193: // expr_tuple_types: expr_identifier -#line 745 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3166 "parser.cpp" - break; - - case 194: // expr_array: expr_object "[" expr "]" -#line 750 "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 3172 "parser.cpp" - break; - - case 195: // expr_field: expr_object "." expr_identifier_nosize -#line 755 "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 3178 "parser.cpp" - break; - - case 196: // expr_size: expr_object "." "size" -#line 760 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3184 "parser.cpp" - break; - - case 197: // expr_paren: "(" expr ")" -#line 765 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3190 "parser.cpp" - break; - - case 198: // expr_object: expr_call -#line 769 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3196 "parser.cpp" - break; - - case 199: // expr_object: expr_method -#line 770 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3202 "parser.cpp" - break; - - case 200: // expr_object: expr_array -#line 771 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3208 "parser.cpp" - break; - - case 201: // expr_object: expr_field -#line 772 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3214 "parser.cpp" - break; - - case 202: // expr_object: expr_game -#line 773 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3220 "parser.cpp" - break; - - case 203: // expr_object: expr_self -#line 774 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3226 "parser.cpp" - break; - - case 204: // expr_object: expr_anim -#line 775 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3232 "parser.cpp" - break; - - case 205: // expr_object: expr_level -#line 776 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3238 "parser.cpp" - break; - - case 206: // expr_object: expr_identifier -#line 777 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3244 "parser.cpp" - break; - - case 207: // expr_thisthread: "thisthread" -#line 782 "parser.ypp" - { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } -#line 3250 "parser.cpp" - break; - - case 208: // expr_empty_array: "[" "]" -#line 787 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3256 "parser.cpp" - break; - - case 209: // expr_undefined: "undefined" -#line 792 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3262 "parser.cpp" - break; - - case 210: // expr_game: "game" -#line 797 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3268 "parser.cpp" - break; - - case 211: // expr_self: "self" -#line 802 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3274 "parser.cpp" - break; - - case 212: // expr_anim: "anim" -#line 807 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3280 "parser.cpp" - break; - - case 213: // expr_level: "level" -#line 812 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3286 "parser.cpp" - break; - - case 214: // expr_animation: "%" "identifier" -#line 817 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3292 "parser.cpp" - break; - - case 215: // expr_animtree: "#animtree" -#line 822 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3298 "parser.cpp" - break; - - case 216: // expr_identifier_nosize: "identifier" -#line 827 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3304 "parser.cpp" - break; - - case 217: // expr_identifier: "identifier" -#line 832 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3310 "parser.cpp" - break; - - case 218: // expr_identifier: "size" -#line 834 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3316 "parser.cpp" - break; - - case 219: // expr_path: "identifier" -#line 839 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3322 "parser.cpp" - break; - - case 220: // expr_path: "path" -#line 841 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3328 "parser.cpp" - break; - - case 221: // expr_istring: "localized string" -#line 846 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3334 "parser.cpp" - break; - - case 222: // expr_string: "string literal" -#line 851 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3340 "parser.cpp" - break; - - case 223: // expr_vector: "(" expr "," expr "," expr ")" -#line 856 "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 3346 "parser.cpp" - break; - - case 224: // expr_float: "-" "float" -#line 861 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3352 "parser.cpp" - break; - - case 225: // expr_float: "float" -#line 863 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3358 "parser.cpp" - break; - - case 226: // expr_integer: "-" "integer" -#line 868 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3364 "parser.cpp" - break; - - case 227: // expr_integer: "integer" -#line 870 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3370 "parser.cpp" - break; - - case 228: // expr_false: "false" -#line 875 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3376 "parser.cpp" - break; - - case 229: // expr_true: "true" -#line 880 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3382 "parser.cpp" - break; - - -#line 3386 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "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", - "childthread", "thisthread", "call", "true", "false", "undefined", - "size", "game", "self", "anim", "level", "(", ")", "{", "}", "[", "]", - ",", ".", "::", ":", ";", "?", "++", "--", "<<", ">>", "||", "&&", "==", - "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", "%=", - "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", "%", - "path", "identifier", "string literal", "localized string", "float", - "integer", "SIZEOF", "ADD_ARRAY", "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_negate", "expr_not", "expr_call", "expr_method", - "expr_function", "expr_pointer", "expr_add_array", "expr_parameters", - "expr_arguments", "expr_arguments_no_empty", "expr_reference", - "expr_tuple", "expr_tuple_arguments", "expr_tuple_types", "expr_array", - "expr_field", "expr_size", "expr_paren", "expr_object", - "expr_thisthread", "expr_empty_array", "expr_undefined", "expr_game", - "expr_self", "expr_anim", "expr_level", "expr_animation", - "expr_animtree", "expr_identifier_nosize", "expr_identifier", - "expr_path", "expr_istring", "expr_string", "expr_vector", "expr_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 IW5DEBUG - // 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 IW5DEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if IW5DEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -281; - - const short parser::yytable_ninf_ = -220; - - const short - parser::yypact_[] = - { - 4, -281, -281, -72, -72, -41, -281, -281, 32, 4, - -281, -281, -281, -281, -281, -281, -21, -281, -281, -28, - -1, -22, -281, -281, -281, -281, -43, 1235, -281, -281, - -281, 5, -29, -281, -281, -26, -24, -281, 8, -281, - -281, -281, -281, -281, -281, -281, 1235, 1109, -43, 1235, - 1235, 612, 1, 47, -281, -281, -281, 2111, -281, -281, - -281, -281, -281, -281, 108, 145, -281, -281, -281, -281, - 372, 438, -281, -281, 633, -281, -281, -281, 664, 818, - 982, 987, -281, -281, 39, 59, -281, -281, -281, -281, - -281, -281, -281, 61, 16, -43, 65, 78, 79, 103, - 109, 127, 133, 1443, 1109, -281, 2194, 125, 136, -281, - -281, -281, 1235, 134, -281, -281, -281, -281, 372, 438, - -281, 1132, -281, -281, -281, -281, 39, 137, -281, -281, - 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, - 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1298, - -35, -281, -281, 147, 1235, -43, -281, 951, -281, -281, - 1235, 1235, -43, 1235, 1235, -43, 1235, -281, 1235, 1231, - 1235, -281, 1609, 1235, 102, -43, 2076, -51, -51, 2225, - 865, 2276, 2276, -27, -27, -27, -27, 2235, 273, 2266, - 51, 51, -281, -281, -281, 1294, -281, -281, -281, 23, - -281, 150, 77, 1235, 148, 157, 1381, 160, 162, 163, - 166, -15, 158, 165, 167, 1172, 168, 172, 173, -281, - 409, 703, 703, -281, -281, 1027, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, 175, 184, 185, 186, 187, 142, -281, -281, 808, - 147, 1921, 30, 176, 1961, 36, 182, 2001, 2040, 195, - 2194, 1231, 150, 1235, -281, -281, 1235, -281, -281, 1080, - 2146, -281, 1235, 224, 1235, 738, -43, 1235, 151, 193, - 196, -281, -281, -281, -281, 2181, -281, 1235, 1235, 1298, - 35, -281, 112, 123, -4, 1132, 1132, -281, -281, -281, - -281, -281, -281, -281, 1235, 204, 206, 209, 210, -281, - -281, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, - 1235, 1235, 207, -281, 1235, 211, -281, 1235, 212, 1235, - 214, 2194, 76, -281, -281, -281, 1643, 215, 1677, 201, - -281, -281, -281, 1407, -8, 1711, -281, -281, -281, 82, - 85, -281, 703, 2194, 1235, 1235, 1235, 1235, 2194, 2194, - 2194, 2194, 2194, 2194, 2194, 2194, 2194, 2194, 2194, 219, - 104, 220, 107, 221, 1745, 1235, -281, 1381, 1235, 1381, - 1235, 1235, -43, 16, 216, 222, -281, 1779, 1487, 1531, - 1575, 1235, -281, 1235, -281, 1235, -281, 120, 249, 1813, - -281, 2194, 223, 1847, 246, -281, -281, -281, 227, 229, - 1235, 232, 1235, 235, 1235, 124, 126, 138, -281, 1381, - 236, 738, 1381, 1235, -281, -281, 228, -281, 230, -281, - 247, -281, -281, -281, -281, -281, 250, -281, 1881, 242, - 243, 248, 1381, 1381, -281, -281, -281, -281, -281 - }; - - const unsigned char - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 218, 217, 0, 2, - 7, 8, 9, 14, 15, 16, 0, 220, 219, 0, - 0, 0, 1, 4, 5, 6, 181, 0, 10, 11, - 222, 0, 0, 180, 215, 0, 0, 207, 0, 229, - 228, 209, 210, 211, 212, 213, 0, 183, 0, 0, - 0, 0, 0, 217, 221, 225, 227, 0, 90, 91, - 92, 130, 131, 132, 133, 134, 164, 165, 135, 136, - 137, 138, 139, 140, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 0, 151, 152, 153, 154, - 155, 156, 157, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 183, 208, 185, 0, 182, 186, - 163, 158, 0, 0, 224, 226, 198, 199, 161, 162, - 160, 0, 202, 203, 204, 205, 159, 0, 214, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 166, 167, 0, 183, 0, 17, 0, 19, 179, - 0, 183, 0, 0, 183, 0, 0, 197, 0, 185, - 0, 178, 0, 0, 0, 0, 0, 123, 124, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 125, 126, 127, 128, 129, 0, 196, 216, 195, 0, - 182, 187, 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, 198, 199, 0, 200, 201, 0, - 206, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 184, 0, 0, 0, 194, 168, 183, 51, 47, 0, - 0, 71, 0, 0, 0, 57, 0, 0, 0, 0, - 0, 82, 83, 84, 86, 0, 87, 183, 183, 0, - 0, 190, 200, 201, 206, 107, 109, 52, 48, 60, - 61, 62, 58, 59, 0, 0, 0, 0, 0, 108, - 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 170, 183, 0, 172, 183, 0, 0, - 0, 111, 0, 50, 46, 66, 0, 0, 0, 0, - 54, 55, 56, 0, 0, 0, 81, 80, 85, 0, - 0, 188, 0, 95, 0, 0, 0, 0, 96, 102, - 103, 104, 105, 106, 97, 98, 99, 101, 100, 0, - 0, 0, 0, 0, 0, 183, 169, 0, 0, 0, - 94, 0, 0, 0, 0, 0, 189, 0, 0, 0, - 0, 183, 171, 183, 173, 183, 223, 0, 72, 0, - 74, 93, 0, 0, 0, 79, 88, 89, 0, 0, - 183, 0, 183, 0, 183, 0, 0, 0, 174, 0, - 0, 57, 0, 0, 63, 65, 182, 68, 182, 70, - 182, 175, 176, 177, 73, 75, 0, 77, 0, 0, - 0, 0, 0, 0, 64, 67, 69, 76, 78 - }; - - const short - parser::yypgoto_[] = - { - -281, -281, -281, 272, 298, 299, -281, -281, -281, 194, - 86, -281, -281, -281, -92, -121, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, 188, - -281, -280, -279, -278, -281, -281, -281, -281, -281, -281, - 92, 203, -66, -62, -281, -281, -127, -46, -281, -281, - -281, -13, 213, 337, -281, 289, 385, -281, -281, -281, - 392, 480, 512, 519, -281, -281, -281, 0, 10, -281, - -17, -281, -281, 130, -281, -281 - }; - - const short - parser::yydefgoto_[] = - { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 223, - 224, 279, 225, 226, 227, 349, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 106, - 412, 251, 252, 253, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 32, 107, 200, 69, 256, - 300, 301, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 198, 84, 85, 86, - 87, 88, 89, 90, 91, 92 - }; - - const short - parser::yytable_[] = - { - 16, 108, 158, 6, 31, 350, 351, 352, 151, 16, - 21, 196, 152, 19, 20, 1, 2, 3, 4, 5, - 6, 391, 6, 94, 17, 18, 33, 199, 95, 96, - 26, 99, 22, 28, 262, 97, 100, 265, 131, 132, - 144, 145, 146, 147, 148, 98, 101, 154, 109, 392, - 6, 126, -193, -193, 7, 151, 27, 93, 108, 152, - 29, 127, 197, 102, 144, 145, 146, 147, 148, 157, - 17, 53, 17, 53, 153, 275, 30, 288, -206, -206, - 170, -206, 333, 30, 127, -206, 56, 170, 336, 277, - 154, 361, 362, 170, -206, 159, 203, -206, 128, 204, - 205, 7, 206, 207, 208, 209, -219, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 35, 36, 155, 38, - 160, 153, 156, 6, 42, 43, 44, 45, 386, 161, - 157, 127, 220, 170, 394, -206, -206, 395, 162, 170, - 221, 222, 170, 116, 146, 147, 148, -198, -198, 342, - -198, 350, 351, 352, -198, 201, 402, 260, 163, 404, - 164, 170, 263, -198, 170, 266, -198, 127, -191, -191, - 359, 360, 428, 17, 53, 272, 441, 170, 442, -192, - -192, 170, 170, 170, -199, -199, 165, -199, 166, 173, - 443, -199, 171, 151, 289, 170, 175, 152, 154, 197, - -199, 276, 260, -199, -198, -198, 260, 380, 282, 281, - 382, 284, 127, 285, 286, 57, 127, 287, 291, 314, - 304, 260, 260, 297, 298, 260, 292, 334, 293, 296, - 127, 127, 127, 337, 103, 127, 309, 110, 111, 151, - 151, -199, -199, 152, 152, 310, 311, 312, 313, 254, - 347, 340, 115, 356, 117, 364, 357, 365, 407, 153, - 366, 367, 390, 379, 118, 385, 388, 381, 383, 127, - 401, 403, 405, 429, 425, 433, 426, 416, 427, 260, - 449, 23, 450, 417, 431, 260, 354, 151, 434, 127, - 435, 152, 169, 437, 254, 127, 439, 445, 254, 451, - 172, 415, 452, 454, 455, 153, 153, 24, 25, 456, - 446, 308, 116, 116, 116, 127, 127, 254, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 131, 132, - 120, 290, 135, 136, 137, 138, 139, 140, 261, 396, - 0, 264, 0, 153, 267, 0, 268, 0, 270, 0, - 255, 271, 304, 127, 144, 145, 146, 147, 148, 0, - 257, 254, 127, 0, 436, 0, 438, 116, 440, 0, - 0, 0, 0, 0, 0, 0, 0, 260, 119, 260, - 0, 280, 414, 0, 0, 0, 278, 127, 0, 127, - 283, 0, 0, 295, 0, 255, 0, 0, 0, 255, - 0, -200, -200, 0, -200, 257, 0, 0, -200, 257, - 0, 0, 0, 117, 117, 117, 0, -200, 255, 260, - -200, 260, 260, 302, 257, 257, 121, 0, 257, 127, - 0, 127, 127, 122, 0, 0, 0, 0, 35, 36, - 0, 38, 260, 260, 116, 6, 42, 43, 44, 45, - 0, 341, 127, 127, 299, 0, 0, 0, -200, -200, - 346, 0, 348, 344, 0, 355, 0, -201, -201, 254, - -201, 254, 255, 0, -201, 0, 0, 271, 117, 0, - 0, 0, 257, -201, 258, 0, -201, 0, 257, 0, - 0, 0, 363, 0, 0, 17, 53, 0, 0, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 0, 254, 0, 116, 254, 0, 0, 384, 0, 0, - 0, 123, 0, 0, -201, -201, 0, 0, 0, 258, - 0, 0, 259, 258, 254, 254, 0, 0, 0, 122, - 0, 0, 397, 398, 399, 400, 0, 303, 258, 258, - 0, 0, 258, 124, 0, 117, 0, 0, 0, 0, - 125, 0, 0, 0, 0, 302, 409, 0, 411, 413, - 0, 408, 0, 410, 0, 0, 0, 259, 0, 0, - 255, 259, 255, 0, 122, 0, 0, 0, 122, 0, - 257, 0, 257, 0, 0, 121, 305, 306, 0, 0, - 259, 0, 122, 122, 122, 0, 258, 122, 0, 0, - 0, 448, 258, 444, 0, 0, 447, 0, 0, 0, - 0, 0, 255, 0, 117, 255, 0, 123, 0, 0, - 0, 0, 257, 0, 257, 257, 457, 458, 0, 0, - 0, 35, 36, 0, 38, 255, 255, 0, 6, 42, - 43, 44, 45, 112, 259, 257, 257, 113, 0, 124, - 353, 122, 35, 36, 0, 38, 125, 122, 0, 6, - 0, 0, 123, 0, 0, 0, 123, 0, 149, 0, - 0, 150, 0, 0, 0, 0, 0, 0, 0, 303, - 123, 123, 123, -202, -202, 123, -202, 0, 17, 53, - -202, 0, 114, 115, 124, 0, 0, 0, 124, -202, - 0, 125, -202, 0, 258, 125, 258, 0, 0, 17, - 53, 0, 124, 124, 124, 0, 0, 124, 0, 125, - 125, 125, 35, 36, 125, 38, 0, 121, 0, 6, - 42, 43, 44, 45, 122, 0, 0, 0, 113, 123, - -202, -202, 0, 0, 0, 123, 258, 0, 258, 258, - 0, 0, 259, 0, 259, 0, 0, 35, 36, 122, - 38, 122, 0, 0, 6, 42, 43, 44, 45, 258, - 258, 124, 0, 220, 0, 0, 0, 124, 125, 17, - 53, 221, 222, 0, 125, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 259, 0, 353, 259, 0, 0, - 0, 122, 0, 122, 122, 315, 316, 0, 317, 318, - 0, 0, 0, 0, 17, 53, 0, 259, 259, 0, - 0, 0, 123, 0, 122, 122, 0, 35, 36, 0, - 38, 0, 0, 0, 6, 0, 0, -203, -203, 0, - -203, 0, 0, 149, -203, 0, 174, 123, 0, 123, - 0, 319, 320, -203, 124, 0, -203, 0, 0, 0, - 0, 125, 0, 0, 0, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 0, 0, 0, 124, - 0, 124, 0, 0, 17, 53, 125, 0, 125, 123, - 0, 123, 123, 0, -203, -203, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 131, 132, 123, 123, 135, 136, 137, 138, 139, 140, - 0, 124, 0, 124, 124, 0, 0, 0, 125, 0, - 125, 125, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 0, 202, 0, 124, 124, 0, 0, 0, 0, - 203, 125, 125, 204, 205, 0, 206, 207, 208, 209, - 0, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 35, 36, 0, 38, 0, 0, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 219, 220, 0, 0, 0, - 0, 0, 0, 0, 221, 222, 0, 0, 0, 0, - 0, -204, -204, 0, -204, 0, -205, -205, -204, -205, - 0, 0, 0, -205, 0, 0, 0, -204, 202, 0, - -204, 0, -205, 0, 0, -205, 203, 17, 53, 204, - 205, 0, 206, 207, 208, 209, 0, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 35, 36, 0, 38, - 0, 0, 0, 6, 42, 43, 44, 45, -204, -204, - 157, 307, 220, -205, -205, 0, 0, 0, 0, 0, - 221, 222, 343, 0, 0, 0, 0, 0, 0, 203, - 0, 0, 204, 205, 0, 206, 207, 208, 209, 0, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 35, - 36, 0, 38, 17, 53, 34, 6, 42, 43, 44, - 45, 0, 0, 157, 0, 220, 0, 0, 0, 0, - 0, 0, 0, 221, 222, 0, 0, 0, 35, 36, - 37, 38, 39, 40, 41, 6, 42, 43, 44, 45, - 46, 0, 0, 0, 104, 105, 0, 0, 48, 0, - 0, 35, 36, 0, 38, 0, 17, 53, 6, 0, - 0, 0, 0, 0, 49, 50, 0, 149, 34, 0, - 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 51, 0, 0, 52, 17, 53, 30, 54, 55, - 56, 35, 36, 37, 38, 39, 40, 41, 6, 42, - 43, 44, 45, 46, 0, 0, 0, 47, 17, 53, - 0, 48, 0, 294, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 49, 50, 0, - 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 51, 0, 0, 52, 17, 53, - 30, 54, 55, 56, 35, 36, 37, 38, 39, 40, - 41, 6, 42, 43, 44, 45, 46, 269, 0, 0, - 47, 0, 0, 130, 48, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 49, 50, 0, 0, 34, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 51, 0, 0, - 52, 17, 53, 30, 54, 55, 56, 35, 36, 37, - 38, 39, 40, 41, 6, 42, 43, 44, 45, 46, - 274, 0, 0, 104, 0, 0, 130, 48, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 49, 50, 0, 0, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 51, 0, 0, 52, 17, 53, 30, 54, 55, 56, - 203, 0, 0, 204, 205, 0, 206, 207, 208, 209, - 0, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 35, 36, 0, 38, 0, 0, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 0, 220, 0, 0, 0, - 0, 0, 0, 0, 221, 222, 35, 36, 0, 38, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, - 0, 0, 149, 0, 0, 174, 0, 0, 0, 0, - 319, 320, 0, 0, 0, 0, 0, 17, 53, 0, - 0, 0, 0, 0, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 167, 0, 0, 0, 0, - 168, 0, 0, 17, 53, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 419, - 0, 0, 0, 0, 420, 0, 0, 0, 0, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 421, 0, 0, 0, 0, 422, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 423, 0, 0, - 0, 0, 424, 0, 0, 0, 0, 130, 0, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 167, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 130, 0, 0, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 387, 0, 141, 142, 143, - 144, 145, 146, 147, 148, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 389, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 393, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 406, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 130, 0, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 418, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 130, 0, 0, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 430, 0, 141, 142, 143, - 144, 145, 146, 147, 148, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 453, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 332, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 335, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 338, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 339, 0, 0, - 0, 0, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 273, 0, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 129, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 345, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 358, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 131, 132, 0, 134, 135, 136, 137, 138, 139, 140, - 131, 132, 0, 0, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 0, 0, 0, 142, 143, 144, 145, 146, 147, - 148, 131, 132, 0, 0, 135, 136, 137, 138, 139, - 140, 131, 132, 0, 0, 0, 0, 137, 138, 139, - 140, 0, 0, 0, 0, 142, 0, 144, 145, 146, - 147, 148, 0, 0, 0, 0, 0, 144, 145, 146, - 147, 148 - }; - - const short - parser::yycheck_[] = - { - 0, 47, 94, 46, 21, 285, 285, 285, 74, 9, - 51, 46, 74, 3, 4, 11, 12, 13, 14, 15, - 46, 29, 46, 52, 96, 97, 26, 154, 57, 55, - 51, 55, 0, 61, 161, 35, 36, 164, 65, 66, - 91, 92, 93, 94, 95, 35, 36, 51, 48, 57, - 46, 51, 56, 57, 97, 121, 77, 52, 104, 121, - 61, 51, 97, 55, 91, 92, 93, 94, 95, 53, - 96, 97, 96, 97, 74, 52, 98, 92, 39, 40, - 57, 42, 52, 98, 74, 46, 101, 57, 52, 12, - 51, 56, 57, 57, 55, 95, 19, 58, 97, 22, - 23, 97, 25, 26, 27, 28, 59, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 59, 42, - 55, 121, 61, 46, 47, 48, 49, 50, 52, 51, - 53, 121, 55, 57, 52, 96, 97, 52, 59, 57, - 63, 64, 57, 51, 93, 94, 95, 39, 40, 276, - 42, 431, 431, 431, 46, 155, 52, 157, 55, 52, - 51, 57, 162, 55, 57, 165, 58, 157, 56, 57, - 297, 298, 52, 96, 97, 175, 52, 57, 52, 56, - 57, 57, 57, 57, 39, 40, 59, 42, 55, 55, - 52, 46, 56, 259, 211, 57, 59, 259, 51, 97, - 55, 51, 202, 58, 96, 97, 206, 334, 51, 61, - 337, 51, 202, 51, 51, 27, 206, 51, 60, 77, - 220, 221, 222, 51, 51, 225, 61, 51, 61, 61, - 220, 221, 222, 51, 46, 225, 61, 49, 50, 305, - 306, 96, 97, 305, 306, 61, 61, 61, 61, 157, - 26, 56, 101, 60, 51, 51, 60, 51, 385, 259, - 51, 51, 61, 56, 51, 51, 51, 56, 56, 259, - 51, 51, 51, 24, 401, 29, 403, 61, 405, 279, - 52, 9, 52, 61, 61, 285, 286, 353, 61, 279, - 61, 353, 104, 61, 202, 285, 61, 61, 206, 52, - 112, 393, 52, 61, 61, 305, 306, 9, 9, 61, - 431, 225, 220, 221, 222, 305, 306, 225, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 65, 66, - 51, 211, 69, 70, 71, 72, 73, 74, 160, 362, - -1, 163, -1, 353, 166, -1, 168, -1, 170, -1, - 157, 173, 362, 353, 91, 92, 93, 94, 95, -1, - 157, 279, 362, -1, 420, -1, 422, 285, 424, -1, - -1, -1, -1, -1, -1, -1, -1, 387, 51, 389, - -1, 203, 392, -1, -1, -1, 202, 387, -1, 389, - 206, -1, -1, 215, -1, 202, -1, -1, -1, 206, - -1, 39, 40, -1, 42, 202, -1, -1, 46, 206, - -1, -1, -1, 220, 221, 222, -1, 55, 225, 429, - 58, 431, 432, 220, 221, 222, 51, -1, 225, 429, - -1, 431, 432, 51, -1, -1, -1, -1, 39, 40, - -1, 42, 452, 453, 362, 46, 47, 48, 49, 50, - -1, 273, 452, 453, 55, -1, -1, -1, 96, 97, - 282, -1, 284, 279, -1, 287, -1, 39, 40, 387, - 42, 389, 279, -1, 46, -1, -1, 299, 285, -1, - -1, -1, 279, 55, 157, -1, 58, -1, 285, -1, - -1, -1, 314, -1, -1, 96, 97, -1, -1, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, - -1, 429, -1, 431, 432, -1, -1, 339, -1, -1, - -1, 51, -1, -1, 96, 97, -1, -1, -1, 202, - -1, -1, 157, 206, 452, 453, -1, -1, -1, 157, - -1, -1, 364, 365, 366, 367, -1, 220, 221, 222, - -1, -1, 225, 51, -1, 362, -1, -1, -1, -1, - 51, -1, -1, -1, -1, 362, 388, -1, 390, 391, - -1, 387, -1, 389, -1, -1, -1, 202, -1, -1, - 387, 206, 389, -1, 202, -1, -1, -1, 206, -1, - 387, -1, 389, -1, -1, 220, 221, 222, -1, -1, - 225, -1, 220, 221, 222, -1, 279, 225, -1, -1, - -1, 433, 285, 429, -1, -1, 432, -1, -1, -1, - -1, -1, 429, -1, 431, 432, -1, 157, -1, -1, - -1, -1, 429, -1, 431, 432, 452, 453, -1, -1, - -1, 39, 40, -1, 42, 452, 453, -1, 46, 47, - 48, 49, 50, 51, 279, 452, 453, 55, -1, 157, - 285, 279, 39, 40, -1, 42, 157, 285, -1, 46, - -1, -1, 202, -1, -1, -1, 206, -1, 55, -1, - -1, 58, -1, -1, -1, -1, -1, -1, -1, 362, - 220, 221, 222, 39, 40, 225, 42, -1, 96, 97, - 46, -1, 100, 101, 202, -1, -1, -1, 206, 55, - -1, 202, 58, -1, 387, 206, 389, -1, -1, 96, - 97, -1, 220, 221, 222, -1, -1, 225, -1, 220, - 221, 222, 39, 40, 225, 42, -1, 362, -1, 46, - 47, 48, 49, 50, 362, -1, -1, -1, 55, 279, - 96, 97, -1, -1, -1, 285, 429, -1, 431, 432, - -1, -1, 387, -1, 389, -1, -1, 39, 40, 387, - 42, 389, -1, -1, 46, 47, 48, 49, 50, 452, - 453, 279, -1, 55, -1, -1, -1, 285, 279, 96, - 97, 63, 64, -1, 285, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 429, -1, 431, 432, -1, -1, - -1, 429, -1, 431, 432, 17, 18, -1, 20, 21, - -1, -1, -1, -1, 96, 97, -1, 452, 453, -1, - -1, -1, 362, -1, 452, 453, -1, 39, 40, -1, - 42, -1, -1, -1, 46, -1, -1, 39, 40, -1, - 42, -1, -1, 55, 46, -1, 58, 387, -1, 389, - -1, 63, 64, 55, 362, -1, 58, -1, -1, -1, - -1, 362, -1, -1, -1, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, -1, -1, -1, 387, - -1, 389, -1, -1, 96, 97, 387, -1, 389, 429, - -1, 431, 432, -1, 96, 97, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, 452, 453, 69, 70, 71, 72, 73, 74, - -1, 429, -1, 431, 432, -1, -1, -1, 429, -1, - 431, 432, -1, 88, 89, 90, 91, 92, 93, 94, - 95, -1, 11, -1, 452, 453, -1, -1, -1, -1, - 19, 452, 453, 22, 23, -1, 25, 26, 27, 28, - -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, -1, 42, -1, -1, -1, 46, 47, 48, - 49, 50, -1, -1, 53, 54, 55, -1, -1, -1, - -1, -1, -1, -1, 63, 64, -1, -1, -1, -1, - -1, 39, 40, -1, 42, -1, 39, 40, 46, 42, - -1, -1, -1, 46, -1, -1, -1, 55, 11, -1, - 58, -1, 55, -1, -1, 58, 19, 96, 97, 22, - 23, -1, 25, 26, 27, 28, -1, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, -1, 42, - -1, -1, -1, 46, 47, 48, 49, 50, 96, 97, - 53, 54, 55, 96, 97, -1, -1, -1, -1, -1, - 63, 64, 12, -1, -1, -1, -1, -1, -1, 19, - -1, -1, 22, 23, -1, 25, 26, 27, 28, -1, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, -1, 42, 96, 97, 16, 46, 47, 48, 49, - 50, -1, -1, 53, -1, 55, -1, -1, -1, -1, - -1, -1, -1, 63, 64, -1, -1, -1, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, -1, -1, -1, 55, 56, -1, -1, 59, -1, - -1, 39, 40, -1, 42, -1, 96, 97, 46, -1, - -1, -1, -1, -1, 75, 76, -1, 55, 16, -1, - 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 92, -1, -1, 95, 96, 97, 98, 99, 100, - 101, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, -1, -1, -1, 55, 96, 97, - -1, 59, -1, 61, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 75, 76, -1, - -1, 16, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 92, -1, -1, 95, 96, 97, - 98, 99, 100, 101, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 56, -1, -1, - 55, -1, -1, 62, 59, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - 75, 76, -1, -1, 16, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 92, -1, -1, - 95, 96, 97, 98, 99, 100, 101, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 56, -1, -1, 55, -1, -1, 62, 59, -1, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, -1, - -1, -1, -1, 75, 76, -1, -1, -1, -1, -1, - -1, -1, 88, 89, 90, 91, 92, 93, 94, 95, - 92, -1, -1, 95, 96, 97, 98, 99, 100, 101, - 19, -1, -1, 22, 23, -1, 25, 26, 27, 28, - -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, -1, 42, -1, -1, -1, 46, 47, 48, - 49, 50, -1, -1, 53, -1, 55, -1, -1, -1, - -1, -1, -1, -1, 63, 64, 39, 40, -1, 42, - -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, - -1, -1, 55, -1, -1, 58, -1, -1, -1, -1, - 63, 64, -1, -1, -1, -1, -1, 96, 97, -1, - -1, -1, -1, -1, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 52, -1, -1, -1, -1, - 57, -1, -1, 96, 97, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 52, - -1, -1, -1, -1, 57, -1, -1, -1, -1, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 52, -1, -1, -1, -1, 57, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 52, -1, -1, - -1, -1, 57, -1, -1, -1, -1, 62, -1, -1, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 52, -1, 88, 89, 90, 91, 92, 93, 94, - 95, 62, -1, -1, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, -1, 88, 89, 90, - 91, 92, 93, 94, 95, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 52, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 52, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 62, -1, -1, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 52, -1, 88, 89, 90, 91, 92, 93, 94, - 95, 62, -1, -1, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, -1, 88, 89, 90, - 91, 92, 93, 94, 95, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 52, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 57, -1, -1, - -1, -1, 62, -1, -1, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 88, 89, - 90, 91, 92, 93, 94, 95, 60, -1, 62, -1, - -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 88, 89, 90, 91, 92, 93, - 94, 95, 61, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 61, 62, -1, - -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 88, 89, 90, 91, 92, 93, - 94, 95, 61, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 62, -1, -1, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 88, - 89, 90, 91, 92, 93, 94, 95, -1, -1, -1, - -1, -1, 88, 89, 90, 91, 92, 93, 94, 95, - 65, 66, -1, 68, 69, 70, 71, 72, 73, 74, - 65, 66, -1, -1, 69, 70, 71, 72, 73, 74, - -1, -1, -1, 88, 89, 90, 91, 92, 93, 94, - 95, -1, -1, -1, 89, 90, 91, 92, 93, 94, - 95, 65, 66, -1, -1, 69, 70, 71, 72, 73, - 74, 65, 66, -1, -1, -1, -1, 71, 72, 73, - 74, -1, -1, -1, -1, 89, -1, 91, 92, 93, - 94, 95, -1, -1, -1, -1, -1, 91, 92, 93, - 94, 95 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 46, 97, 113, 114, - 115, 116, 117, 118, 119, 120, 189, 96, 97, 190, - 190, 51, 0, 115, 116, 117, 51, 77, 61, 61, - 98, 192, 167, 189, 16, 39, 40, 41, 42, 43, - 44, 45, 47, 48, 49, 50, 51, 55, 59, 75, - 76, 92, 95, 97, 99, 100, 101, 151, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 170, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 52, 52, 57, 55, 189, 190, 55, - 189, 190, 55, 151, 55, 56, 151, 168, 169, 189, - 151, 151, 51, 55, 100, 101, 162, 163, 174, 175, - 177, 178, 182, 183, 184, 185, 189, 190, 97, 61, - 62, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 88, 89, 90, 91, 92, 93, 94, 95, 55, - 58, 164, 165, 189, 51, 59, 61, 53, 126, 189, - 55, 51, 59, 55, 51, 59, 55, 52, 57, 151, - 57, 56, 151, 55, 58, 59, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 46, 97, 188, 168, - 169, 189, 11, 19, 22, 23, 25, 26, 27, 28, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 54, - 55, 63, 64, 121, 122, 124, 125, 126, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 153, 154, 155, 162, 163, 171, 174, 175, 178, - 189, 151, 168, 189, 151, 168, 189, 151, 151, 56, - 151, 151, 189, 60, 56, 52, 51, 12, 121, 123, - 151, 61, 51, 121, 51, 51, 51, 51, 92, 192, - 195, 60, 61, 61, 61, 151, 61, 51, 51, 55, - 172, 173, 174, 175, 189, 178, 178, 54, 122, 61, - 61, 61, 61, 61, 77, 17, 18, 20, 21, 63, - 64, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 56, 52, 51, 56, 52, 51, 56, 57, - 56, 151, 168, 12, 121, 61, 151, 26, 151, 127, - 153, 154, 155, 178, 189, 151, 60, 60, 61, 168, - 168, 56, 57, 151, 51, 51, 51, 51, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 56, - 168, 56, 168, 56, 151, 51, 52, 52, 51, 52, - 61, 29, 57, 52, 52, 52, 173, 151, 151, 151, - 151, 51, 52, 51, 52, 51, 52, 168, 121, 151, - 121, 151, 152, 151, 189, 126, 61, 61, 52, 52, - 57, 52, 57, 52, 57, 168, 168, 168, 52, 24, - 52, 61, 52, 29, 61, 61, 169, 61, 169, 61, - 169, 52, 52, 52, 121, 61, 127, 121, 151, 52, - 52, 52, 52, 52, 61, 61, 61, 121, 121 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 112, 113, 113, 114, 114, 114, 114, 114, 114, - 115, 116, 117, 117, 117, 117, 117, 118, 119, 120, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 122, 122, 123, 123, 124, 124, - 125, 125, 126, 126, 127, 127, 127, 127, 128, 128, - 129, 129, 129, 130, 131, 131, 132, 133, 133, 134, - 134, 135, 136, 137, 138, 139, 140, 141, 141, 142, - 143, 143, 144, 145, 146, 147, 147, 148, 149, 150, - 151, 151, 151, 152, 152, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 154, 154, 155, - 155, 156, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 159, 160, - 160, 160, 160, 161, 162, 162, 163, 163, 164, 164, - 164, 164, 164, 164, 165, 165, 165, 165, 166, 167, - 167, 167, 168, 168, 169, 169, 170, 170, 171, 172, - 172, 173, 173, 173, 174, 175, 176, 177, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 189, 190, - 190, 191, 192, 193, 194, 194, 195, 195, 196, 197 - }; - - 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, 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, 2, 2, - 2, 2, 2, 2, 1, 1, 2, 2, 4, 6, - 5, 7, 5, 7, 8, 9, 9, 9, 3, 3, - 1, 0, 1, 0, 3, 1, 2, 3, 3, 3, - 1, 1, 1, 1, 4, 3, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, - 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 7, 2, 1, 2, 1, 1, 1 - }; - - - - -#if IW5DEBUG - const short - parser::yyrline_[] = - { - 0, 261, 261, 262, 266, 268, 270, 272, 274, 276, - 281, 285, 290, 291, 292, 293, 294, 298, 303, 308, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 340, 341, 345, 347, 352, 354, - 359, 360, 364, 365, 369, 371, 373, 376, 380, 382, - 387, 389, 391, 396, 401, 403, 408, 413, 415, 420, - 422, 427, 432, 437, 442, 447, 452, 457, 459, 464, - 469, 471, 476, 481, 486, 491, 493, 498, 503, 508, - 513, 514, 515, 519, 520, 524, 526, 528, 530, 532, - 534, 536, 538, 540, 542, 544, 546, 551, 553, 558, - 560, 565, 570, 572, 574, 576, 578, 580, 582, 584, - 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, - 629, 630, 631, 632, 633, 634, 635, 636, 640, 645, - 647, 649, 651, 656, 661, 662, 665, 666, 670, 672, - 674, 676, 678, 680, 685, 687, 689, 691, 696, 701, - 703, 706, 710, 713, 717, 719, 724, 726, 731, 736, - 738, 743, 744, 745, 749, 754, 759, 764, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 781, 786, 791, - 796, 801, 806, 811, 816, 821, 826, 831, 833, 838, - 840, 845, 850, 855, 860, 862, 867, 869, 874, 879 - }; - - 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 // IW5DEBUG - - -#line 13 "parser.ypp" -} } } // xsk::gsc::iw5 -#line 4661 "parser.cpp" - -#line 883 "parser.ypp" - - -void xsk::gsc::iw5::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/src/iw5/xsk/parser.hpp b/src/iw5/xsk/parser.hpp deleted file mode 100644 index e7b716ec..00000000 --- a/src/iw5/xsk/parser.hpp +++ /dev/null @@ -1,5550 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// 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::gsc::iw5::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_IW5_PARSER_HPP_INCLUDED -# define YY_IW5_PARSER_HPP_INCLUDED -// "%code requires" blocks. -#line 28 "parser.ypp" - -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw5.hpp" -namespace xsk::gsc::iw5 { class lexer; } - -#line 58 "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 IW5_ASSERT -# include -# define IW5_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 - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# 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 IW5DEBUG -# if defined YYDEBUG -#if YYDEBUG -# define IW5DEBUG 1 -# else -# define IW5DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define IW5DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined IW5DEBUG */ - -#line 13 "parser.ypp" -namespace xsk { namespace gsc { namespace iw5 { -#line 207 "parser.hpp" - - - - - /// A Bison parser. - class parser - { - public: -#ifdef IW5STYPE -# ifdef __GNUC__ -# pragma GCC message "bison: do not #define IW5STYPE in C++, use %define api.value.type" -# endif - typedef IW5STYPE value_type; -#else - /// 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 value_type - { - public: - /// Type of *this. - typedef value_type self_type; - - /// Empty construction. - value_type () YY_NOEXCEPT - : yyraw_ () - , yytypeid_ (YY_NULLPTR) - {} - - /// Construct and fill. - template - value_type (YY_RVREF (T) t) - : yytypeid_ (&typeid (T)) - { - IW5_ASSERT (sizeof (T) <= size); - new (yyas_ ()) T (YY_MOVE (t)); - } - -#if 201103L <= YY_CPLUSPLUS - /// Non copyable. - value_type (const self_type&) = delete; - /// Non copyable. - self_type& operator= (const self_type&) = delete; -#endif - - /// Destruction, allowed only if empty. - ~value_type () YY_NOEXCEPT - { - IW5_ASSERT (!yytypeid_); - } - -# if 201103L <= YY_CPLUSPLUS - /// Instantiate a \a T in here from \a t. - template - T& - emplace (U&&... u) - { - IW5_ASSERT (!yytypeid_); - IW5_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 () - { - IW5_ASSERT (!yytypeid_); - IW5_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) - { - IW5_ASSERT (!yytypeid_); - IW5_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 - { - IW5_ASSERT (yytypeid_); - IW5_ASSERT (*yytypeid_ == typeid (T)); - IW5_ASSERT (sizeof (T) <= size); - return *yyas_ (); - } - - /// Const accessor to a built \a T (for %printer). - template - const T& - as () const YY_NOEXCEPT - { - IW5_ASSERT (yytypeid_); - IW5_ASSERT (*yytypeid_ == typeid (T)); - IW5_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 - { - IW5_ASSERT (yytypeid_); - IW5_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. - value_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 = yyraw_; - return static_cast (yyp); - } - - /// Const accessor to raw memory as \a T. - template - const T* - yyas_ () const YY_NOEXCEPT - { - const void *yyp = 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_tuple - // expr_tuple_types - // expr_object - char dummy6[sizeof (ast::expr)]; - - // expr_add_array - char dummy7[sizeof (ast::expr_add_array::ptr)]; - - // expr_anim - char dummy8[sizeof (ast::expr_anim::ptr)]; - - // expr_animation - char dummy9[sizeof (ast::expr_animation::ptr)]; - - // expr_animtree - char dummy10[sizeof (ast::expr_animtree::ptr)]; - - // expr_arguments - // expr_arguments_no_empty - char dummy11[sizeof (ast::expr_arguments::ptr)]; - - // expr_array - char dummy12[sizeof (ast::expr_array::ptr)]; - - // expr_call - char dummy13[sizeof (ast::expr_call::ptr)]; - - // expr_complement - char dummy14[sizeof (ast::expr_complement::ptr)]; - - // expr_empty_array - char dummy15[sizeof (ast::expr_empty_array::ptr)]; - - // expr_false - char dummy16[sizeof (ast::expr_false::ptr)]; - - // expr_field - char dummy17[sizeof (ast::expr_field::ptr)]; - - // expr_float - char dummy18[sizeof (ast::expr_float::ptr)]; - - // expr_game - char dummy19[sizeof (ast::expr_game::ptr)]; - - // expr_identifier_nosize - // expr_identifier - char dummy20[sizeof (ast::expr_identifier::ptr)]; - - // expr_integer - char dummy21[sizeof (ast::expr_integer::ptr)]; - - // expr_istring - char dummy22[sizeof (ast::expr_istring::ptr)]; - - // expr_level - char dummy23[sizeof (ast::expr_level::ptr)]; - - // expr_method - char dummy24[sizeof (ast::expr_method::ptr)]; - - // expr_negate - char dummy25[sizeof (ast::expr_negate::ptr)]; - - // expr_not - char dummy26[sizeof (ast::expr_not::ptr)]; - - // expr_parameters - char dummy27[sizeof (ast::expr_parameters::ptr)]; - - // expr_paren - char dummy28[sizeof (ast::expr_paren::ptr)]; - - // expr_path - char dummy29[sizeof (ast::expr_path::ptr)]; - - // expr_reference - char dummy30[sizeof (ast::expr_reference::ptr)]; - - // expr_self - char dummy31[sizeof (ast::expr_self::ptr)]; - - // expr_size - char dummy32[sizeof (ast::expr_size::ptr)]; - - // expr_string - char dummy33[sizeof (ast::expr_string::ptr)]; - - // expr_thisthread - char dummy34[sizeof (ast::expr_thisthread::ptr)]; - - // expr_true - char dummy35[sizeof (ast::expr_true::ptr)]; - - // expr_tuple_arguments - char dummy36[sizeof (ast::expr_tuple::ptr)]; - - // expr_undefined - char dummy37[sizeof (ast::expr_undefined::ptr)]; - - // expr_vector - char dummy38[sizeof (ast::expr_vector::ptr)]; - - // include - char dummy39[sizeof (ast::include::ptr)]; - - // program - char dummy40[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy41[sizeof (ast::stmt)]; - - // stmt_assign - char dummy42[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy43[sizeof (ast::stmt_break::ptr)]; - - // stmt_breakpoint - char dummy44[sizeof (ast::stmt_breakpoint::ptr)]; - - // stmt_call - char dummy45[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy46[sizeof (ast::stmt_case::ptr)]; - - // stmt_continue - char dummy47[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy48[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy49[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy50[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy51[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy52[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy53[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy54[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy55[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy56[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy57[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy58[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy59[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy60[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy61[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy62[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy63[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waittill - char dummy64[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy65[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy66[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy67[sizeof (ast::stmt_while::ptr)]; - - // "path" - // "identifier" - // "string literal" - // "localized string" - // "float" - // "integer" - char dummy68[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]; - }; - - /// Whether the content is built: if defined, the name of the stored type. - const std::type_info *yytypeid_; - }; - -#endif - /// Backward compatibility (Bison 3.8). - typedef value_type semantic_type; - - /// Symbol locations. - typedef xsk::gsc::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 - { - IW5EMPTY = -2, - IW5EOF = 0, // "end of file" - IW5error = 1, // error - IW5UNDEF = 2, // "invalid token" - SH_DEFINE = 3, // "#define" - SH_UNDEF = 4, // "#undef" - SH_IFDEF = 5, // "#ifdef" - SH_IFNDEF = 6, // "#ifndef" - SH_IF = 7, // "#if" - SH_ELIF = 8, // "#elif" - SH_ELSE = 9, // "#else" - SH_ENDIF = 10, // "#endif" - DEVBEGIN = 11, // "/#" - DEVEND = 12, // "#/" - INLINE = 13, // "#inline" - INCLUDE = 14, // "#include" - USINGTREE = 15, // "#using_animtree" - ANIMTREE = 16, // "#animtree" - ENDON = 17, // "endon" - NOTIFY = 18, // "notify" - WAIT = 19, // "wait" - WAITTILL = 20, // "waittill" - WAITTILLMATCH = 21, // "waittillmatch" - WAITTILLFRAMEEND = 22, // "waittillframeend" - IF = 23, // "if" - ELSE = 24, // "else" - DO = 25, // "do" - WHILE = 26, // "while" - FOR = 27, // "for" - FOREACH = 28, // "foreach" - IN = 29, // "in" - SWITCH = 30, // "switch" - CASE = 31, // "case" - DEFAULT = 32, // "default" - BREAK = 33, // "break" - CONTINUE = 34, // "continue" - RETURN = 35, // "return" - BREAKPOINT = 36, // "breakpoint" - PROFBEGIN = 37, // "prof_begin" - PROFEND = 38, // "prof_end" - THREAD = 39, // "thread" - CHILDTHREAD = 40, // "childthread" - THISTHREAD = 41, // "thisthread" - CALL = 42, // "call" - TRUE = 43, // "true" - FALSE = 44, // "false" - UNDEFINED = 45, // "undefined" - SIZE = 46, // "size" - GAME = 47, // "game" - SELF = 48, // "self" - ANIM = 49, // "anim" - LEVEL = 50, // "level" - LPAREN = 51, // "(" - RPAREN = 52, // ")" - LBRACE = 53, // "{" - RBRACE = 54, // "}" - LBRACKET = 55, // "[" - RBRACKET = 56, // "]" - COMMA = 57, // "," - DOT = 58, // "." - DOUBLECOLON = 59, // "::" - COLON = 60, // ":" - SEMICOLON = 61, // ";" - QMARK = 62, // "?" - INCREMENT = 63, // "++" - DECREMENT = 64, // "--" - LSHIFT = 65, // "<<" - RSHIFT = 66, // ">>" - OR = 67, // "||" - AND = 68, // "&&" - EQUALITY = 69, // "==" - INEQUALITY = 70, // "!=" - LESS_EQUAL = 71, // "<=" - GREATER_EQUAL = 72, // ">=" - LESS = 73, // "<" - GREATER = 74, // ">" - NOT = 75, // "!" - COMPLEMENT = 76, // "~" - ASSIGN = 77, // "=" - ASSIGN_ADD = 78, // "+=" - ASSIGN_SUB = 79, // "-=" - ASSIGN_MUL = 80, // "*=" - ASSIGN_DIV = 81, // "/=" - ASSIGN_MOD = 82, // "%=" - ASSIGN_BW_OR = 83, // "|=" - ASSIGN_BW_AND = 84, // "&=" - ASSIGN_BW_EXOR = 85, // "^=" - ASSIGN_RSHIFT = 86, // ">>=" - ASSIGN_LSHIFT = 87, // "<<=" - BITWISE_OR = 88, // "|" - BITWISE_AND = 89, // "&" - BITWISE_EXOR = 90, // "^" - ADD = 91, // "+" - SUB = 92, // "-" - MUL = 93, // "*" - DIV = 94, // "/" - MOD = 95, // "%" - PATH = 96, // "path" - IDENTIFIER = 97, // "identifier" - STRING = 98, // "string literal" - ISTRING = 99, // "localized string" - FLOAT = 100, // "float" - INTEGER = 101, // "integer" - SIZEOF = 102, // SIZEOF - ADD_ARRAY = 103, // ADD_ARRAY - THEN = 104, // THEN - TERN = 105, // TERN - NEG = 106, // NEG - ANIMREF = 107, // ANIMREF - PREINC = 108, // PREINC - PREDEC = 109, // PREDEC - POSTINC = 110, // POSTINC - POSTDEC = 111 // POSTDEC - }; - /// Backward compatibility alias (Bison 3.6). - typedef token_kind_type yytokentype; - }; - - /// Token kind, as returned by yylex. - typedef token::token_kind_type 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 = 112, ///< Number of tokens. - S_YYEMPTY = -2, - S_YYEOF = 0, // "end of file" - S_YYerror = 1, // error - S_YYUNDEF = 2, // "invalid token" - S_SH_DEFINE = 3, // "#define" - S_SH_UNDEF = 4, // "#undef" - S_SH_IFDEF = 5, // "#ifdef" - S_SH_IFNDEF = 6, // "#ifndef" - S_SH_IF = 7, // "#if" - S_SH_ELIF = 8, // "#elif" - S_SH_ELSE = 9, // "#else" - S_SH_ENDIF = 10, // "#endif" - S_DEVBEGIN = 11, // "/#" - S_DEVEND = 12, // "#/" - S_INLINE = 13, // "#inline" - S_INCLUDE = 14, // "#include" - S_USINGTREE = 15, // "#using_animtree" - S_ANIMTREE = 16, // "#animtree" - S_ENDON = 17, // "endon" - S_NOTIFY = 18, // "notify" - S_WAIT = 19, // "wait" - S_WAITTILL = 20, // "waittill" - S_WAITTILLMATCH = 21, // "waittillmatch" - S_WAITTILLFRAMEEND = 22, // "waittillframeend" - S_IF = 23, // "if" - S_ELSE = 24, // "else" - S_DO = 25, // "do" - S_WHILE = 26, // "while" - S_FOR = 27, // "for" - S_FOREACH = 28, // "foreach" - S_IN = 29, // "in" - S_SWITCH = 30, // "switch" - S_CASE = 31, // "case" - S_DEFAULT = 32, // "default" - S_BREAK = 33, // "break" - S_CONTINUE = 34, // "continue" - S_RETURN = 35, // "return" - S_BREAKPOINT = 36, // "breakpoint" - S_PROFBEGIN = 37, // "prof_begin" - S_PROFEND = 38, // "prof_end" - S_THREAD = 39, // "thread" - S_CHILDTHREAD = 40, // "childthread" - S_THISTHREAD = 41, // "thisthread" - S_CALL = 42, // "call" - S_TRUE = 43, // "true" - S_FALSE = 44, // "false" - S_UNDEFINED = 45, // "undefined" - S_SIZE = 46, // "size" - S_GAME = 47, // "game" - S_SELF = 48, // "self" - S_ANIM = 49, // "anim" - S_LEVEL = 50, // "level" - S_LPAREN = 51, // "(" - S_RPAREN = 52, // ")" - S_LBRACE = 53, // "{" - S_RBRACE = 54, // "}" - S_LBRACKET = 55, // "[" - S_RBRACKET = 56, // "]" - S_COMMA = 57, // "," - S_DOT = 58, // "." - S_DOUBLECOLON = 59, // "::" - S_COLON = 60, // ":" - S_SEMICOLON = 61, // ";" - S_QMARK = 62, // "?" - S_INCREMENT = 63, // "++" - S_DECREMENT = 64, // "--" - S_LSHIFT = 65, // "<<" - S_RSHIFT = 66, // ">>" - S_OR = 67, // "||" - S_AND = 68, // "&&" - S_EQUALITY = 69, // "==" - S_INEQUALITY = 70, // "!=" - S_LESS_EQUAL = 71, // "<=" - S_GREATER_EQUAL = 72, // ">=" - S_LESS = 73, // "<" - S_GREATER = 74, // ">" - S_NOT = 75, // "!" - S_COMPLEMENT = 76, // "~" - S_ASSIGN = 77, // "=" - S_ASSIGN_ADD = 78, // "+=" - S_ASSIGN_SUB = 79, // "-=" - S_ASSIGN_MUL = 80, // "*=" - S_ASSIGN_DIV = 81, // "/=" - S_ASSIGN_MOD = 82, // "%=" - S_ASSIGN_BW_OR = 83, // "|=" - S_ASSIGN_BW_AND = 84, // "&=" - S_ASSIGN_BW_EXOR = 85, // "^=" - S_ASSIGN_RSHIFT = 86, // ">>=" - S_ASSIGN_LSHIFT = 87, // "<<=" - S_BITWISE_OR = 88, // "|" - S_BITWISE_AND = 89, // "&" - S_BITWISE_EXOR = 90, // "^" - S_ADD = 91, // "+" - S_SUB = 92, // "-" - S_MUL = 93, // "*" - S_DIV = 94, // "/" - S_MOD = 95, // "%" - S_PATH = 96, // "path" - S_IDENTIFIER = 97, // "identifier" - S_STRING = 98, // "string literal" - S_ISTRING = 99, // "localized string" - S_FLOAT = 100, // "float" - S_INTEGER = 101, // "integer" - S_SIZEOF = 102, // SIZEOF - S_ADD_ARRAY = 103, // ADD_ARRAY - S_THEN = 104, // THEN - S_TERN = 105, // TERN - S_NEG = 106, // NEG - S_ANIMREF = 107, // ANIMREF - S_PREINC = 108, // PREINC - S_PREDEC = 109, // PREDEC - S_POSTINC = 110, // POSTINC - S_POSTDEC = 111, // POSTDEC - S_YYACCEPT = 112, // $accept - S_root = 113, // root - S_program = 114, // program - S_inline = 115, // inline - S_include = 116, // include - S_declaration = 117, // declaration - S_decl_usingtree = 118, // decl_usingtree - S_decl_constant = 119, // decl_constant - S_decl_thread = 120, // decl_thread - S_stmt = 121, // stmt - S_stmt_or_dev = 122, // stmt_or_dev - S_stmt_list = 123, // stmt_list - S_stmt_or_dev_list = 124, // stmt_or_dev_list - S_stmt_dev = 125, // stmt_dev - S_stmt_block = 126, // stmt_block - S_stmt_expr = 127, // stmt_expr - S_stmt_call = 128, // stmt_call - S_stmt_assign = 129, // stmt_assign - S_stmt_endon = 130, // stmt_endon - S_stmt_notify = 131, // stmt_notify - S_stmt_wait = 132, // stmt_wait - S_stmt_waittill = 133, // stmt_waittill - S_stmt_waittillmatch = 134, // stmt_waittillmatch - S_stmt_waittillframeend = 135, // stmt_waittillframeend - S_stmt_if = 136, // stmt_if - S_stmt_ifelse = 137, // stmt_ifelse - S_stmt_while = 138, // stmt_while - S_stmt_dowhile = 139, // stmt_dowhile - S_stmt_for = 140, // stmt_for - S_stmt_foreach = 141, // stmt_foreach - S_stmt_switch = 142, // stmt_switch - S_stmt_case = 143, // stmt_case - S_stmt_default = 144, // stmt_default - S_stmt_break = 145, // stmt_break - S_stmt_continue = 146, // stmt_continue - S_stmt_return = 147, // stmt_return - S_stmt_breakpoint = 148, // stmt_breakpoint - S_stmt_prof_begin = 149, // stmt_prof_begin - S_stmt_prof_end = 150, // stmt_prof_end - S_expr = 151, // expr - S_expr_or_empty = 152, // expr_or_empty - S_expr_assign = 153, // expr_assign - S_expr_increment = 154, // expr_increment - S_expr_decrement = 155, // expr_decrement - S_expr_ternary = 156, // expr_ternary - S_expr_binary = 157, // expr_binary - S_expr_primitive = 158, // expr_primitive - S_expr_complement = 159, // expr_complement - S_expr_negate = 160, // expr_negate - S_expr_not = 161, // expr_not - S_expr_call = 162, // expr_call - S_expr_method = 163, // expr_method - S_expr_function = 164, // expr_function - S_expr_pointer = 165, // expr_pointer - S_expr_add_array = 166, // expr_add_array - S_expr_parameters = 167, // expr_parameters - S_expr_arguments = 168, // expr_arguments - S_expr_arguments_no_empty = 169, // expr_arguments_no_empty - S_expr_reference = 170, // expr_reference - S_expr_tuple = 171, // expr_tuple - S_expr_tuple_arguments = 172, // expr_tuple_arguments - S_expr_tuple_types = 173, // expr_tuple_types - S_expr_array = 174, // expr_array - S_expr_field = 175, // expr_field - S_expr_size = 176, // expr_size - S_expr_paren = 177, // expr_paren - S_expr_object = 178, // expr_object - S_expr_thisthread = 179, // expr_thisthread - S_expr_empty_array = 180, // expr_empty_array - S_expr_undefined = 181, // expr_undefined - S_expr_game = 182, // expr_game - S_expr_self = 183, // expr_self - S_expr_anim = 184, // expr_anim - S_expr_level = 185, // expr_level - S_expr_animation = 186, // expr_animation - S_expr_animtree = 187, // expr_animtree - S_expr_identifier_nosize = 188, // expr_identifier_nosize - S_expr_identifier = 189, // expr_identifier - S_expr_path = 190, // expr_path - S_expr_istring = 191, // expr_istring - S_expr_string = 192, // expr_string - S_expr_vector = 193, // expr_vector - S_expr_float = 194, // expr_float - S_expr_integer = 195, // expr_integer - S_expr_false = 196, // expr_false - S_expr_true = 197 // 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 () YY_NOEXCEPT - : 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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_add_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_add_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_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_animtree::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_animtree::ptr& v, const location_type& l) - : 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_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_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_negate::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l) - : 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_thisthread::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_thisthread::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_tuple::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_tuple::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::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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.template destroy< ast::expr_add_array::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_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.template destroy< ast::expr_negate::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_thisthread: // expr_thisthread - value.template destroy< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.template destroy< ast::expr_tuple::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_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_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_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. - value_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 - { - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; - - /// Default constructor. - by_kind () YY_NOEXCEPT; - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that) YY_NOEXCEPT; -#endif - - /// Copy constructor. - by_kind (const by_kind& that) YY_NOEXCEPT; - - /// Constructor from (external) token numbers. - by_kind (kind_type t) YY_NOEXCEPT; - - - - /// 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 () YY_NOEXCEPT {} - - /// Constructor for valueless symbols, and symbols from each type. -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, location_type l) - : super_type (token_kind_type (tok), std::move (l)) -#else - symbol_type (int tok, const location_type& l) - : super_type (token_kind_type (tok), l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - IW5_ASSERT (tok == token::IW5EOF - || (token::IW5error <= tok && tok <= token::MOD) - || (token::SIZEOF <= tok && tok <= token::POSTDEC)); -#endif - } -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, std::string v, location_type l) - : super_type (token_kind_type (tok), std::move (v), std::move (l)) -#else - symbol_type (int tok, const std::string& v, const location_type& l) - : super_type (token_kind_type (tok), v, l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - IW5_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); -#endif - } - }; - - /// Build a parser object. - parser (xsk::gsc::iw5::lexer& lexer_yyarg, xsk::gsc::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 IW5DEBUG - /// 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 token kind. -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW5EOF (location_type l) - { - return symbol_type (token::IW5EOF, std::move (l)); - } -#else - static - symbol_type - make_IW5EOF (const location_type& l) - { - return symbol_type (token::IW5EOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW5error (location_type l) - { - return symbol_type (token::IW5error, std::move (l)); - } -#else - static - symbol_type - make_IW5error (const location_type& l) - { - return symbol_type (token::IW5error, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW5UNDEF (location_type l) - { - return symbol_type (token::IW5UNDEF, std::move (l)); - } -#else - static - symbol_type - make_IW5UNDEF (const location_type& l) - { - return symbol_type (token::IW5UNDEF, 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_ANIMTREE (location_type l) - { - return symbol_type (token::ANIMTREE, std::move (l)); - } -#else - static - symbol_type - make_ANIMTREE (const location_type& l) - { - return symbol_type (token::ANIMTREE, 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_CHILDTHREAD (location_type l) - { - return symbol_type (token::CHILDTHREAD, std::move (l)); - } -#else - static - symbol_type - make_CHILDTHREAD (const location_type& l) - { - return symbol_type (token::CHILDTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_THISTHREAD (location_type l) - { - return symbol_type (token::THISTHREAD, std::move (l)); - } -#else - static - symbol_type - make_THISTHREAD (const location_type& l) - { - return symbol_type (token::THISTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_CALL (location_type l) - { - return symbol_type (token::CALL, std::move (l)); - } -#else - static - symbol_type - make_CALL (const location_type& l) - { - return symbol_type (token::CALL, 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_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_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_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_SIZEOF (location_type l) - { - return symbol_type (token::SIZEOF, std::move (l)); - } -#else - static - symbol_type - make_SIZEOF (const location_type& l) - { - return symbol_type (token::SIZEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_ADD_ARRAY (location_type l) - { - return symbol_type (token::ADD_ARRAY, std::move (l)); - } -#else - static - symbol_type - make_ADD_ARRAY (const location_type& l) - { - return symbol_type (token::ADD_ARRAY, 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) YY_NOEXCEPT; - - /// 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) YY_NOEXCEPT; - - 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_kind_type enum. - static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; - - - - // 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 symbol kind of the accessing symbol of - // state STATE-NUM. - static const unsigned char yystos_[]; - - // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. - static const unsigned char yyr1_[]; - - // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. - static const signed char yyr2_[]; - - -#if IW5DEBUG - // 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT; - - /// Constants. - enum - { - yylast_ = 2371, ///< Last index in yytable_. - yynnts_ = 86, ///< Number of nonterminal symbols. - yyfinal_ = 22 ///< Termination state number. - }; - - - // User arguments. - xsk::gsc::iw5::lexer& lexer; - xsk::gsc::ast::program::ptr& ast; - - }; - - inline - parser::symbol_kind_type - parser::yytranslate_ (int t) YY_NOEXCEPT - { - 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::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_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); - 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_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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 () YY_NOEXCEPT - : kind_ (symbol_kind::S_YYEMPTY) - {} - -#if 201103L <= YY_CPLUSPLUS - inline - parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT - : kind_ (that.kind_) - { - that.clear (); - } -#endif - - inline - parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT - : kind_ (that.kind_) - {} - - inline - parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT - : 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::gsc::iw5 -#line 5546 "parser.hpp" - - - - -#endif // !YY_IW5_PARSER_HPP_INCLUDED diff --git a/src/iw5/xsk/resolver.hpp b/src/iw5/xsk/resolver.hpp deleted file mode 100644 index eda9b798..00000000 --- a/src/iw5/xsk/resolver.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::iw5 -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint16_t; - static auto token_name(std::uint16_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::gsc::iw5 diff --git a/src/iw6/iw6_pc.cpp b/src/iw6/iw6_pc.cpp new file mode 100644 index 00000000..5372beb1 --- /dev/null +++ b/src/iw6/iw6_pc.cpp @@ -0,0 +1,52 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_pc.hpp" + +namespace xsk::gsc::iw6_pc +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::str4, engine::iw6, endian::little, system::pc, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::iw6_pc diff --git a/src/iw6/iw6_pc.hpp b/src/iw6/iw6_pc.hpp new file mode 100644 index 00000000..c41e87a3 --- /dev/null +++ b/src/iw6/iw6_pc.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::iw6_pc +{ +// IW6 PC 3.15.146 +constexpr usize code_count = 153; +constexpr usize func_count = 605; +constexpr usize meth_count = 1066; +constexpr usize token_count = 17657; +constexpr u32 max_string_id = 38305; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::iw6_pc diff --git a/src/iw6/iw6_pc_code.cpp b/src/iw6/iw6_pc_code.cpp new file mode 100644 index 00000000..d0699f3a --- /dev/null +++ b/src/iw6/iw6_pc_code.cpp @@ -0,0 +1,168 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_pc.hpp" + +namespace xsk::gsc::iw6_pc +{ + +extern std::array, code_count> const code_list +{{ + { 0x17, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x18, opcode::OP_EvalSelfFieldVariable }, + { 0x19, opcode::OP_Return }, + { 0x1A, opcode::OP_CallBuiltin0 }, + { 0x1B, opcode::OP_CallBuiltin1 }, + { 0x1C, opcode::OP_CallBuiltin2 }, + { 0x1D, opcode::OP_CallBuiltin3 }, + { 0x1E, opcode::OP_CallBuiltin4 }, + { 0x1F, opcode::OP_CallBuiltin5 }, + { 0x20, opcode::OP_CallBuiltin }, + { 0x21, opcode::OP_BoolNot }, + { 0x22, opcode::OP_ScriptFarMethodThreadCall }, + { 0x23, opcode::OP_JumpOnTrueExpr }, + { 0x24, opcode::OP_SetLevelFieldVariableField }, + { 0x25, opcode::OP_CastBool }, + { 0x26, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x27, opcode::OP_CallBuiltinPointer }, + { 0x28, opcode::OP_inequality }, + { 0x29, opcode::OP_GetThisthread }, + { 0x2A, opcode::OP_ClearFieldVariable }, + { 0x2B, opcode::OP_GetFloat }, + { 0x2C, opcode::OP_SafeCreateVariableFieldCached }, + { 0x2D, opcode::OP_ScriptFarFunctionCall2 }, + { 0x2E, opcode::OP_ScriptFarFunctionCall }, + { 0x2F, opcode::OP_ScriptFarChildThreadCall }, + { 0x30, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x31, opcode::OP_ClearLocalVariableFieldCached }, + { 0x32, opcode::OP_checkclearparams }, + { 0x33, opcode::OP_CastFieldObject }, + { 0x34, opcode::OP_End }, + { 0x35, opcode::OP_size }, + { 0x36, opcode::OP_EmptyArray }, + { 0x37, opcode::OP_bit_and }, + { 0x38, opcode::OP_less_equal }, + { 0x39, opcode::OP_voidCodepos }, + { 0x3A, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3B, opcode::OP_endswitch }, + { 0x3C, opcode::OP_ClearVariableField }, + { 0x3D, opcode::OP_divide }, + { 0x3E, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x3F, opcode::OP_GetUnsignedShort }, + { 0x40, opcode::OP_JumpOnTrue }, + { 0x41, opcode::OP_GetSelf }, + { 0x42, opcode::OP_ScriptFarThreadCall }, + { 0x43, opcode::OP_ScriptLocalThreadCall }, + { 0x44, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x45, opcode::OP_SetLocalVariableFieldCached }, + { 0x46, opcode::OP_plus }, + { 0x47, opcode::OP_BoolComplement }, + { 0x48, opcode::OP_ScriptMethodCallPointer }, + { 0x49, opcode::OP_inc }, + { 0x4A, opcode::OP_RemoveLocalVariables }, + { 0x4B, opcode::OP_JumpOnFalseExpr }, + { 0x4C, opcode::OP_switch }, + { 0x4D, opcode::OP_clearparams }, + { 0x4E, opcode::OP_EvalLocalVariableRefCached0 }, + { 0x4F, opcode::OP_EvalLocalVariableRefCached }, + { 0x50, opcode::OP_ScriptLocalMethodCall }, + { 0x51, opcode::OP_EvalFieldVariable }, + { 0x52, opcode::OP_EvalFieldVariableRef }, + { 0x53, opcode::OP_GetString }, + { 0x54, opcode::OP_ScriptFunctionCallPointer }, + { 0x55, opcode::OP_EvalLevelFieldVariable }, + { 0x56, opcode::OP_GetVector }, + { 0x57, opcode::OP_endon }, + { 0x58, opcode::OP_greater_equal }, + { 0x59, opcode::OP_GetSelfObject }, + { 0x5A, opcode::OP_SetAnimFieldVariableField }, + { 0x5B, opcode::OP_SetVariableField }, + { 0x5C, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x5D, opcode::OP_ScriptLocalFunctionCall }, + { 0x5E, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x5F, opcode::OP_EvalLocalArrayRefCached }, + { 0x60, opcode::OP_GetFarFunction }, + { 0x61, opcode::OP_less }, + { 0x62, opcode::OP_GetGameRef }, + { 0x63, opcode::OP_waittillFrameEnd }, + { 0x64, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x65, opcode::OP_SafeSetVariableFieldCached }, + { 0x66, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x67, opcode::OP_GetLevel }, + { 0x68, opcode::OP_notify }, + { 0x69, opcode::OP_DecTop }, + { 0x6A, opcode::OP_shift_left }, + { 0x6B, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x6C, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x6D, opcode::OP_greater }, + { 0x6E, opcode::OP_EvalLocalVariableCached0 }, + { 0x6F, opcode::OP_EvalLocalVariableCached1 }, + { 0x70, opcode::OP_EvalLocalVariableCached2 }, + { 0x71, opcode::OP_EvalLocalVariableCached3 }, + { 0x72, opcode::OP_EvalLocalVariableCached4 }, + { 0x73, opcode::OP_EvalLocalVariableCached5 }, + { 0x74, opcode::OP_EvalLocalVariableCached }, + { 0x75, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x76, opcode::OP_jump }, + { 0x77, opcode::OP_ScriptThreadCallPointer }, + { 0x78, opcode::OP_GetZero }, + { 0x79, opcode::OP_wait }, + { 0x7A, opcode::OP_minus }, + { 0x7B, opcode::OP_SetSelfFieldVariableField }, + { 0x7C, opcode::OP_EvalNewLocalVariableRefCached0 }, + { 0x7D, opcode::OP_multiply }, + { 0x7E, opcode::OP_CreateLocalVariable }, + { 0x7F, opcode::OP_ScriptLocalChildThreadCall }, + { 0x80, opcode::OP_GetInteger }, + { 0x81, opcode::OP_mod }, + { 0x82, opcode::OP_EvalAnimFieldVariableRef }, + { 0x83, opcode::OP_GetBuiltinFunction }, + { 0x84, opcode::OP_GetGame }, + { 0x85, opcode::OP_waittill }, + { 0x86, opcode::OP_dec }, + { 0x87, opcode::OP_EvalLocalVariableObjectCached }, + { 0x88, opcode::OP_PreScriptCall }, + { 0x89, opcode::OP_GetAnim }, + { 0x8A, opcode::OP_GetUndefined }, + { 0x8B, opcode::OP_EvalLevelFieldVariableRef }, + { 0x8C, opcode::OP_GetAnimObject }, + { 0x8D, opcode::OP_GetLevelObject }, + { 0x8E, opcode::OP_bit_ex_or }, + { 0x8F, opcode::OP_equality }, + { 0x90, opcode::OP_ClearArray }, + { 0x91, opcode::OP_jumpback }, + { 0x92, opcode::OP_GetAnimation }, + { 0x93, opcode::OP_EvalAnimFieldVariable }, + { 0x94, opcode::OP_GetAnimTree }, + { 0x95, opcode::OP_GetIString }, + { 0x96, opcode::OP_EvalArrayRef }, + { 0x97, opcode::OP_EvalSelfFieldVariableRef }, + { 0x98, opcode::OP_GetNegByte }, + { 0x99, opcode::OP_GetBuiltinMethod }, + { 0x9A, opcode::OP_CallBuiltinMethodPointer }, + { 0x9B, opcode::OP_EvalArray }, + { 0x9C, opcode::OP_vector }, + { 0x9D, opcode::OP_ScriptFarMethodCall }, + { 0x9E, opcode::OP_EvalLocalArrayCached }, + { 0x9F, opcode::OP_GetByte }, + { 0xA0, opcode::OP_ScriptChildThreadCallPointer }, + { 0xA1, opcode::OP_bit_or }, + { 0xA2, opcode::OP_AddArray }, + { 0xA3, opcode::OP_waittillmatch2 }, + { 0xA4, opcode::OP_waittillmatch }, + { 0xA5, opcode::OP_GetLocalFunction }, + { 0xA6, opcode::OP_GetNegUnsignedShort }, + { 0xA7, opcode::OP_shift_right }, + { 0xA8, opcode::OP_CallBuiltinMethod0 }, + { 0xA9, opcode::OP_CallBuiltinMethod1 }, + { 0xAA, opcode::OP_CallBuiltinMethod2 }, + { 0xAB, opcode::OP_CallBuiltinMethod3 }, + { 0xAC, opcode::OP_CallBuiltinMethod4 }, + { 0xAD, opcode::OP_CallBuiltinMethod5 }, + { 0xAE, opcode::OP_CallBuiltinMethod }, + { 0xAF, opcode::OP_JumpOnFalse }, +}}; + +} // namespace xsk::gsc::iw6_pc diff --git a/src/iw6/iw6_pc_func.cpp b/src/iw6/iw6_pc_func.cpp new file mode 100644 index 00000000..aef9ea03 --- /dev/null +++ b/src/iw6/iw6_pc_func.cpp @@ -0,0 +1,620 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_pc.hpp" + +namespace xsk::gsc::iw6_pc +{ + +extern std::array, func_count> const func_list +{{ + { 0x001, "precacheturret" }, + { 0x002, "getweaponarray" }, + { 0x003, "createprintchannel" }, + { 0x004, "updategamerprofileall" }, + { 0x005, "clearlocalizedstrings" }, + { 0x006, "setphysicsgravitydir" }, + { 0x007, "gettimescale" }, + { 0x008, "settimescale" }, + { 0x009, "setslowmotionview" }, + { 0x00A, "teleportscene" }, + { 0x00B, "forcesharedammo" }, + { 0x00C, "refreshhudcompass" }, + { 0x00D, "refreshhudammocounter" }, + { 0x00E, "notifyoncommand" }, + { 0x00F, "setprintchannel" }, + { 0x010, "print" }, + { 0x011, "println" }, + { 0x012, "print3d" }, + { 0x013, "line" }, + { 0x014, "box" }, + { 0x015, "orientedbox" }, + { 0x016, "sphere" }, + { 0x017, "cylinder" }, + { 0x018, "spawnturret" }, + { 0x019, "canspawnturret" }, + { 0x01A, "assert" }, + { 0x01B, "pausecinematicingame" }, + { 0x01C, "drawcompassfriendlies" }, + { 0x01D, "bulletspread" }, + { 0x01E, "bullettracer" }, + { 0x01F, "badplace_delete" }, + { 0x020, "badplace_cylinder" }, + { 0x021, "badplace_arc" }, + { 0x022, "badplace_brush" }, + { 0x023, "clearallcorpses" }, + { 0x024, "setturretnode" }, + { 0x025, "unsetturretnode" }, + { 0x026, "setnodepriority" }, + { 0x027, "isnodeoccupied" }, + { 0x028, "setdebugorigin" }, + { 0x029, "setdebugangles" }, + { 0x02A, "updategamerprofile" }, + { 0x02B, "assertex" }, + { 0x02C, "assertmsg" }, + { 0x02D, "isdefined" }, + { 0x02E, "isvalidmissile" }, + { 0x02F, "isstring" }, + { 0x030, "setomnvar" }, + { 0x031, "getomnvar" }, + { 0x032, "setdvar" }, + { 0x033, "setdynamicdvar" }, + { 0x034, "setdvarifuninitialized" }, + { 0x035, "setdevdvar" }, + { 0x036, "setdevdvarifuninitialized" }, + { 0x037, "getdvar" }, + { 0x038, "getdvarint" }, + { 0x039, "getdvarfloat" }, + { 0x03A, "getdvarvector" }, + { 0x03B, "gettime" }, + { 0x03C, "getentbynum" }, + { 0x03D, "getweaponmodel" }, + { 0x03E, "getculldist" }, + { 0x03F, "sethalfresparticles" }, + { 0x040, "getmapsunlight" }, + { 0x041, "setsunlight" }, + { 0x042, "resetsunlight" }, + { 0x043, "getmapsundirection" }, + { 0x044, "getmapsunangles" }, + { 0x045, "setsundirection" }, + { 0x046, "lerpsundirection" }, + { 0x047, "lerpsunangles" }, + { 0x048, "resetsundirection" }, + { 0x049, "enableforcedsunshadows" }, + { 0x04A, "enableforcednosunshadows" }, + { 0x04B, "disableforcedsunshadows" }, + { 0x04C, "enableouterspacemodellighting" }, + { 0x04D, "disableouterspacemodellighting" }, + { 0x04E, "remapstage" }, + { 0x04F, "changelevel" }, + { 0x050, "missionsuccess" }, + { 0x051, "missionfailed" }, + { 0x052, "cinematic" }, + { 0x053, "cinematicingame" }, + { 0x054, "cinematicingamesync" }, + { 0x055, "cinematicingameloop" }, + { 0x056, "cinematicingameloopresident" }, + { 0x057, "iscinematicplaying" }, + { 0x058, "stopcinematicingame" }, + { 0x059, "getweapondisplayname" }, + { 0x05A, "getweaponbasename" }, + { 0x05B, "getweaponattachments" }, + { 0x05C, "getweaponattachmentdisplaynames" }, + { 0x05D, "getweaponcamoname" }, + { 0x05E, "getweaponreticlename" }, + { 0x05F, "getweaponhidetags" }, + { 0x060, "getanimlength" }, + { 0x061, "animhasnotetrack" }, + { 0x062, "getnotetracktimes" }, + { 0x063, "spawn" }, + { 0x064, "spawnloopsound" }, + { 0x065, "spawnloopingsound" }, + { 0x066, "bullettrace" }, + { 0x067, "target_setmaxsize" }, + { 0x068, "target_setcolor" }, + { 0x069, "target_setdelay" }, + { 0x06A, "getstartorigin" }, + { 0x06B, "getstartangles" }, + { 0x06C, "getcycleoriginoffset" }, + { 0x06D, "magicgrenade" }, + { 0x06E, "magicgrenademanual" }, + { 0x06F, "setblur" }, + { 0x070, "musicplay" }, + { 0x071, "musicstop" }, + { 0x072, "soundfade" }, + { 0x073, "soundsettimescalefactor" }, + { 0x074, "soundresettimescale" }, + { 0x075, "setocclusionpreset" }, + { 0x076, "levelsoundfade" }, + { 0x077, "precachenightvisioncodeassets" }, + { 0x078, "precachedigitaldistortcodeassets" }, + { 0x079, "precacheminimapsentrycodeassets" }, + { 0x07A, "savegame" }, + { 0x07B, "issavesuccessful" }, + { 0x07C, "issaverecentlyloaded" }, + { 0x07D, "savegamenocommit" }, + { 0x07E, "commitsave" }, + { 0x07F, "commitwouldbevalid" }, + { 0x080, "getfxvisibility" }, + { 0x081, "setculldist" }, + { 0x082, "bullettracepassed" }, + { 0x083, "sighttracepassed" }, + { 0x084, "physicstrace" }, + { 0x085, "playerphysicstrace" }, + { 0x086, "getgroundposition" }, + { 0x087, "getmovedelta" }, + { 0x088, "getangledelta" }, + { 0x089, "getnorthyaw" }, + { 0x08A, "getcommandfromkey" }, + { 0x08B, "getsticksconfig" }, + { 0x08C, "weaponfightdist" }, + { 0x08D, "weaponmaxdist" }, + { 0x08E, "isturretactive" }, + { 0x08F, "target_alloc" }, + { 0x090, "target_flush" }, + { 0x091, "target_set" }, + { 0x092, "target_remove" }, + { 0x093, "target_setshader" }, + { 0x094, "target_setoffscreenshader" }, + { 0x095, "target_isinrect" }, + { 0x096, "target_isincircle" }, + { 0x097, "target_startreticlelockon" }, + { 0x098, "target_clearreticlelockon" }, + { 0x099, "target_getarray" }, + { 0x09A, "target_istarget" }, + { 0x09B, "target_setattackmode" }, + { 0x09C, "target_setjavelinonly" }, + { 0x09D, "target_hidefromplayer" }, + { 0x09E, "target_showtoplayer" }, + { 0x09F, "target_setscaledrendermode" }, + { 0x0A0, "target_drawcornersonly" }, + { 0x0A1, "target_drawsquare" }, + { 0x0A2, "target_drawsingle" }, + { 0x0A3, "target_setminsize" }, + { 0x0A4, "setnorthyaw" }, + { 0x0A5, "setslowmotion" }, + { 0x0A6, "randomint" }, + { 0x0A7, "randomfloat" }, + { 0x0A8, "randomintrange" }, + { 0x0A9, "randomfloatrange" }, + { 0x0AA, "sin" }, + { 0x0AB, "cos" }, + { 0x0AC, "tan" }, + { 0x0AD, "asin" }, + { 0x0AE, "acos" }, + { 0x0AF, "atan" }, + { 0x0B0, "int" }, + { 0x0B1, "float" }, + { 0x0B2, "abs" }, + { 0x0B3, "min" }, + { 0x0B4, "objective_additionalcurrent" }, + { 0x0B5, "objective_ring" }, + { 0x0B6, "objective_setpointertextoverride" }, + { 0x0B7, "getnode" }, + { 0x0B8, "getnodearray" }, + { 0x0B9, "getallnodes" }, + { 0x0BA, "getnodesinradius" }, + { 0x0BB, "getnodesinradiussorted" }, + { 0x0BC, "getclosestnodeinsight" }, + { 0x0BD, "getreflectionlocs" }, + { 0x0BE, "getreflectionreferencelocs" }, + { 0x0BF, "getvehicletracksegment" }, + { 0x0C0, "getvehicletracksegmentarray" }, + { 0x0C1, "getallvehicletracksegments" }, + { 0x0C2, "isarray" }, + { 0x0C3, "isai" }, + { 0x0C4, "getindexforluincstring" }, + { 0x0C5, "issentient" }, + { 0x0C6, "isgodmode" }, + { 0x0C7, "getdebugdvar" }, + { 0x0C8, "getdebugdvarint" }, + { 0x0C9, "getdebugdvarfloat" }, + { 0x0CA, "setsaveddvar" }, + { 0x0CB, "getfreeaicount" }, + { 0x0CC, "getaicount" }, + { 0x0CD, "getaiarray" }, + { 0x0CE, "getaispeciesarray" }, + { 0x0CF, "getspawnerarray" }, + { 0x0D0, "getcorpsearray" }, + { 0x0D1, "getspawnerteamarray" }, + { 0x0D2, "getweaponclipmodel" }, + { 0x0D3, "getbrushmodelcenter" }, + { 0x0D4, "getkeybinding" }, + { 0x0D5, "max" }, + { 0x0D6, "floor" }, + { 0x0D7, "ceil" }, + { 0x0D8, "exp" }, + { 0x0D9, "log" }, + { 0x0DA, "sqrt" }, + { 0x0DB, "squared" }, + { 0x0DC, "clamp" }, + { 0x0DD, "angleclamp" }, + { 0x0DE, "angleclamp180" }, + { 0x0DF, "vectorfromlinetopoint" }, + { 0x0E0, "pointonsegmentnearesttopoint" }, + { 0x0E1, "distance" }, + { 0x0E2, "distance2d" }, + { 0x0E3, "distancesquared" }, + { 0x0E4, "length" }, + { 0x0E5, "length2d" }, + { 0x0E6, "lengthsquared" }, + { 0x0E7, "length2dsquared" }, + { 0x0E8, "closer" }, + { 0x0E9, "vectordot" }, + { 0x0EA, "vectorcross" }, + { 0x0EB, "axistoangles" }, + { 0x0EC, "visionsetthermal" }, + { 0x0ED, "visionsetpain" }, + { 0x0EE, "endlobby" }, + { 0x0EF, "setac130ambience" }, + { 0x0F0, "getmapcustom" }, + { 0x0F1, "spawnsighttrace" }, + { 0x0F2, "incrementcounter" }, + { 0x0F3, "getcountertotal" }, + { 0x0F4, "getlevelticks" }, + { 0x0F5, "perlinnoise2d" }, + { 0x0F6, "calcrockingangles" }, + { 0x0F7, "reconevent" }, + { 0x0F8, "reconspatialevent" }, + { 0x0F9, "setsunflareposition" }, + { 0x0FA, "createthreatbiasgroup" }, + { 0x0FB, "threatbiasgroupexists" }, + { 0x0FC, "getthreatbias" }, + { 0x0FD, "setthreatbias" }, + { 0x0FE, "setthreatbiasagainstall" }, + { 0x0FF, "setignoremegroup" }, + { 0x100, "isenemyteam" }, + { 0x101, "objective_additionalentity" }, + { 0x102, "objective_state_nomessage" }, + { 0x103, "objective_string" }, + { 0x104, "objective_string_nomessage" }, + { 0x105, "objective_additionalposition" }, + { 0x106, "objective_current_nomessage" }, + { 0x107, "vectornormalize" }, + { 0x108, "vectortoangles" }, + { 0x109, "vectortoyaw" }, + { 0x10A, "vectorlerp" }, + { 0x10B, "anglestoup" }, + { 0x10C, "anglestoright" }, + { 0x10D, "anglestoforward" }, + { 0x10E, "anglesdelta" }, + { 0x10F, "combineangles" }, + { 0x110, "transformmove" }, + { 0x111, "rotatevector" }, + { 0x112, "rotatepointaroundvector" }, + { 0x113, "issubstr" }, + { 0x114, "isendstr" }, + { 0x115, "getsubstr" }, + { 0x116, "tolower" }, + { 0x117, "strtok" }, + { 0x118, "stricmp" }, + { 0x119, "ambientplay" }, + { 0x11A, "getuavstrengthmax" }, + { 0x11B, "getuavstrengthlevelneutral" }, + { 0x11C, "getuavstrengthlevelshowenemyfastsweep" }, + { 0x11D, "getuavstrengthlevelshowenemydirectional" }, + { 0x11E, "blockteamradar" }, + { 0x11F, "unblockteamradar" }, + { 0x120, "isteamradarblocked" }, + { 0x121, "getassignedteam" }, + { 0x122, "setmatchdata" }, + { 0x123, "getmatchdata" }, + { 0x124, "sendmatchdata" }, + { 0x125, "clearmatchdata" }, + { 0x126, "setmatchdatadef" }, + { 0x127, "setmatchclientip" }, + { 0x128, "setmatchdataid" }, + { 0x129, "setclientmatchdata" }, + { 0x12A, "getclientmatchdata" }, + { 0x12B, "setclientmatchdatadef" }, + { 0x12C, "sendclientmatchdata" }, + { 0x12D, "getbuildversion" }, + { 0x12E, "getbuildnumber" }, + { 0x12F, "getsystemtime" }, + { 0x130, "getmatchrulesdata" }, + { 0x131, "isusingmatchrulesdata" }, + { 0x132, "kick" }, + { 0x133, "issplitscreen" }, + { 0x134, "setmapcenter" }, + { 0x135, "setgameendtime" }, + { 0x136, "visionsetnaked" }, + { 0x137, "visionsetnight" }, + { 0x138, "visionsetmissilecam" }, + { 0x139, "ambientstop" }, + { 0x13A, "precachemodel" }, + { 0x13B, "precacheshellshock" }, + { 0x13C, "precacheitem" }, + { 0x13D, "precacheshader" }, + { 0x13E, "precachestring" }, + { 0x13F, "precachemenu" }, + { 0x140, "precacherumble" }, + { 0x141, "precachelocationselector" }, + { 0x142, "precacheleaderboards" }, + { 0x143, "loadfx" }, + { 0x144, "playfx" }, + { 0x145, "playfxontag" }, + { 0x146, "stopfxontag" }, + { 0x147, "killfxontag" }, + { 0x148, "playloopedfx" }, + { 0x149, "spawnfx" }, + { 0x14A, "triggerfx" }, + { 0x14B, "playfxontagforclients" }, + { 0x14C, "setwinningteam" }, + { 0x14D, "announcement" }, + { 0x14E, "clientannouncement" }, + { 0x14F, "setteammode" }, + { 0x150, "getteamscore" }, + { 0x151, "setteamscore" }, + { 0x152, "setclientnamemode" }, + { 0x153, "updateclientnames" }, + { 0x154, "getteamplayersalive" }, + { 0x155, "logprint" }, + { 0x156, "worldentnumber" }, + { 0x157, "obituary" }, + { 0x158, "positionwouldtelefrag" }, + { 0x159, "canspawn" }, + { 0x15A, "getstarttime" }, + { 0x15B, "precachestatusicon" }, + { 0x15C, "precacheheadicon" }, + { 0x15D, "precacheminimapicon" }, + { 0x15E, "precachempanim" }, + { 0x15F, "map_restart" }, + { 0x160, "exitlevel" }, + { 0x161, "addtestclient" }, + { 0x162, "addagent" }, + { 0x163, "setarchive" }, + { 0x164, "allclientsprint" }, + { 0x165, "clientprint" }, + { 0x166, "mapexists" }, + { 0x167, "isvalidgametype" }, + { 0x168, "matchend" }, + { 0x169, "setplayerteamrank" }, + { 0x16A, "endparty" }, + { 0x16B, "setteamradar" }, + { 0x16C, "getteamradar" }, + { 0x16D, "setteamradarstrength" }, + { 0x16E, "getteamradarstrength" }, + { 0x16F, "getuavstrengthmin" }, + { 0x170, "physicsexplosionsphere" }, + { 0x171, "physicsexplosioncylinder" }, + { 0x172, "physicsjolt" }, + { 0x173, "physicsjitter" }, + { 0x174, "setexpfog" }, + { 0x175, "isexplosivedamagemod" }, + { 0x176, "radiusdamage" }, + { 0x177, "setplayerignoreradiusdamage" }, + { 0x178, "glassradiusdamage" }, + { 0x179, "earthquake" }, + { 0x17A, "getnumparts" }, + { 0x17B, "objective_onentity" }, + { 0x17C, "objective_onentitywithrotation" }, + { 0x17D, "objective_team" }, + { 0x17E, "objective_player" }, + { 0x17F, "objective_playerteam" }, + { 0x180, "objective_playerenemyteam" }, + { 0x181, "objective_playermask_hidefromall" }, + { 0x182, "objective_playermask_hidefrom" }, + { 0x183, "objective_playermask_showtoall" }, + { 0x184, "objective_playermask_showto" }, + { 0x185, "iprintln" }, + { 0x186, "iprintlnbold" }, + { 0x187, "logstring" }, + { 0x188, "getent" }, + { 0x189, "getentarray" }, + { 0x18A, "getspawnarray" }, + { 0x18B, "spawnplane" }, + { 0x18C, "spawnstruct" }, + { 0x18D, "spawnhelicopter" }, + { 0x18E, "isalive" }, + { 0x18F, "isspawner" }, + { 0x190, "missile_createattractorent" }, + { 0x191, "missile_createattractororigin" }, + { 0x192, "missile_createrepulsorent" }, + { 0x193, "missile_createrepulsororigin" }, + { 0x194, "missile_deleteattractor" }, + { 0x195, "playsoundatpos" }, + { 0x196, "newhudelem" }, + { 0x197, "newclienthudelem" }, + { 0x198, "newteamhudelem" }, + { 0x199, "resettimeout" }, + { 0x19A, "isplayer" }, + { 0x19B, "isplayernumber" }, + { 0x19C, "getpartname" }, + { 0x19D, "weaponfiretime" }, + { 0x19E, "weaponclipsize" }, + { 0x19F, "weaponisauto" }, + { 0x1A0, "weaponissemiauto" }, + { 0x1A1, "weaponisboltaction" }, + { 0x1A2, "weaponinheritsperks" }, + { 0x1A3, "weaponburstcount" }, + { 0x1A4, "weapontype" }, + { 0x1A5, "weaponclass" }, + { 0x1A6, "getnextarraykey" }, + { 0x1A7, "sortbydistance" }, + { 0x1A8, "tablelookup" }, + { 0x1A9, "tablelookupbyrow" }, + { 0x1AA, "tablelookupistring" }, + { 0x1AB, "tablelookupistringbyrow" }, + { 0x1AC, "tablelookuprownum" }, + { 0x1AD, "tableexists" }, + { 0x1AE, "getmissileowner" }, + { 0x1AF, "magicbullet" }, + { 0x1B0, "getweaponflashtagname" }, + { 0x1B1, "averagepoint" }, + { 0x1B2, "averagenormal" }, + { 0x1B3, "vehicle_getspawnerarray" }, + { 0x1B4, "playrumbleonposition" }, + { 0x1B5, "playrumblelooponposition" }, + { 0x1B6, "stopallrumbles" }, + { 0x1B7, "soundexists" }, + { 0x1B8, "openfile" }, + { 0x1B9, "closefile" }, + { 0x1BA, "fprintln" }, + { 0x1BB, "fprintfields" }, + { 0x1BC, "freadln" }, + { 0x1BD, "fgetarg" }, + { 0x1BE, "setminimap" }, + { 0x1BF, "setthermalbodymaterial" }, + { 0x1C0, "getarraykeys" }, + { 0x1C1, "getfirstarraykey" }, + { 0x1C2, "getglass" }, + { 0x1C3, "getglassarray" }, + { 0x1C4, "getglassorigin" }, + { 0x1C5, "isglassdestroyed" }, + { 0x1C6, "destroyglass" }, + { 0x1C7, "deleteglass" }, + { 0x1C8, "getentchannelscount" }, + { 0x1C9, "getentchannelname" }, + { 0x1CA, "objective_add" }, + { 0x1CB, "objective_delete" }, + { 0x1CC, "objective_state" }, + { 0x1CD, "objective_icon" }, + { 0x1CE, "objective_position" }, + { 0x1CF, "objective_current" }, + { 0x1D0, "weaponinventorytype" }, + { 0x1D1, "weaponstartammo" }, + { 0x1D2, "weaponmaxammo" }, + { 0x1D3, "weaponaltweaponname" }, + { 0x1D4, "isweaponcliponly" }, + { 0x1D5, "isweapondetonationtimed" }, + { 0x1D6, "weaponhasthermalscope" }, + { 0x1D7, "getvehiclenode" }, + { 0x1D8, "getvehiclenodearray" }, + { 0x1D9, "getallvehiclenodes" }, + { 0x1DA, "getnumvehicles" }, + { 0x1DB, "precachevehicle" }, + { 0x1DC, "spawnvehicle" }, + { 0x1DD, "vehicle_getarray" }, + { 0x1DE, "pow" }, + { 0x1DF, "botgetmemoryevents" }, + { 0x1E0, "botautoconnectenabled" }, + { 0x1E1, "botzonegetcount" }, + { 0x1E2, "botzonesetteam" }, + { 0x1E3, "botzonenearestcount" }, + { 0x1E4, "botmemoryflags" }, + { 0x1E5, "botflagmemoryevents" }, + { 0x1E6, "botzonegetindoorpercent" }, + { 0x1E7, "botsentientswap" }, + { 0x1E8, "isbot" }, + { 0x1E9, "isagent" }, + { 0x1EA, "getmaxagents" }, + { 0x1EB, "botdebugdrawtrigger" }, + { 0x1EC, "botgetclosestnavigablepoint" }, + { 0x1ED, "gettnodesintrigger" }, + { 0x1EE, "nodesvisible" }, + { 0x1EF, "getnodesonpath" }, + { 0x1F0, "getzonecount" }, + { 0x1F1, "getzonenearest" }, + { 0x1F2, "getzonenodes" }, + { 0x1F3, "getzonepath" }, + { 0x1F4, "getzoneorigin" }, + { 0x1F5, "getnodezone" }, + { 0x1F6, "getzonenodesbydist" }, + { 0x1F7, "getzonenodeforindex" }, + { 0x1F8, "getweaponexplosionradius" }, + { 0x1F9, "markdangerousnodes" }, + { 0x1FA, "markdangerousnodesintrigger" }, + { 0x1FB, "nodeexposedtosky" }, + { 0x1FC, "findentrances" }, + { 0x1FD, "badplace_global" }, + { 0x1FE, "getpathdist" }, + { 0x1FF, "getlinkednodes" }, + { 0x200, "disconnectnodepair" }, + { 0x201, "connectnodepair" }, + { 0x202, "drawsoundshape" }, + { 0x203, "gettimesincelastpaused" }, + { 0x204, "setlasermaterial" }, + { 0x205, "precachefxontag" }, + { 0x206, "precachetag" }, + { 0x207, "precachesound" }, + { 0x208, "devsetminimapdvarsettings" }, + { 0x209, "loadtransient" }, + { 0x20A, "unloadtransient" }, + { 0x20B, "unloadalltransients" }, + { 0x20C, "synctransients" }, + { 0x20D, "istransientqueued" }, + { 0x20E, "istransientloaded" }, + { 0x20F, "loadstartpointtransient" }, + { 0x210, "distance2dsquared" }, + { 0x211, "getangledelta3d" }, + { 0x212, "activateclientexploder" }, + { 0x213, "trajectorycalculateinitialvelocity" }, + { 0x214, "trajectorycalculateminimumvelocity" }, + { 0x215, "trajectorycalculateexitangle" }, + { 0x216, "trajectoryestimatedesiredinairtime" }, + { 0x217, "trajectorycomputedeltaheightattime" }, + { 0x218, "trajectorycanattemptaccuratejump" }, + { 0x219, "adddebugcommand" }, + { 0x21A, "ispointinvolume" }, + { 0x21B, "cinematicgettimeinmsec" }, + { 0x21C, "cinematicgetframe" }, + { 0x21D, "iscinematicloaded" }, + { 0x21E, "bbprint" }, + { 0x21F, "getenemysquaddata" }, + { 0x220, "lookupsoundlength" }, + { 0x221, "getscriptablearray" }, + { 0x222, "clearfog" }, + { 0x223, "setleveldopplerpreset" }, + { 0x224, "screenshake" }, + { 0x225, "anglestoaxis" }, + { 0x226, "visionsetwater" }, + { 0x227, "sendscriptusageanalysisdata" }, + { 0x228, "resetscriptusageanalysisdata" }, + { 0x229, "instantlylogusageanalysisdata" }, + { 0x22A, "invertangles" }, + { 0x22B, "rotatevectorinverted" }, + { 0x22C, "calculatestartorientation" }, + { 0x22D, "getcsplinecount" }, + { 0x22E, "getcsplinepointcount" }, + { 0x22F, "getcsplinelength" }, + { 0x230, "getcsplinepointid" }, + { 0x231, "getcsplinepointlabel" }, + { 0x232, "getcsplinepointtension" }, + { 0x233, "getcsplinepointposition" }, + { 0x234, "getcsplinepointcorridordims" }, + { 0x235, "getcsplinepointtangent" }, + { 0x236, "getcsplinepointdisttonextpoint" }, + { 0x237, "calccsplineposition" }, + { 0x238, "calccsplinetangent" }, + { 0x239, "calccsplinecorridor" }, + { 0x23A, "setnojipscore" }, + { 0x23B, "setnojiptime" }, + { 0x23C, "getpredictedentityposition" }, + { 0x23D, "gamedvrprohibitrecording" }, + { 0x23E, "gamedvrstartrecording" }, + { 0x23F, "gamedvrstoprecording" }, + { 0x240, "gamedvrsetvideometadata" }, + { 0x241, "gamedvrprohibitscreenshots" }, + { 0x242, "gamedvrsetscreenshotmetadata" }, + { 0x243, "queuedialog" }, + { 0x244, "speechenablegrammar" }, + { 0x245, "speechenable" }, + { 0x246, "livestreamingenable" }, + { 0x247, "livestreamingsetbitrate" }, + { 0x248, "triggerportableradarping" }, + { 0x249, "setglaregrimematerial" }, + { 0x24A, "botgetteamlimit" }, + { 0x24B, "spawnfxforclient" }, + { 0x24C, "botgetteamdifficulty" }, + { 0x24D, "getsquadassaultelo" }, + { 0x24E, "loadluifile" }, + { 0x24F, "isdedicatedserver" }, + { 0x250, "getplaylistversion" }, + { 0x251, "getplaylistid" }, + { 0x252, "getactiveclientcount" }, + { 0x253, "issquadsmode" }, + { 0x254, "getsquadassaultsquadindex" }, + { 0x255, "visionsetpostapply" }, + { 0x256, "addbot" }, + { 0x257, "ishairrunning" }, + { 0x258, "getsquadassaultenemyprestige" }, + { 0x259, "playcinematicforall" }, + { 0x25A, "preloadcinematicforall" }, + { 0x25B, "stopcinematicforall" }, + { 0x25C, "getenemysquaddogtype" }, + { 0x25D, "capsuletracepassed" }, +}}; + +} // namespace xsk::gsc::iw6_pc diff --git a/src/iw6/iw6_pc_meth.cpp b/src/iw6/iw6_pc_meth.cpp new file mode 100644 index 00000000..6e69e63f --- /dev/null +++ b/src/iw6/iw6_pc_meth.cpp @@ -0,0 +1,1081 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_pc.hpp" + +namespace xsk::gsc::iw6_pc +{ + +extern std::array, meth_count> const meth_list +{{ + { 0x8000, "thermaldrawdisable" }, + { 0x8001, "setturretdismountorg" }, + { 0x8002, "setdamagestage" }, + { 0x8003, "playsoundtoteam" }, + { 0x8004, "playsoundtoplayer" }, + { 0x8005, "playerhide" }, + { 0x8006, "showtoplayer" }, + { 0x8007, "enableplayeruse" }, + { 0x8008, "disableplayeruse" }, + { 0x8009, "makescrambler" }, + { 0x800A, "makeportableradar" }, + { 0x800B, "clearscrambler" }, + { 0x800C, "clearportableradar" }, + { 0x800D, "placespawnpoint" }, + { 0x800E, "setteamfortrigger" }, + { 0x800F, "clientclaimtrigger" }, + { 0x8010, "clientreleasetrigger" }, + { 0x8011, "releaseclaimedtrigger" }, + { 0x8012, "isusingonlinedataoffline" }, + { 0x8013, "getrestedtime" }, + { 0x8014, "sendleaderboards" }, + { 0x8015, "isonladder" }, + { 0x8016, "getcorpseanim" }, + { 0x8017, "playerforcedeathanim" }, + { 0x8018, "attach" }, + { 0x8019, "attachshieldmodel" }, + { 0x801A, "getlightfovinner" }, + { 0x801B, "getlightfovouter" }, + { 0x801C, "setlightfovrange" }, + { 0x801D, "getlightexponent" }, + { 0x801E, "setlightexponent" }, + { 0x801F, "startragdoll" }, + { 0x8020, "startragdollfromimpact" }, + { 0x8021, "queryshouldearlyragdoll" }, + { 0x8022, "logstring" }, + { 0x8023, "laserhidefromclient" }, + { 0x8024, "stopsoundchannel" }, + { 0x8025, "thermaldrawenable" }, + { 0x8026, "detach" }, + { 0x8027, "detachshieldmodel" }, + { 0x8028, "moveshieldmodel" }, + { 0x8029, "detachall" }, + { 0x802A, "getattachsize" }, + { 0x802B, "getattachmodelname" }, + { 0x802C, "getattachtagname" }, + { 0x802D, "setturretcanaidetach" }, + { 0x802E, "setturretfov" }, + { 0x802F, "lerpfov" }, + { 0x8030, "getvalidcoverpeekouts" }, + { 0x8031, "gethighestnodestance" }, + { 0x8032, "doesnodeallowstance" }, + { 0x8033, "getgunangles" }, + { 0x8034, "magicgrenade" }, + { 0x8035, "magicgrenademanual" }, + { 0x8036, "getentnum" }, + { 0x8037, "launch" }, + { 0x8038, "setsoundblend" }, + { 0x8039, "makefakeai" }, + { 0x803A, "spawndrone" }, + { 0x803B, "setcorpseremovetimer" }, + { 0x803C, "setlookattext" }, + { 0x803D, "setspawnerteam" }, + { 0x803E, "addaieventlistener" }, + { 0x803F, "removeaieventlistener" }, + { 0x8040, "getlightcolor" }, + { 0x8041, "setlightcolor" }, + { 0x8042, "getlightradius" }, + { 0x8043, "setlightradius" }, + { 0x8044, "getattachignorecollision" }, + { 0x8045, "hidepart" }, + { 0x8046, "hidepart_allinstances" }, + { 0x8047, "hideallparts" }, + { 0x8048, "showpart" }, + { 0x8049, "showallparts" }, + { 0x804A, "linkto" }, + { 0x804B, "linktoblendtotag" }, + { 0x804C, "unlink" }, + { 0x804D, "setnormalhealth" }, + { 0x804E, "dodamage" }, + { 0x804F, "kill" }, + { 0x8050, "show" }, + { 0x8051, "hide" }, + { 0x8052, "showonclient" }, + { 0x8053, "hideonclient" }, + { 0x8054, "laserforceon" }, + { 0x8055, "laserforceoff" }, + { 0x8056, "disconnectpaths" }, + { 0x8057, "connectpaths" }, + { 0x8058, "disconnectnode" }, + { 0x8059, "connectnode" }, + { 0x805A, "startusingheroonlylighting" }, + { 0x805B, "stopusingheroonlylighting" }, + { 0x805C, "startusinglessfrequentlighting" }, + { 0x805D, "stopusinglessfrequentlighting" }, + { 0x805E, "setmovingplatformplayerturnrate" }, + { 0x805F, "setthermalfog" }, + { 0x8060, "setnightvisionfog" }, + { 0x8061, "clearthermalfog" }, + { 0x8062, "clearnightvisionfog" }, + { 0x8063, "digitaldistortsetparams" }, + { 0x8064, "setmode" }, + { 0x8065, "getmode" }, + { 0x8066, "setturretignoregoals" }, + { 0x8067, "islinked" }, + { 0x8068, "enablelinkto" }, + { 0x8069, "playsoundatviewheight" }, + { 0x806A, "prefetchsound" }, + { 0x806B, "setpitch" }, + { 0x806C, "scalepitch" }, + { 0x806D, "setvolume" }, + { 0x806E, "scalevolume" }, + { 0x806F, "setspeakermapmonotostereo" }, + { 0x8070, "setspeakermapmonoto51" }, + { 0x8071, "setdistributed2dsound" }, + { 0x8072, "playsoundasmaster" }, + { 0x8073, "playloopsound" }, + { 0x8074, "eqon" }, + { 0x8075, "eqoff" }, + { 0x8076, "haseq" }, + { 0x8077, "iswaitingonsound" }, + { 0x8078, "getnormalhealth" }, + { 0x8079, "playerlinkto" }, + { 0x807A, "playerlinktodelta" }, + { 0x807B, "playerlinkweaponviewtodelta" }, + { 0x807C, "playerlinktoabsolute" }, + { 0x807D, "playerlinktoblend" }, + { 0x807E, "playerlinkedoffsetenable" }, + { 0x807F, "setwaypointedgestyle_secondaryarrow" }, + { 0x8080, "setwaypointiconoffscreenonly" }, + { 0x8081, "fadeovertime" }, + { 0x8082, "scaleovertime" }, + { 0x8083, "moveovertime" }, + { 0x8084, "reset" }, + { 0x8085, "destroy" }, + { 0x8086, "setpulsefx" }, + { 0x8087, "setplayernamestring" }, + { 0x8088, "changefontscaleovertime" }, + { 0x8089, "startignoringspotlight" }, + { 0x808A, "stopignoringspotlight" }, + { 0x808B, "dontcastshadows" }, + { 0x808C, "castshadows" }, + { 0x808D, "setstablemissile" }, + { 0x808E, "playersetgroundreferenceent" }, + { 0x808F, "dontinterpolate" }, + { 0x8090, "dospawn" }, + { 0x8091, "stalingradspawn" }, + { 0x8092, "getorigin" }, + { 0x8093, "getcentroid" }, + { 0x8094, "getshootatpos" }, + { 0x8095, "getdebugeye" }, + { 0x8096, "useby" }, + { 0x8097, "playsound" }, + { 0x8098, "playerlinkedoffsetdisable" }, + { 0x8099, "playerlinkedsetviewznear" }, + { 0x809A, "playerlinkedsetusebaseangleforviewclamp" }, + { 0x809B, "lerpviewangleclamp" }, + { 0x809C, "setviewangleresistance" }, + { 0x809D, "springcamenabled" }, + { 0x809E, "springcamdisabled" }, + { 0x809F, "linktoplayerview" }, + { 0x80A0, "unlinkfromplayerview" }, + { 0x80A1, "geteye" }, + { 0x80A2, "istouching" }, + { 0x80A3, "getistouchingentities" }, + { 0x80A4, "stoploopsound" }, + { 0x80A5, "stopsounds" }, + { 0x80A6, "playrumbleonentity" }, + { 0x80A7, "playrumblelooponentity" }, + { 0x80A8, "stoprumble" }, + { 0x80A9, "delete" }, + { 0x80AA, "setmodel" }, + { 0x80AB, "laseron" }, + { 0x80AC, "laseroff" }, + { 0x80AD, "laseraltviewon" }, + { 0x80AE, "laseraltviewoff" }, + { 0x80AF, "thermalvisionon" }, + { 0x80B0, "thermalvisiononshadowoff" }, + { 0x80B1, "thermalvisionoff" }, + { 0x80B2, "thermalvisionfofoverlayon" }, + { 0x80B3, "thermalvisionfofoverlayoff" }, + { 0x80B4, "autospotoverlayon" }, + { 0x80B5, "autospotoverlayoff" }, + { 0x80B6, "seteyesonuplinkenabled" }, + { 0x80B7, "setcontents" }, + { 0x80B8, "makeusable" }, + { 0x80B9, "makeunusable" }, + { 0x80BA, "setwhizbyprobabilities" }, + { 0x80BB, "visionsetnakedforplayer_lerp" }, + { 0x80BC, "setwaitnode" }, + { 0x80BD, "returnplayercontrol" }, + { 0x80BE, "vehphys_starttrack" }, + { 0x80BF, "vehphys_clearautodisable" }, + { 0x80C0, "vehicleusealtblendedaudio" }, + { 0x80C1, "settext" }, + { 0x80C2, "clearalltextafterhudelem" }, + { 0x80C3, "setshader" }, + { 0x80C4, "settargetent" }, + { 0x80C5, "cleartargetent" }, + { 0x80C6, "settimer" }, + { 0x80C7, "settimerup" }, + { 0x80C8, "settimerstatic" }, + { 0x80C9, "settenthstimer" }, + { 0x80CA, "settenthstimerup" }, + { 0x80CB, "settenthstimerstatic" }, + { 0x80CC, "setclock" }, + { 0x80CD, "setclockup" }, + { 0x80CE, "setvalue" }, + { 0x80CF, "setwaypoint" }, + { 0x80D0, "setwaypointedgestyle_rotatingicon" }, + { 0x80D1, "setcursorhint" }, + { 0x80D2, "sethintstring" }, + { 0x80D3, "forceusehinton" }, + { 0x80D4, "forceusehintoff" }, + { 0x80D5, "makesoft" }, + { 0x80D6, "makehard" }, + { 0x80D7, "willneverchange" }, + { 0x80D8, "startfiring" }, + { 0x80D9, "stopfiring" }, + { 0x80DA, "isfiringturret" }, + { 0x80DB, "startbarrelspin" }, + { 0x80DC, "stopbarrelspin" }, + { 0x80DD, "getbarrelspinrate" }, + { 0x80DE, "remotecontrolturret" }, + { 0x80DF, "remotecontrolturretoff" }, + { 0x80E0, "shootturret" }, + { 0x80E1, "getturretowner" }, + { 0x80E2, "enabledeathshield" }, + { 0x80E3, "nightvisiongogglesforceon" }, + { 0x80E4, "nightvisiongogglesforceoff" }, + { 0x80E5, "enableinvulnerability" }, + { 0x80E6, "disableinvulnerability" }, + { 0x80E7, "enablebreaching" }, + { 0x80E8, "disablebreaching" }, + { 0x80E9, "forceviewmodelanimation" }, + { 0x80EA, "disableturretdismount" }, + { 0x80EB, "enableturretdismount" }, + { 0x80EC, "uploadscore" }, + { 0x80ED, "uploadtime" }, + { 0x80EE, "uploadleaderboards" }, + { 0x80EF, "giveachievement" }, + { 0x80F0, "hidehud" }, + { 0x80F1, "showhud" }, + { 0x80F2, "mountvehicle" }, + { 0x80F3, "dismountvehicle" }, + { 0x80F4, "enableslowaim" }, + { 0x80F5, "disableslowaim" }, + { 0x80F6, "usehintsinvehicle" }, + { 0x80F7, "vehicleattackbuttonpressed" }, + { 0x80F8, "setwhizbyoffset" }, + { 0x80F9, "setsentryowner" }, + { 0x80FA, "setsentrycarrier" }, + { 0x80FB, "setturretminimapvisible" }, + { 0x80FC, "settargetentity" }, + { 0x80FD, "snaptotargetentity" }, + { 0x80FE, "cleartargetentity" }, + { 0x80FF, "getturrettarget" }, + { 0x8100, "setplayerspread" }, + { 0x8101, "setaispread" }, + { 0x8102, "setsuppressiontime" }, + { 0x8103, "setflaggedanimknobrestart" }, + { 0x8104, "setflaggedanimknoblimitedrestart" }, + { 0x8105, "setflaggedanimknoball" }, + { 0x8106, "setflaggedanimknoballrestart" }, + { 0x8107, "setflaggedanim" }, + { 0x8108, "setflaggedanimlimited" }, + { 0x8109, "setflaggedanimrestart" }, + { 0x810A, "setflaggedanimlimitedrestart" }, + { 0x810B, "useanimtree" }, + { 0x810C, "stopuseanimtree" }, + { 0x810D, "setanimtime" }, + { 0x810E, "showviewmodel" }, + { 0x810F, "hideviewmodel" }, + { 0x8110, "allowstand" }, + { 0x8111, "allowcrouch" }, + { 0x8112, "allowprone" }, + { 0x8113, "allowlean" }, + { 0x8114, "allowswim" }, + { 0x8115, "setocclusion" }, + { 0x8116, "setocclusionfromtable" }, + { 0x8117, "deactivateocclusion" }, + { 0x8118, "deactivateallocclusion" }, + { 0x8119, "isocclusionenabled" }, + { 0x811A, "setreverbfromtable" }, + { 0x811B, "setvolmodfromtable" }, + { 0x811C, "settimescalefactorfromtable" }, + { 0x811D, "setwhizbyfromtable" }, + { 0x811E, "seteqfromtable" }, + { 0x811F, "iseqenabled" }, + { 0x8120, "seteq" }, + { 0x8121, "seteqbands" }, + { 0x8122, "deactivateeq" }, + { 0x8123, "seteqlerp" }, + { 0x8124, "islookingat" }, + { 0x8125, "isthrowinggrenade" }, + { 0x8126, "isfiring" }, + { 0x8127, "ismeleeing" }, + { 0x8128, "setautopickup" }, + { 0x8129, "allowmelee" }, + { 0x812A, "allowfire" }, + { 0x812B, "enablehealthshield" }, + { 0x812C, "setconvergencetime" }, + { 0x812D, "setconvergenceheightpercent" }, + { 0x812E, "setturretteam" }, + { 0x812F, "maketurretsolid" }, + { 0x8130, "maketurretoperable" }, + { 0x8131, "maketurretinoperable" }, + { 0x8132, "makeentitysentient" }, + { 0x8133, "freeentitysentient" }, + { 0x8134, "isindoor" }, + { 0x8135, "getdroptofloorposition" }, + { 0x8136, "isbadguy" }, + { 0x8137, "animscripted" }, + { 0x8138, "animscriptedthirdperson" }, + { 0x8139, "animrelative" }, + { 0x813A, "stopanimscripted" }, + { 0x813B, "clearanim" }, + { 0x813C, "setanimknob" }, + { 0x813D, "setanimknoblimited" }, + { 0x813E, "setanimknobrestart" }, + { 0x813F, "setanimknoblimitedrestart" }, + { 0x8140, "setanimknoball" }, + { 0x8141, "setanimknoballlimited" }, + { 0x8142, "setanimknoballrestart" }, + { 0x8143, "setanimknoballlimitedrestart" }, + { 0x8144, "setanim" }, + { 0x8145, "setanimlimited" }, + { 0x8146, "setanimrestart" }, + { 0x8147, "setanimlimitedrestart" }, + { 0x8148, "getanimtime" }, + { 0x8149, "getanimweight" }, + { 0x814A, "getanimassettype" }, + { 0x814B, "setflaggedanimknob" }, + { 0x814C, "setflaggedanimknoblimited" }, + { 0x814D, "setturretaccuracy" }, + { 0x814E, "setrightarc" }, + { 0x814F, "setleftarc" }, + { 0x8150, "settoparc" }, + { 0x8151, "setbottomarc" }, + { 0x8152, "setautorotationdelay" }, + { 0x8153, "setdefaultdroppitch" }, + { 0x8154, "restoredefaultdroppitch" }, + { 0x8155, "turretfiredisable" }, + { 0x8156, "getfixednodesafevolume" }, + { 0x8157, "clearfixednodesafevolume" }, + { 0x8158, "isingoal" }, + { 0x8159, "setruntopos" }, + { 0x815A, "nearnode" }, + { 0x815B, "nearclaimnode" }, + { 0x815C, "nearclaimnodeandangle" }, + { 0x815D, "atdangerousnode" }, + { 0x815E, "getenemyinfo" }, + { 0x815F, "clearenemy" }, + { 0x8160, "setentitytarget" }, + { 0x8161, "clearentitytarget" }, + { 0x8162, "setpotentialthreat" }, + { 0x8163, "clearpotentialthreat" }, + { 0x8164, "setflashbanged" }, + { 0x8165, "setengagementmindist" }, + { 0x8166, "setengagementmaxdist" }, + { 0x8167, "isknownenemyinradius" }, + { 0x8168, "isknownenemyinvolume" }, + { 0x8169, "settalktospecies" }, + { 0x816A, "laseralton" }, + { 0x816B, "laseraltoff" }, + { 0x816C, "invisiblenotsolid" }, + { 0x816D, "visiblesolid" }, + { 0x816E, "setdefaultaimlimits" }, + { 0x816F, "initriotshieldhealth" }, + { 0x8170, "getenemysqdist" }, + { 0x8171, "getclosestenemysqdist" }, + { 0x8172, "setthreatbiasgroup" }, + { 0x8173, "getthreatbiasgroup" }, + { 0x8174, "turretfireenable" }, + { 0x8175, "setturretmodechangewait" }, + { 0x8176, "usetriggerrequirelookat" }, + { 0x8177, "getstance" }, + { 0x8178, "setstance" }, + { 0x8179, "itemweaponsetammo" }, + { 0x817A, "getammocount" }, + { 0x817B, "gettagorigin" }, + { 0x817C, "gettagangles" }, + { 0x817D, "shellshock" }, + { 0x817E, "stunplayer" }, + { 0x817F, "stopshellshock" }, + { 0x8180, "fadeoutshellshock" }, + { 0x8181, "setdepthoffield" }, + { 0x8182, "setviewmodeldepthoffield" }, + { 0x8183, "setmotionblurmovescale" }, + { 0x8184, "pickupgrenade" }, + { 0x8185, "useturret" }, + { 0x8186, "stopuseturret" }, + { 0x8187, "canuseturret" }, + { 0x8188, "traversemode" }, + { 0x8189, "animmode" }, + { 0x818A, "orientmode" }, + { 0x818B, "getmotionangle" }, + { 0x818C, "shouldfacemotion" }, + { 0x818D, "getanglestolikelyenemypath" }, + { 0x818E, "setturretanim" }, + { 0x818F, "getturret" }, + { 0x8190, "getgroundenttype" }, + { 0x8191, "forcestartnegotiation" }, + { 0x8192, "setalienjumpcostscale" }, + { 0x8193, "setalienruncostscale" }, + { 0x8194, "setalientraversecostscale" }, + { 0x8195, "animcustom" }, + { 0x8196, "isinscriptedstate" }, + { 0x8197, "canattackenemynode" }, + { 0x8198, "getnegotiationstartnode" }, + { 0x8199, "getnegotiationendnode" }, + { 0x819A, "getnegotiationnextnode" }, + { 0x819B, "getdoorpathnode" }, + { 0x819C, "comparenodedirtopathdir" }, + { 0x819D, "checkprone" }, + { 0x819E, "pushplayer" }, + { 0x819F, "checkgrenadethrowpos" }, + { 0x81A0, "setgoalnode" }, + { 0x81A1, "setgoalpos" }, + { 0x81A2, "setgoalentity" }, + { 0x81A3, "setgoalvolume" }, + { 0x81A4, "setgoalvolumeauto" }, + { 0x81A5, "getgoalvolume" }, + { 0x81A6, "cleargoalvolume" }, + { 0x81A7, "setfixednodesafevolume" }, + { 0x81A8, "setmotionblurturnscale" }, + { 0x81A9, "setmotionblurzoomscale" }, + { 0x81AA, "viewkick" }, + { 0x81AB, "localtoworldcoords" }, + { 0x81AC, "getentitynumber" }, + { 0x81AD, "getentityvelocity" }, + { 0x81AE, "enablegrenadetouchdamage" }, + { 0x81AF, "disablegrenadetouchdamage" }, + { 0x81B0, "enableaimassist" }, + { 0x81B1, "setlookatyawlimits" }, + { 0x81B2, "stoplookat" }, + { 0x81B3, "getmuzzlepos" }, + { 0x81B4, "getmuzzleangle" }, + { 0x81B5, "getmuzzlesideoffsetpos" }, + { 0x81B6, "getaimangle" }, + { 0x81B7, "canshoot" }, + { 0x81B8, "canshootenemy" }, + { 0x81B9, "cansee" }, + { 0x81BA, "seerecently" }, + { 0x81BB, "lastknowntime" }, + { 0x81BC, "lastknownpos" }, + { 0x81BD, "dropweapon" }, + { 0x81BE, "maymovetopoint" }, + { 0x81BF, "maymovefrompointtopoint" }, + { 0x81C0, "teleport" }, + { 0x81C1, "forceteleport" }, + { 0x81C2, "safeteleport" }, + { 0x81C3, "withinapproxpathdist" }, + { 0x81C4, "ispathdirect" }, + { 0x81C5, "allowedstances" }, + { 0x81C6, "isstanceallowed" }, + { 0x81C7, "issuppressionwaiting" }, + { 0x81C8, "issuppressed" }, + { 0x81C9, "ismovesuppressed" }, + { 0x81CA, "isgrenadepossafe" }, + { 0x81CB, "checkgrenadethrow" }, + { 0x81CC, "checkgrenadelaunch" }, + { 0x81CD, "checkgrenadelaunchpos" }, + { 0x81CE, "throwgrenade" }, + { 0x81CF, "disableaimassist" }, + { 0x81D0, "radiusdamage" }, + { 0x81D1, "detonate" }, + { 0x81D2, "damageconetrace" }, + { 0x81D3, "sightconetrace" }, + { 0x81D4, "missile_settargetent" }, + { 0x81D5, "missile_settargetpos" }, + { 0x81D6, "missile_cleartarget" }, + { 0x81D7, "missile_setflightmodedirect" }, + { 0x81D8, "missile_setflightmodetop" }, + { 0x81D9, "getlightintensity" }, + { 0x81DA, "setlightintensity" }, + { 0x81DB, "isragdoll" }, + { 0x81DC, "setmovespeedscale" }, + { 0x81DD, "cameralinkto" }, + { 0x81DE, "cameraunlink" }, + { 0x81DF, "startcoverarrival" }, + { 0x81E0, "starttraversearrival" }, + { 0x81E1, "checkcoverexitposwithpath" }, + { 0x81E2, "shoot" }, + { 0x81E3, "shootblank" }, + { 0x81E4, "melee" }, + { 0x81E5, "updateplayersightaccuracy" }, + { 0x81E6, "findshufflecovernode" }, + { 0x81E7, "findnearbycovernode" }, + { 0x81E8, "findcovernode" }, + { 0x81E9, "findbestcovernode" }, + { 0x81EA, "getcovernode" }, + { 0x81EB, "usecovernode" }, + { 0x81EC, "iscovervalidagainstenemy" }, + { 0x81ED, "reacquirestep" }, + { 0x81EE, "findreacquiredirectpath" }, + { 0x81EF, "trimpathtoattack" }, + { 0x81F0, "reacquiremove" }, + { 0x81F1, "findreacquireproximatepath" }, + { 0x81F2, "flagenemyunattackable" }, + { 0x81F3, "enterprone" }, + { 0x81F4, "exitprone" }, + { 0x81F5, "setproneanimnodes" }, + { 0x81F6, "updateprone" }, + { 0x81F7, "clearpitchorient" }, + { 0x81F8, "setlookatanimnodes" }, + { 0x81F9, "setlookat" }, + { 0x81FA, "setlookatentity" }, + { 0x81FB, "controlslinkto" }, + { 0x81FC, "controlsunlink" }, + { 0x81FD, "makevehiclesolidcapsule" }, + { 0x81FE, "teleportentityrelative" }, + { 0x81FF, "makevehiclesolidsphere" }, + { 0x8200, "makevehiclesolid" }, + { 0x8201, "remotecontrolvehicle" }, + { 0x8202, "remotecontrolvehicleoff" }, + { 0x8203, "isfiringvehicleturret" }, + { 0x8204, "remotecontrolvehicletarget" }, + { 0x8205, "remotecontrolvehicletargetoff" }, + { 0x8206, "drivevehicleandcontrolturret" }, + { 0x8207, "drivevehicleandcontrolturretoff" }, + { 0x8208, "getplayersetting" }, + { 0x8209, "getlocalplayerprofiledata" }, + { 0x820A, "setlocalplayerprofiledata" }, + { 0x820B, "remotecamerasoundscapeon" }, + { 0x820C, "remotecamerasoundscapeoff" }, + { 0x820D, "setmotiontrackervisible" }, + { 0x820E, "getmotiontrackervisible" }, + { 0x820F, "worldpointinreticle_circle" }, + { 0x8210, "worldpointinreticle_rect" }, + { 0x8211, "getpointinbounds" }, + { 0x8212, "transfermarkstonewscriptmodel" }, + { 0x8213, "setwatersheeting" }, + { 0x8214, "addontoviewmodel" }, + { 0x8215, "clearviewmodeladdons" }, + { 0x8216, "setweaponhudiconoverride" }, + { 0x8217, "getweaponhudiconoverride" }, + { 0x8218, "setempjammed" }, + { 0x8219, "playersetexpfog" }, + { 0x821A, "isitemunlocked" }, + { 0x821B, "getplayerdata" }, + { 0x821C, "getrankedplayerdata" }, + { 0x821D, "getprivateplayerdata" }, + { 0x821E, "getcoopplayerdata" }, + { 0x821F, "getcommonplayerdata" }, + { 0x8220, "vehicleturretcontroloff" }, + { 0x8221, "isturretready" }, + { 0x8222, "vehicledriveto" }, + { 0x8223, "vehicle_dospawn" }, + { 0x8224, "vehicle_isphysveh" }, + { 0x8225, "vehphys_crash" }, + { 0x8226, "vehphys_launch" }, + { 0x8227, "vehphys_disablecrashing" }, + { 0x8228, "vehphys_enablecrashing" }, + { 0x8229, "vehphys_setspeed" }, + { 0x822A, "vehphys_setconveyorbelt" }, + { 0x822B, "freehelicopter" }, + { 0x822C, "playerlinkedturretanglesenable" }, + { 0x822D, "playerlinkedturretanglesdisable" }, + { 0x822E, "playersetstreamorigin" }, + { 0x822F, "playerclearstreamorigin" }, + { 0x8230, "nightvisionviewon" }, + { 0x8231, "nightvisionviewoff" }, + { 0x8232, "painvisionon" }, + { 0x8233, "painvisionoff" }, + { 0x8234, "getplayerintelisfound" }, + { 0x8235, "setplayerintelfound" }, + { 0x8236, "newpip" }, + { 0x8237, "sethuddynlight" }, + { 0x8238, "startscriptedanim" }, + { 0x8239, "startcoverbehavior" }, + { 0x823A, "setplayerdata" }, + { 0x823B, "setrankedplayerdata" }, + { 0x823C, "setprivateplayerdata" }, + { 0x823D, "setcoopplayerdata" }, + { 0x823E, "setcommonplayerdata" }, + { 0x823F, "getcacplayerdata" }, + { 0x8240, "trackerupdate" }, + { 0x8241, "pingplayer" }, + { 0x8242, "buttonpressed" }, + { 0x8243, "sayall" }, + { 0x8244, "sayteam" }, + { 0x8245, "setspawnweapon" }, + { 0x8246, "dropitem" }, + { 0x8247, "dropscavengerbag" }, + { 0x8248, "setjitterparams" }, + { 0x8249, "sethoverparams" }, + { 0x824A, "joltbody" }, + { 0x824B, "freevehicle" }, + { 0x824C, "getwheelsurface" }, + { 0x824D, "getvehicleowner" }, + { 0x824E, "setvehiclelookattext" }, + { 0x824F, "setvehicleteam" }, + { 0x8250, "setneargoalnotifydist" }, + { 0x8251, "setvehgoalpos" }, + { 0x8252, "setgoalyaw" }, + { 0x8253, "cleargoalyaw" }, + { 0x8254, "settargetyaw" }, + { 0x8255, "cleartargetyaw" }, + { 0x8256, "vehicle_helisetai" }, + { 0x8257, "setturrettargetvec" }, + { 0x8258, "setturrettargetent" }, + { 0x8259, "clearturrettarget" }, + { 0x825A, "vehicle_canturrettargetpoint" }, + { 0x825B, "setlookatent" }, + { 0x825C, "clearlookatent" }, + { 0x825D, "setvehweapon" }, + { 0x825E, "fireweapon" }, + { 0x825F, "vehicleturretcontrolon" }, + { 0x8260, "finishplayerdamage" }, + { 0x8261, "suicide" }, + { 0x8262, "closeingamemenu" }, + { 0x8263, "iprintln" }, + { 0x8264, "iprintlnbold" }, + { 0x8265, "spawn" }, + { 0x8266, "setentertime" }, + { 0x8267, "cloneplayer" }, + { 0x8268, "istalking" }, + { 0x8269, "allowspectateteam" }, + { 0x826A, "getguid" }, + { 0x826B, "physicslaunchserver" }, + { 0x826C, "physicslaunchserveritem" }, + { 0x826D, "clonebrushmodeltoscriptmodel" }, + { 0x826E, "scriptmodelplayanim" }, + { 0x826F, "scriptmodelclearanim" }, + { 0x8270, "scriptmodelplayanimdeltamotion" }, + { 0x8271, "vehicle_teleport" }, + { 0x8272, "attachpath" }, + { 0x8273, "getattachpos" }, + { 0x8274, "startpath" }, + { 0x8275, "setswitchnode" }, + { 0x8276, "setwaitspeed" }, + { 0x8277, "vehicle_finishdamage" }, + { 0x8278, "vehicle_setspeed" }, + { 0x8279, "vehicle_setspeedimmediate" }, + { 0x827A, "vehicle_rotateyaw" }, + { 0x827B, "vehicle_getspeed" }, + { 0x827C, "vehicle_getvelocity" }, + { 0x827D, "vehicle_getbodyvelocity" }, + { 0x827E, "vehicle_getsteering" }, + { 0x827F, "vehicle_getthrottle" }, + { 0x8280, "vehicle_turnengineoff" }, + { 0x8281, "vehicle_turnengineon" }, + { 0x8282, "vehicle_orientto" }, + { 0x8283, "getgoalspeedmph" }, + { 0x8284, "setacceleration" }, + { 0x8285, "setdeceleration" }, + { 0x8286, "resumespeed" }, + { 0x8287, "setyawspeed" }, + { 0x8288, "setyawspeedbyname" }, + { 0x8289, "setmaxpitchroll" }, + { 0x828A, "setairresistance" }, + { 0x828B, "setturningability" }, + { 0x828C, "getxuid" }, + { 0x828D, "getucdidhigh" }, + { 0x828E, "getucdidlow" }, + { 0x828F, "getclanidhigh" }, + { 0x8290, "getclanidlow" }, + { 0x8291, "ishost" }, + { 0x8292, "getspectatingplayer" }, + { 0x8293, "predictstreampos" }, + { 0x8294, "updatescores" }, + { 0x8295, "updatedmscores" }, + { 0x8296, "setrank" }, + { 0x8297, "setcardtitle" }, + { 0x8298, "weaponlocknoclearance" }, + { 0x8299, "visionsyncwithplayer" }, + { 0x829A, "showhudsplash" }, + { 0x829B, "setperk" }, + { 0x829C, "hasperk" }, + { 0x829D, "clearperks" }, + { 0x829E, "unsetperk" }, + { 0x829F, "registerparty" }, + { 0x82A0, "getfireteammembers" }, + { 0x82A1, "noclip" }, + { 0x82A2, "ufo" }, + { 0x82A3, "moveto" }, + { 0x82A4, "movex" }, + { 0x82A5, "movey" }, + { 0x82A6, "movez" }, + { 0x82A7, "movegravity" }, + { 0x82A8, "moveslide" }, + { 0x82A9, "stopmoveslide" }, + { 0x82AA, "rotateto" }, + { 0x82AB, "rotatepitch" }, + { 0x82AC, "rotateyaw" }, + { 0x82AD, "rotateroll" }, + { 0x82AE, "addpitch" }, + { 0x82AF, "addyaw" }, + { 0x82B0, "addroll" }, + { 0x82B1, "vibrate" }, + { 0x82B2, "rotatevelocity" }, + { 0x82B3, "solid" }, + { 0x82B4, "notsolid" }, + { 0x82B5, "setcandamage" }, + { 0x82B6, "setcanradiusdamage" }, + { 0x82B7, "physicslaunchclient" }, + { 0x82B8, "setcardicon" }, + { 0x82B9, "setcardnameplate" }, + { 0x82BA, "setcarddisplayslot" }, + { 0x82BB, "kc_regweaponforfxremoval" }, + { 0x82BC, "laststandrevive" }, + { 0x82BD, "setspectatedefaults" }, + { 0x82BE, "getthirdpersoncrosshairoffset" }, + { 0x82BF, "disableweaponpickup" }, + { 0x82C0, "enableweaponpickup" }, + { 0x82C1, "issplitscreenplayer" }, + { 0x82C2, "getweaponslistoffhands" }, + { 0x82C3, "getweaponslistitems" }, + { 0x82C4, "getweaponslistexclusives" }, + { 0x82C5, "getweaponslist" }, + { 0x82C6, "canplayerplacesentry" }, + { 0x82C7, "canplayerplacetank" }, + { 0x82C8, "visionsetnakedforplayer" }, + { 0x82C9, "visionsetnightforplayer" }, + { 0x82CA, "visionsetmissilecamforplayer" }, + { 0x82CB, "visionsetthermalforplayer" }, + { 0x82CC, "visionsetpainforplayer" }, + { 0x82CD, "setblurforplayer" }, + { 0x82CE, "getplayerweaponmodel" }, + { 0x82CF, "getplayerknifemodel" }, + { 0x82D0, "updateentitywithweapons" }, + { 0x82D1, "notifyonplayercommand" }, + { 0x82D2, "canmantle" }, + { 0x82D3, "forcemantle" }, + { 0x82D4, "ismantling" }, + { 0x82D5, "playfx" }, + { 0x82D6, "player_recoilscaleon" }, + { 0x82D7, "player_recoilscaleoff" }, + { 0x82D8, "weaponlockstart" }, + { 0x82D9, "weaponlockfinalize" }, + { 0x82DA, "weaponlockfree" }, + { 0x82DB, "weaponlocktargettooclose" }, + { 0x82DC, "issplitscreenplayerprimary" }, + { 0x82DD, "markforeyeson" }, + { 0x82DE, "issighted" }, + { 0x82DF, "getsightedplayers" }, + { 0x82E0, "getplayerssightingme" }, + { 0x82E1, "getviewmodel" }, + { 0x82E2, "fragbuttonpressed" }, + { 0x82E3, "secondaryoffhandbuttonpressed" }, + { 0x82E4, "getcurrentweaponclipammo" }, + { 0x82E5, "setvelocity" }, + { 0x82E6, "getplayerviewheight" }, + { 0x82E7, "getnormalizedmovement" }, + { 0x82E8, "setchannelvolumes" }, + { 0x82E9, "deactivatechannelvolumes" }, + { 0x82EA, "playlocalsound" }, + { 0x82EB, "stoplocalsound" }, + { 0x82EC, "setweaponammoclip" }, + { 0x82ED, "setweaponammostock" }, + { 0x82EE, "getweaponammoclip" }, + { 0x82EF, "getweaponammostock" }, + { 0x82F0, "anyammoforweaponmodes" }, + { 0x82F1, "setclientomnvar" }, + { 0x82F2, "setclientdvar" }, + { 0x82F3, "setclientdvars" }, + { 0x82F4, "setclientspawnsighttraces" }, + { 0x82F5, "clientspawnsighttracepassed" }, + { 0x82F6, "allowads" }, + { 0x82F7, "allowjump" }, + { 0x82F8, "allowsprint" }, + { 0x82F9, "setspreadoverride" }, + { 0x82FA, "resetspreadoverride" }, + { 0x82FB, "setaimspreadmovementscale" }, + { 0x82FC, "setactionslot" }, + { 0x82FD, "setviewkickscale" }, + { 0x82FE, "getviewkickscale" }, + { 0x82FF, "getweaponslistall" }, + { 0x8300, "getweaponslistprimaries" }, + { 0x8301, "getnormalizedcameramovement" }, + { 0x8302, "giveweapon" }, + { 0x8303, "takeweapon" }, + { 0x8304, "takeallweapons" }, + { 0x8305, "getcurrentweapon" }, + { 0x8306, "getcurrentprimaryweapon" }, + { 0x8307, "getcurrentoffhand" }, + { 0x8308, "hasweapon" }, + { 0x8309, "switchtoweapon" }, + { 0x830A, "switchtoweaponimmediate" }, + { 0x830B, "switchtooffhand" }, + { 0x830C, "setoffhandsecondaryclass" }, + { 0x830D, "getoffhandsecondaryclass" }, + { 0x830E, "beginlocationselection" }, + { 0x830F, "endlocationselection" }, + { 0x8310, "disableweapons" }, + { 0x8311, "enableweapons" }, + { 0x8312, "disableoffhandweapons" }, + { 0x8313, "enableoffhandweapons" }, + { 0x8314, "disableweaponswitch" }, + { 0x8315, "enableweaponswitch" }, + { 0x8316, "openpopupmenu" }, + { 0x8317, "openpopupmenunomouse" }, + { 0x8318, "closepopupmenu" }, + { 0x8319, "openmenu" }, + { 0x831A, "closemenu" }, + { 0x831B, "savematchrulestohistory" }, + { 0x831C, "freezecontrols" }, + { 0x831D, "disableusability" }, + { 0x831E, "enableusability" }, + { 0x831F, "setwhizbyspreads" }, + { 0x8320, "setwhizbyradii" }, + { 0x8321, "setreverb" }, + { 0x8322, "deactivatereverb" }, + { 0x8323, "setvolmod" }, + { 0x8324, "setchannelvolume" }, + { 0x8325, "givestartammo" }, + { 0x8326, "givemaxammo" }, + { 0x8327, "getfractionstartammo" }, + { 0x8328, "getfractionmaxammo" }, + { 0x8329, "isdualwielding" }, + { 0x832A, "isreloading" }, + { 0x832B, "isswitchingweapon" }, + { 0x832C, "setorigin" }, + { 0x832D, "getvelocity" }, + { 0x832E, "setplayerangles" }, + { 0x832F, "getplayerangles" }, + { 0x8330, "usebuttonpressed" }, + { 0x8331, "attackbuttonpressed" }, + { 0x8332, "adsbuttonpressed" }, + { 0x8333, "meleebuttonpressed" }, + { 0x8334, "playerads" }, + { 0x8335, "isonground" }, + { 0x8336, "isusingturret" }, + { 0x8337, "setviewmodel" }, + { 0x8338, "setoffhandprimaryclass" }, + { 0x8339, "getoffhandprimaryclass" }, + { 0x833A, "startac130" }, + { 0x833B, "stopac130" }, + { 0x833C, "enablemousesteer" }, + { 0x833D, "setscriptmoverkillcam" }, + { 0x833E, "usinggamepad" }, + { 0x833F, "forcethirdpersonwhenfollowing" }, + { 0x8340, "disableforcethirdpersonwhenfollowing" }, + { 0x8341, "botsetflag" }, + { 0x8342, "botsetstance" }, + { 0x8343, "botsetscriptmove" }, + { 0x8344, "botsetscriptgoal" }, + { 0x8345, "botsetscriptgoalnode" }, + { 0x8346, "botclearscriptgoal" }, + { 0x8347, "botsetscriptenemy" }, + { 0x8348, "botclearscriptenemy" }, + { 0x8349, "botsetattacker" }, + { 0x834A, "botgetscriptgoal" }, + { 0x834B, "botgetscriptgoalradius" }, + { 0x834C, "botgetscriptgoalyaw" }, + { 0x834D, "botgetscriptgoaltype" }, + { 0x834E, "botgetentrancepoint" }, + { 0x834F, "botgetworldsize" }, + { 0x8350, "botnodeavailable" }, + { 0x8351, "botfindnoderandom" }, + { 0x8352, "botmemoryevent" }, + { 0x8353, "botmemoryselectpos" }, + { 0x8354, "botnodepick" }, + { 0x8355, "bothasscriptgoal" }, + { 0x8356, "botgetpersonality" }, + { 0x8357, "botthrowgrenade" }, + { 0x8358, "botgetmemoryevents" }, + { 0x8359, "botsetpersonality" }, + { 0x835A, "botsetdifficulty" }, + { 0x835B, "botgetdifficulty" }, + { 0x835C, "botgetworldclosestedge" }, + { 0x835D, "botlookatpoint" }, + { 0x835E, "botpredictseepoint" }, + { 0x835F, "botcanseeentity" }, + { 0x8360, "botgetnodesonpath" }, + { 0x8361, "botnodepickmultiple" }, + { 0x8362, "botgetnearestnode" }, + { 0x8363, "botgetfovdot" }, + { 0x8364, "botsetawareness" }, + { 0x8365, "botpursuingscriptgoal" }, + { 0x8366, "botgetscriptgoalnode" }, + { 0x8367, "botgetimperfectenemyinfo" }, + { 0x8368, "botflagmemoryevents" }, + { 0x8369, "botsetpathingstyle" }, + { 0x836A, "botsetdifficultysetting" }, + { 0x836B, "botgetdifficultysetting" }, + { 0x836C, "botgetpathdist" }, + { 0x836D, "botisrandomized" }, + { 0x836E, "botpressbutton" }, + { 0x836F, "botclearbutton" }, + { 0x8370, "botnodescoremultiple" }, + { 0x8371, "getnodenumber" }, + { 0x8372, "setclientowner" }, + { 0x8373, "setotherent" }, + { 0x8374, "playercommandbot" }, + { 0x8375, "setaisightlinevisible" }, + { 0x8376, "setentityowner" }, + { 0x8377, "nodeisdisconnected" }, + { 0x8378, "getnearestnode" }, + { 0x8379, "makeentitynomeleetarget" }, + { 0x837A, "isagent" }, + { 0x837B, "spawnagent" }, + { 0x837C, "finishagentdamage" }, + { 0x837D, "setagentattacker" }, + { 0x837E, "cloneagent" }, + { 0x837F, "agentcanseesentient" }, + { 0x8380, "scragentsetwaypoint" }, + { 0x8381, "scragentsetgoalpos" }, + { 0x8382, "scragentgetgoalpos" }, + { 0x8383, "scragentsetgoalnode" }, + { 0x8384, "scragentsetgoalentity" }, + { 0x8385, "scragentsetgoalradius" }, + { 0x8386, "scragentsetanimscale" }, + { 0x8387, "scragentsetorientmode" }, + { 0x8388, "scragentsetanimmode" }, + { 0x8389, "scragentsetphysicsmode" }, + { 0x838A, "scragentsetclipmode" }, + { 0x838B, "scragentsetmaxturnspeed" }, + { 0x838C, "scragentgetmaxturnspeed" }, + { 0x838D, "scragentbeginmelee" }, + { 0x838E, "scragentsetscripted" }, + { 0x838F, "scragentdotrajectory" }, + { 0x8390, "scragentdoanimlerp" }, + { 0x8391, "scragentsetviewheight" }, + { 0x8392, "scragentclaimnode" }, + { 0x8393, "scragentrelinquishclaimednode" }, + { 0x8394, "setdoghandler" }, + { 0x8395, "setdogcommand" }, + { 0x8396, "setdogattackradius" }, + { 0x8397, "isdogfollowinghandler" }, + { 0x8398, "setdogmaxdrivespeed" }, + { 0x8399, "isdogbeingdriven" }, + { 0x839A, "setdogautoattackwhendriven" }, + { 0x839B, "getdogattackbeginnode" }, + { 0x839C, "setanimclass" }, + { 0x839D, "enableanimstate" }, + { 0x839E, "setanimstate" }, + { 0x839F, "getanimentry" }, + { 0x83A0, "getanimentryname" }, + { 0x83A1, "getanimentryalias" }, + { 0x83A2, "getanimentrycount" }, + { 0x83A3, "pushplayervector" }, + { 0x83A4, "issprinting" }, + { 0x83A5, "playerlinkeduselinkedvelocity" }, + { 0x83A6, "shootstopsound" }, + { 0x83A7, "setclothtype" }, + { 0x83A8, "getclothmovesound" }, + { 0x83A9, "getequipmovesound" }, + { 0x83AA, "jumpbuttonpressed" }, + { 0x83AB, "rotateby" }, + { 0x83AC, "getlookaheaddir" }, + { 0x83AD, "getpathgoalpos" }, + { 0x83AE, "setrocketcorpse" }, + { 0x83AF, "setcorpsefalling" }, + { 0x83B0, "setsurfacetype" }, + { 0x83B1, "aiphysicstrace" }, + { 0x83B2, "aiphysicstracepassed" }, + { 0x83B3, "setdevtext" }, + { 0x83B4, "forcemovingplatformentity" }, + { 0x83B5, "setmovingplatformtrigger" }, + { 0x83B6, "visionsetstage" }, + { 0x83B7, "linkwaypointtotargetwithoffset" }, + { 0x83B8, "getlinkedparent" }, + { 0x83B9, "getmovingplatformparent" }, + { 0x83BA, "setnameplatematerial" }, + { 0x83BB, "retargetscriptmodellighting" }, + { 0x83BC, "setmantlesoundflavor" }, + { 0x83BD, "clearclienttriggeraudiozone" }, + { 0x83BE, "setclienttriggeraudiozone" }, + { 0x83BF, "makevehiclenotcollidewithplayers" }, + { 0x83C0, "getbobrate" }, + { 0x83C1, "setbobrate" }, + { 0x83C2, "setscriptablepartstate" }, + { 0x83C3, "stopsliding" }, + { 0x83C4, "cancelrocketcorpse" }, + { 0x83C5, "setdronegoalpos" }, + { 0x83C6, "hudoutlineenable" }, + { 0x83C7, "hudoutlinedisable" }, + { 0x83C8, "motionblurhqenable" }, + { 0x83C9, "motionblurhqdisable" }, + { 0x83CA, "screenshakeonentity" }, + { 0x83CB, "setpitchorient" }, + { 0x83CC, "worldpointtoscreenpos" }, + { 0x83CD, "linktoplayerviewignoreparentrot" }, + { 0x83CE, "shouldplaymeleedeathanim" }, + { 0x83CF, "botfirstavailablegrenade" }, + { 0x83D0, "visionsetwaterforplayer" }, + { 0x83D1, "setwatersurfacetransitionfx" }, + { 0x83D2, "linktoplayerviewfollowwatersurface" }, + { 0x83D3, "linktoplayerviewattachwatersurfacetransitioneffects" }, + { 0x83D4, "playersetwaterfog" }, + { 0x83D5, "emissiveblend" }, + { 0x83D6, "enableforceviewmodeldof" }, + { 0x83D7, "disableforceviewmodeldof" }, + { 0x83D8, "getcustomizationbody" }, + { 0x83D9, "getcustomizationhead" }, + { 0x83DA, "getcustomizationviewmodel" }, + { 0x83DB, "setviewmodeldepth" }, + { 0x83DC, "isenemyaware" }, + { 0x83DD, "hasenemybeenseen" }, + { 0x83DE, "physicssetmaxlinvel" }, + { 0x83DF, "physicssetmaxangvel" }, + { 0x83E0, "physicsgetlinvel" }, + { 0x83E1, "physicsgetlinspeed" }, + { 0x83E2, "physicsgetangvel" }, + { 0x83E3, "physicsgetangspeed" }, + { 0x83E4, "disablemissileboosting" }, + { 0x83E5, "enablemissileboosting" }, + { 0x83E6, "canspawntestclient" }, + { 0x83E7, "spawntestclient" }, + { 0x83E8, "loadcustomizationplayerview" }, + { 0x83E9, "setgrenadethrowscale" }, + { 0x83EA, "setgrenadecookscale" }, + { 0x83EB, "setplanesplineid" }, + { 0x83EC, "hudoutlineenableforclient" }, + { 0x83ED, "hudoutlinedisableforclient" }, + { 0x83EE, "hudoutlineenableforclients" }, + { 0x83EF, "hudoutlinedisableforclients" }, + { 0x83F0, "turretsetbarrelspinenabled" }, + { 0x83F1, "hasloadedcustomizationplayerview" }, + { 0x83F2, "setclienttriggeraudiozonelerp" }, + { 0x83F3, "setclienttriggeraudiozonepartial" }, + { 0x83F4, "scragentdoanimrelative" }, + { 0x83F5, "rotatetolinked" }, + { 0x83F6, "rotatebylinked" }, + { 0x83F7, "setlinkedangles" }, + { 0x83F8, "getcorpseentity" }, + { 0x83F9, "removefrommovingplatformsystem" }, + { 0x83FA, "logmatchdatalife" }, + { 0x83FB, "logmatchdatadeath" }, + { 0x83FC, "queuedialogforplayer" }, + { 0x83FD, "setmlgcameradefaults" }, + { 0x83FE, "ismlgspectator" }, + { 0x83FF, "disableautoreload" }, + { 0x8400, "enableautoreload" }, + { 0x8401, "issprintsliding" }, + { 0x8402, "getlinkedchildren" }, + { 0x8403, "botpredictenemycampspots" }, + { 0x8404, "playsoundonmovingent" }, + { 0x8405, "cancelmantle" }, + { 0x8406, "hasfemalecustomizationmodel" }, + { 0x8407, "setscriptabledamageowner" }, + { 0x8408, "setfxkilldefondelete" }, + { 0x8409, "getdogavoident" }, + { 0x840A, "enabledogavoidance" }, + { 0x840B, "forcedeathfall" }, + { 0x840C, "gethybridscopestate" }, + { 0x840D, "sethybridscopestate" }, + { 0x840E, "getvieworigin" }, + { 0x840F, "setweaponmodelvariant" }, + { 0x8410, "ridevehicle" }, + { 0x8411, "stopridingvehicle" }, + { 0x8412, "getmantlesound" }, + { 0x8413, "autoboltmissileeffects" }, + { 0x8414, "disablemissilestick" }, + { 0x8415, "enablemissilestick" }, + { 0x8416, "setmissileminimapvisible" }, + { 0x8417, "isoffhandweaponreadytothrow" }, + { 0x8418, "isleaning" }, + { 0x8419, "makecollidewithitemclip" }, + { 0x841A, "ismovementfromgamepad" }, + { 0x841B, "visionsetpostapplyforplayer" }, + { 0x841C, "setcommonplayerdatareservedint" }, + { 0x841D, "getclanwarsbonus" }, + { 0x841E, "getrankedplayerdatareservedint" }, + { 0x841F, "setrankedplayerdatareservedint" }, + { 0x8420, "setignorefoliagesightingme" }, + { 0x8421, "scragentusemodelcollisionbounds" }, + { 0x8422, "setmlgspectator" }, + { 0x8423, "getmlgspectatorteam" }, + { 0x8424, "getcommonplayerdatareservedint" }, + { 0x8425, "getcoopplayerdatareservedint" }, + { 0x8426, "setcoopplayerdatareservedint" }, + { 0x8427, "getjointype" }, + { 0x8428, "scragentsetwallruncost" }, + { 0x8429, "alienscheckisitempurchased" }, +}}; + +} // namespace xsk::gsc::iw6_pc diff --git a/src/iw6/xsk/resolver.cpp b/src/iw6/iw6_pc_token.cpp similarity index 93% rename from src/iw6/xsk/resolver.cpp rename to src/iw6/iw6_pc_token.cpp index 24251cac..342f4dd3 100644 --- a/src/iw6/xsk/resolver.cpp +++ b/src/iw6/iw6_pc_token.cpp @@ -1,2160 +1,14 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" -#include "iw6.hpp" +#include "iw6_pc.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - -namespace xsk::gsc::iw6 +namespace xsk::gsc::iw6_pc { -std::unordered_map opcode_map; -std::unordered_map function_map; -std::unordered_map method_map; -std::unordered_map token_map; -std::unordered_map opcode_map_rev; -std::unordered_map function_map_rev; -std::unordered_map method_map_rev; -std::unordered_map token_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_func_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - const auto itr = function_map.find(id); - - if (itr != function_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_meth_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - const auto itr = method_map.find(id); - - if (itr != method_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_id_")) - { - return static_cast(std::stoul(name.substr(4), nullptr, 16)); - } - - const auto itr = token_map_rev.find(name); - - if (itr != token_map_rev.end()) - { - return itr->second; - } - - return 0; -} - -auto resolver::token_name(std::uint16_t id) -> std::string -{ - const auto itr = token_map.find(id); - - if (itr != token_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - } - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - } - - return false; -} - -void resolver::add_function(const std::string& name, std::uint16_t id) -{ - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - throw error(utils::string::va("builtin function '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - function_map.insert({ id, *str }); - function_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - function_map.insert({ id, *ins.first }); - function_map_rev.insert({ *ins.first, id }); - } - } -} - -void resolver::add_method(const std::string& name, std::uint16_t id) -{ - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - throw error(utils::string::va("builtin method '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - method_map.insert({ id, *str }); - method_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - method_map.insert({ id, *ins.first }); - method_map_rev.insert({ *ins.first, 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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ - "character"sv, - "codescripts"sv, - "common_scripts"sv, - "destructible_scripts"sv, - "maps"sv, - "vehicle_scripts"sv, - "xmodelalias"sv, - "maps/animated_models"sv, - "maps/createart"sv, - "maps/createfx"sv, - "maps/interactive_models"sv, - "maps/mp"sv, - "maps/mp/agents"sv, - "maps/mp/alien"sv, - "maps/mp/bots"sv, - "maps/mp/gametypes"sv, - "maps/mp/killstreaks"sv, - "maps/mp/perks"sv, - "maps/mp/agents/alien"sv, - "maps/mp/agents/dog"sv, - "maps/mp/agents/alien/alien_ancestor"sv, - "maps/mp/agents/alien/alien_kraken"sv, - "maps/mp/agents/alien/alien_spider"sv, -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -const std::array, 153> opcode_list -{{ - { 0x17, "OP_SetNewLocalVariableFieldCached0" }, - { 0x18, "OP_EvalSelfFieldVariable" }, - { 0x19, "OP_Return" }, - { 0x1A, "OP_CallBuiltin0" }, - { 0x1B, "OP_CallBuiltin1" }, - { 0x1C, "OP_CallBuiltin2" }, - { 0x1D, "OP_CallBuiltin3" }, - { 0x1E, "OP_CallBuiltin4" }, - { 0x1F, "OP_CallBuiltin5" }, - { 0x20, "OP_CallBuiltin" }, - { 0x21, "OP_BoolNot" }, - { 0x22, "OP_ScriptFarMethodThreadCall" }, - { 0x23, "OP_JumpOnTrueExpr" }, - { 0x24, "OP_SetLevelFieldVariableField" }, - { 0x25, "OP_CastBool" }, - { 0x26, "OP_EvalNewLocalArrayRefCached0" }, - { 0x27, "OP_CallBuiltinPointer" }, - { 0x28, "OP_inequality" }, - { 0x29, "OP_GetThisthread" }, - { 0x2A, "OP_ClearFieldVariable" }, - { 0x2B, "OP_GetFloat" }, - { 0x2C, "OP_SafeCreateVariableFieldCached" }, - { 0x2D, "OP_ScriptFarFunctionCall2" }, - { 0x2E, "OP_ScriptFarFunctionCall" }, - { 0x2F, "OP_ScriptFarChildThreadCall" }, - { 0x30, "OP_ClearLocalVariableFieldCached0" }, - { 0x31, "OP_ClearLocalVariableFieldCached" }, - { 0x32, "OP_checkclearparams" }, - { 0x33, "OP_CastFieldObject" }, - { 0x34, "OP_End" }, - { 0x35, "OP_size" }, - { 0x36, "OP_EmptyArray" }, - { 0x37, "OP_bit_and" }, - { 0x38, "OP_less_equal" }, - { 0x39, "OP_voidCodepos" }, - { 0x3A, "OP_ScriptMethodThreadCallPointer" }, - { 0x3B, "OP_endswitch" }, - { 0x3C, "OP_ClearVariableField" }, - { 0x3D, "OP_divide" }, - { 0x3E, "OP_ScriptFarMethodChildThreadCall" }, - { 0x3F, "OP_GetUnsignedShort" }, - { 0x40, "OP_JumpOnTrue" }, - { 0x41, "OP_GetSelf" }, - { 0x42, "OP_ScriptFarThreadCall" }, - { 0x43, "OP_ScriptLocalThreadCall" }, - { 0x44, "OP_SetLocalVariableFieldCached0" }, - { 0x45, "OP_SetLocalVariableFieldCached" }, - { 0x46, "OP_plus" }, - { 0x47, "OP_BoolComplement" }, - { 0x48, "OP_ScriptMethodCallPointer" }, - { 0x49, "OP_inc" }, - { 0x4A, "OP_RemoveLocalVariables" }, - { 0x4B, "OP_JumpOnFalseExpr" }, - { 0x4C, "OP_switch" }, - { 0x4D, "OP_clearparams" }, - { 0x4E, "OP_EvalLocalVariableRefCached0" }, - { 0x4F, "OP_EvalLocalVariableRefCached" }, - { 0x50, "OP_ScriptLocalMethodCall" }, - { 0x51, "OP_EvalFieldVariable" }, - { 0x52, "OP_EvalFieldVariableRef" }, - { 0x53, "OP_GetString" }, - { 0x54, "OP_ScriptFunctionCallPointer" }, - { 0x55, "OP_EvalLevelFieldVariable" }, - { 0x56, "OP_GetVector" }, - { 0x57, "OP_endon" }, - { 0x58, "OP_greater_equal" }, - { 0x59, "OP_GetSelfObject" }, - { 0x5A, "OP_SetAnimFieldVariableField" }, - { 0x5B, "OP_SetVariableField" }, - { 0x5C, "OP_ScriptLocalFunctionCall2" }, - { 0x5D, "OP_ScriptLocalFunctionCall" }, - { 0x5E, "OP_EvalLocalArrayRefCached0" }, - { 0x5F, "OP_EvalLocalArrayRefCached" }, - { 0x60, "OP_GetFarFunction" }, - { 0x61, "OP_less" }, - { 0x62, "OP_GetGameRef" }, - { 0x63, "OP_waittillFrameEnd" }, - { 0x64, "OP_SafeSetVariableFieldCached0" }, - { 0x65, "OP_SafeSetVariableFieldCached" }, - { 0x66, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x67, "OP_GetLevel" }, - { 0x68, "OP_notify" }, - { 0x69, "OP_DecTop" }, - { 0x6A, "OP_shift_left" }, - { 0x6B, "OP_ScriptLocalMethodThreadCall" }, - { 0x6C, "OP_ScriptLocalMethodChildThreadCall" }, - { 0x6D, "OP_greater" }, - { 0x6E, "OP_EvalLocalVariableCached0" }, - { 0x6F, "OP_EvalLocalVariableCached1" }, - { 0x70, "OP_EvalLocalVariableCached2" }, - { 0x71, "OP_EvalLocalVariableCached3" }, - { 0x72, "OP_EvalLocalVariableCached4" }, - { 0x73, "OP_EvalLocalVariableCached5" }, - { 0x74, "OP_EvalLocalVariableCached" }, - { 0x75, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x76, "OP_jump" }, - { 0x77, "OP_ScriptThreadCallPointer" }, - { 0x78, "OP_GetZero" }, - { 0x79, "OP_wait" }, - { 0x7A, "OP_minus" }, - { 0x7B, "OP_SetSelfFieldVariableField" }, - { 0x7C, "OP_EvalNewLocalVariableRefCached0" }, - { 0x7D, "OP_multiply" }, - { 0x7E, "OP_CreateLocalVariable" }, - { 0x7F, "OP_ScriptLocalChildThreadCall" }, - { 0x80, "OP_GetInteger" }, - { 0x81, "OP_mod" }, - { 0x82, "OP_EvalAnimFieldVariableRef" }, - { 0x83, "OP_GetBuiltinFunction" }, - { 0x84, "OP_GetGame" }, - { 0x85, "OP_waittill" }, - { 0x86, "OP_dec" }, - { 0x87, "OP_EvalLocalVariableObjectCached" }, - { 0x88, "OP_PreScriptCall" }, - { 0x89, "OP_GetAnim" }, - { 0x8A, "OP_GetUndefined" }, - { 0x8B, "OP_EvalLevelFieldVariableRef" }, - { 0x8C, "OP_GetAnimObject" }, - { 0x8D, "OP_GetLevelObject" }, - { 0x8E, "OP_bit_ex_or" }, - { 0x8F, "OP_equality" }, - { 0x90, "OP_ClearArray" }, - { 0x91, "OP_jumpback" }, - { 0x92, "OP_GetAnimation" }, - { 0x93, "OP_EvalAnimFieldVariable" }, - { 0x94, "OP_GetAnimTree" }, - { 0x95, "OP_GetIString" }, - { 0x96, "OP_EvalArrayRef" }, - { 0x97, "OP_EvalSelfFieldVariableRef" }, - { 0x98, "OP_GetNegByte" }, - { 0x99, "OP_GetBuiltinMethod" }, - { 0x9A, "OP_CallBuiltinMethodPointer" }, - { 0x9B, "OP_EvalArray" }, - { 0x9C, "OP_vector" }, - { 0x9D, "OP_ScriptFarMethodCall" }, - { 0x9E, "OP_EvalLocalArrayCached" }, - { 0x9F, "OP_GetByte" }, - { 0xA0, "OP_ScriptChildThreadCallPointer" }, - { 0xA1, "OP_bit_or" }, - { 0xA2, "OP_AddArray" }, - { 0xA3, "OP_waittillmatch2" }, - { 0xA4, "OP_waittillmatch" }, - { 0xA5, "OP_GetLocalFunction" }, - { 0xA6, "OP_GetNegUnsignedShort" }, - { 0xA7, "OP_shift_right" }, - { 0xA8, "OP_CallBuiltinMethod0" }, - { 0xA9, "OP_CallBuiltinMethod1" }, - { 0xAA, "OP_CallBuiltinMethod2" }, - { 0xAB, "OP_CallBuiltinMethod3" }, - { 0xAC, "OP_CallBuiltinMethod4" }, - { 0xAD, "OP_CallBuiltinMethod5" }, - { 0xAE, "OP_CallBuiltinMethod" }, - { 0xAF, "OP_JumpOnFalse" }, -}}; - -const std::array, 605> function_list -{{ - { 0x001, "precacheturret" }, - { 0x002, "getweaponarray" }, - { 0x003, "createprintchannel" }, - { 0x004, "updategamerprofileall" }, - { 0x005, "clearlocalizedstrings" }, - { 0x006, "setphysicsgravitydir" }, - { 0x007, "gettimescale" }, - { 0x008, "settimescale" }, - { 0x009, "setslowmotionview" }, - { 0x00A, "teleportscene" }, - { 0x00B, "forcesharedammo" }, - { 0x00C, "refreshhudcompass" }, - { 0x00D, "refreshhudammocounter" }, - { 0x00E, "notifyoncommand" }, - { 0x00F, "setprintchannel" }, - { 0x010, "print" }, - { 0x011, "println" }, - { 0x012, "print3d" }, - { 0x013, "line" }, - { 0x014, "box" }, - { 0x015, "orientedbox" }, - { 0x016, "sphere" }, - { 0x017, "cylinder" }, - { 0x018, "spawnturret" }, - { 0x019, "canspawnturret" }, - { 0x01A, "assert" }, - { 0x01B, "pausecinematicingame" }, - { 0x01C, "drawcompassfriendlies" }, - { 0x01D, "bulletspread" }, - { 0x01E, "bullettracer" }, - { 0x01F, "badplace_delete" }, - { 0x020, "badplace_cylinder" }, - { 0x021, "badplace_arc" }, - { 0x022, "badplace_brush" }, - { 0x023, "clearallcorpses" }, - { 0x024, "setturretnode" }, - { 0x025, "unsetturretnode" }, - { 0x026, "setnodepriority" }, - { 0x027, "isnodeoccupied" }, - { 0x028, "setdebugorigin" }, - { 0x029, "setdebugangles" }, - { 0x02A, "updategamerprofile" }, - { 0x02B, "assertex" }, - { 0x02C, "assertmsg" }, - { 0x02D, "isdefined" }, - { 0x02E, "isvalidmissile" }, - { 0x02F, "isstring" }, - { 0x030, "setomnvar" }, - { 0x031, "getomnvar" }, - { 0x032, "setdvar" }, - { 0x033, "setdynamicdvar" }, - { 0x034, "setdvarifuninitialized" }, - { 0x035, "setdevdvar" }, - { 0x036, "setdevdvarifuninitialized" }, - { 0x037, "getdvar" }, - { 0x038, "getdvarint" }, - { 0x039, "getdvarfloat" }, - { 0x03A, "getdvarvector" }, - { 0x03B, "gettime" }, - { 0x03C, "getentbynum" }, - { 0x03D, "getweaponmodel" }, - { 0x03E, "getculldist" }, - { 0x03F, "sethalfresparticles" }, - { 0x040, "getmapsunlight" }, - { 0x041, "setsunlight" }, - { 0x042, "resetsunlight" }, - { 0x043, "getmapsundirection" }, - { 0x044, "getmapsunangles" }, - { 0x045, "setsundirection" }, - { 0x046, "lerpsundirection" }, - { 0x047, "lerpsunangles" }, - { 0x048, "resetsundirection" }, - { 0x049, "enableforcedsunshadows" }, - { 0x04A, "enableforcednosunshadows" }, - { 0x04B, "disableforcedsunshadows" }, - { 0x04C, "enableouterspacemodellighting" }, - { 0x04D, "disableouterspacemodellighting" }, - { 0x04E, "remapstage" }, - { 0x04F, "changelevel" }, - { 0x050, "missionsuccess" }, - { 0x051, "missionfailed" }, - { 0x052, "cinematic" }, - { 0x053, "cinematicingame" }, - { 0x054, "cinematicingamesync" }, - { 0x055, "cinematicingameloop" }, - { 0x056, "cinematicingameloopresident" }, - { 0x057, "iscinematicplaying" }, - { 0x058, "stopcinematicingame" }, - { 0x059, "getweapondisplayname" }, - { 0x05A, "getweaponbasename" }, - { 0x05B, "getweaponattachments" }, - { 0x05C, "getweaponattachmentdisplaynames" }, - { 0x05D, "getweaponcamoname" }, - { 0x05E, "getweaponreticlename" }, - { 0x05F, "getweaponhidetags" }, - { 0x060, "getanimlength" }, - { 0x061, "animhasnotetrack" }, - { 0x062, "getnotetracktimes" }, - { 0x063, "spawn" }, - { 0x064, "spawnloopsound" }, - { 0x065, "spawnloopingsound" }, - { 0x066, "bullettrace" }, - { 0x067, "target_setmaxsize" }, - { 0x068, "target_setcolor" }, - { 0x069, "target_setdelay" }, - { 0x06A, "getstartorigin" }, - { 0x06B, "getstartangles" }, - { 0x06C, "getcycleoriginoffset" }, - { 0x06D, "magicgrenade" }, - { 0x06E, "magicgrenademanual" }, - { 0x06F, "setblur" }, - { 0x070, "musicplay" }, - { 0x071, "musicstop" }, - { 0x072, "soundfade" }, - { 0x073, "soundsettimescalefactor" }, - { 0x074, "soundresettimescale" }, - { 0x075, "setocclusionpreset" }, - { 0x076, "levelsoundfade" }, - { 0x077, "precachenightvisioncodeassets" }, - { 0x078, "precachedigitaldistortcodeassets" }, - { 0x079, "precacheminimapsentrycodeassets" }, - { 0x07A, "savegame" }, - { 0x07B, "issavesuccessful" }, - { 0x07C, "issaverecentlyloaded" }, - { 0x07D, "savegamenocommit" }, - { 0x07E, "commitsave" }, - { 0x07F, "commitwouldbevalid" }, - { 0x080, "getfxvisibility" }, - { 0x081, "setculldist" }, - { 0x082, "bullettracepassed" }, - { 0x083, "sighttracepassed" }, - { 0x084, "physicstrace" }, - { 0x085, "playerphysicstrace" }, - { 0x086, "getgroundposition" }, - { 0x087, "getmovedelta" }, - { 0x088, "getangledelta" }, - { 0x089, "getnorthyaw" }, - { 0x08A, "getcommandfromkey" }, - { 0x08B, "getsticksconfig" }, - { 0x08C, "weaponfightdist" }, - { 0x08D, "weaponmaxdist" }, - { 0x08E, "isturretactive" }, - { 0x08F, "target_alloc" }, - { 0x090, "target_flush" }, - { 0x091, "target_set" }, - { 0x092, "target_remove" }, - { 0x093, "target_setshader" }, - { 0x094, "target_setoffscreenshader" }, - { 0x095, "target_isinrect" }, - { 0x096, "target_isincircle" }, - { 0x097, "target_startreticlelockon" }, - { 0x098, "target_clearreticlelockon" }, - { 0x099, "target_getarray" }, - { 0x09A, "target_istarget" }, - { 0x09B, "target_setattackmode" }, - { 0x09C, "target_setjavelinonly" }, - { 0x09D, "target_hidefromplayer" }, - { 0x09E, "target_showtoplayer" }, - { 0x09F, "target_setscaledrendermode" }, - { 0x0A0, "target_drawcornersonly" }, - { 0x0A1, "target_drawsquare" }, - { 0x0A2, "target_drawsingle" }, - { 0x0A3, "target_setminsize" }, - { 0x0A4, "setnorthyaw" }, - { 0x0A5, "setslowmotion" }, - { 0x0A6, "randomint" }, - { 0x0A7, "randomfloat" }, - { 0x0A8, "randomintrange" }, - { 0x0A9, "randomfloatrange" }, - { 0x0AA, "sin" }, - { 0x0AB, "cos" }, - { 0x0AC, "tan" }, - { 0x0AD, "asin" }, - { 0x0AE, "acos" }, - { 0x0AF, "atan" }, - { 0x0B0, "int" }, - { 0x0B1, "float" }, - { 0x0B2, "abs" }, - { 0x0B3, "min" }, - { 0x0B4, "objective_additionalcurrent" }, - { 0x0B5, "objective_ring" }, - { 0x0B6, "objective_setpointertextoverride" }, - { 0x0B7, "getnode" }, - { 0x0B8, "getnodearray" }, - { 0x0B9, "getallnodes" }, - { 0x0BA, "getnodesinradius" }, - { 0x0BB, "getnodesinradiussorted" }, - { 0x0BC, "getclosestnodeinsight" }, - { 0x0BD, "getreflectionlocs" }, - { 0x0BE, "getreflectionreferencelocs" }, - { 0x0BF, "getvehicletracksegment" }, - { 0x0C0, "getvehicletracksegmentarray" }, - { 0x0C1, "getallvehicletracksegments" }, - { 0x0C2, "isarray" }, - { 0x0C3, "isai" }, - { 0x0C4, "getindexforluincstring" }, - { 0x0C5, "issentient" }, - { 0x0C6, "isgodmode" }, - { 0x0C7, "getdebugdvar" }, - { 0x0C8, "getdebugdvarint" }, - { 0x0C9, "getdebugdvarfloat" }, - { 0x0CA, "setsaveddvar" }, - { 0x0CB, "getfreeaicount" }, - { 0x0CC, "getaicount" }, - { 0x0CD, "getaiarray" }, - { 0x0CE, "getaispeciesarray" }, - { 0x0CF, "getspawnerarray" }, - { 0x0D0, "getcorpsearray" }, - { 0x0D1, "getspawnerteamarray" }, - { 0x0D2, "getweaponclipmodel" }, - { 0x0D3, "getbrushmodelcenter" }, - { 0x0D4, "getkeybinding" }, - { 0x0D5, "max" }, - { 0x0D6, "floor" }, - { 0x0D7, "ceil" }, - { 0x0D8, "exp" }, - { 0x0D9, "log" }, - { 0x0DA, "sqrt" }, - { 0x0DB, "squared" }, - { 0x0DC, "clamp" }, - { 0x0DD, "angleclamp" }, - { 0x0DE, "angleclamp180" }, - { 0x0DF, "vectorfromlinetopoint" }, - { 0x0E0, "pointonsegmentnearesttopoint" }, - { 0x0E1, "distance" }, - { 0x0E2, "distance2d" }, - { 0x0E3, "distancesquared" }, - { 0x0E4, "length" }, - { 0x0E5, "length2d" }, - { 0x0E6, "lengthsquared" }, - { 0x0E7, "length2dsquared" }, - { 0x0E8, "closer" }, - { 0x0E9, "vectordot" }, - { 0x0EA, "vectorcross" }, - { 0x0EB, "axistoangles" }, - { 0x0EC, "visionsetthermal" }, - { 0x0ED, "visionsetpain" }, - { 0x0EE, "endlobby" }, - { 0x0EF, "setac130ambience" }, - { 0x0F0, "getmapcustom" }, - { 0x0F1, "spawnsighttrace" }, - { 0x0F2, "incrementcounter" }, - { 0x0F3, "getcountertotal" }, - { 0x0F4, "getlevelticks" }, - { 0x0F5, "perlinnoise2d" }, - { 0x0F6, "calcrockingangles" }, - { 0x0F7, "reconevent" }, - { 0x0F8, "reconspatialevent" }, - { 0x0F9, "setsunflareposition" }, - { 0x0FA, "createthreatbiasgroup" }, - { 0x0FB, "threatbiasgroupexists" }, - { 0x0FC, "getthreatbias" }, - { 0x0FD, "setthreatbias" }, - { 0x0FE, "setthreatbiasagainstall" }, - { 0x0FF, "setignoremegroup" }, - { 0x100, "isenemyteam" }, - { 0x101, "objective_additionalentity" }, - { 0x102, "objective_state_nomessage" }, - { 0x103, "objective_string" }, - { 0x104, "objective_string_nomessage" }, - { 0x105, "objective_additionalposition" }, - { 0x106, "objective_current_nomessage" }, - { 0x107, "vectornormalize" }, - { 0x108, "vectortoangles" }, - { 0x109, "vectortoyaw" }, - { 0x10A, "vectorlerp" }, - { 0x10B, "anglestoup" }, - { 0x10C, "anglestoright" }, - { 0x10D, "anglestoforward" }, - { 0x10E, "anglesdelta" }, - { 0x10F, "combineangles" }, - { 0x110, "transformmove" }, - { 0x111, "rotatevector" }, - { 0x112, "rotatepointaroundvector" }, - { 0x113, "issubstr" }, - { 0x114, "isendstr" }, - { 0x115, "getsubstr" }, - { 0x116, "tolower" }, - { 0x117, "strtok" }, - { 0x118, "stricmp" }, - { 0x119, "ambientplay" }, - { 0x11A, "getuavstrengthmax" }, - { 0x11B, "getuavstrengthlevelneutral" }, - { 0x11C, "getuavstrengthlevelshowenemyfastsweep" }, - { 0x11D, "getuavstrengthlevelshowenemydirectional" }, - { 0x11E, "blockteamradar" }, - { 0x11F, "unblockteamradar" }, - { 0x120, "isteamradarblocked" }, - { 0x121, "getassignedteam" }, - { 0x122, "setmatchdata" }, - { 0x123, "getmatchdata" }, - { 0x124, "sendmatchdata" }, - { 0x125, "clearmatchdata" }, - { 0x126, "setmatchdatadef" }, - { 0x127, "setmatchclientip" }, - { 0x128, "setmatchdataid" }, - { 0x129, "setclientmatchdata" }, - { 0x12A, "getclientmatchdata" }, - { 0x12B, "setclientmatchdatadef" }, - { 0x12C, "sendclientmatchdata" }, - { 0x12D, "getbuildversion" }, - { 0x12E, "getbuildnumber" }, - { 0x12F, "getsystemtime" }, - { 0x130, "getmatchrulesdata" }, - { 0x131, "isusingmatchrulesdata" }, - { 0x132, "kick" }, - { 0x133, "issplitscreen" }, - { 0x134, "setmapcenter" }, - { 0x135, "setgameendtime" }, - { 0x136, "visionsetnaked" }, - { 0x137, "visionsetnight" }, - { 0x138, "visionsetmissilecam" }, - { 0x139, "ambientstop" }, - { 0x13A, "precachemodel" }, - { 0x13B, "precacheshellshock" }, - { 0x13C, "precacheitem" }, - { 0x13D, "precacheshader" }, - { 0x13E, "precachestring" }, - { 0x13F, "precachemenu" }, - { 0x140, "precacherumble" }, - { 0x141, "precachelocationselector" }, - { 0x142, "precacheleaderboards" }, - { 0x143, "loadfx" }, - { 0x144, "playfx" }, - { 0x145, "playfxontag" }, - { 0x146, "stopfxontag" }, - { 0x147, "killfxontag" }, - { 0x148, "playloopedfx" }, - { 0x149, "spawnfx" }, - { 0x14A, "triggerfx" }, - { 0x14B, "playfxontagforclients" }, - { 0x14C, "setwinningteam" }, - { 0x14D, "announcement" }, - { 0x14E, "clientannouncement" }, - { 0x14F, "setteammode" }, - { 0x150, "getteamscore" }, - { 0x151, "setteamscore" }, - { 0x152, "setclientnamemode" }, - { 0x153, "updateclientnames" }, - { 0x154, "getteamplayersalive" }, - { 0x155, "logprint" }, - { 0x156, "worldentnumber" }, - { 0x157, "obituary" }, - { 0x158, "positionwouldtelefrag" }, - { 0x159, "canspawn" }, - { 0x15A, "getstarttime" }, - { 0x15B, "precachestatusicon" }, - { 0x15C, "precacheheadicon" }, - { 0x15D, "precacheminimapicon" }, - { 0x15E, "precachempanim" }, - { 0x15F, "map_restart" }, - { 0x160, "exitlevel" }, - { 0x161, "addtestclient" }, - { 0x162, "addagent" }, - { 0x163, "setarchive" }, - { 0x164, "allclientsprint" }, - { 0x165, "clientprint" }, - { 0x166, "mapexists" }, - { 0x167, "isvalidgametype" }, - { 0x168, "matchend" }, - { 0x169, "setplayerteamrank" }, - { 0x16A, "endparty" }, - { 0x16B, "setteamradar" }, - { 0x16C, "getteamradar" }, - { 0x16D, "setteamradarstrength" }, - { 0x16E, "getteamradarstrength" }, - { 0x16F, "getuavstrengthmin" }, - { 0x170, "physicsexplosionsphere" }, - { 0x171, "physicsexplosioncylinder" }, - { 0x172, "physicsjolt" }, - { 0x173, "physicsjitter" }, - { 0x174, "setexpfog" }, - { 0x175, "isexplosivedamagemod" }, - { 0x176, "radiusdamage" }, - { 0x177, "setplayerignoreradiusdamage" }, - { 0x178, "glassradiusdamage" }, - { 0x179, "earthquake" }, - { 0x17A, "getnumparts" }, - { 0x17B, "objective_onentity" }, - { 0x17C, "objective_onentitywithrotation" }, - { 0x17D, "objective_team" }, - { 0x17E, "objective_player" }, - { 0x17F, "objective_playerteam" }, - { 0x180, "objective_playerenemyteam" }, - { 0x181, "objective_playermask_hidefromall" }, - { 0x182, "objective_playermask_hidefrom" }, - { 0x183, "objective_playermask_showtoall" }, - { 0x184, "objective_playermask_showto" }, - { 0x185, "iprintln" }, - { 0x186, "iprintlnbold" }, - { 0x187, "logstring" }, - { 0x188, "getent" }, - { 0x189, "getentarray" }, - { 0x18A, "getspawnarray" }, - { 0x18B, "spawnplane" }, - { 0x18C, "spawnstruct" }, - { 0x18D, "spawnhelicopter" }, - { 0x18E, "isalive" }, - { 0x18F, "isspawner" }, - { 0x190, "missile_createattractorent" }, - { 0x191, "missile_createattractororigin" }, - { 0x192, "missile_createrepulsorent" }, - { 0x193, "missile_createrepulsororigin" }, - { 0x194, "missile_deleteattractor" }, - { 0x195, "playsoundatpos" }, - { 0x196, "newhudelem" }, - { 0x197, "newclienthudelem" }, - { 0x198, "newteamhudelem" }, - { 0x199, "resettimeout" }, - { 0x19A, "isplayer" }, - { 0x19B, "isplayernumber" }, - { 0x19C, "getpartname" }, - { 0x19D, "weaponfiretime" }, - { 0x19E, "weaponclipsize" }, - { 0x19F, "weaponisauto" }, - { 0x1A0, "weaponissemiauto" }, - { 0x1A1, "weaponisboltaction" }, - { 0x1A2, "weaponinheritsperks" }, - { 0x1A3, "weaponburstcount" }, - { 0x1A4, "weapontype" }, - { 0x1A5, "weaponclass" }, - { 0x1A6, "getnextarraykey" }, - { 0x1A7, "sortbydistance" }, - { 0x1A8, "tablelookup" }, - { 0x1A9, "tablelookupbyrow" }, - { 0x1AA, "tablelookupistring" }, - { 0x1AB, "tablelookupistringbyrow" }, - { 0x1AC, "tablelookuprownum" }, - { 0x1AD, "tableexists" }, - { 0x1AE, "getmissileowner" }, - { 0x1AF, "magicbullet" }, - { 0x1B0, "getweaponflashtagname" }, - { 0x1B1, "averagepoint" }, - { 0x1B2, "averagenormal" }, - { 0x1B3, "vehicle_getspawnerarray" }, - { 0x1B4, "playrumbleonposition" }, - { 0x1B5, "playrumblelooponposition" }, - { 0x1B6, "stopallrumbles" }, - { 0x1B7, "soundexists" }, - { 0x1B8, "openfile" }, - { 0x1B9, "closefile" }, - { 0x1BA, "fprintln" }, - { 0x1BB, "fprintfields" }, - { 0x1BC, "freadln" }, - { 0x1BD, "fgetarg" }, - { 0x1BE, "setminimap" }, - { 0x1BF, "setthermalbodymaterial" }, - { 0x1C0, "getarraykeys" }, - { 0x1C1, "getfirstarraykey" }, - { 0x1C2, "getglass" }, - { 0x1C3, "getglassarray" }, - { 0x1C4, "getglassorigin" }, - { 0x1C5, "isglassdestroyed" }, - { 0x1C6, "destroyglass" }, - { 0x1C7, "deleteglass" }, - { 0x1C8, "getentchannelscount" }, - { 0x1C9, "getentchannelname" }, - { 0x1CA, "objective_add" }, - { 0x1CB, "objective_delete" }, - { 0x1CC, "objective_state" }, - { 0x1CD, "objective_icon" }, - { 0x1CE, "objective_position" }, - { 0x1CF, "objective_current" }, - { 0x1D0, "weaponinventorytype" }, - { 0x1D1, "weaponstartammo" }, - { 0x1D2, "weaponmaxammo" }, - { 0x1D3, "weaponaltweaponname" }, - { 0x1D4, "isweaponcliponly" }, - { 0x1D5, "isweapondetonationtimed" }, - { 0x1D6, "weaponhasthermalscope" }, - { 0x1D7, "getvehiclenode" }, - { 0x1D8, "getvehiclenodearray" }, - { 0x1D9, "getallvehiclenodes" }, - { 0x1DA, "getnumvehicles" }, - { 0x1DB, "precachevehicle" }, - { 0x1DC, "spawnvehicle" }, - { 0x1DD, "vehicle_getarray" }, - { 0x1DE, "pow" }, - { 0x1DF, "botgetmemoryevents" }, - { 0x1E0, "botautoconnectenabled" }, - { 0x1E1, "botzonegetcount" }, - { 0x1E2, "botzonesetteam" }, - { 0x1E3, "botzonenearestcount" }, - { 0x1E4, "botmemoryflags" }, - { 0x1E5, "botflagmemoryevents" }, - { 0x1E6, "botzonegetindoorpercent" }, - { 0x1E7, "botsentientswap" }, - { 0x1E8, "isbot" }, - { 0x1E9, "isagent" }, - { 0x1EA, "getmaxagents" }, - { 0x1EB, "botdebugdrawtrigger" }, - { 0x1EC, "botgetclosestnavigablepoint" }, - { 0x1ED, "gettnodesintrigger" }, - { 0x1EE, "nodesvisible" }, - { 0x1EF, "getnodesonpath" }, - { 0x1F0, "getzonecount" }, - { 0x1F1, "getzonenearest" }, - { 0x1F2, "getzonenodes" }, - { 0x1F3, "getzonepath" }, - { 0x1F4, "getzoneorigin" }, - { 0x1F5, "getnodezone" }, - { 0x1F6, "getzonenodesbydist" }, - { 0x1F7, "getzonenodeforindex" }, - { 0x1F8, "getweaponexplosionradius" }, - { 0x1F9, "markdangerousnodes" }, - { 0x1FA, "markdangerousnodesintrigger" }, - { 0x1FB, "nodeexposedtosky" }, - { 0x1FC, "findentrances" }, - { 0x1FD, "badplace_global" }, - { 0x1FE, "getpathdist" }, - { 0x1FF, "getlinkednodes" }, - { 0x200, "disconnectnodepair" }, - { 0x201, "connectnodepair" }, - { 0x202, "drawsoundshape" }, - { 0x203, "gettimesincelastpaused" }, - { 0x204, "setlasermaterial" }, - { 0x205, "precachefxontag" }, - { 0x206, "precachetag" }, - { 0x207, "precachesound" }, - { 0x208, "devsetminimapdvarsettings" }, - { 0x209, "loadtransient" }, - { 0x20A, "unloadtransient" }, - { 0x20B, "unloadalltransients" }, - { 0x20C, "synctransients" }, - { 0x20D, "istransientqueued" }, - { 0x20E, "istransientloaded" }, - { 0x20F, "loadstartpointtransient" }, - { 0x210, "distance2dsquared" }, - { 0x211, "getangledelta3d" }, - { 0x212, "activateclientexploder" }, - { 0x213, "trajectorycalculateinitialvelocity" }, - { 0x214, "trajectorycalculateminimumvelocity" }, - { 0x215, "trajectorycalculateexitangle" }, - { 0x216, "trajectoryestimatedesiredinairtime" }, - { 0x217, "trajectorycomputedeltaheightattime" }, - { 0x218, "trajectorycanattemptaccuratejump" }, - { 0x219, "adddebugcommand" }, - { 0x21A, "ispointinvolume" }, - { 0x21B, "cinematicgettimeinmsec" }, - { 0x21C, "cinematicgetframe" }, - { 0x21D, "iscinematicloaded" }, - { 0x21E, "bbprint" }, - { 0x21F, "getenemysquaddata" }, - { 0x220, "lookupsoundlength" }, - { 0x221, "getscriptablearray" }, - { 0x222, "clearfog" }, - { 0x223, "setleveldopplerpreset" }, - { 0x224, "screenshake" }, - { 0x225, "anglestoaxis" }, - { 0x226, "visionsetwater" }, - { 0x227, "sendscriptusageanalysisdata" }, - { 0x228, "resetscriptusageanalysisdata" }, - { 0x229, "instantlylogusageanalysisdata" }, - { 0x22A, "invertangles" }, - { 0x22B, "rotatevectorinverted" }, - { 0x22C, "calculatestartorientation" }, - { 0x22D, "getcsplinecount" }, - { 0x22E, "getcsplinepointcount" }, - { 0x22F, "getcsplinelength" }, - { 0x230, "getcsplinepointid" }, - { 0x231, "getcsplinepointlabel" }, - { 0x232, "getcsplinepointtension" }, - { 0x233, "getcsplinepointposition" }, - { 0x234, "getcsplinepointcorridordims" }, - { 0x235, "getcsplinepointtangent" }, - { 0x236, "getcsplinepointdisttonextpoint" }, - { 0x237, "calccsplineposition" }, - { 0x238, "calccsplinetangent" }, - { 0x239, "calccsplinecorridor" }, - { 0x23A, "setnojipscore" }, - { 0x23B, "setnojiptime" }, - { 0x23C, "getpredictedentityposition" }, - { 0x23D, "gamedvrprohibitrecording" }, - { 0x23E, "gamedvrstartrecording" }, - { 0x23F, "gamedvrstoprecording" }, - { 0x240, "gamedvrsetvideometadata" }, - { 0x241, "gamedvrprohibitscreenshots" }, - { 0x242, "gamedvrsetscreenshotmetadata" }, - { 0x243, "queuedialog" }, - { 0x244, "speechenablegrammar" }, - { 0x245, "speechenable" }, - { 0x246, "livestreamingenable" }, - { 0x247, "livestreamingsetbitrate" }, - { 0x248, "triggerportableradarping" }, - { 0x249, "setglaregrimematerial" }, - { 0x24A, "botgetteamlimit" }, - { 0x24B, "spawnfxforclient" }, - { 0x24C, "botgetteamdifficulty" }, - { 0x24D, "getsquadassaultelo" }, - { 0x24E, "loadluifile" }, - { 0x24F, "isdedicatedserver" }, - { 0x250, "getplaylistversion" }, - { 0x251, "getplaylistid" }, - { 0x252, "getactiveclientcount" }, - { 0x253, "issquadsmode" }, - { 0x254, "getsquadassaultsquadindex" }, - { 0x255, "visionsetpostapply" }, - { 0x256, "addbot" }, - { 0x257, "ishairrunning" }, - { 0x258, "getsquadassaultenemyprestige" }, - { 0x259, "playcinematicforall" }, - { 0x25A, "preloadcinematicforall" }, - { 0x25B, "stopcinematicforall" }, - { 0x25C, "getenemysquaddogtype" }, - { 0x25D, "capsuletracepassed" }, -}}; - -const std::array, 1066> method_list -{{ - { 0x8000, "thermaldrawdisable" }, - { 0x8001, "setturretdismountorg" }, - { 0x8002, "setdamagestage" }, - { 0x8003, "playsoundtoteam" }, - { 0x8004, "playsoundtoplayer" }, - { 0x8005, "playerhide" }, - { 0x8006, "showtoplayer" }, - { 0x8007, "enableplayeruse" }, - { 0x8008, "disableplayeruse" }, - { 0x8009, "makescrambler" }, - { 0x800A, "makeportableradar" }, - { 0x800B, "clearscrambler" }, - { 0x800C, "clearportableradar" }, - { 0x800D, "placespawnpoint" }, - { 0x800E, "setteamfortrigger" }, - { 0x800F, "clientclaimtrigger" }, - { 0x8010, "clientreleasetrigger" }, - { 0x8011, "releaseclaimedtrigger" }, - { 0x8012, "isusingonlinedataoffline" }, - { 0x8013, "getrestedtime" }, - { 0x8014, "sendleaderboards" }, - { 0x8015, "isonladder" }, - { 0x8016, "getcorpseanim" }, - { 0x8017, "playerforcedeathanim" }, - { 0x8018, "attach" }, - { 0x8019, "attachshieldmodel" }, - { 0x801A, "getlightfovinner" }, - { 0x801B, "getlightfovouter" }, - { 0x801C, "setlightfovrange" }, - { 0x801D, "getlightexponent" }, - { 0x801E, "setlightexponent" }, - { 0x801F, "startragdoll" }, - { 0x8020, "startragdollfromimpact" }, - { 0x8021, "queryshouldearlyragdoll" }, - { 0x8022, "logstring" }, - { 0x8023, "laserhidefromclient" }, - { 0x8024, "stopsoundchannel" }, - { 0x8025, "thermaldrawenable" }, - { 0x8026, "detach" }, - { 0x8027, "detachshieldmodel" }, - { 0x8028, "moveshieldmodel" }, - { 0x8029, "detachall" }, - { 0x802A, "getattachsize" }, - { 0x802B, "getattachmodelname" }, - { 0x802C, "getattachtagname" }, - { 0x802D, "setturretcanaidetach" }, - { 0x802E, "setturretfov" }, - { 0x802F, "lerpfov" }, - { 0x8030, "getvalidcoverpeekouts" }, - { 0x8031, "gethighestnodestance" }, - { 0x8032, "doesnodeallowstance" }, - { 0x8033, "getgunangles" }, - { 0x8034, "magicgrenade" }, - { 0x8035, "magicgrenademanual" }, - { 0x8036, "getentnum" }, - { 0x8037, "launch" }, - { 0x8038, "setsoundblend" }, - { 0x8039, "makefakeai" }, - { 0x803A, "spawndrone" }, - { 0x803B, "setcorpseremovetimer" }, - { 0x803C, "setlookattext" }, - { 0x803D, "setspawnerteam" }, - { 0x803E, "addaieventlistener" }, - { 0x803F, "removeaieventlistener" }, - { 0x8040, "getlightcolor" }, - { 0x8041, "setlightcolor" }, - { 0x8042, "getlightradius" }, - { 0x8043, "setlightradius" }, - { 0x8044, "getattachignorecollision" }, - { 0x8045, "hidepart" }, - { 0x8046, "hidepart_allinstances" }, - { 0x8047, "hideallparts" }, - { 0x8048, "showpart" }, - { 0x8049, "showallparts" }, - { 0x804A, "linkto" }, - { 0x804B, "linktoblendtotag" }, - { 0x804C, "unlink" }, - { 0x804D, "setnormalhealth" }, - { 0x804E, "dodamage" }, - { 0x804F, "kill" }, - { 0x8050, "show" }, - { 0x8051, "hide" }, - { 0x8052, "showonclient" }, - { 0x8053, "hideonclient" }, - { 0x8054, "laserforceon" }, - { 0x8055, "laserforceoff" }, - { 0x8056, "disconnectpaths" }, - { 0x8057, "connectpaths" }, - { 0x8058, "disconnectnode" }, - { 0x8059, "connectnode" }, - { 0x805A, "startusingheroonlylighting" }, - { 0x805B, "stopusingheroonlylighting" }, - { 0x805C, "startusinglessfrequentlighting" }, - { 0x805D, "stopusinglessfrequentlighting" }, - { 0x805E, "setmovingplatformplayerturnrate" }, - { 0x805F, "setthermalfog" }, - { 0x8060, "setnightvisionfog" }, - { 0x8061, "clearthermalfog" }, - { 0x8062, "clearnightvisionfog" }, - { 0x8063, "digitaldistortsetparams" }, - { 0x8064, "setmode" }, - { 0x8065, "getmode" }, - { 0x8066, "setturretignoregoals" }, - { 0x8067, "islinked" }, - { 0x8068, "enablelinkto" }, - { 0x8069, "playsoundatviewheight" }, - { 0x806A, "prefetchsound" }, - { 0x806B, "setpitch" }, - { 0x806C, "scalepitch" }, - { 0x806D, "setvolume" }, - { 0x806E, "scalevolume" }, - { 0x806F, "setspeakermapmonotostereo" }, - { 0x8070, "setspeakermapmonoto51" }, - { 0x8071, "setdistributed2dsound" }, - { 0x8072, "playsoundasmaster" }, - { 0x8073, "playloopsound" }, - { 0x8074, "eqon" }, - { 0x8075, "eqoff" }, - { 0x8076, "haseq" }, - { 0x8077, "iswaitingonsound" }, - { 0x8078, "getnormalhealth" }, - { 0x8079, "playerlinkto" }, - { 0x807A, "playerlinktodelta" }, - { 0x807B, "playerlinkweaponviewtodelta" }, - { 0x807C, "playerlinktoabsolute" }, - { 0x807D, "playerlinktoblend" }, - { 0x807E, "playerlinkedoffsetenable" }, - { 0x807F, "setwaypointedgestyle_secondaryarrow" }, - { 0x8080, "setwaypointiconoffscreenonly" }, - { 0x8081, "fadeovertime" }, - { 0x8082, "scaleovertime" }, - { 0x8083, "moveovertime" }, - { 0x8084, "reset" }, - { 0x8085, "destroy" }, - { 0x8086, "setpulsefx" }, - { 0x8087, "setplayernamestring" }, - { 0x8088, "changefontscaleovertime" }, - { 0x8089, "startignoringspotlight" }, - { 0x808A, "stopignoringspotlight" }, - { 0x808B, "dontcastshadows" }, - { 0x808C, "castshadows" }, - { 0x808D, "setstablemissile" }, - { 0x808E, "playersetgroundreferenceent" }, - { 0x808F, "dontinterpolate" }, - { 0x8090, "dospawn" }, - { 0x8091, "stalingradspawn" }, - { 0x8092, "getorigin" }, - { 0x8093, "getcentroid" }, - { 0x8094, "getshootatpos" }, - { 0x8095, "getdebugeye" }, - { 0x8096, "useby" }, - { 0x8097, "playsound" }, - { 0x8098, "playerlinkedoffsetdisable" }, - { 0x8099, "playerlinkedsetviewznear" }, - { 0x809A, "playerlinkedsetusebaseangleforviewclamp" }, - { 0x809B, "lerpviewangleclamp" }, - { 0x809C, "setviewangleresistance" }, - { 0x809D, "springcamenabled" }, - { 0x809E, "springcamdisabled" }, - { 0x809F, "linktoplayerview" }, - { 0x80A0, "unlinkfromplayerview" }, - { 0x80A1, "geteye" }, - { 0x80A2, "istouching" }, - { 0x80A3, "getistouchingentities" }, - { 0x80A4, "stoploopsound" }, - { 0x80A5, "stopsounds" }, - { 0x80A6, "playrumbleonentity" }, - { 0x80A7, "playrumblelooponentity" }, - { 0x80A8, "stoprumble" }, - { 0x80A9, "delete" }, - { 0x80AA, "setmodel" }, - { 0x80AB, "laseron" }, - { 0x80AC, "laseroff" }, - { 0x80AD, "laseraltviewon" }, - { 0x80AE, "laseraltviewoff" }, - { 0x80AF, "thermalvisionon" }, - { 0x80B0, "thermalvisiononshadowoff" }, - { 0x80B1, "thermalvisionoff" }, - { 0x80B2, "thermalvisionfofoverlayon" }, - { 0x80B3, "thermalvisionfofoverlayoff" }, - { 0x80B4, "autospotoverlayon" }, - { 0x80B5, "autospotoverlayoff" }, - { 0x80B6, "seteyesonuplinkenabled" }, - { 0x80B7, "setcontents" }, - { 0x80B8, "makeusable" }, - { 0x80B9, "makeunusable" }, - { 0x80BA, "setwhizbyprobabilities" }, - { 0x80BB, "visionsetnakedforplayer_lerp" }, - { 0x80BC, "setwaitnode" }, - { 0x80BD, "returnplayercontrol" }, - { 0x80BE, "vehphys_starttrack" }, - { 0x80BF, "vehphys_clearautodisable" }, - { 0x80C0, "vehicleusealtblendedaudio" }, - { 0x80C1, "settext" }, - { 0x80C2, "clearalltextafterhudelem" }, - { 0x80C3, "setshader" }, - { 0x80C4, "settargetent" }, - { 0x80C5, "cleartargetent" }, - { 0x80C6, "settimer" }, - { 0x80C7, "settimerup" }, - { 0x80C8, "settimerstatic" }, - { 0x80C9, "settenthstimer" }, - { 0x80CA, "settenthstimerup" }, - { 0x80CB, "settenthstimerstatic" }, - { 0x80CC, "setclock" }, - { 0x80CD, "setclockup" }, - { 0x80CE, "setvalue" }, - { 0x80CF, "setwaypoint" }, - { 0x80D0, "setwaypointedgestyle_rotatingicon" }, - { 0x80D1, "setcursorhint" }, - { 0x80D2, "sethintstring" }, - { 0x80D3, "forceusehinton" }, - { 0x80D4, "forceusehintoff" }, - { 0x80D5, "makesoft" }, - { 0x80D6, "makehard" }, - { 0x80D7, "willneverchange" }, - { 0x80D8, "startfiring" }, - { 0x80D9, "stopfiring" }, - { 0x80DA, "isfiringturret" }, - { 0x80DB, "startbarrelspin" }, - { 0x80DC, "stopbarrelspin" }, - { 0x80DD, "getbarrelspinrate" }, - { 0x80DE, "remotecontrolturret" }, - { 0x80DF, "remotecontrolturretoff" }, - { 0x80E0, "shootturret" }, - { 0x80E1, "getturretowner" }, - { 0x80E2, "enabledeathshield" }, - { 0x80E3, "nightvisiongogglesforceon" }, - { 0x80E4, "nightvisiongogglesforceoff" }, - { 0x80E5, "enableinvulnerability" }, - { 0x80E6, "disableinvulnerability" }, - { 0x80E7, "enablebreaching" }, - { 0x80E8, "disablebreaching" }, - { 0x80E9, "forceviewmodelanimation" }, - { 0x80EA, "disableturretdismount" }, - { 0x80EB, "enableturretdismount" }, - { 0x80EC, "uploadscore" }, - { 0x80ED, "uploadtime" }, - { 0x80EE, "uploadleaderboards" }, - { 0x80EF, "giveachievement" }, - { 0x80F0, "hidehud" }, - { 0x80F1, "showhud" }, - { 0x80F2, "mountvehicle" }, - { 0x80F3, "dismountvehicle" }, - { 0x80F4, "enableslowaim" }, - { 0x80F5, "disableslowaim" }, - { 0x80F6, "usehintsinvehicle" }, - { 0x80F7, "vehicleattackbuttonpressed" }, - { 0x80F8, "setwhizbyoffset" }, - { 0x80F9, "setsentryowner" }, - { 0x80FA, "setsentrycarrier" }, - { 0x80FB, "setturretminimapvisible" }, - { 0x80FC, "settargetentity" }, - { 0x80FD, "snaptotargetentity" }, - { 0x80FE, "cleartargetentity" }, - { 0x80FF, "getturrettarget" }, - { 0x8100, "setplayerspread" }, - { 0x8101, "setaispread" }, - { 0x8102, "setsuppressiontime" }, - { 0x8103, "setflaggedanimknobrestart" }, - { 0x8104, "setflaggedanimknoblimitedrestart" }, - { 0x8105, "setflaggedanimknoball" }, - { 0x8106, "setflaggedanimknoballrestart" }, - { 0x8107, "setflaggedanim" }, - { 0x8108, "setflaggedanimlimited" }, - { 0x8109, "setflaggedanimrestart" }, - { 0x810A, "setflaggedanimlimitedrestart" }, - { 0x810B, "useanimtree" }, - { 0x810C, "stopuseanimtree" }, - { 0x810D, "setanimtime" }, - { 0x810E, "showviewmodel" }, - { 0x810F, "hideviewmodel" }, - { 0x8110, "allowstand" }, - { 0x8111, "allowcrouch" }, - { 0x8112, "allowprone" }, - { 0x8113, "allowlean" }, - { 0x8114, "allowswim" }, - { 0x8115, "setocclusion" }, - { 0x8116, "setocclusionfromtable" }, - { 0x8117, "deactivateocclusion" }, - { 0x8118, "deactivateallocclusion" }, - { 0x8119, "isocclusionenabled" }, - { 0x811A, "setreverbfromtable" }, - { 0x811B, "setvolmodfromtable" }, - { 0x811C, "settimescalefactorfromtable" }, - { 0x811D, "setwhizbyfromtable" }, - { 0x811E, "seteqfromtable" }, - { 0x811F, "iseqenabled" }, - { 0x8120, "seteq" }, - { 0x8121, "seteqbands" }, - { 0x8122, "deactivateeq" }, - { 0x8123, "seteqlerp" }, - { 0x8124, "islookingat" }, - { 0x8125, "isthrowinggrenade" }, - { 0x8126, "isfiring" }, - { 0x8127, "ismeleeing" }, - { 0x8128, "setautopickup" }, - { 0x8129, "allowmelee" }, - { 0x812A, "allowfire" }, - { 0x812B, "enablehealthshield" }, - { 0x812C, "setconvergencetime" }, - { 0x812D, "setconvergenceheightpercent" }, - { 0x812E, "setturretteam" }, - { 0x812F, "maketurretsolid" }, - { 0x8130, "maketurretoperable" }, - { 0x8131, "maketurretinoperable" }, - { 0x8132, "makeentitysentient" }, - { 0x8133, "freeentitysentient" }, - { 0x8134, "isindoor" }, - { 0x8135, "getdroptofloorposition" }, - { 0x8136, "isbadguy" }, - { 0x8137, "animscripted" }, - { 0x8138, "animscriptedthirdperson" }, - { 0x8139, "animrelative" }, - { 0x813A, "stopanimscripted" }, - { 0x813B, "clearanim" }, - { 0x813C, "setanimknob" }, - { 0x813D, "setanimknoblimited" }, - { 0x813E, "setanimknobrestart" }, - { 0x813F, "setanimknoblimitedrestart" }, - { 0x8140, "setanimknoball" }, - { 0x8141, "setanimknoballlimited" }, - { 0x8142, "setanimknoballrestart" }, - { 0x8143, "setanimknoballlimitedrestart" }, - { 0x8144, "setanim" }, - { 0x8145, "setanimlimited" }, - { 0x8146, "setanimrestart" }, - { 0x8147, "setanimlimitedrestart" }, - { 0x8148, "getanimtime" }, - { 0x8149, "getanimweight" }, - { 0x814A, "getanimassettype" }, - { 0x814B, "setflaggedanimknob" }, - { 0x814C, "setflaggedanimknoblimited" }, - { 0x814D, "setturretaccuracy" }, - { 0x814E, "setrightarc" }, - { 0x814F, "setleftarc" }, - { 0x8150, "settoparc" }, - { 0x8151, "setbottomarc" }, - { 0x8152, "setautorotationdelay" }, - { 0x8153, "setdefaultdroppitch" }, - { 0x8154, "restoredefaultdroppitch" }, - { 0x8155, "turretfiredisable" }, - { 0x8156, "getfixednodesafevolume" }, - { 0x8157, "clearfixednodesafevolume" }, - { 0x8158, "isingoal" }, - { 0x8159, "setruntopos" }, - { 0x815A, "nearnode" }, - { 0x815B, "nearclaimnode" }, - { 0x815C, "nearclaimnodeandangle" }, - { 0x815D, "atdangerousnode" }, - { 0x815E, "getenemyinfo" }, - { 0x815F, "clearenemy" }, - { 0x8160, "setentitytarget" }, - { 0x8161, "clearentitytarget" }, - { 0x8162, "setpotentialthreat" }, - { 0x8163, "clearpotentialthreat" }, - { 0x8164, "setflashbanged" }, - { 0x8165, "setengagementmindist" }, - { 0x8166, "setengagementmaxdist" }, - { 0x8167, "isknownenemyinradius" }, - { 0x8168, "isknownenemyinvolume" }, - { 0x8169, "settalktospecies" }, - { 0x816A, "laseralton" }, - { 0x816B, "laseraltoff" }, - { 0x816C, "invisiblenotsolid" }, - { 0x816D, "visiblesolid" }, - { 0x816E, "setdefaultaimlimits" }, - { 0x816F, "initriotshieldhealth" }, - { 0x8170, "getenemysqdist" }, - { 0x8171, "getclosestenemysqdist" }, - { 0x8172, "setthreatbiasgroup" }, - { 0x8173, "getthreatbiasgroup" }, - { 0x8174, "turretfireenable" }, - { 0x8175, "setturretmodechangewait" }, - { 0x8176, "usetriggerrequirelookat" }, - { 0x8177, "getstance" }, - { 0x8178, "setstance" }, - { 0x8179, "itemweaponsetammo" }, - { 0x817A, "getammocount" }, - { 0x817B, "gettagorigin" }, - { 0x817C, "gettagangles" }, - { 0x817D, "shellshock" }, - { 0x817E, "stunplayer" }, - { 0x817F, "stopshellshock" }, - { 0x8180, "fadeoutshellshock" }, - { 0x8181, "setdepthoffield" }, - { 0x8182, "setviewmodeldepthoffield" }, - { 0x8183, "setmotionblurmovescale" }, - { 0x8184, "pickupgrenade" }, - { 0x8185, "useturret" }, - { 0x8186, "stopuseturret" }, - { 0x8187, "canuseturret" }, - { 0x8188, "traversemode" }, - { 0x8189, "animmode" }, - { 0x818A, "orientmode" }, - { 0x818B, "getmotionangle" }, - { 0x818C, "shouldfacemotion" }, - { 0x818D, "getanglestolikelyenemypath" }, - { 0x818E, "setturretanim" }, - { 0x818F, "getturret" }, - { 0x8190, "getgroundenttype" }, - { 0x8191, "forcestartnegotiation" }, - { 0x8192, "setalienjumpcostscale" }, - { 0x8193, "setalienruncostscale" }, - { 0x8194, "setalientraversecostscale" }, - { 0x8195, "animcustom" }, - { 0x8196, "isinscriptedstate" }, - { 0x8197, "canattackenemynode" }, - { 0x8198, "getnegotiationstartnode" }, - { 0x8199, "getnegotiationendnode" }, - { 0x819A, "getnegotiationnextnode" }, - { 0x819B, "getdoorpathnode" }, - { 0x819C, "comparenodedirtopathdir" }, - { 0x819D, "checkprone" }, - { 0x819E, "pushplayer" }, - { 0x819F, "checkgrenadethrowpos" }, - { 0x81A0, "setgoalnode" }, - { 0x81A1, "setgoalpos" }, - { 0x81A2, "setgoalentity" }, - { 0x81A3, "setgoalvolume" }, - { 0x81A4, "setgoalvolumeauto" }, - { 0x81A5, "getgoalvolume" }, - { 0x81A6, "cleargoalvolume" }, - { 0x81A7, "setfixednodesafevolume" }, - { 0x81A8, "setmotionblurturnscale" }, - { 0x81A9, "setmotionblurzoomscale" }, - { 0x81AA, "viewkick" }, - { 0x81AB, "localtoworldcoords" }, - { 0x81AC, "getentitynumber" }, - { 0x81AD, "getentityvelocity" }, - { 0x81AE, "enablegrenadetouchdamage" }, - { 0x81AF, "disablegrenadetouchdamage" }, - { 0x81B0, "enableaimassist" }, - { 0x81B1, "setlookatyawlimits" }, - { 0x81B2, "stoplookat" }, - { 0x81B3, "getmuzzlepos" }, - { 0x81B4, "getmuzzleangle" }, - { 0x81B5, "getmuzzlesideoffsetpos" }, - { 0x81B6, "getaimangle" }, - { 0x81B7, "canshoot" }, - { 0x81B8, "canshootenemy" }, - { 0x81B9, "cansee" }, - { 0x81BA, "seerecently" }, - { 0x81BB, "lastknowntime" }, - { 0x81BC, "lastknownpos" }, - { 0x81BD, "dropweapon" }, - { 0x81BE, "maymovetopoint" }, - { 0x81BF, "maymovefrompointtopoint" }, - { 0x81C0, "teleport" }, - { 0x81C1, "forceteleport" }, - { 0x81C2, "safeteleport" }, - { 0x81C3, "withinapproxpathdist" }, - { 0x81C4, "ispathdirect" }, - { 0x81C5, "allowedstances" }, - { 0x81C6, "isstanceallowed" }, - { 0x81C7, "issuppressionwaiting" }, - { 0x81C8, "issuppressed" }, - { 0x81C9, "ismovesuppressed" }, - { 0x81CA, "isgrenadepossafe" }, - { 0x81CB, "checkgrenadethrow" }, - { 0x81CC, "checkgrenadelaunch" }, - { 0x81CD, "checkgrenadelaunchpos" }, - { 0x81CE, "throwgrenade" }, - { 0x81CF, "disableaimassist" }, - { 0x81D0, "radiusdamage" }, - { 0x81D1, "detonate" }, - { 0x81D2, "damageconetrace" }, - { 0x81D3, "sightconetrace" }, - { 0x81D4, "missile_settargetent" }, - { 0x81D5, "missile_settargetpos" }, - { 0x81D6, "missile_cleartarget" }, - { 0x81D7, "missile_setflightmodedirect" }, - { 0x81D8, "missile_setflightmodetop" }, - { 0x81D9, "getlightintensity" }, - { 0x81DA, "setlightintensity" }, - { 0x81DB, "isragdoll" }, - { 0x81DC, "setmovespeedscale" }, - { 0x81DD, "cameralinkto" }, - { 0x81DE, "cameraunlink" }, - { 0x81DF, "startcoverarrival" }, - { 0x81E0, "starttraversearrival" }, - { 0x81E1, "checkcoverexitposwithpath" }, - { 0x81E2, "shoot" }, - { 0x81E3, "shootblank" }, - { 0x81E4, "melee" }, - { 0x81E5, "updateplayersightaccuracy" }, - { 0x81E6, "findshufflecovernode" }, - { 0x81E7, "findnearbycovernode" }, - { 0x81E8, "findcovernode" }, - { 0x81E9, "findbestcovernode" }, - { 0x81EA, "getcovernode" }, - { 0x81EB, "usecovernode" }, - { 0x81EC, "iscovervalidagainstenemy" }, - { 0x81ED, "reacquirestep" }, - { 0x81EE, "findreacquiredirectpath" }, - { 0x81EF, "trimpathtoattack" }, - { 0x81F0, "reacquiremove" }, - { 0x81F1, "findreacquireproximatepath" }, - { 0x81F2, "flagenemyunattackable" }, - { 0x81F3, "enterprone" }, - { 0x81F4, "exitprone" }, - { 0x81F5, "setproneanimnodes" }, - { 0x81F6, "updateprone" }, - { 0x81F7, "clearpitchorient" }, - { 0x81F8, "setlookatanimnodes" }, - { 0x81F9, "setlookat" }, - { 0x81FA, "setlookatentity" }, - { 0x81FB, "controlslinkto" }, - { 0x81FC, "controlsunlink" }, - { 0x81FD, "makevehiclesolidcapsule" }, - { 0x81FE, "teleportentityrelative" }, - { 0x81FF, "makevehiclesolidsphere" }, - { 0x8200, "makevehiclesolid" }, - { 0x8201, "remotecontrolvehicle" }, - { 0x8202, "remotecontrolvehicleoff" }, - { 0x8203, "isfiringvehicleturret" }, - { 0x8204, "remotecontrolvehicletarget" }, - { 0x8205, "remotecontrolvehicletargetoff" }, - { 0x8206, "drivevehicleandcontrolturret" }, - { 0x8207, "drivevehicleandcontrolturretoff" }, - { 0x8208, "getplayersetting" }, - { 0x8209, "getlocalplayerprofiledata" }, - { 0x820A, "setlocalplayerprofiledata" }, - { 0x820B, "remotecamerasoundscapeon" }, - { 0x820C, "remotecamerasoundscapeoff" }, - { 0x820D, "setmotiontrackervisible" }, - { 0x820E, "getmotiontrackervisible" }, - { 0x820F, "worldpointinreticle_circle" }, - { 0x8210, "worldpointinreticle_rect" }, - { 0x8211, "getpointinbounds" }, - { 0x8212, "transfermarkstonewscriptmodel" }, - { 0x8213, "setwatersheeting" }, - { 0x8214, "addontoviewmodel" }, - { 0x8215, "clearviewmodeladdons" }, - { 0x8216, "setweaponhudiconoverride" }, - { 0x8217, "getweaponhudiconoverride" }, - { 0x8218, "setempjammed" }, - { 0x8219, "playersetexpfog" }, - { 0x821A, "isitemunlocked" }, - { 0x821B, "getplayerdata" }, - { 0x821C, "getrankedplayerdata" }, - { 0x821D, "getprivateplayerdata" }, - { 0x821E, "getcoopplayerdata" }, - { 0x821F, "getcommonplayerdata" }, - { 0x8220, "vehicleturretcontroloff" }, - { 0x8221, "isturretready" }, - { 0x8222, "vehicledriveto" }, - { 0x8223, "vehicle_dospawn" }, - { 0x8224, "vehicle_isphysveh" }, - { 0x8225, "vehphys_crash" }, - { 0x8226, "vehphys_launch" }, - { 0x8227, "vehphys_disablecrashing" }, - { 0x8228, "vehphys_enablecrashing" }, - { 0x8229, "vehphys_setspeed" }, - { 0x822A, "vehphys_setconveyorbelt" }, - { 0x822B, "freehelicopter" }, - { 0x822C, "playerlinkedturretanglesenable" }, - { 0x822D, "playerlinkedturretanglesdisable" }, - { 0x822E, "playersetstreamorigin" }, - { 0x822F, "playerclearstreamorigin" }, - { 0x8230, "nightvisionviewon" }, - { 0x8231, "nightvisionviewoff" }, - { 0x8232, "painvisionon" }, - { 0x8233, "painvisionoff" }, - { 0x8234, "getplayerintelisfound" }, - { 0x8235, "setplayerintelfound" }, - { 0x8236, "newpip" }, - { 0x8237, "sethuddynlight" }, - { 0x8238, "startscriptedanim" }, - { 0x8239, "startcoverbehavior" }, - { 0x823A, "setplayerdata" }, - { 0x823B, "setrankedplayerdata" }, - { 0x823C, "setprivateplayerdata" }, - { 0x823D, "setcoopplayerdata" }, - { 0x823E, "setcommonplayerdata" }, - { 0x823F, "getcacplayerdata" }, - { 0x8240, "trackerupdate" }, - { 0x8241, "pingplayer" }, - { 0x8242, "buttonpressed" }, - { 0x8243, "sayall" }, - { 0x8244, "sayteam" }, - { 0x8245, "setspawnweapon" }, - { 0x8246, "dropitem" }, - { 0x8247, "dropscavengerbag" }, - { 0x8248, "setjitterparams" }, - { 0x8249, "sethoverparams" }, - { 0x824A, "joltbody" }, - { 0x824B, "freevehicle" }, - { 0x824C, "getwheelsurface" }, - { 0x824D, "getvehicleowner" }, - { 0x824E, "setvehiclelookattext" }, - { 0x824F, "setvehicleteam" }, - { 0x8250, "setneargoalnotifydist" }, - { 0x8251, "setvehgoalpos" }, - { 0x8252, "setgoalyaw" }, - { 0x8253, "cleargoalyaw" }, - { 0x8254, "settargetyaw" }, - { 0x8255, "cleartargetyaw" }, - { 0x8256, "vehicle_helisetai" }, - { 0x8257, "setturrettargetvec" }, - { 0x8258, "setturrettargetent" }, - { 0x8259, "clearturrettarget" }, - { 0x825A, "vehicle_canturrettargetpoint" }, - { 0x825B, "setlookatent" }, - { 0x825C, "clearlookatent" }, - { 0x825D, "setvehweapon" }, - { 0x825E, "fireweapon" }, - { 0x825F, "vehicleturretcontrolon" }, - { 0x8260, "finishplayerdamage" }, - { 0x8261, "suicide" }, - { 0x8262, "closeingamemenu" }, - { 0x8263, "iprintln" }, - { 0x8264, "iprintlnbold" }, - { 0x8265, "spawn" }, - { 0x8266, "setentertime" }, - { 0x8267, "cloneplayer" }, - { 0x8268, "istalking" }, - { 0x8269, "allowspectateteam" }, - { 0x826A, "getguid" }, - { 0x826B, "physicslaunchserver" }, - { 0x826C, "physicslaunchserveritem" }, - { 0x826D, "clonebrushmodeltoscriptmodel" }, - { 0x826E, "scriptmodelplayanim" }, - { 0x826F, "scriptmodelclearanim" }, - { 0x8270, "scriptmodelplayanimdeltamotion" }, - { 0x8271, "vehicle_teleport" }, - { 0x8272, "attachpath" }, - { 0x8273, "getattachpos" }, - { 0x8274, "startpath" }, - { 0x8275, "setswitchnode" }, - { 0x8276, "setwaitspeed" }, - { 0x8277, "vehicle_finishdamage" }, - { 0x8278, "vehicle_setspeed" }, - { 0x8279, "vehicle_setspeedimmediate" }, - { 0x827A, "vehicle_rotateyaw" }, - { 0x827B, "vehicle_getspeed" }, - { 0x827C, "vehicle_getvelocity" }, - { 0x827D, "vehicle_getbodyvelocity" }, - { 0x827E, "vehicle_getsteering" }, - { 0x827F, "vehicle_getthrottle" }, - { 0x8280, "vehicle_turnengineoff" }, - { 0x8281, "vehicle_turnengineon" }, - { 0x8282, "vehicle_orientto" }, - { 0x8283, "getgoalspeedmph" }, - { 0x8284, "setacceleration" }, - { 0x8285, "setdeceleration" }, - { 0x8286, "resumespeed" }, - { 0x8287, "setyawspeed" }, - { 0x8288, "setyawspeedbyname" }, - { 0x8289, "setmaxpitchroll" }, - { 0x828A, "setairresistance" }, - { 0x828B, "setturningability" }, - { 0x828C, "getxuid" }, - { 0x828D, "getucdidhigh" }, - { 0x828E, "getucdidlow" }, - { 0x828F, "getclanidhigh" }, - { 0x8290, "getclanidlow" }, - { 0x8291, "ishost" }, - { 0x8292, "getspectatingplayer" }, - { 0x8293, "predictstreampos" }, - { 0x8294, "updatescores" }, - { 0x8295, "updatedmscores" }, - { 0x8296, "setrank" }, - { 0x8297, "setcardtitle" }, - { 0x8298, "weaponlocknoclearance" }, - { 0x8299, "visionsyncwithplayer" }, - { 0x829A, "showhudsplash" }, - { 0x829B, "setperk" }, - { 0x829C, "hasperk" }, - { 0x829D, "clearperks" }, - { 0x829E, "unsetperk" }, - { 0x829F, "registerparty" }, - { 0x82A0, "getfireteammembers" }, - { 0x82A1, "noclip" }, - { 0x82A2, "ufo" }, - { 0x82A3, "moveto" }, - { 0x82A4, "movex" }, - { 0x82A5, "movey" }, - { 0x82A6, "movez" }, - { 0x82A7, "movegravity" }, - { 0x82A8, "moveslide" }, - { 0x82A9, "stopmoveslide" }, - { 0x82AA, "rotateto" }, - { 0x82AB, "rotatepitch" }, - { 0x82AC, "rotateyaw" }, - { 0x82AD, "rotateroll" }, - { 0x82AE, "addpitch" }, - { 0x82AF, "addyaw" }, - { 0x82B0, "addroll" }, - { 0x82B1, "vibrate" }, - { 0x82B2, "rotatevelocity" }, - { 0x82B3, "solid" }, - { 0x82B4, "notsolid" }, - { 0x82B5, "setcandamage" }, - { 0x82B6, "setcanradiusdamage" }, - { 0x82B7, "physicslaunchclient" }, - { 0x82B8, "setcardicon" }, - { 0x82B9, "setcardnameplate" }, - { 0x82BA, "setcarddisplayslot" }, - { 0x82BB, "kc_regweaponforfxremoval" }, - { 0x82BC, "laststandrevive" }, - { 0x82BD, "setspectatedefaults" }, - { 0x82BE, "getthirdpersoncrosshairoffset" }, - { 0x82BF, "disableweaponpickup" }, - { 0x82C0, "enableweaponpickup" }, - { 0x82C1, "issplitscreenplayer" }, - { 0x82C2, "getweaponslistoffhands" }, - { 0x82C3, "getweaponslistitems" }, - { 0x82C4, "getweaponslistexclusives" }, - { 0x82C5, "getweaponslist" }, - { 0x82C6, "canplayerplacesentry" }, - { 0x82C7, "canplayerplacetank" }, - { 0x82C8, "visionsetnakedforplayer" }, - { 0x82C9, "visionsetnightforplayer" }, - { 0x82CA, "visionsetmissilecamforplayer" }, - { 0x82CB, "visionsetthermalforplayer" }, - { 0x82CC, "visionsetpainforplayer" }, - { 0x82CD, "setblurforplayer" }, - { 0x82CE, "getplayerweaponmodel" }, - { 0x82CF, "getplayerknifemodel" }, - { 0x82D0, "updateentitywithweapons" }, - { 0x82D1, "notifyonplayercommand" }, - { 0x82D2, "canmantle" }, - { 0x82D3, "forcemantle" }, - { 0x82D4, "ismantling" }, - { 0x82D5, "playfx" }, - { 0x82D6, "player_recoilscaleon" }, - { 0x82D7, "player_recoilscaleoff" }, - { 0x82D8, "weaponlockstart" }, - { 0x82D9, "weaponlockfinalize" }, - { 0x82DA, "weaponlockfree" }, - { 0x82DB, "weaponlocktargettooclose" }, - { 0x82DC, "issplitscreenplayerprimary" }, - { 0x82DD, "markforeyeson" }, - { 0x82DE, "issighted" }, - { 0x82DF, "getsightedplayers" }, - { 0x82E0, "getplayerssightingme" }, - { 0x82E1, "getviewmodel" }, - { 0x82E2, "fragbuttonpressed" }, - { 0x82E3, "secondaryoffhandbuttonpressed" }, - { 0x82E4, "getcurrentweaponclipammo" }, - { 0x82E5, "setvelocity" }, - { 0x82E6, "getplayerviewheight" }, - { 0x82E7, "getnormalizedmovement" }, - { 0x82E8, "setchannelvolumes" }, - { 0x82E9, "deactivatechannelvolumes" }, - { 0x82EA, "playlocalsound" }, - { 0x82EB, "stoplocalsound" }, - { 0x82EC, "setweaponammoclip" }, - { 0x82ED, "setweaponammostock" }, - { 0x82EE, "getweaponammoclip" }, - { 0x82EF, "getweaponammostock" }, - { 0x82F0, "anyammoforweaponmodes" }, - { 0x82F1, "setclientomnvar" }, - { 0x82F2, "setclientdvar" }, - { 0x82F3, "setclientdvars" }, - { 0x82F4, "setclientspawnsighttraces" }, - { 0x82F5, "clientspawnsighttracepassed" }, - { 0x82F6, "allowads" }, - { 0x82F7, "allowjump" }, - { 0x82F8, "allowsprint" }, - { 0x82F9, "setspreadoverride" }, - { 0x82FA, "resetspreadoverride" }, - { 0x82FB, "setaimspreadmovementscale" }, - { 0x82FC, "setactionslot" }, - { 0x82FD, "setviewkickscale" }, - { 0x82FE, "getviewkickscale" }, - { 0x82FF, "getweaponslistall" }, - { 0x8300, "getweaponslistprimaries" }, - { 0x8301, "getnormalizedcameramovement" }, - { 0x8302, "giveweapon" }, - { 0x8303, "takeweapon" }, - { 0x8304, "takeallweapons" }, - { 0x8305, "getcurrentweapon" }, - { 0x8306, "getcurrentprimaryweapon" }, - { 0x8307, "getcurrentoffhand" }, - { 0x8308, "hasweapon" }, - { 0x8309, "switchtoweapon" }, - { 0x830A, "switchtoweaponimmediate" }, - { 0x830B, "switchtooffhand" }, - { 0x830C, "setoffhandsecondaryclass" }, - { 0x830D, "getoffhandsecondaryclass" }, - { 0x830E, "beginlocationselection" }, - { 0x830F, "endlocationselection" }, - { 0x8310, "disableweapons" }, - { 0x8311, "enableweapons" }, - { 0x8312, "disableoffhandweapons" }, - { 0x8313, "enableoffhandweapons" }, - { 0x8314, "disableweaponswitch" }, - { 0x8315, "enableweaponswitch" }, - { 0x8316, "openpopupmenu" }, - { 0x8317, "openpopupmenunomouse" }, - { 0x8318, "closepopupmenu" }, - { 0x8319, "openmenu" }, - { 0x831A, "closemenu" }, - { 0x831B, "savematchrulestohistory" }, - { 0x831C, "freezecontrols" }, - { 0x831D, "disableusability" }, - { 0x831E, "enableusability" }, - { 0x831F, "setwhizbyspreads" }, - { 0x8320, "setwhizbyradii" }, - { 0x8321, "setreverb" }, - { 0x8322, "deactivatereverb" }, - { 0x8323, "setvolmod" }, - { 0x8324, "setchannelvolume" }, - { 0x8325, "givestartammo" }, - { 0x8326, "givemaxammo" }, - { 0x8327, "getfractionstartammo" }, - { 0x8328, "getfractionmaxammo" }, - { 0x8329, "isdualwielding" }, - { 0x832A, "isreloading" }, - { 0x832B, "isswitchingweapon" }, - { 0x832C, "setorigin" }, - { 0x832D, "getvelocity" }, - { 0x832E, "setplayerangles" }, - { 0x832F, "getplayerangles" }, - { 0x8330, "usebuttonpressed" }, - { 0x8331, "attackbuttonpressed" }, - { 0x8332, "adsbuttonpressed" }, - { 0x8333, "meleebuttonpressed" }, - { 0x8334, "playerads" }, - { 0x8335, "isonground" }, - { 0x8336, "isusingturret" }, - { 0x8337, "setviewmodel" }, - { 0x8338, "setoffhandprimaryclass" }, - { 0x8339, "getoffhandprimaryclass" }, - { 0x833A, "startac130" }, - { 0x833B, "stopac130" }, - { 0x833C, "enablemousesteer" }, - { 0x833D, "setscriptmoverkillcam" }, - { 0x833E, "usinggamepad" }, - { 0x833F, "forcethirdpersonwhenfollowing" }, - { 0x8340, "disableforcethirdpersonwhenfollowing" }, - { 0x8341, "botsetflag" }, - { 0x8342, "botsetstance" }, - { 0x8343, "botsetscriptmove" }, - { 0x8344, "botsetscriptgoal" }, - { 0x8345, "botsetscriptgoalnode" }, - { 0x8346, "botclearscriptgoal" }, - { 0x8347, "botsetscriptenemy" }, - { 0x8348, "botclearscriptenemy" }, - { 0x8349, "botsetattacker" }, - { 0x834A, "botgetscriptgoal" }, - { 0x834B, "botgetscriptgoalradius" }, - { 0x834C, "botgetscriptgoalyaw" }, - { 0x834D, "botgetscriptgoaltype" }, - { 0x834E, "botgetentrancepoint" }, - { 0x834F, "botgetworldsize" }, - { 0x8350, "botnodeavailable" }, - { 0x8351, "botfindnoderandom" }, - { 0x8352, "botmemoryevent" }, - { 0x8353, "botmemoryselectpos" }, - { 0x8354, "botnodepick" }, - { 0x8355, "bothasscriptgoal" }, - { 0x8356, "botgetpersonality" }, - { 0x8357, "botthrowgrenade" }, - { 0x8358, "botgetmemoryevents" }, - { 0x8359, "botsetpersonality" }, - { 0x835A, "botsetdifficulty" }, - { 0x835B, "botgetdifficulty" }, - { 0x835C, "botgetworldclosestedge" }, - { 0x835D, "botlookatpoint" }, - { 0x835E, "botpredictseepoint" }, - { 0x835F, "botcanseeentity" }, - { 0x8360, "botgetnodesonpath" }, - { 0x8361, "botnodepickmultiple" }, - { 0x8362, "botgetnearestnode" }, - { 0x8363, "botgetfovdot" }, - { 0x8364, "botsetawareness" }, - { 0x8365, "botpursuingscriptgoal" }, - { 0x8366, "botgetscriptgoalnode" }, - { 0x8367, "botgetimperfectenemyinfo" }, - { 0x8368, "botflagmemoryevents" }, - { 0x8369, "botsetpathingstyle" }, - { 0x836A, "botsetdifficultysetting" }, - { 0x836B, "botgetdifficultysetting" }, - { 0x836C, "botgetpathdist" }, - { 0x836D, "botisrandomized" }, - { 0x836E, "botpressbutton" }, - { 0x836F, "botclearbutton" }, - { 0x8370, "botnodescoremultiple" }, - { 0x8371, "getnodenumber" }, - { 0x8372, "setclientowner" }, - { 0x8373, "setotherent" }, - { 0x8374, "playercommandbot" }, - { 0x8375, "setaisightlinevisible" }, - { 0x8376, "setentityowner" }, - { 0x8377, "nodeisdisconnected" }, - { 0x8378, "getnearestnode" }, - { 0x8379, "makeentitynomeleetarget" }, - { 0x837A, "isagent" }, - { 0x837B, "spawnagent" }, - { 0x837C, "finishagentdamage" }, - { 0x837D, "setagentattacker" }, - { 0x837E, "cloneagent" }, - { 0x837F, "agentcanseesentient" }, - { 0x8380, "scragentsetwaypoint" }, - { 0x8381, "scragentsetgoalpos" }, - { 0x8382, "scragentgetgoalpos" }, - { 0x8383, "scragentsetgoalnode" }, - { 0x8384, "scragentsetgoalentity" }, - { 0x8385, "scragentsetgoalradius" }, - { 0x8386, "scragentsetanimscale" }, - { 0x8387, "scragentsetorientmode" }, - { 0x8388, "scragentsetanimmode" }, - { 0x8389, "scragentsetphysicsmode" }, - { 0x838A, "scragentsetclipmode" }, - { 0x838B, "scragentsetmaxturnspeed" }, - { 0x838C, "scragentgetmaxturnspeed" }, - { 0x838D, "scragentbeginmelee" }, - { 0x838E, "scragentsetscripted" }, - { 0x838F, "scragentdotrajectory" }, - { 0x8390, "scragentdoanimlerp" }, - { 0x8391, "scragentsetviewheight" }, - { 0x8392, "scragentclaimnode" }, - { 0x8393, "scragentrelinquishclaimednode" }, - { 0x8394, "setdoghandler" }, - { 0x8395, "setdogcommand" }, - { 0x8396, "setdogattackradius" }, - { 0x8397, "isdogfollowinghandler" }, - { 0x8398, "setdogmaxdrivespeed" }, - { 0x8399, "isdogbeingdriven" }, - { 0x839A, "setdogautoattackwhendriven" }, - { 0x839B, "getdogattackbeginnode" }, - { 0x839C, "setanimclass" }, - { 0x839D, "enableanimstate" }, - { 0x839E, "setanimstate" }, - { 0x839F, "getanimentry" }, - { 0x83A0, "getanimentryname" }, - { 0x83A1, "getanimentryalias" }, - { 0x83A2, "getanimentrycount" }, - { 0x83A3, "pushplayervector" }, - { 0x83A4, "issprinting" }, - { 0x83A5, "playerlinkeduselinkedvelocity" }, - { 0x83A6, "shootstopsound" }, - { 0x83A7, "setclothtype" }, - { 0x83A8, "getclothmovesound" }, - { 0x83A9, "getequipmovesound" }, - { 0x83AA, "jumpbuttonpressed" }, - { 0x83AB, "rotateby" }, - { 0x83AC, "getlookaheaddir" }, - { 0x83AD, "getpathgoalpos" }, - { 0x83AE, "setrocketcorpse" }, - { 0x83AF, "setcorpsefalling" }, - { 0x83B0, "setsurfacetype" }, - { 0x83B1, "aiphysicstrace" }, - { 0x83B2, "aiphysicstracepassed" }, - { 0x83B3, "setdevtext" }, - { 0x83B4, "forcemovingplatformentity" }, - { 0x83B5, "setmovingplatformtrigger" }, - { 0x83B6, "visionsetstage" }, - { 0x83B7, "linkwaypointtotargetwithoffset" }, - { 0x83B8, "getlinkedparent" }, - { 0x83B9, "getmovingplatformparent" }, - { 0x83BA, "setnameplatematerial" }, - { 0x83BB, "retargetscriptmodellighting" }, - { 0x83BC, "setmantlesoundflavor" }, - { 0x83BD, "clearclienttriggeraudiozone" }, - { 0x83BE, "setclienttriggeraudiozone" }, - { 0x83BF, "makevehiclenotcollidewithplayers" }, - { 0x83C0, "getbobrate" }, - { 0x83C1, "setbobrate" }, - { 0x83C2, "setscriptablepartstate" }, - { 0x83C3, "stopsliding" }, - { 0x83C4, "cancelrocketcorpse" }, - { 0x83C5, "setdronegoalpos" }, - { 0x83C6, "hudoutlineenable" }, - { 0x83C7, "hudoutlinedisable" }, - { 0x83C8, "motionblurhqenable" }, - { 0x83C9, "motionblurhqdisable" }, - { 0x83CA, "screenshakeonentity" }, - { 0x83CB, "setpitchorient" }, - { 0x83CC, "worldpointtoscreenpos" }, - { 0x83CD, "linktoplayerviewignoreparentrot" }, - { 0x83CE, "shouldplaymeleedeathanim" }, - { 0x83CF, "botfirstavailablegrenade" }, - { 0x83D0, "visionsetwaterforplayer" }, - { 0x83D1, "setwatersurfacetransitionfx" }, - { 0x83D2, "linktoplayerviewfollowwatersurface" }, - { 0x83D3, "linktoplayerviewattachwatersurfacetransitioneffects" }, - { 0x83D4, "playersetwaterfog" }, - { 0x83D5, "emissiveblend" }, - { 0x83D6, "enableforceviewmodeldof" }, - { 0x83D7, "disableforceviewmodeldof" }, - { 0x83D8, "getcustomizationbody" }, - { 0x83D9, "getcustomizationhead" }, - { 0x83DA, "getcustomizationviewmodel" }, - { 0x83DB, "setviewmodeldepth" }, - { 0x83DC, "isenemyaware" }, - { 0x83DD, "hasenemybeenseen" }, - { 0x83DE, "physicssetmaxlinvel" }, - { 0x83DF, "physicssetmaxangvel" }, - { 0x83E0, "physicsgetlinvel" }, - { 0x83E1, "physicsgetlinspeed" }, - { 0x83E2, "physicsgetangvel" }, - { 0x83E3, "physicsgetangspeed" }, - { 0x83E4, "disablemissileboosting" }, - { 0x83E5, "enablemissileboosting" }, - { 0x83E6, "canspawntestclient" }, - { 0x83E7, "spawntestclient" }, - { 0x83E8, "loadcustomizationplayerview" }, - { 0x83E9, "setgrenadethrowscale" }, - { 0x83EA, "setgrenadecookscale" }, - { 0x83EB, "setplanesplineid" }, - { 0x83EC, "hudoutlineenableforclient" }, - { 0x83ED, "hudoutlinedisableforclient" }, - { 0x83EE, "hudoutlineenableforclients" }, - { 0x83EF, "hudoutlinedisableforclients" }, - { 0x83F0, "turretsetbarrelspinenabled" }, - { 0x83F1, "hasloadedcustomizationplayerview" }, - { 0x83F2, "setclienttriggeraudiozonelerp" }, - { 0x83F3, "setclienttriggeraudiozonepartial" }, - { 0x83F4, "scragentdoanimrelative" }, - { 0x83F5, "rotatetolinked" }, - { 0x83F6, "rotatebylinked" }, - { 0x83F7, "setlinkedangles" }, - { 0x83F8, "getcorpseentity" }, - { 0x83F9, "removefrommovingplatformsystem" }, - { 0x83FA, "logmatchdatalife" }, - { 0x83FB, "logmatchdatadeath" }, - { 0x83FC, "queuedialogforplayer" }, - { 0x83FD, "setmlgcameradefaults" }, - { 0x83FE, "ismlgspectator" }, - { 0x83FF, "disableautoreload" }, - { 0x8400, "enableautoreload" }, - { 0x8401, "issprintsliding" }, - { 0x8402, "getlinkedchildren" }, - { 0x8403, "botpredictenemycampspots" }, - { 0x8404, "playsoundonmovingent" }, - { 0x8405, "cancelmantle" }, - { 0x8406, "hasfemalecustomizationmodel" }, - { 0x8407, "setscriptabledamageowner" }, - { 0x8408, "setfxkilldefondelete" }, - { 0x8409, "getdogavoident" }, - { 0x840A, "enabledogavoidance" }, - { 0x840B, "forcedeathfall" }, - { 0x840C, "gethybridscopestate" }, - { 0x840D, "sethybridscopestate" }, - { 0x840E, "getvieworigin" }, - { 0x840F, "setweaponmodelvariant" }, - { 0x8410, "ridevehicle" }, - { 0x8411, "stopridingvehicle" }, - { 0x8412, "getmantlesound" }, - { 0x8413, "autoboltmissileeffects" }, - { 0x8414, "disablemissilestick" }, - { 0x8415, "enablemissilestick" }, - { 0x8416, "setmissileminimapvisible" }, - { 0x8417, "isoffhandweaponreadytothrow" }, - { 0x8418, "isleaning" }, - { 0x8419, "makecollidewithitemclip" }, - { 0x841A, "ismovementfromgamepad" }, - { 0x841B, "visionsetpostapplyforplayer" }, - { 0x841C, "setcommonplayerdatareservedint" }, - { 0x841D, "getclanwarsbonus" }, - { 0x841E, "getrankedplayerdatareservedint" }, - { 0x841F, "setrankedplayerdatareservedint" }, - { 0x8420, "setignorefoliagesightingme" }, - { 0x8421, "scragentusemodelcollisionbounds" }, - { 0x8422, "setmlgspectator" }, - { 0x8423, "getmlgspectatorteam" }, - { 0x8424, "getcommonplayerdatareservedint" }, - { 0x8425, "getcoopplayerdatareservedint" }, - { 0x8426, "setcoopplayerdatareservedint" }, - { 0x8427, "getjointype" }, - { 0x8428, "scragentsetwallruncost" }, - { 0x8429, "alienscheckisitempurchased" }, -}}; - -const std::array, 17657> token_list +extern std::array, token_count> const token_list {{ { 0x0000, "" }, { 0x0001, "pl#" }, @@ -40464,53 +38318,4 @@ const std::array, 17657> token_list { 0x95A1, "wolffurfx" }, }}; -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()); - function_map.reserve(function_list.size()); - function_map_rev.reserve(function_list.size()); - method_map.reserve(method_list.size()); - method_map_rev.reserve(method_list.size()); - token_map.reserve(token_list.size()); - token_map_rev.reserve(token_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 : function_list) - { - function_map.insert({ entry.first, entry.second }); - function_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : method_list) - { - method_map.insert({ entry.first, entry.second }); - method_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : token_list) - { - token_map.insert({ entry.first, entry.second }); - token_map_rev.insert({ entry.second, entry.first }); - } - } -}; - -__init__ _; - -} // namespace xsk::gsc::iw6 - -#ifdef _MSC_VER -#pragma warning(pop) -#endif +} // namespace xsk::gsc::iw6_pc diff --git a/src/iw6/iw6_ps.cpp b/src/iw6/iw6_ps.cpp new file mode 100644 index 00000000..8a8b7e0b --- /dev/null +++ b/src/iw6/iw6_ps.cpp @@ -0,0 +1,52 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_ps.hpp" + +namespace xsk::gsc::iw6_ps +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::none, engine::iw6, endian::big, system::ps3, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::iw6_ps diff --git a/src/iw6/iw6_ps.hpp b/src/iw6/iw6_ps.hpp new file mode 100644 index 00000000..c577bd40 --- /dev/null +++ b/src/iw6/iw6_ps.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::iw6_ps +{ + +constexpr usize code_count = 153; +constexpr usize func_count = 3; +constexpr usize meth_count = 0; +constexpr usize token_count = 0; +constexpr u32 max_string_id = 0x95A1; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::iw6_ps diff --git a/src/iw6/iw6_ps_code.cpp b/src/iw6/iw6_ps_code.cpp new file mode 100644 index 00000000..9181e3e8 --- /dev/null +++ b/src/iw6/iw6_ps_code.cpp @@ -0,0 +1,168 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_ps.hpp" + +namespace xsk::gsc::iw6_ps +{ + +extern std::array, code_count> const code_list +{{ + { 0x1D, opcode::OP_CastFieldObject }, + { 0x1E, opcode::OP_SetLocalVariableFieldCached }, + { 0x1F, opcode::OP_plus }, + { 0x20, opcode::OP_RemoveLocalVariables }, + { 0x21, opcode::OP_EvalSelfFieldVariableRef }, + { 0x22, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x23, opcode::OP_GetGameRef }, + { 0x24, opcode::OP_EvalAnimFieldVariable }, + { 0x25, opcode::OP_EvalLevelFieldVariableRef }, + { 0x26, opcode::OP_GetThisthread }, + { 0x27, opcode::OP_greater }, + { 0x28, opcode::OP_waittillmatch }, + { 0x29, opcode::OP_shift_right }, + { 0x2A, opcode::OP_dec }, + { 0x2B, opcode::OP_JumpOnTrue }, + { 0x2C, opcode::OP_bit_or }, + { 0x2D, opcode::OP_equality }, + { 0x2E, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x2F, opcode::OP_notify }, + { 0x30, opcode::OP_GetVector }, + { 0x31, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x32, opcode::OP_PreScriptCall }, + { 0x33, opcode::OP_GetByte }, + { 0x34, opcode::OP_ScriptFarThreadCall }, + { 0x35, opcode::OP_SetSelfFieldVariableField }, + { 0x36, opcode::OP_JumpOnFalseExpr }, + { 0x37, opcode::OP_GetUndefined }, + { 0x38, opcode::OP_jumpback }, + { 0x39, opcode::OP_JumpOnTrueExpr }, + { 0x3A, opcode::OP_CallBuiltin0 }, + { 0x3B, opcode::OP_CallBuiltin1 }, + { 0x3C, opcode::OP_CallBuiltin2 }, + { 0x3D, opcode::OP_CallBuiltin3 }, + { 0x3E, opcode::OP_CallBuiltin4 }, + { 0x3F, opcode::OP_CallBuiltin5 }, + { 0x40, opcode::OP_CallBuiltin }, + { 0x41, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x42, opcode::OP_ClearFieldVariable }, + { 0x43, opcode::OP_GetLevel }, + { 0x44, opcode::OP_size }, + { 0x45, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x46, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x47, opcode::OP_AddArray }, + { 0x48, opcode::OP_endon }, + { 0x49, opcode::OP_EvalFieldVariable }, + { 0x4A, opcode::OP_shift_left }, + { 0x4B, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x4C, opcode::OP_Return }, + { 0x4D, opcode::OP_CreateLocalVariable }, + { 0x4E, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x4F, opcode::OP_GetBuiltinMethod }, + { 0x50, opcode::OP_ScriptLocalMethodCall }, + { 0x51, opcode::OP_CallBuiltinMethodPointer }, + { 0x52, opcode::OP_ScriptLocalChildThreadCall }, + { 0x53, opcode::OP_GetSelfObject }, + { 0x54, opcode::OP_GetGame }, + { 0x55, opcode::OP_SetLevelFieldVariableField }, + { 0x56, opcode::OP_EvalArray }, + { 0x57, opcode::OP_GetSelf }, + { 0x58, opcode::OP_End }, + { 0x59, opcode::OP_EvalSelfFieldVariable }, + { 0x5A, opcode::OP_less_equal }, + { 0x5B, opcode::OP_EvalLocalVariableCached0 }, + { 0x5C, opcode::OP_EvalLocalVariableCached1 }, + { 0x5D, opcode::OP_EvalLocalVariableCached2 }, + { 0x5E, opcode::OP_EvalLocalVariableCached3 }, + { 0x5F, opcode::OP_EvalLocalVariableCached4 }, + { 0x60, opcode::OP_EvalLocalVariableCached5 }, + { 0x61, opcode::OP_EvalLocalVariableCached }, + { 0x62, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x63, opcode::OP_ScriptChildThreadCallPointer }, + { 0x64, opcode::OP_EvalLocalVariableObjectCached }, + { 0x65, opcode::OP_ScriptLocalThreadCall }, + { 0x66, opcode::OP_GetInteger }, + { 0x67, opcode::OP_ScriptMethodCallPointer }, + { 0x68, opcode::OP_checkclearparams }, + { 0x69, opcode::OP_SetAnimFieldVariableField }, + { 0x6A, opcode::OP_waittillmatch2 }, + { 0x6B, opcode::OP_minus }, + { 0x6C, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x6D, opcode::OP_GetNegUnsignedShort }, + { 0x6E, opcode::OP_GetNegByte }, + { 0x6F, opcode::OP_SafeCreateVariableFieldCached }, + { 0x70, opcode::OP_greater_equal }, + { 0x71, opcode::OP_vector }, + { 0x72, opcode::OP_GetBuiltinFunction }, + { 0x73, opcode::OP_endswitch }, + { 0x74, opcode::OP_ClearArray }, + { 0x75, opcode::OP_DecTop }, + { 0x76, opcode::OP_CastBool }, + { 0x77, opcode::OP_EvalArrayRef }, + { 0x78, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x79, opcode::OP_GetZero }, + { 0x7A, opcode::OP_wait }, + { 0x7B, opcode::OP_waittill }, + { 0x7C, opcode::OP_GetIString }, + { 0x7D, opcode::OP_ScriptFarFunctionCall }, + { 0x7E, opcode::OP_GetAnimObject }, + { 0x7F, opcode::OP_GetAnimTree }, + { 0x80, opcode::OP_EvalLocalArrayCached }, + { 0x81, opcode::OP_mod }, + { 0x82, opcode::OP_ScriptFarMethodThreadCall }, + { 0x83, opcode::OP_GetUnsignedShort }, + { 0x84, opcode::OP_clearparams }, + { 0x85, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x86, opcode::OP_ScriptFunctionCallPointer }, + { 0x87, opcode::OP_EmptyArray }, + { 0x88, opcode::OP_SafeSetVariableFieldCached }, + { 0x89, opcode::OP_ClearVariableField }, // MAYBE + { 0x8A, opcode::OP_EvalFieldVariableRef }, + { 0x8B, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x8C, opcode::OP_EvalNewLocalVariableRefCached0 }, // MAYBE + { 0x8D, opcode::OP_GetFloat }, + { 0x8E, opcode::OP_EvalLocalVariableRefCached }, + { 0x8F, opcode::OP_JumpOnFalse }, + { 0x90, opcode::OP_BoolComplement }, + { 0x91, opcode::OP_ScriptThreadCallPointer }, + { 0x92, opcode::OP_ScriptFarFunctionCall2 }, + { 0x93, opcode::OP_less }, + { 0x94, opcode::OP_BoolNot }, + { 0x95, opcode::OP_waittillFrameEnd }, + { 0x96, opcode::OP_GetString }, + { 0x97, opcode::OP_EvalLevelFieldVariable }, + { 0x98, opcode::OP_GetLevelObject }, + { 0x99, opcode::OP_inc }, + { 0x9A, opcode::OP_CallBuiltinMethod0 }, + { 0x9B, opcode::OP_CallBuiltinMethod1 }, + { 0x9C, opcode::OP_CallBuiltinMethod2 }, + { 0x9D, opcode::OP_CallBuiltinMethod3 }, + { 0x9E, opcode::OP_CallBuiltinMethod4 }, + { 0x9F, opcode::OP_CallBuiltinMethod5 }, + { 0xA0, opcode::OP_CallBuiltinMethod }, + { 0xA1, opcode::OP_GetAnim }, + { 0xA2, opcode::OP_switch }, + { 0xA3, opcode::OP_SetVariableField }, + { 0xA4, opcode::OP_divide }, + { 0xA5, opcode::OP_GetLocalFunction }, + { 0xA6, opcode::OP_ScriptFarChildThreadCall }, + { 0xA7, opcode::OP_multiply }, + { 0xA8, opcode::OP_ClearLocalVariableFieldCached }, + { 0xA9, opcode::OP_EvalAnimFieldVariableRef }, + { 0xAA, opcode::OP_EvalLocalArrayRefCached }, + { 0xAB, opcode::OP_EvalLocalVariableRefCached0 }, + { 0xAC, opcode::OP_bit_and }, + { 0xAD, opcode::OP_GetAnimation }, + { 0xAE, opcode::OP_GetFarFunction }, + { 0xAF, opcode::OP_CallBuiltinPointer }, + { 0xB0, opcode::OP_jump }, + { 0xB1, opcode::OP_voidCodepos }, + { 0xB2, opcode::OP_ScriptFarMethodCall }, + { 0xB3, opcode::OP_inequality }, + { 0xB4, opcode::OP_ScriptLocalFunctionCall }, + { 0xB5, opcode::OP_bit_ex_or }, +}}; + +} // namespace xsk::gsc::iw6_ps diff --git a/src/iw6/iw6_ps_func.cpp b/src/iw6/iw6_ps_func.cpp new file mode 100644 index 00000000..1f018b4b --- /dev/null +++ b/src/iw6/iw6_ps_func.cpp @@ -0,0 +1,18 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_ps.hpp" + +namespace xsk::gsc::iw6_ps +{ + +extern std::array, func_count> const func_list +{{ + { 0x12, "isdefined" }, + { 0xB7, "getfirstarraykey" }, + { 0xB8, "getnextarraykey" }, +}}; + +} // namespace xsk::gsc::iw6_ps diff --git a/src/iw6/iw6_ps_meth.cpp b/src/iw6/iw6_ps_meth.cpp new file mode 100644 index 00000000..5cfefe12 --- /dev/null +++ b/src/iw6/iw6_ps_meth.cpp @@ -0,0 +1,15 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_ps.hpp" + +namespace xsk::gsc::iw6_ps +{ + +extern std::array, meth_count> const meth_list +{{ +}}; + +} // namespace xsk::gsc::iw6_ps diff --git a/src/iw6/iw6_ps_token.cpp b/src/iw6/iw6_ps_token.cpp new file mode 100644 index 00000000..bf432e5f --- /dev/null +++ b/src/iw6/iw6_ps_token.cpp @@ -0,0 +1,15 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_ps.hpp" + +namespace xsk::gsc::iw6_ps +{ + +extern std::array, token_count> const token_list +{{ +}}; + +} // namespace xsk::gsc::iw6_ps diff --git a/src/iw6/iw6_xb.cpp b/src/iw6/iw6_xb.cpp new file mode 100644 index 00000000..e7292c89 --- /dev/null +++ b/src/iw6/iw6_xb.cpp @@ -0,0 +1,52 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_xb.hpp" + +namespace xsk::gsc::iw6_xb +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::none, engine::iw6, endian::big, system::xb2, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::iw6_xb diff --git a/src/iw6/iw6_xb.hpp b/src/iw6/iw6_xb.hpp new file mode 100644 index 00000000..580e9581 --- /dev/null +++ b/src/iw6/iw6_xb.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::iw6_xb +{ + +constexpr usize code_count = 153; +constexpr usize func_count = 3; +constexpr usize meth_count = 0; +constexpr usize token_count = 0; +constexpr u32 max_string_id = 0x8EFA; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::iw6_xb diff --git a/src/iw6/iw6_xb_code.cpp b/src/iw6/iw6_xb_code.cpp new file mode 100644 index 00000000..deb5fac1 --- /dev/null +++ b/src/iw6/iw6_xb_code.cpp @@ -0,0 +1,168 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_xb.hpp" + +namespace xsk::gsc::iw6_xb +{ + +extern std::array, code_count> const code_list +{{ + { 0x1D, opcode::OP_CastFieldObject }, + { 0x1E, opcode::OP_SetLocalVariableFieldCached }, + { 0x1F, opcode::OP_plus }, + { 0x20, opcode::OP_RemoveLocalVariables }, + { 0x21, opcode::OP_EvalSelfFieldVariableRef }, + { 0x22, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x23, opcode::OP_GetGameRef }, + { 0x24, opcode::OP_EvalAnimFieldVariable }, + { 0x25, opcode::OP_EvalLevelFieldVariableRef }, + { 0x26, opcode::OP_GetThisthread }, + { 0x27, opcode::OP_greater }, + { 0x28, opcode::OP_waittillmatch }, + { 0x29, opcode::OP_shift_right }, + { 0x2A, opcode::OP_dec }, + { 0x2B, opcode::OP_JumpOnTrue }, + { 0x2C, opcode::OP_bit_or }, + { 0x2D, opcode::OP_equality }, + { 0x2E, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x2F, opcode::OP_notify }, + { 0x30, opcode::OP_GetVector }, + { 0x31, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x32, opcode::OP_PreScriptCall }, + { 0x33, opcode::OP_GetByte }, + { 0x34, opcode::OP_ScriptFarThreadCall }, + { 0x35, opcode::OP_SetSelfFieldVariableField }, + { 0x36, opcode::OP_JumpOnFalseExpr }, + { 0x37, opcode::OP_GetUndefined }, + { 0x38, opcode::OP_jumpback }, + { 0x39, opcode::OP_JumpOnTrueExpr }, + { 0x3A, opcode::OP_CallBuiltin0 }, + { 0x3B, opcode::OP_CallBuiltin1 }, + { 0x3C, opcode::OP_CallBuiltin2 }, + { 0x3D, opcode::OP_CallBuiltin3 }, + { 0x3E, opcode::OP_CallBuiltin4 }, + { 0x3F, opcode::OP_CallBuiltin5 }, + { 0x40, opcode::OP_CallBuiltin }, + { 0x41, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x42, opcode::OP_ClearFieldVariable }, + { 0x43, opcode::OP_GetLevel }, + { 0x44, opcode::OP_size }, + { 0x45, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x46, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x47, opcode::OP_AddArray }, + { 0x48, opcode::OP_endon }, + { 0x49, opcode::OP_EvalFieldVariable }, + { 0x4A, opcode::OP_shift_left }, + { 0x4B, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x4C, opcode::OP_Return }, + { 0x4D, opcode::OP_CreateLocalVariable }, + { 0x4E, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x4F, opcode::OP_GetBuiltinMethod }, + { 0x50, opcode::OP_ScriptLocalMethodCall }, + { 0x51, opcode::OP_CallBuiltinMethodPointer }, + { 0x52, opcode::OP_ScriptLocalChildThreadCall }, + { 0x53, opcode::OP_GetSelfObject }, + { 0x54, opcode::OP_GetGame }, + { 0x55, opcode::OP_SetLevelFieldVariableField }, + { 0x56, opcode::OP_EvalArray }, + { 0x57, opcode::OP_GetSelf }, + { 0x58, opcode::OP_End }, + { 0x59, opcode::OP_EvalSelfFieldVariable }, + { 0x5A, opcode::OP_less_equal }, + { 0x5B, opcode::OP_EvalLocalVariableCached0 }, + { 0x5C, opcode::OP_EvalLocalVariableCached1 }, + { 0x5D, opcode::OP_EvalLocalVariableCached2 }, + { 0x5E, opcode::OP_EvalLocalVariableCached3 }, + { 0x5F, opcode::OP_EvalLocalVariableCached4 }, + { 0x60, opcode::OP_EvalLocalVariableCached5 }, + { 0x61, opcode::OP_EvalLocalVariableCached }, + { 0x62, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x63, opcode::OP_ScriptChildThreadCallPointer }, + { 0x64, opcode::OP_EvalLocalVariableObjectCached }, + { 0x65, opcode::OP_ScriptLocalThreadCall }, + { 0x66, opcode::OP_GetInteger }, + { 0x67, opcode::OP_ScriptMethodCallPointer }, + { 0x68, opcode::OP_checkclearparams }, + { 0x69, opcode::OP_SetAnimFieldVariableField }, + { 0x6A, opcode::OP_waittillmatch2 }, + { 0x6B, opcode::OP_minus }, + { 0x6C, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x6D, opcode::OP_GetNegUnsignedShort }, + { 0x6E, opcode::OP_GetNegByte }, + { 0x6F, opcode::OP_SafeCreateVariableFieldCached }, + { 0x70, opcode::OP_greater_equal }, + { 0x71, opcode::OP_vector }, + { 0x72, opcode::OP_GetBuiltinFunction }, + { 0x73, opcode::OP_endswitch }, + { 0x74, opcode::OP_ClearArray }, + { 0x75, opcode::OP_DecTop }, + { 0x76, opcode::OP_CastBool }, + { 0x77, opcode::OP_EvalArrayRef }, + { 0x78, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x79, opcode::OP_GetZero }, + { 0x7A, opcode::OP_wait }, + { 0x7B, opcode::OP_waittill }, + { 0x7C, opcode::OP_GetIString }, + { 0x7D, opcode::OP_ScriptFarFunctionCall }, + { 0x7E, opcode::OP_GetAnimObject }, + { 0x7F, opcode::OP_GetAnimTree }, + { 0x80, opcode::OP_EvalLocalArrayCached }, + { 0x81, opcode::OP_mod }, + { 0x82, opcode::OP_ScriptFarMethodThreadCall }, + { 0x83, opcode::OP_GetUnsignedShort }, + { 0x84, opcode::OP_clearparams }, + { 0x85, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x86, opcode::OP_ScriptFunctionCallPointer }, + { 0x87, opcode::OP_EmptyArray }, + { 0x88, opcode::OP_SafeSetVariableFieldCached }, + { 0x89, opcode::OP_ClearVariableField }, // MAYBE + { 0x8A, opcode::OP_EvalFieldVariableRef }, + { 0x8B, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x8C, opcode::OP_EvalNewLocalVariableRefCached0 }, // MAYBE + { 0x8D, opcode::OP_GetFloat }, + { 0x8E, opcode::OP_EvalLocalVariableRefCached }, + { 0x8F, opcode::OP_JumpOnFalse }, + { 0x90, opcode::OP_BoolComplement }, + { 0x91, opcode::OP_ScriptThreadCallPointer }, + { 0x92, opcode::OP_ScriptFarFunctionCall2 }, + { 0x93, opcode::OP_less }, + { 0x94, opcode::OP_BoolNot }, + { 0x95, opcode::OP_waittillFrameEnd }, + { 0x96, opcode::OP_GetString }, + { 0x97, opcode::OP_EvalLevelFieldVariable }, + { 0x98, opcode::OP_GetLevelObject }, + { 0x99, opcode::OP_inc }, + { 0x9A, opcode::OP_CallBuiltinMethod0 }, + { 0x9B, opcode::OP_CallBuiltinMethod1 }, + { 0x9C, opcode::OP_CallBuiltinMethod2 }, + { 0x9D, opcode::OP_CallBuiltinMethod3 }, + { 0x9E, opcode::OP_CallBuiltinMethod4 }, + { 0x9F, opcode::OP_CallBuiltinMethod5 }, + { 0xA0, opcode::OP_CallBuiltinMethod }, + { 0xA1, opcode::OP_GetAnim }, + { 0xA2, opcode::OP_switch }, + { 0xA3, opcode::OP_SetVariableField }, + { 0xA4, opcode::OP_divide }, + { 0xA5, opcode::OP_GetLocalFunction }, + { 0xA6, opcode::OP_ScriptFarChildThreadCall }, + { 0xA7, opcode::OP_multiply }, + { 0xA8, opcode::OP_ClearLocalVariableFieldCached }, + { 0xA9, opcode::OP_EvalAnimFieldVariableRef }, + { 0xAA, opcode::OP_EvalLocalArrayRefCached }, + { 0xAB, opcode::OP_EvalLocalVariableRefCached0 }, + { 0xAC, opcode::OP_bit_and }, + { 0xAD, opcode::OP_GetAnimation }, + { 0xAE, opcode::OP_GetFarFunction }, + { 0xAF, opcode::OP_CallBuiltinPointer }, + { 0xB0, opcode::OP_jump }, + { 0xB1, opcode::OP_voidCodepos }, + { 0xB2, opcode::OP_ScriptFarMethodCall }, + { 0xB3, opcode::OP_inequality }, + { 0xB4, opcode::OP_ScriptLocalFunctionCall }, + { 0xB5, opcode::OP_bit_ex_or }, +}}; + +} // namespace xsk::gsc::iw6_xb diff --git a/src/iw6/iw6_xb_func.cpp b/src/iw6/iw6_xb_func.cpp new file mode 100644 index 00000000..d8221d0a --- /dev/null +++ b/src/iw6/iw6_xb_func.cpp @@ -0,0 +1,18 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_xb.hpp" + +namespace xsk::gsc::iw6_xb +{ + +extern std::array, func_count> const func_list +{{ + { 0x12, "isdefined" }, + { 0xB7, "getfirstarraykey" }, + { 0xB8, "getnextarraykey" }, +}}; + +} // namespace xsk::gsc::iw6_xb diff --git a/src/iw6/iw6_xb_meth.cpp b/src/iw6/iw6_xb_meth.cpp new file mode 100644 index 00000000..7c088e52 --- /dev/null +++ b/src/iw6/iw6_xb_meth.cpp @@ -0,0 +1,15 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_xb.hpp" + +namespace xsk::gsc::iw6_xb +{ + +extern std::array, meth_count> const meth_list +{{ +}}; + +} // namespace xsk::gsc::iw6_xb diff --git a/src/iw6/iw6_xb_token.cpp b/src/iw6/iw6_xb_token.cpp new file mode 100644 index 00000000..8a0f7cf4 --- /dev/null +++ b/src/iw6/iw6_xb_token.cpp @@ -0,0 +1,15 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw6_xb.hpp" + +namespace xsk::gsc::iw6_xb +{ + +extern std::array, token_count> const token_list +{{ +}}; + +} // namespace xsk::gsc::iw6_xb diff --git a/src/iw6/stdafx.cpp b/src/iw6/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/iw6/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/iw6/stdafx.hpp b/src/iw6/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/iw6/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/iw6/xsk/assembler.cpp b/src/iw6/xsk/assembler.cpp deleted file mode 100644 index 88fc26a1..00000000 --- a/src/iw6/xsk/assembler.cpp +++ /dev/null @@ -1,554 +0,0 @@ -// 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 "iw6.hpp" - -namespace xsk::gsc::iw6 -{ - -auto assembler::output_script() -> std::vector -{ - std::vector script; - - if (script_ == nullptr) return script; - - script.resize(script_->pos()); - std::memcpy(script.data(), script_->buffer().data(), script.size()); - - return script; -} - -auto assembler::output_stack() -> std::vector -{ - std::vector stack; - - if (stack_ == nullptr) return stack; - - stack.resize(stack_->pos()); - std::memcpy(stack.data(), stack_->buffer().data(), stack.size()); - - return stack; -} - -void assembler::assemble(const std::string& file, std::vector& data) -{ - std::vector assembly = utils::string::clean_buffer_lines(data); - std::vector functions; - function::ptr func = nullptr; - std::uint32_t index = 1; - std::uint16_t switchnum = 0; - - for (auto& line : assembly) - { - if (line == "" || line.substr(0, 2) == "//") - { - continue; - } - else if (line.substr(0, 4) == "sub_") - { - func = std::make_unique(); - func->index = index; - func->name = line.substr(4); - } - else if (line.substr(0, 4) == "end_") - { - if (func != nullptr) - { - func->size = index - func->index; - functions.push_back(std::move(func)); - } - } - else if (line.substr(0, 4) == "loc_") - { - func->labels[index] = line; - } - else - { - auto opdata = utils::string::parse_code(line); - - if (switchnum) - { - if (opdata[0] == "case" || opdata[0] == "default") - { - for (auto& entry : opdata) - { - func->instructions.back()->data.push_back(entry); - } - switchnum--; - continue; - } - - throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); - } - else - { - auto inst = std::make_unique(); - inst->index = index; - inst->opcode = resolver::opcode_id(opdata[0]); - inst->size = opcode_size(inst->opcode); - opdata.erase(opdata.begin()); - inst->data = std::move(opdata); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = inst->data[0].substr(4); - break; - case opcode::OP_endswitch: - switchnum = static_cast(std::stoi(inst->data[0])); - inst->size += 7 * switchnum; - break; - default: - break; - } - - index += inst->size; - func->instructions.push_back(std::move(inst)); - } - } - } - - assemble(file, functions); -} - -void assembler::assemble(const std::string& file, std::vector& funcs) -{ - script_ = std::make_unique(0x100000); - stack_ = std::make_unique(0x100000); - filename_ = file; - functions_ = std::move(funcs); - - script_->write(static_cast(opcode::OP_End)); - - for (const auto& func : functions_) - { - assemble_function(func); - } -} - -void assembler::assemble_function(const function::ptr& func) -{ - labels_ = func->labels; - - func->id = resolver::token_id(func->name); - - stack_->write(func->size); - stack_->write(static_cast(func->id)); - - if (func->id == 0) - { - stack_->write_c_string(func->name); - } - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->write(std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->write(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - 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(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_GetAnimation: - script_->write(0); - script_->write(0); - stack_->write_c_string(inst->data[0]); - stack_->write_c_string(inst->data[1]); - break; - case opcode::OP_GetAnimTree: - script_->write(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_waittillmatch: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - assemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - assemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - assemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - assemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - assemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - assemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - assemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - assemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - assemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - assemble_jump(inst, false, true); - break; - case opcode::OP_jump: - assemble_jump(inst, false, false); - break; - case opcode::OP_switch: - assemble_switch(inst); - break; - case opcode::OP_endswitch: - assemble_end_switch(inst); - break; - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } - - const auto id = method ? resolver::method_id(inst->data[0]) : resolver::function_id(inst->data[0]); - - script_->write(id); -} - -void assembler::assemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto addr = resolve_function(inst->data[0]); - const auto offset = static_cast(addr - inst->index - 1); - - assemble_offset(offset); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } -} - -void assembler::assemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->write(0); - script_->write(0); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[2]))); - } - - const auto file_id = resolver::token_id(inst->data[0]); - const auto func_id = resolver::token_id(inst->data[1]); - - stack_->write(file_id); - if (file_id == 0) stack_->write_c_string(inst->data[0]); - stack_->write(func_id); - if (func_id == 0) stack_->write_c_string(inst->data[1]); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const auto addr = resolve_label(inst->data[0]); - - script_->write(addr - inst->index - 4); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - - script_->write(static_cast(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); - stack_->write_c_string(inst->data[1 + (3 * i) + 1]); - } - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 2]); - - assemble_offset(addr - index); - - index += 3; - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write(0); - stack_->write_c_string("\x01"); - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 1]); - - assemble_offset(addr - index); - - index += 3; - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::assemble_field_variable(const instruction::ptr& inst) -{ - auto id = resolver::token_id(inst->data[0]); - - if (id == 0) id = 0xFFFF; - - script_->write(id); - - if (id > max_string_id) - { - stack_->write(0); - stack_->write_c_string(inst->data[0]); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - const auto addr = resolve_label(inst->data[0]); - - if (expr) - { - script_->write(static_cast(addr - inst->index - 3)); - } - else if (back) - { - script_->write(static_cast((inst->index + 3) - addr)); - } - else - { - script_->write(static_cast(addr - inst->index - 5)); - } -} - -void assembler::assemble_offset(std::int32_t offset) -{ - std::array bytes = {}; - - offset = (offset << 10) >> 8; - - *reinterpret_cast(bytes.data()) = offset; - - script_->write(bytes[0]); - script_->write(bytes[1]); - script_->write(bytes[2]); -} - -auto assembler::resolve_function(const std::string& name) -> std::int32_t -{ - for (const auto& entry : functions_) - { - if (entry->name == name) - { - return entry->index; - } - } - - throw asm_error("couldn't resolve local function address of '" + name + "'!"); -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/assembler.hpp b/src/iw6/xsk/assembler.hpp deleted file mode 100644 index c04157f3..00000000 --- a/src/iw6/xsk/assembler.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::iw6 -{ - -class assembler : public gsc::assembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output_script() -> std::vector; - auto output_stack() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, std::vector& funcs); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void assemble_local_call(const instruction::ptr& inst, bool thread); - void assemble_far_call(const instruction::ptr& inst, bool thread); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void assemble_field_variable(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst, bool expr, bool back); - void assemble_offset(std::int32_t offset); - auto resolve_function(const std::string& name) -> std::int32_t; - auto resolve_label(const std::string& name) -> std::int32_t; -}; - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/compiler.cpp b/src/iw6/xsk/compiler.cpp deleted file mode 100644 index 58251c89..00000000 --- a/src/iw6/xsk/compiler.cpp +++ /dev/null @@ -1,2961 +0,0 @@ -// 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 "iw6.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -namespace xsk::gsc::iw6 -{ - -auto compiler::output() -> std::vector -{ - return std::move(assembly_); -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "an unknown error ocurred while parsing gsc file"); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_.clear(); - includes_.clear(); - animtrees_.clear(); - constants_.clear(); - local_functions_.clear(); - index_ = 1; - 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& inc : includes_) - { - if (inc.name == path) - { - throw comp_error(include->loc(), "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(), "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 developer block comment"); - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) -{ - const auto itr = constants_.find(constant->name->value); - - if (itr != constants_.end()) - throw comp_error(constant->loc(), "duplicated constant '" + constant->name->value + "'"); - - 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; - - auto blk = std::make_unique(); - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - break_blks_.clear(); - continue_blks_.clear(); - - process_thread(thread, blk); - - emit_expr_parameters(thread->params, blk); - emit_stmt_list(thread->stmt, blk, true); - emit_opcode(opcode::OP_End); - - function_->size = index_ - function_->index; - assembly_.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list, blk, last); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev, blk, last); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend, blk); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if, blk, last); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse, blk, last); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case, blk); - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default, blk); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return, blk); - break; - case ast::kind::stmt_breakpoint: - emit_stmt_breakpoint(stmt.as_breakpoint, blk); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin, blk); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end, blk); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last) -{ - for (const auto& entry : stmt->list) - { - bool last_ = (&entry == &stmt->list.back() && last) ? true : false; - emit_stmt(entry, blk, last_); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last) -{ - emit_stmt_list(stmt->list, blk, last); -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - 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, const block::ptr& blk) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, blk, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, blk, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_endon); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } - - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->time, blk); - emit_opcode(opcode::OP_wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittill); - - for (const auto& entry : stmt->args->list) - { - variable_create(entry.as_identifier, blk); - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(entry.as_identifier, blk)); - } - - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - emit_expr_arguments(stmt->args, blk); - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_waittillmatch2); - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waittillFrameEnd); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - blk->transfer(stmt->blk); - - emit_stmt(stmt->stmt, stmt->blk, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last) -{ - std::vector childs; - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - blk->transfer(stmt->blk_if); - - emit_stmt(stmt->stmt_if, stmt->blk_if, last); - - emit_remove_local_vars(stmt->blk_if); - - if (stmt->blk_if->abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - - last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - - blk->transfer(stmt->blk_else); - - emit_stmt(stmt->stmt_else, stmt->blk_else, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk_else); - - if (stmt->blk_else->abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - - insert_label(end_loc); - - blk->init_from_child(childs); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_stmt(stmt->init, blk, false); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->blk_iter); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - can_break_ = true; - can_continue_ = true; - - emit_stmt(stmt->stmt, stmt->blk, false); - - if (stmt->blk->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->blk.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->blk_iter->init_from_child(continue_blks_); - - emit_stmt(stmt->iter, stmt->blk_iter, false); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_expr(stmt->array_expr, blk); - emit_expr_variable_ref(stmt->array, blk, true); - emit_expr_variable(stmt->array, blk); - emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); - emit_expr_variable_ref(stmt->key_expr, blk, true); - - blk->transfer(stmt->ctx); - stmt->ctx->loc_break = break_loc; - stmt->ctx->loc_continue = continue_loc; - - emit_create_local_vars(stmt->ctx); - - blk->local_vars_create_count = stmt->ctx->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->ctx_post); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr, blk); - emit_opcode(opcode::OP_CallBuiltin1, "isdefined"); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr, stmt->ctx); - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->array.as_identifier, stmt->ctx)); - emit_expr_variable_ref(stmt->value_expr, stmt->ctx, true); - emit_stmt(stmt->stmt, stmt->ctx, false); - - if (stmt->ctx->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->ctx.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->ctx_post->init_from_child(continue_blks_); - - emit_expr_variable(stmt->key_expr, stmt->ctx_post); - emit_expr_variable(stmt->array, stmt->ctx_post); - emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); - emit_expr_variable_ref(stmt->key_expr, stmt->ctx_post, true); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - emit_expr_clear_local(stmt->array.as_identifier, blk); - if (!stmt->use_key) emit_expr_clear_local(stmt->key_expr.as_identifier, blk); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_break = can_break_; - break_blks_.clear(); - can_break_ = false; - - auto jmptable_loc = create_label(); - auto break_loc = create_label(); - - emit_expr(stmt->test, blk); - 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; - block* default_ctx = nullptr; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - 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"); - } - - blk->transfer(case_->blk); - case_->blk->loc_break = break_loc; - emit_stmt_list(case_->stmt, case_->blk, false); - if (case_->stmt->list.size() > 0) - emit_remove_local_vars(case_->blk); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - - has_default = true; - default_ctx = entry.as_default->blk.get(); - - blk->transfer(entry.as_default->blk); - entry.as_default->blk->loc_break = break_loc; - emit_stmt_list(entry.as_default->stmt, entry.as_default->blk, false); - if (entry.as_default->stmt->list.size() > 0) - emit_remove_local_vars(entry.as_default->blk); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - } - blk->init_from_child(break_blks_); - } - - insert_label(jmptable_loc); - - emit_opcode(opcode::OP_endswitch, data); - - auto offset = static_cast(7 * stmt->stmt->list.size()); - function_->instructions.back()->size += offset; - index_ += offset; - - insert_label(break_loc); - - can_break_ = old_break; - break_blks_ = old_breaks; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) -{ - if (!can_break_ || blk->abort != abort_t::abort_none || blk->loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - break_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_break; - emit_opcode(opcode::OP_jump, blk->loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) -{ - if (!can_continue_ || blk->abort != abort_t::abort_none || blk->loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - continue_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_continue; - emit_opcode(opcode::OP_jump, blk->loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - blk->abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr, blk); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child, blk); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate, blk); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference, blk); - break; - case ast::kind::expr_add_array: - emit_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_thisthread: - emit_opcode(opcode::OP_GetThisthread); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - 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, blk); - 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, const block::ptr& blk) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue, blk); - } - else if (expr->lvalue == ast::kind::expr_tuple) - { - emit_expr(expr->rvalue, blk); - emit_expr_tuple(expr->lvalue.as_tuple, blk); - } - else - { - emit_expr(expr->rvalue, blk); - emit_expr_variable_ref(expr->lvalue, blk, true); - } - - return; - } - - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - 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_mod); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_ex_or); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, blk, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key, blk); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, blk, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj, blk); - 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, blk, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk) -{ - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); - else - emit_opcode(opcode::OP_ClearLocalVariableFieldCached, variable_access_index(expr, blk)); -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_inc); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_dec); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr, blk); - emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr, blk); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_equality); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_inequality); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_less); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_greater); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_less_equal); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_greater_equal); - 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_ex_or); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_mod); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt && mode_ == gsc::build::prod) - { - const auto& name = expr->name->value; - if (name == "assert" || name == "assertex" || name == "assertmsg") return; - } - - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal && expr->args->list.size() > 0) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptLocalFunctionCall, expr->name->value); - else - emit_opcode(opcode::OP_ScriptLocalFunctionCall2, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptFarFunctionCall, { expr->path->value, expr->name->value }); - else - emit_opcode(opcode::OP_ScriptFarFunctionCall2, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltin0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltin1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltin2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltin3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltin4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltin5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltin, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptLocalMethodCall, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFarMethodCall, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltinMethod0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltinMethod1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltinMethod2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltinMethod3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltinMethod4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltinMethod5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltinMethod, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_EmptyArray); - - for (const auto& arg : expr->args->list) - { - emit_expr(arg, blk); - emit_opcode(opcode::OP_AddArray); - } -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) -{ - for (const auto& entry : expr->list) - { - variable_initialize(entry, blk); - emit_opcode(opcode::OP_SafeCreateVariableFieldCached, variable_create_index(entry, blk)); - } - - emit_opcode(opcode::OP_checkclearparams); -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry, blk); - } -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) -{ - bool method = false; - auto type = resolve_reference_type(expr, method); - - switch (type) - { - case ast::call::type::local: - emit_opcode(opcode::OP_GetLocalFunction, expr->name->value); - break; - case ast::call::type::far: - emit_opcode(opcode::OP_GetFarFunction, { expr->path->value, expr->name->value }); - break; - case ast::call::type::builtin: - if (method) - emit_opcode(opcode::OP_GetBuiltinMethod, expr->name->value); - else - emit_opcode(opcode::OP_GetBuiltinFunction, expr->name->value); - break; - } -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_size); -} - -void compiler::emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - emit_expr_variable_ref(expr->temp, blk, true); - - auto index = 0; - - for (const auto& entry : expr->list) - { - if (index == 0) - emit_opcode(opcode::OP_GetZero); - else - emit_opcode(opcode::OP_GetByte, utils::string::va("%d", index)); - - index++; - - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->temp.as_identifier, blk)); - - emit_expr_variable_ref(entry, blk, true); - } - - emit_expr_clear_local(expr->temp.as_identifier, blk); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, blk, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, blk, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, blk, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set) -{ - emit_expr(expr->key, blk); - - 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, blk, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - { - if (!variable_initialized(expr->obj.as_identifier, blk)) - { - variable_initialize(expr->obj.as_identifier, blk); - emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(expr->obj.as_identifier, blk)); - - if (!set) throw comp_error(expr->loc(), "INTERNAL: VAR CREATED BUT NOT SET!"); - } - else if (variable_stack_index(expr->obj.as_identifier, blk) == 0) - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached0); - } - else - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access_index(expr->obj.as_identifier, blk)); - } - - 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, const block::ptr& blk, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); - break; - case ast::kind::expr_anim: - set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); - break; - case ast::kind::expr_self: - set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - 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, blk); - 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_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, 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 + "'"); - } - - if (set) - { - if (!variable_initialized(expr, blk)) - { - variable_initialize(expr, blk); - emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(expr, blk)); - } - else if (variable_stack_index(expr, blk) == 0) - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached0); - } - else - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached, variable_access_index(expr, blk)); - } - } - else - { - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_EvalLocalVariableRefCached0); - else - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access_index(expr, blk)); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->key, blk); - - if (expr->obj == ast::kind::expr_identifier) - { - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->obj.as_identifier, blk)); - } - else - { - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_EvalArray); - } -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_EvalLevelFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_EvalAnimFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_EvalSelfFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, const block::ptr& blk) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - emit_expr(itr->second, blk); - return; - } - - // is local var - auto index = variable_stack_index(expr, blk); - - switch (index) - { - case 0: - emit_opcode(opcode::OP_EvalLocalVariableCached0); - break; - case 1: - emit_opcode(opcode::OP_EvalLocalVariableCached1); - break; - case 2: - emit_opcode(opcode::OP_EvalLocalVariableCached2); - break; - case 3: - emit_opcode(opcode::OP_EvalLocalVariableCached3); - break; - case 4: - emit_opcode(opcode::OP_EvalLocalVariableCached4); - break; - case 5: - emit_opcode(opcode::OP_EvalLocalVariableCached5); - break; - default: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access_index(expr, blk)); - break; - } -} - -void compiler::emit_expr_object(const ast::expr& expr, const block::ptr& blk) -{ - 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, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr.as_identifier, blk)); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk) -{ - std::vector data; - - bool isexpr = false; - - 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, blk); - emit_expr(expr->y, blk); - emit_expr(expr->x, blk); - 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(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimation, { "", expr->value }); - } - else - { - emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); - tree.loaded = true; - } -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error(expr->loc(), "trying to use animtree without specified using animtree"); - } - - auto& tree = animtrees_.back(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimTree, ""); - } - else - { - emit_opcode(opcode::OP_GetAnimTree, tree.name); - tree.loaded = true; - } -} - -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_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_create_local_vars(const block::ptr& blk) -{ - if (blk->local_vars_create_count != blk->local_vars_public_count) - { - for (auto i = blk->local_vars_create_count; i < blk->local_vars_public_count; i++) - { - auto data = utils::string::va("%d", blk->local_vars.at(i).create); - emit_opcode(opcode::OP_CreateLocalVariable, data); - blk->local_vars.at(i).init = true; - } - blk->local_vars_create_count = blk->local_vars_public_count; - } -} - -void compiler::emit_remove_local_vars(const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - auto count = blk->local_vars_create_count - blk->local_vars_public_count; - - if (count > 0) - { - auto data = utils::string::va("%d", count); - emit_opcode(opcode::OP_RemoveLocalVariables, data); - } - } -} - -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, const block::ptr& blk) -{ - process_expr_parameters(decl->params, blk); - process_stmt_list(decl->stmt, blk); -} - -void compiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - 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_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, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk) -{ - process_stmt_list(stmt->list, blk); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - 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, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - blk->merge(childs); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - stmt->blk_if = std::make_unique(); - stmt->blk_else = std::make_unique(); - - blk->copy(stmt->blk_if); - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - blk->copy(stmt->blk_else); - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - blk->merge(childs); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - stmt->blk = std::make_unique(); - stmt->blk_iter = std::make_unique(); - - process_stmt(stmt->init, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->blk); - blk->copy(stmt->blk_iter); - - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_stmt(stmt->iter, stmt->blk_iter); - - blk->append({ stmt->blk_iter.get() }); - blk->merge({ stmt->blk_iter.get() }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto array_name = utils::string::va("_temp_%d", ++label_idx_); - auto key_name = utils::string::va("_temp_%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; - - // calculate variables - - stmt->ctx = std::make_unique(); - stmt->ctx_post = std::make_unique(); - - // calculate pre_expr variables - process_expr(stmt->array, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->ctx); - blk->copy(stmt->ctx_post); - - // calculate stmt variables & add missing array access as first stmt - process_expr(stmt->value_expr, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - continue_blks_.push_back(stmt->ctx.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_expr(stmt->key_expr, stmt->ctx_post); - - blk->append({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - // calculate variables - stmt->ctx = std::make_unique(); - std::vector childs; - auto abort = abort_t::abort_return; - bool has_default = false; - block* default_ctx = nullptr; - auto old_breaks = break_blks_; - break_blks_.clear(); - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->copy(entry.as_case->blk); - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort != abort_t::abort_none) - { - if (entry.as_case->blk->abort == abort_t::abort_break ) - { - entry.as_case->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_case->blk.get()); - } - else if (entry.as_case->blk->abort <= abort ) - { - abort = entry.as_case->blk->abort; - } - } - } - else if (entry == ast::kind::stmt_default) - { - entry.as_default->blk = std::make_unique(); - blk->copy(entry.as_default->blk); - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - has_default = true; - default_ctx = entry.as_default->blk.get(); - - if (entry.as_default->blk->abort != abort_t::abort_none) - { - if (entry.as_default->blk->abort == abort_t::abort_break ) - { - entry.as_default->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_default->blk.get()); - } - else if (entry.as_default->blk->abort <= abort ) - { - abort = entry.as_default->blk->abort; - } - } - } - } - - stmt->stmt =std::move(stmt_list); - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - } - - blk->append(break_blks_); - blk->merge(childs); - } - - break_blks_ = old_breaks; -} - -void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - break_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_break; - } -} - -void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - continue_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_continue; - } -} - -void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } -} - -void compiler::process_expr(const ast::expr& expr, const block::ptr& blk) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value, blk); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj, blk); - } - else if (expr == ast::kind::expr_tuple) - { - process_expr_tuple(expr.as_tuple, blk); - } -} - -void compiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - auto array = utils::string::va("_temp_%d", ++label_idx_); - expr->temp = ast::expr(std::make_unique(expr->loc(), array)); - - process_expr(expr->temp, blk); - - for (const auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk) -{ - for (const auto& entry : decl->list) - { - variable_register(entry->value, blk); - } -} - -void compiler::variable_register(const std::string& name, const block::ptr& blk) -{ - auto it = std::find_if (blk->local_vars.begin(), blk->local_vars.end(), - [&](const gsc::local_var& v) { return v.name == name; }); - - if (it == blk->local_vars.end()) - { - auto found = false; - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - blk->local_vars.push_back({ name, static_cast(i), false }); - found = true; - break; - } - } - - if (!found) - { - blk->local_vars.push_back({ name, stack_idx_, false }); - local_stack_.push_back(name); - stack_idx_++; - } - } -} - -void compiler::variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::uint32_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (!blk->local_vars[i].init) - { - for (std::uint32_t j = 0; j < i; j++) - { - if (!blk->local_vars[j].init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", blk->local_vars[j].create)); - blk->local_vars[j].init = true; - } - } - blk->local_vars[i].init = true; - blk->local_vars_create_count = i + 1; - return; - } - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -void compiler::variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - auto& var = blk->local_vars.at(i); - if (var.name == name->value) - { - if (!var.init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); - var.init = true; - blk->local_vars_create_count++; - } - return; - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return static_cast(blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - return utils::string::va("%d", blk->local_vars[i].create); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return utils::string::va("%d", blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - return blk->local_vars.at(i).init; - } - } - - 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_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jump: - case opcode::OP_jumpback: - case opcode::OP_switch: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_endswitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - -auto compiler::map_known_includes(const std::string&) -> bool -{ - return false; -} - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/compiler.hpp b/src/iw6/xsk/compiler.hpp deleted file mode 100644 index 86f3a26e..00000000 --- a/src/iw6/xsk/compiler.hpp +++ /dev/null @@ -1,159 +0,0 @@ -// 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::gsc::iw6 -{ - -enum class opcode : std::uint8_t; - -class compiler : public gsc::compiler -{ - build mode_; - std::string filename_; - std::vector assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector break_blks_; - std::vector continue_blks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - -public: - auto output() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_constant(const ast::decl_constant::ptr& constant); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last); - void emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void emit_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt, const block::ptr& blk); - void emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk); - void emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk); - void emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk); - void emit_expr(const ast::expr& expr, const block::ptr& blk); - void emit_expr_assign(const ast::expr_assign::ptr& expr, const block::ptr& blk); - void emit_expr_clear(const ast::expr& expr, const block::ptr& blk); - void emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk); - void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk); - void emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_variable(const ast::expr& expr, const block::ptr& blk); - void emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void emit_expr_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_object(const ast::expr& expr, const block::ptr& blk); - void emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_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_create_local_vars(const block::ptr& blk); - void emit_remove_local_vars(const block::ptr& blk); - 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, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(const ast::expr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk); - void variable_register(const std::string& name, const block::ptr& blk); - void variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk); - void variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk); - auto variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t; - auto variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool; - 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; -}; - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/context.cpp b/src/iw6/xsk/context.cpp deleted file mode 100644 index 9408f909..00000000 --- a/src/iw6/xsk/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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 "iw6.hpp" - -namespace xsk::gsc::iw6 -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/context.hpp b/src/iw6/xsk/context.hpp deleted file mode 100644 index 7a253b5c..00000000 --- a/src/iw6/xsk/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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::gsc::iw6 -{ - -class context : public gsc::context -{ - iw6::assembler assembler_; - iw6::disassembler disassembler_; - iw6::compiler compiler_; - iw6::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { return assembler_; } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { return compiler_; } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/decompiler.cpp b/src/iw6/xsk/decompiler.cpp deleted file mode 100644 index e15be07c..00000000 --- a/src/iw6/xsk/decompiler.cpp +++ /dev/null @@ -1,3436 +0,0 @@ -// 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 "iw6.hpp" - -namespace xsk::gsc::iw6 -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// IW6 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetLocalFunction: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalFunctionCall2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - 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_ScriptLocalFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalMethodCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodChildThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall2: - { - 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 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_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin1: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin3: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin4: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin5: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod1: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod2: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod3: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod4: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod5: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_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 node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // continue is at jumpback, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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 - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - auto use_key = true; - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - use_key = false; - } - - 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)), use_key)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(std::stoi(entry->value.substr(4))), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - auto var = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - auto var1 = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); - blk->local_vars_create_count++; - } - - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/decompiler.hpp b/src/iw6/xsk/decompiler.hpp deleted file mode 100644 index 6fa61337..00000000 --- a/src/iw6/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::iw6 -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/disassembler.cpp b/src/iw6/xsk/disassembler.cpp deleted file mode 100644 index a719bbe0..00000000 --- a/src/iw6/xsk/disassembler.cpp +++ /dev/null @@ -1,574 +0,0 @@ -// 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 "iw6.hpp" - -namespace xsk::gsc::iw6 -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// IW6 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read(); - func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - 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->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetVector: - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(4); - inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); - break; - case opcode::OP_GetAnimation: - script_->seek(8); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - disassemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto id = script_->read(); - const auto name = method ? resolver::method_name(id) : resolver::function_name(id); - inst->data.emplace(inst->data.begin(), name); -} - -void disassembler::disassemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto offset = disassemble_offset(); - - inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(3); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto file_id = stack_->read(); - const auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::token_name(file_id); - const auto func_id = stack_->read(); - const auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); - - inst->data.emplace(inst->data.begin(), func_name); - inst->data.emplace(inst->data.begin(), file_name); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read(); - 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) -{ - const auto count = script_->read(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read(); - - if (value < 0x40000) - { - const auto data = stack_->read_c_string(); - - if (data.data()[0] != 0x01) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(data, false)); - } - else - inst->data.push_back("default"); - } - else - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - index += 4; - - const auto addr = disassemble_offset() + index; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 3; - inst->size += 7; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - const auto id = script_->read(); - std::string name; - - if (id > max_string_id) - { - auto temp = stack_->read(); - name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); - } - else - { - name = resolver::token_name(id); - } - - inst->data.push_back(name); -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read(); - } - else if (back) - { - addr = inst->index + 3 - script_->read(); - } - else - { - addr = inst->index + 5 + script_->read(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -auto disassembler::disassemble_offset() -> std::int32_t -{ - std::array bytes = {}; - - for (auto i = 0; i < 3; i++) - { - bytes[i] = script_->read(); - } - - auto offset = *reinterpret_cast(bytes.data()); - - offset = (offset << 8) >> 10; - - return offset; -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = resolve_function(inst->data[0]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s\n", func->name.data())); - - 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())); - } - - print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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; - } - if (casenum != totalcase - 1) - { - output_->write_string("\n"); - } - } - } - break; - default: - for (auto& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - break; - } - - output_->write_string("\n"); -} - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/disassembler.hpp b/src/iw6/xsk/disassembler.hpp deleted file mode 100644 index ee980c71..00000000 --- a/src/iw6/xsk/disassembler.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc::iw6 -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_local_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - auto disassemble_offset() -> std::int32_t; - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/iw6.cpp b/src/iw6/xsk/iw6.cpp deleted file mode 100644 index 097a37bd..00000000 --- a/src/iw6/xsk/iw6.cpp +++ /dev/null @@ -1,181 +0,0 @@ -// 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 "iw6.hpp" - -namespace xsk::gsc::iw6 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - return 1; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_GetAnimTree: - case opcode::OP_GetNegByte: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_GetByte: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_waittillmatch: - return 2; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_GetUnsignedShort: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_jumpback: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - case opcode::OP_JumpOnFalse: - case opcode::OP_endswitch: - return 3; - case opcode::OP_CallBuiltin: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_GetLocalFunction: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarMethodCall: - return 4; - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_GetFloat: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_switch: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - case opcode::OP_jump: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_GetInteger: - case opcode::OP_GetString: - case opcode::OP_GetIString: - return 5; - case opcode::OP_GetAnimation: - return 9; - case opcode::OP_GetVector: - return 13; - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/iw6.hpp b/src/iw6/xsk/iw6.hpp deleted file mode 100644 index d32bef55..00000000 --- a/src/iw6/xsk/iw6.hpp +++ /dev/null @@ -1,182 +0,0 @@ -// 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 "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::iw6 -{ - -constexpr std::uint16_t max_string_id = 0x95A1; - -enum class opcode : std::uint8_t -{ - OP_SetNewLocalVariableFieldCached0 = 0x17, - OP_EvalSelfFieldVariable = 0x18, - OP_Return = 0x19, - OP_CallBuiltin0 = 0x1A, - OP_CallBuiltin1 = 0x1B, - OP_CallBuiltin2 = 0x1C, - OP_CallBuiltin3 = 0x1D, - OP_CallBuiltin4 = 0x1E, - OP_CallBuiltin5 = 0x1F, - OP_CallBuiltin = 0x20, - OP_BoolNot = 0x21, - OP_ScriptFarMethodThreadCall = 0x22, - OP_JumpOnTrueExpr = 0x23, - OP_SetLevelFieldVariableField = 0x24, - OP_CastBool = 0x25, - OP_EvalNewLocalArrayRefCached0 = 0x26, - OP_CallBuiltinPointer = 0x27, - OP_inequality = 0x28, - OP_GetThisthread = 0x29, - OP_ClearFieldVariable = 0x2A, - OP_GetFloat = 0x2B, - OP_SafeCreateVariableFieldCached = 0x2C, - OP_ScriptFarFunctionCall2 = 0x2D, - OP_ScriptFarFunctionCall = 0x2E, - OP_ScriptFarChildThreadCall = 0x2F, - OP_ClearLocalVariableFieldCached0 = 0x30, - OP_ClearLocalVariableFieldCached = 0x31, - OP_checkclearparams = 0x32, - OP_CastFieldObject = 0x33, - OP_End = 0x34, - OP_size = 0x35, - OP_EmptyArray = 0x36, - OP_bit_and = 0x37, - OP_less_equal = 0x38, - OP_voidCodepos = 0x39, - OP_ScriptMethodThreadCallPointer = 0x3A, - OP_endswitch = 0x3B, - OP_ClearVariableField = 0x3C, - OP_divide = 0x3D, - OP_ScriptFarMethodChildThreadCall = 0x3E, - OP_GetUnsignedShort = 0x3F, - OP_JumpOnTrue = 0x40, - OP_GetSelf = 0x41, - OP_ScriptFarThreadCall = 0x42, - OP_ScriptLocalThreadCall = 0x43, - OP_SetLocalVariableFieldCached0 = 0x44, - OP_SetLocalVariableFieldCached = 0x45, - OP_plus = 0x46, - OP_BoolComplement = 0x47, - OP_ScriptMethodCallPointer = 0x48, - OP_inc = 0x49, - OP_RemoveLocalVariables = 0x4A, - OP_JumpOnFalseExpr = 0x4B, - OP_switch = 0x4C, - OP_clearparams = 0x4D, - OP_EvalLocalVariableRefCached0 = 0x4E, - OP_EvalLocalVariableRefCached = 0x4F, - OP_ScriptLocalMethodCall = 0x50, - OP_EvalFieldVariable = 0x51, - OP_EvalFieldVariableRef = 0x52, - OP_GetString = 0x53, - OP_ScriptFunctionCallPointer = 0x54, - OP_EvalLevelFieldVariable = 0x55, - OP_GetVector = 0x56, - OP_endon = 0x57, - OP_greater_equal = 0x58, - OP_GetSelfObject = 0x59, - OP_SetAnimFieldVariableField = 0x5A, - OP_SetVariableField = 0x5B, - OP_ScriptLocalFunctionCall2 = 0x5C, - OP_ScriptLocalFunctionCall = 0x5D, - OP_EvalLocalArrayRefCached0 = 0x5E, - OP_EvalLocalArrayRefCached = 0x5F, - OP_GetFarFunction = 0x60, - OP_less = 0x61, - OP_GetGameRef = 0x62, - OP_waittillFrameEnd = 0x63, - OP_SafeSetVariableFieldCached0 = 0x64, - OP_SafeSetVariableFieldCached = 0x65, - OP_ScriptMethodChildThreadCallPointer = 0x66, - OP_GetLevel = 0x67, - OP_notify = 0x68, - OP_DecTop = 0x69, - OP_shift_left = 0x6A, - OP_ScriptLocalMethodThreadCall = 0x6B, - OP_ScriptLocalMethodChildThreadCall = 0x6C, - OP_greater = 0x6D, - OP_EvalLocalVariableCached0 = 0x6E, - OP_EvalLocalVariableCached1 = 0x6F, - OP_EvalLocalVariableCached2 = 0x70, - OP_EvalLocalVariableCached3 = 0x71, - OP_EvalLocalVariableCached4 = 0x72, - OP_EvalLocalVariableCached5 = 0x73, - OP_EvalLocalVariableCached = 0x74, - OP_SafeSetWaittillVariableFieldCached = 0x75, - OP_jump = 0x76, - OP_ScriptThreadCallPointer = 0x77, - OP_GetZero = 0x78, - OP_wait = 0x79, - OP_minus = 0x7A, - OP_SetSelfFieldVariableField = 0x7B, - OP_EvalNewLocalVariableRefCached0 = 0x7C, - OP_multiply = 0x7D, - OP_CreateLocalVariable = 0x7E, - OP_ScriptLocalChildThreadCall = 0x7F, - OP_GetInteger = 0x80, - OP_mod = 0x81, - OP_EvalAnimFieldVariableRef = 0x82, - OP_GetBuiltinFunction = 0x83, - OP_GetGame = 0x84, - OP_waittill = 0x85, - OP_dec = 0x86, - OP_EvalLocalVariableObjectCached = 0x87, - OP_PreScriptCall = 0x88, - OP_GetAnim = 0x89, - OP_GetUndefined = 0x8A, - OP_EvalLevelFieldVariableRef = 0x8B, - OP_GetAnimObject = 0x8C, - OP_GetLevelObject = 0x8D, - OP_bit_ex_or = 0x8E, - OP_equality = 0x8F, - OP_ClearArray = 0x90, - OP_jumpback = 0x91, - OP_GetAnimation = 0x92, - OP_EvalAnimFieldVariable = 0x93, - OP_GetAnimTree = 0x94, - OP_GetIString = 0x95, - OP_EvalArrayRef = 0x96, - OP_EvalSelfFieldVariableRef = 0x97, - OP_GetNegByte = 0x98, - OP_GetBuiltinMethod = 0x99, - OP_CallBuiltinMethodPointer = 0x9A, - OP_EvalArray = 0x9B, - OP_vector = 0x9C, - OP_ScriptFarMethodCall = 0x9D, - OP_EvalLocalArrayCached = 0x9E, - OP_GetByte = 0x9F, - OP_ScriptChildThreadCallPointer = 0xA0, - OP_bit_or = 0xA1, - OP_AddArray = 0xA2, - OP_waittillmatch2 = 0xA3, - OP_waittillmatch = 0xA4, - OP_GetLocalFunction = 0xA5, - OP_GetNegUnsignedShort = 0xA6, - OP_shift_right = 0xA7, - OP_CallBuiltinMethod0 = 0xA8, - OP_CallBuiltinMethod1 = 0xA9, - OP_CallBuiltinMethod2 = 0xAA, - OP_CallBuiltinMethod3 = 0xAB, - OP_CallBuiltinMethod4 = 0xAC, - OP_CallBuiltinMethod5 = 0xAD, - OP_CallBuiltinMethod = 0xAE, - OP_JumpOnFalse = 0xAF, - OP_Count = 0xB0, -}; - -auto opcode_size(std::uint8_t op) -> std::uint32_t; - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/lexer.cpp b/src/iw6/xsk/lexer.cpp deleted file mode 100644 index 500b0078..00000000 --- a/src/iw6/xsk/lexer.cpp +++ /dev/null @@ -1,848 +0,0 @@ -// 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 "iw6.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -xsk::gsc::iw6::parser::symbol_type IW6lex(xsk::gsc::iw6::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::gsc::iw6 -{ - -const std::unordered_map keyword_map -{{ - { "#define", parser::token::SH_DEFINE }, - { "#undef", parser::token::SH_UNDEF }, - { "#ifdef", parser::token::SH_IFDEF }, - { "#ifndef", parser::token::SH_IFNDEF }, - { "#if", parser::token::SH_IF }, - { "#elif", parser::token::SH_ELIF }, - { "#else", parser::token::SH_ELSE }, - { "#endif", parser::token::SH_ENDIF }, - { "#inline", parser::token::INLINE }, - { "#include", parser::token::INCLUDE }, - { "#using_animtree", parser::token::USINGTREE }, - { "#animtree", parser::token::ANIMTREE }, - { "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 }, - { "childthread", parser::token::CHILDTHREAD }, - { "thisthread", parser::token::THISTHREAD }, - { "call", parser::token::CALL }, - { "true", parser::token::TRUE }, - { "false", parser::token::FALSE }, - { "undefined", parser::token::UNDEFINED }, - { "size", parser::token::SIZE }, - { "game", parser::token::GAME }, - { "self", parser::token::SELF }, - { "anim", parser::token::ANIM }, - { "level", parser::token::LEVEL }, -}}; - -buffer::buffer() : length(0) -{ - data = static_cast(std::malloc(max_buf_size)); -} - -buffer::~buffer() -{ - if (data) std::free(data); -} - -bool buffer::push(char c) -{ - if (length >= max_buf_size) - return false; - - data[length++] = c; - return true; -} - -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) -{ - -} - -void reader::init(const char* data, size_t size) -{ - if (data && size) - { - state = reader::ok; - buffer_pos = data; - bytes_remaining = static_cast(size); - last_byte = 0; - current_byte = *data; - } - else - { - state = reader::end; - buffer_pos = 0; - bytes_remaining = 0; - last_byte = 0; - current_byte = 0; - } -} - -void reader::advance() -{ - ++buffer_pos; - - if (bytes_remaining-- == 1) - { - state = reader::end; - bytes_remaining = 0; - last_byte = current_byte; - current_byte = 0; - } - else - { - last_byte = current_byte; - current_byte = *buffer_pos; - } -} - -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) -{ - reader_.init(data, size); -} - -void lexer::push_header(const std::string& file) -{ - try - { - if (header_top_++ >= 10) - throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - - auto data = resolver::file_data(file + ".gsh"); - - readers_.push(reader_); - locs_.push(loc_); - loc_.initialize(std::get<0>(data)); - reader_.init(std::get<1>(data), std::get<2>(data)); - clean_ = true; - } - catch (const std::exception& e) - { - throw error("parsing header file '" + file + "': " + e.what()); - } -} - -void lexer::pop_header() -{ - header_top_--; - loc_ = locs_.top(); - locs_.pop(); - reader_ = readers_.top(); - readers_.pop(); -} - -void lexer::ban_header(const location& loc) -{ - if (header_top_ > 0) - { - throw comp_error(loc, "not allowed inside a gsh file"); - } -} - -auto lexer::lex() -> parser::symbol_type -{ - buffer_.length = 0; - state_ = state::start; - - while (true) - { - const auto& state = reader_.state; - auto& last = reader_.last_byte; - auto& curr = reader_.current_byte; - auto path = false; - loc_.step(); - - if (state == reader::end) - { - if (indev_) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (header_top_ > 0) - pop_header(); - else - return parser::make_IW6EOF(loc_); - } - - if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') - clean_ = false; - - advance(); - - switch (last) - { - case ' ': - case '\t': - case '\r': - loc_.step(); - continue; - case '\n': - loc_.lines(); - loc_.step(); - clean_ = true; - continue; - case '\\': - throw comp_error(loc_, "invalid token ('\\')"); - case '/': - if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') - return parser::make_DIV(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_DIV(loc_); - - if (last == '#') - { - if (indev_) - throw comp_error(loc_, "cannot recurse devblock ('/#')"); - - if (mode_ == build::dev) - { - indev_ = true; - return parser::make_DEVBEGIN(loc_); - } - else - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '#' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - } - else if (last == '@') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched script doc comment start ('/@')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '@' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '*') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched multiline comment start ('/*')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '*' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '/') - { - while (true) - { - if (state == reader::end) - break; - - if (curr == '\n') - break; - - advance(); - } - } - continue; - case '#': - if (curr == '/') - { - if (!indev_) - throw comp_error(loc_, "unmatched devblock end ('#/')"); - - advance(); - indev_ = false; - return parser::make_DEVEND(loc_); - } - - buffer_.push(last); - advance(); - - while (state == reader::ok) - { - if (last != ' ' || last != '\t') - break; - - advance(); - } - - if (state == reader::end || !((last > 64 && last < 91) || (last > 96 && last < 123))) - throw comp_error(loc_, "invalid preprocessor directive ('#')"); - - state_ = state::preprocessor; - goto lex_name; - case '*': - if (curr != '=' && curr != '/') - return parser::make_MUL(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_MUL(loc_); - - throw comp_error(loc_, "unmatched multiline comment end ('*/')"); - case '"': - state_ = state::string; - goto lex_string; - case '.': - if (curr < '0' || curr > '9') - return parser::make_DOT(loc_); - goto lex_number; - case '(': - return parser::make_LPAREN(loc_); - case ')': - return parser::make_RPAREN(loc_); - case '{': - return parser::make_LBRACE(loc_); - case '}': - return parser::make_RBRACE(loc_); - case '[': - return parser::make_LBRACKET(loc_); - case ']': - return parser::make_RBRACKET(loc_); - case ',': - return parser::make_COMMA(loc_); - case ';': - return parser::make_SEMICOLON(loc_); - case ':': - if (curr != ':') - return parser::make_COLON(loc_); - - advance(); - return parser::make_DOUBLECOLON(loc_); - case '?': - return parser::make_QMARK(loc_); - case '=': - if (curr != '=') - return parser::make_ASSIGN(loc_); - - advance(); - return parser::make_EQUALITY(loc_); - case '+': - if (curr != '+' && curr != '=') - return parser::make_ADD(loc_); - - advance(); - - if (last == '+') - return parser::make_INCREMENT(loc_); - - return parser::make_ASSIGN_ADD(loc_); - case '-': - if (curr != '-' && curr != '=') - return parser::make_SUB(loc_); - - advance(); - - if (last == '-') - return parser::make_DECREMENT(loc_); - - return parser::make_ASSIGN_SUB(loc_); - case '%': - if (curr != '=') - return parser::make_MOD(loc_); - - advance(); - - return parser::make_ASSIGN_MOD(loc_); - case '|': - if (curr != '|' && curr != '=') - return parser::make_BITWISE_OR(loc_); - - advance(); - - if (last == '|') - return parser::make_OR(loc_); - - return parser::make_ASSIGN_BW_OR(loc_); - case '&': - if (curr != '&' && curr != '=' && curr != '"') - return parser::make_BITWISE_AND(loc_); - - advance(); - - if (last == '&') - return parser::make_AND(loc_); - - if (last == '=') - return parser::make_ASSIGN_BW_AND(loc_); - - state_ = state::localize; - goto lex_string; - case '^': - if (curr != '=') - return parser::make_BITWISE_EXOR(loc_); - - advance(); - return parser::make_ASSIGN_BW_EXOR(loc_); - case '!': - if (curr != '=') - return parser::make_NOT(loc_); - - advance(); - return parser::make_INEQUALITY(loc_); - case '~': - return parser::make_COMPLEMENT(loc_); - case '<': - if (curr != '<' && curr != '=') - return parser::make_LESS(loc_); - - advance(); - if (last == '=') - return parser::make_LESS_EQUAL(loc_); - - if (curr != '=') - return parser::make_LSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_LSHIFT(loc_); - case '>': - if (curr != '>' && curr != '=') - return parser::make_GREATER(loc_); - - advance(); - - if (last == '=') - return parser::make_GREATER_EQUAL(loc_); - - if (curr != '=') - return parser::make_RSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_RSHIFT(loc_); - default: - if (last >= '0' && last <= '9') - goto lex_number; - else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) - goto lex_name; - - throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); - } - -lex_string: - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched string start ('\"')"); - - if (curr == '"') - { - advance(); - break; - } - - if (curr == '\n') - throw comp_error(loc_, "unterminated string literal"); - - if (curr == '\\') - { - advance(); - - if (state == reader::end) - throw comp_error(loc_, "invalid token ('\')"); - - char c = curr; - switch (curr) - { - case 't': c = '\t'; break; - case 'r': c = '\r'; break; - case 'n': c = '\n'; break; - case '"': c = '\"'; break; - case '\\': c = '\\'; break; - default: break; - } - - if (!buffer_.push(c)) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); - -lex_name: - buffer_.push(last); - - while (true) - { - if (state == reader::end) - break; - - if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) - break; - - if (curr == '\\') - { - if (last == '\\') - throw comp_error(loc_, "invalid path '\\\\'"); - - path = true; - if (!buffer_.push('/')) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::preprocessor) - { - auto token = parser::token::IW6UNDEF; - - if (buffer_.length < 16) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - { - if (itr->second > parser::token::SH_ENDIF) - return parser::symbol_type(itr->second, loc_); - - token = itr->second; - } - } - - preprocessor_run(token); - - state_ = state::start; - continue; - } - else - { - 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_); - } - - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - -lex_number: - if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) - { - buffer_.push(last); - - auto dot = last == '.' ? 1 : 0; - auto flt = 0; - - while (true) - { - if (state == reader::end) - break; - - if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) - throw comp_error(loc_, "invalid number literal"); - - if ((curr == '.' || curr == 'f') && last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr == 'f') - flt++; - else if (curr == '.') - dot++; - else if (!(curr > 47 && curr < 58)) - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f')) - throw comp_error(loc_, "invalid number literal"); - - if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); - } - else if (curr == 'o') - { - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) - throw comp_error(loc_, "invalid octal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!(curr > 47 && curr < 56)) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length <= 0) - throw comp_error(loc_, "invalid octal literal"); - - return parser::make_INTEGER(utils::string::oct_to_dec(buffer_.data), loc_); - } - else if (curr == 'b') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) - throw comp_error(loc_, "invalid binary literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr != '0' && curr != '1') - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid binary literal"); - - return parser::make_INTEGER(utils::string::bin_to_dec(buffer_.data), loc_); - } - else if (curr == 'x') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) - throw comp_error(loc_, "invalid hexadecimal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid hexadecimal literal"); - - return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); - } - - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); - } -} - -void lexer::advance() -{ - reader_.advance(); - loc_.end.column++; - - if (reader_.current_byte == '\\') [[unlikely]] - preprocessor_wrap(); -} - -void lexer::preprocessor_wrap() -{ - while (reader_.current_byte == '\\') - { - if (reader_.bytes_remaining == 1) - throw comp_error(loc_, "invalid token ('\\')"); - - if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') - break; - - if (reader_.buffer_pos[1] == '\r') - { - if (reader_.bytes_remaining <= 3 || reader_.buffer_pos[2] != '\n') - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 3; - reader_.bytes_remaining -= 3; - } - - if ((reader_.buffer_pos[1] == '\n')) - { - if (reader_.bytes_remaining == 2) - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 2; - reader_.bytes_remaining -= 2; - } - - if (reader_.bytes_remaining == 0) - { - reader_.state = reader::end; - reader_.current_byte = 0; - } - else - { - reader_.current_byte = *reader_.buffer_pos; - } - - loc_.lines(); - loc_.step(); - } -} - -void lexer::preprocessor_run(parser::token::token_kind_type token) -{ - if (!clean_) - throw comp_error(loc_, "invalid token ('#')"); - - switch (token) - { - case parser::token::SH_DEFINE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_UNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELSE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ENDIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - default: - throw comp_error(loc_, "unknown preprocessor directive"); - } -} - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/lexer.hpp b/src/iw6/xsk/lexer.hpp deleted file mode 100644 index 0d8f5fa7..00000000 --- a/src/iw6/xsk/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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::gsc::iw6 -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/parser.cpp b/src/iw6/xsk/parser.cpp deleted file mode 100644 index 2222d48b..00000000 --- a/src/iw6/xsk/parser.cpp +++ /dev/null @@ -1,4668 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw6::parser::symbol_type IW6lex(xsk::gsc::iw6::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex IW6lex - - - -#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 IW6DEBUG - -// 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 // !IW6DEBUG - -# 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 // !IW6DEBUG - -#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 gsc { namespace iw6 { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::gsc::iw6::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg) -#if IW6DEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - 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_add_array: // expr_add_array - value.YY_MOVE_OR_COPY< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.YY_MOVE_OR_COPY< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.YY_MOVE_OR_COPY< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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 IW6DEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if IW6DEBUG - 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 // IW6DEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - yylhs.value.emplace< ast::expr_add_array::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - yylhs.value.emplace< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - yylhs.value.emplace< ast::expr_tuple::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_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_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_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 261 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2020 "parser.cpp" - break; - - case 3: // root: %empty -#line 262 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2026 "parser.cpp" - break; - - case 4: // program: program inline -#line 267 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2032 "parser.cpp" - break; - - case 5: // program: program include -#line 269 "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 2038 "parser.cpp" - break; - - case 6: // program: program declaration -#line 271 "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 2044 "parser.cpp" - break; - - case 7: // program: inline -#line 273 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2050 "parser.cpp" - break; - - case 8: // program: include -#line 275 "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 2056 "parser.cpp" - break; - - case 9: // program: declaration -#line 277 "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 2062 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 281 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2068 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 286 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2074 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 290 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2080 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 291 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2086 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 292 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2092 "parser.cpp" - break; - - case 15: // declaration: decl_constant -#line 293 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } -#line 2098 "parser.cpp" - break; - - case 16: // declaration: decl_thread -#line 294 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2104 "parser.cpp" - break; - - case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 299 "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 2110 "parser.cpp" - break; - - case 18: // decl_constant: expr_identifier "=" expr ";" -#line 304 "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 2116 "parser.cpp" - break; - - case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 309 "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 2122 "parser.cpp" - break; - - case 20: // stmt: stmt_block -#line 313 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2128 "parser.cpp" - break; - - case 21: // stmt: stmt_call -#line 314 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2134 "parser.cpp" - break; - - case 22: // stmt: stmt_assign -#line 315 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2140 "parser.cpp" - break; - - case 23: // stmt: stmt_endon -#line 316 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2146 "parser.cpp" - break; - - case 24: // stmt: stmt_notify -#line 317 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2152 "parser.cpp" - break; - - case 25: // stmt: stmt_wait -#line 318 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2158 "parser.cpp" - break; - - case 26: // stmt: stmt_waittill -#line 319 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2164 "parser.cpp" - break; - - case 27: // stmt: stmt_waittillmatch -#line 320 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2170 "parser.cpp" - break; - - case 28: // stmt: stmt_waittillframeend -#line 321 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2176 "parser.cpp" - break; - - case 29: // stmt: stmt_if -#line 322 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2182 "parser.cpp" - break; - - case 30: // stmt: stmt_ifelse -#line 323 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2188 "parser.cpp" - break; - - case 31: // stmt: stmt_while -#line 324 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2194 "parser.cpp" - break; - - case 32: // stmt: stmt_dowhile -#line 325 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2200 "parser.cpp" - break; - - case 33: // stmt: stmt_for -#line 326 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2206 "parser.cpp" - break; - - case 34: // stmt: stmt_foreach -#line 327 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2212 "parser.cpp" - break; - - case 35: // stmt: stmt_switch -#line 328 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2218 "parser.cpp" - break; - - case 36: // stmt: stmt_case -#line 329 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2224 "parser.cpp" - break; - - case 37: // stmt: stmt_default -#line 330 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2230 "parser.cpp" - break; - - case 38: // stmt: stmt_break -#line 331 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2236 "parser.cpp" - break; - - case 39: // stmt: stmt_continue -#line 332 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2242 "parser.cpp" - break; - - case 40: // stmt: stmt_return -#line 333 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2248 "parser.cpp" - break; - - case 41: // stmt: stmt_breakpoint -#line 334 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } -#line 2254 "parser.cpp" - break; - - case 42: // stmt: stmt_prof_begin -#line 335 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2260 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_end -#line 336 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2266 "parser.cpp" - break; - - case 44: // stmt_or_dev: stmt -#line 340 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2272 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt_dev -#line 341 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2278 "parser.cpp" - break; - - case 46: // stmt_list: stmt_list stmt -#line 346 "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 2284 "parser.cpp" - break; - - case 47: // stmt_list: stmt -#line 348 "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 2290 "parser.cpp" - break; - - case 48: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 353 "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 2296 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev -#line 355 "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 2302 "parser.cpp" - break; - - case 50: // stmt_dev: "/#" stmt_list "#/" -#line 359 "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 2308 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" "#/" -#line 360 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2314 "parser.cpp" - break; - - case 52: // stmt_block: "{" stmt_or_dev_list "}" -#line 364 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2320 "parser.cpp" - break; - - case 53: // stmt_block: "{" "}" -#line 365 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2326 "parser.cpp" - break; - - case 54: // stmt_expr: expr_assign -#line 370 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2332 "parser.cpp" - break; - - case 55: // stmt_expr: expr_increment -#line 372 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2338 "parser.cpp" - break; - - case 56: // stmt_expr: expr_decrement -#line 374 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2344 "parser.cpp" - break; - - case 57: // stmt_expr: %empty -#line 376 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2350 "parser.cpp" - break; - - case 58: // stmt_call: expr_call ";" -#line 381 "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 2356 "parser.cpp" - break; - - case 59: // stmt_call: expr_method ";" -#line 383 "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 2362 "parser.cpp" - break; - - case 60: // stmt_assign: expr_assign ";" -#line 388 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2368 "parser.cpp" - break; - - case 61: // stmt_assign: expr_increment ";" -#line 390 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2374 "parser.cpp" - break; - - case 62: // stmt_assign: expr_decrement ";" -#line 392 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2380 "parser.cpp" - break; - - case 63: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 397 "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 2386 "parser.cpp" - break; - - case 64: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 402 "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 2392 "parser.cpp" - break; - - case 65: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 404 "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 2398 "parser.cpp" - break; - - case 66: // stmt_wait: "wait" expr ";" -#line 409 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2404 "parser.cpp" - break; - - case 67: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 414 "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 2410 "parser.cpp" - break; - - case 68: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 416 "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 2416 "parser.cpp" - break; - - case 69: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 421 "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 2422 "parser.cpp" - break; - - case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 423 "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 2428 "parser.cpp" - break; - - case 71: // stmt_waittillframeend: "waittillframeend" ";" -#line 428 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2434 "parser.cpp" - break; - - case 72: // stmt_if: "if" "(" expr ")" stmt -#line 433 "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 2440 "parser.cpp" - break; - - case 73: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 438 "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 2446 "parser.cpp" - break; - - case 74: // stmt_while: "while" "(" expr ")" stmt -#line 443 "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 2452 "parser.cpp" - break; - - case 75: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 448 "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 2458 "parser.cpp" - break; - - case 76: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 453 "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 2464 "parser.cpp" - break; - - case 77: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 458 "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 2470 "parser.cpp" - break; - - case 78: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 460 "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 2476 "parser.cpp" - break; - - case 79: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 465 "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 2482 "parser.cpp" - break; - - case 80: // stmt_case: "case" expr_integer ":" -#line 470 "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 2488 "parser.cpp" - break; - - case 81: // stmt_case: "case" expr_string ":" -#line 472 "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 2494 "parser.cpp" - break; - - case 82: // stmt_default: "default" ":" -#line 477 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2500 "parser.cpp" - break; - - case 83: // stmt_break: "break" ";" -#line 482 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2506 "parser.cpp" - break; - - case 84: // stmt_continue: "continue" ";" -#line 487 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2512 "parser.cpp" - break; - - case 85: // stmt_return: "return" expr ";" -#line 492 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2518 "parser.cpp" - break; - - case 86: // stmt_return: "return" ";" -#line 494 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2524 "parser.cpp" - break; - - case 87: // stmt_breakpoint: "breakpoint" ";" -#line 499 "parser.ypp" - { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } -#line 2530 "parser.cpp" - break; - - case 88: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 504 "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 2536 "parser.cpp" - break; - - case 89: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 509 "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 2542 "parser.cpp" - break; - - case 90: // expr: expr_ternary -#line 513 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2548 "parser.cpp" - break; - - case 91: // expr: expr_binary -#line 514 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2554 "parser.cpp" - break; - - case 92: // expr: expr_primitive -#line 515 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2560 "parser.cpp" - break; - - case 93: // expr_or_empty: expr -#line 519 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2566 "parser.cpp" - break; - - case 94: // expr_or_empty: %empty -#line 520 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2572 "parser.cpp" - break; - - case 95: // expr_assign: expr_tuple "=" expr -#line 525 "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 2578 "parser.cpp" - break; - - case 96: // expr_assign: expr_object "=" expr -#line 527 "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 2584 "parser.cpp" - break; - - case 97: // expr_assign: expr_object "|=" expr -#line 529 "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 2590 "parser.cpp" - break; - - case 98: // expr_assign: expr_object "&=" expr -#line 531 "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 2596 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "^=" expr -#line 533 "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 2602 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "<<=" expr -#line 535 "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 2608 "parser.cpp" - break; - - case 101: // expr_assign: expr_object ">>=" expr -#line 537 "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 2614 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "+=" expr -#line 539 "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 2620 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "-=" expr -#line 541 "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 2626 "parser.cpp" - break; - - case 104: // expr_assign: expr_object "*=" expr -#line 543 "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 2632 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "/=" expr -#line 545 "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 2638 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "%=" expr -#line 547 "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 2644 "parser.cpp" - break; - - case 107: // expr_increment: "++" expr_object -#line 552 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2650 "parser.cpp" - break; - - case 108: // expr_increment: expr_object "++" -#line 554 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2656 "parser.cpp" - break; - - case 109: // expr_decrement: "--" expr_object -#line 559 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2662 "parser.cpp" - break; - - case 110: // expr_decrement: expr_object "--" -#line 561 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2668 "parser.cpp" - break; - - case 111: // expr_ternary: expr "?" expr ":" expr -#line 566 "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 2674 "parser.cpp" - break; - - case 112: // expr_binary: expr "||" expr -#line 571 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2680 "parser.cpp" - break; - - case 113: // expr_binary: expr "&&" expr -#line 573 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2686 "parser.cpp" - break; - - case 114: // expr_binary: expr "==" expr -#line 575 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2692 "parser.cpp" - break; - - case 115: // expr_binary: expr "!=" expr -#line 577 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2698 "parser.cpp" - break; - - case 116: // expr_binary: expr "<=" expr -#line 579 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2704 "parser.cpp" - break; - - case 117: // expr_binary: expr ">=" expr -#line 581 "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 2710 "parser.cpp" - break; - - case 118: // expr_binary: expr "<" expr -#line 583 "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 2716 "parser.cpp" - break; - - case 119: // expr_binary: expr ">" expr -#line 585 "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 2722 "parser.cpp" - break; - - case 120: // expr_binary: expr "|" expr -#line 587 "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 2728 "parser.cpp" - break; - - case 121: // expr_binary: expr "&" expr -#line 589 "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 2734 "parser.cpp" - break; - - case 122: // expr_binary: expr "^" expr -#line 591 "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 2740 "parser.cpp" - break; - - case 123: // expr_binary: expr "<<" expr -#line 593 "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 2746 "parser.cpp" - break; - - case 124: // expr_binary: expr ">>" expr -#line 595 "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 2752 "parser.cpp" - break; - - case 125: // expr_binary: expr "+" expr -#line 597 "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 2758 "parser.cpp" - break; - - case 126: // expr_binary: expr "-" expr -#line 599 "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 2764 "parser.cpp" - break; - - case 127: // expr_binary: expr "*" expr -#line 601 "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 2770 "parser.cpp" - break; - - case 128: // expr_binary: expr "/" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2776 "parser.cpp" - break; - - case 129: // expr_binary: expr "%" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2782 "parser.cpp" - break; - - case 130: // expr_primitive: expr_complement -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 2788 "parser.cpp" - break; - - case 131: // expr_primitive: expr_negate -#line 610 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 2794 "parser.cpp" - break; - - case 132: // expr_primitive: expr_not -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 2800 "parser.cpp" - break; - - case 133: // expr_primitive: expr_call -#line 612 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 2806 "parser.cpp" - break; - - case 134: // expr_primitive: expr_method -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 2812 "parser.cpp" - break; - - case 135: // expr_primitive: expr_add_array -#line 614 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } -#line 2818 "parser.cpp" - break; - - case 136: // expr_primitive: expr_reference -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 2824 "parser.cpp" - break; - - case 137: // expr_primitive: expr_array -#line 616 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 2830 "parser.cpp" - break; - - case 138: // expr_primitive: expr_field -#line 617 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 2836 "parser.cpp" - break; - - case 139: // expr_primitive: expr_size -#line 618 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 2842 "parser.cpp" - break; - - case 140: // expr_primitive: expr_paren -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 2848 "parser.cpp" - break; - - case 141: // expr_primitive: expr_thisthread -#line 620 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } -#line 2854 "parser.cpp" - break; - - case 142: // expr_primitive: expr_empty_array -#line 621 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 2860 "parser.cpp" - break; - - case 143: // expr_primitive: expr_undefined -#line 622 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 2866 "parser.cpp" - break; - - case 144: // expr_primitive: expr_game -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 2872 "parser.cpp" - break; - - case 145: // expr_primitive: expr_self -#line 624 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 2878 "parser.cpp" - break; - - case 146: // expr_primitive: expr_anim -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 2884 "parser.cpp" - break; - - case 147: // expr_primitive: expr_level -#line 626 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 2890 "parser.cpp" - break; - - case 148: // expr_primitive: expr_animation -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 2896 "parser.cpp" - break; - - case 149: // expr_primitive: expr_animtree -#line 628 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 2902 "parser.cpp" - break; - - case 150: // expr_primitive: expr_identifier -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 2908 "parser.cpp" - break; - - case 151: // expr_primitive: expr_istring -#line 630 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 2914 "parser.cpp" - break; - - case 152: // expr_primitive: expr_string -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 2920 "parser.cpp" - break; - - case 153: // expr_primitive: expr_vector -#line 632 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 2926 "parser.cpp" - break; - - case 154: // expr_primitive: expr_float -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 2932 "parser.cpp" - break; - - case 155: // expr_primitive: expr_integer -#line 634 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 2938 "parser.cpp" - break; - - case 156: // expr_primitive: expr_false -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 2944 "parser.cpp" - break; - - case 157: // expr_primitive: expr_true -#line 636 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 2950 "parser.cpp" - break; - - case 158: // expr_complement: "~" expr -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2956 "parser.cpp" - break; - - case 159: // expr_negate: "-" expr_identifier -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 2962 "parser.cpp" - break; - - case 160: // expr_negate: "-" expr_paren -#line 648 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 2968 "parser.cpp" - break; - - case 161: // expr_negate: "-" expr_array -#line 650 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 2974 "parser.cpp" - break; - - case 162: // expr_negate: "-" expr_field -#line 652 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 2980 "parser.cpp" - break; - - case 163: // expr_not: "!" expr -#line 657 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2986 "parser.cpp" - break; - - case 164: // expr_call: expr_function -#line 661 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 2992 "parser.cpp" - break; - - case 165: // expr_call: expr_pointer -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 2998 "parser.cpp" - break; - - case 166: // expr_method: expr_object expr_function -#line 665 "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 3004 "parser.cpp" - break; - - case 167: // expr_method: expr_object expr_pointer -#line 666 "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 3010 "parser.cpp" - break; - - case 168: // expr_function: expr_identifier "(" expr_arguments ")" -#line 671 "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 3016 "parser.cpp" - break; - - case 169: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 673 "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 3022 "parser.cpp" - break; - - case 170: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 675 "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 3028 "parser.cpp" - break; - - case 171: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 677 "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 3034 "parser.cpp" - break; - - case 172: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 679 "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::childthread); } -#line 3040 "parser.cpp" - break; - - case 173: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 681 "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::childthread); } -#line 3046 "parser.cpp" - break; - - case 174: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 686 "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 3052 "parser.cpp" - break; - - case 175: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 688 "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 3058 "parser.cpp" - break; - - case 176: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 690 "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::childthread); } -#line 3064 "parser.cpp" - break; - - case 177: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 692 "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::builtin); } -#line 3070 "parser.cpp" - break; - - case 178: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 697 "parser.ypp" - { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } -#line 3076 "parser.cpp" - break; - - case 179: // expr_parameters: expr_parameters "," expr_identifier -#line 702 "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 3082 "parser.cpp" - break; - - case 180: // expr_parameters: expr_identifier -#line 704 "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 3088 "parser.cpp" - break; - - case 181: // expr_parameters: %empty -#line 706 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3094 "parser.cpp" - break; - - case 182: // expr_arguments: expr_arguments_no_empty -#line 711 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3100 "parser.cpp" - break; - - case 183: // expr_arguments: %empty -#line 713 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3106 "parser.cpp" - break; - - case 184: // expr_arguments_no_empty: expr_arguments "," expr -#line 718 "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 3112 "parser.cpp" - break; - - case 185: // expr_arguments_no_empty: expr -#line 720 "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 3118 "parser.cpp" - break; - - case 186: // expr_reference: "::" expr_identifier -#line 725 "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 3124 "parser.cpp" - break; - - case 187: // expr_reference: expr_path "::" expr_identifier -#line 727 "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 3130 "parser.cpp" - break; - - case 188: // expr_tuple: "[" expr_tuple_arguments "]" -#line 732 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[1].value.as < ast::expr_tuple::ptr > ()); } -#line 3136 "parser.cpp" - break; - - case 189: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types -#line 737 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::move(yystack_[2].value.as < ast::expr_tuple::ptr > ()); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3142 "parser.cpp" - break; - - case 190: // expr_tuple_arguments: expr_tuple_types -#line 739 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3148 "parser.cpp" - break; - - case 191: // expr_tuple_types: expr_array -#line 743 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3154 "parser.cpp" - break; - - case 192: // expr_tuple_types: expr_field -#line 744 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3160 "parser.cpp" - break; - - case 193: // expr_tuple_types: expr_identifier -#line 745 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3166 "parser.cpp" - break; - - case 194: // expr_array: expr_object "[" expr "]" -#line 750 "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 3172 "parser.cpp" - break; - - case 195: // expr_field: expr_object "." expr_identifier_nosize -#line 755 "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 3178 "parser.cpp" - break; - - case 196: // expr_size: expr_object "." "size" -#line 760 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3184 "parser.cpp" - break; - - case 197: // expr_paren: "(" expr ")" -#line 765 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3190 "parser.cpp" - break; - - case 198: // expr_object: expr_call -#line 769 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3196 "parser.cpp" - break; - - case 199: // expr_object: expr_method -#line 770 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3202 "parser.cpp" - break; - - case 200: // expr_object: expr_array -#line 771 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3208 "parser.cpp" - break; - - case 201: // expr_object: expr_field -#line 772 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3214 "parser.cpp" - break; - - case 202: // expr_object: expr_game -#line 773 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3220 "parser.cpp" - break; - - case 203: // expr_object: expr_self -#line 774 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3226 "parser.cpp" - break; - - case 204: // expr_object: expr_anim -#line 775 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3232 "parser.cpp" - break; - - case 205: // expr_object: expr_level -#line 776 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3238 "parser.cpp" - break; - - case 206: // expr_object: expr_identifier -#line 777 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3244 "parser.cpp" - break; - - case 207: // expr_thisthread: "thisthread" -#line 782 "parser.ypp" - { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } -#line 3250 "parser.cpp" - break; - - case 208: // expr_empty_array: "[" "]" -#line 787 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3256 "parser.cpp" - break; - - case 209: // expr_undefined: "undefined" -#line 792 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3262 "parser.cpp" - break; - - case 210: // expr_game: "game" -#line 797 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3268 "parser.cpp" - break; - - case 211: // expr_self: "self" -#line 802 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3274 "parser.cpp" - break; - - case 212: // expr_anim: "anim" -#line 807 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3280 "parser.cpp" - break; - - case 213: // expr_level: "level" -#line 812 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3286 "parser.cpp" - break; - - case 214: // expr_animation: "%" "identifier" -#line 817 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3292 "parser.cpp" - break; - - case 215: // expr_animtree: "#animtree" -#line 822 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3298 "parser.cpp" - break; - - case 216: // expr_identifier_nosize: "identifier" -#line 827 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3304 "parser.cpp" - break; - - case 217: // expr_identifier: "identifier" -#line 832 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3310 "parser.cpp" - break; - - case 218: // expr_identifier: "size" -#line 834 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3316 "parser.cpp" - break; - - case 219: // expr_path: "identifier" -#line 839 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3322 "parser.cpp" - break; - - case 220: // expr_path: "path" -#line 841 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3328 "parser.cpp" - break; - - case 221: // expr_istring: "localized string" -#line 846 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3334 "parser.cpp" - break; - - case 222: // expr_string: "string literal" -#line 851 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3340 "parser.cpp" - break; - - case 223: // expr_vector: "(" expr "," expr "," expr ")" -#line 856 "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 3346 "parser.cpp" - break; - - case 224: // expr_float: "-" "float" -#line 861 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3352 "parser.cpp" - break; - - case 225: // expr_float: "float" -#line 863 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3358 "parser.cpp" - break; - - case 226: // expr_integer: "-" "integer" -#line 868 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3364 "parser.cpp" - break; - - case 227: // expr_integer: "integer" -#line 870 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3370 "parser.cpp" - break; - - case 228: // expr_false: "false" -#line 875 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3376 "parser.cpp" - break; - - case 229: // expr_true: "true" -#line 880 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3382 "parser.cpp" - break; - - -#line 3386 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "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", - "childthread", "thisthread", "call", "true", "false", "undefined", - "size", "game", "self", "anim", "level", "(", ")", "{", "}", "[", "]", - ",", ".", "::", ":", ";", "?", "++", "--", "<<", ">>", "||", "&&", "==", - "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", "%=", - "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", "%", - "path", "identifier", "string literal", "localized string", "float", - "integer", "SIZEOF", "ADD_ARRAY", "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_negate", "expr_not", "expr_call", "expr_method", - "expr_function", "expr_pointer", "expr_add_array", "expr_parameters", - "expr_arguments", "expr_arguments_no_empty", "expr_reference", - "expr_tuple", "expr_tuple_arguments", "expr_tuple_types", "expr_array", - "expr_field", "expr_size", "expr_paren", "expr_object", - "expr_thisthread", "expr_empty_array", "expr_undefined", "expr_game", - "expr_self", "expr_anim", "expr_level", "expr_animation", - "expr_animtree", "expr_identifier_nosize", "expr_identifier", - "expr_path", "expr_istring", "expr_string", "expr_vector", "expr_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 IW6DEBUG - // 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 IW6DEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if IW6DEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -281; - - const short parser::yytable_ninf_ = -220; - - const short - parser::yypact_[] = - { - 4, -281, -281, -72, -72, -41, -281, -281, 32, 4, - -281, -281, -281, -281, -281, -281, -21, -281, -281, -28, - -1, -22, -281, -281, -281, -281, -43, 1235, -281, -281, - -281, 5, -29, -281, -281, -26, -24, -281, 8, -281, - -281, -281, -281, -281, -281, -281, 1235, 1109, -43, 1235, - 1235, 612, 1, 47, -281, -281, -281, 2111, -281, -281, - -281, -281, -281, -281, 108, 145, -281, -281, -281, -281, - 372, 438, -281, -281, 633, -281, -281, -281, 664, 818, - 982, 987, -281, -281, 39, 59, -281, -281, -281, -281, - -281, -281, -281, 61, 16, -43, 65, 78, 79, 103, - 109, 127, 133, 1443, 1109, -281, 2194, 125, 136, -281, - -281, -281, 1235, 134, -281, -281, -281, -281, 372, 438, - -281, 1132, -281, -281, -281, -281, 39, 137, -281, -281, - 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, - 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1298, - -35, -281, -281, 147, 1235, -43, -281, 951, -281, -281, - 1235, 1235, -43, 1235, 1235, -43, 1235, -281, 1235, 1231, - 1235, -281, 1609, 1235, 102, -43, 2076, -51, -51, 2225, - 865, 2276, 2276, -27, -27, -27, -27, 2235, 273, 2266, - 51, 51, -281, -281, -281, 1294, -281, -281, -281, 23, - -281, 150, 77, 1235, 148, 157, 1381, 160, 162, 163, - 166, -15, 158, 165, 167, 1172, 168, 172, 173, -281, - 409, 703, 703, -281, -281, 1027, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, 175, 184, 185, 186, 187, 142, -281, -281, 808, - 147, 1921, 30, 176, 1961, 36, 182, 2001, 2040, 195, - 2194, 1231, 150, 1235, -281, -281, 1235, -281, -281, 1080, - 2146, -281, 1235, 224, 1235, 738, -43, 1235, 151, 193, - 196, -281, -281, -281, -281, 2181, -281, 1235, 1235, 1298, - 35, -281, 112, 123, -4, 1132, 1132, -281, -281, -281, - -281, -281, -281, -281, 1235, 204, 206, 209, 210, -281, - -281, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, - 1235, 1235, 207, -281, 1235, 211, -281, 1235, 212, 1235, - 214, 2194, 76, -281, -281, -281, 1643, 215, 1677, 201, - -281, -281, -281, 1407, -8, 1711, -281, -281, -281, 82, - 85, -281, 703, 2194, 1235, 1235, 1235, 1235, 2194, 2194, - 2194, 2194, 2194, 2194, 2194, 2194, 2194, 2194, 2194, 219, - 104, 220, 107, 221, 1745, 1235, -281, 1381, 1235, 1381, - 1235, 1235, -43, 16, 216, 222, -281, 1779, 1487, 1531, - 1575, 1235, -281, 1235, -281, 1235, -281, 120, 249, 1813, - -281, 2194, 223, 1847, 246, -281, -281, -281, 227, 229, - 1235, 232, 1235, 235, 1235, 124, 126, 138, -281, 1381, - 236, 738, 1381, 1235, -281, -281, 228, -281, 230, -281, - 247, -281, -281, -281, -281, -281, 250, -281, 1881, 242, - 243, 248, 1381, 1381, -281, -281, -281, -281, -281 - }; - - const unsigned char - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 218, 217, 0, 2, - 7, 8, 9, 14, 15, 16, 0, 220, 219, 0, - 0, 0, 1, 4, 5, 6, 181, 0, 10, 11, - 222, 0, 0, 180, 215, 0, 0, 207, 0, 229, - 228, 209, 210, 211, 212, 213, 0, 183, 0, 0, - 0, 0, 0, 217, 221, 225, 227, 0, 90, 91, - 92, 130, 131, 132, 133, 134, 164, 165, 135, 136, - 137, 138, 139, 140, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 0, 151, 152, 153, 154, - 155, 156, 157, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 183, 208, 185, 0, 182, 186, - 163, 158, 0, 0, 224, 226, 198, 199, 161, 162, - 160, 0, 202, 203, 204, 205, 159, 0, 214, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 166, 167, 0, 183, 0, 17, 0, 19, 179, - 0, 183, 0, 0, 183, 0, 0, 197, 0, 185, - 0, 178, 0, 0, 0, 0, 0, 123, 124, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 125, 126, 127, 128, 129, 0, 196, 216, 195, 0, - 182, 187, 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, 198, 199, 0, 200, 201, 0, - 206, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 184, 0, 0, 0, 194, 168, 183, 51, 47, 0, - 0, 71, 0, 0, 0, 57, 0, 0, 0, 0, - 0, 82, 83, 84, 86, 0, 87, 183, 183, 0, - 0, 190, 200, 201, 206, 107, 109, 52, 48, 60, - 61, 62, 58, 59, 0, 0, 0, 0, 0, 108, - 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 170, 183, 0, 172, 183, 0, 0, - 0, 111, 0, 50, 46, 66, 0, 0, 0, 0, - 54, 55, 56, 0, 0, 0, 81, 80, 85, 0, - 0, 188, 0, 95, 0, 0, 0, 0, 96, 102, - 103, 104, 105, 106, 97, 98, 99, 101, 100, 0, - 0, 0, 0, 0, 0, 183, 169, 0, 0, 0, - 94, 0, 0, 0, 0, 0, 189, 0, 0, 0, - 0, 183, 171, 183, 173, 183, 223, 0, 72, 0, - 74, 93, 0, 0, 0, 79, 88, 89, 0, 0, - 183, 0, 183, 0, 183, 0, 0, 0, 174, 0, - 0, 57, 0, 0, 63, 65, 182, 68, 182, 70, - 182, 175, 176, 177, 73, 75, 0, 77, 0, 0, - 0, 0, 0, 0, 64, 67, 69, 76, 78 - }; - - const short - parser::yypgoto_[] = - { - -281, -281, -281, 272, 298, 299, -281, -281, -281, 194, - 86, -281, -281, -281, -92, -121, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, 188, - -281, -280, -279, -278, -281, -281, -281, -281, -281, -281, - 92, 203, -66, -62, -281, -281, -127, -46, -281, -281, - -281, -13, 213, 337, -281, 289, 385, -281, -281, -281, - 392, 480, 512, 519, -281, -281, -281, 0, 10, -281, - -17, -281, -281, 130, -281, -281 - }; - - const short - parser::yydefgoto_[] = - { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 223, - 224, 279, 225, 226, 227, 349, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 106, - 412, 251, 252, 253, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 32, 107, 200, 69, 256, - 300, 301, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 198, 84, 85, 86, - 87, 88, 89, 90, 91, 92 - }; - - const short - parser::yytable_[] = - { - 16, 108, 158, 6, 31, 350, 351, 352, 151, 16, - 21, 196, 152, 19, 20, 1, 2, 3, 4, 5, - 6, 391, 6, 94, 17, 18, 33, 199, 95, 96, - 26, 99, 22, 28, 262, 97, 100, 265, 131, 132, - 144, 145, 146, 147, 148, 98, 101, 154, 109, 392, - 6, 126, -193, -193, 7, 151, 27, 93, 108, 152, - 29, 127, 197, 102, 144, 145, 146, 147, 148, 157, - 17, 53, 17, 53, 153, 275, 30, 288, -206, -206, - 170, -206, 333, 30, 127, -206, 56, 170, 336, 277, - 154, 361, 362, 170, -206, 159, 203, -206, 128, 204, - 205, 7, 206, 207, 208, 209, -219, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 35, 36, 155, 38, - 160, 153, 156, 6, 42, 43, 44, 45, 386, 161, - 157, 127, 220, 170, 394, -206, -206, 395, 162, 170, - 221, 222, 170, 116, 146, 147, 148, -198, -198, 342, - -198, 350, 351, 352, -198, 201, 402, 260, 163, 404, - 164, 170, 263, -198, 170, 266, -198, 127, -191, -191, - 359, 360, 428, 17, 53, 272, 441, 170, 442, -192, - -192, 170, 170, 170, -199, -199, 165, -199, 166, 173, - 443, -199, 171, 151, 289, 170, 175, 152, 154, 197, - -199, 276, 260, -199, -198, -198, 260, 380, 282, 281, - 382, 284, 127, 285, 286, 57, 127, 287, 291, 314, - 304, 260, 260, 297, 298, 260, 292, 334, 293, 296, - 127, 127, 127, 337, 103, 127, 309, 110, 111, 151, - 151, -199, -199, 152, 152, 310, 311, 312, 313, 254, - 347, 340, 115, 356, 117, 364, 357, 365, 407, 153, - 366, 367, 390, 379, 118, 385, 388, 381, 383, 127, - 401, 403, 405, 429, 425, 433, 426, 416, 427, 260, - 449, 23, 450, 417, 431, 260, 354, 151, 434, 127, - 435, 152, 169, 437, 254, 127, 439, 445, 254, 451, - 172, 415, 452, 454, 455, 153, 153, 24, 25, 456, - 446, 308, 116, 116, 116, 127, 127, 254, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 131, 132, - 120, 290, 135, 136, 137, 138, 139, 140, 261, 396, - 0, 264, 0, 153, 267, 0, 268, 0, 270, 0, - 255, 271, 304, 127, 144, 145, 146, 147, 148, 0, - 257, 254, 127, 0, 436, 0, 438, 116, 440, 0, - 0, 0, 0, 0, 0, 0, 0, 260, 119, 260, - 0, 280, 414, 0, 0, 0, 278, 127, 0, 127, - 283, 0, 0, 295, 0, 255, 0, 0, 0, 255, - 0, -200, -200, 0, -200, 257, 0, 0, -200, 257, - 0, 0, 0, 117, 117, 117, 0, -200, 255, 260, - -200, 260, 260, 302, 257, 257, 121, 0, 257, 127, - 0, 127, 127, 122, 0, 0, 0, 0, 35, 36, - 0, 38, 260, 260, 116, 6, 42, 43, 44, 45, - 0, 341, 127, 127, 299, 0, 0, 0, -200, -200, - 346, 0, 348, 344, 0, 355, 0, -201, -201, 254, - -201, 254, 255, 0, -201, 0, 0, 271, 117, 0, - 0, 0, 257, -201, 258, 0, -201, 0, 257, 0, - 0, 0, 363, 0, 0, 17, 53, 0, 0, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 0, 254, 0, 116, 254, 0, 0, 384, 0, 0, - 0, 123, 0, 0, -201, -201, 0, 0, 0, 258, - 0, 0, 259, 258, 254, 254, 0, 0, 0, 122, - 0, 0, 397, 398, 399, 400, 0, 303, 258, 258, - 0, 0, 258, 124, 0, 117, 0, 0, 0, 0, - 125, 0, 0, 0, 0, 302, 409, 0, 411, 413, - 0, 408, 0, 410, 0, 0, 0, 259, 0, 0, - 255, 259, 255, 0, 122, 0, 0, 0, 122, 0, - 257, 0, 257, 0, 0, 121, 305, 306, 0, 0, - 259, 0, 122, 122, 122, 0, 258, 122, 0, 0, - 0, 448, 258, 444, 0, 0, 447, 0, 0, 0, - 0, 0, 255, 0, 117, 255, 0, 123, 0, 0, - 0, 0, 257, 0, 257, 257, 457, 458, 0, 0, - 0, 35, 36, 0, 38, 255, 255, 0, 6, 42, - 43, 44, 45, 112, 259, 257, 257, 113, 0, 124, - 353, 122, 35, 36, 0, 38, 125, 122, 0, 6, - 0, 0, 123, 0, 0, 0, 123, 0, 149, 0, - 0, 150, 0, 0, 0, 0, 0, 0, 0, 303, - 123, 123, 123, -202, -202, 123, -202, 0, 17, 53, - -202, 0, 114, 115, 124, 0, 0, 0, 124, -202, - 0, 125, -202, 0, 258, 125, 258, 0, 0, 17, - 53, 0, 124, 124, 124, 0, 0, 124, 0, 125, - 125, 125, 35, 36, 125, 38, 0, 121, 0, 6, - 42, 43, 44, 45, 122, 0, 0, 0, 113, 123, - -202, -202, 0, 0, 0, 123, 258, 0, 258, 258, - 0, 0, 259, 0, 259, 0, 0, 35, 36, 122, - 38, 122, 0, 0, 6, 42, 43, 44, 45, 258, - 258, 124, 0, 220, 0, 0, 0, 124, 125, 17, - 53, 221, 222, 0, 125, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 259, 0, 353, 259, 0, 0, - 0, 122, 0, 122, 122, 315, 316, 0, 317, 318, - 0, 0, 0, 0, 17, 53, 0, 259, 259, 0, - 0, 0, 123, 0, 122, 122, 0, 35, 36, 0, - 38, 0, 0, 0, 6, 0, 0, -203, -203, 0, - -203, 0, 0, 149, -203, 0, 174, 123, 0, 123, - 0, 319, 320, -203, 124, 0, -203, 0, 0, 0, - 0, 125, 0, 0, 0, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 0, 0, 0, 124, - 0, 124, 0, 0, 17, 53, 125, 0, 125, 123, - 0, 123, 123, 0, -203, -203, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 131, 132, 123, 123, 135, 136, 137, 138, 139, 140, - 0, 124, 0, 124, 124, 0, 0, 0, 125, 0, - 125, 125, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 0, 202, 0, 124, 124, 0, 0, 0, 0, - 203, 125, 125, 204, 205, 0, 206, 207, 208, 209, - 0, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 35, 36, 0, 38, 0, 0, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 219, 220, 0, 0, 0, - 0, 0, 0, 0, 221, 222, 0, 0, 0, 0, - 0, -204, -204, 0, -204, 0, -205, -205, -204, -205, - 0, 0, 0, -205, 0, 0, 0, -204, 202, 0, - -204, 0, -205, 0, 0, -205, 203, 17, 53, 204, - 205, 0, 206, 207, 208, 209, 0, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 35, 36, 0, 38, - 0, 0, 0, 6, 42, 43, 44, 45, -204, -204, - 157, 307, 220, -205, -205, 0, 0, 0, 0, 0, - 221, 222, 343, 0, 0, 0, 0, 0, 0, 203, - 0, 0, 204, 205, 0, 206, 207, 208, 209, 0, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 35, - 36, 0, 38, 17, 53, 34, 6, 42, 43, 44, - 45, 0, 0, 157, 0, 220, 0, 0, 0, 0, - 0, 0, 0, 221, 222, 0, 0, 0, 35, 36, - 37, 38, 39, 40, 41, 6, 42, 43, 44, 45, - 46, 0, 0, 0, 104, 105, 0, 0, 48, 0, - 0, 35, 36, 0, 38, 0, 17, 53, 6, 0, - 0, 0, 0, 0, 49, 50, 0, 149, 34, 0, - 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 51, 0, 0, 52, 17, 53, 30, 54, 55, - 56, 35, 36, 37, 38, 39, 40, 41, 6, 42, - 43, 44, 45, 46, 0, 0, 0, 47, 17, 53, - 0, 48, 0, 294, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 49, 50, 0, - 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 51, 0, 0, 52, 17, 53, - 30, 54, 55, 56, 35, 36, 37, 38, 39, 40, - 41, 6, 42, 43, 44, 45, 46, 269, 0, 0, - 47, 0, 0, 130, 48, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 49, 50, 0, 0, 34, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 51, 0, 0, - 52, 17, 53, 30, 54, 55, 56, 35, 36, 37, - 38, 39, 40, 41, 6, 42, 43, 44, 45, 46, - 274, 0, 0, 104, 0, 0, 130, 48, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 49, 50, 0, 0, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 51, 0, 0, 52, 17, 53, 30, 54, 55, 56, - 203, 0, 0, 204, 205, 0, 206, 207, 208, 209, - 0, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 35, 36, 0, 38, 0, 0, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 0, 220, 0, 0, 0, - 0, 0, 0, 0, 221, 222, 35, 36, 0, 38, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, - 0, 0, 149, 0, 0, 174, 0, 0, 0, 0, - 319, 320, 0, 0, 0, 0, 0, 17, 53, 0, - 0, 0, 0, 0, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 167, 0, 0, 0, 0, - 168, 0, 0, 17, 53, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 419, - 0, 0, 0, 0, 420, 0, 0, 0, 0, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 421, 0, 0, 0, 0, 422, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 423, 0, 0, - 0, 0, 424, 0, 0, 0, 0, 130, 0, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 167, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 130, 0, 0, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 387, 0, 141, 142, 143, - 144, 145, 146, 147, 148, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 389, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 393, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 406, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 130, 0, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 418, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 130, 0, 0, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 430, 0, 141, 142, 143, - 144, 145, 146, 147, 148, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 453, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 332, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 335, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 338, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 339, 0, 0, - 0, 0, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 273, 0, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 129, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 345, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 358, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 131, 132, 0, 134, 135, 136, 137, 138, 139, 140, - 131, 132, 0, 0, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 0, 0, 0, 142, 143, 144, 145, 146, 147, - 148, 131, 132, 0, 0, 135, 136, 137, 138, 139, - 140, 131, 132, 0, 0, 0, 0, 137, 138, 139, - 140, 0, 0, 0, 0, 142, 0, 144, 145, 146, - 147, 148, 0, 0, 0, 0, 0, 144, 145, 146, - 147, 148 - }; - - const short - parser::yycheck_[] = - { - 0, 47, 94, 46, 21, 285, 285, 285, 74, 9, - 51, 46, 74, 3, 4, 11, 12, 13, 14, 15, - 46, 29, 46, 52, 96, 97, 26, 154, 57, 55, - 51, 55, 0, 61, 161, 35, 36, 164, 65, 66, - 91, 92, 93, 94, 95, 35, 36, 51, 48, 57, - 46, 51, 56, 57, 97, 121, 77, 52, 104, 121, - 61, 51, 97, 55, 91, 92, 93, 94, 95, 53, - 96, 97, 96, 97, 74, 52, 98, 92, 39, 40, - 57, 42, 52, 98, 74, 46, 101, 57, 52, 12, - 51, 56, 57, 57, 55, 95, 19, 58, 97, 22, - 23, 97, 25, 26, 27, 28, 59, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 59, 42, - 55, 121, 61, 46, 47, 48, 49, 50, 52, 51, - 53, 121, 55, 57, 52, 96, 97, 52, 59, 57, - 63, 64, 57, 51, 93, 94, 95, 39, 40, 276, - 42, 431, 431, 431, 46, 155, 52, 157, 55, 52, - 51, 57, 162, 55, 57, 165, 58, 157, 56, 57, - 297, 298, 52, 96, 97, 175, 52, 57, 52, 56, - 57, 57, 57, 57, 39, 40, 59, 42, 55, 55, - 52, 46, 56, 259, 211, 57, 59, 259, 51, 97, - 55, 51, 202, 58, 96, 97, 206, 334, 51, 61, - 337, 51, 202, 51, 51, 27, 206, 51, 60, 77, - 220, 221, 222, 51, 51, 225, 61, 51, 61, 61, - 220, 221, 222, 51, 46, 225, 61, 49, 50, 305, - 306, 96, 97, 305, 306, 61, 61, 61, 61, 157, - 26, 56, 101, 60, 51, 51, 60, 51, 385, 259, - 51, 51, 61, 56, 51, 51, 51, 56, 56, 259, - 51, 51, 51, 24, 401, 29, 403, 61, 405, 279, - 52, 9, 52, 61, 61, 285, 286, 353, 61, 279, - 61, 353, 104, 61, 202, 285, 61, 61, 206, 52, - 112, 393, 52, 61, 61, 305, 306, 9, 9, 61, - 431, 225, 220, 221, 222, 305, 306, 225, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 65, 66, - 51, 211, 69, 70, 71, 72, 73, 74, 160, 362, - -1, 163, -1, 353, 166, -1, 168, -1, 170, -1, - 157, 173, 362, 353, 91, 92, 93, 94, 95, -1, - 157, 279, 362, -1, 420, -1, 422, 285, 424, -1, - -1, -1, -1, -1, -1, -1, -1, 387, 51, 389, - -1, 203, 392, -1, -1, -1, 202, 387, -1, 389, - 206, -1, -1, 215, -1, 202, -1, -1, -1, 206, - -1, 39, 40, -1, 42, 202, -1, -1, 46, 206, - -1, -1, -1, 220, 221, 222, -1, 55, 225, 429, - 58, 431, 432, 220, 221, 222, 51, -1, 225, 429, - -1, 431, 432, 51, -1, -1, -1, -1, 39, 40, - -1, 42, 452, 453, 362, 46, 47, 48, 49, 50, - -1, 273, 452, 453, 55, -1, -1, -1, 96, 97, - 282, -1, 284, 279, -1, 287, -1, 39, 40, 387, - 42, 389, 279, -1, 46, -1, -1, 299, 285, -1, - -1, -1, 279, 55, 157, -1, 58, -1, 285, -1, - -1, -1, 314, -1, -1, 96, 97, -1, -1, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, - -1, 429, -1, 431, 432, -1, -1, 339, -1, -1, - -1, 51, -1, -1, 96, 97, -1, -1, -1, 202, - -1, -1, 157, 206, 452, 453, -1, -1, -1, 157, - -1, -1, 364, 365, 366, 367, -1, 220, 221, 222, - -1, -1, 225, 51, -1, 362, -1, -1, -1, -1, - 51, -1, -1, -1, -1, 362, 388, -1, 390, 391, - -1, 387, -1, 389, -1, -1, -1, 202, -1, -1, - 387, 206, 389, -1, 202, -1, -1, -1, 206, -1, - 387, -1, 389, -1, -1, 220, 221, 222, -1, -1, - 225, -1, 220, 221, 222, -1, 279, 225, -1, -1, - -1, 433, 285, 429, -1, -1, 432, -1, -1, -1, - -1, -1, 429, -1, 431, 432, -1, 157, -1, -1, - -1, -1, 429, -1, 431, 432, 452, 453, -1, -1, - -1, 39, 40, -1, 42, 452, 453, -1, 46, 47, - 48, 49, 50, 51, 279, 452, 453, 55, -1, 157, - 285, 279, 39, 40, -1, 42, 157, 285, -1, 46, - -1, -1, 202, -1, -1, -1, 206, -1, 55, -1, - -1, 58, -1, -1, -1, -1, -1, -1, -1, 362, - 220, 221, 222, 39, 40, 225, 42, -1, 96, 97, - 46, -1, 100, 101, 202, -1, -1, -1, 206, 55, - -1, 202, 58, -1, 387, 206, 389, -1, -1, 96, - 97, -1, 220, 221, 222, -1, -1, 225, -1, 220, - 221, 222, 39, 40, 225, 42, -1, 362, -1, 46, - 47, 48, 49, 50, 362, -1, -1, -1, 55, 279, - 96, 97, -1, -1, -1, 285, 429, -1, 431, 432, - -1, -1, 387, -1, 389, -1, -1, 39, 40, 387, - 42, 389, -1, -1, 46, 47, 48, 49, 50, 452, - 453, 279, -1, 55, -1, -1, -1, 285, 279, 96, - 97, 63, 64, -1, 285, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 429, -1, 431, 432, -1, -1, - -1, 429, -1, 431, 432, 17, 18, -1, 20, 21, - -1, -1, -1, -1, 96, 97, -1, 452, 453, -1, - -1, -1, 362, -1, 452, 453, -1, 39, 40, -1, - 42, -1, -1, -1, 46, -1, -1, 39, 40, -1, - 42, -1, -1, 55, 46, -1, 58, 387, -1, 389, - -1, 63, 64, 55, 362, -1, 58, -1, -1, -1, - -1, 362, -1, -1, -1, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, -1, -1, -1, 387, - -1, 389, -1, -1, 96, 97, 387, -1, 389, 429, - -1, 431, 432, -1, 96, 97, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, 452, 453, 69, 70, 71, 72, 73, 74, - -1, 429, -1, 431, 432, -1, -1, -1, 429, -1, - 431, 432, -1, 88, 89, 90, 91, 92, 93, 94, - 95, -1, 11, -1, 452, 453, -1, -1, -1, -1, - 19, 452, 453, 22, 23, -1, 25, 26, 27, 28, - -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, -1, 42, -1, -1, -1, 46, 47, 48, - 49, 50, -1, -1, 53, 54, 55, -1, -1, -1, - -1, -1, -1, -1, 63, 64, -1, -1, -1, -1, - -1, 39, 40, -1, 42, -1, 39, 40, 46, 42, - -1, -1, -1, 46, -1, -1, -1, 55, 11, -1, - 58, -1, 55, -1, -1, 58, 19, 96, 97, 22, - 23, -1, 25, 26, 27, 28, -1, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, -1, 42, - -1, -1, -1, 46, 47, 48, 49, 50, 96, 97, - 53, 54, 55, 96, 97, -1, -1, -1, -1, -1, - 63, 64, 12, -1, -1, -1, -1, -1, -1, 19, - -1, -1, 22, 23, -1, 25, 26, 27, 28, -1, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, -1, 42, 96, 97, 16, 46, 47, 48, 49, - 50, -1, -1, 53, -1, 55, -1, -1, -1, -1, - -1, -1, -1, 63, 64, -1, -1, -1, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, -1, -1, -1, 55, 56, -1, -1, 59, -1, - -1, 39, 40, -1, 42, -1, 96, 97, 46, -1, - -1, -1, -1, -1, 75, 76, -1, 55, 16, -1, - 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 92, -1, -1, 95, 96, 97, 98, 99, 100, - 101, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, -1, -1, -1, 55, 96, 97, - -1, 59, -1, 61, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 75, 76, -1, - -1, 16, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 92, -1, -1, 95, 96, 97, - 98, 99, 100, 101, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 56, -1, -1, - 55, -1, -1, 62, 59, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - 75, 76, -1, -1, 16, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 92, -1, -1, - 95, 96, 97, 98, 99, 100, 101, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 56, -1, -1, 55, -1, -1, 62, 59, -1, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, -1, - -1, -1, -1, 75, 76, -1, -1, -1, -1, -1, - -1, -1, 88, 89, 90, 91, 92, 93, 94, 95, - 92, -1, -1, 95, 96, 97, 98, 99, 100, 101, - 19, -1, -1, 22, 23, -1, 25, 26, 27, 28, - -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, -1, 42, -1, -1, -1, 46, 47, 48, - 49, 50, -1, -1, 53, -1, 55, -1, -1, -1, - -1, -1, -1, -1, 63, 64, 39, 40, -1, 42, - -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, - -1, -1, 55, -1, -1, 58, -1, -1, -1, -1, - 63, 64, -1, -1, -1, -1, -1, 96, 97, -1, - -1, -1, -1, -1, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 52, -1, -1, -1, -1, - 57, -1, -1, 96, 97, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 52, - -1, -1, -1, -1, 57, -1, -1, -1, -1, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 52, -1, -1, -1, -1, 57, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 52, -1, -1, - -1, -1, 57, -1, -1, -1, -1, 62, -1, -1, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 52, -1, 88, 89, 90, 91, 92, 93, 94, - 95, 62, -1, -1, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, -1, 88, 89, 90, - 91, 92, 93, 94, 95, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 52, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 52, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 62, -1, -1, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 52, -1, 88, 89, 90, 91, 92, 93, 94, - 95, 62, -1, -1, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, -1, 88, 89, 90, - 91, 92, 93, 94, 95, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 52, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 57, -1, -1, - -1, -1, 62, -1, -1, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 88, 89, - 90, 91, 92, 93, 94, 95, 60, -1, 62, -1, - -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 88, 89, 90, 91, 92, 93, - 94, 95, 61, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 61, 62, -1, - -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 88, 89, 90, 91, 92, 93, - 94, 95, 61, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 62, -1, -1, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 88, - 89, 90, 91, 92, 93, 94, 95, -1, -1, -1, - -1, -1, 88, 89, 90, 91, 92, 93, 94, 95, - 65, 66, -1, 68, 69, 70, 71, 72, 73, 74, - 65, 66, -1, -1, 69, 70, 71, 72, 73, 74, - -1, -1, -1, 88, 89, 90, 91, 92, 93, 94, - 95, -1, -1, -1, 89, 90, 91, 92, 93, 94, - 95, 65, 66, -1, -1, 69, 70, 71, 72, 73, - 74, 65, 66, -1, -1, -1, -1, 71, 72, 73, - 74, -1, -1, -1, -1, 89, -1, 91, 92, 93, - 94, 95, -1, -1, -1, -1, -1, 91, 92, 93, - 94, 95 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 46, 97, 113, 114, - 115, 116, 117, 118, 119, 120, 189, 96, 97, 190, - 190, 51, 0, 115, 116, 117, 51, 77, 61, 61, - 98, 192, 167, 189, 16, 39, 40, 41, 42, 43, - 44, 45, 47, 48, 49, 50, 51, 55, 59, 75, - 76, 92, 95, 97, 99, 100, 101, 151, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 170, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 52, 52, 57, 55, 189, 190, 55, - 189, 190, 55, 151, 55, 56, 151, 168, 169, 189, - 151, 151, 51, 55, 100, 101, 162, 163, 174, 175, - 177, 178, 182, 183, 184, 185, 189, 190, 97, 61, - 62, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 88, 89, 90, 91, 92, 93, 94, 95, 55, - 58, 164, 165, 189, 51, 59, 61, 53, 126, 189, - 55, 51, 59, 55, 51, 59, 55, 52, 57, 151, - 57, 56, 151, 55, 58, 59, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 46, 97, 188, 168, - 169, 189, 11, 19, 22, 23, 25, 26, 27, 28, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 54, - 55, 63, 64, 121, 122, 124, 125, 126, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 153, 154, 155, 162, 163, 171, 174, 175, 178, - 189, 151, 168, 189, 151, 168, 189, 151, 151, 56, - 151, 151, 189, 60, 56, 52, 51, 12, 121, 123, - 151, 61, 51, 121, 51, 51, 51, 51, 92, 192, - 195, 60, 61, 61, 61, 151, 61, 51, 51, 55, - 172, 173, 174, 175, 189, 178, 178, 54, 122, 61, - 61, 61, 61, 61, 77, 17, 18, 20, 21, 63, - 64, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 56, 52, 51, 56, 52, 51, 56, 57, - 56, 151, 168, 12, 121, 61, 151, 26, 151, 127, - 153, 154, 155, 178, 189, 151, 60, 60, 61, 168, - 168, 56, 57, 151, 51, 51, 51, 51, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 56, - 168, 56, 168, 56, 151, 51, 52, 52, 51, 52, - 61, 29, 57, 52, 52, 52, 173, 151, 151, 151, - 151, 51, 52, 51, 52, 51, 52, 168, 121, 151, - 121, 151, 152, 151, 189, 126, 61, 61, 52, 52, - 57, 52, 57, 52, 57, 168, 168, 168, 52, 24, - 52, 61, 52, 29, 61, 61, 169, 61, 169, 61, - 169, 52, 52, 52, 121, 61, 127, 121, 151, 52, - 52, 52, 52, 52, 61, 61, 61, 121, 121 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 112, 113, 113, 114, 114, 114, 114, 114, 114, - 115, 116, 117, 117, 117, 117, 117, 118, 119, 120, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 122, 122, 123, 123, 124, 124, - 125, 125, 126, 126, 127, 127, 127, 127, 128, 128, - 129, 129, 129, 130, 131, 131, 132, 133, 133, 134, - 134, 135, 136, 137, 138, 139, 140, 141, 141, 142, - 143, 143, 144, 145, 146, 147, 147, 148, 149, 150, - 151, 151, 151, 152, 152, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 154, 154, 155, - 155, 156, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 159, 160, - 160, 160, 160, 161, 162, 162, 163, 163, 164, 164, - 164, 164, 164, 164, 165, 165, 165, 165, 166, 167, - 167, 167, 168, 168, 169, 169, 170, 170, 171, 172, - 172, 173, 173, 173, 174, 175, 176, 177, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 189, 190, - 190, 191, 192, 193, 194, 194, 195, 195, 196, 197 - }; - - 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, 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, 2, 2, - 2, 2, 2, 2, 1, 1, 2, 2, 4, 6, - 5, 7, 5, 7, 8, 9, 9, 9, 3, 3, - 1, 0, 1, 0, 3, 1, 2, 3, 3, 3, - 1, 1, 1, 1, 4, 3, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, - 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 7, 2, 1, 2, 1, 1, 1 - }; - - - - -#if IW6DEBUG - const short - parser::yyrline_[] = - { - 0, 261, 261, 262, 266, 268, 270, 272, 274, 276, - 281, 285, 290, 291, 292, 293, 294, 298, 303, 308, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 340, 341, 345, 347, 352, 354, - 359, 360, 364, 365, 369, 371, 373, 376, 380, 382, - 387, 389, 391, 396, 401, 403, 408, 413, 415, 420, - 422, 427, 432, 437, 442, 447, 452, 457, 459, 464, - 469, 471, 476, 481, 486, 491, 493, 498, 503, 508, - 513, 514, 515, 519, 520, 524, 526, 528, 530, 532, - 534, 536, 538, 540, 542, 544, 546, 551, 553, 558, - 560, 565, 570, 572, 574, 576, 578, 580, 582, 584, - 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, - 629, 630, 631, 632, 633, 634, 635, 636, 640, 645, - 647, 649, 651, 656, 661, 662, 665, 666, 670, 672, - 674, 676, 678, 680, 685, 687, 689, 691, 696, 701, - 703, 706, 710, 713, 717, 719, 724, 726, 731, 736, - 738, 743, 744, 745, 749, 754, 759, 764, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 781, 786, 791, - 796, 801, 806, 811, 816, 821, 826, 831, 833, 838, - 840, 845, 850, 855, 860, 862, 867, 869, 874, 879 - }; - - 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 // IW6DEBUG - - -#line 13 "parser.ypp" -} } } // xsk::gsc::iw6 -#line 4661 "parser.cpp" - -#line 883 "parser.ypp" - - -void xsk::gsc::iw6::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/src/iw6/xsk/parser.hpp b/src/iw6/xsk/parser.hpp deleted file mode 100644 index 60ae7f12..00000000 --- a/src/iw6/xsk/parser.hpp +++ /dev/null @@ -1,5550 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// 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::gsc::iw6::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_IW6_PARSER_HPP_INCLUDED -# define YY_IW6_PARSER_HPP_INCLUDED -// "%code requires" blocks. -#line 28 "parser.ypp" - -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw6.hpp" -namespace xsk::gsc::iw6 { class lexer; } - -#line 58 "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 IW6_ASSERT -# include -# define IW6_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 - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# 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 IW6DEBUG -# if defined YYDEBUG -#if YYDEBUG -# define IW6DEBUG 1 -# else -# define IW6DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define IW6DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined IW6DEBUG */ - -#line 13 "parser.ypp" -namespace xsk { namespace gsc { namespace iw6 { -#line 207 "parser.hpp" - - - - - /// A Bison parser. - class parser - { - public: -#ifdef IW6STYPE -# ifdef __GNUC__ -# pragma GCC message "bison: do not #define IW6STYPE in C++, use %define api.value.type" -# endif - typedef IW6STYPE value_type; -#else - /// 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 value_type - { - public: - /// Type of *this. - typedef value_type self_type; - - /// Empty construction. - value_type () YY_NOEXCEPT - : yyraw_ () - , yytypeid_ (YY_NULLPTR) - {} - - /// Construct and fill. - template - value_type (YY_RVREF (T) t) - : yytypeid_ (&typeid (T)) - { - IW6_ASSERT (sizeof (T) <= size); - new (yyas_ ()) T (YY_MOVE (t)); - } - -#if 201103L <= YY_CPLUSPLUS - /// Non copyable. - value_type (const self_type&) = delete; - /// Non copyable. - self_type& operator= (const self_type&) = delete; -#endif - - /// Destruction, allowed only if empty. - ~value_type () YY_NOEXCEPT - { - IW6_ASSERT (!yytypeid_); - } - -# if 201103L <= YY_CPLUSPLUS - /// Instantiate a \a T in here from \a t. - template - T& - emplace (U&&... u) - { - IW6_ASSERT (!yytypeid_); - IW6_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 () - { - IW6_ASSERT (!yytypeid_); - IW6_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) - { - IW6_ASSERT (!yytypeid_); - IW6_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 - { - IW6_ASSERT (yytypeid_); - IW6_ASSERT (*yytypeid_ == typeid (T)); - IW6_ASSERT (sizeof (T) <= size); - return *yyas_ (); - } - - /// Const accessor to a built \a T (for %printer). - template - const T& - as () const YY_NOEXCEPT - { - IW6_ASSERT (yytypeid_); - IW6_ASSERT (*yytypeid_ == typeid (T)); - IW6_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 - { - IW6_ASSERT (yytypeid_); - IW6_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. - value_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 = yyraw_; - return static_cast (yyp); - } - - /// Const accessor to raw memory as \a T. - template - const T* - yyas_ () const YY_NOEXCEPT - { - const void *yyp = 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_tuple - // expr_tuple_types - // expr_object - char dummy6[sizeof (ast::expr)]; - - // expr_add_array - char dummy7[sizeof (ast::expr_add_array::ptr)]; - - // expr_anim - char dummy8[sizeof (ast::expr_anim::ptr)]; - - // expr_animation - char dummy9[sizeof (ast::expr_animation::ptr)]; - - // expr_animtree - char dummy10[sizeof (ast::expr_animtree::ptr)]; - - // expr_arguments - // expr_arguments_no_empty - char dummy11[sizeof (ast::expr_arguments::ptr)]; - - // expr_array - char dummy12[sizeof (ast::expr_array::ptr)]; - - // expr_call - char dummy13[sizeof (ast::expr_call::ptr)]; - - // expr_complement - char dummy14[sizeof (ast::expr_complement::ptr)]; - - // expr_empty_array - char dummy15[sizeof (ast::expr_empty_array::ptr)]; - - // expr_false - char dummy16[sizeof (ast::expr_false::ptr)]; - - // expr_field - char dummy17[sizeof (ast::expr_field::ptr)]; - - // expr_float - char dummy18[sizeof (ast::expr_float::ptr)]; - - // expr_game - char dummy19[sizeof (ast::expr_game::ptr)]; - - // expr_identifier_nosize - // expr_identifier - char dummy20[sizeof (ast::expr_identifier::ptr)]; - - // expr_integer - char dummy21[sizeof (ast::expr_integer::ptr)]; - - // expr_istring - char dummy22[sizeof (ast::expr_istring::ptr)]; - - // expr_level - char dummy23[sizeof (ast::expr_level::ptr)]; - - // expr_method - char dummy24[sizeof (ast::expr_method::ptr)]; - - // expr_negate - char dummy25[sizeof (ast::expr_negate::ptr)]; - - // expr_not - char dummy26[sizeof (ast::expr_not::ptr)]; - - // expr_parameters - char dummy27[sizeof (ast::expr_parameters::ptr)]; - - // expr_paren - char dummy28[sizeof (ast::expr_paren::ptr)]; - - // expr_path - char dummy29[sizeof (ast::expr_path::ptr)]; - - // expr_reference - char dummy30[sizeof (ast::expr_reference::ptr)]; - - // expr_self - char dummy31[sizeof (ast::expr_self::ptr)]; - - // expr_size - char dummy32[sizeof (ast::expr_size::ptr)]; - - // expr_string - char dummy33[sizeof (ast::expr_string::ptr)]; - - // expr_thisthread - char dummy34[sizeof (ast::expr_thisthread::ptr)]; - - // expr_true - char dummy35[sizeof (ast::expr_true::ptr)]; - - // expr_tuple_arguments - char dummy36[sizeof (ast::expr_tuple::ptr)]; - - // expr_undefined - char dummy37[sizeof (ast::expr_undefined::ptr)]; - - // expr_vector - char dummy38[sizeof (ast::expr_vector::ptr)]; - - // include - char dummy39[sizeof (ast::include::ptr)]; - - // program - char dummy40[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy41[sizeof (ast::stmt)]; - - // stmt_assign - char dummy42[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy43[sizeof (ast::stmt_break::ptr)]; - - // stmt_breakpoint - char dummy44[sizeof (ast::stmt_breakpoint::ptr)]; - - // stmt_call - char dummy45[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy46[sizeof (ast::stmt_case::ptr)]; - - // stmt_continue - char dummy47[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy48[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy49[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy50[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy51[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy52[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy53[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy54[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy55[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy56[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy57[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy58[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy59[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy60[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy61[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy62[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy63[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waittill - char dummy64[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy65[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy66[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy67[sizeof (ast::stmt_while::ptr)]; - - // "path" - // "identifier" - // "string literal" - // "localized string" - // "float" - // "integer" - char dummy68[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]; - }; - - /// Whether the content is built: if defined, the name of the stored type. - const std::type_info *yytypeid_; - }; - -#endif - /// Backward compatibility (Bison 3.8). - typedef value_type semantic_type; - - /// Symbol locations. - typedef xsk::gsc::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 - { - IW6EMPTY = -2, - IW6EOF = 0, // "end of file" - IW6error = 1, // error - IW6UNDEF = 2, // "invalid token" - SH_DEFINE = 3, // "#define" - SH_UNDEF = 4, // "#undef" - SH_IFDEF = 5, // "#ifdef" - SH_IFNDEF = 6, // "#ifndef" - SH_IF = 7, // "#if" - SH_ELIF = 8, // "#elif" - SH_ELSE = 9, // "#else" - SH_ENDIF = 10, // "#endif" - DEVBEGIN = 11, // "/#" - DEVEND = 12, // "#/" - INLINE = 13, // "#inline" - INCLUDE = 14, // "#include" - USINGTREE = 15, // "#using_animtree" - ANIMTREE = 16, // "#animtree" - ENDON = 17, // "endon" - NOTIFY = 18, // "notify" - WAIT = 19, // "wait" - WAITTILL = 20, // "waittill" - WAITTILLMATCH = 21, // "waittillmatch" - WAITTILLFRAMEEND = 22, // "waittillframeend" - IF = 23, // "if" - ELSE = 24, // "else" - DO = 25, // "do" - WHILE = 26, // "while" - FOR = 27, // "for" - FOREACH = 28, // "foreach" - IN = 29, // "in" - SWITCH = 30, // "switch" - CASE = 31, // "case" - DEFAULT = 32, // "default" - BREAK = 33, // "break" - CONTINUE = 34, // "continue" - RETURN = 35, // "return" - BREAKPOINT = 36, // "breakpoint" - PROFBEGIN = 37, // "prof_begin" - PROFEND = 38, // "prof_end" - THREAD = 39, // "thread" - CHILDTHREAD = 40, // "childthread" - THISTHREAD = 41, // "thisthread" - CALL = 42, // "call" - TRUE = 43, // "true" - FALSE = 44, // "false" - UNDEFINED = 45, // "undefined" - SIZE = 46, // "size" - GAME = 47, // "game" - SELF = 48, // "self" - ANIM = 49, // "anim" - LEVEL = 50, // "level" - LPAREN = 51, // "(" - RPAREN = 52, // ")" - LBRACE = 53, // "{" - RBRACE = 54, // "}" - LBRACKET = 55, // "[" - RBRACKET = 56, // "]" - COMMA = 57, // "," - DOT = 58, // "." - DOUBLECOLON = 59, // "::" - COLON = 60, // ":" - SEMICOLON = 61, // ";" - QMARK = 62, // "?" - INCREMENT = 63, // "++" - DECREMENT = 64, // "--" - LSHIFT = 65, // "<<" - RSHIFT = 66, // ">>" - OR = 67, // "||" - AND = 68, // "&&" - EQUALITY = 69, // "==" - INEQUALITY = 70, // "!=" - LESS_EQUAL = 71, // "<=" - GREATER_EQUAL = 72, // ">=" - LESS = 73, // "<" - GREATER = 74, // ">" - NOT = 75, // "!" - COMPLEMENT = 76, // "~" - ASSIGN = 77, // "=" - ASSIGN_ADD = 78, // "+=" - ASSIGN_SUB = 79, // "-=" - ASSIGN_MUL = 80, // "*=" - ASSIGN_DIV = 81, // "/=" - ASSIGN_MOD = 82, // "%=" - ASSIGN_BW_OR = 83, // "|=" - ASSIGN_BW_AND = 84, // "&=" - ASSIGN_BW_EXOR = 85, // "^=" - ASSIGN_RSHIFT = 86, // ">>=" - ASSIGN_LSHIFT = 87, // "<<=" - BITWISE_OR = 88, // "|" - BITWISE_AND = 89, // "&" - BITWISE_EXOR = 90, // "^" - ADD = 91, // "+" - SUB = 92, // "-" - MUL = 93, // "*" - DIV = 94, // "/" - MOD = 95, // "%" - PATH = 96, // "path" - IDENTIFIER = 97, // "identifier" - STRING = 98, // "string literal" - ISTRING = 99, // "localized string" - FLOAT = 100, // "float" - INTEGER = 101, // "integer" - SIZEOF = 102, // SIZEOF - ADD_ARRAY = 103, // ADD_ARRAY - THEN = 104, // THEN - TERN = 105, // TERN - NEG = 106, // NEG - ANIMREF = 107, // ANIMREF - PREINC = 108, // PREINC - PREDEC = 109, // PREDEC - POSTINC = 110, // POSTINC - POSTDEC = 111 // POSTDEC - }; - /// Backward compatibility alias (Bison 3.6). - typedef token_kind_type yytokentype; - }; - - /// Token kind, as returned by yylex. - typedef token::token_kind_type 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 = 112, ///< Number of tokens. - S_YYEMPTY = -2, - S_YYEOF = 0, // "end of file" - S_YYerror = 1, // error - S_YYUNDEF = 2, // "invalid token" - S_SH_DEFINE = 3, // "#define" - S_SH_UNDEF = 4, // "#undef" - S_SH_IFDEF = 5, // "#ifdef" - S_SH_IFNDEF = 6, // "#ifndef" - S_SH_IF = 7, // "#if" - S_SH_ELIF = 8, // "#elif" - S_SH_ELSE = 9, // "#else" - S_SH_ENDIF = 10, // "#endif" - S_DEVBEGIN = 11, // "/#" - S_DEVEND = 12, // "#/" - S_INLINE = 13, // "#inline" - S_INCLUDE = 14, // "#include" - S_USINGTREE = 15, // "#using_animtree" - S_ANIMTREE = 16, // "#animtree" - S_ENDON = 17, // "endon" - S_NOTIFY = 18, // "notify" - S_WAIT = 19, // "wait" - S_WAITTILL = 20, // "waittill" - S_WAITTILLMATCH = 21, // "waittillmatch" - S_WAITTILLFRAMEEND = 22, // "waittillframeend" - S_IF = 23, // "if" - S_ELSE = 24, // "else" - S_DO = 25, // "do" - S_WHILE = 26, // "while" - S_FOR = 27, // "for" - S_FOREACH = 28, // "foreach" - S_IN = 29, // "in" - S_SWITCH = 30, // "switch" - S_CASE = 31, // "case" - S_DEFAULT = 32, // "default" - S_BREAK = 33, // "break" - S_CONTINUE = 34, // "continue" - S_RETURN = 35, // "return" - S_BREAKPOINT = 36, // "breakpoint" - S_PROFBEGIN = 37, // "prof_begin" - S_PROFEND = 38, // "prof_end" - S_THREAD = 39, // "thread" - S_CHILDTHREAD = 40, // "childthread" - S_THISTHREAD = 41, // "thisthread" - S_CALL = 42, // "call" - S_TRUE = 43, // "true" - S_FALSE = 44, // "false" - S_UNDEFINED = 45, // "undefined" - S_SIZE = 46, // "size" - S_GAME = 47, // "game" - S_SELF = 48, // "self" - S_ANIM = 49, // "anim" - S_LEVEL = 50, // "level" - S_LPAREN = 51, // "(" - S_RPAREN = 52, // ")" - S_LBRACE = 53, // "{" - S_RBRACE = 54, // "}" - S_LBRACKET = 55, // "[" - S_RBRACKET = 56, // "]" - S_COMMA = 57, // "," - S_DOT = 58, // "." - S_DOUBLECOLON = 59, // "::" - S_COLON = 60, // ":" - S_SEMICOLON = 61, // ";" - S_QMARK = 62, // "?" - S_INCREMENT = 63, // "++" - S_DECREMENT = 64, // "--" - S_LSHIFT = 65, // "<<" - S_RSHIFT = 66, // ">>" - S_OR = 67, // "||" - S_AND = 68, // "&&" - S_EQUALITY = 69, // "==" - S_INEQUALITY = 70, // "!=" - S_LESS_EQUAL = 71, // "<=" - S_GREATER_EQUAL = 72, // ">=" - S_LESS = 73, // "<" - S_GREATER = 74, // ">" - S_NOT = 75, // "!" - S_COMPLEMENT = 76, // "~" - S_ASSIGN = 77, // "=" - S_ASSIGN_ADD = 78, // "+=" - S_ASSIGN_SUB = 79, // "-=" - S_ASSIGN_MUL = 80, // "*=" - S_ASSIGN_DIV = 81, // "/=" - S_ASSIGN_MOD = 82, // "%=" - S_ASSIGN_BW_OR = 83, // "|=" - S_ASSIGN_BW_AND = 84, // "&=" - S_ASSIGN_BW_EXOR = 85, // "^=" - S_ASSIGN_RSHIFT = 86, // ">>=" - S_ASSIGN_LSHIFT = 87, // "<<=" - S_BITWISE_OR = 88, // "|" - S_BITWISE_AND = 89, // "&" - S_BITWISE_EXOR = 90, // "^" - S_ADD = 91, // "+" - S_SUB = 92, // "-" - S_MUL = 93, // "*" - S_DIV = 94, // "/" - S_MOD = 95, // "%" - S_PATH = 96, // "path" - S_IDENTIFIER = 97, // "identifier" - S_STRING = 98, // "string literal" - S_ISTRING = 99, // "localized string" - S_FLOAT = 100, // "float" - S_INTEGER = 101, // "integer" - S_SIZEOF = 102, // SIZEOF - S_ADD_ARRAY = 103, // ADD_ARRAY - S_THEN = 104, // THEN - S_TERN = 105, // TERN - S_NEG = 106, // NEG - S_ANIMREF = 107, // ANIMREF - S_PREINC = 108, // PREINC - S_PREDEC = 109, // PREDEC - S_POSTINC = 110, // POSTINC - S_POSTDEC = 111, // POSTDEC - S_YYACCEPT = 112, // $accept - S_root = 113, // root - S_program = 114, // program - S_inline = 115, // inline - S_include = 116, // include - S_declaration = 117, // declaration - S_decl_usingtree = 118, // decl_usingtree - S_decl_constant = 119, // decl_constant - S_decl_thread = 120, // decl_thread - S_stmt = 121, // stmt - S_stmt_or_dev = 122, // stmt_or_dev - S_stmt_list = 123, // stmt_list - S_stmt_or_dev_list = 124, // stmt_or_dev_list - S_stmt_dev = 125, // stmt_dev - S_stmt_block = 126, // stmt_block - S_stmt_expr = 127, // stmt_expr - S_stmt_call = 128, // stmt_call - S_stmt_assign = 129, // stmt_assign - S_stmt_endon = 130, // stmt_endon - S_stmt_notify = 131, // stmt_notify - S_stmt_wait = 132, // stmt_wait - S_stmt_waittill = 133, // stmt_waittill - S_stmt_waittillmatch = 134, // stmt_waittillmatch - S_stmt_waittillframeend = 135, // stmt_waittillframeend - S_stmt_if = 136, // stmt_if - S_stmt_ifelse = 137, // stmt_ifelse - S_stmt_while = 138, // stmt_while - S_stmt_dowhile = 139, // stmt_dowhile - S_stmt_for = 140, // stmt_for - S_stmt_foreach = 141, // stmt_foreach - S_stmt_switch = 142, // stmt_switch - S_stmt_case = 143, // stmt_case - S_stmt_default = 144, // stmt_default - S_stmt_break = 145, // stmt_break - S_stmt_continue = 146, // stmt_continue - S_stmt_return = 147, // stmt_return - S_stmt_breakpoint = 148, // stmt_breakpoint - S_stmt_prof_begin = 149, // stmt_prof_begin - S_stmt_prof_end = 150, // stmt_prof_end - S_expr = 151, // expr - S_expr_or_empty = 152, // expr_or_empty - S_expr_assign = 153, // expr_assign - S_expr_increment = 154, // expr_increment - S_expr_decrement = 155, // expr_decrement - S_expr_ternary = 156, // expr_ternary - S_expr_binary = 157, // expr_binary - S_expr_primitive = 158, // expr_primitive - S_expr_complement = 159, // expr_complement - S_expr_negate = 160, // expr_negate - S_expr_not = 161, // expr_not - S_expr_call = 162, // expr_call - S_expr_method = 163, // expr_method - S_expr_function = 164, // expr_function - S_expr_pointer = 165, // expr_pointer - S_expr_add_array = 166, // expr_add_array - S_expr_parameters = 167, // expr_parameters - S_expr_arguments = 168, // expr_arguments - S_expr_arguments_no_empty = 169, // expr_arguments_no_empty - S_expr_reference = 170, // expr_reference - S_expr_tuple = 171, // expr_tuple - S_expr_tuple_arguments = 172, // expr_tuple_arguments - S_expr_tuple_types = 173, // expr_tuple_types - S_expr_array = 174, // expr_array - S_expr_field = 175, // expr_field - S_expr_size = 176, // expr_size - S_expr_paren = 177, // expr_paren - S_expr_object = 178, // expr_object - S_expr_thisthread = 179, // expr_thisthread - S_expr_empty_array = 180, // expr_empty_array - S_expr_undefined = 181, // expr_undefined - S_expr_game = 182, // expr_game - S_expr_self = 183, // expr_self - S_expr_anim = 184, // expr_anim - S_expr_level = 185, // expr_level - S_expr_animation = 186, // expr_animation - S_expr_animtree = 187, // expr_animtree - S_expr_identifier_nosize = 188, // expr_identifier_nosize - S_expr_identifier = 189, // expr_identifier - S_expr_path = 190, // expr_path - S_expr_istring = 191, // expr_istring - S_expr_string = 192, // expr_string - S_expr_vector = 193, // expr_vector - S_expr_float = 194, // expr_float - S_expr_integer = 195, // expr_integer - S_expr_false = 196, // expr_false - S_expr_true = 197 // 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 () YY_NOEXCEPT - : 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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_add_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_add_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_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_animtree::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_animtree::ptr& v, const location_type& l) - : 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_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_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_negate::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l) - : 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_thisthread::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_thisthread::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_tuple::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_tuple::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::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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.template destroy< ast::expr_add_array::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_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.template destroy< ast::expr_negate::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_thisthread: // expr_thisthread - value.template destroy< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.template destroy< ast::expr_tuple::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_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_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_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. - value_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 - { - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; - - /// Default constructor. - by_kind () YY_NOEXCEPT; - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that) YY_NOEXCEPT; -#endif - - /// Copy constructor. - by_kind (const by_kind& that) YY_NOEXCEPT; - - /// Constructor from (external) token numbers. - by_kind (kind_type t) YY_NOEXCEPT; - - - - /// 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 () YY_NOEXCEPT {} - - /// Constructor for valueless symbols, and symbols from each type. -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, location_type l) - : super_type (token_kind_type (tok), std::move (l)) -#else - symbol_type (int tok, const location_type& l) - : super_type (token_kind_type (tok), l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - IW6_ASSERT (tok == token::IW6EOF - || (token::IW6error <= tok && tok <= token::MOD) - || (token::SIZEOF <= tok && tok <= token::POSTDEC)); -#endif - } -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, std::string v, location_type l) - : super_type (token_kind_type (tok), std::move (v), std::move (l)) -#else - symbol_type (int tok, const std::string& v, const location_type& l) - : super_type (token_kind_type (tok), v, l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - IW6_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); -#endif - } - }; - - /// Build a parser object. - parser (xsk::gsc::iw6::lexer& lexer_yyarg, xsk::gsc::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 IW6DEBUG - /// 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 token kind. -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW6EOF (location_type l) - { - return symbol_type (token::IW6EOF, std::move (l)); - } -#else - static - symbol_type - make_IW6EOF (const location_type& l) - { - return symbol_type (token::IW6EOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW6error (location_type l) - { - return symbol_type (token::IW6error, std::move (l)); - } -#else - static - symbol_type - make_IW6error (const location_type& l) - { - return symbol_type (token::IW6error, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW6UNDEF (location_type l) - { - return symbol_type (token::IW6UNDEF, std::move (l)); - } -#else - static - symbol_type - make_IW6UNDEF (const location_type& l) - { - return symbol_type (token::IW6UNDEF, 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_ANIMTREE (location_type l) - { - return symbol_type (token::ANIMTREE, std::move (l)); - } -#else - static - symbol_type - make_ANIMTREE (const location_type& l) - { - return symbol_type (token::ANIMTREE, 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_CHILDTHREAD (location_type l) - { - return symbol_type (token::CHILDTHREAD, std::move (l)); - } -#else - static - symbol_type - make_CHILDTHREAD (const location_type& l) - { - return symbol_type (token::CHILDTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_THISTHREAD (location_type l) - { - return symbol_type (token::THISTHREAD, std::move (l)); - } -#else - static - symbol_type - make_THISTHREAD (const location_type& l) - { - return symbol_type (token::THISTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_CALL (location_type l) - { - return symbol_type (token::CALL, std::move (l)); - } -#else - static - symbol_type - make_CALL (const location_type& l) - { - return symbol_type (token::CALL, 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_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_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_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_SIZEOF (location_type l) - { - return symbol_type (token::SIZEOF, std::move (l)); - } -#else - static - symbol_type - make_SIZEOF (const location_type& l) - { - return symbol_type (token::SIZEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_ADD_ARRAY (location_type l) - { - return symbol_type (token::ADD_ARRAY, std::move (l)); - } -#else - static - symbol_type - make_ADD_ARRAY (const location_type& l) - { - return symbol_type (token::ADD_ARRAY, 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) YY_NOEXCEPT; - - /// 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) YY_NOEXCEPT; - - 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_kind_type enum. - static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; - - - - // 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 symbol kind of the accessing symbol of - // state STATE-NUM. - static const unsigned char yystos_[]; - - // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. - static const unsigned char yyr1_[]; - - // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. - static const signed char yyr2_[]; - - -#if IW6DEBUG - // 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT; - - /// Constants. - enum - { - yylast_ = 2371, ///< Last index in yytable_. - yynnts_ = 86, ///< Number of nonterminal symbols. - yyfinal_ = 22 ///< Termination state number. - }; - - - // User arguments. - xsk::gsc::iw6::lexer& lexer; - xsk::gsc::ast::program::ptr& ast; - - }; - - inline - parser::symbol_kind_type - parser::yytranslate_ (int t) YY_NOEXCEPT - { - 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::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_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); - 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_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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 () YY_NOEXCEPT - : kind_ (symbol_kind::S_YYEMPTY) - {} - -#if 201103L <= YY_CPLUSPLUS - inline - parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT - : kind_ (that.kind_) - { - that.clear (); - } -#endif - - inline - parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT - : kind_ (that.kind_) - {} - - inline - parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT - : 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::gsc::iw6 -#line 5546 "parser.hpp" - - - - -#endif // !YY_IW6_PARSER_HPP_INCLUDED diff --git a/src/iw6/xsk/resolver.hpp b/src/iw6/xsk/resolver.hpp deleted file mode 100644 index 45820ab2..00000000 --- a/src/iw6/xsk/resolver.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::iw6 -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint16_t; - static auto token_name(std::uint16_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::gsc::iw6 diff --git a/src/iw7/iw7.cpp b/src/iw7/iw7.cpp new file mode 100644 index 00000000..309e7074 --- /dev/null +++ b/src/iw7/iw7.cpp @@ -0,0 +1,52 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw7.hpp" + +namespace xsk::gsc::iw7 +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::str4 | props::tok4 | props::offs9, engine::iw7, endian::little, system::pc, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/iw7.hpp b/src/iw7/iw7.hpp new file mode 100644 index 00000000..f5f94b48 --- /dev/null +++ b/src/iw7/iw7.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::iw7 +{ + +constexpr usize code_count = 153; +constexpr usize func_count = 807; +constexpr usize meth_count = 1500; +constexpr usize token_count = 5; +constexpr u32 max_string_id = 0x13FCC; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/iw7_code.cpp b/src/iw7/iw7_code.cpp new file mode 100644 index 00000000..c989e2e4 --- /dev/null +++ b/src/iw7/iw7_code.cpp @@ -0,0 +1,168 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw7.hpp" + +namespace xsk::gsc::iw7 +{ + +extern std::array, code_count> const code_list +{{ + { 0x17, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x18, opcode::OP_EvalSelfFieldVariable }, + { 0x19, opcode::OP_Return }, + { 0x1A, opcode::OP_CallBuiltin0 }, + { 0x1B, opcode::OP_CallBuiltin1 }, + { 0x1C, opcode::OP_CallBuiltin2 }, + { 0x1D, opcode::OP_CallBuiltin3 }, + { 0x1E, opcode::OP_CallBuiltin4 }, + { 0x1F, opcode::OP_CallBuiltin5 }, + { 0x20, opcode::OP_CallBuiltin }, + { 0x21, opcode::OP_BoolNot }, + { 0x22, opcode::OP_ScriptFarMethodThreadCall }, + { 0x23, opcode::OP_JumpOnTrueExpr }, + { 0x24, opcode::OP_SetLevelFieldVariableField }, + { 0x25, opcode::OP_CastBool }, + { 0x26, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x27, opcode::OP_CallBuiltinPointer }, + { 0x28, opcode::OP_inequality }, + { 0x29, opcode::OP_GetThisthread }, + { 0x2A, opcode::OP_ClearFieldVariable }, + { 0x2B, opcode::OP_GetFloat }, + { 0x2C, opcode::OP_SafeCreateVariableFieldCached }, + { 0x2D, opcode::OP_ScriptFarFunctionCall2 }, + { 0x2E, opcode::OP_ScriptFarFunctionCall }, + { 0x2F, opcode::OP_ScriptFarChildThreadCall }, + { 0x30, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x31, opcode::OP_ClearLocalVariableFieldCached }, + { 0x32, opcode::OP_checkclearparams }, + { 0x33, opcode::OP_CastFieldObject }, + { 0x34, opcode::OP_End }, + { 0x35, opcode::OP_size }, + { 0x36, opcode::OP_EmptyArray }, + { 0x37, opcode::OP_bit_and }, + { 0x38, opcode::OP_less_equal }, + { 0x39, opcode::OP_voidCodepos }, + { 0x3A, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3B, opcode::OP_endswitch }, + { 0x3C, opcode::OP_ClearVariableField }, + { 0x3D, opcode::OP_divide }, + { 0x3E, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x3F, opcode::OP_GetUnsignedShort }, + { 0x40, opcode::OP_JumpOnTrue }, + { 0x41, opcode::OP_GetSelf }, + { 0x42, opcode::OP_ScriptFarThreadCall }, + { 0x43, opcode::OP_ScriptLocalThreadCall }, + { 0x44, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x45, opcode::OP_SetLocalVariableFieldCached }, + { 0x46, opcode::OP_plus }, + { 0x47, opcode::OP_BoolComplement }, + { 0x48, opcode::OP_ScriptMethodCallPointer }, + { 0x49, opcode::OP_inc }, + { 0x4A, opcode::OP_RemoveLocalVariables }, + { 0x4B, opcode::OP_JumpOnFalseExpr }, + { 0x4C, opcode::OP_switch }, + { 0x4D, opcode::OP_clearparams }, + { 0x4E, opcode::OP_EvalLocalVariableRefCached0 }, + { 0x4F, opcode::OP_EvalLocalVariableRefCached }, + { 0x50, opcode::OP_ScriptLocalMethodCall }, + { 0x51, opcode::OP_EvalFieldVariable }, + { 0x52, opcode::OP_EvalFieldVariableRef }, + { 0x53, opcode::OP_GetString }, + { 0x54, opcode::OP_ScriptFunctionCallPointer }, + { 0x55, opcode::OP_EvalLevelFieldVariable }, + { 0x56, opcode::OP_GetVector }, + { 0x57, opcode::OP_endon }, + { 0x58, opcode::OP_greater_equal }, + { 0x59, opcode::OP_GetSelfObject }, + { 0x5A, opcode::OP_SetAnimFieldVariableField }, + { 0x5B, opcode::OP_SetVariableField }, + { 0x5C, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x5D, opcode::OP_ScriptLocalFunctionCall }, + { 0x5E, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x5F, opcode::OP_EvalLocalArrayRefCached }, + { 0x60, opcode::OP_GetFarFunction }, + { 0x61, opcode::OP_less }, + { 0x62, opcode::OP_GetGameRef }, + { 0x63, opcode::OP_waittillFrameEnd }, + { 0x64, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x65, opcode::OP_SafeSetVariableFieldCached }, + { 0x66, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x67, opcode::OP_GetLevel }, + { 0x68, opcode::OP_notify }, + { 0x69, opcode::OP_DecTop }, + { 0x6A, opcode::OP_shift_left }, + { 0x6B, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x6C, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x6D, opcode::OP_greater }, + { 0x6E, opcode::OP_EvalLocalVariableCached0 }, + { 0x6F, opcode::OP_EvalLocalVariableCached1 }, + { 0x70, opcode::OP_EvalLocalVariableCached2 }, + { 0x71, opcode::OP_EvalLocalVariableCached3 }, + { 0x72, opcode::OP_EvalLocalVariableCached4 }, + { 0x73, opcode::OP_EvalLocalVariableCached5 }, + { 0x74, opcode::OP_EvalLocalVariableCached }, + { 0x75, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x76, opcode::OP_jump }, + { 0x77, opcode::OP_ScriptThreadCallPointer }, + { 0x78, opcode::OP_GetZero }, + { 0x79, opcode::OP_wait }, + { 0x7A, opcode::OP_minus }, + { 0x7B, opcode::OP_SetSelfFieldVariableField }, + { 0x7C, opcode::OP_EvalNewLocalVariableRefCached0 }, + { 0x7D, opcode::OP_multiply }, + { 0x7E, opcode::OP_CreateLocalVariable }, + { 0x7F, opcode::OP_ScriptLocalChildThreadCall }, + { 0x80, opcode::OP_GetInteger }, + { 0x81, opcode::OP_mod }, + { 0x82, opcode::OP_EvalAnimFieldVariableRef }, + { 0x83, opcode::OP_GetBuiltinFunction }, + { 0x84, opcode::OP_GetGame }, + { 0x85, opcode::OP_waittill }, + { 0x86, opcode::OP_dec }, + { 0x87, opcode::OP_EvalLocalVariableObjectCached }, + { 0x88, opcode::OP_PreScriptCall }, + { 0x89, opcode::OP_GetAnim }, + { 0x8A, opcode::OP_GetUndefined }, + { 0x8B, opcode::OP_EvalLevelFieldVariableRef }, + { 0x8C, opcode::OP_GetAnimObject }, + { 0x8D, opcode::OP_GetLevelObject }, + { 0x8E, opcode::OP_bit_ex_or }, + { 0x8F, opcode::OP_equality }, + { 0x90, opcode::OP_ClearArray }, + { 0x91, opcode::OP_jumpback }, + { 0x92, opcode::OP_GetAnimation }, + { 0x93, opcode::OP_EvalAnimFieldVariable }, + { 0x94, opcode::OP_GetAnimTree }, + { 0x95, opcode::OP_GetIString }, + { 0x96, opcode::OP_EvalArrayRef }, + { 0x97, opcode::OP_EvalSelfFieldVariableRef }, + { 0x98, opcode::OP_GetNegByte }, + { 0x99, opcode::OP_GetBuiltinMethod }, + { 0x9A, opcode::OP_CallBuiltinMethodPointer }, + { 0x9B, opcode::OP_EvalArray }, + { 0x9C, opcode::OP_vector }, + { 0x9D, opcode::OP_ScriptFarMethodCall }, + { 0x9E, opcode::OP_EvalLocalArrayCached }, + { 0x9F, opcode::OP_GetByte }, + { 0xA0, opcode::OP_ScriptChildThreadCallPointer }, + { 0xA1, opcode::OP_bit_or }, + { 0xA2, opcode::OP_AddArray }, + { 0xA3, opcode::OP_waittillmatch2 }, + { 0xA4, opcode::OP_waittillmatch }, + { 0xA5, opcode::OP_GetLocalFunction }, + { 0xA6, opcode::OP_GetNegUnsignedShort }, + { 0xA7, opcode::OP_shift_right }, + { 0xA8, opcode::OP_CallBuiltinMethod0 }, + { 0xA9, opcode::OP_CallBuiltinMethod1 }, + { 0xAA, opcode::OP_CallBuiltinMethod2 }, + { 0xAB, opcode::OP_CallBuiltinMethod3 }, + { 0xAC, opcode::OP_CallBuiltinMethod4 }, + { 0xAD, opcode::OP_CallBuiltinMethod5 }, + { 0xAE, opcode::OP_CallBuiltinMethod }, + { 0xAF, opcode::OP_JumpOnFalse }, +}}; + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/iw7_func.cpp b/src/iw7/iw7_func.cpp new file mode 100644 index 00000000..b648fd39 --- /dev/null +++ b/src/iw7/iw7_func.cpp @@ -0,0 +1,822 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw7.hpp" + +namespace xsk::gsc::iw7 +{ + +extern std::array, func_count> const func_list +{{ + { 0x001, "_func_001" }, + { 0x002, "_func_002" }, + { 0x003, "_func_003" }, + { 0x004, "_func_004" }, + { 0x005, "_func_005" }, + { 0x006, "_func_006" }, + { 0x007, "_func_007" }, + { 0x008, "_func_008" }, + { 0x009, "_func_009" }, + { 0x00A, "_func_00A" }, + { 0x00B, "_func_00B" }, + { 0x00C, "_func_00C" }, + { 0x00D, "_func_00D" }, + { 0x00E, "_func_00E" }, + { 0x00F, "_func_00F" }, + { 0x010, "_func_010" }, + { 0x011, "_func_011" }, + { 0x012, "_func_012" }, + { 0x013, "_func_013" }, + { 0x014, "_func_014" }, + { 0x015, "_func_015" }, + { 0x016, "_func_016" }, + { 0x017, "_func_017" }, + { 0x018, "_func_018" }, + { 0x019, "_func_019" }, + { 0x01A, "_func_01A" }, + { 0x01B, "_func_01B" }, + { 0x01C, "_func_01C" }, + { 0x01D, "_func_01D" }, + { 0x01E, "_func_01E" }, + { 0x01F, "_func_01F" }, + { 0x020, "_func_020" }, + { 0x021, "_func_021" }, + { 0x022, "_func_022" }, + { 0x023, "_func_023" }, + { 0x024, "_func_024" }, + { 0x025, "_func_025" }, + { 0x026, "_func_026" }, + { 0x027, "_func_027" }, + { 0x028, "_func_028" }, + { 0x029, "_func_029" }, + { 0x02A, "_func_02A" }, + { 0x02B, "_func_02B" }, + { 0x02C, "_func_02C" }, + { 0x02D, "_func_02D" }, + { 0x02E, "_func_02E" }, + { 0x02F, "_func_02F" }, + { 0x030, "_func_030" }, + { 0x031, "_func_031" }, + { 0x032, "_func_032" }, + { 0x033, "_func_033" }, + { 0x034, "_func_034" }, + { 0x035, "_func_035" }, + { 0x036, "_func_036" }, + { 0x037, "_func_037" }, + { 0x038, "_func_038" }, + { 0x039, "_func_039" }, + { 0x03A, "_func_03A" }, + { 0x03B, "_func_03B" }, + { 0x03C, "_func_03C" }, + { 0x03D, "_func_03D" }, + { 0x03E, "_func_03E" }, + { 0x03F, "_func_03F" }, + { 0x040, "_func_040" }, + { 0x041, "_func_041" }, + { 0x042, "_func_042" }, + { 0x043, "_func_043" }, + { 0x044, "_func_044" }, + { 0x045, "_func_045" }, + { 0x046, "_func_046" }, + { 0x047, "_func_047" }, + { 0x048, "_func_048" }, + { 0x049, "_func_049" }, + { 0x04A, "_func_04A" }, + { 0x04B, "_func_04B" }, + { 0x04C, "_func_04C" }, + { 0x04D, "_func_04D" }, + { 0x04E, "_func_04E" }, + { 0x04F, "_func_04F" }, + { 0x050, "_func_050" }, + { 0x051, "_func_051" }, + { 0x052, "_func_052" }, + { 0x053, "_func_053" }, + { 0x054, "_func_054" }, + { 0x055, "_func_055" }, + { 0x056, "_func_056" }, + { 0x057, "_func_057" }, + { 0x058, "_func_058" }, + { 0x059, "_func_059" }, + { 0x05A, "_func_05A" }, + { 0x05B, "_func_05B" }, + { 0x05C, "_func_05C" }, + { 0x05D, "_func_05D" }, + { 0x05E, "_func_05E" }, + { 0x05F, "_func_05F" }, + { 0x060, "_func_060" }, + { 0x061, "_func_061" }, + { 0x062, "_func_062" }, + { 0x063, "_func_063" }, + { 0x064, "_func_064" }, + { 0x065, "_func_065" }, + { 0x066, "_func_066" }, + { 0x067, "_func_067" }, + { 0x068, "_func_068" }, + { 0x069, "_func_069" }, + { 0x06A, "_func_06A" }, + { 0x06B, "_func_06B" }, + { 0x06C, "_func_06C" }, + { 0x06D, "_func_06D" }, + { 0x06E, "_func_06E" }, + { 0x06F, "_func_06F" }, + { 0x070, "_func_070" }, + { 0x071, "_func_071" }, + { 0x072, "_func_072" }, + { 0x073, "_func_073" }, + { 0x074, "_func_074" }, + { 0x075, "_func_075" }, + { 0x076, "_func_076" }, + { 0x077, "_func_077" }, + { 0x078, "_func_078" }, + { 0x079, "_func_079" }, + { 0x07A, "_func_07A" }, + { 0x07B, "_func_07B" }, + { 0x07C, "_func_07C" }, + { 0x07D, "_func_07D" }, + { 0x07E, "_func_07E" }, + { 0x07F, "_func_07F" }, + { 0x080, "_func_080" }, + { 0x081, "_func_081" }, + { 0x082, "_func_082" }, + { 0x083, "_func_083" }, + { 0x084, "_func_084" }, + { 0x085, "_func_085" }, + { 0x086, "_func_086" }, + { 0x087, "_func_087" }, + { 0x088, "_func_088" }, + { 0x089, "_func_089" }, + { 0x08A, "_func_08A" }, + { 0x08B, "_func_08B" }, + { 0x08C, "_func_08C" }, + { 0x08D, "_func_08D" }, + { 0x08E, "_func_08E" }, + { 0x08F, "_func_08F" }, + { 0x090, "_func_090" }, + { 0x091, "_func_091" }, + { 0x092, "_func_092" }, + { 0x093, "_func_093" }, + { 0x094, "_func_094" }, + { 0x095, "_func_095" }, + { 0x096, "_func_096" }, + { 0x097, "_func_097" }, + { 0x098, "_func_098" }, + { 0x099, "_func_099" }, + { 0x09A, "_func_09A" }, + { 0x09B, "_func_09B" }, + { 0x09C, "getfirstarraykey" }, + { 0x09D, "_func_09D" }, + { 0x09E, "_func_09E" }, + { 0x09F, "_func_09F" }, + { 0x0A0, "_func_0A0" }, + { 0x0A1, "_func_0A1" }, + { 0x0A2, "_func_0A2" }, + { 0x0A3, "_func_0A3" }, + { 0x0A4, "_func_0A4" }, + { 0x0A5, "_func_0A5" }, + { 0x0A6, "_func_0A6" }, + { 0x0A7, "_func_0A7" }, + { 0x0A8, "_func_0A8" }, + { 0x0A9, "_func_0A9" }, + { 0x0AA, "_func_0AA" }, + { 0x0AB, "_func_0AB" }, + { 0x0AC, "_func_0AC" }, + { 0x0AD, "_func_0AD" }, + { 0x0AE, "_func_0AE" }, + { 0x0AF, "_func_0AF" }, + { 0x0B0, "_func_0B0" }, + { 0x0B1, "_func_0B1" }, + { 0x0B2, "getnextarraykey" }, + { 0x0B3, "_func_0B3" }, + { 0x0B4, "_func_0B4" }, + { 0x0B5, "_func_0B5" }, + { 0x0B6, "_func_0B6" }, + { 0x0B7, "_func_0B7" }, + { 0x0B8, "_func_0B8" }, + { 0x0B9, "_func_0B9" }, + { 0x0BA, "_func_0BA" }, + { 0x0BB, "_func_0BB" }, + { 0x0BC, "_func_0BC" }, + { 0x0BD, "_func_0BD" }, + { 0x0BE, "_func_0BE" }, + { 0x0BF, "_func_0BF" }, + { 0x0C0, "_func_0C0" }, + { 0x0C1, "_func_0C1" }, + { 0x0C2, "_func_0C2" }, + { 0x0C3, "_func_0C3" }, + { 0x0C4, "_func_0C4" }, + { 0x0C5, "_func_0C5" }, + { 0x0C6, "_func_0C6" }, + { 0x0C7, "_func_0C7" }, + { 0x0C8, "_func_0C8" }, + { 0x0C9, "_func_0C9" }, + { 0x0CA, "_func_0CA" }, + { 0x0CB, "_func_0CB" }, + { 0x0CC, "_func_0CC" }, + { 0x0CD, "_func_0CD" }, + { 0x0CE, "_func_0CE" }, + { 0x0CF, "_func_0CF" }, + { 0x0D0, "_func_0D0" }, + { 0x0D1, "_func_0D1" }, + { 0x0D2, "_func_0D2" }, + { 0x0D3, "_func_0D3" }, + { 0x0D4, "_func_0D4" }, + { 0x0D5, "_func_0D5" }, + { 0x0D6, "_func_0D6" }, + { 0x0D7, "_func_0D7" }, + { 0x0D8, "_func_0D8" }, + { 0x0D9, "_func_0D9" }, + { 0x0DA, "_func_0DA" }, + { 0x0DB, "_func_0DB" }, + { 0x0DC, "_func_0DC" }, + { 0x0DD, "_func_0DD" }, + { 0x0DE, "_func_0DE" }, + { 0x0DF, "_func_0DF" }, + { 0x0E0, "_func_0E0" }, + { 0x0E1, "_func_0E1" }, + { 0x0E2, "_func_0E2" }, + { 0x0E3, "_func_0E3" }, + { 0x0E4, "_func_0E4" }, + { 0x0E5, "_func_0E5" }, + { 0x0E6, "_func_0E6" }, + { 0x0E7, "_func_0E7" }, + { 0x0E8, "_func_0E8" }, + { 0x0E9, "_func_0E9" }, + { 0x0EA, "_func_0EA" }, + { 0x0EB, "_func_0EB" }, + { 0x0EC, "_func_0EC" }, + { 0x0ED, "_func_0ED" }, + { 0x0EE, "_func_0EE" }, + { 0x0EF, "_func_0EF" }, + { 0x0F0, "_func_0F0" }, + { 0x0F1, "_func_0F1" }, + { 0x0F2, "_func_0F2" }, + { 0x0F3, "_func_0F3" }, + { 0x0F4, "_func_0F4" }, + { 0x0F5, "_func_0F5" }, + { 0x0F6, "_func_0F6" }, + { 0x0F7, "_func_0F7" }, + { 0x0F8, "_func_0F8" }, + { 0x0F9, "_func_0F9" }, + { 0x0FA, "_func_0FA" }, + { 0x0FB, "_func_0FB" }, + { 0x0FC, "_func_0FC" }, + { 0x0FD, "_func_0FD" }, + { 0x0FE, "_func_0FE" }, + { 0x0FF, "_func_0FF" }, + { 0x100, "_func_100" }, + { 0x101, "_func_101" }, + { 0x102, "_func_102" }, + { 0x103, "_func_103" }, + { 0x104, "isdefined" }, + { 0x105, "_func_105" }, + { 0x106, "_func_106" }, + { 0x107, "_func_107" }, + { 0x108, "_func_108" }, + { 0x109, "_func_109" }, + { 0x10A, "_func_10A" }, + { 0x10B, "_func_10B" }, + { 0x10C, "_func_10C" }, + { 0x10D, "_func_10D" }, + { 0x10E, "_func_10E" }, + { 0x10F, "_func_10F" }, + { 0x110, "_func_110" }, + { 0x111, "_func_111" }, + { 0x112, "_func_112" }, + { 0x113, "_func_113" }, + { 0x114, "_func_114" }, + { 0x115, "_func_115" }, + { 0x116, "_func_116" }, + { 0x117, "_func_117" }, + { 0x118, "_func_118" }, + { 0x119, "_func_119" }, + { 0x11A, "_func_11A" }, + { 0x11B, "_func_11B" }, + { 0x11C, "_func_11C" }, + { 0x11D, "_func_11D" }, + { 0x11E, "_func_11E" }, + { 0x11F, "_func_11F" }, + { 0x120, "_func_120" }, + { 0x121, "_func_121" }, + { 0x122, "_func_122" }, + { 0x123, "_func_123" }, + { 0x124, "_func_124" }, + { 0x125, "_func_125" }, + { 0x126, "_func_126" }, + { 0x127, "_func_127" }, + { 0x128, "_func_128" }, + { 0x129, "_func_129" }, + { 0x12A, "_func_12A" }, + { 0x12B, "_func_12B" }, + { 0x12C, "_func_12C" }, + { 0x12D, "_func_12D" }, + { 0x12E, "_func_12E" }, + { 0x12F, "_func_12F" }, + { 0x130, "_func_130" }, + { 0x131, "_func_131" }, + { 0x132, "_func_132" }, + { 0x133, "_func_133" }, + { 0x134, "_func_134" }, + { 0x135, "_func_135" }, + { 0x136, "_func_136" }, + { 0x137, "_func_137" }, + { 0x138, "_func_138" }, + { 0x139, "_func_139" }, + { 0x13A, "_func_13A" }, + { 0x13B, "_func_13B" }, + { 0x13C, "_func_13C" }, + { 0x13D, "_func_13D" }, + { 0x13E, "_func_13E" }, + { 0x13F, "_func_13F" }, + { 0x140, "_func_140" }, + { 0x141, "_func_141" }, + { 0x142, "_func_142" }, + { 0x143, "_func_143" }, + { 0x144, "_func_144" }, + { 0x145, "_func_145" }, + { 0x146, "_func_146" }, + { 0x147, "_func_147" }, + { 0x148, "_func_148" }, + { 0x149, "_func_149" }, + { 0x14A, "_func_14A" }, + { 0x14B, "_func_14B" }, + { 0x14C, "_func_14C" }, + { 0x14D, "_func_14D" }, + { 0x14E, "_func_14E" }, + { 0x14F, "_func_14F" }, + { 0x150, "_func_150" }, + { 0x151, "_func_151" }, + { 0x152, "_func_152" }, + { 0x153, "_func_153" }, + { 0x154, "_func_154" }, + { 0x155, "_func_155" }, + { 0x156, "_func_156" }, + { 0x157, "_func_157" }, + { 0x158, "_func_158" }, + { 0x159, "_func_159" }, + { 0x15A, "_func_15A" }, + { 0x15B, "_func_15B" }, + { 0x15C, "_func_15C" }, + { 0x15D, "_func_15D" }, + { 0x15E, "_func_15E" }, + { 0x15F, "_func_15F" }, + { 0x160, "_func_160" }, + { 0x161, "_func_161" }, + { 0x162, "_func_162" }, + { 0x163, "_func_163" }, + { 0x164, "_func_164" }, + { 0x165, "_func_165" }, + { 0x166, "_func_166" }, + { 0x167, "_func_167" }, + { 0x168, "_func_168" }, + { 0x169, "_func_169" }, + { 0x16A, "_func_16A" }, + { 0x16B, "_func_16B" }, + { 0x16C, "_func_16C" }, + { 0x16D, "_func_16D" }, + { 0x16E, "_func_16E" }, + { 0x16F, "_func_16F" }, + { 0x170, "_func_170" }, + { 0x171, "_func_171" }, + { 0x172, "_func_172" }, + { 0x173, "_func_173" }, + { 0x174, "_func_174" }, + { 0x175, "_func_175" }, + { 0x176, "_func_176" }, + { 0x177, "_func_177" }, + { 0x178, "_func_178" }, + { 0x179, "_func_179" }, + { 0x17A, "_func_17A" }, + { 0x17B, "_func_17B" }, + { 0x17C, "_func_17C" }, + { 0x17D, "_func_17D" }, + { 0x17E, "_func_17E" }, + { 0x17F, "_func_17F" }, + { 0x180, "_func_180" }, + { 0x181, "_func_181" }, + { 0x182, "_func_182" }, + { 0x183, "_func_183" }, + { 0x184, "_func_184" }, + { 0x185, "_func_185" }, + { 0x186, "_func_186" }, + { 0x187, "_func_187" }, + { 0x188, "_func_188" }, + { 0x189, "_func_189" }, + { 0x18A, "_func_18A" }, + { 0x18B, "_func_18B" }, + { 0x18C, "_func_18C" }, + { 0x18D, "_func_18D" }, + { 0x18E, "_func_18E" }, + { 0x18F, "_func_18F" }, + { 0x190, "_func_190" }, + { 0x191, "_func_191" }, + { 0x192, "_func_192" }, + { 0x193, "_func_193" }, + { 0x194, "_func_194" }, + { 0x195, "_func_195" }, + { 0x196, "_func_196" }, + { 0x197, "_func_197" }, + { 0x198, "_func_198" }, + { 0x199, "_func_199" }, + { 0x19A, "_func_19A" }, + { 0x19B, "_func_19B" }, + { 0x19C, "_func_19C" }, + { 0x19D, "_func_19D" }, + { 0x19E, "_func_19E" }, + { 0x19F, "_func_19F" }, + { 0x1A0, "_func_1A0" }, + { 0x1A1, "_func_1A1" }, + { 0x1A2, "_func_1A2" }, + { 0x1A3, "_func_1A3" }, + { 0x1A4, "_func_1A4" }, + { 0x1A5, "_func_1A5" }, + { 0x1A6, "_func_1A6" }, + { 0x1A7, "_func_1A7" }, + { 0x1A8, "_func_1A8" }, + { 0x1A9, "_func_1A9" }, + { 0x1AA, "_func_1AA" }, + { 0x1AB, "_func_1AB" }, + { 0x1AC, "_func_1AC" }, + { 0x1AD, "_func_1AD" }, + { 0x1AE, "_func_1AE" }, + { 0x1AF, "_func_1AF" }, + { 0x1B0, "_func_1B0" }, + { 0x1B1, "_func_1B1" }, + { 0x1B2, "_func_1B2" }, + { 0x1B3, "_func_1B3" }, + { 0x1B4, "_func_1B4" }, + { 0x1B5, "_func_1B5" }, + { 0x1B6, "_func_1B6" }, + { 0x1B7, "_func_1B7" }, + { 0x1B8, "_func_1B8" }, + { 0x1B9, "_func_1B9" }, + { 0x1BA, "_func_1BA" }, + { 0x1BB, "_func_1BB" }, + { 0x1BC, "_func_1BC" }, + { 0x1BD, "_func_1BD" }, + { 0x1BE, "_func_1BE" }, + { 0x1BF, "_func_1BF" }, + { 0x1C0, "_func_1C0" }, + { 0x1C1, "_func_1C1" }, + { 0x1C2, "_func_1C2" }, + { 0x1C3, "_func_1C3" }, + { 0x1C4, "_func_1C4" }, + { 0x1C5, "_func_1C5" }, + { 0x1C6, "_func_1C6" }, + { 0x1C7, "_func_1C7" }, + { 0x1C8, "_func_1C8" }, + { 0x1C9, "_func_1C9" }, + { 0x1CA, "_func_1CA" }, + { 0x1CB, "_func_1CB" }, + { 0x1CC, "_func_1CC" }, + { 0x1CD, "_func_1CD" }, + { 0x1CE, "_func_1CE" }, + { 0x1CF, "_func_1CF" }, + { 0x1D0, "_func_1D0" }, + { 0x1D1, "_func_1D1" }, + { 0x1D2, "_func_1D2" }, + { 0x1D3, "_func_1D3" }, + { 0x1D4, "_func_1D4" }, + { 0x1D5, "_func_1D5" }, + { 0x1D6, "_func_1D6" }, + { 0x1D7, "_func_1D7" }, + { 0x1D8, "_func_1D8" }, + { 0x1D9, "_func_1D9" }, + { 0x1DA, "_func_1DA" }, + { 0x1DB, "_func_1DB" }, + { 0x1DC, "_func_1DC" }, + { 0x1DD, "_func_1DD" }, + { 0x1DE, "_func_1DE" }, + { 0x1DF, "_func_1DF" }, + { 0x1E0, "_func_1E0" }, + { 0x1E1, "_func_1E1" }, + { 0x1E2, "_func_1E2" }, + { 0x1E3, "_func_1E3" }, + { 0x1E4, "_func_1E4" }, + { 0x1E5, "_func_1E5" }, + { 0x1E6, "_func_1E6" }, + { 0x1E7, "_func_1E7" }, + { 0x1E8, "_func_1E8" }, + { 0x1E9, "_func_1E9" }, + { 0x1EA, "_func_1EA" }, + { 0x1EB, "_func_1EB" }, + { 0x1EC, "_func_1EC" }, + { 0x1ED, "_func_1ED" }, + { 0x1EE, "_func_1EE" }, + { 0x1EF, "_func_1EF" }, + { 0x1F0, "_func_1F0" }, + { 0x1F1, "_func_1F1" }, + { 0x1F2, "_func_1F2" }, + { 0x1F3, "_func_1F3" }, + { 0x1F4, "_func_1F4" }, + { 0x1F5, "_func_1F5" }, + { 0x1F6, "_func_1F6" }, + { 0x1F7, "_func_1F7" }, + { 0x1F8, "_func_1F8" }, + { 0x1F9, "_func_1F9" }, + { 0x1FA, "_func_1FA" }, + { 0x1FB, "_func_1FB" }, + { 0x1FC, "_func_1FC" }, + { 0x1FD, "_func_1FD" }, + { 0x1FE, "_func_1FE" }, + { 0x1FF, "_func_1FF" }, + { 0x200, "_func_200" }, + { 0x201, "_func_201" }, + { 0x202, "_func_202" }, + { 0x203, "_func_203" }, + { 0x204, "_func_204" }, + { 0x205, "_func_205" }, + { 0x206, "_func_206" }, + { 0x207, "_func_207" }, + { 0x208, "_func_208" }, + { 0x209, "_func_209" }, + { 0x20A, "_func_20A" }, + { 0x20B, "_func_20B" }, + { 0x20C, "_func_20C" }, + { 0x20D, "_func_20D" }, + { 0x20E, "_func_20E" }, + { 0x20F, "_func_20F" }, + { 0x210, "_func_210" }, + { 0x211, "_func_211" }, + { 0x212, "_func_212" }, + { 0x213, "_func_213" }, + { 0x214, "_func_214" }, + { 0x215, "_func_215" }, + { 0x216, "_func_216" }, + { 0x217, "_func_217" }, + { 0x218, "_func_218" }, + { 0x219, "_func_219" }, + { 0x21A, "_func_21A" }, + { 0x21B, "_func_21B" }, + { 0x21C, "_func_21C" }, + { 0x21D, "_func_21D" }, + { 0x21E, "_func_21E" }, + { 0x21F, "_func_21F" }, + { 0x220, "_func_220" }, + { 0x221, "_func_221" }, + { 0x222, "_func_222" }, + { 0x223, "_func_223" }, + { 0x224, "_func_224" }, + { 0x225, "_func_225" }, + { 0x226, "_func_226" }, + { 0x227, "_func_227" }, + { 0x228, "_func_228" }, + { 0x229, "_func_229" }, + { 0x22A, "_func_22A" }, + { 0x22B, "_func_22B" }, + { 0x22C, "_func_22C" }, + { 0x22D, "_func_22D" }, + { 0x22E, "_func_22E" }, + { 0x22F, "_func_22F" }, + { 0x230, "_func_230" }, + { 0x231, "_func_231" }, + { 0x232, "_func_232" }, + { 0x233, "_func_233" }, + { 0x234, "_func_234" }, + { 0x235, "_func_235" }, + { 0x236, "_func_236" }, + { 0x237, "_func_237" }, + { 0x238, "_func_238" }, + { 0x239, "_func_239" }, + { 0x23A, "_func_23A" }, + { 0x23B, "_func_23B" }, + { 0x23C, "_func_23C" }, + { 0x23D, "_func_23D" }, + { 0x23E, "_func_23E" }, + { 0x23F, "_func_23F" }, + { 0x240, "_func_240" }, + { 0x241, "_func_241" }, + { 0x242, "_func_242" }, + { 0x243, "_func_243" }, + { 0x244, "_func_244" }, + { 0x245, "_func_245" }, + { 0x246, "_func_246" }, + { 0x247, "_func_247" }, + { 0x248, "_func_248" }, + { 0x249, "_func_249" }, + { 0x24A, "_func_24A" }, + { 0x24B, "_func_24B" }, + { 0x24C, "_func_24C" }, + { 0x24D, "_func_24D" }, + { 0x24E, "_func_24E" }, + { 0x24F, "_func_24F" }, + { 0x250, "_func_250" }, + { 0x251, "_func_251" }, + { 0x252, "_func_252" }, + { 0x253, "_func_253" }, + { 0x254, "_func_254" }, + { 0x255, "_func_255" }, + { 0x256, "_func_256" }, + { 0x257, "_func_257" }, + { 0x258, "_func_258" }, + { 0x259, "_func_259" }, + { 0x25A, "_func_25A" }, + { 0x25B, "_func_25B" }, + { 0x25C, "_func_25C" }, + { 0x25D, "_func_25D" }, + { 0x25E, "_func_25E" }, + { 0x25F, "_func_25F" }, + { 0x260, "_func_260" }, + { 0x261, "_func_261" }, + { 0x262, "_func_262" }, + { 0x263, "_func_263" }, + { 0x264, "_func_264" }, + { 0x265, "_func_265" }, + { 0x266, "_func_266" }, + { 0x267, "_func_267" }, + { 0x268, "_func_268" }, + { 0x269, "_func_269" }, + { 0x26A, "_func_26A" }, + { 0x26B, "_func_26B" }, + { 0x26C, "_func_26C" }, + { 0x26D, "_func_26D" }, + { 0x26E, "_func_26E" }, + { 0x26F, "_func_26F" }, + { 0x270, "_func_270" }, + { 0x271, "_func_271" }, + { 0x272, "_func_272" }, + { 0x273, "_func_273" }, + { 0x274, "_func_274" }, + { 0x275, "_func_275" }, + { 0x276, "_func_276" }, + { 0x277, "_func_277" }, + { 0x278, "_func_278" }, + { 0x279, "_func_279" }, + { 0x27A, "_func_27A" }, + { 0x27B, "_func_27B" }, + { 0x27C, "_func_27C" }, + { 0x27D, "_func_27D" }, + { 0x27E, "_func_27E" }, + { 0x27F, "_func_27F" }, + { 0x280, "_func_280" }, + { 0x281, "_func_281" }, + { 0x282, "_func_282" }, + { 0x283, "_func_283" }, + { 0x284, "_func_284" }, + { 0x285, "_func_285" }, + { 0x286, "_func_286" }, + { 0x287, "_func_287" }, + { 0x288, "_func_288" }, + { 0x289, "_func_289" }, + { 0x28A, "_func_28A" }, + { 0x28B, "_func_28B" }, + { 0x28C, "_func_28C" }, + { 0x28D, "_func_28D" }, + { 0x28E, "_func_28E" }, + { 0x28F, "_func_28F" }, + { 0x290, "_func_290" }, + { 0x291, "_func_291" }, + { 0x292, "_func_292" }, + { 0x293, "_func_293" }, + { 0x294, "_func_294" }, + { 0x295, "_func_295" }, + { 0x296, "_func_296" }, + { 0x297, "_func_297" }, + { 0x298, "_func_298" }, + { 0x299, "_func_299" }, + { 0x29A, "_func_29A" }, + { 0x29B, "_func_29B" }, + { 0x29C, "_func_29C" }, + { 0x29D, "_func_29D" }, + { 0x29E, "_func_29E" }, + { 0x29F, "_func_29F" }, + { 0x2A0, "_func_2A0" }, + { 0x2A1, "_func_2A1" }, + { 0x2A2, "_func_2A2" }, + { 0x2A3, "_func_2A3" }, + { 0x2A4, "_func_2A4" }, + { 0x2A5, "_func_2A5" }, + { 0x2A6, "_func_2A6" }, + { 0x2A7, "_func_2A7" }, + { 0x2A8, "_func_2A8" }, + { 0x2A9, "_func_2A9" }, + { 0x2AA, "_func_2AA" }, + { 0x2AB, "_func_2AB" }, + { 0x2AC, "_func_2AC" }, + { 0x2AD, "_func_2AD" }, + { 0x2AE, "_func_2AE" }, + { 0x2AF, "_func_2AF" }, + { 0x2B0, "_func_2B0" }, + { 0x2B1, "_func_2B1" }, + { 0x2B2, "_func_2B2" }, + { 0x2B3, "_func_2B3" }, + { 0x2B4, "_func_2B4" }, + { 0x2B5, "_func_2B5" }, + { 0x2B6, "_func_2B6" }, + { 0x2B7, "_func_2B7" }, + { 0x2B8, "_func_2B8" }, + { 0x2B9, "_func_2B9" }, + { 0x2BA, "_func_2BA" }, + { 0x2BB, "_func_2BB" }, + { 0x2BC, "_func_2BC" }, + { 0x2BD, "_func_2BD" }, + { 0x2BE, "_func_2BE" }, + { 0x2BF, "_func_2BF" }, + { 0x2C0, "_func_2C0" }, + { 0x2C1, "_func_2C1" }, + { 0x2C2, "_func_2C2" }, + { 0x2C3, "_func_2C3" }, + { 0x2C4, "_func_2C4" }, + { 0x2C5, "_func_2C5" }, + { 0x2C6, "_func_2C6" }, + { 0x2C7, "_func_2C7" }, + { 0x2C8, "_func_2C8" }, + { 0x2C9, "_func_2C9" }, + { 0x2CA, "_func_2CA" }, + { 0x2CB, "_func_2CB" }, + { 0x2CC, "_func_2CC" }, + { 0x2CD, "_func_2CD" }, + { 0x2CE, "_func_2CE" }, + { 0x2CF, "_func_2CF" }, + { 0x2D0, "_func_2D0" }, + { 0x2D1, "_func_2D1" }, + { 0x2D2, "_func_2D2" }, + { 0x2D3, "_func_2D3" }, + { 0x2D4, "_func_2D4" }, + { 0x2D5, "_func_2D5" }, + { 0x2D6, "_func_2D6" }, + { 0x2D7, "_func_2D7" }, + { 0x2D8, "_func_2D8" }, + { 0x2D9, "_func_2D9" }, + { 0x2DA, "_func_2DA" }, + { 0x2DB, "_func_2DB" }, + { 0x2DC, "_func_2DC" }, + { 0x2DD, "_func_2DD" }, + { 0x2DE, "_func_2DE" }, + { 0x2DF, "_func_2DF" }, + { 0x2E0, "_func_2E0" }, + { 0x2E1, "_func_2E1" }, + { 0x2E2, "_func_2E2" }, + { 0x2E3, "_func_2E3" }, + { 0x2E4, "_func_2E4" }, + { 0x2E5, "_func_2E5" }, + { 0x2E6, "_func_2E6" }, + { 0x2E7, "_func_2E7" }, + { 0x2E8, "_func_2E8" }, + { 0x2E9, "_func_2E9" }, + { 0x2EA, "_func_2EA" }, + { 0x2EB, "_func_2EB" }, + { 0x2EC, "_func_2EC" }, + { 0x2ED, "_func_2ED" }, + { 0x2EE, "_func_2EE" }, + { 0x2EF, "_func_2EF" }, + { 0x2F0, "_func_2F0" }, + { 0x2F1, "_func_2F1" }, + { 0x2F2, "_func_2F2" }, + { 0x2F3, "_func_2F3" }, + { 0x2F4, "_func_2F4" }, + { 0x2F5, "_func_2F5" }, + { 0x2F6, "_func_2F6" }, + { 0x2F7, "_func_2F7" }, + { 0x2F8, "_func_2F8" }, + { 0x2F9, "_func_2F9" }, + { 0x2FA, "_func_2FA" }, + { 0x2FB, "_func_2FB" }, + { 0x2FC, "_func_2FC" }, + { 0x2FD, "_func_2FD" }, + { 0x2FE, "_func_2FE" }, + { 0x2FF, "_func_2FF" }, + { 0x300, "_func_300" }, + { 0x301, "_func_301" }, + { 0x302, "_func_302" }, + { 0x303, "_func_303" }, + { 0x304, "_func_304" }, + { 0x305, "_func_305" }, + { 0x306, "_func_306" }, + { 0x307, "_func_307" }, + { 0x308, "_func_308" }, + { 0x309, "_func_309" }, + { 0x30A, "_func_30A" }, + { 0x30B, "_func_30B" }, + { 0x30C, "_func_30C" }, + { 0x30D, "_func_30D" }, + { 0x30E, "_func_30E" }, + { 0x30F, "_func_30F" }, + { 0x310, "_func_310" }, + { 0x311, "_func_311" }, + { 0x312, "_func_312" }, + { 0x313, "_func_313" }, + { 0x314, "_func_314" }, + { 0x315, "_func_315" }, + { 0x316, "_func_316" }, + { 0x317, "_func_317" }, + { 0x318, "_func_318" }, + { 0x319, "_func_319" }, + { 0x31A, "_func_31A" }, + { 0x31B, "_func_31B" }, + { 0x31C, "_func_31C" }, + { 0x31D, "_func_31D" }, + { 0x31E, "_func_31E" }, + { 0x31F, "_func_31F" }, + { 0x320, "_func_320" }, + { 0x321, "_func_321" }, + { 0x322, "_func_322" }, + { 0x323, "_func_323" }, + { 0x324, "_func_324" }, + { 0x325, "_func_325" }, + { 0x326, "_func_326" }, + { 0x327, "_func_327" }, +}}; + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/resolver.cpp b/src/iw7/iw7_meth.cpp similarity index 54% rename from src/iw7/xsk/resolver.cpp rename to src/iw7/iw7_meth.cpp index ba8776e1..87666fc8 100644 --- a/src/iw7/xsk/resolver.cpp +++ b/src/iw7/iw7_meth.cpp @@ -1,1269 +1,14 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" #include "iw7.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - namespace xsk::gsc::iw7 { -std::unordered_map opcode_map; -std::unordered_map function_map; -std::unordered_map method_map; -std::unordered_map token_map; -std::unordered_map opcode_map_rev; -std::unordered_map function_map_rev; -std::unordered_map method_map_rev; -std::unordered_map token_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_func_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - const auto itr = function_map.find(id); - - if (itr != function_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_meth_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - const auto itr = method_map.find(id); - - if (itr != method_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string& name) -> std::uint32_t -{ - if (name.starts_with("_id_")) - { - return static_cast(std::stoul(name.substr(4), nullptr, 16)); - } - - const auto itr = token_map_rev.find(name); - - if (itr != token_map_rev.end()) - { - return itr->second; - } - - return 0; -} - -auto resolver::token_name(std::uint32_t id) -> std::string -{ - const auto itr = token_map.find(id); - - if (itr != token_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - } - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - } - - return false; -} - -void resolver::add_function(const std::string& name, std::uint16_t id) -{ - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - throw error(utils::string::va("builtin function '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - function_map.insert({ id, *str }); - function_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - function_map.insert({ id, *ins.first }); - function_map_rev.insert({ *ins.first, id }); - } - } -} - -void resolver::add_method(const std::string& name, std::uint16_t id) -{ - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - throw error(utils::string::va("builtin method '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - method_map.insert({ id, *str }); - method_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - method_map.insert({ id, *ins.first }); - method_map_rev.insert({ *ins.first, 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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -const std::array, 153> opcode_list -{{ - { 0x17, "OP_SetNewLocalVariableFieldCached0" }, - { 0x18, "OP_EvalSelfFieldVariable" }, - { 0x19, "OP_Return" }, - { 0x1A, "OP_CallBuiltin0" }, - { 0x1B, "OP_CallBuiltin1" }, - { 0x1C, "OP_CallBuiltin2" }, - { 0x1D, "OP_CallBuiltin3" }, - { 0x1E, "OP_CallBuiltin4" }, - { 0x1F, "OP_CallBuiltin5" }, - { 0x20, "OP_CallBuiltin" }, - { 0x21, "OP_BoolNot" }, - { 0x22, "OP_ScriptFarMethodThreadCall" }, - { 0x23, "OP_JumpOnTrueExpr" }, - { 0x24, "OP_SetLevelFieldVariableField" }, - { 0x25, "OP_CastBool" }, - { 0x26, "OP_EvalNewLocalArrayRefCached0" }, - { 0x27, "OP_CallBuiltinPointer" }, - { 0x28, "OP_inequality" }, - { 0x29, "OP_GetThisthread" }, - { 0x2A, "OP_ClearFieldVariable" }, - { 0x2B, "OP_GetFloat" }, - { 0x2C, "OP_SafeCreateVariableFieldCached" }, - { 0x2D, "OP_ScriptFarFunctionCall2" }, - { 0x2E, "OP_ScriptFarFunctionCall" }, - { 0x2F, "OP_ScriptFarChildThreadCall" }, - { 0x30, "OP_ClearLocalVariableFieldCached0" }, - { 0x31, "OP_ClearLocalVariableFieldCached" }, - { 0x32, "OP_checkclearparams" }, - { 0x33, "OP_CastFieldObject" }, - { 0x34, "OP_End" }, - { 0x35, "OP_size" }, - { 0x36, "OP_EmptyArray" }, - { 0x37, "OP_bit_and" }, - { 0x38, "OP_less_equal" }, - { 0x39, "OP_voidCodepos" }, - { 0x3A, "OP_ScriptMethodThreadCallPointer" }, - { 0x3B, "OP_endswitch" }, - { 0x3C, "OP_ClearVariableField" }, - { 0x3D, "OP_divide" }, - { 0x3E, "OP_ScriptFarMethodChildThreadCall" }, - { 0x3F, "OP_GetUnsignedShort" }, - { 0x40, "OP_JumpOnTrue" }, - { 0x41, "OP_GetSelf" }, - { 0x42, "OP_ScriptFarThreadCall" }, - { 0x43, "OP_ScriptLocalThreadCall" }, - { 0x44, "OP_SetLocalVariableFieldCached0" }, - { 0x45, "OP_SetLocalVariableFieldCached" }, - { 0x46, "OP_plus" }, - { 0x47, "OP_BoolComplement" }, - { 0x48, "OP_ScriptMethodCallPointer" }, - { 0x49, "OP_inc" }, - { 0x4A, "OP_RemoveLocalVariables" }, - { 0x4B, "OP_JumpOnFalseExpr" }, - { 0x4C, "OP_switch" }, - { 0x4D, "OP_clearparams" }, - { 0x4E, "OP_EvalLocalVariableRefCached0" }, - { 0x4F, "OP_EvalLocalVariableRefCached" }, - { 0x50, "OP_ScriptLocalMethodCall" }, - { 0x51, "OP_EvalFieldVariable" }, - { 0x52, "OP_EvalFieldVariableRef" }, - { 0x53, "OP_GetString" }, - { 0x54, "OP_ScriptFunctionCallPointer" }, - { 0x55, "OP_EvalLevelFieldVariable" }, - { 0x56, "OP_GetVector" }, - { 0x57, "OP_endon" }, - { 0x58, "OP_greater_equal" }, - { 0x59, "OP_GetSelfObject" }, - { 0x5A, "OP_SetAnimFieldVariableField" }, - { 0x5B, "OP_SetVariableField" }, - { 0x5C, "OP_ScriptLocalFunctionCall2" }, - { 0x5D, "OP_ScriptLocalFunctionCall" }, - { 0x5E, "OP_EvalLocalArrayRefCached0" }, - { 0x5F, "OP_EvalLocalArrayRefCached" }, - { 0x60, "OP_GetFarFunction" }, - { 0x61, "OP_less" }, - { 0x62, "OP_GetGameRef" }, - { 0x63, "OP_waittillFrameEnd" }, - { 0x64, "OP_SafeSetVariableFieldCached0" }, - { 0x65, "OP_SafeSetVariableFieldCached" }, - { 0x66, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x67, "OP_GetLevel" }, - { 0x68, "OP_notify" }, - { 0x69, "OP_DecTop" }, - { 0x6A, "OP_shift_left" }, - { 0x6B, "OP_ScriptLocalMethodThreadCall" }, - { 0x6C, "OP_ScriptLocalMethodChildThreadCall" }, - { 0x6D, "OP_greater" }, - { 0x6E, "OP_EvalLocalVariableCached0" }, - { 0x6F, "OP_EvalLocalVariableCached1" }, - { 0x70, "OP_EvalLocalVariableCached2" }, - { 0x71, "OP_EvalLocalVariableCached3" }, - { 0x72, "OP_EvalLocalVariableCached4" }, - { 0x73, "OP_EvalLocalVariableCached5" }, - { 0x74, "OP_EvalLocalVariableCached" }, - { 0x75, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x76, "OP_jump" }, - { 0x77, "OP_ScriptThreadCallPointer" }, - { 0x78, "OP_GetZero" }, - { 0x79, "OP_wait" }, - { 0x7A, "OP_minus" }, - { 0x7B, "OP_SetSelfFieldVariableField" }, - { 0x7C, "OP_EvalNewLocalVariableRefCached0" }, - { 0x7D, "OP_multiply" }, - { 0x7E, "OP_CreateLocalVariable" }, - { 0x7F, "OP_ScriptLocalChildThreadCall" }, - { 0x80, "OP_GetInteger" }, - { 0x81, "OP_mod" }, - { 0x82, "OP_EvalAnimFieldVariableRef" }, - { 0x83, "OP_GetBuiltinFunction" }, - { 0x84, "OP_GetGame" }, - { 0x85, "OP_waittill" }, - { 0x86, "OP_dec" }, - { 0x87, "OP_EvalLocalVariableObjectCached" }, - { 0x88, "OP_PreScriptCall" }, - { 0x89, "OP_GetAnim" }, - { 0x8A, "OP_GetUndefined" }, - { 0x8B, "OP_EvalLevelFieldVariableRef" }, - { 0x8C, "OP_GetAnimObject" }, - { 0x8D, "OP_GetLevelObject" }, - { 0x8E, "OP_bit_ex_or" }, - { 0x8F, "OP_equality" }, - { 0x90, "OP_ClearArray" }, - { 0x91, "OP_jumpback" }, - { 0x92, "OP_GetAnimation" }, - { 0x93, "OP_EvalAnimFieldVariable" }, - { 0x94, "OP_GetAnimTree" }, - { 0x95, "OP_GetIString" }, - { 0x96, "OP_EvalArrayRef" }, - { 0x97, "OP_EvalSelfFieldVariableRef" }, - { 0x98, "OP_GetNegByte" }, - { 0x99, "OP_GetBuiltinMethod" }, - { 0x9A, "OP_CallBuiltinMethodPointer" }, - { 0x9B, "OP_EvalArray" }, - { 0x9C, "OP_vector" }, - { 0x9D, "OP_ScriptFarMethodCall" }, - { 0x9E, "OP_EvalLocalArrayCached" }, - { 0x9F, "OP_GetByte" }, - { 0xA0, "OP_ScriptChildThreadCallPointer" }, - { 0xA1, "OP_bit_or" }, - { 0xA2, "OP_AddArray" }, - { 0xA3, "OP_waittillmatch2" }, - { 0xA4, "OP_waittillmatch" }, - { 0xA5, "OP_GetLocalFunction" }, - { 0xA6, "OP_GetNegUnsignedShort" }, - { 0xA7, "OP_shift_right" }, - { 0xA8, "OP_CallBuiltinMethod0" }, - { 0xA9, "OP_CallBuiltinMethod1" }, - { 0xAA, "OP_CallBuiltinMethod2" }, - { 0xAB, "OP_CallBuiltinMethod3" }, - { 0xAC, "OP_CallBuiltinMethod4" }, - { 0xAD, "OP_CallBuiltinMethod5" }, - { 0xAE, "OP_CallBuiltinMethod" }, - { 0xAF, "OP_JumpOnFalse" }, -}}; - -const std::array, 807> function_list -{{ - { 0x001, "_func_001" }, - { 0x002, "_func_002" }, - { 0x003, "_func_003" }, - { 0x004, "_func_004" }, - { 0x005, "_func_005" }, - { 0x006, "_func_006" }, - { 0x007, "_func_007" }, - { 0x008, "_func_008" }, - { 0x009, "_func_009" }, - { 0x00A, "_func_00A" }, - { 0x00B, "_func_00B" }, - { 0x00C, "_func_00C" }, - { 0x00D, "_func_00D" }, - { 0x00E, "_func_00E" }, - { 0x00F, "_func_00F" }, - { 0x010, "_func_010" }, - { 0x011, "_func_011" }, - { 0x012, "_func_012" }, - { 0x013, "_func_013" }, - { 0x014, "_func_014" }, - { 0x015, "_func_015" }, - { 0x016, "_func_016" }, - { 0x017, "_func_017" }, - { 0x018, "_func_018" }, - { 0x019, "_func_019" }, - { 0x01A, "_func_01A" }, - { 0x01B, "_func_01B" }, - { 0x01C, "_func_01C" }, - { 0x01D, "_func_01D" }, - { 0x01E, "_func_01E" }, - { 0x01F, "_func_01F" }, - { 0x020, "_func_020" }, - { 0x021, "_func_021" }, - { 0x022, "_func_022" }, - { 0x023, "_func_023" }, - { 0x024, "_func_024" }, - { 0x025, "_func_025" }, - { 0x026, "_func_026" }, - { 0x027, "_func_027" }, - { 0x028, "_func_028" }, - { 0x029, "_func_029" }, - { 0x02A, "_func_02A" }, - { 0x02B, "_func_02B" }, - { 0x02C, "_func_02C" }, - { 0x02D, "_func_02D" }, - { 0x02E, "_func_02E" }, - { 0x02F, "_func_02F" }, - { 0x030, "_func_030" }, - { 0x031, "_func_031" }, - { 0x032, "_func_032" }, - { 0x033, "_func_033" }, - { 0x034, "_func_034" }, - { 0x035, "_func_035" }, - { 0x036, "_func_036" }, - { 0x037, "_func_037" }, - { 0x038, "_func_038" }, - { 0x039, "_func_039" }, - { 0x03A, "_func_03A" }, - { 0x03B, "_func_03B" }, - { 0x03C, "_func_03C" }, - { 0x03D, "_func_03D" }, - { 0x03E, "_func_03E" }, - { 0x03F, "_func_03F" }, - { 0x040, "_func_040" }, - { 0x041, "_func_041" }, - { 0x042, "_func_042" }, - { 0x043, "_func_043" }, - { 0x044, "_func_044" }, - { 0x045, "_func_045" }, - { 0x046, "_func_046" }, - { 0x047, "_func_047" }, - { 0x048, "_func_048" }, - { 0x049, "_func_049" }, - { 0x04A, "_func_04A" }, - { 0x04B, "_func_04B" }, - { 0x04C, "_func_04C" }, - { 0x04D, "_func_04D" }, - { 0x04E, "_func_04E" }, - { 0x04F, "_func_04F" }, - { 0x050, "_func_050" }, - { 0x051, "_func_051" }, - { 0x052, "_func_052" }, - { 0x053, "_func_053" }, - { 0x054, "_func_054" }, - { 0x055, "_func_055" }, - { 0x056, "_func_056" }, - { 0x057, "_func_057" }, - { 0x058, "_func_058" }, - { 0x059, "_func_059" }, - { 0x05A, "_func_05A" }, - { 0x05B, "_func_05B" }, - { 0x05C, "_func_05C" }, - { 0x05D, "_func_05D" }, - { 0x05E, "_func_05E" }, - { 0x05F, "_func_05F" }, - { 0x060, "_func_060" }, - { 0x061, "_func_061" }, - { 0x062, "_func_062" }, - { 0x063, "_func_063" }, - { 0x064, "_func_064" }, - { 0x065, "_func_065" }, - { 0x066, "_func_066" }, - { 0x067, "_func_067" }, - { 0x068, "_func_068" }, - { 0x069, "_func_069" }, - { 0x06A, "_func_06A" }, - { 0x06B, "_func_06B" }, - { 0x06C, "_func_06C" }, - { 0x06D, "_func_06D" }, - { 0x06E, "_func_06E" }, - { 0x06F, "_func_06F" }, - { 0x070, "_func_070" }, - { 0x071, "_func_071" }, - { 0x072, "_func_072" }, - { 0x073, "_func_073" }, - { 0x074, "_func_074" }, - { 0x075, "_func_075" }, - { 0x076, "_func_076" }, - { 0x077, "_func_077" }, - { 0x078, "_func_078" }, - { 0x079, "_func_079" }, - { 0x07A, "_func_07A" }, - { 0x07B, "_func_07B" }, - { 0x07C, "_func_07C" }, - { 0x07D, "_func_07D" }, - { 0x07E, "_func_07E" }, - { 0x07F, "_func_07F" }, - { 0x080, "_func_080" }, - { 0x081, "_func_081" }, - { 0x082, "_func_082" }, - { 0x083, "_func_083" }, - { 0x084, "_func_084" }, - { 0x085, "_func_085" }, - { 0x086, "_func_086" }, - { 0x087, "_func_087" }, - { 0x088, "_func_088" }, - { 0x089, "_func_089" }, - { 0x08A, "_func_08A" }, - { 0x08B, "_func_08B" }, - { 0x08C, "_func_08C" }, - { 0x08D, "_func_08D" }, - { 0x08E, "_func_08E" }, - { 0x08F, "_func_08F" }, - { 0x090, "_func_090" }, - { 0x091, "_func_091" }, - { 0x092, "_func_092" }, - { 0x093, "_func_093" }, - { 0x094, "_func_094" }, - { 0x095, "_func_095" }, - { 0x096, "_func_096" }, - { 0x097, "_func_097" }, - { 0x098, "_func_098" }, - { 0x099, "_func_099" }, - { 0x09A, "_func_09A" }, - { 0x09B, "_func_09B" }, - { 0x09C, "getfirstarraykey" }, - { 0x09D, "_func_09D" }, - { 0x09E, "_func_09E" }, - { 0x09F, "_func_09F" }, - { 0x0A0, "_func_0A0" }, - { 0x0A1, "_func_0A1" }, - { 0x0A2, "_func_0A2" }, - { 0x0A3, "_func_0A3" }, - { 0x0A4, "_func_0A4" }, - { 0x0A5, "_func_0A5" }, - { 0x0A6, "_func_0A6" }, - { 0x0A7, "_func_0A7" }, - { 0x0A8, "_func_0A8" }, - { 0x0A9, "_func_0A9" }, - { 0x0AA, "_func_0AA" }, - { 0x0AB, "_func_0AB" }, - { 0x0AC, "_func_0AC" }, - { 0x0AD, "_func_0AD" }, - { 0x0AE, "_func_0AE" }, - { 0x0AF, "_func_0AF" }, - { 0x0B0, "_func_0B0" }, - { 0x0B1, "_func_0B1" }, - { 0x0B2, "getnextarraykey" }, - { 0x0B3, "_func_0B3" }, - { 0x0B4, "_func_0B4" }, - { 0x0B5, "_func_0B5" }, - { 0x0B6, "_func_0B6" }, - { 0x0B7, "_func_0B7" }, - { 0x0B8, "_func_0B8" }, - { 0x0B9, "_func_0B9" }, - { 0x0BA, "_func_0BA" }, - { 0x0BB, "_func_0BB" }, - { 0x0BC, "_func_0BC" }, - { 0x0BD, "_func_0BD" }, - { 0x0BE, "_func_0BE" }, - { 0x0BF, "_func_0BF" }, - { 0x0C0, "_func_0C0" }, - { 0x0C1, "_func_0C1" }, - { 0x0C2, "_func_0C2" }, - { 0x0C3, "_func_0C3" }, - { 0x0C4, "_func_0C4" }, - { 0x0C5, "_func_0C5" }, - { 0x0C6, "_func_0C6" }, - { 0x0C7, "_func_0C7" }, - { 0x0C8, "_func_0C8" }, - { 0x0C9, "_func_0C9" }, - { 0x0CA, "_func_0CA" }, - { 0x0CB, "_func_0CB" }, - { 0x0CC, "_func_0CC" }, - { 0x0CD, "_func_0CD" }, - { 0x0CE, "_func_0CE" }, - { 0x0CF, "_func_0CF" }, - { 0x0D0, "_func_0D0" }, - { 0x0D1, "_func_0D1" }, - { 0x0D2, "_func_0D2" }, - { 0x0D3, "_func_0D3" }, - { 0x0D4, "_func_0D4" }, - { 0x0D5, "_func_0D5" }, - { 0x0D6, "_func_0D6" }, - { 0x0D7, "_func_0D7" }, - { 0x0D8, "_func_0D8" }, - { 0x0D9, "_func_0D9" }, - { 0x0DA, "_func_0DA" }, - { 0x0DB, "_func_0DB" }, - { 0x0DC, "_func_0DC" }, - { 0x0DD, "_func_0DD" }, - { 0x0DE, "_func_0DE" }, - { 0x0DF, "_func_0DF" }, - { 0x0E0, "_func_0E0" }, - { 0x0E1, "_func_0E1" }, - { 0x0E2, "_func_0E2" }, - { 0x0E3, "_func_0E3" }, - { 0x0E4, "_func_0E4" }, - { 0x0E5, "_func_0E5" }, - { 0x0E6, "_func_0E6" }, - { 0x0E7, "_func_0E7" }, - { 0x0E8, "_func_0E8" }, - { 0x0E9, "_func_0E9" }, - { 0x0EA, "_func_0EA" }, - { 0x0EB, "_func_0EB" }, - { 0x0EC, "_func_0EC" }, - { 0x0ED, "_func_0ED" }, - { 0x0EE, "_func_0EE" }, - { 0x0EF, "_func_0EF" }, - { 0x0F0, "_func_0F0" }, - { 0x0F1, "_func_0F1" }, - { 0x0F2, "_func_0F2" }, - { 0x0F3, "_func_0F3" }, - { 0x0F4, "_func_0F4" }, - { 0x0F5, "_func_0F5" }, - { 0x0F6, "_func_0F6" }, - { 0x0F7, "_func_0F7" }, - { 0x0F8, "_func_0F8" }, - { 0x0F9, "_func_0F9" }, - { 0x0FA, "_func_0FA" }, - { 0x0FB, "_func_0FB" }, - { 0x0FC, "_func_0FC" }, - { 0x0FD, "_func_0FD" }, - { 0x0FE, "_func_0FE" }, - { 0x0FF, "_func_0FF" }, - { 0x100, "_func_100" }, - { 0x101, "_func_101" }, - { 0x102, "_func_102" }, - { 0x103, "_func_103" }, - { 0x104, "isdefined" }, - { 0x105, "_func_105" }, - { 0x106, "_func_106" }, - { 0x107, "_func_107" }, - { 0x108, "_func_108" }, - { 0x109, "_func_109" }, - { 0x10A, "_func_10A" }, - { 0x10B, "_func_10B" }, - { 0x10C, "_func_10C" }, - { 0x10D, "_func_10D" }, - { 0x10E, "_func_10E" }, - { 0x10F, "_func_10F" }, - { 0x110, "_func_110" }, - { 0x111, "_func_111" }, - { 0x112, "_func_112" }, - { 0x113, "_func_113" }, - { 0x114, "_func_114" }, - { 0x115, "_func_115" }, - { 0x116, "_func_116" }, - { 0x117, "_func_117" }, - { 0x118, "_func_118" }, - { 0x119, "_func_119" }, - { 0x11A, "_func_11A" }, - { 0x11B, "_func_11B" }, - { 0x11C, "_func_11C" }, - { 0x11D, "_func_11D" }, - { 0x11E, "_func_11E" }, - { 0x11F, "_func_11F" }, - { 0x120, "_func_120" }, - { 0x121, "_func_121" }, - { 0x122, "_func_122" }, - { 0x123, "_func_123" }, - { 0x124, "_func_124" }, - { 0x125, "_func_125" }, - { 0x126, "_func_126" }, - { 0x127, "_func_127" }, - { 0x128, "_func_128" }, - { 0x129, "_func_129" }, - { 0x12A, "_func_12A" }, - { 0x12B, "_func_12B" }, - { 0x12C, "_func_12C" }, - { 0x12D, "_func_12D" }, - { 0x12E, "_func_12E" }, - { 0x12F, "_func_12F" }, - { 0x130, "_func_130" }, - { 0x131, "_func_131" }, - { 0x132, "_func_132" }, - { 0x133, "_func_133" }, - { 0x134, "_func_134" }, - { 0x135, "_func_135" }, - { 0x136, "_func_136" }, - { 0x137, "_func_137" }, - { 0x138, "_func_138" }, - { 0x139, "_func_139" }, - { 0x13A, "_func_13A" }, - { 0x13B, "_func_13B" }, - { 0x13C, "_func_13C" }, - { 0x13D, "_func_13D" }, - { 0x13E, "_func_13E" }, - { 0x13F, "_func_13F" }, - { 0x140, "_func_140" }, - { 0x141, "_func_141" }, - { 0x142, "_func_142" }, - { 0x143, "_func_143" }, - { 0x144, "_func_144" }, - { 0x145, "_func_145" }, - { 0x146, "_func_146" }, - { 0x147, "_func_147" }, - { 0x148, "_func_148" }, - { 0x149, "_func_149" }, - { 0x14A, "_func_14A" }, - { 0x14B, "_func_14B" }, - { 0x14C, "_func_14C" }, - { 0x14D, "_func_14D" }, - { 0x14E, "_func_14E" }, - { 0x14F, "_func_14F" }, - { 0x150, "_func_150" }, - { 0x151, "_func_151" }, - { 0x152, "_func_152" }, - { 0x153, "_func_153" }, - { 0x154, "_func_154" }, - { 0x155, "_func_155" }, - { 0x156, "_func_156" }, - { 0x157, "_func_157" }, - { 0x158, "_func_158" }, - { 0x159, "_func_159" }, - { 0x15A, "_func_15A" }, - { 0x15B, "_func_15B" }, - { 0x15C, "_func_15C" }, - { 0x15D, "_func_15D" }, - { 0x15E, "_func_15E" }, - { 0x15F, "_func_15F" }, - { 0x160, "_func_160" }, - { 0x161, "_func_161" }, - { 0x162, "_func_162" }, - { 0x163, "_func_163" }, - { 0x164, "_func_164" }, - { 0x165, "_func_165" }, - { 0x166, "_func_166" }, - { 0x167, "_func_167" }, - { 0x168, "_func_168" }, - { 0x169, "_func_169" }, - { 0x16A, "_func_16A" }, - { 0x16B, "_func_16B" }, - { 0x16C, "_func_16C" }, - { 0x16D, "_func_16D" }, - { 0x16E, "_func_16E" }, - { 0x16F, "_func_16F" }, - { 0x170, "_func_170" }, - { 0x171, "_func_171" }, - { 0x172, "_func_172" }, - { 0x173, "_func_173" }, - { 0x174, "_func_174" }, - { 0x175, "_func_175" }, - { 0x176, "_func_176" }, - { 0x177, "_func_177" }, - { 0x178, "_func_178" }, - { 0x179, "_func_179" }, - { 0x17A, "_func_17A" }, - { 0x17B, "_func_17B" }, - { 0x17C, "_func_17C" }, - { 0x17D, "_func_17D" }, - { 0x17E, "_func_17E" }, - { 0x17F, "_func_17F" }, - { 0x180, "_func_180" }, - { 0x181, "_func_181" }, - { 0x182, "_func_182" }, - { 0x183, "_func_183" }, - { 0x184, "_func_184" }, - { 0x185, "_func_185" }, - { 0x186, "_func_186" }, - { 0x187, "_func_187" }, - { 0x188, "_func_188" }, - { 0x189, "_func_189" }, - { 0x18A, "_func_18A" }, - { 0x18B, "_func_18B" }, - { 0x18C, "_func_18C" }, - { 0x18D, "_func_18D" }, - { 0x18E, "_func_18E" }, - { 0x18F, "_func_18F" }, - { 0x190, "_func_190" }, - { 0x191, "_func_191" }, - { 0x192, "_func_192" }, - { 0x193, "_func_193" }, - { 0x194, "_func_194" }, - { 0x195, "_func_195" }, - { 0x196, "_func_196" }, - { 0x197, "_func_197" }, - { 0x198, "_func_198" }, - { 0x199, "_func_199" }, - { 0x19A, "_func_19A" }, - { 0x19B, "_func_19B" }, - { 0x19C, "_func_19C" }, - { 0x19D, "_func_19D" }, - { 0x19E, "_func_19E" }, - { 0x19F, "_func_19F" }, - { 0x1A0, "_func_1A0" }, - { 0x1A1, "_func_1A1" }, - { 0x1A2, "_func_1A2" }, - { 0x1A3, "_func_1A3" }, - { 0x1A4, "_func_1A4" }, - { 0x1A5, "_func_1A5" }, - { 0x1A6, "_func_1A6" }, - { 0x1A7, "_func_1A7" }, - { 0x1A8, "_func_1A8" }, - { 0x1A9, "_func_1A9" }, - { 0x1AA, "_func_1AA" }, - { 0x1AB, "_func_1AB" }, - { 0x1AC, "_func_1AC" }, - { 0x1AD, "_func_1AD" }, - { 0x1AE, "_func_1AE" }, - { 0x1AF, "_func_1AF" }, - { 0x1B0, "_func_1B0" }, - { 0x1B1, "_func_1B1" }, - { 0x1B2, "_func_1B2" }, - { 0x1B3, "_func_1B3" }, - { 0x1B4, "_func_1B4" }, - { 0x1B5, "_func_1B5" }, - { 0x1B6, "_func_1B6" }, - { 0x1B7, "_func_1B7" }, - { 0x1B8, "_func_1B8" }, - { 0x1B9, "_func_1B9" }, - { 0x1BA, "_func_1BA" }, - { 0x1BB, "_func_1BB" }, - { 0x1BC, "_func_1BC" }, - { 0x1BD, "_func_1BD" }, - { 0x1BE, "_func_1BE" }, - { 0x1BF, "_func_1BF" }, - { 0x1C0, "_func_1C0" }, - { 0x1C1, "_func_1C1" }, - { 0x1C2, "_func_1C2" }, - { 0x1C3, "_func_1C3" }, - { 0x1C4, "_func_1C4" }, - { 0x1C5, "_func_1C5" }, - { 0x1C6, "_func_1C6" }, - { 0x1C7, "_func_1C7" }, - { 0x1C8, "_func_1C8" }, - { 0x1C9, "_func_1C9" }, - { 0x1CA, "_func_1CA" }, - { 0x1CB, "_func_1CB" }, - { 0x1CC, "_func_1CC" }, - { 0x1CD, "_func_1CD" }, - { 0x1CE, "_func_1CE" }, - { 0x1CF, "_func_1CF" }, - { 0x1D0, "_func_1D0" }, - { 0x1D1, "_func_1D1" }, - { 0x1D2, "_func_1D2" }, - { 0x1D3, "_func_1D3" }, - { 0x1D4, "_func_1D4" }, - { 0x1D5, "_func_1D5" }, - { 0x1D6, "_func_1D6" }, - { 0x1D7, "_func_1D7" }, - { 0x1D8, "_func_1D8" }, - { 0x1D9, "_func_1D9" }, - { 0x1DA, "_func_1DA" }, - { 0x1DB, "_func_1DB" }, - { 0x1DC, "_func_1DC" }, - { 0x1DD, "_func_1DD" }, - { 0x1DE, "_func_1DE" }, - { 0x1DF, "_func_1DF" }, - { 0x1E0, "_func_1E0" }, - { 0x1E1, "_func_1E1" }, - { 0x1E2, "_func_1E2" }, - { 0x1E3, "_func_1E3" }, - { 0x1E4, "_func_1E4" }, - { 0x1E5, "_func_1E5" }, - { 0x1E6, "_func_1E6" }, - { 0x1E7, "_func_1E7" }, - { 0x1E8, "_func_1E8" }, - { 0x1E9, "_func_1E9" }, - { 0x1EA, "_func_1EA" }, - { 0x1EB, "_func_1EB" }, - { 0x1EC, "_func_1EC" }, - { 0x1ED, "_func_1ED" }, - { 0x1EE, "_func_1EE" }, - { 0x1EF, "_func_1EF" }, - { 0x1F0, "_func_1F0" }, - { 0x1F1, "_func_1F1" }, - { 0x1F2, "_func_1F2" }, - { 0x1F3, "_func_1F3" }, - { 0x1F4, "_func_1F4" }, - { 0x1F5, "_func_1F5" }, - { 0x1F6, "_func_1F6" }, - { 0x1F7, "_func_1F7" }, - { 0x1F8, "_func_1F8" }, - { 0x1F9, "_func_1F9" }, - { 0x1FA, "_func_1FA" }, - { 0x1FB, "_func_1FB" }, - { 0x1FC, "_func_1FC" }, - { 0x1FD, "_func_1FD" }, - { 0x1FE, "_func_1FE" }, - { 0x1FF, "_func_1FF" }, - { 0x200, "_func_200" }, - { 0x201, "_func_201" }, - { 0x202, "_func_202" }, - { 0x203, "_func_203" }, - { 0x204, "_func_204" }, - { 0x205, "_func_205" }, - { 0x206, "_func_206" }, - { 0x207, "_func_207" }, - { 0x208, "_func_208" }, - { 0x209, "_func_209" }, - { 0x20A, "_func_20A" }, - { 0x20B, "_func_20B" }, - { 0x20C, "_func_20C" }, - { 0x20D, "_func_20D" }, - { 0x20E, "_func_20E" }, - { 0x20F, "_func_20F" }, - { 0x210, "_func_210" }, - { 0x211, "_func_211" }, - { 0x212, "_func_212" }, - { 0x213, "_func_213" }, - { 0x214, "_func_214" }, - { 0x215, "_func_215" }, - { 0x216, "_func_216" }, - { 0x217, "_func_217" }, - { 0x218, "_func_218" }, - { 0x219, "_func_219" }, - { 0x21A, "_func_21A" }, - { 0x21B, "_func_21B" }, - { 0x21C, "_func_21C" }, - { 0x21D, "_func_21D" }, - { 0x21E, "_func_21E" }, - { 0x21F, "_func_21F" }, - { 0x220, "_func_220" }, - { 0x221, "_func_221" }, - { 0x222, "_func_222" }, - { 0x223, "_func_223" }, - { 0x224, "_func_224" }, - { 0x225, "_func_225" }, - { 0x226, "_func_226" }, - { 0x227, "_func_227" }, - { 0x228, "_func_228" }, - { 0x229, "_func_229" }, - { 0x22A, "_func_22A" }, - { 0x22B, "_func_22B" }, - { 0x22C, "_func_22C" }, - { 0x22D, "_func_22D" }, - { 0x22E, "_func_22E" }, - { 0x22F, "_func_22F" }, - { 0x230, "_func_230" }, - { 0x231, "_func_231" }, - { 0x232, "_func_232" }, - { 0x233, "_func_233" }, - { 0x234, "_func_234" }, - { 0x235, "_func_235" }, - { 0x236, "_func_236" }, - { 0x237, "_func_237" }, - { 0x238, "_func_238" }, - { 0x239, "_func_239" }, - { 0x23A, "_func_23A" }, - { 0x23B, "_func_23B" }, - { 0x23C, "_func_23C" }, - { 0x23D, "_func_23D" }, - { 0x23E, "_func_23E" }, - { 0x23F, "_func_23F" }, - { 0x240, "_func_240" }, - { 0x241, "_func_241" }, - { 0x242, "_func_242" }, - { 0x243, "_func_243" }, - { 0x244, "_func_244" }, - { 0x245, "_func_245" }, - { 0x246, "_func_246" }, - { 0x247, "_func_247" }, - { 0x248, "_func_248" }, - { 0x249, "_func_249" }, - { 0x24A, "_func_24A" }, - { 0x24B, "_func_24B" }, - { 0x24C, "_func_24C" }, - { 0x24D, "_func_24D" }, - { 0x24E, "_func_24E" }, - { 0x24F, "_func_24F" }, - { 0x250, "_func_250" }, - { 0x251, "_func_251" }, - { 0x252, "_func_252" }, - { 0x253, "_func_253" }, - { 0x254, "_func_254" }, - { 0x255, "_func_255" }, - { 0x256, "_func_256" }, - { 0x257, "_func_257" }, - { 0x258, "_func_258" }, - { 0x259, "_func_259" }, - { 0x25A, "_func_25A" }, - { 0x25B, "_func_25B" }, - { 0x25C, "_func_25C" }, - { 0x25D, "_func_25D" }, - { 0x25E, "_func_25E" }, - { 0x25F, "_func_25F" }, - { 0x260, "_func_260" }, - { 0x261, "_func_261" }, - { 0x262, "_func_262" }, - { 0x263, "_func_263" }, - { 0x264, "_func_264" }, - { 0x265, "_func_265" }, - { 0x266, "_func_266" }, - { 0x267, "_func_267" }, - { 0x268, "_func_268" }, - { 0x269, "_func_269" }, - { 0x26A, "_func_26A" }, - { 0x26B, "_func_26B" }, - { 0x26C, "_func_26C" }, - { 0x26D, "_func_26D" }, - { 0x26E, "_func_26E" }, - { 0x26F, "_func_26F" }, - { 0x270, "_func_270" }, - { 0x271, "_func_271" }, - { 0x272, "_func_272" }, - { 0x273, "_func_273" }, - { 0x274, "_func_274" }, - { 0x275, "_func_275" }, - { 0x276, "_func_276" }, - { 0x277, "_func_277" }, - { 0x278, "_func_278" }, - { 0x279, "_func_279" }, - { 0x27A, "_func_27A" }, - { 0x27B, "_func_27B" }, - { 0x27C, "_func_27C" }, - { 0x27D, "_func_27D" }, - { 0x27E, "_func_27E" }, - { 0x27F, "_func_27F" }, - { 0x280, "_func_280" }, - { 0x281, "_func_281" }, - { 0x282, "_func_282" }, - { 0x283, "_func_283" }, - { 0x284, "_func_284" }, - { 0x285, "_func_285" }, - { 0x286, "_func_286" }, - { 0x287, "_func_287" }, - { 0x288, "_func_288" }, - { 0x289, "_func_289" }, - { 0x28A, "_func_28A" }, - { 0x28B, "_func_28B" }, - { 0x28C, "_func_28C" }, - { 0x28D, "_func_28D" }, - { 0x28E, "_func_28E" }, - { 0x28F, "_func_28F" }, - { 0x290, "_func_290" }, - { 0x291, "_func_291" }, - { 0x292, "_func_292" }, - { 0x293, "_func_293" }, - { 0x294, "_func_294" }, - { 0x295, "_func_295" }, - { 0x296, "_func_296" }, - { 0x297, "_func_297" }, - { 0x298, "_func_298" }, - { 0x299, "_func_299" }, - { 0x29A, "_func_29A" }, - { 0x29B, "_func_29B" }, - { 0x29C, "_func_29C" }, - { 0x29D, "_func_29D" }, - { 0x29E, "_func_29E" }, - { 0x29F, "_func_29F" }, - { 0x2A0, "_func_2A0" }, - { 0x2A1, "_func_2A1" }, - { 0x2A2, "_func_2A2" }, - { 0x2A3, "_func_2A3" }, - { 0x2A4, "_func_2A4" }, - { 0x2A5, "_func_2A5" }, - { 0x2A6, "_func_2A6" }, - { 0x2A7, "_func_2A7" }, - { 0x2A8, "_func_2A8" }, - { 0x2A9, "_func_2A9" }, - { 0x2AA, "_func_2AA" }, - { 0x2AB, "_func_2AB" }, - { 0x2AC, "_func_2AC" }, - { 0x2AD, "_func_2AD" }, - { 0x2AE, "_func_2AE" }, - { 0x2AF, "_func_2AF" }, - { 0x2B0, "_func_2B0" }, - { 0x2B1, "_func_2B1" }, - { 0x2B2, "_func_2B2" }, - { 0x2B3, "_func_2B3" }, - { 0x2B4, "_func_2B4" }, - { 0x2B5, "_func_2B5" }, - { 0x2B6, "_func_2B6" }, - { 0x2B7, "_func_2B7" }, - { 0x2B8, "_func_2B8" }, - { 0x2B9, "_func_2B9" }, - { 0x2BA, "_func_2BA" }, - { 0x2BB, "_func_2BB" }, - { 0x2BC, "_func_2BC" }, - { 0x2BD, "_func_2BD" }, - { 0x2BE, "_func_2BE" }, - { 0x2BF, "_func_2BF" }, - { 0x2C0, "_func_2C0" }, - { 0x2C1, "_func_2C1" }, - { 0x2C2, "_func_2C2" }, - { 0x2C3, "_func_2C3" }, - { 0x2C4, "_func_2C4" }, - { 0x2C5, "_func_2C5" }, - { 0x2C6, "_func_2C6" }, - { 0x2C7, "_func_2C7" }, - { 0x2C8, "_func_2C8" }, - { 0x2C9, "_func_2C9" }, - { 0x2CA, "_func_2CA" }, - { 0x2CB, "_func_2CB" }, - { 0x2CC, "_func_2CC" }, - { 0x2CD, "_func_2CD" }, - { 0x2CE, "_func_2CE" }, - { 0x2CF, "_func_2CF" }, - { 0x2D0, "_func_2D0" }, - { 0x2D1, "_func_2D1" }, - { 0x2D2, "_func_2D2" }, - { 0x2D3, "_func_2D3" }, - { 0x2D4, "_func_2D4" }, - { 0x2D5, "_func_2D5" }, - { 0x2D6, "_func_2D6" }, - { 0x2D7, "_func_2D7" }, - { 0x2D8, "_func_2D8" }, - { 0x2D9, "_func_2D9" }, - { 0x2DA, "_func_2DA" }, - { 0x2DB, "_func_2DB" }, - { 0x2DC, "_func_2DC" }, - { 0x2DD, "_func_2DD" }, - { 0x2DE, "_func_2DE" }, - { 0x2DF, "_func_2DF" }, - { 0x2E0, "_func_2E0" }, - { 0x2E1, "_func_2E1" }, - { 0x2E2, "_func_2E2" }, - { 0x2E3, "_func_2E3" }, - { 0x2E4, "_func_2E4" }, - { 0x2E5, "_func_2E5" }, - { 0x2E6, "_func_2E6" }, - { 0x2E7, "_func_2E7" }, - { 0x2E8, "_func_2E8" }, - { 0x2E9, "_func_2E9" }, - { 0x2EA, "_func_2EA" }, - { 0x2EB, "_func_2EB" }, - { 0x2EC, "_func_2EC" }, - { 0x2ED, "_func_2ED" }, - { 0x2EE, "_func_2EE" }, - { 0x2EF, "_func_2EF" }, - { 0x2F0, "_func_2F0" }, - { 0x2F1, "_func_2F1" }, - { 0x2F2, "_func_2F2" }, - { 0x2F3, "_func_2F3" }, - { 0x2F4, "_func_2F4" }, - { 0x2F5, "_func_2F5" }, - { 0x2F6, "_func_2F6" }, - { 0x2F7, "_func_2F7" }, - { 0x2F8, "_func_2F8" }, - { 0x2F9, "_func_2F9" }, - { 0x2FA, "_func_2FA" }, - { 0x2FB, "_func_2FB" }, - { 0x2FC, "_func_2FC" }, - { 0x2FD, "_func_2FD" }, - { 0x2FE, "_func_2FE" }, - { 0x2FF, "_func_2FF" }, - { 0x300, "_func_300" }, - { 0x301, "_func_301" }, - { 0x302, "_func_302" }, - { 0x303, "_func_303" }, - { 0x304, "_func_304" }, - { 0x305, "_func_305" }, - { 0x306, "_func_306" }, - { 0x307, "_func_307" }, - { 0x308, "_func_308" }, - { 0x309, "_func_309" }, - { 0x30A, "_func_30A" }, - { 0x30B, "_func_30B" }, - { 0x30C, "_func_30C" }, - { 0x30D, "_func_30D" }, - { 0x30E, "_func_30E" }, - { 0x30F, "_func_30F" }, - { 0x310, "_func_310" }, - { 0x311, "_func_311" }, - { 0x312, "_func_312" }, - { 0x313, "_func_313" }, - { 0x314, "_func_314" }, - { 0x315, "_func_315" }, - { 0x316, "_func_316" }, - { 0x317, "_func_317" }, - { 0x318, "_func_318" }, - { 0x319, "_func_319" }, - { 0x31A, "_func_31A" }, - { 0x31B, "_func_31B" }, - { 0x31C, "_func_31C" }, - { 0x31D, "_func_31D" }, - { 0x31E, "_func_31E" }, - { 0x31F, "_func_31F" }, - { 0x320, "_func_320" }, - { 0x321, "_func_321" }, - { 0x322, "_func_322" }, - { 0x323, "_func_323" }, - { 0x324, "_func_324" }, - { 0x325, "_func_325" }, - { 0x326, "_func_326" }, - { 0x327, "_func_327" }, -}}; - -const std::array, 1500> method_list +extern std::array, meth_count> const meth_list {{ { 0x8000, "_meth_8000" }, { 0x8001, "_meth_8001" }, @@ -2767,62 +1512,4 @@ const std::array, 1500> method_list { 0x85DB, "_meth_85DB" }, }}; -const std::array, 5> token_list -{{ - { 0x0000, "" }, - { 0x0001, "pl#" }, - { 0x0002, "-" }, - { 0x0003, "radius`" }, - { 0x0004, "note:" }, -}}; - -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()); - function_map.reserve(function_list.size()); - function_map_rev.reserve(function_list.size()); - method_map.reserve(method_list.size()); - method_map_rev.reserve(method_list.size()); - token_map.reserve(token_list.size()); - token_map_rev.reserve(token_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 : function_list) - { - function_map.insert({ entry.first, entry.second }); - function_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : method_list) - { - method_map.insert({ entry.first, entry.second }); - method_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : token_list) - { - token_map.insert({ entry.first, entry.second }); - token_map_rev.insert({ entry.second, entry.first }); - } - } -}; - -__init__ _; - } // namespace xsk::gsc::iw7 - -#ifdef _MSC_VER -#pragma warning(pop) -#endif diff --git a/src/iw7/iw7_token.cpp b/src/iw7/iw7_token.cpp new file mode 100644 index 00000000..82560ab0 --- /dev/null +++ b/src/iw7/iw7_token.cpp @@ -0,0 +1,20 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw7.hpp" + +namespace xsk::gsc::iw7 +{ + +extern std::array, token_count> const token_list +{{ + { 0x0000, "" }, + { 0x0001, "pl#" }, + { 0x0002, "-" }, + { 0x0003, "radius`" }, + { 0x0004, "note:" }, +}}; + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/stdafx.cpp b/src/iw7/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/iw7/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/iw7/xsk/assembler.cpp b/src/iw7/xsk/assembler.cpp deleted file mode 100644 index 1a2051cd..00000000 --- a/src/iw7/xsk/assembler.cpp +++ /dev/null @@ -1,554 +0,0 @@ -// 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 "iw7.hpp" - -namespace xsk::gsc::iw7 -{ - -auto assembler::output_script() -> std::vector -{ - std::vector script; - - if (script_ == nullptr) return script; - - script.resize(script_->pos()); - std::memcpy(script.data(), script_->buffer().data(), script.size()); - - return script; -} - -auto assembler::output_stack() -> std::vector -{ - std::vector stack; - - if (stack_ == nullptr) return stack; - - stack.resize(stack_->pos()); - std::memcpy(stack.data(), stack_->buffer().data(), stack.size()); - - return stack; -} - -void assembler::assemble(const std::string& file, std::vector& data) -{ - std::vector assembly = utils::string::clean_buffer_lines(data); - std::vector functions; - function::ptr func = nullptr; - std::uint32_t index = 1; - std::uint16_t switchnum = 0; - - for (auto& line : assembly) - { - if (line == "" || line.substr(0, 2) == "//") - { - continue; - } - else if (line.substr(0, 4) == "sub_") - { - func = std::make_unique(); - func->index = index; - func->name = line.substr(4); - } - else if (line.substr(0, 4) == "end_") - { - if (func != nullptr) - { - func->size = index - func->index; - functions.push_back(std::move(func)); - } - } - else if (line.substr(0, 4) == "loc_") - { - func->labels[index] = line; - } - else - { - auto opdata = utils::string::parse_code(line); - - if (switchnum) - { - if (opdata[0] == "case" || opdata[0] == "default") - { - for (auto& entry : opdata) - { - func->instructions.back()->data.push_back(entry); - } - switchnum--; - continue; - } - - throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); - } - else - { - auto inst = std::make_unique(); - inst->index = index; - inst->opcode = resolver::opcode_id(opdata[0]); - inst->size = opcode_size(inst->opcode); - opdata.erase(opdata.begin()); - inst->data = std::move(opdata); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = inst->data[0].substr(4); - break; - case opcode::OP_endswitch: - switchnum = static_cast(std::stoi(inst->data[0])); - inst->size += 7 * switchnum; - break; - default: - break; - } - - index += inst->size; - func->instructions.push_back(std::move(inst)); - } - } - } - - assemble(file, functions); -} - -void assembler::assemble(const std::string& file, std::vector& funcs) -{ - script_ = std::make_unique(0x100000); - stack_ = std::make_unique(0x100000); - filename_ = file; - functions_ = std::move(funcs); - - script_->write(static_cast(opcode::OP_End)); - - for (const auto& func : functions_) - { - assemble_function(func); - } -} - -void assembler::assemble_function(const function::ptr& func) -{ - labels_ = func->labels; - - func->id = resolver::token_id(func->name); - - stack_->write(func->size); - stack_->write(func->id); - - if (func->id == 0) - { - stack_->write_c_string(func->name); - } - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->write(std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->write(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - 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(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_GetAnimation: - script_->write(0); - script_->write(0); - stack_->write_c_string(inst->data[0]); - stack_->write_c_string(inst->data[1]); - break; - case opcode::OP_GetAnimTree: - script_->write(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_waittillmatch: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - assemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - assemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - assemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - assemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - assemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - assemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - assemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - assemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - assemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - assemble_jump(inst, false, true); - break; - case opcode::OP_jump: - assemble_jump(inst, false, false); - break; - case opcode::OP_switch: - assemble_switch(inst); - break; - case opcode::OP_endswitch: - assemble_end_switch(inst); - break; - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } - - const auto id = method ? resolver::method_id(inst->data[0]) : resolver::function_id(inst->data[0]); - - script_->write(id); -} - -void assembler::assemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto addr = resolve_function(inst->data[0]); - const auto offset = static_cast(addr - inst->index - 1); - - assemble_offset(offset); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } -} - -void assembler::assemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->write(0); - script_->write(0); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[2]))); - } - - const auto file_id = resolver::token_id(inst->data[0]); - const auto func_id = resolver::token_id(inst->data[1]); - - stack_->write(file_id); - if (file_id == 0) stack_->write_c_string(inst->data[0]); - stack_->write(func_id); - if (func_id == 0) stack_->write_c_string(inst->data[1]); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const auto addr = resolve_label(inst->data[0]); - - script_->write(addr - inst->index - 4); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - - script_->write(static_cast(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); - stack_->write_c_string(inst->data[1 + (3 * i) + 1]); - } - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 2]); - - assemble_offset(addr - index); - - index += 3; - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write(0); - stack_->write_c_string("\x01"); - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 1]); - - assemble_offset(addr - index); - - index += 3; - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::assemble_field_variable(const instruction::ptr& inst) -{ - auto id = resolver::token_id(inst->data[0]); - - if (id == 0) id = 0xFFFFFFFF; - - script_->write(id); - - if (id > max_string_id) - { - stack_->write(0); - stack_->write_c_string(inst->data[0]); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - const auto addr = resolve_label(inst->data[0]); - - if (expr) - { - script_->write(static_cast(addr - inst->index - 3)); - } - else if (back) - { - script_->write(static_cast((inst->index + 3) - addr)); - } - else - { - script_->write(static_cast(addr - inst->index - 5)); - } -} - -void assembler::assemble_offset(std::int32_t offset) -{ - std::array bytes = {}; - - offset = (offset << 9) >> 8; - - *reinterpret_cast(bytes.data()) = offset; - - script_->write(bytes[0]); - script_->write(bytes[1]); - script_->write(bytes[2]); -} - -auto assembler::resolve_function(const std::string& name) -> std::int32_t -{ - for (const auto& entry : functions_) - { - if (entry->name == name) - { - return entry->index; - } - } - - throw asm_error("couldn't resolve local function address of '" + name + "'!"); -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/assembler.hpp b/src/iw7/xsk/assembler.hpp deleted file mode 100644 index fe10317a..00000000 --- a/src/iw7/xsk/assembler.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::iw7 -{ - -class assembler : public gsc::assembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output_script() -> std::vector; - auto output_stack() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, std::vector& funcs); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void assemble_local_call(const instruction::ptr& inst, bool thread); - void assemble_far_call(const instruction::ptr& inst, bool thread); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void assemble_field_variable(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst, bool expr, bool back); - void assemble_offset(std::int32_t offset); - auto resolve_function(const std::string& name) -> std::int32_t; - auto resolve_label(const std::string& name) -> std::int32_t; -}; - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/compiler.cpp b/src/iw7/xsk/compiler.cpp deleted file mode 100644 index a4a1dd2a..00000000 --- a/src/iw7/xsk/compiler.cpp +++ /dev/null @@ -1,2961 +0,0 @@ -// 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 "iw7.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -namespace xsk::gsc::iw7 -{ - -auto compiler::output() -> std::vector -{ - return std::move(assembly_); -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "an unknown error ocurred while parsing gsc file"); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_.clear(); - includes_.clear(); - animtrees_.clear(); - constants_.clear(); - local_functions_.clear(); - index_ = 1; - 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& inc : includes_) - { - if (inc.name == path) - { - throw comp_error(include->loc(), "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(), "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 developer block comment"); - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) -{ - const auto itr = constants_.find(constant->name->value); - - if (itr != constants_.end()) - throw comp_error(constant->loc(), "duplicated constant '" + constant->name->value + "'"); - - 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; - - auto blk = std::make_unique(); - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - break_blks_.clear(); - continue_blks_.clear(); - - process_thread(thread, blk); - - emit_expr_parameters(thread->params, blk); - emit_stmt_list(thread->stmt, blk, true); - emit_opcode(opcode::OP_End); - - function_->size = index_ - function_->index; - assembly_.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list, blk, last); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev, blk, last); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend, blk); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if, blk, last); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse, blk, last); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case, blk); - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default, blk); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return, blk); - break; - case ast::kind::stmt_breakpoint: - emit_stmt_breakpoint(stmt.as_breakpoint, blk); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin, blk); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end, blk); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last) -{ - for (const auto& entry : stmt->list) - { - bool last_ = (&entry == &stmt->list.back() && last) ? true : false; - emit_stmt(entry, blk, last_); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last) -{ - emit_stmt_list(stmt->list, blk, last); -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - 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, const block::ptr& blk) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, blk, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, blk, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_endon); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } - - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->time, blk); - emit_opcode(opcode::OP_wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittill); - - for (const auto& entry : stmt->args->list) - { - variable_create(entry.as_identifier, blk); - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(entry.as_identifier, blk)); - } - - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - emit_expr_arguments(stmt->args, blk); - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_waittillmatch2); - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waittillFrameEnd); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - blk->transfer(stmt->blk); - - emit_stmt(stmt->stmt, stmt->blk, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last) -{ - std::vector childs; - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - blk->transfer(stmt->blk_if); - - emit_stmt(stmt->stmt_if, stmt->blk_if, last); - - emit_remove_local_vars(stmt->blk_if); - - if (stmt->blk_if->abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - - last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - - blk->transfer(stmt->blk_else); - - emit_stmt(stmt->stmt_else, stmt->blk_else, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk_else); - - if (stmt->blk_else->abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - - insert_label(end_loc); - - blk->init_from_child(childs); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_stmt(stmt->init, blk, false); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->blk_iter); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - can_break_ = true; - can_continue_ = true; - - emit_stmt(stmt->stmt, stmt->blk, false); - - if (stmt->blk->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->blk.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->blk_iter->init_from_child(continue_blks_); - - emit_stmt(stmt->iter, stmt->blk_iter, false); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_expr(stmt->array_expr, blk); - emit_expr_variable_ref(stmt->array, blk, true); - emit_expr_variable(stmt->array, blk); - emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); - emit_expr_variable_ref(stmt->key_expr, blk, true); - - blk->transfer(stmt->ctx); - stmt->ctx->loc_break = break_loc; - stmt->ctx->loc_continue = continue_loc; - - emit_create_local_vars(stmt->ctx); - - blk->local_vars_create_count = stmt->ctx->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->ctx_post); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr, blk); - emit_opcode(opcode::OP_CallBuiltin1, "isdefined"); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr, stmt->ctx); - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->array.as_identifier, stmt->ctx)); - emit_expr_variable_ref(stmt->value_expr, stmt->ctx, true); - emit_stmt(stmt->stmt, stmt->ctx, false); - - if (stmt->ctx->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->ctx.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->ctx_post->init_from_child(continue_blks_); - - emit_expr_variable(stmt->key_expr, stmt->ctx_post); - emit_expr_variable(stmt->array, stmt->ctx_post); - emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); - emit_expr_variable_ref(stmt->key_expr, stmt->ctx_post, true); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - emit_expr_clear_local(stmt->array.as_identifier, blk); - if (!stmt->use_key) emit_expr_clear_local(stmt->key_expr.as_identifier, blk); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_break = can_break_; - break_blks_.clear(); - can_break_ = false; - - auto jmptable_loc = create_label(); - auto break_loc = create_label(); - - emit_expr(stmt->test, blk); - 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; - block* default_ctx = nullptr; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - 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"); - } - - blk->transfer(case_->blk); - case_->blk->loc_break = break_loc; - emit_stmt_list(case_->stmt, case_->blk, false); - if (case_->stmt->list.size() > 0) - emit_remove_local_vars(case_->blk); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - - has_default = true; - default_ctx = entry.as_default->blk.get(); - - blk->transfer(entry.as_default->blk); - entry.as_default->blk->loc_break = break_loc; - emit_stmt_list(entry.as_default->stmt, entry.as_default->blk, false); - if (entry.as_default->stmt->list.size() > 0) - emit_remove_local_vars(entry.as_default->blk); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - } - blk->init_from_child(break_blks_); - } - - insert_label(jmptable_loc); - - emit_opcode(opcode::OP_endswitch, data); - - auto offset = static_cast(7 * stmt->stmt->list.size()); - function_->instructions.back()->size += offset; - index_ += offset; - - insert_label(break_loc); - - can_break_ = old_break; - break_blks_ = old_breaks; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) -{ - if (!can_break_ || blk->abort != abort_t::abort_none || blk->loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - break_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_break; - emit_opcode(opcode::OP_jump, blk->loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) -{ - if (!can_continue_ || blk->abort != abort_t::abort_none || blk->loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - continue_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_continue; - emit_opcode(opcode::OP_jump, blk->loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - blk->abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr, blk); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child, blk); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate, blk); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference, blk); - break; - case ast::kind::expr_add_array: - emit_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_thisthread: - emit_opcode(opcode::OP_GetThisthread); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - 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, blk); - 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, const block::ptr& blk) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue, blk); - } - else if (expr->lvalue == ast::kind::expr_tuple) - { - emit_expr(expr->rvalue, blk); - emit_expr_tuple(expr->lvalue.as_tuple, blk); - } - else - { - emit_expr(expr->rvalue, blk); - emit_expr_variable_ref(expr->lvalue, blk, true); - } - - return; - } - - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - 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_mod); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_ex_or); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, blk, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key, blk); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, blk, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj, blk); - 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, blk, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk) -{ - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); - else - emit_opcode(opcode::OP_ClearLocalVariableFieldCached, variable_access_index(expr, blk)); -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_inc); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_dec); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr, blk); - emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr, blk); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_equality); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_inequality); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_less); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_greater); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_less_equal); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_greater_equal); - 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_ex_or); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_mod); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt && mode_ == gsc::build::prod) - { - const auto& name = expr->name->value; - if (name == "assert" || name == "assertex" || name == "assertmsg") return; - } - - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal && expr->args->list.size() > 0) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptLocalFunctionCall, expr->name->value); - else - emit_opcode(opcode::OP_ScriptLocalFunctionCall2, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptFarFunctionCall, { expr->path->value, expr->name->value }); - else - emit_opcode(opcode::OP_ScriptFarFunctionCall2, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltin0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltin1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltin2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltin3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltin4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltin5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltin, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptLocalMethodCall, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFarMethodCall, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltinMethod0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltinMethod1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltinMethod2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltinMethod3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltinMethod4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltinMethod5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltinMethod, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_EmptyArray); - - for (const auto& arg : expr->args->list) - { - emit_expr(arg, blk); - emit_opcode(opcode::OP_AddArray); - } -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) -{ - for (const auto& entry : expr->list) - { - variable_initialize(entry, blk); - emit_opcode(opcode::OP_SafeCreateVariableFieldCached, variable_create_index(entry, blk)); - } - - emit_opcode(opcode::OP_checkclearparams); -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry, blk); - } -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) -{ - bool method = false; - auto type = resolve_reference_type(expr, method); - - switch (type) - { - case ast::call::type::local: - emit_opcode(opcode::OP_GetLocalFunction, expr->name->value); - break; - case ast::call::type::far: - emit_opcode(opcode::OP_GetFarFunction, { expr->path->value, expr->name->value }); - break; - case ast::call::type::builtin: - if (method) - emit_opcode(opcode::OP_GetBuiltinMethod, expr->name->value); - else - emit_opcode(opcode::OP_GetBuiltinFunction, expr->name->value); - break; - } -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_size); -} - -void compiler::emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - emit_expr_variable_ref(expr->temp, blk, true); - - auto index = 0; - - for (const auto& entry : expr->list) - { - if (index == 0) - emit_opcode(opcode::OP_GetZero); - else - emit_opcode(opcode::OP_GetByte, utils::string::va("%d", index)); - - index++; - - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->temp.as_identifier, blk)); - - emit_expr_variable_ref(entry, blk, true); - } - - emit_expr_clear_local(expr->temp.as_identifier, blk); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, blk, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, blk, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, blk, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set) -{ - emit_expr(expr->key, blk); - - 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, blk, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - { - if (!variable_initialized(expr->obj.as_identifier, blk)) - { - variable_initialize(expr->obj.as_identifier, blk); - emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(expr->obj.as_identifier, blk)); - - if (!set) throw comp_error(expr->loc(), "INTERNAL: VAR CREATED BUT NOT SET!"); - } - else if (variable_stack_index(expr->obj.as_identifier, blk) == 0) - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached0); - } - else - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access_index(expr->obj.as_identifier, blk)); - } - - 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, const block::ptr& blk, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); - break; - case ast::kind::expr_anim: - set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); - break; - case ast::kind::expr_self: - set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - 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, blk); - 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_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, 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 + "'"); - } - - if (set) - { - if (!variable_initialized(expr, blk)) - { - variable_initialize(expr, blk); - emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(expr, blk)); - } - else if (variable_stack_index(expr, blk) == 0) - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached0); - } - else - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached, variable_access_index(expr, blk)); - } - } - else - { - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_EvalLocalVariableRefCached0); - else - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access_index(expr, blk)); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->key, blk); - - if (expr->obj == ast::kind::expr_identifier) - { - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->obj.as_identifier, blk)); - } - else - { - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_EvalArray); - } -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_EvalLevelFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_EvalAnimFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_EvalSelfFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, const block::ptr& blk) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - emit_expr(itr->second, blk); - return; - } - - // is local var - auto index = variable_stack_index(expr, blk); - - switch (index) - { - case 0: - emit_opcode(opcode::OP_EvalLocalVariableCached0); - break; - case 1: - emit_opcode(opcode::OP_EvalLocalVariableCached1); - break; - case 2: - emit_opcode(opcode::OP_EvalLocalVariableCached2); - break; - case 3: - emit_opcode(opcode::OP_EvalLocalVariableCached3); - break; - case 4: - emit_opcode(opcode::OP_EvalLocalVariableCached4); - break; - case 5: - emit_opcode(opcode::OP_EvalLocalVariableCached5); - break; - default: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access_index(expr, blk)); - break; - } -} - -void compiler::emit_expr_object(const ast::expr& expr, const block::ptr& blk) -{ - 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, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr.as_identifier, blk)); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk) -{ - std::vector data; - - bool isexpr = false; - - 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, blk); - emit_expr(expr->y, blk); - emit_expr(expr->x, blk); - 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(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimation, { "", expr->value }); - } - else - { - emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); - tree.loaded = true; - } -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error(expr->loc(), "trying to use animtree without specified using animtree"); - } - - auto& tree = animtrees_.back(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimTree, ""); - } - else - { - emit_opcode(opcode::OP_GetAnimTree, tree.name); - tree.loaded = true; - } -} - -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_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_create_local_vars(const block::ptr& blk) -{ - if (blk->local_vars_create_count != blk->local_vars_public_count) - { - for (auto i = blk->local_vars_create_count; i < blk->local_vars_public_count; i++) - { - auto data = utils::string::va("%d", blk->local_vars.at(i).create); - emit_opcode(opcode::OP_CreateLocalVariable, data); - blk->local_vars.at(i).init = true; - } - blk->local_vars_create_count = blk->local_vars_public_count; - } -} - -void compiler::emit_remove_local_vars(const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - auto count = blk->local_vars_create_count - blk->local_vars_public_count; - - if (count > 0) - { - auto data = utils::string::va("%d", count); - emit_opcode(opcode::OP_RemoveLocalVariables, data); - } - } -} - -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, const block::ptr& blk) -{ - process_expr_parameters(decl->params, blk); - process_stmt_list(decl->stmt, blk); -} - -void compiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - 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_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, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk) -{ - process_stmt_list(stmt->list, blk); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - 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, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - blk->merge(childs); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - stmt->blk_if = std::make_unique(); - stmt->blk_else = std::make_unique(); - - blk->copy(stmt->blk_if); - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - blk->copy(stmt->blk_else); - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - blk->merge(childs); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - stmt->blk = std::make_unique(); - stmt->blk_iter = std::make_unique(); - - process_stmt(stmt->init, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->blk); - blk->copy(stmt->blk_iter); - - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_stmt(stmt->iter, stmt->blk_iter); - - blk->append({ stmt->blk_iter.get() }); - blk->merge({ stmt->blk_iter.get() }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto array_name = utils::string::va("_temp_%d", ++label_idx_); - auto key_name = utils::string::va("_temp_%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; - - // calculate variables - - stmt->ctx = std::make_unique(); - stmt->ctx_post = std::make_unique(); - - // calculate pre_expr variables - process_expr(stmt->array, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->ctx); - blk->copy(stmt->ctx_post); - - // calculate stmt variables & add missing array access as first stmt - process_expr(stmt->value_expr, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - continue_blks_.push_back(stmt->ctx.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_expr(stmt->key_expr, stmt->ctx_post); - - blk->append({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - // calculate variables - stmt->ctx = std::make_unique(); - std::vector childs; - auto abort = abort_t::abort_return; - bool has_default = false; - block* default_ctx = nullptr; - auto old_breaks = break_blks_; - break_blks_.clear(); - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->copy(entry.as_case->blk); - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort != abort_t::abort_none) - { - if (entry.as_case->blk->abort == abort_t::abort_break ) - { - entry.as_case->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_case->blk.get()); - } - else if (entry.as_case->blk->abort <= abort ) - { - abort = entry.as_case->blk->abort; - } - } - } - else if (entry == ast::kind::stmt_default) - { - entry.as_default->blk = std::make_unique(); - blk->copy(entry.as_default->blk); - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - has_default = true; - default_ctx = entry.as_default->blk.get(); - - if (entry.as_default->blk->abort != abort_t::abort_none) - { - if (entry.as_default->blk->abort == abort_t::abort_break ) - { - entry.as_default->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_default->blk.get()); - } - else if (entry.as_default->blk->abort <= abort ) - { - abort = entry.as_default->blk->abort; - } - } - } - } - - stmt->stmt =std::move(stmt_list); - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - } - - blk->append(break_blks_); - blk->merge(childs); - } - - break_blks_ = old_breaks; -} - -void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - break_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_break; - } -} - -void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - continue_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_continue; - } -} - -void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } -} - -void compiler::process_expr(const ast::expr& expr, const block::ptr& blk) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value, blk); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj, blk); - } - else if (expr == ast::kind::expr_tuple) - { - process_expr_tuple(expr.as_tuple, blk); - } -} - -void compiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - auto array = utils::string::va("_temp_%d", ++label_idx_); - expr->temp = ast::expr(std::make_unique(expr->loc(), array)); - - process_expr(expr->temp, blk); - - for (const auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk) -{ - for (const auto& entry : decl->list) - { - variable_register(entry->value, blk); - } -} - -void compiler::variable_register(const std::string& name, const block::ptr& blk) -{ - auto it = std::find_if (blk->local_vars.begin(), blk->local_vars.end(), - [&](const gsc::local_var& v) { return v.name == name; }); - - if (it == blk->local_vars.end()) - { - auto found = false; - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - blk->local_vars.push_back({ name, static_cast(i), false }); - found = true; - break; - } - } - - if (!found) - { - blk->local_vars.push_back({ name, stack_idx_, false }); - local_stack_.push_back(name); - stack_idx_++; - } - } -} - -void compiler::variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::uint32_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (!blk->local_vars[i].init) - { - for (std::uint32_t j = 0; j < i; j++) - { - if (!blk->local_vars[j].init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", blk->local_vars[j].create)); - blk->local_vars[j].init = true; - } - } - blk->local_vars[i].init = true; - blk->local_vars_create_count = i + 1; - return; - } - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -void compiler::variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - auto& var = blk->local_vars.at(i); - if (var.name == name->value) - { - if (!var.init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); - var.init = true; - blk->local_vars_create_count++; - } - return; - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return static_cast(blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - return utils::string::va("%d", blk->local_vars[i].create); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return utils::string::va("%d", blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - return blk->local_vars.at(i).init; - } - } - - 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_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jump: - case opcode::OP_jumpback: - case opcode::OP_switch: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_endswitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - -auto compiler::map_known_includes(const std::string&) -> bool -{ - return false; -} - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/compiler.hpp b/src/iw7/xsk/compiler.hpp deleted file mode 100644 index 5ff5dec6..00000000 --- a/src/iw7/xsk/compiler.hpp +++ /dev/null @@ -1,159 +0,0 @@ -// 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::gsc::iw7 -{ - -enum class opcode : std::uint8_t; - -class compiler : public gsc::compiler -{ - build mode_; - std::string filename_; - std::vector assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector break_blks_; - std::vector continue_blks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - -public: - auto output() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_constant(const ast::decl_constant::ptr& constant); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last); - void emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void emit_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt, const block::ptr& blk); - void emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk); - void emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk); - void emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk); - void emit_expr(const ast::expr& expr, const block::ptr& blk); - void emit_expr_assign(const ast::expr_assign::ptr& expr, const block::ptr& blk); - void emit_expr_clear(const ast::expr& expr, const block::ptr& blk); - void emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk); - void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk); - void emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_variable(const ast::expr& expr, const block::ptr& blk); - void emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void emit_expr_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_object(const ast::expr& expr, const block::ptr& blk); - void emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_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_create_local_vars(const block::ptr& blk); - void emit_remove_local_vars(const block::ptr& blk); - 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, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(const ast::expr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk); - void variable_register(const std::string& name, const block::ptr& blk); - void variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk); - void variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk); - auto variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t; - auto variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool; - 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; -}; - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/context.cpp b/src/iw7/xsk/context.cpp deleted file mode 100644 index 4d916632..00000000 --- a/src/iw7/xsk/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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 "iw7.hpp" - -namespace xsk::gsc::iw7 -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/context.hpp b/src/iw7/xsk/context.hpp deleted file mode 100644 index 62a950d0..00000000 --- a/src/iw7/xsk/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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::gsc::iw7 -{ - -class context : public gsc::context -{ - iw7::assembler assembler_; - iw7::disassembler disassembler_; - iw7::compiler compiler_; - iw7::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { return assembler_; } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { return compiler_; } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/decompiler.cpp b/src/iw7/xsk/decompiler.cpp deleted file mode 100644 index 9c43788e..00000000 --- a/src/iw7/xsk/decompiler.cpp +++ /dev/null @@ -1,3436 +0,0 @@ -// 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 "iw7.hpp" - -namespace xsk::gsc::iw7 -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// IW7 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetLocalFunction: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalFunctionCall2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - 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_ScriptLocalFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalMethodCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodChildThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall2: - { - 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 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_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin1: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin3: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin4: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin5: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod1: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod2: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod3: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod4: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod5: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_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 node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // continue is at jumpback, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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 - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - auto use_key = true; - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - use_key = false; - } - - 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)), use_key)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(std::stoi(entry->value.substr(4))), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - auto var = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - auto var1 = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); - blk->local_vars_create_count++; - } - - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/decompiler.hpp b/src/iw7/xsk/decompiler.hpp deleted file mode 100644 index 399ba6f6..00000000 --- a/src/iw7/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::iw7 -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/disassembler.cpp b/src/iw7/xsk/disassembler.cpp deleted file mode 100644 index b36d51dc..00000000 --- a/src/iw7/xsk/disassembler.cpp +++ /dev/null @@ -1,574 +0,0 @@ -// 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 "iw7.hpp" - -namespace xsk::gsc::iw7 -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// IW7 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read(); - func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - 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->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetVector: - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(4); - inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); - break; - case opcode::OP_GetAnimation: - script_->seek(8); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - disassemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto id = script_->read(); - const auto name = method ? resolver::method_name(id) : resolver::function_name(id); - inst->data.emplace(inst->data.begin(), name); -} - -void disassembler::disassemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto offset = disassemble_offset(); - - inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(3); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto file_id = stack_->read(); - const auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::token_name(file_id); - const auto func_id = stack_->read(); - const auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); - - inst->data.emplace(inst->data.begin(), func_name); - inst->data.emplace(inst->data.begin(), file_name); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read(); - 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) -{ - const auto count = script_->read(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read(); - - if (value < 0x40000) - { - const auto data = stack_->read_c_string(); - - if (data.data()[0] != 0x01) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(data, false)); - } - else - inst->data.push_back("default"); - } - else - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - index += 4; - - const auto addr = disassemble_offset() + index; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 3; - inst->size += 7; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - const auto id = script_->read(); - std::string name; - - if (id > max_string_id) - { - auto temp = stack_->read(); - name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); - } - else - { - name = resolver::token_name(id); - } - - inst->data.push_back(name); -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read(); - } - else if (back) - { - addr = inst->index + 3 - script_->read(); - } - else - { - addr = inst->index + 5 + script_->read(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -auto disassembler::disassemble_offset() -> std::int32_t -{ - std::array bytes = {}; - - for (auto i = 0; i < 3; i++) - { - bytes[i] = script_->read(); - } - - auto offset = *reinterpret_cast(bytes.data()); - - offset = (offset << 8) >> 9; - - return offset; -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = resolve_function(inst->data[0]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s\n", func->name.data())); - - 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())); - } - - print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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; - } - if (casenum != totalcase - 1) - { - output_->write_string("\n"); - } - } - } - break; - default: - for (auto& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - break; - } - - output_->write_string("\n"); -} - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/disassembler.hpp b/src/iw7/xsk/disassembler.hpp deleted file mode 100644 index 174da2cd..00000000 --- a/src/iw7/xsk/disassembler.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc::iw7 -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_local_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - auto disassemble_offset() -> std::int32_t; - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/iw7.cpp b/src/iw7/xsk/iw7.cpp deleted file mode 100644 index a2f82557..00000000 --- a/src/iw7/xsk/iw7.cpp +++ /dev/null @@ -1,181 +0,0 @@ -// 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 "iw7.hpp" - -namespace xsk::gsc::iw7 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - return 1; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_GetAnimTree: - case opcode::OP_GetNegByte: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_GetByte: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_waittillmatch: - return 2; - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_GetUnsignedShort: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_jumpback: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - case opcode::OP_JumpOnFalse: - case opcode::OP_endswitch: - return 3; - case opcode::OP_CallBuiltin: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_GetLocalFunction: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarMethodCall: - return 4; - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_GetFloat: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_switch: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - case opcode::OP_jump: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_GetInteger: - case opcode::OP_GetString: - case opcode::OP_GetIString: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - return 5; - case opcode::OP_GetAnimation: - return 9; - case opcode::OP_GetVector: - return 13; - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/iw7.hpp b/src/iw7/xsk/iw7.hpp deleted file mode 100644 index 6049c41e..00000000 --- a/src/iw7/xsk/iw7.hpp +++ /dev/null @@ -1,182 +0,0 @@ -// 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 "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::iw7 -{ - -constexpr std::uint32_t max_string_id = 0x13FCC; - -enum class opcode : std::uint8_t -{ - OP_SetNewLocalVariableFieldCached0 = 0x17, - OP_EvalSelfFieldVariable = 0x18, - OP_Return = 0x19, - OP_CallBuiltin0 = 0x1A, - OP_CallBuiltin1 = 0x1B, - OP_CallBuiltin2 = 0x1C, - OP_CallBuiltin3 = 0x1D, - OP_CallBuiltin4 = 0x1E, - OP_CallBuiltin5 = 0x1F, - OP_CallBuiltin = 0x20, - OP_BoolNot = 0x21, - OP_ScriptFarMethodThreadCall = 0x22, - OP_JumpOnTrueExpr = 0x23, - OP_SetLevelFieldVariableField = 0x24, - OP_CastBool = 0x25, - OP_EvalNewLocalArrayRefCached0 = 0x26, - OP_CallBuiltinPointer = 0x27, - OP_inequality = 0x28, - OP_GetThisthread = 0x29, - OP_ClearFieldVariable = 0x2A, - OP_GetFloat = 0x2B, - OP_SafeCreateVariableFieldCached = 0x2C, - OP_ScriptFarFunctionCall2 = 0x2D, - OP_ScriptFarFunctionCall = 0x2E, - OP_ScriptFarChildThreadCall = 0x2F, - OP_ClearLocalVariableFieldCached0 = 0x30, - OP_ClearLocalVariableFieldCached = 0x31, - OP_checkclearparams = 0x32, - OP_CastFieldObject = 0x33, - OP_End = 0x34, - OP_size = 0x35, - OP_EmptyArray = 0x36, - OP_bit_and = 0x37, - OP_less_equal = 0x38, - OP_voidCodepos = 0x39, - OP_ScriptMethodThreadCallPointer = 0x3A, - OP_endswitch = 0x3B, - OP_ClearVariableField = 0x3C, - OP_divide = 0x3D, - OP_ScriptFarMethodChildThreadCall = 0x3E, - OP_GetUnsignedShort = 0x3F, - OP_JumpOnTrue = 0x40, - OP_GetSelf = 0x41, - OP_ScriptFarThreadCall = 0x42, - OP_ScriptLocalThreadCall = 0x43, - OP_SetLocalVariableFieldCached0 = 0x44, - OP_SetLocalVariableFieldCached = 0x45, - OP_plus = 0x46, - OP_BoolComplement = 0x47, - OP_ScriptMethodCallPointer = 0x48, - OP_inc = 0x49, - OP_RemoveLocalVariables = 0x4A, - OP_JumpOnFalseExpr = 0x4B, - OP_switch = 0x4C, - OP_clearparams = 0x4D, - OP_EvalLocalVariableRefCached0 = 0x4E, - OP_EvalLocalVariableRefCached = 0x4F, - OP_ScriptLocalMethodCall = 0x50, - OP_EvalFieldVariable = 0x51, - OP_EvalFieldVariableRef = 0x52, - OP_GetString = 0x53, - OP_ScriptFunctionCallPointer = 0x54, - OP_EvalLevelFieldVariable = 0x55, - OP_GetVector = 0x56, - OP_endon = 0x57, - OP_greater_equal = 0x58, - OP_GetSelfObject = 0x59, - OP_SetAnimFieldVariableField = 0x5A, - OP_SetVariableField = 0x5B, - OP_ScriptLocalFunctionCall2 = 0x5C, - OP_ScriptLocalFunctionCall = 0x5D, - OP_EvalLocalArrayRefCached0 = 0x5E, - OP_EvalLocalArrayRefCached = 0x5F, - OP_GetFarFunction = 0x60, - OP_less = 0x61, - OP_GetGameRef = 0x62, - OP_waittillFrameEnd = 0x63, - OP_SafeSetVariableFieldCached0 = 0x64, - OP_SafeSetVariableFieldCached = 0x65, - OP_ScriptMethodChildThreadCallPointer = 0x66, - OP_GetLevel = 0x67, - OP_notify = 0x68, - OP_DecTop = 0x69, - OP_shift_left = 0x6A, - OP_ScriptLocalMethodThreadCall = 0x6B, - OP_ScriptLocalMethodChildThreadCall = 0x6C, - OP_greater = 0x6D, - OP_EvalLocalVariableCached0 = 0x6E, - OP_EvalLocalVariableCached1 = 0x6F, - OP_EvalLocalVariableCached2 = 0x70, - OP_EvalLocalVariableCached3 = 0x71, - OP_EvalLocalVariableCached4 = 0x72, - OP_EvalLocalVariableCached5 = 0x73, - OP_EvalLocalVariableCached = 0x74, - OP_SafeSetWaittillVariableFieldCached = 0x75, - OP_jump = 0x76, - OP_ScriptThreadCallPointer = 0x77, - OP_GetZero = 0x78, - OP_wait = 0x79, - OP_minus = 0x7A, - OP_SetSelfFieldVariableField = 0x7B, - OP_EvalNewLocalVariableRefCached0 = 0x7C, - OP_multiply = 0x7D, - OP_CreateLocalVariable = 0x7E, - OP_ScriptLocalChildThreadCall = 0x7F, - OP_GetInteger = 0x80, - OP_mod = 0x81, - OP_EvalAnimFieldVariableRef = 0x82, - OP_GetBuiltinFunction = 0x83, - OP_GetGame = 0x84, - OP_waittill = 0x85, - OP_dec = 0x86, - OP_EvalLocalVariableObjectCached = 0x87, - OP_PreScriptCall = 0x88, - OP_GetAnim = 0x89, - OP_GetUndefined = 0x8A, - OP_EvalLevelFieldVariableRef = 0x8B, - OP_GetAnimObject = 0x8C, - OP_GetLevelObject = 0x8D, - OP_bit_ex_or = 0x8E, - OP_equality = 0x8F, - OP_ClearArray = 0x90, - OP_jumpback = 0x91, - OP_GetAnimation = 0x92, - OP_EvalAnimFieldVariable = 0x93, - OP_GetAnimTree = 0x94, - OP_GetIString = 0x95, - OP_EvalArrayRef = 0x96, - OP_EvalSelfFieldVariableRef = 0x97, - OP_GetNegByte = 0x98, - OP_GetBuiltinMethod = 0x99, - OP_CallBuiltinMethodPointer = 0x9A, - OP_EvalArray = 0x9B, - OP_vector = 0x9C, - OP_ScriptFarMethodCall = 0x9D, - OP_EvalLocalArrayCached = 0x9E, - OP_GetByte = 0x9F, - OP_ScriptChildThreadCallPointer = 0xA0, - OP_bit_or = 0xA1, - OP_AddArray = 0xA2, - OP_waittillmatch2 = 0xA3, - OP_waittillmatch = 0xA4, - OP_GetLocalFunction = 0xA5, - OP_GetNegUnsignedShort = 0xA6, - OP_shift_right = 0xA7, - OP_CallBuiltinMethod0 = 0xA8, - OP_CallBuiltinMethod1 = 0xA9, - OP_CallBuiltinMethod2 = 0xAA, - OP_CallBuiltinMethod3 = 0xAB, - OP_CallBuiltinMethod4 = 0xAC, - OP_CallBuiltinMethod5 = 0xAD, - OP_CallBuiltinMethod = 0xAE, - OP_JumpOnFalse = 0xAF, - OP_Count = 0xB0, -}; - -auto opcode_size(std::uint8_t op) -> std::uint32_t; - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/lexer.cpp b/src/iw7/xsk/lexer.cpp deleted file mode 100644 index 139eb555..00000000 --- a/src/iw7/xsk/lexer.cpp +++ /dev/null @@ -1,848 +0,0 @@ -// 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 "iw7.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -xsk::gsc::iw7::parser::symbol_type IW7lex(xsk::gsc::iw7::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::gsc::iw7 -{ - -const std::unordered_map keyword_map -{{ - { "#define", parser::token::SH_DEFINE }, - { "#undef", parser::token::SH_UNDEF }, - { "#ifdef", parser::token::SH_IFDEF }, - { "#ifndef", parser::token::SH_IFNDEF }, - { "#if", parser::token::SH_IF }, - { "#elif", parser::token::SH_ELIF }, - { "#else", parser::token::SH_ELSE }, - { "#endif", parser::token::SH_ENDIF }, - { "#inline", parser::token::INLINE }, - { "#include", parser::token::INCLUDE }, - { "#using_animtree", parser::token::USINGTREE }, - { "#animtree", parser::token::ANIMTREE }, - { "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 }, - { "childthread", parser::token::CHILDTHREAD }, - { "thisthread", parser::token::THISTHREAD }, - { "call", parser::token::CALL }, - { "true", parser::token::TRUE }, - { "false", parser::token::FALSE }, - { "undefined", parser::token::UNDEFINED }, - { "size", parser::token::SIZE }, - { "game", parser::token::GAME }, - { "self", parser::token::SELF }, - { "anim", parser::token::ANIM }, - { "level", parser::token::LEVEL }, -}}; - -buffer::buffer() : length(0) -{ - data = static_cast(std::malloc(max_buf_size)); -} - -buffer::~buffer() -{ - if (data) std::free(data); -} - -bool buffer::push(char c) -{ - if (length >= max_buf_size) - return false; - - data[length++] = c; - return true; -} - -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) -{ - -} - -void reader::init(const char* data, size_t size) -{ - if (data && size) - { - state = reader::ok; - buffer_pos = data; - bytes_remaining = static_cast(size); - last_byte = 0; - current_byte = *data; - } - else - { - state = reader::end; - buffer_pos = 0; - bytes_remaining = 0; - last_byte = 0; - current_byte = 0; - } -} - -void reader::advance() -{ - ++buffer_pos; - - if (bytes_remaining-- == 1) - { - state = reader::end; - bytes_remaining = 0; - last_byte = current_byte; - current_byte = 0; - } - else - { - last_byte = current_byte; - current_byte = *buffer_pos; - } -} - -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) -{ - reader_.init(data, size); -} - -void lexer::push_header(const std::string& file) -{ - try - { - if (header_top_++ >= 10) - throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - - auto data = resolver::file_data(file + ".gsh"); - - readers_.push(reader_); - locs_.push(loc_); - loc_.initialize(std::get<0>(data)); - reader_.init(std::get<1>(data), std::get<2>(data)); - clean_ = true; - } - catch (const std::exception& e) - { - throw error("parsing header file '" + file + "': " + e.what()); - } -} - -void lexer::pop_header() -{ - header_top_--; - loc_ = locs_.top(); - locs_.pop(); - reader_ = readers_.top(); - readers_.pop(); -} - -void lexer::ban_header(const location& loc) -{ - if (header_top_ > 0) - { - throw comp_error(loc, "not allowed inside a gsh file"); - } -} - -auto lexer::lex() -> parser::symbol_type -{ - buffer_.length = 0; - state_ = state::start; - - while (true) - { - const auto& state = reader_.state; - auto& last = reader_.last_byte; - auto& curr = reader_.current_byte; - auto path = false; - loc_.step(); - - if (state == reader::end) - { - if (indev_) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (header_top_ > 0) - pop_header(); - else - return parser::make_IW7EOF(loc_); - } - - if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') - clean_ = false; - - advance(); - - switch (last) - { - case ' ': - case '\t': - case '\r': - loc_.step(); - continue; - case '\n': - loc_.lines(); - loc_.step(); - clean_ = true; - continue; - case '\\': - throw comp_error(loc_, "invalid token ('\\')"); - case '/': - if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') - return parser::make_DIV(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_DIV(loc_); - - if (last == '#') - { - if (indev_) - throw comp_error(loc_, "cannot recurse devblock ('/#')"); - - if (mode_ == build::dev) - { - indev_ = true; - return parser::make_DEVBEGIN(loc_); - } - else - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '#' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - } - else if (last == '@') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched script doc comment start ('/@')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '@' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '*') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched multiline comment start ('/*')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '*' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '/') - { - while (true) - { - if (state == reader::end) - break; - - if (curr == '\n') - break; - - advance(); - } - } - continue; - case '#': - if (curr == '/') - { - if (!indev_) - throw comp_error(loc_, "unmatched devblock end ('#/')"); - - advance(); - indev_ = false; - return parser::make_DEVEND(loc_); - } - - buffer_.push(last); - advance(); - - while (state == reader::ok) - { - if (last != ' ' || last != '\t') - break; - - advance(); - } - - if (state == reader::end || !((last > 64 && last < 91) || (last > 96 && last < 123))) - throw comp_error(loc_, "invalid preprocessor directive ('#')"); - - state_ = state::preprocessor; - goto lex_name; - case '*': - if (curr != '=' && curr != '/') - return parser::make_MUL(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_MUL(loc_); - - throw comp_error(loc_, "unmatched multiline comment end ('*/')"); - case '"': - state_ = state::string; - goto lex_string; - case '.': - if (curr < '0' || curr > '9') - return parser::make_DOT(loc_); - goto lex_number; - case '(': - return parser::make_LPAREN(loc_); - case ')': - return parser::make_RPAREN(loc_); - case '{': - return parser::make_LBRACE(loc_); - case '}': - return parser::make_RBRACE(loc_); - case '[': - return parser::make_LBRACKET(loc_); - case ']': - return parser::make_RBRACKET(loc_); - case ',': - return parser::make_COMMA(loc_); - case ';': - return parser::make_SEMICOLON(loc_); - case ':': - if (curr != ':') - return parser::make_COLON(loc_); - - advance(); - return parser::make_DOUBLECOLON(loc_); - case '?': - return parser::make_QMARK(loc_); - case '=': - if (curr != '=') - return parser::make_ASSIGN(loc_); - - advance(); - return parser::make_EQUALITY(loc_); - case '+': - if (curr != '+' && curr != '=') - return parser::make_ADD(loc_); - - advance(); - - if (last == '+') - return parser::make_INCREMENT(loc_); - - return parser::make_ASSIGN_ADD(loc_); - case '-': - if (curr != '-' && curr != '=') - return parser::make_SUB(loc_); - - advance(); - - if (last == '-') - return parser::make_DECREMENT(loc_); - - return parser::make_ASSIGN_SUB(loc_); - case '%': - if (curr != '=') - return parser::make_MOD(loc_); - - advance(); - - return parser::make_ASSIGN_MOD(loc_); - case '|': - if (curr != '|' && curr != '=') - return parser::make_BITWISE_OR(loc_); - - advance(); - - if (last == '|') - return parser::make_OR(loc_); - - return parser::make_ASSIGN_BW_OR(loc_); - case '&': - if (curr != '&' && curr != '=' && curr != '"') - return parser::make_BITWISE_AND(loc_); - - advance(); - - if (last == '&') - return parser::make_AND(loc_); - - if (last == '=') - return parser::make_ASSIGN_BW_AND(loc_); - - state_ = state::localize; - goto lex_string; - case '^': - if (curr != '=') - return parser::make_BITWISE_EXOR(loc_); - - advance(); - return parser::make_ASSIGN_BW_EXOR(loc_); - case '!': - if (curr != '=') - return parser::make_NOT(loc_); - - advance(); - return parser::make_INEQUALITY(loc_); - case '~': - return parser::make_COMPLEMENT(loc_); - case '<': - if (curr != '<' && curr != '=') - return parser::make_LESS(loc_); - - advance(); - if (last == '=') - return parser::make_LESS_EQUAL(loc_); - - if (curr != '=') - return parser::make_LSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_LSHIFT(loc_); - case '>': - if (curr != '>' && curr != '=') - return parser::make_GREATER(loc_); - - advance(); - - if (last == '=') - return parser::make_GREATER_EQUAL(loc_); - - if (curr != '=') - return parser::make_RSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_RSHIFT(loc_); - default: - if (last >= '0' && last <= '9') - goto lex_number; - else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) - goto lex_name; - - throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); - } - -lex_string: - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched string start ('\"')"); - - if (curr == '"') - { - advance(); - break; - } - - if (curr == '\n') - throw comp_error(loc_, "unterminated string literal"); - - if (curr == '\\') - { - advance(); - - if (state == reader::end) - throw comp_error(loc_, "invalid token ('\')"); - - char c = curr; - switch (curr) - { - case 't': c = '\t'; break; - case 'r': c = '\r'; break; - case 'n': c = '\n'; break; - case '"': c = '\"'; break; - case '\\': c = '\\'; break; - default: break; - } - - if (!buffer_.push(c)) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); - -lex_name: - buffer_.push(last); - - while (true) - { - if (state == reader::end) - break; - - if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) - break; - - if (curr == '\\') - { - if (last == '\\') - throw comp_error(loc_, "invalid path '\\\\'"); - - path = true; - if (!buffer_.push('/')) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::preprocessor) - { - auto token = parser::token::IW7UNDEF; - - if (buffer_.length < 16) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - { - if (itr->second > parser::token::SH_ENDIF) - return parser::symbol_type(itr->second, loc_); - - token = itr->second; - } - } - - preprocessor_run(token); - - state_ = state::start; - continue; - } - else - { - 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_); - } - - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - -lex_number: - if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) - { - buffer_.push(last); - - auto dot = last == '.' ? 1 : 0; - auto flt = 0; - - while (true) - { - if (state == reader::end) - break; - - if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) - throw comp_error(loc_, "invalid number literal"); - - if ((curr == '.' || curr == 'f') && last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr == 'f') - flt++; - else if (curr == '.') - dot++; - else if (!(curr > 47 && curr < 58)) - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f')) - throw comp_error(loc_, "invalid number literal"); - - if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); - } - else if (curr == 'o') - { - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) - throw comp_error(loc_, "invalid octal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!(curr > 47 && curr < 56)) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length <= 0) - throw comp_error(loc_, "invalid octal literal"); - - return parser::make_INTEGER(utils::string::oct_to_dec(buffer_.data), loc_); - } - else if (curr == 'b') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) - throw comp_error(loc_, "invalid binary literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr != '0' && curr != '1') - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid binary literal"); - - return parser::make_INTEGER(utils::string::bin_to_dec(buffer_.data), loc_); - } - else if (curr == 'x') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) - throw comp_error(loc_, "invalid hexadecimal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid hexadecimal literal"); - - return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); - } - - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); - } -} - -void lexer::advance() -{ - reader_.advance(); - loc_.end.column++; - - if (reader_.current_byte == '\\') [[unlikely]] - preprocessor_wrap(); -} - -void lexer::preprocessor_wrap() -{ - while (reader_.current_byte == '\\') - { - if (reader_.bytes_remaining == 1) - throw comp_error(loc_, "invalid token ('\\')"); - - if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') - break; - - if (reader_.buffer_pos[1] == '\r') - { - if (reader_.bytes_remaining <= 3 || reader_.buffer_pos[2] != '\n') - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 3; - reader_.bytes_remaining -= 3; - } - - if ((reader_.buffer_pos[1] == '\n')) - { - if (reader_.bytes_remaining == 2) - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 2; - reader_.bytes_remaining -= 2; - } - - if (reader_.bytes_remaining == 0) - { - reader_.state = reader::end; - reader_.current_byte = 0; - } - else - { - reader_.current_byte = *reader_.buffer_pos; - } - - loc_.lines(); - loc_.step(); - } -} - -void lexer::preprocessor_run(parser::token::token_kind_type token) -{ - if (!clean_) - throw comp_error(loc_, "invalid token ('#')"); - - switch (token) - { - case parser::token::SH_DEFINE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_UNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELSE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ENDIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - default: - throw comp_error(loc_, "unknown preprocessor directive"); - } -} - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/lexer.hpp b/src/iw7/xsk/lexer.hpp deleted file mode 100644 index c353fcf8..00000000 --- a/src/iw7/xsk/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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::gsc::iw7 -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/parser.cpp b/src/iw7/xsk/parser.cpp deleted file mode 100644 index ad13d856..00000000 --- a/src/iw7/xsk/parser.cpp +++ /dev/null @@ -1,4668 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw7::parser::symbol_type IW7lex(xsk::gsc::iw7::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex IW7lex - - - -#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 IW7DEBUG - -// 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 // !IW7DEBUG - -# 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 // !IW7DEBUG - -#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 gsc { namespace iw7 { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::gsc::iw7::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg) -#if IW7DEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - 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_add_array: // expr_add_array - value.YY_MOVE_OR_COPY< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.YY_MOVE_OR_COPY< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.YY_MOVE_OR_COPY< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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 IW7DEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if IW7DEBUG - 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 // IW7DEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - yylhs.value.emplace< ast::expr_add_array::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - yylhs.value.emplace< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - yylhs.value.emplace< ast::expr_tuple::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_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_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_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 261 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2020 "parser.cpp" - break; - - case 3: // root: %empty -#line 262 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2026 "parser.cpp" - break; - - case 4: // program: program inline -#line 267 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2032 "parser.cpp" - break; - - case 5: // program: program include -#line 269 "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 2038 "parser.cpp" - break; - - case 6: // program: program declaration -#line 271 "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 2044 "parser.cpp" - break; - - case 7: // program: inline -#line 273 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2050 "parser.cpp" - break; - - case 8: // program: include -#line 275 "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 2056 "parser.cpp" - break; - - case 9: // program: declaration -#line 277 "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 2062 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 281 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2068 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 286 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2074 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 290 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2080 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 291 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2086 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 292 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2092 "parser.cpp" - break; - - case 15: // declaration: decl_constant -#line 293 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } -#line 2098 "parser.cpp" - break; - - case 16: // declaration: decl_thread -#line 294 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2104 "parser.cpp" - break; - - case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 299 "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 2110 "parser.cpp" - break; - - case 18: // decl_constant: expr_identifier "=" expr ";" -#line 304 "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 2116 "parser.cpp" - break; - - case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 309 "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 2122 "parser.cpp" - break; - - case 20: // stmt: stmt_block -#line 313 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2128 "parser.cpp" - break; - - case 21: // stmt: stmt_call -#line 314 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2134 "parser.cpp" - break; - - case 22: // stmt: stmt_assign -#line 315 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2140 "parser.cpp" - break; - - case 23: // stmt: stmt_endon -#line 316 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2146 "parser.cpp" - break; - - case 24: // stmt: stmt_notify -#line 317 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2152 "parser.cpp" - break; - - case 25: // stmt: stmt_wait -#line 318 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2158 "parser.cpp" - break; - - case 26: // stmt: stmt_waittill -#line 319 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2164 "parser.cpp" - break; - - case 27: // stmt: stmt_waittillmatch -#line 320 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2170 "parser.cpp" - break; - - case 28: // stmt: stmt_waittillframeend -#line 321 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2176 "parser.cpp" - break; - - case 29: // stmt: stmt_if -#line 322 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2182 "parser.cpp" - break; - - case 30: // stmt: stmt_ifelse -#line 323 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2188 "parser.cpp" - break; - - case 31: // stmt: stmt_while -#line 324 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2194 "parser.cpp" - break; - - case 32: // stmt: stmt_dowhile -#line 325 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2200 "parser.cpp" - break; - - case 33: // stmt: stmt_for -#line 326 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2206 "parser.cpp" - break; - - case 34: // stmt: stmt_foreach -#line 327 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2212 "parser.cpp" - break; - - case 35: // stmt: stmt_switch -#line 328 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2218 "parser.cpp" - break; - - case 36: // stmt: stmt_case -#line 329 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2224 "parser.cpp" - break; - - case 37: // stmt: stmt_default -#line 330 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2230 "parser.cpp" - break; - - case 38: // stmt: stmt_break -#line 331 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2236 "parser.cpp" - break; - - case 39: // stmt: stmt_continue -#line 332 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2242 "parser.cpp" - break; - - case 40: // stmt: stmt_return -#line 333 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2248 "parser.cpp" - break; - - case 41: // stmt: stmt_breakpoint -#line 334 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } -#line 2254 "parser.cpp" - break; - - case 42: // stmt: stmt_prof_begin -#line 335 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2260 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_end -#line 336 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2266 "parser.cpp" - break; - - case 44: // stmt_or_dev: stmt -#line 340 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2272 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt_dev -#line 341 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2278 "parser.cpp" - break; - - case 46: // stmt_list: stmt_list stmt -#line 346 "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 2284 "parser.cpp" - break; - - case 47: // stmt_list: stmt -#line 348 "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 2290 "parser.cpp" - break; - - case 48: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 353 "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 2296 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev -#line 355 "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 2302 "parser.cpp" - break; - - case 50: // stmt_dev: "/#" stmt_list "#/" -#line 359 "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 2308 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" "#/" -#line 360 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2314 "parser.cpp" - break; - - case 52: // stmt_block: "{" stmt_or_dev_list "}" -#line 364 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2320 "parser.cpp" - break; - - case 53: // stmt_block: "{" "}" -#line 365 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2326 "parser.cpp" - break; - - case 54: // stmt_expr: expr_assign -#line 370 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2332 "parser.cpp" - break; - - case 55: // stmt_expr: expr_increment -#line 372 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2338 "parser.cpp" - break; - - case 56: // stmt_expr: expr_decrement -#line 374 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2344 "parser.cpp" - break; - - case 57: // stmt_expr: %empty -#line 376 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2350 "parser.cpp" - break; - - case 58: // stmt_call: expr_call ";" -#line 381 "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 2356 "parser.cpp" - break; - - case 59: // stmt_call: expr_method ";" -#line 383 "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 2362 "parser.cpp" - break; - - case 60: // stmt_assign: expr_assign ";" -#line 388 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2368 "parser.cpp" - break; - - case 61: // stmt_assign: expr_increment ";" -#line 390 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2374 "parser.cpp" - break; - - case 62: // stmt_assign: expr_decrement ";" -#line 392 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2380 "parser.cpp" - break; - - case 63: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 397 "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 2386 "parser.cpp" - break; - - case 64: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 402 "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 2392 "parser.cpp" - break; - - case 65: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 404 "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 2398 "parser.cpp" - break; - - case 66: // stmt_wait: "wait" expr ";" -#line 409 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2404 "parser.cpp" - break; - - case 67: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 414 "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 2410 "parser.cpp" - break; - - case 68: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 416 "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 2416 "parser.cpp" - break; - - case 69: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 421 "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 2422 "parser.cpp" - break; - - case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 423 "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 2428 "parser.cpp" - break; - - case 71: // stmt_waittillframeend: "waittillframeend" ";" -#line 428 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2434 "parser.cpp" - break; - - case 72: // stmt_if: "if" "(" expr ")" stmt -#line 433 "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 2440 "parser.cpp" - break; - - case 73: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 438 "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 2446 "parser.cpp" - break; - - case 74: // stmt_while: "while" "(" expr ")" stmt -#line 443 "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 2452 "parser.cpp" - break; - - case 75: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 448 "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 2458 "parser.cpp" - break; - - case 76: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 453 "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 2464 "parser.cpp" - break; - - case 77: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 458 "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 2470 "parser.cpp" - break; - - case 78: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 460 "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 2476 "parser.cpp" - break; - - case 79: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 465 "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 2482 "parser.cpp" - break; - - case 80: // stmt_case: "case" expr_integer ":" -#line 470 "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 2488 "parser.cpp" - break; - - case 81: // stmt_case: "case" expr_string ":" -#line 472 "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 2494 "parser.cpp" - break; - - case 82: // stmt_default: "default" ":" -#line 477 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2500 "parser.cpp" - break; - - case 83: // stmt_break: "break" ";" -#line 482 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2506 "parser.cpp" - break; - - case 84: // stmt_continue: "continue" ";" -#line 487 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2512 "parser.cpp" - break; - - case 85: // stmt_return: "return" expr ";" -#line 492 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2518 "parser.cpp" - break; - - case 86: // stmt_return: "return" ";" -#line 494 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2524 "parser.cpp" - break; - - case 87: // stmt_breakpoint: "breakpoint" ";" -#line 499 "parser.ypp" - { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } -#line 2530 "parser.cpp" - break; - - case 88: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 504 "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 2536 "parser.cpp" - break; - - case 89: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 509 "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 2542 "parser.cpp" - break; - - case 90: // expr: expr_ternary -#line 513 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2548 "parser.cpp" - break; - - case 91: // expr: expr_binary -#line 514 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2554 "parser.cpp" - break; - - case 92: // expr: expr_primitive -#line 515 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2560 "parser.cpp" - break; - - case 93: // expr_or_empty: expr -#line 519 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2566 "parser.cpp" - break; - - case 94: // expr_or_empty: %empty -#line 520 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2572 "parser.cpp" - break; - - case 95: // expr_assign: expr_tuple "=" expr -#line 525 "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 2578 "parser.cpp" - break; - - case 96: // expr_assign: expr_object "=" expr -#line 527 "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 2584 "parser.cpp" - break; - - case 97: // expr_assign: expr_object "|=" expr -#line 529 "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 2590 "parser.cpp" - break; - - case 98: // expr_assign: expr_object "&=" expr -#line 531 "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 2596 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "^=" expr -#line 533 "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 2602 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "<<=" expr -#line 535 "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 2608 "parser.cpp" - break; - - case 101: // expr_assign: expr_object ">>=" expr -#line 537 "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 2614 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "+=" expr -#line 539 "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 2620 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "-=" expr -#line 541 "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 2626 "parser.cpp" - break; - - case 104: // expr_assign: expr_object "*=" expr -#line 543 "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 2632 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "/=" expr -#line 545 "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 2638 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "%=" expr -#line 547 "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 2644 "parser.cpp" - break; - - case 107: // expr_increment: "++" expr_object -#line 552 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2650 "parser.cpp" - break; - - case 108: // expr_increment: expr_object "++" -#line 554 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2656 "parser.cpp" - break; - - case 109: // expr_decrement: "--" expr_object -#line 559 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2662 "parser.cpp" - break; - - case 110: // expr_decrement: expr_object "--" -#line 561 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2668 "parser.cpp" - break; - - case 111: // expr_ternary: expr "?" expr ":" expr -#line 566 "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 2674 "parser.cpp" - break; - - case 112: // expr_binary: expr "||" expr -#line 571 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2680 "parser.cpp" - break; - - case 113: // expr_binary: expr "&&" expr -#line 573 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2686 "parser.cpp" - break; - - case 114: // expr_binary: expr "==" expr -#line 575 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2692 "parser.cpp" - break; - - case 115: // expr_binary: expr "!=" expr -#line 577 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2698 "parser.cpp" - break; - - case 116: // expr_binary: expr "<=" expr -#line 579 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2704 "parser.cpp" - break; - - case 117: // expr_binary: expr ">=" expr -#line 581 "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 2710 "parser.cpp" - break; - - case 118: // expr_binary: expr "<" expr -#line 583 "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 2716 "parser.cpp" - break; - - case 119: // expr_binary: expr ">" expr -#line 585 "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 2722 "parser.cpp" - break; - - case 120: // expr_binary: expr "|" expr -#line 587 "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 2728 "parser.cpp" - break; - - case 121: // expr_binary: expr "&" expr -#line 589 "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 2734 "parser.cpp" - break; - - case 122: // expr_binary: expr "^" expr -#line 591 "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 2740 "parser.cpp" - break; - - case 123: // expr_binary: expr "<<" expr -#line 593 "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 2746 "parser.cpp" - break; - - case 124: // expr_binary: expr ">>" expr -#line 595 "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 2752 "parser.cpp" - break; - - case 125: // expr_binary: expr "+" expr -#line 597 "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 2758 "parser.cpp" - break; - - case 126: // expr_binary: expr "-" expr -#line 599 "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 2764 "parser.cpp" - break; - - case 127: // expr_binary: expr "*" expr -#line 601 "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 2770 "parser.cpp" - break; - - case 128: // expr_binary: expr "/" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2776 "parser.cpp" - break; - - case 129: // expr_binary: expr "%" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2782 "parser.cpp" - break; - - case 130: // expr_primitive: expr_complement -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 2788 "parser.cpp" - break; - - case 131: // expr_primitive: expr_negate -#line 610 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 2794 "parser.cpp" - break; - - case 132: // expr_primitive: expr_not -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 2800 "parser.cpp" - break; - - case 133: // expr_primitive: expr_call -#line 612 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 2806 "parser.cpp" - break; - - case 134: // expr_primitive: expr_method -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 2812 "parser.cpp" - break; - - case 135: // expr_primitive: expr_add_array -#line 614 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } -#line 2818 "parser.cpp" - break; - - case 136: // expr_primitive: expr_reference -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 2824 "parser.cpp" - break; - - case 137: // expr_primitive: expr_array -#line 616 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 2830 "parser.cpp" - break; - - case 138: // expr_primitive: expr_field -#line 617 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 2836 "parser.cpp" - break; - - case 139: // expr_primitive: expr_size -#line 618 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 2842 "parser.cpp" - break; - - case 140: // expr_primitive: expr_paren -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 2848 "parser.cpp" - break; - - case 141: // expr_primitive: expr_thisthread -#line 620 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } -#line 2854 "parser.cpp" - break; - - case 142: // expr_primitive: expr_empty_array -#line 621 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 2860 "parser.cpp" - break; - - case 143: // expr_primitive: expr_undefined -#line 622 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 2866 "parser.cpp" - break; - - case 144: // expr_primitive: expr_game -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 2872 "parser.cpp" - break; - - case 145: // expr_primitive: expr_self -#line 624 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 2878 "parser.cpp" - break; - - case 146: // expr_primitive: expr_anim -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 2884 "parser.cpp" - break; - - case 147: // expr_primitive: expr_level -#line 626 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 2890 "parser.cpp" - break; - - case 148: // expr_primitive: expr_animation -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 2896 "parser.cpp" - break; - - case 149: // expr_primitive: expr_animtree -#line 628 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 2902 "parser.cpp" - break; - - case 150: // expr_primitive: expr_identifier -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 2908 "parser.cpp" - break; - - case 151: // expr_primitive: expr_istring -#line 630 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 2914 "parser.cpp" - break; - - case 152: // expr_primitive: expr_string -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 2920 "parser.cpp" - break; - - case 153: // expr_primitive: expr_vector -#line 632 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 2926 "parser.cpp" - break; - - case 154: // expr_primitive: expr_float -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 2932 "parser.cpp" - break; - - case 155: // expr_primitive: expr_integer -#line 634 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 2938 "parser.cpp" - break; - - case 156: // expr_primitive: expr_false -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 2944 "parser.cpp" - break; - - case 157: // expr_primitive: expr_true -#line 636 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 2950 "parser.cpp" - break; - - case 158: // expr_complement: "~" expr -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2956 "parser.cpp" - break; - - case 159: // expr_negate: "-" expr_identifier -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 2962 "parser.cpp" - break; - - case 160: // expr_negate: "-" expr_paren -#line 648 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 2968 "parser.cpp" - break; - - case 161: // expr_negate: "-" expr_array -#line 650 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 2974 "parser.cpp" - break; - - case 162: // expr_negate: "-" expr_field -#line 652 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 2980 "parser.cpp" - break; - - case 163: // expr_not: "!" expr -#line 657 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2986 "parser.cpp" - break; - - case 164: // expr_call: expr_function -#line 661 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 2992 "parser.cpp" - break; - - case 165: // expr_call: expr_pointer -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 2998 "parser.cpp" - break; - - case 166: // expr_method: expr_object expr_function -#line 665 "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 3004 "parser.cpp" - break; - - case 167: // expr_method: expr_object expr_pointer -#line 666 "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 3010 "parser.cpp" - break; - - case 168: // expr_function: expr_identifier "(" expr_arguments ")" -#line 671 "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 3016 "parser.cpp" - break; - - case 169: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 673 "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 3022 "parser.cpp" - break; - - case 170: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 675 "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 3028 "parser.cpp" - break; - - case 171: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 677 "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 3034 "parser.cpp" - break; - - case 172: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 679 "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::childthread); } -#line 3040 "parser.cpp" - break; - - case 173: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 681 "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::childthread); } -#line 3046 "parser.cpp" - break; - - case 174: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 686 "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 3052 "parser.cpp" - break; - - case 175: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 688 "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 3058 "parser.cpp" - break; - - case 176: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 690 "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::childthread); } -#line 3064 "parser.cpp" - break; - - case 177: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 692 "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::builtin); } -#line 3070 "parser.cpp" - break; - - case 178: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 697 "parser.ypp" - { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } -#line 3076 "parser.cpp" - break; - - case 179: // expr_parameters: expr_parameters "," expr_identifier -#line 702 "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 3082 "parser.cpp" - break; - - case 180: // expr_parameters: expr_identifier -#line 704 "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 3088 "parser.cpp" - break; - - case 181: // expr_parameters: %empty -#line 706 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3094 "parser.cpp" - break; - - case 182: // expr_arguments: expr_arguments_no_empty -#line 711 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3100 "parser.cpp" - break; - - case 183: // expr_arguments: %empty -#line 713 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3106 "parser.cpp" - break; - - case 184: // expr_arguments_no_empty: expr_arguments "," expr -#line 718 "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 3112 "parser.cpp" - break; - - case 185: // expr_arguments_no_empty: expr -#line 720 "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 3118 "parser.cpp" - break; - - case 186: // expr_reference: "::" expr_identifier -#line 725 "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 3124 "parser.cpp" - break; - - case 187: // expr_reference: expr_path "::" expr_identifier -#line 727 "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 3130 "parser.cpp" - break; - - case 188: // expr_tuple: "[" expr_tuple_arguments "]" -#line 732 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[1].value.as < ast::expr_tuple::ptr > ()); } -#line 3136 "parser.cpp" - break; - - case 189: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types -#line 737 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::move(yystack_[2].value.as < ast::expr_tuple::ptr > ()); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3142 "parser.cpp" - break; - - case 190: // expr_tuple_arguments: expr_tuple_types -#line 739 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3148 "parser.cpp" - break; - - case 191: // expr_tuple_types: expr_array -#line 743 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3154 "parser.cpp" - break; - - case 192: // expr_tuple_types: expr_field -#line 744 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3160 "parser.cpp" - break; - - case 193: // expr_tuple_types: expr_identifier -#line 745 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3166 "parser.cpp" - break; - - case 194: // expr_array: expr_object "[" expr "]" -#line 750 "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 3172 "parser.cpp" - break; - - case 195: // expr_field: expr_object "." expr_identifier_nosize -#line 755 "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 3178 "parser.cpp" - break; - - case 196: // expr_size: expr_object "." "size" -#line 760 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3184 "parser.cpp" - break; - - case 197: // expr_paren: "(" expr ")" -#line 765 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3190 "parser.cpp" - break; - - case 198: // expr_object: expr_call -#line 769 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3196 "parser.cpp" - break; - - case 199: // expr_object: expr_method -#line 770 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3202 "parser.cpp" - break; - - case 200: // expr_object: expr_array -#line 771 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3208 "parser.cpp" - break; - - case 201: // expr_object: expr_field -#line 772 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3214 "parser.cpp" - break; - - case 202: // expr_object: expr_game -#line 773 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3220 "parser.cpp" - break; - - case 203: // expr_object: expr_self -#line 774 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3226 "parser.cpp" - break; - - case 204: // expr_object: expr_anim -#line 775 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3232 "parser.cpp" - break; - - case 205: // expr_object: expr_level -#line 776 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3238 "parser.cpp" - break; - - case 206: // expr_object: expr_identifier -#line 777 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3244 "parser.cpp" - break; - - case 207: // expr_thisthread: "thisthread" -#line 782 "parser.ypp" - { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } -#line 3250 "parser.cpp" - break; - - case 208: // expr_empty_array: "[" "]" -#line 787 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3256 "parser.cpp" - break; - - case 209: // expr_undefined: "undefined" -#line 792 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3262 "parser.cpp" - break; - - case 210: // expr_game: "game" -#line 797 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3268 "parser.cpp" - break; - - case 211: // expr_self: "self" -#line 802 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3274 "parser.cpp" - break; - - case 212: // expr_anim: "anim" -#line 807 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3280 "parser.cpp" - break; - - case 213: // expr_level: "level" -#line 812 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3286 "parser.cpp" - break; - - case 214: // expr_animation: "%" "identifier" -#line 817 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3292 "parser.cpp" - break; - - case 215: // expr_animtree: "#animtree" -#line 822 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3298 "parser.cpp" - break; - - case 216: // expr_identifier_nosize: "identifier" -#line 827 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3304 "parser.cpp" - break; - - case 217: // expr_identifier: "identifier" -#line 832 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3310 "parser.cpp" - break; - - case 218: // expr_identifier: "size" -#line 834 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3316 "parser.cpp" - break; - - case 219: // expr_path: "identifier" -#line 839 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3322 "parser.cpp" - break; - - case 220: // expr_path: "path" -#line 841 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3328 "parser.cpp" - break; - - case 221: // expr_istring: "localized string" -#line 846 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3334 "parser.cpp" - break; - - case 222: // expr_string: "string literal" -#line 851 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3340 "parser.cpp" - break; - - case 223: // expr_vector: "(" expr "," expr "," expr ")" -#line 856 "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 3346 "parser.cpp" - break; - - case 224: // expr_float: "-" "float" -#line 861 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3352 "parser.cpp" - break; - - case 225: // expr_float: "float" -#line 863 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3358 "parser.cpp" - break; - - case 226: // expr_integer: "-" "integer" -#line 868 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3364 "parser.cpp" - break; - - case 227: // expr_integer: "integer" -#line 870 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3370 "parser.cpp" - break; - - case 228: // expr_false: "false" -#line 875 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3376 "parser.cpp" - break; - - case 229: // expr_true: "true" -#line 880 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3382 "parser.cpp" - break; - - -#line 3386 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "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", - "childthread", "thisthread", "call", "true", "false", "undefined", - "size", "game", "self", "anim", "level", "(", ")", "{", "}", "[", "]", - ",", ".", "::", ":", ";", "?", "++", "--", "<<", ">>", "||", "&&", "==", - "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", "%=", - "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", "%", - "path", "identifier", "string literal", "localized string", "float", - "integer", "SIZEOF", "ADD_ARRAY", "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_negate", "expr_not", "expr_call", "expr_method", - "expr_function", "expr_pointer", "expr_add_array", "expr_parameters", - "expr_arguments", "expr_arguments_no_empty", "expr_reference", - "expr_tuple", "expr_tuple_arguments", "expr_tuple_types", "expr_array", - "expr_field", "expr_size", "expr_paren", "expr_object", - "expr_thisthread", "expr_empty_array", "expr_undefined", "expr_game", - "expr_self", "expr_anim", "expr_level", "expr_animation", - "expr_animtree", "expr_identifier_nosize", "expr_identifier", - "expr_path", "expr_istring", "expr_string", "expr_vector", "expr_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 IW7DEBUG - // 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 IW7DEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if IW7DEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -281; - - const short parser::yytable_ninf_ = -220; - - const short - parser::yypact_[] = - { - 4, -281, -281, -72, -72, -41, -281, -281, 32, 4, - -281, -281, -281, -281, -281, -281, -21, -281, -281, -28, - -1, -22, -281, -281, -281, -281, -43, 1235, -281, -281, - -281, 5, -29, -281, -281, -26, -24, -281, 8, -281, - -281, -281, -281, -281, -281, -281, 1235, 1109, -43, 1235, - 1235, 612, 1, 47, -281, -281, -281, 2111, -281, -281, - -281, -281, -281, -281, 108, 145, -281, -281, -281, -281, - 372, 438, -281, -281, 633, -281, -281, -281, 664, 818, - 982, 987, -281, -281, 39, 59, -281, -281, -281, -281, - -281, -281, -281, 61, 16, -43, 65, 78, 79, 103, - 109, 127, 133, 1443, 1109, -281, 2194, 125, 136, -281, - -281, -281, 1235, 134, -281, -281, -281, -281, 372, 438, - -281, 1132, -281, -281, -281, -281, 39, 137, -281, -281, - 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, - 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1298, - -35, -281, -281, 147, 1235, -43, -281, 951, -281, -281, - 1235, 1235, -43, 1235, 1235, -43, 1235, -281, 1235, 1231, - 1235, -281, 1609, 1235, 102, -43, 2076, -51, -51, 2225, - 865, 2276, 2276, -27, -27, -27, -27, 2235, 273, 2266, - 51, 51, -281, -281, -281, 1294, -281, -281, -281, 23, - -281, 150, 77, 1235, 148, 157, 1381, 160, 162, 163, - 166, -15, 158, 165, 167, 1172, 168, 172, 173, -281, - 409, 703, 703, -281, -281, 1027, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, 175, 184, 185, 186, 187, 142, -281, -281, 808, - 147, 1921, 30, 176, 1961, 36, 182, 2001, 2040, 195, - 2194, 1231, 150, 1235, -281, -281, 1235, -281, -281, 1080, - 2146, -281, 1235, 224, 1235, 738, -43, 1235, 151, 193, - 196, -281, -281, -281, -281, 2181, -281, 1235, 1235, 1298, - 35, -281, 112, 123, -4, 1132, 1132, -281, -281, -281, - -281, -281, -281, -281, 1235, 204, 206, 209, 210, -281, - -281, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235, - 1235, 1235, 207, -281, 1235, 211, -281, 1235, 212, 1235, - 214, 2194, 76, -281, -281, -281, 1643, 215, 1677, 201, - -281, -281, -281, 1407, -8, 1711, -281, -281, -281, 82, - 85, -281, 703, 2194, 1235, 1235, 1235, 1235, 2194, 2194, - 2194, 2194, 2194, 2194, 2194, 2194, 2194, 2194, 2194, 219, - 104, 220, 107, 221, 1745, 1235, -281, 1381, 1235, 1381, - 1235, 1235, -43, 16, 216, 222, -281, 1779, 1487, 1531, - 1575, 1235, -281, 1235, -281, 1235, -281, 120, 249, 1813, - -281, 2194, 223, 1847, 246, -281, -281, -281, 227, 229, - 1235, 232, 1235, 235, 1235, 124, 126, 138, -281, 1381, - 236, 738, 1381, 1235, -281, -281, 228, -281, 230, -281, - 247, -281, -281, -281, -281, -281, 250, -281, 1881, 242, - 243, 248, 1381, 1381, -281, -281, -281, -281, -281 - }; - - const unsigned char - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 218, 217, 0, 2, - 7, 8, 9, 14, 15, 16, 0, 220, 219, 0, - 0, 0, 1, 4, 5, 6, 181, 0, 10, 11, - 222, 0, 0, 180, 215, 0, 0, 207, 0, 229, - 228, 209, 210, 211, 212, 213, 0, 183, 0, 0, - 0, 0, 0, 217, 221, 225, 227, 0, 90, 91, - 92, 130, 131, 132, 133, 134, 164, 165, 135, 136, - 137, 138, 139, 140, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 0, 151, 152, 153, 154, - 155, 156, 157, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 183, 208, 185, 0, 182, 186, - 163, 158, 0, 0, 224, 226, 198, 199, 161, 162, - 160, 0, 202, 203, 204, 205, 159, 0, 214, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 166, 167, 0, 183, 0, 17, 0, 19, 179, - 0, 183, 0, 0, 183, 0, 0, 197, 0, 185, - 0, 178, 0, 0, 0, 0, 0, 123, 124, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 125, 126, 127, 128, 129, 0, 196, 216, 195, 0, - 182, 187, 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, 198, 199, 0, 200, 201, 0, - 206, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 184, 0, 0, 0, 194, 168, 183, 51, 47, 0, - 0, 71, 0, 0, 0, 57, 0, 0, 0, 0, - 0, 82, 83, 84, 86, 0, 87, 183, 183, 0, - 0, 190, 200, 201, 206, 107, 109, 52, 48, 60, - 61, 62, 58, 59, 0, 0, 0, 0, 0, 108, - 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 170, 183, 0, 172, 183, 0, 0, - 0, 111, 0, 50, 46, 66, 0, 0, 0, 0, - 54, 55, 56, 0, 0, 0, 81, 80, 85, 0, - 0, 188, 0, 95, 0, 0, 0, 0, 96, 102, - 103, 104, 105, 106, 97, 98, 99, 101, 100, 0, - 0, 0, 0, 0, 0, 183, 169, 0, 0, 0, - 94, 0, 0, 0, 0, 0, 189, 0, 0, 0, - 0, 183, 171, 183, 173, 183, 223, 0, 72, 0, - 74, 93, 0, 0, 0, 79, 88, 89, 0, 0, - 183, 0, 183, 0, 183, 0, 0, 0, 174, 0, - 0, 57, 0, 0, 63, 65, 182, 68, 182, 70, - 182, 175, 176, 177, 73, 75, 0, 77, 0, 0, - 0, 0, 0, 0, 64, 67, 69, 76, 78 - }; - - const short - parser::yypgoto_[] = - { - -281, -281, -281, 272, 298, 299, -281, -281, -281, 194, - 86, -281, -281, -281, -92, -121, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, -281, -281, -281, -281, -281, -281, -281, -281, 188, - -281, -280, -279, -278, -281, -281, -281, -281, -281, -281, - 92, 203, -66, -62, -281, -281, -127, -46, -281, -281, - -281, -13, 213, 337, -281, 289, 385, -281, -281, -281, - 392, 480, 512, 519, -281, -281, -281, 0, 10, -281, - -17, -281, -281, 130, -281, -281 - }; - - const short - parser::yydefgoto_[] = - { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 223, - 224, 279, 225, 226, 227, 349, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 106, - 412, 251, 252, 253, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 32, 107, 200, 69, 256, - 300, 301, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 198, 84, 85, 86, - 87, 88, 89, 90, 91, 92 - }; - - const short - parser::yytable_[] = - { - 16, 108, 158, 6, 31, 350, 351, 352, 151, 16, - 21, 196, 152, 19, 20, 1, 2, 3, 4, 5, - 6, 391, 6, 94, 17, 18, 33, 199, 95, 96, - 26, 99, 22, 28, 262, 97, 100, 265, 131, 132, - 144, 145, 146, 147, 148, 98, 101, 154, 109, 392, - 6, 126, -193, -193, 7, 151, 27, 93, 108, 152, - 29, 127, 197, 102, 144, 145, 146, 147, 148, 157, - 17, 53, 17, 53, 153, 275, 30, 288, -206, -206, - 170, -206, 333, 30, 127, -206, 56, 170, 336, 277, - 154, 361, 362, 170, -206, 159, 203, -206, 128, 204, - 205, 7, 206, 207, 208, 209, -219, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 35, 36, 155, 38, - 160, 153, 156, 6, 42, 43, 44, 45, 386, 161, - 157, 127, 220, 170, 394, -206, -206, 395, 162, 170, - 221, 222, 170, 116, 146, 147, 148, -198, -198, 342, - -198, 350, 351, 352, -198, 201, 402, 260, 163, 404, - 164, 170, 263, -198, 170, 266, -198, 127, -191, -191, - 359, 360, 428, 17, 53, 272, 441, 170, 442, -192, - -192, 170, 170, 170, -199, -199, 165, -199, 166, 173, - 443, -199, 171, 151, 289, 170, 175, 152, 154, 197, - -199, 276, 260, -199, -198, -198, 260, 380, 282, 281, - 382, 284, 127, 285, 286, 57, 127, 287, 291, 314, - 304, 260, 260, 297, 298, 260, 292, 334, 293, 296, - 127, 127, 127, 337, 103, 127, 309, 110, 111, 151, - 151, -199, -199, 152, 152, 310, 311, 312, 313, 254, - 347, 340, 115, 356, 117, 364, 357, 365, 407, 153, - 366, 367, 390, 379, 118, 385, 388, 381, 383, 127, - 401, 403, 405, 429, 425, 433, 426, 416, 427, 260, - 449, 23, 450, 417, 431, 260, 354, 151, 434, 127, - 435, 152, 169, 437, 254, 127, 439, 445, 254, 451, - 172, 415, 452, 454, 455, 153, 153, 24, 25, 456, - 446, 308, 116, 116, 116, 127, 127, 254, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 131, 132, - 120, 290, 135, 136, 137, 138, 139, 140, 261, 396, - 0, 264, 0, 153, 267, 0, 268, 0, 270, 0, - 255, 271, 304, 127, 144, 145, 146, 147, 148, 0, - 257, 254, 127, 0, 436, 0, 438, 116, 440, 0, - 0, 0, 0, 0, 0, 0, 0, 260, 119, 260, - 0, 280, 414, 0, 0, 0, 278, 127, 0, 127, - 283, 0, 0, 295, 0, 255, 0, 0, 0, 255, - 0, -200, -200, 0, -200, 257, 0, 0, -200, 257, - 0, 0, 0, 117, 117, 117, 0, -200, 255, 260, - -200, 260, 260, 302, 257, 257, 121, 0, 257, 127, - 0, 127, 127, 122, 0, 0, 0, 0, 35, 36, - 0, 38, 260, 260, 116, 6, 42, 43, 44, 45, - 0, 341, 127, 127, 299, 0, 0, 0, -200, -200, - 346, 0, 348, 344, 0, 355, 0, -201, -201, 254, - -201, 254, 255, 0, -201, 0, 0, 271, 117, 0, - 0, 0, 257, -201, 258, 0, -201, 0, 257, 0, - 0, 0, 363, 0, 0, 17, 53, 0, 0, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 0, 254, 0, 116, 254, 0, 0, 384, 0, 0, - 0, 123, 0, 0, -201, -201, 0, 0, 0, 258, - 0, 0, 259, 258, 254, 254, 0, 0, 0, 122, - 0, 0, 397, 398, 399, 400, 0, 303, 258, 258, - 0, 0, 258, 124, 0, 117, 0, 0, 0, 0, - 125, 0, 0, 0, 0, 302, 409, 0, 411, 413, - 0, 408, 0, 410, 0, 0, 0, 259, 0, 0, - 255, 259, 255, 0, 122, 0, 0, 0, 122, 0, - 257, 0, 257, 0, 0, 121, 305, 306, 0, 0, - 259, 0, 122, 122, 122, 0, 258, 122, 0, 0, - 0, 448, 258, 444, 0, 0, 447, 0, 0, 0, - 0, 0, 255, 0, 117, 255, 0, 123, 0, 0, - 0, 0, 257, 0, 257, 257, 457, 458, 0, 0, - 0, 35, 36, 0, 38, 255, 255, 0, 6, 42, - 43, 44, 45, 112, 259, 257, 257, 113, 0, 124, - 353, 122, 35, 36, 0, 38, 125, 122, 0, 6, - 0, 0, 123, 0, 0, 0, 123, 0, 149, 0, - 0, 150, 0, 0, 0, 0, 0, 0, 0, 303, - 123, 123, 123, -202, -202, 123, -202, 0, 17, 53, - -202, 0, 114, 115, 124, 0, 0, 0, 124, -202, - 0, 125, -202, 0, 258, 125, 258, 0, 0, 17, - 53, 0, 124, 124, 124, 0, 0, 124, 0, 125, - 125, 125, 35, 36, 125, 38, 0, 121, 0, 6, - 42, 43, 44, 45, 122, 0, 0, 0, 113, 123, - -202, -202, 0, 0, 0, 123, 258, 0, 258, 258, - 0, 0, 259, 0, 259, 0, 0, 35, 36, 122, - 38, 122, 0, 0, 6, 42, 43, 44, 45, 258, - 258, 124, 0, 220, 0, 0, 0, 124, 125, 17, - 53, 221, 222, 0, 125, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 259, 0, 353, 259, 0, 0, - 0, 122, 0, 122, 122, 315, 316, 0, 317, 318, - 0, 0, 0, 0, 17, 53, 0, 259, 259, 0, - 0, 0, 123, 0, 122, 122, 0, 35, 36, 0, - 38, 0, 0, 0, 6, 0, 0, -203, -203, 0, - -203, 0, 0, 149, -203, 0, 174, 123, 0, 123, - 0, 319, 320, -203, 124, 0, -203, 0, 0, 0, - 0, 125, 0, 0, 0, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 0, 0, 0, 124, - 0, 124, 0, 0, 17, 53, 125, 0, 125, 123, - 0, 123, 123, 0, -203, -203, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 131, 132, 123, 123, 135, 136, 137, 138, 139, 140, - 0, 124, 0, 124, 124, 0, 0, 0, 125, 0, - 125, 125, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 0, 202, 0, 124, 124, 0, 0, 0, 0, - 203, 125, 125, 204, 205, 0, 206, 207, 208, 209, - 0, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 35, 36, 0, 38, 0, 0, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 219, 220, 0, 0, 0, - 0, 0, 0, 0, 221, 222, 0, 0, 0, 0, - 0, -204, -204, 0, -204, 0, -205, -205, -204, -205, - 0, 0, 0, -205, 0, 0, 0, -204, 202, 0, - -204, 0, -205, 0, 0, -205, 203, 17, 53, 204, - 205, 0, 206, 207, 208, 209, 0, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 35, 36, 0, 38, - 0, 0, 0, 6, 42, 43, 44, 45, -204, -204, - 157, 307, 220, -205, -205, 0, 0, 0, 0, 0, - 221, 222, 343, 0, 0, 0, 0, 0, 0, 203, - 0, 0, 204, 205, 0, 206, 207, 208, 209, 0, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 35, - 36, 0, 38, 17, 53, 34, 6, 42, 43, 44, - 45, 0, 0, 157, 0, 220, 0, 0, 0, 0, - 0, 0, 0, 221, 222, 0, 0, 0, 35, 36, - 37, 38, 39, 40, 41, 6, 42, 43, 44, 45, - 46, 0, 0, 0, 104, 105, 0, 0, 48, 0, - 0, 35, 36, 0, 38, 0, 17, 53, 6, 0, - 0, 0, 0, 0, 49, 50, 0, 149, 34, 0, - 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 51, 0, 0, 52, 17, 53, 30, 54, 55, - 56, 35, 36, 37, 38, 39, 40, 41, 6, 42, - 43, 44, 45, 46, 0, 0, 0, 47, 17, 53, - 0, 48, 0, 294, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 49, 50, 0, - 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 51, 0, 0, 52, 17, 53, - 30, 54, 55, 56, 35, 36, 37, 38, 39, 40, - 41, 6, 42, 43, 44, 45, 46, 269, 0, 0, - 47, 0, 0, 130, 48, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 49, 50, 0, 0, 34, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 51, 0, 0, - 52, 17, 53, 30, 54, 55, 56, 35, 36, 37, - 38, 39, 40, 41, 6, 42, 43, 44, 45, 46, - 274, 0, 0, 104, 0, 0, 130, 48, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 49, 50, 0, 0, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 51, 0, 0, 52, 17, 53, 30, 54, 55, 56, - 203, 0, 0, 204, 205, 0, 206, 207, 208, 209, - 0, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 35, 36, 0, 38, 0, 0, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 0, 220, 0, 0, 0, - 0, 0, 0, 0, 221, 222, 35, 36, 0, 38, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, - 0, 0, 149, 0, 0, 174, 0, 0, 0, 0, - 319, 320, 0, 0, 0, 0, 0, 17, 53, 0, - 0, 0, 0, 0, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 167, 0, 0, 0, 0, - 168, 0, 0, 17, 53, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 419, - 0, 0, 0, 0, 420, 0, 0, 0, 0, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 421, 0, 0, 0, 0, 422, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 423, 0, 0, - 0, 0, 424, 0, 0, 0, 0, 130, 0, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 167, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 130, 0, 0, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 387, 0, 141, 142, 143, - 144, 145, 146, 147, 148, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 389, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 393, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 406, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 130, 0, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 418, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 130, 0, 0, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 430, 0, 141, 142, 143, - 144, 145, 146, 147, 148, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 453, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 332, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 335, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 338, 0, 0, - 0, 0, 0, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 339, 0, 0, - 0, 0, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 273, 0, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 129, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 345, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 358, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 131, 132, 0, 134, 135, 136, 137, 138, 139, 140, - 131, 132, 0, 0, 135, 136, 137, 138, 139, 140, - 0, 0, 0, 141, 142, 143, 144, 145, 146, 147, - 148, 0, 0, 0, 142, 143, 144, 145, 146, 147, - 148, 131, 132, 0, 0, 135, 136, 137, 138, 139, - 140, 131, 132, 0, 0, 0, 0, 137, 138, 139, - 140, 0, 0, 0, 0, 142, 0, 144, 145, 146, - 147, 148, 0, 0, 0, 0, 0, 144, 145, 146, - 147, 148 - }; - - const short - parser::yycheck_[] = - { - 0, 47, 94, 46, 21, 285, 285, 285, 74, 9, - 51, 46, 74, 3, 4, 11, 12, 13, 14, 15, - 46, 29, 46, 52, 96, 97, 26, 154, 57, 55, - 51, 55, 0, 61, 161, 35, 36, 164, 65, 66, - 91, 92, 93, 94, 95, 35, 36, 51, 48, 57, - 46, 51, 56, 57, 97, 121, 77, 52, 104, 121, - 61, 51, 97, 55, 91, 92, 93, 94, 95, 53, - 96, 97, 96, 97, 74, 52, 98, 92, 39, 40, - 57, 42, 52, 98, 74, 46, 101, 57, 52, 12, - 51, 56, 57, 57, 55, 95, 19, 58, 97, 22, - 23, 97, 25, 26, 27, 28, 59, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 59, 42, - 55, 121, 61, 46, 47, 48, 49, 50, 52, 51, - 53, 121, 55, 57, 52, 96, 97, 52, 59, 57, - 63, 64, 57, 51, 93, 94, 95, 39, 40, 276, - 42, 431, 431, 431, 46, 155, 52, 157, 55, 52, - 51, 57, 162, 55, 57, 165, 58, 157, 56, 57, - 297, 298, 52, 96, 97, 175, 52, 57, 52, 56, - 57, 57, 57, 57, 39, 40, 59, 42, 55, 55, - 52, 46, 56, 259, 211, 57, 59, 259, 51, 97, - 55, 51, 202, 58, 96, 97, 206, 334, 51, 61, - 337, 51, 202, 51, 51, 27, 206, 51, 60, 77, - 220, 221, 222, 51, 51, 225, 61, 51, 61, 61, - 220, 221, 222, 51, 46, 225, 61, 49, 50, 305, - 306, 96, 97, 305, 306, 61, 61, 61, 61, 157, - 26, 56, 101, 60, 51, 51, 60, 51, 385, 259, - 51, 51, 61, 56, 51, 51, 51, 56, 56, 259, - 51, 51, 51, 24, 401, 29, 403, 61, 405, 279, - 52, 9, 52, 61, 61, 285, 286, 353, 61, 279, - 61, 353, 104, 61, 202, 285, 61, 61, 206, 52, - 112, 393, 52, 61, 61, 305, 306, 9, 9, 61, - 431, 225, 220, 221, 222, 305, 306, 225, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 65, 66, - 51, 211, 69, 70, 71, 72, 73, 74, 160, 362, - -1, 163, -1, 353, 166, -1, 168, -1, 170, -1, - 157, 173, 362, 353, 91, 92, 93, 94, 95, -1, - 157, 279, 362, -1, 420, -1, 422, 285, 424, -1, - -1, -1, -1, -1, -1, -1, -1, 387, 51, 389, - -1, 203, 392, -1, -1, -1, 202, 387, -1, 389, - 206, -1, -1, 215, -1, 202, -1, -1, -1, 206, - -1, 39, 40, -1, 42, 202, -1, -1, 46, 206, - -1, -1, -1, 220, 221, 222, -1, 55, 225, 429, - 58, 431, 432, 220, 221, 222, 51, -1, 225, 429, - -1, 431, 432, 51, -1, -1, -1, -1, 39, 40, - -1, 42, 452, 453, 362, 46, 47, 48, 49, 50, - -1, 273, 452, 453, 55, -1, -1, -1, 96, 97, - 282, -1, 284, 279, -1, 287, -1, 39, 40, 387, - 42, 389, 279, -1, 46, -1, -1, 299, 285, -1, - -1, -1, 279, 55, 157, -1, 58, -1, 285, -1, - -1, -1, 314, -1, -1, 96, 97, -1, -1, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, - -1, 429, -1, 431, 432, -1, -1, 339, -1, -1, - -1, 51, -1, -1, 96, 97, -1, -1, -1, 202, - -1, -1, 157, 206, 452, 453, -1, -1, -1, 157, - -1, -1, 364, 365, 366, 367, -1, 220, 221, 222, - -1, -1, 225, 51, -1, 362, -1, -1, -1, -1, - 51, -1, -1, -1, -1, 362, 388, -1, 390, 391, - -1, 387, -1, 389, -1, -1, -1, 202, -1, -1, - 387, 206, 389, -1, 202, -1, -1, -1, 206, -1, - 387, -1, 389, -1, -1, 220, 221, 222, -1, -1, - 225, -1, 220, 221, 222, -1, 279, 225, -1, -1, - -1, 433, 285, 429, -1, -1, 432, -1, -1, -1, - -1, -1, 429, -1, 431, 432, -1, 157, -1, -1, - -1, -1, 429, -1, 431, 432, 452, 453, -1, -1, - -1, 39, 40, -1, 42, 452, 453, -1, 46, 47, - 48, 49, 50, 51, 279, 452, 453, 55, -1, 157, - 285, 279, 39, 40, -1, 42, 157, 285, -1, 46, - -1, -1, 202, -1, -1, -1, 206, -1, 55, -1, - -1, 58, -1, -1, -1, -1, -1, -1, -1, 362, - 220, 221, 222, 39, 40, 225, 42, -1, 96, 97, - 46, -1, 100, 101, 202, -1, -1, -1, 206, 55, - -1, 202, 58, -1, 387, 206, 389, -1, -1, 96, - 97, -1, 220, 221, 222, -1, -1, 225, -1, 220, - 221, 222, 39, 40, 225, 42, -1, 362, -1, 46, - 47, 48, 49, 50, 362, -1, -1, -1, 55, 279, - 96, 97, -1, -1, -1, 285, 429, -1, 431, 432, - -1, -1, 387, -1, 389, -1, -1, 39, 40, 387, - 42, 389, -1, -1, 46, 47, 48, 49, 50, 452, - 453, 279, -1, 55, -1, -1, -1, 285, 279, 96, - 97, 63, 64, -1, 285, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 429, -1, 431, 432, -1, -1, - -1, 429, -1, 431, 432, 17, 18, -1, 20, 21, - -1, -1, -1, -1, 96, 97, -1, 452, 453, -1, - -1, -1, 362, -1, 452, 453, -1, 39, 40, -1, - 42, -1, -1, -1, 46, -1, -1, 39, 40, -1, - 42, -1, -1, 55, 46, -1, 58, 387, -1, 389, - -1, 63, 64, 55, 362, -1, 58, -1, -1, -1, - -1, 362, -1, -1, -1, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, -1, -1, -1, 387, - -1, 389, -1, -1, 96, 97, 387, -1, 389, 429, - -1, 431, 432, -1, 96, 97, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, 452, 453, 69, 70, 71, 72, 73, 74, - -1, 429, -1, 431, 432, -1, -1, -1, 429, -1, - 431, 432, -1, 88, 89, 90, 91, 92, 93, 94, - 95, -1, 11, -1, 452, 453, -1, -1, -1, -1, - 19, 452, 453, 22, 23, -1, 25, 26, 27, 28, - -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, -1, 42, -1, -1, -1, 46, 47, 48, - 49, 50, -1, -1, 53, 54, 55, -1, -1, -1, - -1, -1, -1, -1, 63, 64, -1, -1, -1, -1, - -1, 39, 40, -1, 42, -1, 39, 40, 46, 42, - -1, -1, -1, 46, -1, -1, -1, 55, 11, -1, - 58, -1, 55, -1, -1, 58, 19, 96, 97, 22, - 23, -1, 25, 26, 27, 28, -1, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, -1, 42, - -1, -1, -1, 46, 47, 48, 49, 50, 96, 97, - 53, 54, 55, 96, 97, -1, -1, -1, -1, -1, - 63, 64, 12, -1, -1, -1, -1, -1, -1, 19, - -1, -1, 22, 23, -1, 25, 26, 27, 28, -1, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, -1, 42, 96, 97, 16, 46, 47, 48, 49, - 50, -1, -1, 53, -1, 55, -1, -1, -1, -1, - -1, -1, -1, 63, 64, -1, -1, -1, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, -1, -1, -1, 55, 56, -1, -1, 59, -1, - -1, 39, 40, -1, 42, -1, 96, 97, 46, -1, - -1, -1, -1, -1, 75, 76, -1, 55, 16, -1, - 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 92, -1, -1, 95, 96, 97, 98, 99, 100, - 101, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, -1, -1, -1, 55, 96, 97, - -1, 59, -1, 61, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 75, 76, -1, - -1, 16, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 92, -1, -1, 95, 96, 97, - 98, 99, 100, 101, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 56, -1, -1, - 55, -1, -1, 62, 59, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - 75, 76, -1, -1, 16, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 92, -1, -1, - 95, 96, 97, 98, 99, 100, 101, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 56, -1, -1, 55, -1, -1, 62, 59, -1, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, -1, - -1, -1, -1, 75, 76, -1, -1, -1, -1, -1, - -1, -1, 88, 89, 90, 91, 92, 93, 94, 95, - 92, -1, -1, 95, 96, 97, 98, 99, 100, 101, - 19, -1, -1, 22, 23, -1, 25, 26, 27, 28, - -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, -1, 42, -1, -1, -1, 46, 47, 48, - 49, 50, -1, -1, 53, -1, 55, -1, -1, -1, - -1, -1, -1, -1, 63, 64, 39, 40, -1, 42, - -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, - -1, -1, 55, -1, -1, 58, -1, -1, -1, -1, - 63, 64, -1, -1, -1, -1, -1, 96, 97, -1, - -1, -1, -1, -1, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 52, -1, -1, -1, -1, - 57, -1, -1, 96, 97, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 52, - -1, -1, -1, -1, 57, -1, -1, -1, -1, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 52, -1, -1, -1, -1, 57, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 52, -1, -1, - -1, -1, 57, -1, -1, -1, -1, 62, -1, -1, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 52, -1, 88, 89, 90, 91, 92, 93, 94, - 95, 62, -1, -1, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, -1, 88, 89, 90, - 91, 92, 93, 94, 95, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 52, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 52, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 62, -1, -1, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 52, -1, 88, 89, 90, 91, 92, 93, 94, - 95, 62, -1, -1, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, -1, 88, 89, 90, - 91, 92, 93, 94, 95, 62, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 62, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 52, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 56, -1, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 57, -1, -1, - -1, -1, 62, -1, -1, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 88, 89, - 90, 91, 92, 93, 94, 95, 60, -1, 62, -1, - -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 88, 89, 90, 91, 92, 93, - 94, 95, 61, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 61, 62, -1, - -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 88, 89, 90, 91, 92, 93, - 94, 95, 61, 62, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 62, -1, -1, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 88, - 89, 90, 91, 92, 93, 94, 95, -1, -1, -1, - -1, -1, 88, 89, 90, 91, 92, 93, 94, 95, - 65, 66, -1, 68, 69, 70, 71, 72, 73, 74, - 65, 66, -1, -1, 69, 70, 71, 72, 73, 74, - -1, -1, -1, 88, 89, 90, 91, 92, 93, 94, - 95, -1, -1, -1, 89, 90, 91, 92, 93, 94, - 95, 65, 66, -1, -1, 69, 70, 71, 72, 73, - 74, 65, 66, -1, -1, -1, -1, 71, 72, 73, - 74, -1, -1, -1, -1, 89, -1, 91, 92, 93, - 94, 95, -1, -1, -1, -1, -1, 91, 92, 93, - 94, 95 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 46, 97, 113, 114, - 115, 116, 117, 118, 119, 120, 189, 96, 97, 190, - 190, 51, 0, 115, 116, 117, 51, 77, 61, 61, - 98, 192, 167, 189, 16, 39, 40, 41, 42, 43, - 44, 45, 47, 48, 49, 50, 51, 55, 59, 75, - 76, 92, 95, 97, 99, 100, 101, 151, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 170, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 52, 52, 57, 55, 189, 190, 55, - 189, 190, 55, 151, 55, 56, 151, 168, 169, 189, - 151, 151, 51, 55, 100, 101, 162, 163, 174, 175, - 177, 178, 182, 183, 184, 185, 189, 190, 97, 61, - 62, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 88, 89, 90, 91, 92, 93, 94, 95, 55, - 58, 164, 165, 189, 51, 59, 61, 53, 126, 189, - 55, 51, 59, 55, 51, 59, 55, 52, 57, 151, - 57, 56, 151, 55, 58, 59, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 46, 97, 188, 168, - 169, 189, 11, 19, 22, 23, 25, 26, 27, 28, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 54, - 55, 63, 64, 121, 122, 124, 125, 126, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 153, 154, 155, 162, 163, 171, 174, 175, 178, - 189, 151, 168, 189, 151, 168, 189, 151, 151, 56, - 151, 151, 189, 60, 56, 52, 51, 12, 121, 123, - 151, 61, 51, 121, 51, 51, 51, 51, 92, 192, - 195, 60, 61, 61, 61, 151, 61, 51, 51, 55, - 172, 173, 174, 175, 189, 178, 178, 54, 122, 61, - 61, 61, 61, 61, 77, 17, 18, 20, 21, 63, - 64, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 56, 52, 51, 56, 52, 51, 56, 57, - 56, 151, 168, 12, 121, 61, 151, 26, 151, 127, - 153, 154, 155, 178, 189, 151, 60, 60, 61, 168, - 168, 56, 57, 151, 51, 51, 51, 51, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 56, - 168, 56, 168, 56, 151, 51, 52, 52, 51, 52, - 61, 29, 57, 52, 52, 52, 173, 151, 151, 151, - 151, 51, 52, 51, 52, 51, 52, 168, 121, 151, - 121, 151, 152, 151, 189, 126, 61, 61, 52, 52, - 57, 52, 57, 52, 57, 168, 168, 168, 52, 24, - 52, 61, 52, 29, 61, 61, 169, 61, 169, 61, - 169, 52, 52, 52, 121, 61, 127, 121, 151, 52, - 52, 52, 52, 52, 61, 61, 61, 121, 121 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 112, 113, 113, 114, 114, 114, 114, 114, 114, - 115, 116, 117, 117, 117, 117, 117, 118, 119, 120, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 122, 122, 123, 123, 124, 124, - 125, 125, 126, 126, 127, 127, 127, 127, 128, 128, - 129, 129, 129, 130, 131, 131, 132, 133, 133, 134, - 134, 135, 136, 137, 138, 139, 140, 141, 141, 142, - 143, 143, 144, 145, 146, 147, 147, 148, 149, 150, - 151, 151, 151, 152, 152, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 154, 154, 155, - 155, 156, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 159, 160, - 160, 160, 160, 161, 162, 162, 163, 163, 164, 164, - 164, 164, 164, 164, 165, 165, 165, 165, 166, 167, - 167, 167, 168, 168, 169, 169, 170, 170, 171, 172, - 172, 173, 173, 173, 174, 175, 176, 177, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 189, 190, - 190, 191, 192, 193, 194, 194, 195, 195, 196, 197 - }; - - 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, 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, 2, 2, - 2, 2, 2, 2, 1, 1, 2, 2, 4, 6, - 5, 7, 5, 7, 8, 9, 9, 9, 3, 3, - 1, 0, 1, 0, 3, 1, 2, 3, 3, 3, - 1, 1, 1, 1, 4, 3, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, - 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 7, 2, 1, 2, 1, 1, 1 - }; - - - - -#if IW7DEBUG - const short - parser::yyrline_[] = - { - 0, 261, 261, 262, 266, 268, 270, 272, 274, 276, - 281, 285, 290, 291, 292, 293, 294, 298, 303, 308, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 340, 341, 345, 347, 352, 354, - 359, 360, 364, 365, 369, 371, 373, 376, 380, 382, - 387, 389, 391, 396, 401, 403, 408, 413, 415, 420, - 422, 427, 432, 437, 442, 447, 452, 457, 459, 464, - 469, 471, 476, 481, 486, 491, 493, 498, 503, 508, - 513, 514, 515, 519, 520, 524, 526, 528, 530, 532, - 534, 536, 538, 540, 542, 544, 546, 551, 553, 558, - 560, 565, 570, 572, 574, 576, 578, 580, 582, 584, - 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, - 629, 630, 631, 632, 633, 634, 635, 636, 640, 645, - 647, 649, 651, 656, 661, 662, 665, 666, 670, 672, - 674, 676, 678, 680, 685, 687, 689, 691, 696, 701, - 703, 706, 710, 713, 717, 719, 724, 726, 731, 736, - 738, 743, 744, 745, 749, 754, 759, 764, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 781, 786, 791, - 796, 801, 806, 811, 816, 821, 826, 831, 833, 838, - 840, 845, 850, 855, 860, 862, 867, 869, 874, 879 - }; - - 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 // IW7DEBUG - - -#line 13 "parser.ypp" -} } } // xsk::gsc::iw7 -#line 4661 "parser.cpp" - -#line 883 "parser.ypp" - - -void xsk::gsc::iw7::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/src/iw7/xsk/parser.hpp b/src/iw7/xsk/parser.hpp deleted file mode 100644 index 4b2e5bbc..00000000 --- a/src/iw7/xsk/parser.hpp +++ /dev/null @@ -1,5550 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// 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::gsc::iw7::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_IW7_PARSER_HPP_INCLUDED -# define YY_IW7_PARSER_HPP_INCLUDED -// "%code requires" blocks. -#line 28 "parser.ypp" - -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw7.hpp" -namespace xsk::gsc::iw7 { class lexer; } - -#line 58 "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 IW7_ASSERT -# include -# define IW7_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 - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# 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 IW7DEBUG -# if defined YYDEBUG -#if YYDEBUG -# define IW7DEBUG 1 -# else -# define IW7DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define IW7DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined IW7DEBUG */ - -#line 13 "parser.ypp" -namespace xsk { namespace gsc { namespace iw7 { -#line 207 "parser.hpp" - - - - - /// A Bison parser. - class parser - { - public: -#ifdef IW7STYPE -# ifdef __GNUC__ -# pragma GCC message "bison: do not #define IW7STYPE in C++, use %define api.value.type" -# endif - typedef IW7STYPE value_type; -#else - /// 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 value_type - { - public: - /// Type of *this. - typedef value_type self_type; - - /// Empty construction. - value_type () YY_NOEXCEPT - : yyraw_ () - , yytypeid_ (YY_NULLPTR) - {} - - /// Construct and fill. - template - value_type (YY_RVREF (T) t) - : yytypeid_ (&typeid (T)) - { - IW7_ASSERT (sizeof (T) <= size); - new (yyas_ ()) T (YY_MOVE (t)); - } - -#if 201103L <= YY_CPLUSPLUS - /// Non copyable. - value_type (const self_type&) = delete; - /// Non copyable. - self_type& operator= (const self_type&) = delete; -#endif - - /// Destruction, allowed only if empty. - ~value_type () YY_NOEXCEPT - { - IW7_ASSERT (!yytypeid_); - } - -# if 201103L <= YY_CPLUSPLUS - /// Instantiate a \a T in here from \a t. - template - T& - emplace (U&&... u) - { - IW7_ASSERT (!yytypeid_); - IW7_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 () - { - IW7_ASSERT (!yytypeid_); - IW7_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) - { - IW7_ASSERT (!yytypeid_); - IW7_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 - { - IW7_ASSERT (yytypeid_); - IW7_ASSERT (*yytypeid_ == typeid (T)); - IW7_ASSERT (sizeof (T) <= size); - return *yyas_ (); - } - - /// Const accessor to a built \a T (for %printer). - template - const T& - as () const YY_NOEXCEPT - { - IW7_ASSERT (yytypeid_); - IW7_ASSERT (*yytypeid_ == typeid (T)); - IW7_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 - { - IW7_ASSERT (yytypeid_); - IW7_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. - value_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 = yyraw_; - return static_cast (yyp); - } - - /// Const accessor to raw memory as \a T. - template - const T* - yyas_ () const YY_NOEXCEPT - { - const void *yyp = 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_tuple - // expr_tuple_types - // expr_object - char dummy6[sizeof (ast::expr)]; - - // expr_add_array - char dummy7[sizeof (ast::expr_add_array::ptr)]; - - // expr_anim - char dummy8[sizeof (ast::expr_anim::ptr)]; - - // expr_animation - char dummy9[sizeof (ast::expr_animation::ptr)]; - - // expr_animtree - char dummy10[sizeof (ast::expr_animtree::ptr)]; - - // expr_arguments - // expr_arguments_no_empty - char dummy11[sizeof (ast::expr_arguments::ptr)]; - - // expr_array - char dummy12[sizeof (ast::expr_array::ptr)]; - - // expr_call - char dummy13[sizeof (ast::expr_call::ptr)]; - - // expr_complement - char dummy14[sizeof (ast::expr_complement::ptr)]; - - // expr_empty_array - char dummy15[sizeof (ast::expr_empty_array::ptr)]; - - // expr_false - char dummy16[sizeof (ast::expr_false::ptr)]; - - // expr_field - char dummy17[sizeof (ast::expr_field::ptr)]; - - // expr_float - char dummy18[sizeof (ast::expr_float::ptr)]; - - // expr_game - char dummy19[sizeof (ast::expr_game::ptr)]; - - // expr_identifier_nosize - // expr_identifier - char dummy20[sizeof (ast::expr_identifier::ptr)]; - - // expr_integer - char dummy21[sizeof (ast::expr_integer::ptr)]; - - // expr_istring - char dummy22[sizeof (ast::expr_istring::ptr)]; - - // expr_level - char dummy23[sizeof (ast::expr_level::ptr)]; - - // expr_method - char dummy24[sizeof (ast::expr_method::ptr)]; - - // expr_negate - char dummy25[sizeof (ast::expr_negate::ptr)]; - - // expr_not - char dummy26[sizeof (ast::expr_not::ptr)]; - - // expr_parameters - char dummy27[sizeof (ast::expr_parameters::ptr)]; - - // expr_paren - char dummy28[sizeof (ast::expr_paren::ptr)]; - - // expr_path - char dummy29[sizeof (ast::expr_path::ptr)]; - - // expr_reference - char dummy30[sizeof (ast::expr_reference::ptr)]; - - // expr_self - char dummy31[sizeof (ast::expr_self::ptr)]; - - // expr_size - char dummy32[sizeof (ast::expr_size::ptr)]; - - // expr_string - char dummy33[sizeof (ast::expr_string::ptr)]; - - // expr_thisthread - char dummy34[sizeof (ast::expr_thisthread::ptr)]; - - // expr_true - char dummy35[sizeof (ast::expr_true::ptr)]; - - // expr_tuple_arguments - char dummy36[sizeof (ast::expr_tuple::ptr)]; - - // expr_undefined - char dummy37[sizeof (ast::expr_undefined::ptr)]; - - // expr_vector - char dummy38[sizeof (ast::expr_vector::ptr)]; - - // include - char dummy39[sizeof (ast::include::ptr)]; - - // program - char dummy40[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy41[sizeof (ast::stmt)]; - - // stmt_assign - char dummy42[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy43[sizeof (ast::stmt_break::ptr)]; - - // stmt_breakpoint - char dummy44[sizeof (ast::stmt_breakpoint::ptr)]; - - // stmt_call - char dummy45[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy46[sizeof (ast::stmt_case::ptr)]; - - // stmt_continue - char dummy47[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy48[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy49[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy50[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy51[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy52[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy53[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy54[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy55[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy56[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy57[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy58[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy59[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy60[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy61[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy62[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy63[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waittill - char dummy64[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy65[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy66[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy67[sizeof (ast::stmt_while::ptr)]; - - // "path" - // "identifier" - // "string literal" - // "localized string" - // "float" - // "integer" - char dummy68[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]; - }; - - /// Whether the content is built: if defined, the name of the stored type. - const std::type_info *yytypeid_; - }; - -#endif - /// Backward compatibility (Bison 3.8). - typedef value_type semantic_type; - - /// Symbol locations. - typedef xsk::gsc::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 - { - IW7EMPTY = -2, - IW7EOF = 0, // "end of file" - IW7error = 1, // error - IW7UNDEF = 2, // "invalid token" - SH_DEFINE = 3, // "#define" - SH_UNDEF = 4, // "#undef" - SH_IFDEF = 5, // "#ifdef" - SH_IFNDEF = 6, // "#ifndef" - SH_IF = 7, // "#if" - SH_ELIF = 8, // "#elif" - SH_ELSE = 9, // "#else" - SH_ENDIF = 10, // "#endif" - DEVBEGIN = 11, // "/#" - DEVEND = 12, // "#/" - INLINE = 13, // "#inline" - INCLUDE = 14, // "#include" - USINGTREE = 15, // "#using_animtree" - ANIMTREE = 16, // "#animtree" - ENDON = 17, // "endon" - NOTIFY = 18, // "notify" - WAIT = 19, // "wait" - WAITTILL = 20, // "waittill" - WAITTILLMATCH = 21, // "waittillmatch" - WAITTILLFRAMEEND = 22, // "waittillframeend" - IF = 23, // "if" - ELSE = 24, // "else" - DO = 25, // "do" - WHILE = 26, // "while" - FOR = 27, // "for" - FOREACH = 28, // "foreach" - IN = 29, // "in" - SWITCH = 30, // "switch" - CASE = 31, // "case" - DEFAULT = 32, // "default" - BREAK = 33, // "break" - CONTINUE = 34, // "continue" - RETURN = 35, // "return" - BREAKPOINT = 36, // "breakpoint" - PROFBEGIN = 37, // "prof_begin" - PROFEND = 38, // "prof_end" - THREAD = 39, // "thread" - CHILDTHREAD = 40, // "childthread" - THISTHREAD = 41, // "thisthread" - CALL = 42, // "call" - TRUE = 43, // "true" - FALSE = 44, // "false" - UNDEFINED = 45, // "undefined" - SIZE = 46, // "size" - GAME = 47, // "game" - SELF = 48, // "self" - ANIM = 49, // "anim" - LEVEL = 50, // "level" - LPAREN = 51, // "(" - RPAREN = 52, // ")" - LBRACE = 53, // "{" - RBRACE = 54, // "}" - LBRACKET = 55, // "[" - RBRACKET = 56, // "]" - COMMA = 57, // "," - DOT = 58, // "." - DOUBLECOLON = 59, // "::" - COLON = 60, // ":" - SEMICOLON = 61, // ";" - QMARK = 62, // "?" - INCREMENT = 63, // "++" - DECREMENT = 64, // "--" - LSHIFT = 65, // "<<" - RSHIFT = 66, // ">>" - OR = 67, // "||" - AND = 68, // "&&" - EQUALITY = 69, // "==" - INEQUALITY = 70, // "!=" - LESS_EQUAL = 71, // "<=" - GREATER_EQUAL = 72, // ">=" - LESS = 73, // "<" - GREATER = 74, // ">" - NOT = 75, // "!" - COMPLEMENT = 76, // "~" - ASSIGN = 77, // "=" - ASSIGN_ADD = 78, // "+=" - ASSIGN_SUB = 79, // "-=" - ASSIGN_MUL = 80, // "*=" - ASSIGN_DIV = 81, // "/=" - ASSIGN_MOD = 82, // "%=" - ASSIGN_BW_OR = 83, // "|=" - ASSIGN_BW_AND = 84, // "&=" - ASSIGN_BW_EXOR = 85, // "^=" - ASSIGN_RSHIFT = 86, // ">>=" - ASSIGN_LSHIFT = 87, // "<<=" - BITWISE_OR = 88, // "|" - BITWISE_AND = 89, // "&" - BITWISE_EXOR = 90, // "^" - ADD = 91, // "+" - SUB = 92, // "-" - MUL = 93, // "*" - DIV = 94, // "/" - MOD = 95, // "%" - PATH = 96, // "path" - IDENTIFIER = 97, // "identifier" - STRING = 98, // "string literal" - ISTRING = 99, // "localized string" - FLOAT = 100, // "float" - INTEGER = 101, // "integer" - SIZEOF = 102, // SIZEOF - ADD_ARRAY = 103, // ADD_ARRAY - THEN = 104, // THEN - TERN = 105, // TERN - NEG = 106, // NEG - ANIMREF = 107, // ANIMREF - PREINC = 108, // PREINC - PREDEC = 109, // PREDEC - POSTINC = 110, // POSTINC - POSTDEC = 111 // POSTDEC - }; - /// Backward compatibility alias (Bison 3.6). - typedef token_kind_type yytokentype; - }; - - /// Token kind, as returned by yylex. - typedef token::token_kind_type 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 = 112, ///< Number of tokens. - S_YYEMPTY = -2, - S_YYEOF = 0, // "end of file" - S_YYerror = 1, // error - S_YYUNDEF = 2, // "invalid token" - S_SH_DEFINE = 3, // "#define" - S_SH_UNDEF = 4, // "#undef" - S_SH_IFDEF = 5, // "#ifdef" - S_SH_IFNDEF = 6, // "#ifndef" - S_SH_IF = 7, // "#if" - S_SH_ELIF = 8, // "#elif" - S_SH_ELSE = 9, // "#else" - S_SH_ENDIF = 10, // "#endif" - S_DEVBEGIN = 11, // "/#" - S_DEVEND = 12, // "#/" - S_INLINE = 13, // "#inline" - S_INCLUDE = 14, // "#include" - S_USINGTREE = 15, // "#using_animtree" - S_ANIMTREE = 16, // "#animtree" - S_ENDON = 17, // "endon" - S_NOTIFY = 18, // "notify" - S_WAIT = 19, // "wait" - S_WAITTILL = 20, // "waittill" - S_WAITTILLMATCH = 21, // "waittillmatch" - S_WAITTILLFRAMEEND = 22, // "waittillframeend" - S_IF = 23, // "if" - S_ELSE = 24, // "else" - S_DO = 25, // "do" - S_WHILE = 26, // "while" - S_FOR = 27, // "for" - S_FOREACH = 28, // "foreach" - S_IN = 29, // "in" - S_SWITCH = 30, // "switch" - S_CASE = 31, // "case" - S_DEFAULT = 32, // "default" - S_BREAK = 33, // "break" - S_CONTINUE = 34, // "continue" - S_RETURN = 35, // "return" - S_BREAKPOINT = 36, // "breakpoint" - S_PROFBEGIN = 37, // "prof_begin" - S_PROFEND = 38, // "prof_end" - S_THREAD = 39, // "thread" - S_CHILDTHREAD = 40, // "childthread" - S_THISTHREAD = 41, // "thisthread" - S_CALL = 42, // "call" - S_TRUE = 43, // "true" - S_FALSE = 44, // "false" - S_UNDEFINED = 45, // "undefined" - S_SIZE = 46, // "size" - S_GAME = 47, // "game" - S_SELF = 48, // "self" - S_ANIM = 49, // "anim" - S_LEVEL = 50, // "level" - S_LPAREN = 51, // "(" - S_RPAREN = 52, // ")" - S_LBRACE = 53, // "{" - S_RBRACE = 54, // "}" - S_LBRACKET = 55, // "[" - S_RBRACKET = 56, // "]" - S_COMMA = 57, // "," - S_DOT = 58, // "." - S_DOUBLECOLON = 59, // "::" - S_COLON = 60, // ":" - S_SEMICOLON = 61, // ";" - S_QMARK = 62, // "?" - S_INCREMENT = 63, // "++" - S_DECREMENT = 64, // "--" - S_LSHIFT = 65, // "<<" - S_RSHIFT = 66, // ">>" - S_OR = 67, // "||" - S_AND = 68, // "&&" - S_EQUALITY = 69, // "==" - S_INEQUALITY = 70, // "!=" - S_LESS_EQUAL = 71, // "<=" - S_GREATER_EQUAL = 72, // ">=" - S_LESS = 73, // "<" - S_GREATER = 74, // ">" - S_NOT = 75, // "!" - S_COMPLEMENT = 76, // "~" - S_ASSIGN = 77, // "=" - S_ASSIGN_ADD = 78, // "+=" - S_ASSIGN_SUB = 79, // "-=" - S_ASSIGN_MUL = 80, // "*=" - S_ASSIGN_DIV = 81, // "/=" - S_ASSIGN_MOD = 82, // "%=" - S_ASSIGN_BW_OR = 83, // "|=" - S_ASSIGN_BW_AND = 84, // "&=" - S_ASSIGN_BW_EXOR = 85, // "^=" - S_ASSIGN_RSHIFT = 86, // ">>=" - S_ASSIGN_LSHIFT = 87, // "<<=" - S_BITWISE_OR = 88, // "|" - S_BITWISE_AND = 89, // "&" - S_BITWISE_EXOR = 90, // "^" - S_ADD = 91, // "+" - S_SUB = 92, // "-" - S_MUL = 93, // "*" - S_DIV = 94, // "/" - S_MOD = 95, // "%" - S_PATH = 96, // "path" - S_IDENTIFIER = 97, // "identifier" - S_STRING = 98, // "string literal" - S_ISTRING = 99, // "localized string" - S_FLOAT = 100, // "float" - S_INTEGER = 101, // "integer" - S_SIZEOF = 102, // SIZEOF - S_ADD_ARRAY = 103, // ADD_ARRAY - S_THEN = 104, // THEN - S_TERN = 105, // TERN - S_NEG = 106, // NEG - S_ANIMREF = 107, // ANIMREF - S_PREINC = 108, // PREINC - S_PREDEC = 109, // PREDEC - S_POSTINC = 110, // POSTINC - S_POSTDEC = 111, // POSTDEC - S_YYACCEPT = 112, // $accept - S_root = 113, // root - S_program = 114, // program - S_inline = 115, // inline - S_include = 116, // include - S_declaration = 117, // declaration - S_decl_usingtree = 118, // decl_usingtree - S_decl_constant = 119, // decl_constant - S_decl_thread = 120, // decl_thread - S_stmt = 121, // stmt - S_stmt_or_dev = 122, // stmt_or_dev - S_stmt_list = 123, // stmt_list - S_stmt_or_dev_list = 124, // stmt_or_dev_list - S_stmt_dev = 125, // stmt_dev - S_stmt_block = 126, // stmt_block - S_stmt_expr = 127, // stmt_expr - S_stmt_call = 128, // stmt_call - S_stmt_assign = 129, // stmt_assign - S_stmt_endon = 130, // stmt_endon - S_stmt_notify = 131, // stmt_notify - S_stmt_wait = 132, // stmt_wait - S_stmt_waittill = 133, // stmt_waittill - S_stmt_waittillmatch = 134, // stmt_waittillmatch - S_stmt_waittillframeend = 135, // stmt_waittillframeend - S_stmt_if = 136, // stmt_if - S_stmt_ifelse = 137, // stmt_ifelse - S_stmt_while = 138, // stmt_while - S_stmt_dowhile = 139, // stmt_dowhile - S_stmt_for = 140, // stmt_for - S_stmt_foreach = 141, // stmt_foreach - S_stmt_switch = 142, // stmt_switch - S_stmt_case = 143, // stmt_case - S_stmt_default = 144, // stmt_default - S_stmt_break = 145, // stmt_break - S_stmt_continue = 146, // stmt_continue - S_stmt_return = 147, // stmt_return - S_stmt_breakpoint = 148, // stmt_breakpoint - S_stmt_prof_begin = 149, // stmt_prof_begin - S_stmt_prof_end = 150, // stmt_prof_end - S_expr = 151, // expr - S_expr_or_empty = 152, // expr_or_empty - S_expr_assign = 153, // expr_assign - S_expr_increment = 154, // expr_increment - S_expr_decrement = 155, // expr_decrement - S_expr_ternary = 156, // expr_ternary - S_expr_binary = 157, // expr_binary - S_expr_primitive = 158, // expr_primitive - S_expr_complement = 159, // expr_complement - S_expr_negate = 160, // expr_negate - S_expr_not = 161, // expr_not - S_expr_call = 162, // expr_call - S_expr_method = 163, // expr_method - S_expr_function = 164, // expr_function - S_expr_pointer = 165, // expr_pointer - S_expr_add_array = 166, // expr_add_array - S_expr_parameters = 167, // expr_parameters - S_expr_arguments = 168, // expr_arguments - S_expr_arguments_no_empty = 169, // expr_arguments_no_empty - S_expr_reference = 170, // expr_reference - S_expr_tuple = 171, // expr_tuple - S_expr_tuple_arguments = 172, // expr_tuple_arguments - S_expr_tuple_types = 173, // expr_tuple_types - S_expr_array = 174, // expr_array - S_expr_field = 175, // expr_field - S_expr_size = 176, // expr_size - S_expr_paren = 177, // expr_paren - S_expr_object = 178, // expr_object - S_expr_thisthread = 179, // expr_thisthread - S_expr_empty_array = 180, // expr_empty_array - S_expr_undefined = 181, // expr_undefined - S_expr_game = 182, // expr_game - S_expr_self = 183, // expr_self - S_expr_anim = 184, // expr_anim - S_expr_level = 185, // expr_level - S_expr_animation = 186, // expr_animation - S_expr_animtree = 187, // expr_animtree - S_expr_identifier_nosize = 188, // expr_identifier_nosize - S_expr_identifier = 189, // expr_identifier - S_expr_path = 190, // expr_path - S_expr_istring = 191, // expr_istring - S_expr_string = 192, // expr_string - S_expr_vector = 193, // expr_vector - S_expr_float = 194, // expr_float - S_expr_integer = 195, // expr_integer - S_expr_false = 196, // expr_false - S_expr_true = 197 // 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 () YY_NOEXCEPT - : 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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_add_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_add_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_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_animtree::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_animtree::ptr& v, const location_type& l) - : 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_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_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_negate::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l) - : 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_thisthread::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_thisthread::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_tuple::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_tuple::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::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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.template destroy< ast::expr_add_array::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_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.template destroy< ast::expr_negate::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_thisthread: // expr_thisthread - value.template destroy< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.template destroy< ast::expr_tuple::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_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_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_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. - value_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 - { - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; - - /// Default constructor. - by_kind () YY_NOEXCEPT; - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that) YY_NOEXCEPT; -#endif - - /// Copy constructor. - by_kind (const by_kind& that) YY_NOEXCEPT; - - /// Constructor from (external) token numbers. - by_kind (kind_type t) YY_NOEXCEPT; - - - - /// 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 () YY_NOEXCEPT {} - - /// Constructor for valueless symbols, and symbols from each type. -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, location_type l) - : super_type (token_kind_type (tok), std::move (l)) -#else - symbol_type (int tok, const location_type& l) - : super_type (token_kind_type (tok), l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - IW7_ASSERT (tok == token::IW7EOF - || (token::IW7error <= tok && tok <= token::MOD) - || (token::SIZEOF <= tok && tok <= token::POSTDEC)); -#endif - } -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, std::string v, location_type l) - : super_type (token_kind_type (tok), std::move (v), std::move (l)) -#else - symbol_type (int tok, const std::string& v, const location_type& l) - : super_type (token_kind_type (tok), v, l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - IW7_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); -#endif - } - }; - - /// Build a parser object. - parser (xsk::gsc::iw7::lexer& lexer_yyarg, xsk::gsc::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 IW7DEBUG - /// 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 token kind. -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW7EOF (location_type l) - { - return symbol_type (token::IW7EOF, std::move (l)); - } -#else - static - symbol_type - make_IW7EOF (const location_type& l) - { - return symbol_type (token::IW7EOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW7error (location_type l) - { - return symbol_type (token::IW7error, std::move (l)); - } -#else - static - symbol_type - make_IW7error (const location_type& l) - { - return symbol_type (token::IW7error, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW7UNDEF (location_type l) - { - return symbol_type (token::IW7UNDEF, std::move (l)); - } -#else - static - symbol_type - make_IW7UNDEF (const location_type& l) - { - return symbol_type (token::IW7UNDEF, 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_ANIMTREE (location_type l) - { - return symbol_type (token::ANIMTREE, std::move (l)); - } -#else - static - symbol_type - make_ANIMTREE (const location_type& l) - { - return symbol_type (token::ANIMTREE, 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_CHILDTHREAD (location_type l) - { - return symbol_type (token::CHILDTHREAD, std::move (l)); - } -#else - static - symbol_type - make_CHILDTHREAD (const location_type& l) - { - return symbol_type (token::CHILDTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_THISTHREAD (location_type l) - { - return symbol_type (token::THISTHREAD, std::move (l)); - } -#else - static - symbol_type - make_THISTHREAD (const location_type& l) - { - return symbol_type (token::THISTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_CALL (location_type l) - { - return symbol_type (token::CALL, std::move (l)); - } -#else - static - symbol_type - make_CALL (const location_type& l) - { - return symbol_type (token::CALL, 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_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_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_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_SIZEOF (location_type l) - { - return symbol_type (token::SIZEOF, std::move (l)); - } -#else - static - symbol_type - make_SIZEOF (const location_type& l) - { - return symbol_type (token::SIZEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_ADD_ARRAY (location_type l) - { - return symbol_type (token::ADD_ARRAY, std::move (l)); - } -#else - static - symbol_type - make_ADD_ARRAY (const location_type& l) - { - return symbol_type (token::ADD_ARRAY, 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) YY_NOEXCEPT; - - /// 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) YY_NOEXCEPT; - - 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_kind_type enum. - static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; - - - - // 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 symbol kind of the accessing symbol of - // state STATE-NUM. - static const unsigned char yystos_[]; - - // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. - static const unsigned char yyr1_[]; - - // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. - static const signed char yyr2_[]; - - -#if IW7DEBUG - // 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT; - - /// Constants. - enum - { - yylast_ = 2371, ///< Last index in yytable_. - yynnts_ = 86, ///< Number of nonterminal symbols. - yyfinal_ = 22 ///< Termination state number. - }; - - - // User arguments. - xsk::gsc::iw7::lexer& lexer; - xsk::gsc::ast::program::ptr& ast; - - }; - - inline - parser::symbol_kind_type - parser::yytranslate_ (int t) YY_NOEXCEPT - { - 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::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_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); - 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_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_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_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 () YY_NOEXCEPT - : kind_ (symbol_kind::S_YYEMPTY) - {} - -#if 201103L <= YY_CPLUSPLUS - inline - parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT - : kind_ (that.kind_) - { - that.clear (); - } -#endif - - inline - parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT - : kind_ (that.kind_) - {} - - inline - parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT - : 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::gsc::iw7 -#line 5546 "parser.hpp" - - - - -#endif // !YY_IW7_PARSER_HPP_INCLUDED diff --git a/src/iw7/xsk/resolver.hpp b/src/iw7/xsk/resolver.hpp deleted file mode 100644 index ab804781..00000000 --- a/src/iw7/xsk/resolver.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::iw7 -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint32_t; - static auto token_name(std::uint32_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::gsc::iw7 diff --git a/src/iw8/iw8.cpp b/src/iw8/iw8.cpp new file mode 100644 index 00000000..03e2be2b --- /dev/null +++ b/src/iw8/iw8.cpp @@ -0,0 +1,53 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw8.hpp" + +namespace xsk::gsc::iw8 +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::str4 | props::tok4 | props::waitframe | props::params | props::boolfuncs | props::boolnotand | props::offs8, + engine::iw8, endian::little, system::pc, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::iw8 diff --git a/src/iw8/iw8.hpp b/src/iw8/iw8.hpp new file mode 100644 index 00000000..7a0e4dcd --- /dev/null +++ b/src/iw8/iw8.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::iw8 +{ + +constexpr usize code_count = 190; +constexpr usize func_count = 1065; +constexpr usize meth_count = 2032; +constexpr usize token_count = 72014; +constexpr u32 max_string_id = 0x1472F; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::iw8 diff --git a/src/iw8/iw8_code.cpp b/src/iw8/iw8_code.cpp new file mode 100644 index 00000000..23478965 --- /dev/null +++ b/src/iw8/iw8_code.cpp @@ -0,0 +1,205 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw8.hpp" + +namespace xsk::gsc::iw8 +{ + +extern std::array, code_count> const code_list +{{ + { 0x00, opcode::OP_CastFieldObject }, + { 0x01, opcode::OP_SetLocalVariableFieldCached }, + { 0x02, opcode::OP_plus }, + { 0x03, opcode::OP_RemoveLocalVariables }, + { 0x04, opcode::OP_EvalSelfFieldVariableRef }, + { 0x05, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x06, opcode::OP_GetGameRef }, + { 0x07, opcode::OP_EvalAnimFieldVariable }, + { 0x08, opcode::OP_EvalLevelFieldVariableRef }, + { 0x09, opcode::OP_GetThisthread }, + { 0x0A, opcode::OP_greater }, + { 0x0B, opcode::OP_waittillmatch }, + { 0x0C, opcode::OP_shift_right }, + { 0x0D, opcode::OP_dec }, + { 0x0E, opcode::OP_JumpOnTrue }, + { 0x0F, opcode::OP_bit_or }, + { 0x10, opcode::OP_equality }, + { 0x11, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x12, opcode::OP_notify }, + { 0x13, opcode::OP_GetVector }, + { 0x14, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x15, opcode::OP_PreScriptCall }, + { 0x16, opcode::OP_GetByte }, + { 0x17, opcode::OP_ScriptFarThreadCall }, + { 0x18, opcode::OP_SetSelfFieldVariableField }, + { 0x19, opcode::OP_JumpOnFalseExpr }, + { 0x1A, opcode::OP_GetUndefined }, + { 0x1B, opcode::OP_jumpback }, + { 0x1C, opcode::OP_JumpOnTrueExpr }, + { 0x1D, opcode::OP_CallBuiltin0 }, + { 0x1E, opcode::OP_CallBuiltin1 }, + { 0x1F, opcode::OP_CallBuiltin2 }, + { 0x20, opcode::OP_CallBuiltin3 }, + { 0x21, opcode::OP_CallBuiltin4 }, + { 0x22, opcode::OP_CallBuiltin5 }, + { 0x23, opcode::OP_CallBuiltin }, + { 0x24, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x25, opcode::OP_ClearFieldVariable }, + { 0x26, opcode::OP_GetLevel }, + { 0x27, opcode::OP_size }, + { 0x28, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x29, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x2A, opcode::OP_AddArray }, + { 0x2B, opcode::OP_endon }, + { 0x2C, opcode::OP_EvalFieldVariable }, + { 0x2D, opcode::OP_shift_left }, + { 0x2E, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x2F, opcode::OP_Return }, + { 0x30, opcode::OP_CreateLocalVariable }, + { 0x31, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x32, opcode::OP_GetBuiltinFunction }, + { 0x33, opcode::OP_ScriptLocalMethodCall }, + { 0x34, opcode::OP_CallBuiltinMethodPointer }, + { 0x35, opcode::OP_ScriptLocalChildThreadCall }, + { 0x36, opcode::OP_GetSelfObject }, + { 0x37, opcode::OP_GetGame }, + { 0x38, opcode::OP_SetLevelFieldVariableField }, + { 0x39, opcode::OP_EvalArray }, + { 0x3A, opcode::OP_GetSelf }, + { 0x3B, opcode::OP_End }, + { 0x3C, opcode::OP_EvalSelfFieldVariable }, + { 0x3D, opcode::OP_less_equal }, + { 0x3E, opcode::OP_EvalLocalVariableCached0 }, + { 0x3F, opcode::OP_EvalLocalVariableCached1 }, + { 0x40, opcode::OP_EvalLocalVariableCached2 }, + { 0x41, opcode::OP_EvalLocalVariableCached3 }, + { 0x42, opcode::OP_EvalLocalVariableCached4 }, + { 0x43, opcode::OP_EvalLocalVariableCached5 }, + { 0x44, opcode::OP_EvalLocalVariableCached }, + { 0x45, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x46, opcode::OP_ScriptChildThreadCallPointer }, + { 0x47, opcode::OP_EvalLocalVariableObjectCached }, + { 0x48, opcode::OP_ScriptLocalThreadCall }, + { 0x49, opcode::OP_GetInteger }, + { 0x4A, opcode::OP_ScriptMethodCallPointer }, + { 0x4B, opcode::OP_checkclearparams }, + { 0x4C, opcode::OP_SetAnimFieldVariableField }, + { 0x4D, opcode::OP_waittillmatch2 }, + { 0x4E, opcode::OP_minus }, + { 0x4F, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x50, opcode::OP_GetNegUnsignedShort }, + { 0x51, opcode::OP_GetNegByte }, + { 0x52, opcode::OP_SafeCreateVariableFieldCached }, + { 0x53, opcode::OP_greater_equal }, + { 0x54, opcode::OP_vector }, + { 0x55, opcode::OP_GetBuiltinMethod }, + { 0x56, opcode::OP_endswitch }, + { 0x57, opcode::OP_ClearArray }, + { 0x58, opcode::OP_DecTop }, + { 0x59, opcode::OP_CastBool }, + { 0x5A, opcode::OP_EvalArrayRef }, + { 0x5B, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x5C, opcode::OP_GetZero }, + { 0x5D, opcode::OP_wait }, + { 0x5E, opcode::OP_waittill }, + { 0x5F, opcode::OP_GetIString }, + { 0x60, opcode::OP_ScriptFarFunctionCall }, + { 0x61, opcode::OP_GetAnimObject }, + { 0x62, opcode::OP_GetAnimTree }, + { 0x63, opcode::OP_EvalLocalArrayCached }, + { 0x64, opcode::OP_mod }, + { 0x65, opcode::OP_ScriptFarMethodThreadCall }, + { 0x66, opcode::OP_GetUnsignedShort }, + { 0x67, opcode::OP_clearparams }, + { 0x68, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x69, opcode::OP_ScriptFunctionCallPointer }, + { 0x6A, opcode::OP_EmptyArray }, + { 0x6B, opcode::OP_SafeSetVariableFieldCached }, + { 0x6C, opcode::OP_ClearVariableField }, + { 0x6D, opcode::OP_EvalFieldVariableRef }, + { 0x6E, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x6F, opcode::OP_EvalNewLocalVariableRefCached0 }, + { 0x70, opcode::OP_GetFloat }, + { 0x71, opcode::OP_EvalLocalVariableRefCached }, + { 0x72, opcode::OP_JumpOnFalse }, + { 0x73, opcode::OP_BoolComplement }, + { 0x74, opcode::OP_ScriptThreadCallPointer }, + { 0x75, opcode::OP_ScriptFarFunctionCall2 }, + { 0x76, opcode::OP_less }, + { 0x77, opcode::OP_BoolNot }, + { 0x78, opcode::OP_waittillFrameEnd }, + { 0x79, opcode::OP_waitframe }, + { 0x7A, opcode::OP_GetString }, + { 0x7B, opcode::OP_EvalLevelFieldVariable }, + { 0x7C, opcode::OP_GetLevelObject }, + { 0x7D, opcode::OP_inc }, + { 0x7E, opcode::OP_CallBuiltinMethod0 }, + { 0x7F, opcode::OP_CallBuiltinMethod1 }, + { 0x80, opcode::OP_CallBuiltinMethod2 }, + { 0x81, opcode::OP_CallBuiltinMethod3 }, + { 0x82, opcode::OP_CallBuiltinMethod4 }, + { 0x83, opcode::OP_CallBuiltinMethod5 }, + { 0x84, opcode::OP_CallBuiltinMethod }, + { 0x85, opcode::OP_GetAnim }, + { 0x86, opcode::OP_switch }, + { 0x87, opcode::OP_SetVariableField }, + { 0x88, opcode::OP_divide }, + { 0x89, opcode::OP_GetLocalFunction }, + { 0x8A, opcode::OP_ScriptFarChildThreadCall }, + { 0x8B, opcode::OP_multiply }, + { 0x8C, opcode::OP_ClearLocalVariableFieldCached }, + { 0x8D, opcode::OP_EvalAnimFieldVariableRef }, + { 0x8E, opcode::OP_EvalLocalArrayRefCached }, + { 0x8F, opcode::OP_EvalLocalVariableRefCached0 }, + { 0x90, opcode::OP_bit_and }, + { 0x91, opcode::OP_GetAnimation }, + { 0x92, opcode::OP_GetFarFunction }, + { 0x93, opcode::OP_CallBuiltinPointer }, + { 0x94, opcode::OP_jump }, + { 0x95, opcode::OP_voidCodepos }, + { 0x96, opcode::OP_ScriptFarMethodCall }, + { 0x97, opcode::OP_inequality }, + { 0x98, opcode::OP_ScriptLocalFunctionCall }, + { 0x99, opcode::OP_bit_ex_or }, + { 0x9A, opcode::OP_NOP }, + { 0x9B, opcode::OP_abort }, + { 0x9C, opcode::OP_object }, + { 0x9D, opcode::OP_thread_object }, + { 0x9E, opcode::OP_EvalLocalVariable }, + { 0x9F, opcode::OP_EvalLocalVariableRef }, + { 0xA0, opcode::OP_prof_begin }, + { 0xA1, opcode::OP_prof_end }, + { 0xA2, opcode::OP_breakpoint }, + { 0xA3, opcode::OP_assignmentBreakpoint }, + { 0xA4, opcode::OP_manualAndAssignmentBreakpoint }, + { 0xA5, opcode::OP_BoolNotAfterAnd }, + { 0xA6, opcode::OP_FormalParams }, + { 0xA7, opcode::OP_IsDefined }, + { 0xA8, opcode::OP_IsTrue }, + { 0xA9, opcode::OP_NativeGetLocalFunction }, + { 0xAA, opcode::OP_NativeLocalFunctionCall }, + { 0xAB, opcode::OP_NativeLocalFunctionCall2 }, + { 0xAC, opcode::OP_NativeLocalMethodCall }, + { 0xAD, opcode::OP_NativeLocalFunctionThreadCall }, + { 0xAE, opcode::OP_NativeLocalMethodThreadCall }, + { 0xAF, opcode::OP_NativeLocalFunctionChildThreadCall }, + { 0xB0, opcode::OP_NativeLocalMethodChildThreadCall }, + { 0xB1, opcode::OP_NativeGetFarFunction }, + { 0xB2, opcode::OP_NativeFarFunctionCall }, + { 0xB3, opcode::OP_NativeFarFunctionCall2 }, + { 0xB4, opcode::OP_NativeFarMethodCall }, + { 0xB5, opcode::OP_NativeFarFunctionThreadCall }, + { 0xB6, opcode::OP_NativeFarMethodThreadCall }, + { 0xB7, opcode::OP_NativeFarFunctionChildThreadCall }, + { 0xB8, opcode::OP_NativeFarMethodChildThreadCall }, + { 0xB9, opcode::OP_EvalNewLocalArrayRefCached0_Precompiled }, + { 0xBA, opcode::OP_SetNewLocalVariableFieldCached0_Precompiled }, + { 0xBB, opcode::OP_CreateLocalVariable_Precompiled }, + { 0xBC, opcode::OP_SafeCreateVariableFieldCached_Precompiled }, + { 0xBD, opcode::OP_FormalParams_Precompiled }, +}}; + +} // namespace xsk::gsc::iw8 diff --git a/src/iw8/iw8_func.cpp b/src/iw8/iw8_func.cpp new file mode 100644 index 00000000..12dc54c5 --- /dev/null +++ b/src/iw8/iw8_func.cpp @@ -0,0 +1,1080 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw8.hpp" + +namespace xsk::gsc::iw8 +{ + +extern std::array, func_count> const func_list +{{ + { 0x001, "abs" }, + { 0x002, "acos" }, + { 0x003, "activateclientexploder" }, + { 0x004, "addagent" }, + { 0x005, "addbot" }, + { 0x006, "addtestclient" }, + { 0x007, "allclientsprint" }, + { 0x008, "ambientplay" }, + { 0x009, "ambientstop" }, + { 0x00A, "angleclamp" }, + { 0x00B, "angleclamp180" }, + { 0x00C, "anglesdelta" }, + { 0x00D, "anglestoaxis" }, + { 0x00E, "anglestoforward" }, + { 0x00F, "anglestoright" }, + { 0x010, "anglestoup" }, + { 0x011, "animhasnotetrack" }, + { 0x012, "announcement" }, + { 0x013, "asin" }, + { 0x014, "atan" }, + { 0x015, "averagenormal" }, + { 0x016, "averagepoint" }, + { 0x017, "axistoangles" }, + { 0x018, "badplace_cylinder" }, + { 0x019, "badplace_delete" }, + { 0x01A, "badplace_global" }, + { 0x01B, "bbprint" }, + { 0x01C, "blockteamradar" }, + { 0x01D, "botsystemstatus" }, + { 0x01E, "botdebugdrawtrigger" }, + { 0x01F, "botflagmemoryevents" }, + { 0x020, "botgetclosestnavigablepoint" }, + { 0x021, "botgetmemoryevents" }, + { 0x022, "botgetteamdifficulty" }, + { 0x023, "botgetteamlimit" }, + { 0x024, "botmemoryflags" }, + { 0x025, "botsentientswap" }, + { 0x026, "botzonegetcount" }, + { 0x027, "botzonegetindoorpercent" }, + { 0x028, "botzonenearestcount" }, + { 0x029, "botzonesetteam" }, + { 0x02A, "bulletspread" }, + { 0x02B, "bullettracer" }, + { 0x02C, "calccsplinecorridor" }, + { 0x02D, "calccsplineposition" }, + { 0x02E, "calccsplinetangent" }, + { 0x02F, "calcrockingangles" }, + { 0x030, "calculatestartorientation" }, + { 0x031, "canspawn" }, + { 0x032, "canspawnturret" }, + { 0x033, "capsuletracepassed" }, + { 0x034, "ceil" }, + { 0x035, "changelevel" }, + { 0x036, "cinematic" }, + { 0x037, "cinematicgetframe" }, + { 0x038, "cinematicgettimeinmsec" }, + { 0x039, "cinematicingame" }, + { 0x03A, "cinematicingameloop" }, + { 0x03B, "cinematicingameloopresident" }, + { 0x03C, "cinematicingamesync" }, + { 0x03D, "clamp" }, + { 0x03E, "clearallcorpses" }, + { 0x03F, "clearlocalizedstrings" }, + { 0x040, "clearmatchdata" }, + { 0x041, "clientannouncement" }, + { 0x042, "clientprint" }, + { 0x043, "closer" }, + { 0x044, "combineangles" }, + { 0x045, "commitsave" }, + { 0x046, "commitwouldbevalid" }, + { 0x047, "connectnodepair" }, + { 0x048, "cos" }, + { 0x049, "createnavlink" }, + { 0x04A, "createthreatbiasgroup" }, + { 0x04B, "deleteglass" }, + { 0x04C, "destroyglass" }, + { 0x04D, "destroynavlink" }, + { 0x04E, "devsetminimapdvarsettings" }, + { 0x04F, "disableaudiotrigger" }, + { 0x050, "disableforcedsunshadows" }, + { 0x051, "disableouterspacemodellighting" }, + { 0x052, "disablepaspeaker" }, + { 0x053, "disconnectnodepair" }, + { 0x054, "distance" }, + { 0x055, "distance2d" }, + { 0x056, "distance2dsquared" }, + { 0x057, "distancesquared" }, + { 0x058, "drawcompassfriendlies" }, + { 0x059, "earthquake" }, + { 0x05A, "enableaudiotrigger" }, + { 0x05B, "enableforcednosunshadows" }, + { 0x05C, "enableforcedsunshadows" }, + { 0x05D, "enableouterspacemodellighting" }, + { 0x05E, "enablepaspeaker" }, + { 0x05F, "endlobby" }, + { 0x060, "endparty" }, + { 0x061, "exitlevel" }, + { 0x062, "exp" }, + { 0x063, "findentrances" }, + { 0x064, "float" }, + { 0x065, "floor" }, + { 0x066, "gamedvrprohibitrecording" }, + { 0x067, "gamedvrprohibitscreenshots" }, + { 0x068, "gamedvrsetscreenshotmetadata" }, + { 0x069, "gamedvrsetvideometadata" }, + { 0x06A, "gamedvrstartrecording" }, + { 0x06B, "gamedvrstoprecording" }, + { 0x06C, "getactiveclientcount" }, + { 0x06D, "getaiarray" }, + { 0x06E, "getaiarrayinradius" }, + { 0x06F, "getaicount" }, + { 0x070, "getaispeciesarray" }, + { 0x071, "getaiunittypearray" }, + { 0x072, "getallnodes" }, + { 0x073, "getallvehiclenodes" }, + { 0x074, "getangledelta" }, + { 0x075, "getangledelta3d" }, + { 0x076, "getanimlength" }, + { 0x077, "getarraykeys" }, + { 0x078, "getassignedteam" }, + { 0x079, "getbrushmodelcenter" }, + { 0x07A, "getbuildnumber" }, + { 0x07B, "getbuildversion" }, + { 0x07C, "getclientmatchdata" }, + { 0x07D, "getclosestnodeinsight" }, + { 0x07E, "getcorpsearray" }, + { 0x07F, "getcorpsearrayinradius" }, + { 0x080, "getcountertotal" }, + { 0x081, "getcsplinecount" }, + { 0x082, "getcsplinelength" }, + { 0x083, "getcsplinepointcorridordims" }, + { 0x084, "getcsplinepointcount" }, + { 0x085, "getcsplinepointdisttonextpoint" }, + { 0x086, "getcsplinepointid" }, + { 0x087, "getcsplinepointlabel" }, + { 0x088, "getcsplinepointposition" }, + { 0x089, "getcsplinepointtangent" }, + { 0x08A, "getcsplinepointtension" }, + { 0x08B, "getculldist" }, + { 0x08C, "getcycleoriginoffset" }, + { 0x08D, "getdvar" }, + { 0x08E, "getdvarfloat" }, + { 0x08F, "getdvarint" }, + { 0x090, "getgamebattlematchreportstate" }, + { 0x091, "getdvarvector" }, + { 0x092, "getenemysquaddata" }, + { 0x093, "getenemysquaddogtype" }, + { 0x094, "getent" }, + { 0x095, "getentarray" }, + { 0x096, "getentarrayinradius" }, + { 0x097, "getentchannelname" }, + { 0x098, "getentchannelscount" }, + { 0x099, "getfirstarraykey" }, + { 0x09A, "getfreeaicount" }, + { 0x09B, "getfxvisibility" }, + { 0x09C, "getgametypeindex" }, + { 0x09D, "getglass" }, + { 0x09E, "getglassarray" }, + { 0x09F, "getglassorigin" }, + { 0x0A0, "getgroundposition" }, + { 0x0A1, "getindexforluincstring" }, + { 0x0A2, "getkeybinding" }, + { 0x0A3, "getlastarraykey" }, + { 0x0A4, "getlinkednodes" }, + { 0x0A5, "getmapsunangles" }, + { 0x0A6, "getmapsundirection" }, + { 0x0A7, "getmapsunlight" }, + { 0x0A8, "getmapsuncolorraw" }, + { 0x0A9, "getmapsuncolorandintensity" }, + { 0x0AA, "getmatchdata" }, + { 0x0AB, "getmatchrulesdata" }, + { 0x0AC, "getmaxagents" }, + { 0x0AD, "getmissileowner" }, + { 0x0AE, "getmovedelta" }, + { 0x0AF, "getnextarraykey" }, + { 0x0B0, "getnode" }, + { 0x0B1, "getnodearray" }, + { 0x0B2, "getnodesinradius" }, + { 0x0B3, "getnodesinradiussorted" }, + { 0x0B4, "getnodesintrigger" }, + { 0x0B5, "getnodesonpath" }, + { 0x0B6, "getnodezone" }, + { 0x0B7, "getnorthyaw" }, + { 0x0B8, "getnotetracktimes" }, + { 0x0B9, "getnumparts" }, + { 0x0BA, "getnumvehicles" }, + { 0x0BB, "getomnvar" }, + { 0x0BC, "getpartname" }, + { 0x0BD, "getanimname" }, + { 0x0BE, "getpathdist" }, + { 0x0BF, "getplaylistid" }, + { 0x0C0, "getplaylistversion" }, + { 0x0C1, "getpredictedentityposition" }, + { 0x0C2, "getprevarraykey" }, + { 0x0C3, "getscriptablearray" }, + { 0x0C4, "getscriptablearrayinradius" }, + { 0x0C5, "getspawnarray" }, + { 0x0C6, "getspawner" }, + { 0x0C7, "getspawnerarray" }, + { 0x0C8, "getspawnerteamarray" }, + { 0x0C9, "getsquadassaultelo" }, + { 0x0CA, "getsquadassaultenemyprestige" }, + { 0x0CB, "getsquadassaultsquadindex" }, + { 0x0CC, "getstartangles" }, + { 0x0CD, "getstartorigin" }, + { 0x0CE, "getstarttime" }, + { 0x0CF, "getsticksconfig" }, + { 0x0D0, "getsubstr" }, + { 0x0D1, "getsystemtime" }, + { 0x0D2, "getteamplayersalive" }, + { 0x0D3, "getteamradar" }, + { 0x0D4, "getteamradarstrength" }, + { 0x0D5, "getteamscore" }, + { 0x0D6, "getthreatbias" }, + { 0x0D7, "gettime" }, + { 0x0D8, "gettimescale" }, + { 0x0D9, "gettimesincelastpaused" }, + { 0x0DA, "getuavstrengthlevelneutral" }, + { 0x0DB, "getuavstrengthlevelshowenemydirectional" }, + { 0x0DC, "getuavstrengthlevelshowenemyfastsweep" }, + { 0x0DD, "getuavstrengthmax" }, + { 0x0DE, "getuavstrengthmin" }, + { 0x0DF, "getvehiclenode" }, + { 0x0E0, "getvehiclenodearray" }, + { 0x0E1, "getweaponammopoolname" }, + { 0x0E2, "getweaponarray" }, + { 0x0E3, "getweaponarrayinradius" }, + { 0x0E4, "getweaponattachments" }, + { 0x0E5, "getweaponattachmentworldmodels" }, + { 0x0E6, "getweaponbasename" }, + { 0x0E7, "getweaponcamoname" }, + { 0x0E8, "getweaponclipmodel" }, + { 0x0E9, "getweaponexplosionradius" }, + { 0x0EA, "getweaponflashtagname" }, + { 0x0EB, "getweaponhidetags" }, + { 0x0EC, "getweaponmodel" }, + { 0x0ED, "getweaponreticlename" }, + { 0x0EE, "getzonecount" }, + { 0x0EF, "getzonenearest" }, + { 0x0F0, "getzonenodeforindex" }, + { 0x0F1, "getzonenodes" }, + { 0x0F2, "getzonenodesbydist" }, + { 0x0F3, "getzoneorigin" }, + { 0x0F4, "getzonepath" }, + { 0x0F5, "glassradiusdamage" }, + { 0x0F6, "hidemayhem" }, + { 0x0F7, "incrementcounter" }, + { 0x0F8, "instantlylogusageanalysisdata" }, + { 0x0F9, "int" }, + { 0x0FA, "invertangles" }, + { 0x0FB, "iprintln" }, + { 0x0FC, "iprintlnbold" }, + { 0x0FD, "isagent" }, + { 0x0FE, "isscriptedagent" }, + { 0x0FF, "isai" }, + { 0x100, "isalive" }, + { 0x101, "isarray" }, + { 0x102, "isbot" }, + { 0x103, "iscinematicloaded" }, + { 0x104, "iscinematicplaying" }, + { 0x105, "isdedicatedserver" }, + { 0x106, "isendstr" }, + { 0x107, "isstartstr" }, + { 0x108, "isenemyteam" }, + { 0x109, "isexplosivedamagemod" }, + { 0x10A, "isfloat" }, + { 0x10B, "isglassdestroyed" }, + { 0x10C, "isgodmode" }, + { 0x10D, "ishairrunning" }, + { 0x10E, "isint" }, + { 0x10F, "isistring" }, + { 0x110, "ismayhem" }, + { 0x111, "isnodeoccupied" }, + { 0x112, "isplayer" }, + { 0x113, "isplayernumber" }, + { 0x114, "ispointinvolume" }, + { 0x115, "issaverecentlyloaded" }, + { 0x116, "issavesuccessful" }, + { 0x117, "issentient" }, + { 0x118, "isspawner" }, + { 0x119, "issplitscreen" }, + { 0x11A, "issquadsmode" }, + { 0x11B, "isstring" }, + { 0x11C, "issubstr" }, + { 0x11D, "isteamradarblocked" }, + { 0x11E, "istransientloaded" }, + { 0x11F, "istransientqueued" }, + { 0x120, "isturretactive" }, + { 0x121, "isusingmatchrulesdata" }, + { 0x122, "isvalidmissile" }, + { 0x123, "isweaponcliponly" }, + { 0x124, "isweapondetonationtimed" }, + { 0x125, "kick" }, + { 0x126, "killfxontag" }, + { 0x127, "killmayhem" }, + { 0x128, "length" }, + { 0x129, "length2d" }, + { 0x12A, "length2dsquared" }, + { 0x12B, "lengthsquared" }, + { 0x12C, "lerpsunangles" }, + { 0x12D, "lerpsundirection" }, + { 0x12E, "levelsoundfade" }, + { 0x12F, "livestreamingenable" }, + { 0x130, "livestreamingsetbitrate" }, + { 0x131, "loadfx" }, + { 0x132, "loadluifile" }, + { 0x133, "loadstartpointtransients" }, + { 0x134, "loadtransient" }, + { 0x135, "log" }, + { 0x136, "logprint" }, + { 0x137, "logstring" }, + { 0x138, "lookupsoundlength" }, + { 0x139, "magicbullet" }, + { 0x13A, "magicgrenade" }, + { 0x13B, "magicgrenademanual" }, + { 0x13C, "map_restart" }, + { 0x13D, "mapexists" }, + { 0x13E, "matchend" }, + { 0x13F, "max" }, + { 0x140, "min" }, + { 0x141, "missile_createattractorent" }, + { 0x142, "missile_createattractororigin" }, + { 0x143, "missile_createrepulsorent" }, + { 0x144, "missile_createrepulsororigin" }, + { 0x145, "missile_deleteattractor" }, + { 0x146, "missionfailed" }, + { 0x147, "missionsuccess" }, + { 0x148, "musicplay" }, + { 0x149, "musicstop" }, + { 0x14A, "newclienthudelem" }, + { 0x14B, "newhudelem" }, + { 0x14C, "newteamhudelem" }, + { 0x14D, "nodeexposedtosky" }, + { 0x14E, "nodesvisible" }, + { 0x14F, "notifyoncommand" }, + { 0x150, "obituary" }, + { 0x151, "objective_current" }, + { 0x152, "objective_delete" }, + { 0x153, "objective_icon" }, + { 0x154, "objective_onentity" }, + { 0x155, "objective_setzoffset" }, + { 0x156, "objective_position" }, + { 0x157, "objective_setlocation" }, + { 0x158, "objective_unsetlocation" }, + { 0x159, "objective_setlabel" }, + { 0x15A, "objective_setfriendlylabel" }, + { 0x15B, "objective_setenemylabel" }, + { 0x15C, "objective_setneutrallabel" }, + { 0x15D, "objective_state" }, + { 0x15E, "objective_setpinned" }, + { 0x15F, "objective_pinforclient" }, + { 0x160, "objective_unpinforclient" }, + { 0x161, "objective_pinforteam" }, + { 0x162, "objective_unpinforteam" }, + { 0x163, "objective_setdescription" }, + { 0x164, "objective_setplayintro" }, + { 0x165, "objective_setplayoutro" }, + { 0x166, "objective_sethot" }, + { 0x167, "objective_setpulsate" }, + { 0x168, "objective_setshowdistance" }, + { 0x169, "objective_setrotateonminimap" }, + { 0x16A, "objective_setshowoncompass" }, + { 0x16B, "objective_setminimapiconsize" }, + { 0x16C, "objective_setbackground" }, + { 0x16D, "objective_setshowprogress" }, + { 0x16E, "objective_showprogressforclient" }, + { 0x16F, "objective_hideprogressforclient" }, + { 0x170, "objective_showprogressforteam" }, + { 0x171, "objective_hideprogressforteam" }, + { 0x172, "objective_setprogress" }, + { 0x173, "objective_setownerclient" }, + { 0x174, "objective_setownerteam" }, + { 0x175, "objective_setprogressclient" }, + { 0x176, "objective_setprogressteam" }, + { 0x177, "objective_addclienttomask" }, + { 0x178, "objective_addteamtomask" }, + { 0x179, "objective_addalltomask" }, + { 0x17A, "objective_removeclientfrommask" }, + { 0x17B, "objective_removeteamfrommask" }, + { 0x17C, "objective_removeallfrommask" }, + { 0x17D, "objective_showtoplayersinmask" }, + { 0x17E, "objective_hidefromplayersinmask" }, + { 0x17F, "objective_setfadedisabled" }, + { 0x180, "objective_ping" }, + { 0x181, "objective_setpings" }, + { 0x182, "objective_setpingsforteam" }, + { 0x183, "pausecinematicingame" }, + { 0x184, "pausemayhem" }, + { 0x185, "perlinnoise2d" }, + { 0x186, "physicsexplosionsphere" }, + { 0x187, "physicsjitter" }, + { 0x188, "physicsjolt" }, + { 0x189, "physicstrace" }, + { 0x18A, "playcinematicforall" }, + { 0x18B, "playerphysicstrace" }, + { 0x18C, "playfx" }, + { 0x18D, "playfxontag" }, + { 0x18E, "playfxontagforclients" }, + { 0x18F, "playloopedfx" }, + { 0x190, "playmayhem" }, + { 0x191, "playrumblelooponposition" }, + { 0x192, "playrumbleonposition" }, + { 0x193, "playsoundatpos" }, + { 0x194, "playworldsound" }, + { 0x195, "pointonsegmentnearesttopoint" }, + { 0x196, "positionwouldtelefrag" }, + { 0x197, "pow" }, + { 0x198, "precachedigitaldistortcodeassets" }, + { 0x199, "precachefxontag" }, + { 0x19A, "precacheitem" }, + { 0x19B, "precacheleaderboards" }, + { 0x19C, "precacheminimapicon" }, + { 0x19D, "precacheminimapsentrycodeassets" }, + { 0x19E, "precachemodel" }, + { 0x19F, "precachecompositemodel" }, + { 0x1A0, "precachempanim" }, + { 0x1A1, "precachenightvisioncodeassets" }, + { 0x1A2, "precacherumble" }, + { 0x1A3, "precacheshader" }, + { 0x1A4, "precachestatusicon" }, + { 0x1A5, "precachestring" }, + { 0x1A6, "precachetag" }, + { 0x1A7, "precacheturret" }, + { 0x1A8, "precachevehicle" }, + { 0x1A9, "preloadcinematicforall" }, + { 0x1AA, "queuedialog" }, + { 0x1AB, "radiusdamage" }, + { 0x1AC, "randomfloat" }, + { 0x1AD, "randomfloatrange" }, + { 0x1AE, "randomint" }, + { 0x1AF, "randomintrange" }, + { 0x1B0, "reconevent" }, + { 0x1B1, "reconspatialevent" }, + { 0x1B2, "remapstage" }, + { 0x1B3, "resetscriptusageanalysisdata" }, + { 0x1B4, "resetsundirection" }, + { 0x1B5, "resetsunlight" }, + { 0x1B6, "resettimeout" }, + { 0x1B7, "rotatepointaroundvector" }, + { 0x1B8, "rotatevector" }, + { 0x1B9, "rotatevectorinverted" }, + { 0x1BA, "savegame" }, + { 0x1BB, "savegamenocommit" }, + { 0x1BC, "screenshake" }, + { 0x1BD, "sendclientmatchdata" }, + { 0x1BE, "sendmatchdata" }, + { 0x1BF, "sendscriptusageanalysisdata" }, + { 0x1C0, "setac130ambience" }, + { 0x1C1, "setblur" }, + { 0x1C2, "setclientmatchdata" }, + { 0x1C3, "setclientmatchdatadef" }, + { 0x1C4, "setclientnamemode" }, + { 0x1C5, "setculldist" }, + { 0x1C6, "setdvar" }, + { 0x1C7, "setdvarifuninitialized" }, + { 0x1C8, "setdynamicdvar" }, + { 0x1C9, "setgameendtime" }, + { 0x1CA, "setglaregrimematerial" }, + { 0x1CB, "sethalfresparticles" }, + { 0x1CC, "setignoremegroup" }, + { 0x1CD, "setlasermaterial" }, + { 0x1CE, "setmapcenter" }, + { 0x1CF, "setmatchclientip" }, + { 0x1D0, "setmatchdata" }, + { 0x1D1, "setmatchdatadef" }, + { 0x1D2, "setmatchdataid" }, + { 0x1D3, "setminimap" }, + { 0x1D4, "setmusicstate" }, + { 0x1D5, "setnodepriority" }, + { 0x1D6, "setnojipscore" }, + { 0x1D7, "setnojiptime" }, + { 0x1D8, "setocclusionpreset" }, + { 0x1D9, "setomnvar" }, + { 0x1DA, "setomnvarforallclients" }, + { 0x1DB, "setomnvarbit" }, + { 0x1DC, "setplayerignoreradiusdamage" }, + { 0x1DD, "setplayerteamrank" }, + { 0x1DE, "doentitiessharehierarchy" }, + { 0x1DF, "setsaveddvar" }, + { 0x1E0, "setslowmotion" }, + { 0x1E1, "setslowmotionview" }, + { 0x1E2, "setsundirection" }, + { 0x1E3, "setsunflareposition" }, + { 0x1E4, "setsuncolorandintensity" }, + { 0x1E5, "setteammode" }, + { 0x1E6, "setteamradar" }, + { 0x1E7, "setteamradarstrength" }, + { 0x1E8, "setteamscore" }, + { 0x1E9, "setthermalbodymaterial" }, + { 0x1EA, "setthreatbias" }, + { 0x1EB, "setthreatbiasagainstall" }, + { 0x1EC, "settimescale" }, + { 0x1ED, "setturretnode" }, + { 0x1EE, "setumbraportalstate" }, + { 0x1EF, "setwinningteam" }, + { 0x1F0, "showmayhem" }, + { 0x1F1, "sighttracepassed" }, + { 0x1F2, "sin" }, + { 0x1F3, "sortbydistance" }, + { 0x1F4, "soundexists" }, + { 0x1F5, "soundfade" }, + { 0x1F6, "soundislooping" }, + { 0x1F7, "soundresettimescale" }, + { 0x1F8, "soundsettimescalefactor" }, + { 0x1F9, "spawn" }, + { 0x1FA, "spawnbrcircle" }, + { 0x1FB, "spawnfx" }, + { 0x1FC, "spawnfxforclient" }, + { 0x1FD, "spawnhelicopter" }, + { 0x1FE, "spawnloopingsound" }, + { 0x1FF, "spawnmayhem" }, + { 0x200, "spawnplane" }, + { 0x201, "spawnragdollconstraint" }, + { 0x202, "spawnsighttrace" }, + { 0x203, "spawnstruct" }, + { 0x204, "spawnturret" }, + { 0x205, "spawnvehicle" }, + { 0x206, "speechenable" }, + { 0x207, "speechenablegrammar" }, + { 0x208, "sqrt" }, + { 0x209, "squared" }, + { 0x20A, "stopallrumbles" }, + { 0x20B, "stopcinematicforall" }, + { 0x20C, "stopcinematicingame" }, + { 0x20D, "stopfxontag" }, + { 0x20E, "stricmp" }, + { 0x20F, "strtok" }, + { 0x210, "synctransients" }, + { 0x211, "tableexists" }, + { 0x212, "tablelookup" }, + { 0x213, "tablelookupbyrow" }, + { 0x214, "tablelookupgetnumrows" }, + { 0x215, "tablelookupgetnumcols" }, + { 0x216, "tablelookupistring" }, + { 0x217, "tablelookupistringbyrow" }, + { 0x218, "tablelookuprownum_startfromrow" }, + { 0x219, "tablelookuprownum_reversefromrow" }, + { 0x21A, "tablelookuprownum" }, + { 0x21B, "tan" }, + { 0x21C, "target_alloc" }, + { 0x21D, "target_clearreticlelockon" }, + { 0x21E, "target_drawcornersonly" }, + { 0x21F, "target_drawsingle" }, + { 0x220, "target_drawsquare" }, + { 0x221, "target_flush" }, + { 0x222, "target_getarray" }, + { 0x223, "target_gettargetatindex" }, + { 0x224, "target_getindexoftarget" }, + { 0x225, "target_hidefromplayer" }, + { 0x226, "target_isincircle" }, + { 0x227, "target_isinrect" }, + { 0x228, "target_istarget" }, + { 0x229, "target_remove" }, + { 0x22A, "target_set" }, + { 0x22B, "target_setattackmode" }, + { 0x22C, "target_setcolor" }, + { 0x22D, "target_setdelay" }, + { 0x22E, "target_setjavelinonly" }, + { 0x22F, "target_setmaxsize" }, + { 0x230, "target_setminsize" }, + { 0x231, "target_setoffscreenshader" }, + { 0x232, "target_setscaledrendermode" }, + { 0x233, "target_setshader" }, + { 0x234, "target_showtoplayer" }, + { 0x235, "target_startreticlelockon" }, + { 0x236, "teleportscene" }, + { 0x237, "threatbiasgroupexists" }, + { 0x238, "tolower" }, + { 0x239, "trajectorycalculateexitangle" }, + { 0x23A, "trajectorycalculateinitialvelocity" }, + { 0x23B, "trajectorycalculateminimumvelocity" }, + { 0x23C, "trajectorycanattemptaccuratejump" }, + { 0x23D, "trajectorycomputedeltaheightattime" }, + { 0x23E, "trajectoryestimatedesiredinairtime" }, + { 0x23F, "transformmove" }, + { 0x240, "triggerfx" }, + { 0x241, "triggerportableradarping" }, + { 0x242, "pinglocationenemyteams" }, + { 0x243, "triggeroneoffradarsweep" }, + { 0x244, "unblockteamradar" }, + { 0x245, "unloadalltransients" }, + { 0x246, "unloadtransient" }, + { 0x247, "unsetturretnode" }, + { 0x248, "updateclientnames" }, + { 0x249, "updategamerprofile" }, + { 0x24A, "updategamerprofileall" }, + { 0x24B, "vectorcross" }, + { 0x24C, "vectordot" }, + { 0x24D, "vectorfromlinetopoint" }, + { 0x24E, "vectorlerp" }, + { 0x24F, "vectornormalize" }, + { 0x250, "vectortoangles" }, + { 0x251, "vectortoyaw" }, + { 0x252, "vehicle_getarray" }, + { 0x253, "vehicle_getspawnerarray" }, + { 0x254, "vehicle_allowplayeruse" }, + { 0x255, "visionsetalternate" }, + { 0x256, "visionsetfadetoblack" }, + { 0x257, "visionsetmissilecam" }, + { 0x258, "visionsetnaked" }, + { 0x259, "visionsetnight" }, + { 0x25A, "visionsetpain" }, + { 0x25B, "visionsetthermal" }, + { 0x25C, "weaponaltweaponname" }, + { 0x25D, "weaponburstcount" }, + { 0x25E, "weaponclass" }, + { 0x25F, "weaponoffhandclass" }, + { 0x260, "weaponclipsize" }, + { 0x261, "weaponfightdist" }, + { 0x262, "weaponfiretime" }, + { 0x263, "weaponhasthermalscope" }, + { 0x264, "weaponcandrop" }, + { 0x265, "weaponinheritsperks" }, + { 0x266, "weaponinventorytype" }, + { 0x267, "weaponisauto" }, + { 0x268, "weaponisboltaction" }, + { 0x269, "weaponisimpaling" }, + { 0x26A, "weaponissemiauto" }, + { 0x26B, "weaponmaxammo" }, + { 0x26C, "weaponmaxdist" }, + { 0x26D, "weaponstartammo" }, + { 0x26E, "weapontype" }, + { 0x26F, "worldentnumber" }, + { 0x270, "adddebugcommand" }, + { 0x271, "assert" }, + { 0x272, "assertex" }, + { 0x273, "assertmsg" }, + { 0x274, "box" }, + { 0x275, "closefile" }, + { 0x276, "createprintchannel" }, + { 0x277, "cylinder" }, + { 0x278, "drawsoundshape" }, + { 0x279, "fgetarg" }, + { 0x27A, "fprintfields" }, + { 0x27B, "fprintln" }, + { 0x27C, "freadln" }, + { 0x27D, "getentbynum" }, + { 0x27E, "getreflectionlocs" }, + { 0x27F, "getsystemtimeinmicroseconds" }, + { 0x280, "getunarchiveddebugdvar" }, + { 0x281, "line" }, + { 0x282, "openfile" }, + { 0x283, "debugstar" }, + { 0x284, "orientedbox" }, + { 0x285, "debugaxis" }, + { 0x286, "print" }, + { 0x287, "print3d" }, + { 0x288, "println" }, + { 0x289, "printtoscreen2d" }, + { 0x28A, "setdebugangles" }, + { 0x28B, "setdebugorigin" }, + { 0x28C, "setdevdvar" }, + { 0x28D, "setdevdvarifuninitialized" }, + { 0x28E, "setprintchannel" }, + { 0x28F, "sphere" }, + { 0x290, "sysprint" }, + { 0x291, "physics_getbodylinvel" }, + { 0x292, "physics_getbodyangvel" }, + { 0x293, "physics_getbodylinangvel" }, + { 0x294, "findpathcustom" }, + { 0x295, "findpath3d" }, + { 0x296, "navtrace" }, + { 0x297, "navtrace3d" }, + { 0x298, "navisstraightlinereachable" }, + { 0x299, "getrandomnavpoint" }, + { 0x29A, "getrandomnavpoints" }, + { 0x29B, "getclosestpointonnavmesh" }, + { 0x29C, "createnavrepulsor" }, + { 0x29D, "destroynavrepulsor" }, + { 0x29E, "ispointonnavmesh" }, + { 0x29F, "createnavobstaclebybounds" }, + { 0x2A0, "createnavobstaclebyent" }, + { 0x2A1, "destroynavobstacle" }, + { 0x2A2, "createnavbadplacebybounds" }, + { 0x2A3, "createnavbadplacebyent" }, + { 0x2A4, "createnavobstaclebyboundsforlayer" }, + { 0x2A5, "createnavobstaclebyentforlayer" }, + { 0x2A6, "createnavmodifier" }, + { 0x2A7, "isnumber" }, + { 0x2A8, "preloadzones" }, + { 0x2A9, "physics_setgravity" }, + { 0x2AA, "isbotmatchmakingenabled" }, + { 0x2AB, "addmpbottoteam" }, + { 0x2AC, "ispreloadzonescomplete" }, + { 0x2AD, "physics_getbulletmissilecontents" }, + { 0x2AE, "assertdemo" }, + { 0x2AF, "physics_aabbbroadphasequery" }, + { 0x2B0, "physics_aabbquery" }, + { 0x2B1, "physics_raycast" }, + { 0x2B2, "physics_spherecast" }, + { 0x2B3, "physics_capsulecast" }, + { 0x2B4, "physics_shapecast" }, + { 0x2B5, "physics_querypoint" }, + { 0x2B6, "physics_getclosestpointtosphere" }, + { 0x2B7, "physics_getclosestpointtocapsule" }, + { 0x2B8, "physics_getclosestpoint" }, + { 0x2B9, "physics_createcontents" }, + { 0x2BA, "physics_getsurfacetypefromflags" }, + { 0x2BB, "pathsighttestfast" }, + { 0x2BC, "nodetoentitysighttest" }, + { 0x2BD, "weapongetdamagemax" }, + { 0x2BE, "weapongetdamagemin" }, + { 0x2BF, "precomputedlosdatatest" }, + { 0x2C0, "getislosdatafileloaded" }, + { 0x2C1, "stopfxontagforclients" }, + { 0x2C2, "physics_charactercast" }, + { 0x2C3, "physics_getclosestpointtocharacter" }, + { 0x2C4, "playfxontagforteam" }, + { 0x2C5, "physics_getbodymass" }, + { 0x2C6, "physics_getbodydynamicmass" }, + { 0x2C7, "physics_getbodycenterofmass" }, + { 0x2C8, "physics_setbodycenterofmassnormal" }, + { 0x2C9, "physics_getbodyaabb" }, + { 0x2CA, "cachespawnpathnodesincode" }, + { 0x2CB, "getaccuracyfraction" }, + { 0x2CC, "triggerportableradarpingteam" }, + { 0x2CD, "isvfxfile" }, + { 0x2CE, "isstruct" }, + { 0x2CF, "isvector" }, + { 0x2D0, "isent" }, + { 0x2D1, "isnode" }, + { 0x2D2, "isnonentspawner" }, + { 0x2D3, "setglobalsoundcontext" }, + { 0x2D4, "setaudiotriggerstate" }, + { 0x2D5, "finishplayerdeath" }, + { 0x2D6, "precachesuit" }, + { 0x2D7, "getcsplineid" }, + { 0x2D8, "spawnimpulsefield" }, + { 0x2D9, "clearstartpointtransients" }, + { 0x2DA, "isloadingsavegame" }, + { 0x2DB, "getsavegametransients" }, + { 0x2DC, "getclosestpointonnavmesh3d" }, + { 0x2DD, "ispointonnavmesh3d" }, + { 0x2DE, "waspreloadzonesstarted" }, + { 0x2DF, "getcsplinepointstring" }, + { 0x2E0, "calccsplineclosestpoint" }, + { 0x2E1, "weaponisbeam" }, + { 0x2E2, "navisstraightlinereachable3d" }, + { 0x2E3, "getcsplinepointtargetname" }, + { 0x2E4, "getcsplinepointtarget" }, + { 0x2E5, "getcsplinetargetname" }, + { 0x2E6, "getweaponloottable" }, + { 0x2E7, "getweaponvariantindex" }, + { 0x2E8, "areanynavvolumesloaded" }, + { 0x2E9, "projectileintercept" }, + { 0x2EA, "getgrenadefusetime" }, + { 0x2EB, "getgrenadefusetimeai" }, + { 0x2EC, "getgrenadedamageradius" }, + { 0x2ED, "getcsplineidarray" }, + { 0x2EE, "spawncovernode" }, + { 0x2EF, "despawncovernode" }, + { 0x2F0, "spawnscriptitem" }, + { 0x2F1, "areworldweaponsloaded" }, + { 0x2F2, "getmaxclients" }, + { 0x2F3, "settransientvisibility" }, + { 0x2F4, "vectortopitch" }, + { 0x2F5, "getserverhostname" }, + { 0x2F6, "anglestoleft" }, + { 0x2F7, "weaponusesenergybullets" }, + { 0x2F8, "testbrushedgesforgrapple" }, + { 0x2F9, "spawncoverwall" }, + { 0x2FA, "generateaxisanglesfromforwardvector" }, + { 0x2FB, "btregistertree" }, + { 0x2FC, "isenumvaluevalid" }, + { 0x2FD, "switchtransientset" }, + { 0x2FE, "loadstartpointtransientset" }, + { 0x2FF, "physics_setgravityragdollscalar" }, + { 0x300, "physics_setgravitydynentscalar" }, + { 0x301, "physics_setgravityparticlescalar" }, + { 0x302, "playfxontagsbetweenclients" }, + { 0x303, "playfxbetweenpoints" }, + { 0x304, "physics_volumecreate" }, + { 0x305, "issound3d" }, + { 0x306, "generateaxisanglesfromupvector" }, + { 0x307, "anglelerpquat" }, + { 0x308, "loadworldweapons" }, + { 0x309, "clearworldweapons" }, + { 0x30A, "anglelerpquatfrac" }, + { 0x30B, "archetypeassetloaded" }, + { 0x30C, "archetypegetalias" }, + { 0x30D, "archetypegetrandomalias" }, + { 0x30E, "archetypegetaliases" }, + { 0x30F, "archetypehasstate" }, + { 0x310, "computeweaponclientloadout" }, + { 0x311, "target_drawonradar" }, + { 0x312, "target_setradarcenter" }, + { 0x313, "target_offsetlocalspace" }, + { 0x314, "target_drawrotated" }, + { 0x315, "getangleindices" }, + { 0x316, "getangleindex" }, + { 0x317, "hasroomtoplaypeekout" }, + { 0x318, "getdobjcount" }, + { 0x319, "frontendscenecamerafade" }, + { 0x31A, "frontendscenecamerafov" }, + { 0x31B, "frontendscenegetactivesection" }, + { 0x31C, "frontendscenecameracharacters" }, + { 0x31D, "isspleveltransient" }, + { 0x31E, "isgamebattlematch" }, + { 0x31F, "physics_setgravityitemscalar" }, + { 0x320, "setsettletime" }, + { 0x321, "bbreportspawnfactors" }, + { 0x322, "bbreportspawntypes" }, + { 0x323, "bbreportspawnplayerdetails" }, + { 0x324, "setstreamsynconnextlevel" }, + { 0x325, "setpreloadimageprimeset" }, + { 0x326, "animisleaf" }, + { 0x327, "getweaponviewmodel" }, + { 0x328, "startpodium" }, + { 0x329, "playcinematicforalllooping" }, + { 0x32A, "frontendscenecameracinematic" }, + { 0x32B, "setcodcasterclientmatchdata" }, + { 0x32C, "getcodcasterclientmatchdata" }, + { 0x32D, "sendcodcasterclientmatchdata" }, + { 0x32E, "waitforalltransients" }, + { 0x32F, "waitfortransient" }, + { 0x330, "isloadinganytransients" }, + { 0x331, "getmlgsettings" }, + { 0x332, "setintrocameraactive" }, + { 0x333, "removeallcorpses" }, + { 0x334, "asmregistergenerichandler" }, + { 0x335, "asmdevgetallnotetrackaimstates" }, + { 0x336, "stopspectateplayer" }, + { 0x337, "weaponispreferreddrop" }, + { 0x338, "physics_setbodylinvel" }, + { 0x339, "physics_setbodyangvel" }, + { 0x33A, "physics_setbodylinangvel" }, + { 0x33B, "findclosestlospointwithinvolume" }, + { 0x33C, "findclosestpointbyapproxpathdist" }, + { 0x33D, "findclosestnonlospointwithinvolume" }, + { 0x33E, "findclosestnonlospointwithinradius" }, + { 0x33F, "findclosestlospointwithinradius" }, + { 0x340, "findopenlookdir" }, + { 0x341, "makeweapon" }, + { 0x342, "getcompleteweaponname" }, + { 0x343, "createheadicon" }, + { 0x344, "deleteheadicon" }, + { 0x345, "setheadiconimage" }, + { 0x346, "setheadiconfriendlyimage" }, + { 0x347, "setheadiconenemyimage" }, + { 0x348, "setheadiconneutralimage" }, + { 0x349, "setheadiconnaturaldistance" }, + { 0x34A, "setheadiconmaxdistance" }, + { 0x34B, "setheadiconsnaptoedges" }, + { 0x34C, "setheadicondrawthroughgeo" }, + { 0x34D, "setheadiconzoffset" }, + { 0x34E, "addclienttoheadiconmask" }, + { 0x34F, "addteamtoheadiconmask" }, + { 0x350, "removeclientfromheadiconmask" }, + { 0x351, "removeteamfromheadiconmask" }, + { 0x352, "showheadicontoplayersinmask" }, + { 0x353, "hideheadiconfromplayersinmask" }, + { 0x354, "setheadiconteam" }, + { 0x355, "setheadiconowner" }, + { 0x356, "createtargetmarkergroup" }, + { 0x357, "deletetargetmarkergroup" }, + { 0x358, "targetmarkergroupaddentity" }, + { 0x359, "targetmarkergroupremoveentity" }, + { 0x35A, "targetmarkergroupsetentitystate" }, + { 0x35B, "targetmarkergroupsetextrastate" }, + { 0x35C, "addclienttotargetmarkergroupmask" }, + { 0x35D, "addteamtotargetmarkergroupmask" }, + { 0x35E, "removeclientfromtargetmarkergroupmask" }, + { 0x35F, "removeteamfromtargetmarkergroupmask" }, + { 0x360, "showtargetmarkergrouptoplayersinmask" }, + { 0x361, "hidetargetmarkergroupfromplayersinmask" }, + { 0x362, "isweapon" }, + { 0x363, "issameweapon" }, + { 0x364, "isnullweapon" }, + { 0x365, "nullweapon" }, + { 0x366, "isundefinedweapon" }, + { 0x367, "getqueuedspleveltransients" }, + { 0x368, "getloadedspleveltransients" }, + { 0x369, "getallspleveltransients" }, + { 0x36A, "gettransientsinset" }, + { 0x36B, "gettransientsetnames" }, + { 0x36C, "makealtweapon" }, + { 0x36D, "makeweaponfromstring" }, + { 0x36E, "asmdevgetallstates" }, + { 0x36F, "getplayerspawnarray" }, + { 0x370, "disablespawnpoints" }, + { 0x371, "disablespawnpointsbyclassname" }, + { 0x372, "disablespawnpointbyindex" }, + { 0x373, "enablespawnpoints" }, + { 0x374, "enablespawnpointsbyclassname" }, + { 0x375, "enablespawnpointbyindex" }, + { 0x376, "registerspawnfactor" }, + { 0x377, "enablefrontlinecriticalfactor" }, + { 0x378, "registerspawnteamsmode" }, + { 0x379, "createspawninfluencepoint" }, + { 0x37A, "destroyspawninfluencepoint" }, + { 0x37B, "animsetgetanimfromindex" }, + { 0x37C, "animsetgetallanimindicesforalias" }, + { 0x37D, "analyticsstreamerlogfileendstream" }, + { 0x37E, "analyticsstreamerlogfilestartstream" }, + { 0x37F, "analyticsstreamerlogfilewritetobuffer" }, + { 0x380, "analyticsstreamerlogfiletagplayer" }, + { 0x381, "analyticsstreamerislogfilestreamingenabled" }, + { 0x382, "drawentitybounds" }, + { 0x383, "getscriptbundle" }, + { 0x384, "isintournament" }, + { 0x385, "dotournamentendgame" }, + { 0x386, "logtournamentdeath" }, + { 0x387, "updatetournamentroundtime" }, + { 0x388, "physics_raycastents" }, + { 0x389, "savepotgdata" }, + { 0x38A, "getpotgstarttime" }, + { 0x38B, "getpotgduration" }, + { 0x38C, "completescenetransition" }, + { 0x38D, "stopclientexploder" }, + { 0x38E, "loadinfiltransient" }, + { 0x38F, "unloadinfiltransient" }, + { 0x390, "unloadallinfilintrotransients" }, + { 0x391, "setspeedthreshold" }, + { 0x392, "animspeedthresholdsexist" }, + { 0x393, "hasanimspeedthresholdstring" }, + { 0x394, "getanimspeedthreshold" }, + { 0x395, "getnearestspeedthresholdname" }, + { 0x396, "getnextlowestspeedthresholdstring" }, + { 0x397, "getanimspeedbetweenthresholds" }, + { 0x398, "getcoveranglelimits" }, + { 0x399, "get3dcoveranglelimits" }, + { 0x39A, "getcovercrouchanglelimits" }, + { 0x39B, "isfunction" }, + { 0x39C, "isbuiltinfunction" }, + { 0x39D, "isbuiltinmethod" }, + { 0x39E, "isanimation" }, + { 0x39F, "dospawnaitype" }, + { 0x3A0, "havemapentseffects" }, + { 0x3A1, "isplatformconsole" }, + { 0x3A2, "isplatformpc" }, + { 0x3A3, "isplatformps4" }, + { 0x3A4, "isplatformxb3" }, + { 0x3A5, "spawninfluencepointlinkto" }, + { 0x3A6, "spawninfluencepointislinked" }, + { 0x3A7, "spawninfluencepointsetposition" }, + { 0x3A8, "dlog_recordevent" }, + { 0x3A9, "getentitylessscriptablearray" }, + { 0x3AA, "getentitylessscriptablearrayinradius" }, + { 0x3AB, "getlootscriptablearray" }, + { 0x3AC, "getlootscriptablearrayinradius" }, + { 0x3AD, "canceljoins" }, + { 0x3AE, "spawnscriptable" }, + { 0x3AF, "easepower" }, + { 0x3B0, "easeexponential" }, + { 0x3B1, "easelogarithmic" }, + { 0x3B2, "easesine" }, + { 0x3B3, "easeback" }, + { 0x3B4, "easeelastic" }, + { 0x3B5, "easebounce" }, + { 0x3B6, "spawnsound" }, + { 0x3B7, "getplayerrateofgamerevenue" }, + { 0x3B8, "botnodeavailabletoteam" }, + { 0x3B9, "getnodeowner" }, + { 0x3BA, "showcinematicletterboxing" }, + { 0x3BB, "hidecinematicletterboxing" }, + { 0x3BC, "getrandomnodedestination" }, + { 0x3BD, "getfakeaiarray" }, + { 0x3BE, "getfakeaiarrayinradius" }, + { 0x3BF, "onmatchbegin" }, + { 0x3C0, "onmatchend" }, + { 0x3C1, "isalliedsentient" }, + { 0x3C2, "istestclient" }, + { 0x3C3, "initmaxspeedforpathlengthtable" }, + { 0x3C4, "isnavmeshloaded" }, + { 0x3C5, "isscriptabledefined" }, + { 0x3C6, "visionsetkillcamthirdpersonnight" }, + { 0x3C7, "getnodeindex" }, + { 0x3C8, "getnodebyindex" }, + { 0x3C9, "nvidiahighlightsrequestpermissions" }, + { 0x3CA, "nvidiahighlightsisenabled" }, + { 0x3CB, "nvidiahighlightsbegingroup" }, + { 0x3CC, "nvidiahighlightsendgroup" }, + { 0x3CD, "nvidiahighlightsscreenshot" }, + { 0x3CE, "nvidiahighlightsvideo" }, + { 0x3CF, "nvidiahighlightsgetcount" }, + { 0x3D0, "nvidiahighlightssummary" }, + { 0x3D1, "nvidiahighlightscleanup" }, + { 0x3D2, "getscriptableinstancefromindex" }, + { 0x3D3, "calcscriptablepayloadgravityarc" }, + { 0x3D4, "getscriptablereservedremaining" }, + { 0x3D5, "enabledismembermenttag" }, + { 0x3D6, "disabledismembermenttag" }, + { 0x3D7, "spawnmapcircle" }, + { 0x3D8, "getmaxobjectivecount" }, + { 0x3D9, "spawncustomweaponscriptable" }, + { 0x3DA, "getnodecount" }, + { 0x3DB, "getsentientcounts" }, + { 0x3DC, "getsentientlimits" }, + { 0x3DD, "nvidiaanselisenabled" }, + { 0x3DE, "computedropbagpositions" }, + { 0x3DF, "getunusedlootcachepoints" }, + { 0x3E0, "getlootspawnpoint" }, + { 0x3E1, "getquestpoints" }, + { 0x3E2, "disablelootspawnpoint" }, + { 0x3E3, "getlootspawnpointcount" }, + { 0x3E4, "getlootspawnscriptableindexfirst" }, + { 0x3E5, "getdatetime" }, + { 0x3E6, "analyticsreset" }, + { 0x3E7, "analyticsaddevent" }, + { 0x3E8, "analyticswritecsv" }, + { 0x3E9, "objective_setspecialobjectivedisplay" }, + { 0x3EA, "hastacvis" }, + { 0x3EB, "enablegroundwarspawnlogic" }, + { 0x3EC, "getscriptablelootspawnedcountbyname" }, + { 0x3ED, "getscriptablelootspawnedcountbyrarity" }, + { 0x3EE, "getscriptablelootspawnedcountbytype" }, + { 0x3EF, "getscriptablelootcachecontents" }, + { 0x3F0, "pickscriptablelootitem" }, + { 0x3F1, "registerscriptedspawnpoints" }, + { 0x3F2, "getoriginforanimtime" }, + { 0x3F3, "getanglesforanimtime" }, + { 0x3F4, "getbnetigrplayerxpmultiplier" }, + { 0x3F5, "getbnetigrweaponxpmultiplier" }, + { 0x3F6, "sortbydistancecullbyradius" }, + { 0x3F7, "incrementpersistentstat" }, + { 0x3F8, "objective_sethideformlgspectator" }, + { 0x3F9, "objective_setshowformlgspectator" }, + { 0x3FA, "getdediserverguid" }, + { 0x3FB, "isdismembermentenabled" }, + { 0x3FC, "objective_mlgicon" }, + { 0x3FD, "objective_reset_mlgicon" }, + { 0x3FE, "resetglass" }, + { 0x3FF, "objective_setmlgbackground" }, + { 0x400, "weaponisrestricted" }, + { 0x401, "attachmentisrestricted" }, + { 0x402, "perkisrestricted" }, + { 0x403, "equipmentisrestricted" }, + { 0x404, "killstreakisrestricted" }, + { 0x405, "superisrestricted" }, + { 0x406, "setgamebattleplayerstats" }, + { 0x407, "setgamebattlematchstats" }, + { 0x408, "requestgamelobbyremainintact" }, + { 0x409, "createnavobstaclebyshape" }, + { 0x40A, "createnavbadplacebyshape" }, + { 0x40B, "createnavobstaclebyshapeforlayer" }, + { 0x40C, "setminimapcpraidmaze" }, + { 0x40D, "brmatchstarted" }, + { 0x40E, "vehicle_getarrayinradius" }, + { 0x40F, "tablesort" }, + { 0x410, "setteamplacement" }, + { 0x411, "soundsettimescalefactorfromtable" }, + { 0x412, "createheadiconatorigin" }, + { 0x413, "setheadicondrawinmap" }, + { 0x414, "objective_sethideelevation" }, + { 0x415, "playencryptedcinematicforall" }, + { 0x416, "getbnetigrbattlepassxpmultiplier" }, + { 0x417, "getscriptcachecontents" }, + { 0x418, "getweaponindex" }, + { 0x419, "radiusdamagestepped" }, + { 0x41A, "verifybunkercode" }, + { 0x41B, "getaltbunkerindexforname" }, + { 0x41C, "getplaylistname" }, + { 0x41D, "stopmusicstate" }, + { 0x41E, "_func_41E" }, + { 0x41F, "_func_41F" }, + { 0x420, "_func_420" }, + { 0x421, "_func_421" }, + { 0x422, "_func_422" }, + { 0x423, "_func_423" }, + { 0x424, "_func_424" }, + { 0x425, "_func_425" }, + { 0x426, "_func_426" }, + { 0x427, "_func_427" }, + { 0x428, "_func_428" }, + { 0x429, "_func_429" }, +}}; + +} // namespace xsk::gsc::iw8 diff --git a/src/iw8/iw8_meth.cpp b/src/iw8/iw8_meth.cpp new file mode 100644 index 00000000..531376e2 --- /dev/null +++ b/src/iw8/iw8_meth.cpp @@ -0,0 +1,2047 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw8.hpp" + +namespace xsk::gsc::iw8 +{ + +extern std::array, meth_count> const meth_list +{{ + { 0x8000, "addaieventlistener" }, + { 0x8001, "addontoviewmodel" }, + { 0x8002, "addpitch" }, + { 0x8003, "addroll" }, + { 0x8004, "addyaw" }, + { 0x8005, "adsbuttonpressed" }, + { 0x8006, "agentcanseesentient" }, + { 0x8007, "setaimstate" }, + { 0x8008, "aiphysicstrace" }, + { 0x8009, "aiphysicstracepassed" }, + { 0x800A, "allowads" }, + { 0x800B, "allowcrouch" }, + { 0x800C, "allowedstances" }, + { 0x800D, "allowfire" }, + { 0x800E, "allowjump" }, + { 0x800F, "allowlean" }, + { 0x8010, "allowmelee" }, + { 0x8011, "allowprone" }, + { 0x8012, "allowspectateteam" }, + { 0x8013, "allowsprint" }, + { 0x8014, "allowstand" }, + { 0x8015, "allowswim" }, + { 0x8016, "allowjog" }, + { 0x8017, "animcustom" }, + { 0x8018, "animmode" }, + { 0x8019, "animrelative" }, + { 0x801A, "animscripted" }, + { 0x801B, "animscriptedthirdperson" }, + { 0x801C, "anyammoforweaponmodes" }, + { 0x801D, "atdangerousnode" }, + { 0x801E, "attach" }, + { 0x801F, "attachpath" }, + { 0x8020, "attachshieldmodel" }, + { 0x8021, "attackbuttonpressed" }, + { 0x8022, "autoboltmissileeffects" }, + { 0x8023, "autospotoverlayoff" }, + { 0x8024, "autospotoverlayon" }, + { 0x8025, "beginlocationselection" }, + { 0x8026, "blendlinktoplayerviewmotion" }, + { 0x8027, "botcanseeentity" }, + { 0x8028, "botclearbutton" }, + { 0x8029, "botclearscriptenemy" }, + { 0x802A, "botclearscriptgoal" }, + { 0x802B, "botfindrandomgoal" }, + { 0x802C, "botfirstavailablegrenade" }, + { 0x802D, "botflagmemoryevents" }, + { 0x802E, "botgetdifficulty" }, + { 0x802F, "botgetdifficultysetting" }, + { 0x8030, "botgetentrancepoint" }, + { 0x8031, "botgetfovdot" }, + { 0x8032, "botgetfovdotz" }, + { 0x8033, "botgetimperfectenemyinfo" }, + { 0x8034, "botgetmemoryevents" }, + { 0x8035, "botgetnearestnode" }, + { 0x8036, "botgetnodesonpath" }, + { 0x8037, "botgetnegotiationstartnode" }, + { 0x8038, "botgetpathdist" }, + { 0x8039, "botgetpersonality" }, + { 0x803A, "botgetscriptgoal" }, + { 0x803B, "botgetscriptgoalnode" }, + { 0x803C, "botgetscriptgoalradius" }, + { 0x803D, "botgetscriptgoaltype" }, + { 0x803E, "botgetscriptgoalyaw" }, + { 0x803F, "botgetworldclosestedge" }, + { 0x8040, "botgetworldsize" }, + { 0x8041, "bothasscriptgoal" }, + { 0x8042, "botisrandomized" }, + { 0x8043, "botisdoingaisearch" }, + { 0x8044, "botlookatpoint" }, + { 0x8045, "botmemoryevent" }, + { 0x8046, "botmemoryselectpos" }, + { 0x8047, "botnodeavailable" }, + { 0x8048, "botnodepick" }, + { 0x8049, "botnodepickmultiple" }, + { 0x804A, "botnodescoremultiple" }, + { 0x804B, "botpredictenemycampspots" }, + { 0x804C, "botpredictseepoint" }, + { 0x804D, "botpressbutton" }, + { 0x804E, "botpursuingscriptgoal" }, + { 0x804F, "botsetattacker" }, + { 0x8050, "botsetawareness" }, + { 0x8051, "botsetdifficulty" }, + { 0x8052, "botsetdifficultysetting" }, + { 0x8053, "botsetflag" }, + { 0x8054, "botsetpathingstyle" }, + { 0x8055, "botsetpersonality" }, + { 0x8056, "botsetscriptenemy" }, + { 0x8057, "botsetscriptgoal" }, + { 0x8058, "botsetscriptgoalnode" }, + { 0x8059, "botsetscriptmove" }, + { 0x805A, "botsetstance" }, + { 0x805B, "botthrowscriptedgrenade" }, + { 0x805C, "botisthrowingscriptedgrenade" }, + { 0x805D, "buttonpressed" }, + { 0x805E, "cameralinkto" }, + { 0x805F, "cameraunlink" }, + { 0x8060, "canattackenemynode" }, + { 0x8061, "canattackenemynodefromexposed" }, + { 0x8062, "cancelmantle" }, + { 0x8063, "canmantle" }, + { 0x8064, "canplayerplacesentry" }, + { 0x8065, "canplayerplacetank" }, + { 0x8066, "cansee" }, + { 0x8067, "canshoot" }, + { 0x8068, "canshootenemy" }, + { 0x8069, "canspawnbotortestclient" }, + { 0x806A, "canuseturret" }, + { 0x806B, "capturnrate" }, + { 0x806C, "castdistantshadows" }, + { 0x806D, "castshadows" }, + { 0x806E, "castspotshadows" }, + { 0x806F, "changefontscaleovertime" }, + { 0x8070, "checkgrenadelaunch" }, + { 0x8071, "checkgrenadelaunchpos" }, + { 0x8072, "checkgrenadethrow" }, + { 0x8073, "checkgrenadethrowpos" }, + { 0x8074, "checkprone" }, + { 0x8075, "clearalltextafterhudelem" }, + { 0x8076, "clearanim" }, + { 0x8077, "clearclienttriggeraudiozone" }, + { 0x8078, "clearenemy" }, + { 0x8079, "clearentitytarget" }, + { 0x807A, "clearfixednodesafevolume" }, + { 0x807B, "cleargoalvolume" }, + { 0x807C, "cleargoalyaw" }, + { 0x807D, "clearlookatent" }, + { 0x807E, "clearperks" }, + { 0x807F, "clearpitchorient" }, + { 0x8080, "clearportableradar" }, + { 0x8081, "clearpotentialthreat" }, + { 0x8082, "clearpriorityclienttriggeraudiozone" }, + { 0x8083, "clearscrambler" }, + { 0x8084, "cleartargetent" }, + { 0x8085, "cleartargetentity" }, + { 0x8086, "cleartargetyaw" }, + { 0x8087, "clearturrettarget" }, + { 0x8088, "clearviewmodeladdons" }, + { 0x8089, "clientclaimtrigger" }, + { 0x808A, "clientreleasetrigger" }, + { 0x808B, "cloneagent" }, + { 0x808C, "clonebrushmodeltoscriptmodel" }, + { 0x808D, "cloneplayer" }, + { 0x808E, "closeingamemenu" }, + { 0x808F, "closemenu" }, + { 0x8090, "closepopupmenu" }, + { 0x8091, "connectnode" }, + { 0x8092, "connectpaths" }, + { 0x8093, "controlslinkto" }, + { 0x8094, "controlsunlink" }, + { 0x8095, "damageconetrace" }, + { 0x8096, "deactivateallocclusion" }, + { 0x8097, "deactivateeq" }, + { 0x8098, "deactivateocclusion" }, + { 0x8099, "deactivatereverb" }, + { 0x809A, "delete" }, + { 0x809B, "destroy" }, + { 0x809C, "detach" }, + { 0x809D, "detachall" }, + { 0x809E, "detachshieldmodel" }, + { 0x809F, "detonate" }, + { 0x80A0, "digitaldistortsetparams" }, + { 0x80A1, "disableaimassist" }, + { 0x80A2, "disableautoreload" }, + { 0x80A3, "disablebreaching" }, + { 0x80A4, "disableforcethirdpersonwhenspectating" }, + { 0x80A5, "disableforcehelmetwhenspectating" }, + { 0x80A6, "disableforceviewmodeldof" }, + { 0x80A7, "disablegrenadetouchdamage" }, + { 0x80A8, "disableinvulnerability" }, + { 0x80A9, "disablemissileboosting" }, + { 0x80AA, "disablemissilestick" }, + { 0x80AB, "disableoffhandweapons" }, + { 0x80AC, "disableplayeruse" }, + { 0x80AD, "disableslowaim" }, + { 0x80AE, "disableturretdismount" }, + { 0x80AF, "disableusability" }, + { 0x80B0, "disableweaponpickup" }, + { 0x80B1, "disableweapons" }, + { 0x80B2, "disableweaponswitch" }, + { 0x80B3, "disconnectnode" }, + { 0x80B4, "disconnectpaths" }, + { 0x80B5, "dismountvehicle" }, + { 0x80B6, "dockmovingplatform" }, + { 0x80B7, "dodamage" }, + { 0x80B8, "doesnodeallowstance" }, + { 0x80B9, "setcovermultinodetype" }, + { 0x80BA, "iscovermultinode" }, + { 0x80BB, "reevaluatemultinode" }, + { 0x80BC, "dontcastdistantshadows" }, + { 0x80BD, "dontcastshadows" }, + { 0x80BE, "dontinterpolate" }, + { 0x80BF, "dospawn" }, + { 0x80C0, "drivevehicleandcontrolturret" }, + { 0x80C1, "drivevehicleandcontrolturretoff" }, + { 0x80C2, "dropitem" }, + { 0x80C3, "dropscavengerbag" }, + { 0x80C4, "dropweapon" }, + { 0x80C5, "emissiveblend" }, + { 0x80C6, "setclientloadoutinfo" }, + { 0x80C7, "setclientextrasuper" }, + { 0x80C8, "setclientweaponinfo" }, + { 0x80C9, "setkillstreakpoints" }, + { 0x80CA, "setnextkillstreakcost" }, + { 0x80CB, "setgametypevip" }, + { 0x80CC, "getgametypevip" }, + { 0x80CD, "setnoteworthykillstreakactive" }, + { 0x80CE, "getnoteworthykillstreakactive" }, + { 0x80CF, "setspecialactive" }, + { 0x80D0, "getspecialactive" }, + { 0x80D1, "enableaimassist" }, + { 0x80D2, "enableanimstate" }, + { 0x80D3, "enableautoreload" }, + { 0x80D4, "enablebreaching" }, + { 0x80D5, "enabledeathshield" }, + { 0x80D6, "enableequipdeployvfx" }, + { 0x80D7, "enableforceviewmodeldof" }, + { 0x80D8, "enablegrenadetouchdamage" }, + { 0x80D9, "enablehealthshield" }, + { 0x80DA, "enableinvulnerability" }, + { 0x80DB, "enablelinkto" }, + { 0x80DC, "enablemissileboosting" }, + { 0x80DD, "enablemissilestick" }, + { 0x80DE, "enablemousesteer" }, + { 0x80DF, "enableoffhandweapons" }, + { 0x80E0, "enableplayeruse" }, + { 0x80E1, "enableslowaim" }, + { 0x80E2, "enableturretdismount" }, + { 0x80E3, "enableusability" }, + { 0x80E4, "enableweaponpickup" }, + { 0x80E5, "enableweapons" }, + { 0x80E6, "enableweaponswitch" }, + { 0x80E7, "endlocationselection" }, + { 0x80E8, "enterprone" }, + { 0x80E9, "exitprone" }, + { 0x80EA, "fadeoutshellshock" }, + { 0x80EB, "fadeovertime" }, + { 0x80EC, "findbestcovernode" }, + { 0x80ED, "findcovernode" }, + { 0x80EE, "findnearbycovernode" }, + { 0x80EF, "findreacquiredirectpath" }, + { 0x80F0, "findshufflecovernode" }, + { 0x80F1, "finishagentdamage" }, + { 0x80F2, "finishplayerdamage" }, + { 0x80F3, "fireweapon" }, + { 0x80F4, "flagenemyunattackable" }, + { 0x80F5, "forcedeathfall" }, + { 0x80F6, "forcemantle" }, + { 0x80F7, "forcemovingplatformentity" }, + { 0x80F8, "forcestartnegotiation" }, + { 0x80F9, "forceteleport" }, + { 0x80FA, "forcethirdpersonwhenspectating" }, + { 0x80FB, "forcehelmetwhenspectating" }, + { 0x80FC, "forceusehintoff" }, + { 0x80FD, "forceusehinton" }, + { 0x80FE, "forceviewmodelanimation" }, + { 0x80FF, "fragbuttonpressed" }, + { 0x8100, "freeentitysentient" }, + { 0x8101, "makecorpse" }, + { 0x8102, "suspendvehicle" }, + { 0x8103, "wakeupvehicle" }, + { 0x8104, "issuspendedvehicle" }, + { 0x8105, "freezecontrols" }, + { 0x8106, "freezelookcontrols" }, + { 0x8107, "getaimangle" }, + { 0x8108, "getweaponhudiconoverrideammo" }, + { 0x8109, "getammocount" }, + { 0x810A, "getammotype" }, + { 0x810B, "getanglestolikelyenemypath" }, + { 0x810C, "getanimentry" }, + { 0x810D, "getanimindexfromalias" }, + { 0x810E, "hasanimalias" }, + { 0x810F, "getanimentrycount" }, + { 0x8110, "getanimentryname" }, + { 0x8111, "getanimtime" }, + { 0x8112, "getanimweight" }, + { 0x8113, "getanimrate" }, + { 0x8114, "getattachignorecollision" }, + { 0x8115, "getattachmodelname" }, + { 0x8116, "getattachpos" }, + { 0x8117, "getattachsize" }, + { 0x8118, "getattachtagname" }, + { 0x8119, "getbarrelspinrate" }, + { 0x811A, "getbobrate" }, + { 0x811B, "getcentroid" }, + { 0x811C, "getclanidhigh" }, + { 0x811D, "getclanidlow" }, + { 0x811E, "getskill" }, + { 0x811F, "getclanwarsbonus" }, + { 0x8120, "getclosestenemysqdist" }, + { 0x8121, "getcorpseanim" }, + { 0x8122, "getcorpseentity" }, + { 0x8123, "getcovernode" }, + { 0x8124, "getcurrentoffhand" }, + { 0x8125, "getcurrentprimaryweapon" }, + { 0x8126, "getcurrentweapon" }, + { 0x8127, "getcurrentweaponclipammo" }, + { 0x8128, "getcustomizationbody" }, + { 0x8129, "getcustomizationhead" }, + { 0x812A, "getcustomizationviewmodel" }, + { 0x812B, "getdroptofloorposition" }, + { 0x812C, "getenemyinfo" }, + { 0x812D, "getenemysqdist" }, + { 0x812E, "getentitynumber" }, + { 0x812F, "getentityvelocity" }, + { 0x8130, "geteye" }, + { 0x8131, "getfireteammembers" }, + { 0x8132, "getfixednodesafevolume" }, + { 0x8133, "getfractionmaxammo" }, + { 0x8134, "getfractionstartammo" }, + { 0x8135, "getgoalspeedmph" }, + { 0x8136, "getgoalvolume" }, + { 0x8137, "getgroundenttype" }, + { 0x8138, "getguid" }, + { 0x8139, "gethighestnodestance" }, + { 0x813A, "gethybridscopestate" }, + { 0x813B, "getistouchingentities" }, + { 0x813C, "getjointype" }, + { 0x813D, "getlightcolor" }, + { 0x813E, "getlightfovinner" }, + { 0x813F, "getlightfovouter" }, + { 0x8140, "getlightintensity" }, + { 0x8141, "getlightuvintensity" }, + { 0x8142, "getlightradius" }, + { 0x8143, "getlinkedchildren" }, + { 0x8144, "getlinkedparent" }, + { 0x8145, "getlocalplayerprofiledata" }, + { 0x8146, "getlookaheaddir" }, + { 0x8147, "getmlgspectatorteam" }, + { 0x8148, "setmlgspectatorfromlobbydata" }, + { 0x8149, "ismlgfollower" }, + { 0x814A, "getmode" }, + { 0x814B, "getmotionangle" }, + { 0x814C, "getmotiontrackervisible" }, + { 0x814D, "getmovingplatformparent" }, + { 0x814E, "getmuzzleangle" }, + { 0x814F, "getmuzzlepos" }, + { 0x8150, "getmuzzlesideoffsetpos" }, + { 0x8151, "getnearestnode" }, + { 0x8152, "getnegotiationendnode" }, + { 0x8153, "getnegotiationendpos" }, + { 0x8154, "getnegotiationstartnode" }, + { 0x8155, "getnodenumber" }, + { 0x8156, "getnonstick" }, + { 0x8157, "getnormalhealth" }, + { 0x8158, "getnormalizedcameramovement" }, + { 0x8159, "getnormalizedmovement" }, + { 0x815A, "getoffhandprimaryclass" }, + { 0x815B, "getoffhandsecondaryclass" }, + { 0x815C, "getorigin" }, + { 0x815D, "getpathgoalpos" }, + { 0x815E, "getplayerangles" }, + { 0x815F, "getplayeruseentity" }, + { 0x8160, "getplayerdata" }, + { 0x8161, "getplayerintelisfound" }, + { 0x8162, "getplayerknifemodel" }, + { 0x8163, "getplayersetting" }, + { 0x8164, "getplayerssightingme" }, + { 0x8165, "getplayerviewheight" }, + { 0x8166, "getplayerweaponmodel" }, + { 0x8167, "getpointinbounds" }, + { 0x8168, "getrestedtime" }, + { 0x8169, "getshootatpos" }, + { 0x816A, "getsightedplayers" }, + { 0x816B, "getspectatingplayer" }, + { 0x816C, "getstance" }, + { 0x816D, "gettagangles" }, + { 0x816E, "gettagorigin" }, + { 0x816F, "tagexists" }, + { 0x8170, "gettargetentity" }, + { 0x8171, "getthirdpersoncrosshairoffset" }, + { 0x8172, "getthreatbiasgroup" }, + { 0x8173, "getturret" }, + { 0x8174, "getturretowner" }, + { 0x8175, "getturrettarget" }, + { 0x8176, "getturretweaponinfo" }, + { 0x8177, "getucdidhigh" }, + { 0x8178, "getucdidlow" }, + { 0x8179, "getvalidcoverpeekouts" }, + { 0x817A, "getvalidcovermultinodetypes" }, + { 0x817B, "getvehicleowner" }, + { 0x817C, "getownedvehicle" }, + { 0x817D, "getvelocity" }, + { 0x817E, "getviewkickscale" }, + { 0x817F, "getviewmodel" }, + { 0x8180, "getvieworigin" }, + { 0x8181, "getweaponammoclip" }, + { 0x8182, "getweaponammostock" }, + { 0x8183, "getweaponhudiconoverride" }, + { 0x8184, "getweaponslist" }, + { 0x8185, "getweaponslistall" }, + { 0x8186, "getweaponslistexclusives" }, + { 0x8187, "getweaponslistitems" }, + { 0x8188, "getweaponslistoffhands" }, + { 0x8189, "getweaponslistprimaries" }, + { 0x818A, "getweaponslistmodelonly" }, + { 0x818B, "getwheelsurface" }, + { 0x818C, "getxuid" }, + { 0x818D, "giveachievement" }, + { 0x818E, "givemaxammo" }, + { 0x818F, "givestartammo" }, + { 0x8190, "giveweapon" }, + { 0x8191, "glanceatentity" }, + { 0x8192, "glanceatpos" }, + { 0x8193, "hasenemybeenseen" }, + { 0x8194, "hasfemalecustomizationmodel" }, + { 0x8195, "hasloadedcustomizationplayerview" }, + { 0x8196, "hasperk" }, + { 0x8197, "hasweapon" }, + { 0x8198, "hide" }, + { 0x8199, "hideallparts" }, + { 0x819A, "hidehud" }, + { 0x819B, "hideonclient" }, + { 0x819C, "hidepart" }, + { 0x819D, "hidepart_allinstances" }, + { 0x819E, "hidepartandchildren_allinstances" }, + { 0x819F, "hideviewmodel" }, + { 0x81A0, "hudoutlinedisable" }, + { 0x81A1, "hudoutlinedisableforclient" }, + { 0x81A2, "hudoutlinedisableforclients" }, + { 0x81A3, "hudoutlineenable" }, + { 0x81A4, "hudoutlineenableforclient" }, + { 0x81A5, "hudoutlineenableforclients" }, + { 0x81A6, "hudoutlineviewmodelenable" }, + { 0x81A7, "hudoutlineviewmodeldisable" }, + { 0x81A8, "initriotshieldhealth" }, + { 0x81A9, "invisiblenotsolid" }, + { 0x81AA, "iprintln" }, + { 0x81AB, "iprintlnbold" }, + { 0x81AC, "isbadguy" }, + { 0x81AD, "iscovervalidagainstenemy" }, + { 0x81AE, "isdualwielding" }, + { 0x81AF, "isenemyaware" }, + { 0x81B0, "iseqenabled" }, + { 0x81B1, "isfireteamleader" }, + { 0x81B2, "isfiring" }, + { 0x81B3, "isfiringturret" }, + { 0x81B4, "isfiringvehicleturret" }, + { 0x81B5, "isgrenadepossafe" }, + { 0x81B6, "ishost" }, + { 0x81B7, "isindoor" }, + { 0x81B8, "isingoal" }, + { 0x81B9, "isinscriptedstate" }, + { 0x81BA, "isitemunlocked" }, + { 0x81BB, "isknownenemyinradius" }, + { 0x81BC, "isknownenemyinvolume" }, + { 0x81BD, "isleaning" }, + { 0x81BE, "islinked" }, + { 0x81BF, "islookingat" }, + { 0x81C0, "ismantling" }, + { 0x81C1, "ismeleeing" }, + { 0x81C2, "getmeleeattacktype" }, + { 0x81C3, "getmeleeattackvariant" }, + { 0x81C4, "getmeleeattackisalternate" }, + { 0x81C5, "ismlgspectator" }, + { 0x81C6, "ismovementfromgamepad" }, + { 0x81C7, "ismovesuppressed" }, + { 0x81C8, "isocclusionenabled" }, + { 0x81C9, "isoffhandweaponreadytothrow" }, + { 0x81CA, "isonground" }, + { 0x81CB, "isonladder" }, + { 0x81CC, "setbountycount" }, + { 0x81CD, "setperkicon" }, + { 0x81CE, "setsquadindex" }, + { 0x81CF, "getlobbysquadindex" }, + { 0x81D0, "ispathdirect" }, + { 0x81D1, "isragdoll" }, + { 0x81D2, "isreloading" }, + { 0x81D3, "issighted" }, + { 0x81D4, "issplitscreenplayer" }, + { 0x81D5, "issplitscreenplayerprimary" }, + { 0x81D6, "getothersplitscreenplayer" }, + { 0x81D7, "issprinting" }, + { 0x81D8, "issprintsliding" }, + { 0x81D9, "isstanceallowed" }, + { 0x81DA, "issuppressed" }, + { 0x81DB, "issuppressionwaiting" }, + { 0x81DC, "isswitchingweapon" }, + { 0x81DD, "israisingweapon" }, + { 0x81DE, "isdroppingweapon" }, + { 0x81DF, "istalking" }, + { 0x81E0, "isthrowinggrenade" }, + { 0x81E1, "istouching" }, + { 0x81E2, "istriggerenabled" }, + { 0x81E3, "isturretready" }, + { 0x81E4, "isusingonlinedataoffline" }, + { 0x81E5, "isusingturret" }, + { 0x81E6, "iswaitingonsound" }, + { 0x81E7, "itemweaponsetammo" }, + { 0x81E8, "joltbody" }, + { 0x81E9, "jumpbuttonpressed" }, + { 0x81EA, "kc_regweaponforfxremoval" }, + { 0x81EB, "kill" }, + { 0x81EC, "laseraltoff" }, + { 0x81ED, "laseralton" }, + { 0x81EE, "laseraltviewoff" }, + { 0x81EF, "laseraltviewon" }, + { 0x81F0, "laserforceoff" }, + { 0x81F1, "laserforceon" }, + { 0x81F2, "laserhidefromclient" }, + { 0x81F3, "laseroff" }, + { 0x81F4, "laseron" }, + { 0x81F5, "lastknownpos" }, + { 0x81F6, "lastknowntime" }, + { 0x81F7, "laststandrevive" }, + { 0x81F8, "launch" }, + { 0x81F9, "lerpfov" }, + { 0x81FA, "lerpfovscalefactor" }, + { 0x81FB, "lerpviewangleclamp" }, + { 0x81FC, "linkto" }, + { 0x81FD, "linktoblendtotag" }, + { 0x81FE, "linktomoveoffset" }, + { 0x81FF, "linktoplayerview" }, + { 0x8200, "linktoplayerviewfollowremoteeyes" }, + { 0x8201, "linktoplayerviewignoreparentrot" }, + { 0x8202, "linkwaypointtotargetwithoffset" }, + { 0x8203, "loadcustomizationplayerview" }, + { 0x8204, "localtoworldcoords" }, + { 0x8205, "logmatchdatadeath" }, + { 0x8206, "logclientmatchdatadeath" }, + { 0x8207, "logplayerendmatchdata" }, + { 0x8208, "logmatchdatalife" }, + { 0x8209, "logstring" }, + { 0x820A, "magicgrenade" }, + { 0x820B, "magicgrenademanual" }, + { 0x820C, "makecollidewithitemclip" }, + { 0x820D, "makeentitynomeleetarget" }, + { 0x820E, "makeentitysentient" }, + { 0x820F, "makefakeai" }, + { 0x8210, "makeportableradar" }, + { 0x8211, "makescrambler" }, + { 0x8212, "maketurretinoperable" }, + { 0x8213, "maketurretoperable" }, + { 0x8214, "makeunusable" }, + { 0x8215, "makeusable" }, + { 0x8216, "makevehiclesolid" }, + { 0x8217, "makevehiclesolidcapsule" }, + { 0x8218, "makevehiclesolidsphere" }, + { 0x8219, "markforeyeson" }, + { 0x821A, "maymovefrompointtopoint" }, + { 0x821B, "maymovetopoint" }, + { 0x821C, "melee" }, + { 0x821D, "meleebuttonpressed" }, + { 0x821E, "missile_cleartarget" }, + { 0x821F, "missile_setflightmodedirect" }, + { 0x8220, "missile_setflightmodetop" }, + { 0x8221, "missile_settargetent" }, + { 0x8222, "missile_settargetpos" }, + { 0x8223, "motionblurhqdisable" }, + { 0x8224, "motionblurhqenable" }, + { 0x8225, "mountvehicle" }, + { 0x8226, "movegravity" }, + { 0x8227, "moveovertime" }, + { 0x8228, "moveshieldmodel" }, + { 0x8229, "moveslide" }, + { 0x822A, "moveto" }, + { 0x822B, "movex" }, + { 0x822C, "movey" }, + { 0x822D, "movez" }, + { 0x822E, "nearclaimnode" }, + { 0x822F, "nearclaimnodeandangle" }, + { 0x8230, "nearnode" }, + { 0x8231, "newpip" }, + { 0x8232, "nightvisiongogglesforceoff" }, + { 0x8233, "nightvisiongogglesforceon" }, + { 0x8234, "nightvisionviewoff" }, + { 0x8235, "activatenightvisionblind" }, + { 0x8236, "setnightvisionblindweight" }, + { 0x8237, "nightvisionviewon" }, + { 0x8238, "nodeisdisconnected" }, + { 0x8239, "notifyonplayercommand" }, + { 0x823A, "notifyonplayercommandremove" }, + { 0x823B, "notsolid" }, + { 0x823C, "openmenu" }, + { 0x823D, "openpopupmenu" }, + { 0x823E, "openpopupmenunomouse" }, + { 0x823F, "orientmode" }, + { 0x8240, "painvisionoff" }, + { 0x8241, "painvisionon" }, + { 0x8242, "physicslaunchclient" }, + { 0x8243, "physicslaunchserver" }, + { 0x8244, "physicslaunchserveritem" }, + { 0x8245, "physicswarpto" }, + { 0x8246, "pickupgrenade" }, + { 0x8247, "pingplayer" }, + { 0x8248, "placespawnpoint" }, + { 0x8249, "playcontextsound" }, + { 0x824A, "player_recoilscaleoff" }, + { 0x824B, "player_recoilscaleon" }, + { 0x824C, "playerads" }, + { 0x824D, "playerclearstreamorigin" }, + { 0x824E, "playerforcedeathanim" }, + { 0x824F, "playerhide" }, + { 0x8250, "playerlinkedoffsetdisable" }, + { 0x8251, "playerlinkedoffsetenable" }, + { 0x8252, "playerlinkedsetforceparentvisible" }, + { 0x8253, "playerlinkedsetusebaseangleforviewclamp" }, + { 0x8254, "playerlinkedsetviewznear" }, + { 0x8255, "playerlinkedturretanglesdisable" }, + { 0x8256, "playerlinkedturretanglesenable" }, + { 0x8257, "playerlinkeduselinkedvelocity" }, + { 0x8258, "playerlinkto" }, + { 0x8259, "playerlinktoabsolute" }, + { 0x825A, "playerlinktoblend" }, + { 0x825B, "playerlinktodelta" }, + { 0x825C, "playerlinkweaponviewtodelta" }, + { 0x825D, "playermount" }, + { 0x825E, "playermounttype" }, + { 0x825F, "playersetgroundreferenceent" }, + { 0x8260, "playersetstreamorigin" }, + { 0x8261, "playexplosionsound" }, + { 0x8262, "playfx" }, + { 0x8263, "playlocalsound" }, + { 0x8264, "playloopsound" }, + { 0x8265, "playrumblelooponentity" }, + { 0x8266, "playrumbleonentity" }, + { 0x8267, "playrumbleonpositionforclient" }, + { 0x8268, "playrumblelooponpositionforclient" }, + { 0x8269, "playsound" }, + { 0x826A, "playsoundatviewheight" }, + { 0x826B, "playsoundonmovingent" }, + { 0x826C, "playsoundtoplayer" }, + { 0x826D, "playsoundtoteam" }, + { 0x826E, "playsurfacesound" }, + { 0x826F, "predictstreampos" }, + { 0x8270, "clearpredictedstreampos" }, + { 0x8271, "ispredictedstreamposready" }, + { 0x8272, "pushplayer" }, + { 0x8273, "pushplayervector" }, + { 0x8274, "queuedialogforplayer" }, + { 0x8275, "radiusdamage" }, + { 0x8276, "reacquiremove" }, + { 0x8277, "reacquirestep" }, + { 0x8278, "registerparty" }, + { 0x8279, "releaseclaimedtrigger" }, + { 0x827A, "remotecamerasoundscapeoff" }, + { 0x827B, "remotecamerasoundscapeon" }, + { 0x827C, "remotecontrolturret" }, + { 0x827D, "remotecontrolturretoff" }, + { 0x827E, "controlturreton" }, + { 0x827F, "controlturretoff" }, + { 0x8280, "remotecontrolvehicle" }, + { 0x8281, "remotecontrolvehicleoff" }, + { 0x8282, "remotecontrolvehicletarget" }, + { 0x8283, "remotecontrolvehicletargetoff" }, + { 0x8284, "removeaieventlistener" }, + { 0x8285, "removefrommovingplatformsystem" }, + { 0x8286, "reset" }, + { 0x8287, "resetspreadoverride" }, + { 0x8288, "restoredefaultdroppitch" }, + { 0x8289, "resumespeed" }, + { 0x828A, "setlookaheadtime" }, + { 0x828B, "getlookaheadtime" }, + { 0x828C, "returnplayercontrol" }, + { 0x828D, "ridevehicle" }, + { 0x828E, "rotateby" }, + { 0x828F, "rotatebylinked" }, + { 0x8290, "rotateovertime" }, + { 0x8291, "rotatepitch" }, + { 0x8292, "rotateroll" }, + { 0x8293, "rotateto" }, + { 0x8294, "rotatetolinked" }, + { 0x8295, "rotatevelocity" }, + { 0x8296, "rotateyaw" }, + { 0x8297, "safeteleport" }, + { 0x8298, "savematchrulestohistory" }, + { 0x8299, "sayall" }, + { 0x829A, "sayteam" }, + { 0x829B, "scaleovertime" }, + { 0x829C, "scalepitch" }, + { 0x829D, "scalevolume" }, + { 0x829E, "scragentbeginmelee" }, + { 0x829F, "scragentclaimnode" }, + { 0x82A0, "scragentdoanimlerp" }, + { 0x82A1, "scragentdoanimrelative" }, + { 0x82A2, "scragentdotrajectory" }, + { 0x82A3, "scragentgetgoalpos" }, + { 0x82A4, "scragentgetmaxturnspeed" }, + { 0x82A5, "scragentrelinquishclaimednode" }, + { 0x82A6, "scragentsetanimmode" }, + { 0x82A7, "scragentsetanimscale" }, + { 0x82A8, "scragentsetclipmode" }, + { 0x82A9, "scragentsetgoalentity" }, + { 0x82AA, "scragentsetgoalnode" }, + { 0x82AB, "scragentsetgoalpos" }, + { 0x82AC, "scragentsetgoalradius" }, + { 0x82AD, "scragentsetmaxturnspeed" }, + { 0x82AE, "scragentsetorientmode" }, + { 0x82AF, "scragentsetphysicsmode" }, + { 0x82B0, "scragentsetscripted" }, + { 0x82B1, "scragentsetunittype" }, + { 0x82B2, "scragentsetviewheight" }, + { 0x82B3, "scragentsetwallruncost" }, + { 0x82B4, "scragentsetwaypoint" }, + { 0x82B5, "scragentusemodelcollisionbounds" }, + { 0x82B6, "screenshakeonentity" }, + { 0x82B7, "scriptmodelclearanim" }, + { 0x82B8, "scriptmodelplayanim" }, + { 0x82B9, "scriptmodelplayanimdeltamotion" }, + { 0x82BA, "secondaryoffhandbuttonpressed" }, + { 0x82BB, "seerecently" }, + { 0x82BC, "sendleaderboards" }, + { 0x82BD, "setacceleration" }, + { 0x82BE, "setactionslot" }, + { 0x82BF, "setagentattacker" }, + { 0x82C0, "setaimspreadmovementscale" }, + { 0x82C1, "setairresistance" }, + { 0x82C2, "setaispread" }, + { 0x82C3, "setalienjumpcostscale" }, + { 0x82C4, "setalienruncostscale" }, + { 0x82C5, "setalientraversecostscale" }, + { 0x82C6, "setanim" }, + { 0x82C7, "setanimclass" }, + { 0x82C8, "setanimknob" }, + { 0x82C9, "setanimknoball" }, + { 0x82CA, "setanimknoballlimited" }, + { 0x82CB, "setanimknoballlimitedrestart" }, + { 0x82CC, "setanimknoballrestart" }, + { 0x82CD, "setanimknoblimited" }, + { 0x82CE, "setanimknoblimitedrestart" }, + { 0x82CF, "setanimknobrestart" }, + { 0x82D0, "setanimlimited" }, + { 0x82D1, "setanimlimitedrestart" }, + { 0x82D2, "setanimrestart" }, + { 0x82D3, "setanimstate" }, + { 0x82D4, "setanimtime" }, + { 0x82D5, "setanimrate" }, + { 0x82D6, "setanimblendcurve" }, + { 0x82D7, "setcustomnodegameparameter" }, + { 0x82D8, "isanimlooping" }, + { 0x82D9, "setautopickup" }, + { 0x82DA, "setautorotationdelay" }, + { 0x82DB, "setblurforplayer" }, + { 0x82DC, "setbobrate" }, + { 0x82DD, "setbottomarc" }, + { 0x82DE, "setcandamage" }, + { 0x82DF, "setcanradiusdamage" }, + { 0x82E0, "setcarddisplayslot" }, + { 0x82E1, "setchargemeleehudvisible" }, + { 0x82E2, "setclientdvar" }, + { 0x82E3, "setclientdvars" }, + { 0x82E4, "setclientomnvar" }, + { 0x82E5, "setclientomnvarbit" }, + { 0x82E6, "setclientowner" }, + { 0x82E7, "setclienttriggeraudiozone" }, + { 0x82E8, "setclienttriggeraudiozonelerp" }, + { 0x82E9, "setclienttriggeraudiozonepartial" }, + { 0x82EA, "setclienttriggeraudiozonepartialwithfade" }, + { 0x82EB, "setclock" }, + { 0x82EC, "setclockup" }, + { 0x82ED, "setclothtype" }, + { 0x82EE, "setconvergenceheightpercent" }, + { 0x82EF, "setconvergencetime" }, + { 0x82F0, "setcorpsefalling" }, + { 0x82F1, "setcorpseremovetimer" }, + { 0x82F2, "getcorpsephysicsorigin" }, + { 0x82F3, "setcursorhint" }, + { 0x82F4, "setdamagestage" }, + { 0x82F5, "setdeceleration" }, + { 0x82F6, "setdefaultaimlimits" }, + { 0x82F7, "setdefaultdroppitch" }, + { 0x82F8, "setdepthoffield" }, + { 0x82F9, "setdistributed2dsound" }, + { 0x82FA, "setdronegoalpos" }, + { 0x82FB, "setempjammed" }, + { 0x82FC, "setengagementmaxdist" }, + { 0x82FD, "setengagementmindist" }, + { 0x82FE, "setentityowner" }, + { 0x82FF, "setentitytarget" }, + { 0x8300, "seteyesonuplinkenabled" }, + { 0x8301, "setfixednodesafevolume" }, + { 0x8302, "setflaggedanim" }, + { 0x8303, "setflaggedanimknob" }, + { 0x8304, "setflaggedanimknoball" }, + { 0x8305, "setflaggedanimknoballrestart" }, + { 0x8306, "setflaggedanimknoblimited" }, + { 0x8307, "setflaggedanimknoblimitedrestart" }, + { 0x8308, "setflaggedanimknobrestart" }, + { 0x8309, "setflaggedanimlimited" }, + { 0x830A, "setflaggedanimlimitedrestart" }, + { 0x830B, "setflaggedanimrestart" }, + { 0x830C, "setflashbanged" }, + { 0x830D, "setfxkilldefondelete" }, + { 0x830E, "setgoalentity" }, + { 0x830F, "setgoalnode" }, + { 0x8310, "setgoalpath" }, + { 0x8311, "setgoalpos" }, + { 0x8312, "setgoalvolume" }, + { 0x8313, "setgoalvolumeauto" }, + { 0x8314, "setgoalyaw" }, + { 0x8315, "setgrenadecookscale" }, + { 0x8316, "setgrenadethrowscale" }, + { 0x8317, "sethintstring" }, + { 0x8318, "sethoverparams" }, + { 0x8319, "sethuddynlight" }, + { 0x831A, "sethybridscopestate" }, + { 0x831B, "setjitterparams" }, + { 0x831C, "setleftarc" }, + { 0x831D, "setlightcolor" }, + { 0x831E, "setlightfovrange" }, + { 0x831F, "setlightintensity" }, + { 0x8320, "setlightuvintensity" }, + { 0x8321, "setlightradius" }, + { 0x8322, "setlinkedangles" }, + { 0x8323, "setlocalplayerprofiledata" }, + { 0x8324, "setlookat" }, + { 0x8325, "setlookatent" }, + { 0x8326, "setlookatentity" }, + { 0x8327, "setlookatstateoverride" }, + { 0x8328, "clearlookatstateoverride" }, + { 0x8329, "setlookattext" }, + { 0x832A, "setmantlesoundflavor" }, + { 0x832B, "setmaxpitchroll" }, + { 0x832C, "setmissileminimapvisible" }, + { 0x832D, "setmlgcameradefaults" }, + { 0x832E, "setmlgselectedcameraicon" }, + { 0x832F, "setmlgspectator" }, + { 0x8330, "setmode" }, + { 0x8331, "setmodel" }, + { 0x8332, "setmotiontrackervisible" }, + { 0x8333, "setmovespeedscale" }, + { 0x8334, "setmovingplatformplayerturnrate" }, + { 0x8335, "setmovingplatformtrigger" }, + { 0x8336, "setneargoalnotifydist" }, + { 0x8337, "setnodeploy" }, + { 0x8338, "setnonstick" }, + { 0x8339, "setnormalhealth" }, + { 0x833A, "setocclusion" }, + { 0x833B, "setocclusionfromtable" }, + { 0x833C, "setoffhandprimaryclass" }, + { 0x833D, "setoffhandsecondaryclass" }, + { 0x833E, "setorigin" }, + { 0x833F, "setotherent" }, + { 0x8340, "setperk" }, + { 0x8341, "setpitchorient" }, + { 0x8342, "setplayerangles" }, + { 0x8343, "setplayercorpsedone" }, + { 0x8344, "setplayerdata" }, + { 0x8345, "setplayerintelfound" }, + { 0x8346, "setplayernamestring" }, + { 0x8347, "setplayerspread" }, + { 0x8348, "setpotentialthreat" }, + { 0x8349, "setpriorityclienttriggeraudiozone" }, + { 0x834A, "setpriorityclienttriggeraudiozonepartial" }, + { 0x834B, "setpriorityclienttriggeraudiozonepartialwithfade" }, + { 0x834C, "setproneanimnodes" }, + { 0x834D, "setpulsefx" }, + { 0x834E, "setrank" }, + { 0x834F, "setreverb" }, + { 0x8350, "setreverbfromtable" }, + { 0x8351, "setrightarc" }, + { 0x8352, "setscriptabledamageowner" }, + { 0x8353, "setscriptablepartstate" }, + { 0x8354, "setscriptmoverkillcam" }, + { 0x8355, "setsentrycarrier" }, + { 0x8356, "setsentryowner" }, + { 0x8357, "setturretowner" }, + { 0x8358, "setshader" }, + { 0x8359, "setsoundblend" }, + { 0x835A, "settransientsoundbank" }, + { 0x835B, "setspawnerteam" }, + { 0x835C, "setspawnweapon" }, + { 0x835D, "setspeakermapmonoto51" }, + { 0x835E, "setspeakermapmonotostereo" }, + { 0x835F, "setspectatedefaults" }, + { 0x8360, "setspreadoverride" }, + { 0x8361, "setstablemissile" }, + { 0x8362, "setstance" }, + { 0x8363, "setsuppressiontime" }, + { 0x8364, "setsurfacetype" }, + { 0x8365, "setswitchnode" }, + { 0x8366, "settalktospecies" }, + { 0x8367, "settargetent" }, + { 0x8368, "settargetentity" }, + { 0x8369, "settargetyaw" }, + { 0x836A, "setteamfortrigger" }, + { 0x836B, "settenthstimer" }, + { 0x836C, "settenthstimerstatic" }, + { 0x836D, "settenthstimerup" }, + { 0x836E, "settext" }, + { 0x836F, "setthreatbiasgroup" }, + { 0x8370, "settimer" }, + { 0x8371, "settimerstatic" }, + { 0x8372, "settimerup" }, + { 0x8373, "settimescalefactorfromtable" }, + { 0x8374, "settoparc" }, + { 0x8375, "setturningability" }, + { 0x8376, "setturretanim" }, + { 0x8377, "setturretcanaidetach" }, + { 0x8378, "setturretdismountorg" }, + { 0x8379, "setturretfov" }, + { 0x837A, "setturretignoregoals" }, + { 0x837B, "setturretminimapvisible" }, + { 0x837C, "setturretmodechangewait" }, + { 0x837D, "setturrettargetent" }, + { 0x837E, "setturrettargetvec" }, + { 0x837F, "setturretteam" }, + { 0x8380, "setusepriority" }, + { 0x8381, "setuseprioritymax" }, + { 0x8382, "setvalue" }, + { 0x8383, "setvehgoalpos" }, + { 0x8384, "setvehiclelookattext" }, + { 0x8385, "setvehicleteam" }, + { 0x8386, "setvehweapon" }, + { 0x8387, "setvelocity" }, + { 0x8388, "setviewangleresistance" }, + { 0x8389, "setviewkickscale" }, + { 0x838A, "setviewmodel" }, + { 0x838B, "setviewmodeldepth" }, + { 0x838C, "setviewmodeldepthoffield" }, + { 0x838D, "setvisionparams" }, + { 0x838E, "setwaitnode" }, + { 0x838F, "setwaitspeed" }, + { 0x8390, "setwatersheeting" }, + { 0x8391, "setwaypoint" }, + { 0x8392, "setwaypointedgestyle_rotatingicon" }, + { 0x8393, "setwaypointedgestyle_secondaryarrow" }, + { 0x8394, "setwaypointiconoffscreenonly" }, + { 0x8395, "setweaponammoclip" }, + { 0x8396, "setweaponammostock" }, + { 0x8397, "setweaponhudiconoverride" }, + { 0x8398, "setweaponhudiconoverrideammo" }, + { 0x8399, "setweaponmodelvariant" }, + { 0x839A, "setyawspeed" }, + { 0x839B, "setyawspeedbyname" }, + { 0x839C, "shellshock" }, + { 0x839D, "shoot" }, + { 0x839E, "shootblank" }, + { 0x839F, "shootstopsound" }, + { 0x83A0, "shootturret" }, + { 0x83A1, "shouldearlyragdoll" }, + { 0x83A2, "shouldplaymeleedeathanim" }, + { 0x83A3, "show" }, + { 0x83A4, "showallparts" }, + { 0x83A5, "showhud" }, + { 0x83A6, "showhudsplash" }, + { 0x83A7, "showonclient" }, + { 0x83A8, "showpart" }, + { 0x83A9, "showonlytoplayer" }, + { 0x83AA, "showtoplayer" }, + { 0x83AB, "showviewmodel" }, + { 0x83AC, "sightconetrace" }, + { 0x83AD, "snaptotargetentity" }, + { 0x83AE, "solid" }, + { 0x83AF, "spawn" }, + { 0x83B0, "spawnagent" }, + { 0x83B1, "spawndrone" }, + { 0x83B2, "spawnbotortestclient" }, + { 0x83B3, "springcamdisabled" }, + { 0x83B4, "springcamenabled" }, + { 0x83B5, "stalingradspawn" }, + { 0x83B6, "startac130" }, + { 0x83B7, "startbarrelspin" }, + { 0x83B8, "startcoverarrival" }, + { 0x83B9, "startcoverbehavior" }, + { 0x83BA, "startfiring" }, + { 0x83BB, "startpath" }, + { 0x83BC, "startpathfind" }, + { 0x83BD, "startpathnodes" }, + { 0x83BE, "path_getcurrentnode" }, + { 0x83BF, "path_getcurrenttime" }, + { 0x83C0, "path_getcurrentnodetime" }, + { 0x83C1, "stoppath" }, + { 0x83C2, "pausepath" }, + { 0x83C3, "resumepath" }, + { 0x83C4, "startragdoll" }, + { 0x83C5, "startragdollfromimpact" }, + { 0x83C6, "startscriptedanim" }, + { 0x83C7, "starttraversearrival" }, + { 0x83C8, "startusingheroonlylighting" }, + { 0x83C9, "startusinglessfrequentlighting" }, + { 0x83CA, "stopac130" }, + { 0x83CB, "stopanimscripted" }, + { 0x83CC, "stopbarrelspin" }, + { 0x83CD, "stopfiring" }, + { 0x83CE, "stoplocalsound" }, + { 0x83CF, "stoplookat" }, + { 0x83D0, "stoploopsound" }, + { 0x83D1, "stopmoveslide" }, + { 0x83D2, "stopridingvehicle" }, + { 0x83D3, "stoprumble" }, + { 0x83D4, "stopshellshock" }, + { 0x83D5, "stopsliding" }, + { 0x83D6, "stopsoundchannel" }, + { 0x83D7, "stopsounds" }, + { 0x83D8, "stopuseanimtree" }, + { 0x83D9, "stopuseturret" }, + { 0x83DA, "stopusingheroonlylighting" }, + { 0x83DB, "stopusinglessfrequentlighting" }, + { 0x83DC, "stunplayer" }, + { 0x83DD, "suicide" }, + { 0x83DE, "switchtooffhand" }, + { 0x83DF, "switchtoweapon" }, + { 0x83E0, "switchtoweaponimmediate" }, + { 0x83E1, "takeallweapons" }, + { 0x83E2, "takeweapon" }, + { 0x83E3, "teleport" }, + { 0x83E4, "teleportentityrelative" }, + { 0x83E5, "thermaldrawdisable" }, + { 0x83E6, "thermaldrawenable" }, + { 0x83E7, "thermalvisionfofoverlayoff" }, + { 0x83E8, "thermalvisionfofoverlayon" }, + { 0x83E9, "thermalvisionoff" }, + { 0x83EA, "thermalvisionon" }, + { 0x83EB, "thermalvisiononshadowoff" }, + { 0x83EC, "throwgrenade" }, + { 0x83ED, "triggerenable" }, + { 0x83EE, "triggerdisable" }, + { 0x83EF, "turretfiredisable" }, + { 0x83F0, "turretfireenable" }, + { 0x83F1, "turretoverheatdisable" }, + { 0x83F2, "turretisoverheatdisabled" }, + { 0x83F3, "turretsetbarrelspinenabled" }, + { 0x83F4, "undockmovingplatform" }, + { 0x83F5, "unlink" }, + { 0x83F6, "unlinkfromplayerview" }, + { 0x83F7, "unsetperk" }, + { 0x83F8, "updateentitywithweapons" }, + { 0x83F9, "getentityweapons" }, + { 0x83FA, "updateplayersightaccuracy" }, + { 0x83FB, "updateprone" }, + { 0x83FC, "useanimtree" }, + { 0x83FD, "usebuttonpressed" }, + { 0x83FE, "isuseinprogress" }, + { 0x83FF, "isuseavailable" }, + { 0x8400, "useby" }, + { 0x8401, "usecovernode" }, + { 0x8402, "usehintsinvehicle" }, + { 0x8403, "usehintsonturret" }, + { 0x8404, "usetriggerrequirelookat" }, + { 0x8405, "useturret" }, + { 0x8406, "usinggamepad" }, + { 0x8407, "vehicle_canturrettargetpoint" }, + { 0x8408, "vehicle_dospawn" }, + { 0x8409, "vehicle_finishdamage" }, + { 0x840A, "vehicle_getbodyvelocity" }, + { 0x840B, "vehicle_getspeed" }, + { 0x840C, "vehicle_getsteering" }, + { 0x840D, "vehicle_getthrottle" }, + { 0x840E, "vehicle_getvelocity" }, + { 0x840F, "vehicle_getangularvelocity" }, + { 0x8410, "vehicle_helisetai" }, + { 0x8411, "vehicle_isphysveh" }, + { 0x8412, "vehicle_orientto" }, + { 0x8413, "vehicle_rotateyaw" }, + { 0x8414, "vehicle_setspeed" }, + { 0x8415, "vehicle_setspeedimmediate" }, + { 0x8416, "vehicle_teleport" }, + { 0x8417, "vehicle_turnengineoff" }, + { 0x8418, "vehicle_turnengineon" }, + { 0x8419, "rcplane_settopspeed" }, + { 0x841A, "rcplane_settopspeedboost" }, + { 0x841B, "rcplane_setminspeed" }, + { 0x841C, "vehicleattackbuttonpressed" }, + { 0x841D, "vehicledriveto" }, + { 0x841E, "vehicleturretcontroloff" }, + { 0x841F, "vehicleturretcontrolon" }, + { 0x8420, "vehicleusealtblendedaudio" }, + { 0x8421, "vehphys_crash" }, + { 0x8422, "vehphys_disablecrashing" }, + { 0x8423, "vehphys_enablecrashing" }, + { 0x8424, "vehphys_launch" }, + { 0x8425, "vehphys_setconveyorbelt" }, + { 0x8426, "vehphys_forcekeyframedmotion" }, + { 0x8427, "vehphys_setdefaultmotion" }, + { 0x8428, "vibrate" }, + { 0x8429, "viewkick" }, + { 0x842A, "visiblesolid" }, + { 0x842B, "visionsetfadetoblackforplayer" }, + { 0x842C, "visionsetmissilecamforplayer" }, + { 0x842D, "visionsetnakedforplayer" }, + { 0x842E, "visionsetnightforplayer" }, + { 0x842F, "visionsetpainforplayer" }, + { 0x8430, "visionsetalternateforplayer" }, + { 0x8431, "increaseplayerconsecutivekills" }, + { 0x8432, "resetplayerconsecutivekills" }, + { 0x8433, "setplayersupermeterprogress" }, + { 0x8434, "visionsetthermalforplayer" }, + { 0x8435, "weaponlockfinalize" }, + { 0x8436, "weaponlockfree" }, + { 0x8437, "weaponlocknoclearance" }, + { 0x8438, "weaponlockstart" }, + { 0x8439, "weaponlocktargettooclose" }, + { 0x843A, "willneverchange" }, + { 0x843B, "worldpointinreticle_circle" }, + { 0x843C, "worldpointinreticle_rect" }, + { 0x843D, "worldpointtoscreenpos" }, + { 0x843E, "getanimassettype" }, + { 0x843F, "getdebugeye" }, + { 0x8440, "getentnum" }, + { 0x8441, "noclip" }, + { 0x8442, "setdevtext" }, + { 0x8443, "ufo" }, + { 0x8444, "allowdodge" }, + { 0x8445, "allowhighjump" }, + { 0x8446, "allowboostjump" }, + { 0x8447, "isjumping" }, + { 0x8448, "ishighjumping" }, + { 0x8449, "setworldupreference" }, + { 0x844A, "physics_getnumbodies" }, + { 0x844B, "physics_getbodyid" }, + { 0x844C, "physics_getplayergroundlinvel" }, + { 0x844D, "physics_createinstance" }, + { 0x844E, "physics_takecontrol" }, + { 0x844F, "physics_applyimpulse" }, + { 0x8450, "pathdisttogoal" }, + { 0x8451, "clearpath" }, + { 0x8452, "setdodgemeter" }, + { 0x8453, "getdodgemeter" }, + { 0x8454, "allowdoublejump" }, + { 0x8455, "allowmovement" }, + { 0x8456, "allowwallrun" }, + { 0x8457, "allowslide" }, + { 0x8458, "findpath" }, + { 0x8459, "hidefromplayer" }, + { 0x845A, "energy_getenergy" }, + { 0x845B, "energy_setenergy" }, + { 0x845C, "energy_getmax" }, + { 0x845D, "energy_setmax" }, + { 0x845E, "energy_getresttimems" }, + { 0x845F, "energy_setresttimems" }, + { 0x8460, "energy_getuserate" }, + { 0x8461, "energy_setuserate" }, + { 0x8462, "energy_getrestorerate" }, + { 0x8463, "energy_setrestorerate" }, + { 0x8464, "physics_getcharactercollisioncapsule" }, + { 0x8465, "teleportworldupreferenceangles" }, + { 0x8466, "disableoffhandsecondaryweapons" }, + { 0x8467, "enableoffhandsecondaryweapons" }, + { 0x8468, "sprintbuttonpressed" }, + { 0x8469, "enemyincrosshairs" }, + { 0x846A, "crouchbuttonpressed" }, + { 0x846B, "isweaponsenabled" }, + { 0x846C, "physics_getentitymass" }, + { 0x846D, "physics_getentitydynamicmass" }, + { 0x846E, "physics_getentitycenterofmass" }, + { 0x846F, "physics_getentityaabb" }, + { 0x8470, "playgestureviewmodel" }, + { 0x8471, "stopgestureviewmodel" }, + { 0x8472, "getgestureanimlength" }, + { 0x8473, "createnavrepulsor3d" }, + { 0x8474, "destroynavrepulsor3d" }, + { 0x8475, "iswallrunning" }, + { 0x8476, "playershow" }, + { 0x8477, "isthrowingbackgrenade" }, + { 0x8478, "launchgrenade" }, + { 0x8479, "assignweaponoffhandprimary" }, + { 0x847A, "assignweaponoffhandsecondary" }, + { 0x847B, "clearoffhandprimary" }, + { 0x847C, "clearoffhandsecondary" }, + { 0x847D, "earthquakeforplayer" }, + { 0x847E, "assignweaponprimaryslot" }, + { 0x847F, "assignweaponheavyslot" }, + { 0x8480, "getweaponslot" }, + { 0x8481, "setsuit" }, + { 0x8482, "getgroundentity" }, + { 0x8483, "getposonpath" }, + { 0x8484, "setcamerathirdperson" }, + { 0x8485, "setentitysoundcontext" }, + { 0x8486, "setplayermusicstate" }, + { 0x8487, "getnavspaceent" }, + { 0x8488, "setdemeanorviewmodel" }, + { 0x8489, "getdemeanorviewmodel" }, + { 0x848A, "getgestureviewmodel" }, + { 0x848B, "forceplaygestureviewmodel" }, + { 0x848C, "isgesturelooped" }, + { 0x848D, "allowreload" }, + { 0x848E, "allowmounttop" }, + { 0x848F, "allowmountside" }, + { 0x8490, "allowmantle" }, + { 0x8491, "offhandstopclienteffects" }, + { 0x8492, "cleardamageindicators" }, + { 0x8493, "isgestureplaying" }, + { 0x8494, "visiblenotsolid" }, + { 0x8495, "destroydamagepart" }, + { 0x8496, "destroyalldamageparts" }, + { 0x8497, "getnearnodelistforspawncheck" }, + { 0x8498, "setbtgoalpos" }, + { 0x8499, "setbtgoalent" }, + { 0x849A, "setbtgoalnode" }, + { 0x849B, "setbtgoalvolume" }, + { 0x849C, "clearbtgoal" }, + { 0x849D, "btgoalvalid" }, + { 0x849E, "getsecondarytargets" }, + { 0x849F, "canmelee" }, + { 0x84A0, "sethitlocdamagetable" }, + { 0x84A1, "shootcustomweapon" }, + { 0x84A2, "playerunlinkonjump" }, + { 0x84A3, "sethudtutorialmessage" }, + { 0x84A4, "clearhudtutorialmessage" }, + { 0x84A5, "initdamageparts" }, + { 0x84A6, "adddamagepart" }, + { 0x84A7, "addhudwarningmessage" }, + { 0x84A8, "clearhudwarningmessage" }, + { 0x84A9, "enablecallouts" }, + { 0x84AA, "setvehicledef" }, + { 0x84AB, "setuserange" }, + { 0x84AC, "setuseholdduration" }, + { 0x84AD, "setusehideprogressbar" }, + { 0x84AE, "setusewhenhandsoccupied" }, + { 0x84AF, "setusecommand" }, + { 0x84B0, "sethintdisplayrange" }, + { 0x84B1, "setusefov" }, + { 0x84B2, "sethintdisplayfov" }, + { 0x84B3, "sethinttag" }, + { 0x84B4, "sethintinoperable" }, + { 0x84B5, "sethintonobstruction" }, + { 0x84B6, "sethinticon" }, + { 0x84B7, "sethintrarity" }, + { 0x84B8, "getnavposition" }, + { 0x84B9, "actoraimassiston" }, + { 0x84BA, "actoraimassistoff" }, + { 0x84BB, "enablequickweaponswitch" }, + { 0x84BC, "btregistertreeinstance" }, + { 0x84BD, "btterminatetreeinstance" }, + { 0x84BE, "bttick" }, + { 0x84BF, "getlastpathpointwithingoal" }, + { 0x84C0, "sethintrequiresmashing" }, + { 0x84C1, "isstuck" }, + { 0x84C2, "iswithinscriptgoalradius" }, + { 0x84C3, "requeststopsoonnotify" }, + { 0x84C4, "setworlduptrigger" }, + { 0x84C5, "assignweaponoffhandspecial" }, + { 0x84C6, "clearoffhandspecial" }, + { 0x84C7, "setoffhandspecialclass" }, + { 0x84C8, "getoffhandspecialclass" }, + { 0x84C9, "getplayerprogression" }, + { 0x84CA, "setplayerprogression" }, + { 0x84CB, "initplayerloadoutnames" }, + { 0x84CC, "sendleveldata" }, + { 0x84CD, "enablecollisionnotifies" }, + { 0x84CE, "playerenabletriggers" }, + { 0x84CF, "playerdisabletriggers" }, + { 0x84D0, "getscriptedmeleetarget" }, + { 0x84D1, "setscriptedmeleeactive" }, + { 0x84D2, "isscriptedmeleeactive" }, + { 0x84D3, "sethandsoccupied" }, + { 0x84D4, "gethandsoccupied" }, + { 0x84D5, "setnextbulletdryfire" }, + { 0x84D6, "getshieldmaxenergy" }, + { 0x84D7, "getshieldcurrentenergy" }, + { 0x84D8, "physics_registerforcollisioncallback" }, + { 0x84D9, "physics_unregisterforcollisioncallback" }, + { 0x84DA, "playanimscriptevent" }, + { 0x84DB, "playanimscriptsceneevent" }, + { 0x84DC, "notifyonplayerupdate" }, + { 0x84DD, "setsoundduck" }, + { 0x84DE, "clearsoundduck" }, + { 0x84DF, "getsprintmeterfraction" }, + { 0x84E0, "getstairsstateatdist" }, + { 0x84E1, "stairswithindistance" }, + { 0x84E2, "setphasestatus" }, + { 0x84E3, "isinphase" }, + { 0x84E4, "knockback" }, + { 0x84E5, "allowoffhandshieldweapons" }, + { 0x84E6, "setspacejump" }, + { 0x84E7, "clearspacejump" }, + { 0x84E8, "vehicle_breakglass" }, + { 0x84E9, "vehicle_invoketriggers" }, + { 0x84EA, "controlagent" }, + { 0x84EB, "restorecontrolagent" }, + { 0x84EC, "enableavoidance" }, + { 0x84ED, "setavoidancereciprocity" }, + { 0x84EE, "setavoidanceradius" }, + { 0x84EF, "modifyspacejumppath" }, + { 0x84F0, "assignweaponmeleeslot" }, + { 0x84F1, "getthreatsight" }, + { 0x84F2, "setthreatsight" }, + { 0x84F3, "startspacejumpdeath" }, + { 0x84F4, "trackmovingplatformtilt" }, + { 0x84F5, "loadweaponsforplayer" }, + { 0x84F6, "hasloadedviewweapons" }, + { 0x84F7, "setworldupreferenceangles" }, + { 0x84F8, "zerograv" }, + { 0x84F9, "codemoveanimrate" }, + { 0x84FA, "setmoveanimknob" }, + { 0x84FB, "getgrenadetossvel" }, + { 0x84FC, "getspacejumpstate" }, + { 0x84FD, "getgesturestarttime" }, + { 0x84FE, "getmotionangle3d" }, + { 0x84FF, "aieventlistenerevent" }, + { 0x8500, "findbestcoverlist" }, + { 0x8501, "getnearbynegotiationinfo" }, + { 0x8502, "setcustomization" }, + { 0x8503, "loadcustomization" }, + { 0x8504, "showlegsandshadow" }, + { 0x8505, "hidelegsandshadow" }, + { 0x8506, "giveandfireoffhand" }, + { 0x8507, "setsolid" }, + { 0x8508, "setspacejumpentoverride" }, + { 0x8509, "clearspacejumpentoverride" }, + { 0x850A, "setspacegrapple" }, + { 0x850B, "enabletraversals" }, + { 0x850C, "setgrapplevolume" }, + { 0x850D, "setgrappleroundvolume" }, + { 0x850E, "clearspacegrapple" }, + { 0x850F, "spacegrappleavailable" }, + { 0x8510, "getspacegrapplewalkable" }, + { 0x8511, "setgrappleactor" }, + { 0x8512, "damagedamagepart" }, + { 0x8513, "getdamageparthealth" }, + { 0x8514, "hasloadedcustomizationplayerworld" }, + { 0x8515, "hasloadedcustomizationworldmodels" }, + { 0x8516, "hasloadedcustomizationviewmodels" }, + { 0x8517, "hasloadedworldweapons" }, + { 0x8518, "allowwalk" }, + { 0x8519, "getgesturenotetracktimes" }, + { 0x851A, "despawncoverwall" }, + { 0x851B, "scriptmodelplayanimdeltamotionfrompos" }, + { 0x851C, "forcespacejump" }, + { 0x851D, "getworldupreferenceangles" }, + { 0x851E, "normalizeworldupreferenceangles" }, + { 0x851F, "isalternatemode" }, + { 0x8520, "setballpassallowed" }, + { 0x8521, "physicsstopserver" }, + { 0x8522, "startbeam" }, + { 0x8523, "stopbeam" }, + { 0x8524, "turretgetaim" }, + { 0x8525, "botenemyfacesbot" }, + { 0x8526, "allowspacegrapplecancel" }, + { 0x8527, "setplayerghost" }, + { 0x8528, "setprioritysnap" }, + { 0x8529, "getweaponmeleeslot" }, + { 0x852A, "isinvulnerable" }, + { 0x852B, "physics_volumeenable" }, + { 0x852C, "physics_volumeaffectcharacters" }, + { 0x852D, "physics_volumeaffectmissiles" }, + { 0x852E, "physics_volumesetactivator" }, + { 0x852F, "physics_volumesetasgravityscalar" }, + { 0x8530, "physics_volumesetasdirectionalforce" }, + { 0x8531, "physics_volumesetasfocalforce" }, + { 0x8532, "setdead" }, + { 0x8533, "sethintstringparams" }, + { 0x8534, "physics_volumesetasgravityvector" }, + { 0x8535, "getposoutsidebadplace" }, + { 0x8536, "isinbadplace" }, + { 0x8537, "setturretalwaysmanned" }, + { 0x8538, "setturretholdstill" }, + { 0x8539, "setmoverweapon" }, + { 0x853A, "getplayerrollvelocity" }, + { 0x853B, "setvolumewalkingenabled" }, + { 0x853C, "loadworldweaponsforplayer" }, + { 0x853D, "getmuzzledir" }, + { 0x853E, "isusingoffhandshield" }, + { 0x853F, "getanimikweights" }, + { 0x8540, "turretcantarget" }, + { 0x8541, "assignweaponoffhandtaunt" }, + { 0x8542, "codemoverequested" }, + { 0x8543, "setvolumeupvector" }, + { 0x8544, "getspacegrappleentity" }, + { 0x8545, "cancelreload" }, + { 0x8546, "actorcalcsharpturnanim" }, + { 0x8547, "actorcalcstopdata" }, + { 0x8548, "scriptmoverplane" }, + { 0x8549, "scriptmoveroutline" }, + { 0x854A, "scriptmoverclearoutline" }, + { 0x854B, "setturretlockedon" }, + { 0x854C, "getoffhandslot" }, + { 0x854D, "getheldoffhand" }, + { 0x854E, "setmodelusesmaterialoverride" }, + { 0x854F, "doshieldoutlinesweep" }, + { 0x8550, "setdamageparthealth" }, + { 0x8551, "getscriptablepartstate" }, + { 0x8552, "actorgetgroundslope" }, + { 0x8553, "lerpfovbypreset" }, + { 0x8554, "getthrowbackweapon" }, + { 0x8555, "enableplayerbreathsystem" }, + { 0x8556, "limitedmovement" }, + { 0x8557, "getmodifierlocationonpath" }, + { 0x8558, "getmodifierlocationbetween" }, + { 0x8559, "setvolumegrappledisable" }, + { 0x855A, "allowswimpredicted" }, + { 0x855B, "setavoidancebounds" }, + { 0x855C, "sethintrequiresholding" }, + { 0x855D, "sethintlockplayermovement" }, + { 0x855E, "clearplayerhintlock" }, + { 0x855F, "abortspacejump" }, + { 0x8560, "spacegrapplebeginmove" }, + { 0x8561, "getxuidhigh" }, + { 0x8562, "getxuidlow" }, + { 0x8563, "getclantag" }, + { 0x8564, "setdroneturnparams" }, + { 0x8565, "gethighpriorityweapon" }, + { 0x8566, "ishighpriorityweapon" }, + { 0x8567, "sethighpriorityweapon" }, + { 0x8568, "clearhighpriorityweapon" }, + { 0x8569, "recordbreadcrumbdataforplayer" }, + { 0x856A, "logpinghistogram" }, + { 0x856B, "setshadowmodel" }, + { 0x856C, "setlegsmodel" }, + { 0x856D, "setmoverlaserweapon" }, + { 0x856E, "setmoverbehavior" }, + { 0x856F, "ragdollblendinit" }, + { 0x8570, "getspacegrappleplatform" }, + { 0x8571, "setcallouttext" }, + { 0x8572, "setlaserflag" }, + { 0x8573, "setvolumesnapenabled" }, + { 0x8574, "getgunangles" }, + { 0x8575, "disableemptyclipweaponswitch" }, + { 0x8576, "showlegs" }, + { 0x8577, "hidelegs" }, + { 0x8578, "showshadow" }, + { 0x8579, "hideshadow" }, + { 0x857A, "playequipmovesound" }, + { 0x857B, "playclothmovesound" }, + { 0x857C, "setdriftvelocity" }, + { 0x857D, "setdriftoffset" }, + { 0x857E, "forcehidegrenadehudwarning" }, + { 0x857F, "setasgametypeobjective" }, + { 0x8580, "setscriptablebeamlength" }, + { 0x8581, "enablemissilehint" }, + { 0x8582, "disableoffhandprimaryweapons" }, + { 0x8583, "enableoffhandprimaryweapons" }, + { 0x8584, "getmlgselectedcamera" }, + { 0x8585, "fixlinktointerpolationbug" }, + { 0x8586, "getplayeryolostate" }, + { 0x8587, "setplayeryolostate" }, + { 0x8588, "hasplayerdata" }, + { 0x8589, "clearscriptabledamageowner" }, + { 0x858A, "scriptmoverthermal" }, + { 0x858B, "scriptmoverclearthermal" }, + { 0x858C, "setc8obstacleflag" }, + { 0x858D, "clearcustomization" }, + { 0x858E, "clearweaponloadrequestsforplayer" }, + { 0x858F, "logplayerendmatchdatashotshits" }, + { 0x8590, "logplayerendmatchdataheadbody" }, + { 0x8591, "logplayerendmatchdatamatchresult" }, + { 0x8592, "lockdeathcamera" }, + { 0x8593, "missilethermal" }, + { 0x8594, "missileoutline" }, + { 0x8595, "iw7shiphack_setmaymovetime" }, + { 0x8596, "visionsetkillstreakforplayer" }, + { 0x8597, "logstatmatchguid" }, + { 0x8598, "sethasradar" }, + { 0x8599, "setisradarblocked" }, + { 0x859A, "setradarstrength" }, + { 0x859B, "vehicle_cleardrivingstate" }, + { 0x859C, "setwaypointbackground" }, + { 0x859D, "setmlgdraw" }, + { 0x859E, "setteaminhuddata" }, + { 0x859F, "logplayerendmatchdatagesture" }, + { 0x85A0, "logplayerendmatchdatamisc" }, + { 0x85A1, "asmtick" }, + { 0x85A2, "asmgetanim" }, + { 0x85A3, "asmhasstate" }, + { 0x85A4, "asmsetstate" }, + { 0x85A5, "asminstantiate" }, + { 0x85A6, "asmgetcurrentstate" }, + { 0x85A7, "asmcurrentstatehasflag" }, + { 0x85A8, "asmgetstatetransitioningfrom" }, + { 0x85A9, "asmevalpaintransition" }, + { 0x85AA, "asmhaspainstate" }, + { 0x85AB, "asmgetnotehandler" }, + { 0x85AC, "asmgetfacialstate" }, + { 0x85AD, "asmterminate" }, + { 0x85AE, "asmfireevent" }, + { 0x85AF, "asmfireephemeralevent" }, + { 0x85B0, "asmeventfired" }, + { 0x85B1, "asmephemeraleventfired" }, + { 0x85B2, "asmeventfiredwithin" }, + { 0x85B3, "asmclearephemeralevents" }, + { 0x85B4, "asmgeteventdata" }, + { 0x85B5, "asmgeteventtime" }, + { 0x85B6, "asmgetephemeraleventdata" }, + { 0x85B7, "asmdodeathtransition" }, + { 0x85B8, "getaiblackboard" }, + { 0x85B9, "clearaiblackboard" }, + { 0x85BA, "setanimset" }, + { 0x85BB, "getanimset" }, + { 0x85BC, "aisetdesiredspeed" }, + { 0x85BD, "aisetspeedscalemode" }, + { 0x85BE, "setaimangles" }, + { 0x85BF, "getnodehideyaw" }, + { 0x85C0, "getnodehideyawoffset" }, + { 0x85C1, "getnodesnapyawoffset" }, + { 0x85C2, "getnodeleanaimyaw" }, + { 0x85C3, "getnodeleanaimyawoffset" }, + { 0x85C4, "getnodeleanaimpitch" }, + { 0x85C5, "getnodeleanaimpitchoffset" }, + { 0x85C6, "islegacyagent" }, + { 0x85C7, "aisetanim" }, + { 0x85C8, "aisetanimlimited" }, + { 0x85C9, "aiclearanim" }, + { 0x85CA, "aisetanimknob" }, + { 0x85CB, "aisetanimknoblimited" }, + { 0x85CC, "aisetanimblendcurve" }, + { 0x85CD, "aisetanimtime" }, + { 0x85CE, "setpupildiameter" }, + { 0x85CF, "aisetanimrate" }, + { 0x85D0, "aigetanimweight" }, + { 0x85D1, "aigetanimtime" }, + { 0x85D2, "aisetanimknobrestart" }, + { 0x85D3, "finishtraverse" }, + { 0x85D4, "motionwarp" }, + { 0x85D5, "motionwarpwithanim" }, + { 0x85D6, "motionwarpcancel" }, + { 0x85D7, "getreacquirestate" }, + { 0x85D8, "reacquireclear" }, + { 0x85D9, "setbtgoalheight" }, + { 0x85DA, "setbtgoalradius" }, + { 0x85DB, "getallanimsforalias" }, + { 0x85DC, "getpointafternegotiation" }, + { 0x85DD, "aimayshoot" }, + { 0x85DE, "missiledonttrackkillcam" }, + { 0x85DF, "isspectatingplayer" }, + { 0x85E0, "spectateclientnum" }, + { 0x85E1, "setmlgfollowdroneactive" }, + { 0x85E2, "ismlgfollowdroneactive" }, + { 0x85E3, "setseatedanimconditional" }, + { 0x85E4, "istrialversion" }, + { 0x85E5, "missile_setphasestate" }, + { 0x85E6, "setnavlayer" }, + { 0x85E7, "setonwallanimconditional" }, + { 0x85E8, "enableworldup" }, + { 0x85E9, "getprivatepartysize" }, + { 0x85EA, "playannouncersound" }, + { 0x85EB, "player_getrecoilscale" }, + { 0x85EC, "setfiretimescaleon" }, + { 0x85ED, "setfiretimescaleoff" }, + { 0x85EE, "getfiretimescale" }, + { 0x85EF, "setkillcamentstickstolookatent" }, + { 0x85F0, "finishcoverarrival" }, + { 0x85F1, "forceboostonlyjump" }, + { 0x85F2, "setdronegoalent" }, + { 0x85F3, "setuavjammed" }, + { 0x85F4, "hastacvis" }, + { 0x85F5, "findlastpointonpathwithinvolume" }, + { 0x85F6, "copyenemyinfo" }, + { 0x85F7, "aipointinfov" }, + { 0x85F8, "isgunblockedbywall" }, + { 0x85F9, "playviewmodelanim" }, + { 0x85FA, "vehicleplayanim" }, + { 0x85FB, "canseeperipheral" }, + { 0x85FC, "resetthreatupdate" }, + { 0x85FD, "enableteamwalking" }, + { 0x85FE, "hasattachment" }, + { 0x85FF, "getbaseweapon" }, + { 0x8600, "getplayerlightlevel" }, + { 0x8601, "getaltweapon" }, + { 0x8602, "getnoaltweapon" }, + { 0x8603, "canuseattachment" }, + { 0x8604, "setimpactfx" }, + { 0x8605, "getspawnpointforplayer" }, + { 0x8606, "forceupdategoalpos" }, + { 0x8607, "finalizespawnpointchoiceforplayer" }, + { 0x8608, "dropweaponnovelocity" }, + { 0x8609, "vehphys_speedboost" }, + { 0x860A, "vehicle_settopspeedforward" }, + { 0x860B, "vehicle_settopspeedreverse" }, + { 0x860C, "isnightvisionon" }, + { 0x860D, "ambushiscurrentnodevalid" }, + { 0x860E, "ambushgetnextambushnode" }, + { 0x860F, "ambushcheckpath" }, + { 0x8610, "isthirdpersoncamvehicle" }, + { 0x8611, "setthirdpersoncamvehicle" }, + { 0x8612, "setcinematicmotionoverride" }, + { 0x8613, "clearcinematicmotionoverride" }, + { 0x8614, "playeradsnotreloading" }, + { 0x8615, "stancebuttonpressed" }, + { 0x8616, "setupmotionwarpforturn" }, + { 0x8617, "transfermarkstonewscriptmodel" }, + { 0x8618, "registerentityspawnviewer" }, + { 0x8619, "clearentityspawnviewer" }, + { 0x861A, "reportchallengeuserevent" }, + { 0x861B, "scriptmodelpauseanim" }, + { 0x861C, "updateaiminfo" }, + { 0x861D, "aigetdesiredspeed" }, + { 0x861E, "asmcurrentstatehasaimset" }, + { 0x861F, "asmcurrentstatehasshootadditive" }, + { 0x8620, "missilehidetrail" }, + { 0x8621, "vehicle_setworldcollisioncapsule" }, + { 0x8622, "aisettargetspeed" }, + { 0x8623, "setgunadditive" }, + { 0x8624, "aigettargetspeed" }, + { 0x8625, "getdesiredscaledspeedforposalongpath" }, + { 0x8626, "vehicle_gettopspeedforward" }, + { 0x8627, "vehicle_gettopspeedreverse" }, + { 0x8628, "vehicle_gettopspeedrotational" }, + { 0x8629, "vehicle_settopspeedrotational" }, + { 0x862A, "applydroneimpulsevelocity" }, + { 0x862B, "enableaudioportal" }, + { 0x862C, "vehphys_deactivate" }, + { 0x862D, "vehphys_enablecollisioncallback" }, + { 0x862E, "stopanimscriptsceneevent" }, + { 0x862F, "stopviewmodelanim" }, + { 0x8630, "setavoidanceignoreent" }, + { 0x8631, "clearavoidanceignoreent" }, + { 0x8632, "iscurrentenemyvalid" }, + { 0x8633, "canboundingoverwatchmove" }, + { 0x8634, "setcoverselectionfocusent" }, + { 0x8635, "isatvalidlongdeathspot" }, + { 0x8636, "enablephysicaldepthoffieldscripting" }, + { 0x8637, "disablephysicaldepthoffieldscripting" }, + { 0x8638, "resetphysicaldepthoffieldscripting" }, + { 0x8639, "setphysicaldepthoffield" }, + { 0x863A, "setadsphysicaldepthoffield" }, + { 0x863B, "setphysicalviewmodeldepthoffield" }, + { 0x863C, "setlensprofiledistort" }, + { 0x863D, "giveaccessory" }, + { 0x863E, "clearaccessory" }, + { 0x863F, "giveexecution" }, + { 0x8640, "clearexecution" }, + { 0x8641, "setweaponmodelcamo" }, + { 0x8642, "withattachment" }, + { 0x8643, "withoutattachment" }, + { 0x8644, "withattachments" }, + { 0x8645, "withoutattachments" }, + { 0x8646, "withotherattachment" }, + { 0x8647, "withoutotherattachment" }, + { 0x8648, "withcamo" }, + { 0x8649, "withoutcamo" }, + { 0x864A, "setsticker" }, + { 0x864B, "clearsticker" }, + { 0x864C, "clearstickers" }, + { 0x864D, "withreticle" }, + { 0x864E, "withoutreticle" }, + { 0x864F, "aiplaygesture" }, + { 0x8650, "aicleargesture" }, + { 0x8651, "isnodelmgmountable" }, + { 0x8652, "getscriptablehaspart" }, + { 0x8653, "getscriptableparthasstate" }, + { 0x8654, "getscriptablepartstatehasevent" }, + { 0x8655, "getscriptablepartstatefield" }, + { 0x8656, "getscriptablepartstateeventfield" }, + { 0x8657, "setmoveravatar" }, + { 0x8658, "setsoundsubmix" }, + { 0x8659, "clearsoundsubmix" }, + { 0x865A, "clearallsoundsubmixes" }, + { 0x865B, "scalesoundsubmix" }, + { 0x865C, "isviewmodelanimplaying" }, + { 0x865D, "isconsoleplayer" }, + { 0x865E, "ispcplayer" }, + { 0x865F, "isps4player" }, + { 0x8660, "isxb3player" }, + { 0x8661, "modifybasefov" }, + { 0x8662, "isnearanyplayer" }, + { 0x8663, "ignorecharacterduringspawnselection" }, + { 0x8664, "animscriptentervehicle" }, + { 0x8665, "animscriptexitvehicle" }, + { 0x8666, "vehicle_setheldweaponvisibility" }, + { 0x8667, "vehicle_setstowedweaponvisibility" }, + { 0x8668, "setnvgarealighteffect" }, + { 0x8669, "getcollision" }, + { 0x866A, "setcivilianfocus" }, + { 0x866B, "cameradefault" }, + { 0x866C, "cameraset" }, + { 0x866D, "animscriptsetinputparamreplicationstatus" }, + { 0x866E, "animscriptsetparachutestate" }, + { 0x866F, "animscriptexitparachutestate" }, + { 0x8670, "getleftstickx" }, + { 0x8671, "getleftsticky" }, + { 0x8672, "getrightstickx" }, + { 0x8673, "getrightsticky" }, + { 0x8674, "setscriptablepartzerostate_hack" }, + { 0x8675, "enablescriptablepartplayeruse" }, + { 0x8676, "disablescriptablepartplayeruse" }, + { 0x8677, "vehicleshowonminimap" }, + { 0x8678, "setadditionalstreampos" }, + { 0x8679, "clearadditionalstreampos" }, + { 0x867A, "isadditionalstreamposready" }, + { 0x867B, "setragdollnobloodpoolfx" }, + { 0x867C, "enablescriptableplayeruse" }, + { 0x867D, "disablescriptableplayeruse" }, + { 0x867E, "getapproxeyepos" }, + { 0x867F, "isentitywithincone" }, + { 0x8680, "choosearrivaltype" }, + { 0x8681, "clearimpactmarks" }, + { 0x8682, "getboundshalfsize" }, + { 0x8683, "getboundsmidpoint" }, + { 0x8684, "maymovecheckfriendlyfire" }, + { 0x8685, "skydive_beginfreefall" }, + { 0x8686, "skydive_deployparachute" }, + { 0x8687, "skydive_setdeploymentstatus" }, + { 0x8688, "skydive_setbasejumpingstatus" }, + { 0x8689, "skydive_interrupt" }, + { 0x868A, "skydive_setforcethirdpersonstatus" }, + { 0x868B, "isskydiving" }, + { 0x868C, "isinfreefall" }, + { 0x868D, "isparachuting" }, + { 0x868E, "shoulddisableskydivevfx" }, + { 0x868F, "setisinfilskydive" }, + { 0x8690, "setscriptablepayloadmodel" }, + { 0x8691, "setscriptablepayloadweapon" }, + { 0x8692, "freescriptable" }, + { 0x8693, "nodeisactivated" }, + { 0x8694, "triggersoundstart" }, + { 0x8695, "triggersoundstop" }, + { 0x8696, "setcarryobject" }, + { 0x8697, "resetcarryobject" }, + { 0x8698, "disableexecutionattack" }, + { 0x8699, "enableexecutionattack" }, + { 0x869A, "disableexecutionvictim" }, + { 0x869B, "enableexecutionvictim" }, + { 0x869C, "isinexecutionattack" }, + { 0x869D, "isinexecutionvictim" }, + { 0x869E, "setscriptableuselargerbounds" }, + { 0x869F, "aigetworldweaponoffset" }, + { 0x86A0, "allowsupersprint" }, + { 0x86A1, "refreshsprinttime" }, + { 0x86A2, "issupersprinting" }, + { 0x86A3, "setagentbounds" }, + { 0x86A4, "despawnagent" }, + { 0x86A5, "agentclearscriptvars" }, + { 0x86A6, "agentsetclipmode" }, + { 0x86A7, "agentsetfavoriteenemy" }, + { 0x86A8, "isnodeinbadplace" }, + { 0x86A9, "matchdataplayerexistingslot" }, + { 0x86AA, "matchdatafillplayerheader" }, + { 0x86AB, "scalesoundvolume" }, + { 0x86AC, "scalesoundpitch" }, + { 0x86AD, "setfacialindex" }, + { 0x86AE, "setcustomnodegameparameterbyte" }, + { 0x86AF, "vignettesetparams" }, + { 0x86B0, "vignettegetparams" }, + { 0x86B1, "vignettescriptdisable" }, + { 0x86B2, "brcirclemoveto" }, + { 0x86B3, "forcethreatupdate" }, + { 0x86B4, "getturretcurrentyaw" }, + { 0x86B5, "getturretcurrentpitch" }, + { 0x86B6, "getleftarc" }, + { 0x86B7, "getrightarc" }, + { 0x86B8, "gettoparc" }, + { 0x86B9, "getbottomarc" }, + { 0x86BA, "isturretinoperable" }, + { 0x86BB, "setupdooropen" }, + { 0x86BC, "cleardooropen" }, + { 0x86BD, "botpathexists" }, + { 0x86BE, "setbackupcoverfrompos" }, + { 0x86BF, "aiclearscriptdesiredspeed" }, + { 0x86C0, "getlinkedscriptableinstance" }, + { 0x86C1, "getscriptablelinkedentity" }, + { 0x86C2, "sprayevent" }, + { 0x86C3, "isscriptable" }, + { 0x86C4, "setupshootstyleadditive" }, + { 0x86C5, "shouldcautiousstrafe" }, + { 0x86C6, "getaccessorygesturename" }, + { 0x86C7, "scriptmoverdistancefade" }, + { 0x86C8, "scriptmovercleardistancefade" }, + { 0x86C9, "getadjustedexitdirection" }, + { 0x86CA, "setanimlookatneutraldir" }, + { 0x86CB, "setanimlookatranges" }, + { 0x86CC, "setuplookatfornotetrack" }, + { 0x86CD, "getclosestreachablepointonnavmesh" }, + { 0x86CE, "enablemissedbulletclientonly" }, + { 0x86CF, "getscriptableisloot" }, + { 0x86D0, "getscriptableisreserved" }, + { 0x86D1, "getscriptableislinked" }, + { 0x86D2, "getscriptableisusableonanypart" }, + { 0x86D3, "enableplayermarks" }, + { 0x86D4, "disableplayermarks" }, + { 0x86D5, "enableentitymarks" }, + { 0x86D6, "disableentitymarks" }, + { 0x86D7, "entityhasmark" }, + { 0x86D8, "entitymarkfilteredin" }, + { 0x86D9, "entitymarkfilteredout" }, + { 0x86DA, "getplayermarks" }, + { 0x86DB, "filteroutplayermarks" }, + { 0x86DC, "filterinplayermarks" }, + { 0x86DD, "enabledismemberment" }, + { 0x86DE, "disabledismemberment" }, + { 0x86DF, "enabletargetmarks" }, + { 0x86E0, "disabletargetmarks" }, + { 0x86E1, "enablestatelookat" }, + { 0x86E2, "enablescriptedlookat" }, + { 0x86E3, "dlog_recordplayerevent" }, + { 0x86E4, "entitymarkfilterindistance" }, + { 0x86E5, "targetmarklimits" }, + { 0x86E6, "isufo" }, + { 0x86E7, "isnoclip" }, + { 0x86E8, "getsquadindex" }, + { 0x86E9, "streamsetmaterialtouchuntilloaded" }, + { 0x86EA, "calloutmarkerping_create" }, + { 0x86EB, "calloutmarkerping_setfeedback" }, + { 0x86EC, "calloutmarkerping_delete" }, + { 0x86ED, "calloutmarkerping_hide" }, + { 0x86EE, "calloutmarkerping_show" }, + { 0x86EF, "calloutmarkerping_onentity" }, + { 0x86F0, "allownightvisiontoggle" }, + { 0x86F1, "getjuggdefaultmusicenabled" }, + { 0x86F2, "overridevehicleseatanimconditionals" }, + { 0x86F3, "aiprecalcshouldstartarrival" }, + { 0x86F4, "getscriptablepartcount" }, + { 0x86F5, "getscriptablepartnameatindex" }, + { 0x86F6, "usebuttondone" }, + { 0x86F7, "sendclientnetworktelemetry" }, + { 0x86F8, "getlastgroundorigin" }, + { 0x86F9, "vehicle_allowplayerstandon" }, + { 0x86FA, "vehicle_isonground" }, + { 0x86FB, "scriptabledoorfreeze" }, + { 0x86FC, "scriptabledoorisclosed" }, + { 0x86FD, "scriptabledoorisowned" }, + { 0x86FE, "scriptableisdoor" }, + { 0x86FF, "scriptabledoorisdouble" }, + { 0x8700, "setmapcirclecolorindex" }, + { 0x8701, "setmapcirclestyleindex" }, + { 0x8702, "setmapcircleiconindex" }, + { 0x8703, "vehicleshowonminimapforclient" }, + { 0x8704, "scriptabledoorangle" }, + { 0x8705, "setmovertransparentvolume" }, + { 0x8706, "haslastgroundorigin" }, + { 0x8707, "disableoffhandthrowback" }, + { 0x8708, "enableoffhandthrowback" }, + { 0x8709, "setplayeradvanceduavdot" }, + { 0x870A, "sethidenameplate" }, + { 0x870B, "startragdollfromvehiclehit" }, + { 0x870C, "vehiclepinonminimap" }, + { 0x870D, "vehswitchseatbuttonpressed" }, + { 0x870E, "aiupdatecoverexposetype" }, + { 0x870F, "aicalcsuppressspot" }, + { 0x8710, "scriptabledooropen" }, + { 0x8711, "scriptabledoorclose" }, + { 0x8712, "constraintoscriptgoalradius" }, + { 0x8713, "vehicle_getinputvalue" }, + { 0x8714, "getplayerip" }, + { 0x8715, "setstrafereverse" }, + { 0x8716, "updatelastcovertime" }, + { 0x8717, "getpartyid" }, + { 0x8718, "isguest" }, + { 0x8719, "getmissilevelocity" }, + { 0x871A, "scriptablesetparententity" }, + { 0x871B, "scriptableclearparententity" }, + { 0x871C, "validatecollision" }, + { 0x871D, "ctgsreportusermatchstats" }, + { 0x871E, "getclosestenemy" }, + { 0x871F, "getcurrentusereloadconfig" }, + { 0x8720, "getspawnbucketforplayer" }, + { 0x8721, "ismlgfreecamenabled" }, + { 0x8722, "disablereloading" }, + { 0x8723, "enablereloading" }, + { 0x8724, "forcereloading" }, + { 0x8725, "cancelreloading" }, + { 0x8726, "reloadbuttonpressed" }, + { 0x8727, "startragdollfromvehicleimpact" }, + { 0x8728, "isbnetkr15player" }, + { 0x8729, "isbnetigrplayer" }, + { 0x872A, "setclientkillstreakindexes" }, + { 0x872B, "resetclientkillstreakindexes" }, + { 0x872C, "setclientkillstreakavailability" }, + { 0x872D, "resetclientkillstreakavailability" }, + { 0x872E, "setpowerammo" }, + { 0x872F, "setpowerprogress" }, + { 0x8730, "trajectoryupdateoriginandangles" }, + { 0x8731, "clearladderstate" }, + { 0x8732, "getcovertacpoint" }, + { 0x8733, "setmlgdamagedone" }, + { 0x8734, "setcorpsemodel" }, + { 0x8735, "getplayergpadenabled" }, + { 0x8736, "getwartrackpassengerenabled" }, + { 0x8737, "startzeroarrival" }, + { 0x8738, "finishzeroarrival" }, + { 0x8739, "candoretreat" }, + { 0x873A, "copyloadoutbuttonpressed" }, + { 0x873B, "playcinematicforplayer" }, + { 0x873C, "playcinematicforplayerlooping" }, + { 0x873D, "preloadcinematicforplayer" }, + { 0x873E, "stopcinematicforplayer" }, + { 0x873F, "skydive_cutparachuteon" }, + { 0x8740, "skydive_cutparachuteoff" }, + { 0x8741, "skydive_cutautodeployon" }, + { 0x8742, "skydive_cutautodeployoff" }, + { 0x8743, "getclientomnvar" }, + { 0x8744, "weaponswitchbuttonpressed" }, + { 0x8745, "calloutmarkerping_entityzoffset" }, + { 0x8746, "allowspectateallteams" }, + { 0x8747, "ismlgaerialcamenabled" }, + { 0x8748, "setmlgmessagesent" }, + { 0x8749, "useinvisibleplayerduringspawnselection" }, + { 0x874A, "updatemlgammoinfo" }, + { 0x874B, "setbeingrevived" }, + { 0x874C, "getbeingrevived" }, + { 0x874D, "setisusingspecialist" }, + { 0x874E, "setmlgdominationpoint" }, + { 0x874F, "getfollowedplayer" }, + { 0x8750, "setmlgthirdpersonenabled" }, + { 0x8751, "updatecurrentweapon" }, + { 0x8752, "getmid1damage" }, + { 0x8753, "getmid2damage" }, + { 0x8754, "getmid3damage" }, + { 0x8755, "getweaponclassint" }, + { 0x8756, "clearvehiclesticker" }, + { 0x8757, "clearvehiclestickers" }, + { 0x8758, "getvehiclesticker" }, + { 0x8759, "setvehiclesticker" }, + { 0x875A, "aisetriotshieldweapon" }, + { 0x875B, "enablephysicsmoverpush" }, + { 0x875C, "clearvehiclecamo" }, + { 0x875D, "getvehiclecamo" }, + { 0x875E, "setvehiclecamo" }, + { 0x875F, "getexecutionpartner" }, + { 0x8760, "getmountconfigenabled" }, + { 0x8761, "scriptablecanbepinged" }, + { 0x8762, "scriptableislootcache" }, + { 0x8763, "scriptablegetmidpoint" }, + { 0x8764, "isplayerheadless" }, + { 0x8765, "calloutmarkerping_getactive" }, + { 0x8766, "calloutmarkerping_getent" }, + { 0x8767, "calloutmarkerping_getfeedback" }, + { 0x8768, "calloutmarkerping_getsavedzoffset" }, + { 0x8769, "selfrevivingdoneanimevent" }, + { 0x876A, "buddyrevivingdoneanimevent" }, + { 0x876B, "setlaststandreviving" }, + { 0x876C, "setlaststandselfreviving" }, + { 0x876D, "isholdingbreath" }, + { 0x876E, "setlaststandenabled" }, + { 0x876F, "enableplayeruseforallplayers" }, + { 0x8770, "disableplayeruseforallplayers" }, + { 0x8771, "activatekeypressed" }, + { 0x8772, "istacmapactive" }, + { 0x8773, "setmainstreamloaddist" }, + { 0x8774, "setadditionalstreamloaddist" }, + { 0x8775, "sendrequestgamerprofilecmd" }, + { 0x8776, "calloutmarkerping_getorigin" }, + { 0x8777, "setpredictedstreamloaddist" }, + { 0x8778, "setallstreamloaddist" }, + { 0x8779, "calloutmarkerping_getinventoryslot" }, + { 0x877A, "calloutmarkerping_getcreatedtime" }, + { 0x877B, "isdismembermentenabledforplayer" }, + { 0x877C, "sethasspecialistbonus" }, + { 0x877D, "clearvehicleturretsticker" }, + { 0x877E, "clearvehicleturretstickers" }, + { 0x877F, "getvehicleturretsticker" }, + { 0x8780, "setvehicleturretsticker" }, + { 0x8781, "clearvehicleturretcamo" }, + { 0x8782, "getvehicleturretcamo" }, + { 0x8783, "setvehicleturretcamo" }, + { 0x8784, "isbasejumpavailable" }, + { 0x8785, "sendclientmatchdataforclient" }, + { 0x8786, "setautoboxcalculationusingdobj" }, + { 0x8787, "setshowinrealism" }, + { 0x8788, "getuseholdkbmprofile" }, + { 0x8789, "sendcollectedclientanticheatdata" }, + { 0x878A, "setvehiclehornsound" }, + { 0x878B, "radiusdamagestepped" }, + { 0x878C, "setfacialindexfromasm" }, + { 0x878D, "calloutmarkerping_getgscobjectiveindex" }, + { 0x878E, "playencryptedcinematicforplayer" }, + { 0x878F, "getnodeoffset_code" }, + { 0x8790, "setarrivalanimdata" }, + { 0x8791, "aisuppressai_code" }, + { 0x8792, "playergetzoomlevelindex" }, + { 0x8793, "playergetzoomfov" }, + { 0x8794, "setmoveroptimized" }, + { 0x8795, "stopplayermusicstate" }, + { 0x8796, "setoverridearchetype_code" }, + { 0x8797, "clearoverridearchetype_code" }, + { 0x8798, "findoverridearchetype_code" }, + { 0x8799, "getbasearchetype_code" }, + { 0x879A, "setbasearchetype_code" }, + { 0x879B, "canaimwhilemoving_code" }, + { 0x879C, "forcenetfieldhighlod" }, + { 0x879D, "markkeyframedmover" }, + { 0x879E, "unmarkkeyframedmover" }, + { 0x879F, "validateloadoutownership" }, + { 0x87A0, "validateoperatorownership" }, + { 0x87A1, "setmoverantilagged" }, + { 0x87A2, "setwristwatchtime" }, + { 0x87A3, "clearwristwatchtime" }, + { 0x87A4, "_meth_87A4" }, + { 0x87A5, "_meth_87A5" }, + { 0x87A6, "_meth_87A6" }, + { 0x87A7, "_meth_87A7" }, + { 0x87A8, "_meth_87A8" }, + { 0x87A9, "_meth_87A9" }, + { 0x87AA, "_meth_87AA" }, + { 0x87AB, "_meth_87AB" }, + { 0x87AC, "_meth_87AC" }, + { 0x87AD, "_meth_87AD" }, + { 0x87AE, "_meth_87AE" }, + { 0x87AF, "_meth_87AF" }, + { 0x87B0, "_meth_87B0" }, + { 0x87B1, "_meth_87B1" }, + { 0x87B2, "_meth_87B2" }, + { 0x87B3, "_meth_87B3" }, + { 0x87B4, "_meth_87B4" }, + { 0x87B5, "_meth_87B5" }, + { 0x87B6, "_meth_87B6" }, + { 0x87B7, "_meth_87B7" }, + { 0x87B8, "_meth_87B8" }, + { 0x87B9, "_meth_87B9" }, + { 0x87BA, "_meth_87BA" }, + { 0x87BB, "_meth_87BB" }, + { 0x87BC, "_meth_87BC" }, + { 0x87BD, "_meth_87BD" }, + { 0x87BE, "_meth_87BE" }, + { 0x87BF, "_meth_87BF" }, + { 0x87C0, "_meth_87C0" }, + { 0x87C1, "_meth_87C1" }, + { 0x87C2, "_meth_87C2" }, + { 0x87C3, "_meth_87C3" }, + { 0x87C4, "_meth_87C4" }, + { 0x87C5, "_meth_87C5" }, + { 0x87C6, "_meth_87C6" }, + { 0x87C7, "_meth_87C7" }, + { 0x87C8, "_meth_87C8" }, + { 0x87C9, "_meth_87C9" }, + { 0x87CA, "_meth_87CA" }, + { 0x87CB, "_meth_87CB" }, + { 0x87CC, "_meth_87CC" }, + { 0x87CD, "_meth_87CD" }, + { 0x87CE, "_meth_87CE" }, + { 0x87CF, "_meth_87CF" }, + { 0x87D0, "_meth_87D0" }, + { 0x87D1, "_meth_87D1" }, + { 0x87D2, "_meth_87D2" }, + { 0x87D3, "_meth_87D3" }, + { 0x87D4, "_meth_87D4" }, + { 0x87D5, "_meth_87D5" }, + { 0x87D6, "_meth_87D6" }, + { 0x87D7, "_meth_87D7" }, + { 0x87D8, "_meth_87D8" }, + { 0x87D9, "_meth_87D9" }, + { 0x87DA, "_meth_87DA" }, + { 0x87DB, "_meth_87DB" }, + { 0x87DC, "_meth_87DC" }, + { 0x87DD, "_meth_87DD" }, + { 0x87DE, "_meth_87DE" }, + { 0x87DF, "_meth_87DF" }, + { 0x87E0, "_meth_87E0" }, + { 0x87E1, "_meth_87E1" }, + { 0x87E2, "_meth_87E2" }, + { 0x87E3, "_meth_87E3" }, + { 0x87E4, "_meth_87E4" }, + { 0x87E5, "_meth_87E5" }, + { 0x87E6, "_meth_87E6" }, + { 0x87E7, "_meth_87E7" }, + { 0x87E8, "_meth_87E8" }, + { 0x87E9, "_meth_87E9" }, + { 0x87EA, "_meth_87EA" }, + { 0x87EB, "_meth_87EB" }, + { 0x87EC, "_meth_87EC" }, + { 0x87ED, "_meth_87ED" }, + { 0x87EE, "_meth_87EE" }, + { 0x87EF, "_meth_87EF" }, +}}; + +} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/resolver.cpp b/src/iw8/iw8_token.cpp similarity index 95% rename from src/iw8/xsk/resolver.cpp rename to src/iw8/iw8_token.cpp index efc4d6a6..2a641151 100644 --- a/src/iw8/xsk/resolver.cpp +++ b/src/iw8/iw8_token.cpp @@ -1,3600 +1,14 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" #include "iw8.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - namespace xsk::gsc::iw8 { -std::unordered_map opcode_map; -std::unordered_map function_map; -std::unordered_map method_map; -std::unordered_map token_map; -std::unordered_map opcode_map_rev; -std::unordered_map function_map_rev; -std::unordered_map method_map_rev; -std::unordered_map token_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_func_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - const auto itr = function_map.find(id); - - if (itr != function_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_meth_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - const auto itr = method_map.find(id); - - if (itr != method_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string& name) -> std::uint32_t -{ - if (name.starts_with("_id_")) - { - return static_cast(std::stoul(name.substr(4), nullptr, 16)); - } - - const auto itr = token_map_rev.find(name); - - if (itr != token_map_rev.end()) - { - return itr->second; - } - - return 0; -} - -auto resolver::token_name(std::uint32_t id) -> std::string -{ - const auto itr = token_map.find(id); - - if (itr != token_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - } - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - } - - return false; -} - -void resolver::add_function(const std::string& name, std::uint16_t id) -{ - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - throw error(utils::string::va("builtin function '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - function_map.insert({ id, *str }); - function_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - function_map.insert({ id, *ins.first }); - function_map_rev.insert({ *ins.first, id }); - } - } -} - -void resolver::add_method(const std::string& name, std::uint16_t id) -{ - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - throw error(utils::string::va("builtin method '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - method_map.insert({ id, *str }); - method_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - method_map.insert({ id, *ins.first }); - method_map_rev.insert({ *ins.first, 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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -const std::array, 190> opcode_list -{{ - { 0x00, "OP_CastFieldObject" }, - { 0x01, "OP_SetLocalVariableFieldCached" }, - { 0x02, "OP_plus" }, - { 0x03, "OP_RemoveLocalVariables" }, - { 0x04, "OP_EvalSelfFieldVariableRef" }, - { 0x05, "OP_ScriptFarMethodChildThreadCall" }, - { 0x06, "OP_GetGameRef" }, - { 0x07, "OP_EvalAnimFieldVariable" }, - { 0x08, "OP_EvalLevelFieldVariableRef" }, - { 0x09, "OP_GetThisthread" }, - { 0x0A, "OP_greater" }, - { 0x0B, "OP_waittillmatch" }, - { 0x0C, "OP_shift_right" }, - { 0x0D, "OP_dec" }, - { 0x0E, "OP_JumpOnTrue" }, - { 0x0F, "OP_bit_or" }, - { 0x10, "OP_equality" }, - { 0x11, "OP_ClearLocalVariableFieldCached0" }, - { 0x12, "OP_notify" }, - { 0x13, "OP_GetVector" }, - { 0x14, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x15, "OP_PreScriptCall" }, - { 0x16, "OP_GetByte" }, - { 0x17, "OP_ScriptFarThreadCall" }, - { 0x18, "OP_SetSelfFieldVariableField" }, - { 0x19, "OP_JumpOnFalseExpr" }, - { 0x1A, "OP_GetUndefined" }, - { 0x1B, "OP_jumpback" }, - { 0x1C, "OP_JumpOnTrueExpr" }, - { 0x1D, "OP_CallBuiltin0" }, - { 0x1E, "OP_CallBuiltin1" }, - { 0x1F, "OP_CallBuiltin2" }, - { 0x20, "OP_CallBuiltin3" }, - { 0x21, "OP_CallBuiltin4" }, - { 0x22, "OP_CallBuiltin5" }, - { 0x23, "OP_CallBuiltin" }, - { 0x24, "OP_SetLocalVariableFieldCached0" }, - { 0x25, "OP_ClearFieldVariable" }, - { 0x26, "OP_GetLevel" }, - { 0x27, "OP_size" }, - { 0x28, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x29, "OP_ScriptLocalMethodThreadCall" }, - { 0x2A, "OP_AddArray" }, - { 0x2B, "OP_endon" }, - { 0x2C, "OP_EvalFieldVariable" }, - { 0x2D, "OP_shift_left" }, - { 0x2E, "OP_EvalLocalArrayRefCached0" }, - { 0x2F, "OP_Return" }, - { 0x30, "OP_CreateLocalVariable" }, - { 0x31, "OP_SafeSetVariableFieldCached0" }, - { 0x32, "OP_GetBuiltinFunction" }, - { 0x33, "OP_ScriptLocalMethodCall" }, - { 0x34, "OP_CallBuiltinMethodPointer" }, - { 0x35, "OP_ScriptLocalChildThreadCall" }, - { 0x36, "OP_GetSelfObject" }, - { 0x37, "OP_GetGame" }, - { 0x38, "OP_SetLevelFieldVariableField" }, - { 0x39, "OP_EvalArray" }, - { 0x3A, "OP_GetSelf" }, - { 0x3B, "OP_End" }, - { 0x3C, "OP_EvalSelfFieldVariable" }, - { 0x3D, "OP_less_equal" }, - { 0x3E, "OP_EvalLocalVariableCached0" }, - { 0x3F, "OP_EvalLocalVariableCached1" }, - { 0x40, "OP_EvalLocalVariableCached2" }, - { 0x41, "OP_EvalLocalVariableCached3" }, - { 0x42, "OP_EvalLocalVariableCached4" }, - { 0x43, "OP_EvalLocalVariableCached5" }, - { 0x44, "OP_EvalLocalVariableCached" }, - { 0x45, "OP_EvalNewLocalArrayRefCached0" }, - { 0x46, "OP_ScriptChildThreadCallPointer" }, - { 0x47, "OP_EvalLocalVariableObjectCached" }, - { 0x48, "OP_ScriptLocalThreadCall" }, - { 0x49, "OP_GetInteger" }, - { 0x4A, "OP_ScriptMethodCallPointer" }, - { 0x4B, "OP_checkclearparams" }, - { 0x4C, "OP_SetAnimFieldVariableField" }, - { 0x4D, "OP_waittillmatch2" }, - { 0x4E, "OP_minus" }, - { 0x4F, "OP_ScriptLocalFunctionCall2" }, - { 0x50, "OP_GetNegUnsignedShort" }, - { 0x51, "OP_GetNegByte" }, - { 0x52, "OP_SafeCreateVariableFieldCached" }, - { 0x53, "OP_greater_equal" }, - { 0x54, "OP_vector" }, - { 0x55, "OP_GetBuiltinMethod" }, - { 0x56, "OP_endswitch" }, - { 0x57, "OP_ClearArray" }, - { 0x58, "OP_DecTop" }, - { 0x59, "OP_CastBool" }, - { 0x5A, "OP_EvalArrayRef" }, - { 0x5B, "OP_SetNewLocalVariableFieldCached0" }, - { 0x5C, "OP_GetZero" }, - { 0x5D, "OP_wait" }, - { 0x5E, "OP_waittill" }, - { 0x5F, "OP_GetIString" }, - { 0x60, "OP_ScriptFarFunctionCall" }, - { 0x61, "OP_GetAnimObject" }, - { 0x62, "OP_GetAnimTree" }, - { 0x63, "OP_EvalLocalArrayCached" }, - { 0x64, "OP_mod" }, - { 0x65, "OP_ScriptFarMethodThreadCall" }, - { 0x66, "OP_GetUnsignedShort" }, - { 0x67, "OP_clearparams" }, - { 0x68, "OP_ScriptMethodThreadCallPointer" }, - { 0x69, "OP_ScriptFunctionCallPointer" }, - { 0x6A, "OP_EmptyArray" }, - { 0x6B, "OP_SafeSetVariableFieldCached" }, - { 0x6C, "OP_ClearVariableField" }, - { 0x6D, "OP_EvalFieldVariableRef" }, - { 0x6E, "OP_ScriptLocalMethodChildThreadCall" }, - { 0x6F, "OP_EvalNewLocalVariableRefCached0" }, - { 0x70, "OP_GetFloat" }, - { 0x71, "OP_EvalLocalVariableRefCached" }, - { 0x72, "OP_JumpOnFalse" }, - { 0x73, "OP_BoolComplement" }, - { 0x74, "OP_ScriptThreadCallPointer" }, - { 0x75, "OP_ScriptFarFunctionCall2" }, - { 0x76, "OP_less" }, - { 0x77, "OP_BoolNot" }, - { 0x78, "OP_waittillFrameEnd" }, - { 0x79, "OP_waitframe" }, - { 0x7A, "OP_GetString" }, - { 0x7B, "OP_EvalLevelFieldVariable" }, - { 0x7C, "OP_GetLevelObject" }, - { 0x7D, "OP_inc" }, - { 0x7E, "OP_CallBuiltinMethod0" }, - { 0x7F, "OP_CallBuiltinMethod1" }, - { 0x80, "OP_CallBuiltinMethod2" }, - { 0x81, "OP_CallBuiltinMethod3" }, - { 0x82, "OP_CallBuiltinMethod4" }, - { 0x83, "OP_CallBuiltinMethod5" }, - { 0x84, "OP_CallBuiltinMethod" }, - { 0x85, "OP_GetAnim" }, - { 0x86, "OP_switch" }, - { 0x87, "OP_SetVariableField" }, - { 0x88, "OP_divide" }, - { 0x89, "OP_GetLocalFunction" }, - { 0x8A, "OP_ScriptFarChildThreadCall" }, - { 0x8B, "OP_multiply" }, - { 0x8C, "OP_ClearLocalVariableFieldCached" }, - { 0x8D, "OP_EvalAnimFieldVariableRef" }, - { 0x8E, "OP_EvalLocalArrayRefCached" }, - { 0x8F, "OP_EvalLocalVariableRefCached0" }, - { 0x90, "OP_bit_and" }, - { 0x91, "OP_GetAnimation" }, - { 0x92, "OP_GetFarFunction" }, - { 0x93, "OP_CallBuiltinPointer" }, - { 0x94, "OP_jump" }, - { 0x95, "OP_voidCodepos" }, - { 0x96, "OP_ScriptFarMethodCall" }, - { 0x97, "OP_inequality" }, - { 0x98, "OP_ScriptLocalFunctionCall" }, - { 0x99, "OP_bit_ex_or" }, - { 0x9A, "OP_NOP" }, - { 0x9B, "OP_abort" }, - { 0x9C, "OP_object" }, - { 0x9D, "OP_thread_object" }, - { 0x9E, "OP_EvalLocalVariable" }, - { 0x9F, "OP_EvalLocalVariableRef" }, - { 0xA0, "OP_prof_begin" }, - { 0xA1, "OP_prof_end" }, - { 0xA2, "OP_breakpoint" }, - { 0xA3, "OP_assignmentBreakpoint" }, - { 0xA4, "OP_manualAndAssignmentBreakpoint" }, - { 0xA5, "OP_BoolNotAfterAnd" }, - { 0xA6, "OP_FormalParams" }, - { 0xA7, "OP_IsDefined" }, - { 0xA8, "OP_IsTrue" }, - { 0xA9, "OP_NativeGetLocalFunction" }, - { 0xAA, "OP_NativeLocalFunctionCall" }, - { 0xAB, "OP_NativeLocalFunctionCall2" }, - { 0xAC, "OP_NativeLocalMethodCall" }, - { 0xAD, "OP_NativeLocalFunctionThreadCall" }, - { 0xAE, "OP_NativeLocalMethodThreadCall" }, - { 0xAF, "OP_NativeLocalFunctionChildThreadCall" }, - { 0xB0, "OP_NativeLocalMethodChildThreadCall" }, - { 0xB1, "OP_NativeGetFarFunction" }, - { 0xB2, "OP_NativeFarFunctionCall" }, - { 0xB3, "OP_NativeFarFunctionCall2" }, - { 0xB4, "OP_NativeFarMethodCall" }, - { 0xB5, "OP_NativeFarFunctionThreadCall" }, - { 0xB6, "OP_NativeFarMethodThreadCall" }, - { 0xB7, "OP_NativeFarFunctionChildThreadCall" }, - { 0xB8, "OP_NativeFarMethodChildThreadCall" }, - { 0xB9, "OP_EvalNewLocalArrayRefCached0_Precompiled" }, - { 0xBA, "OP_SetNewLocalVariableFieldCached0_Precompiled" }, - { 0xBB, "OP_CreateLocalVariable_Precompiled" }, - { 0xBC, "OP_SafeCreateVariableFieldCached_Precompiled" }, - { 0xBD, "OP_FormalParams_Precompiled" }, -}}; - -const std::array, 1065> function_list -{{ - { 0x001, "abs" }, - { 0x002, "acos" }, - { 0x003, "activateclientexploder" }, - { 0x004, "addagent" }, - { 0x005, "addbot" }, - { 0x006, "addtestclient" }, - { 0x007, "allclientsprint" }, - { 0x008, "ambientplay" }, - { 0x009, "ambientstop" }, - { 0x00A, "angleclamp" }, - { 0x00B, "angleclamp180" }, - { 0x00C, "anglesdelta" }, - { 0x00D, "anglestoaxis" }, - { 0x00E, "anglestoforward" }, - { 0x00F, "anglestoright" }, - { 0x010, "anglestoup" }, - { 0x011, "animhasnotetrack" }, - { 0x012, "announcement" }, - { 0x013, "asin" }, - { 0x014, "atan" }, - { 0x015, "averagenormal" }, - { 0x016, "averagepoint" }, - { 0x017, "axistoangles" }, - { 0x018, "badplace_cylinder" }, - { 0x019, "badplace_delete" }, - { 0x01A, "badplace_global" }, - { 0x01B, "bbprint" }, - { 0x01C, "blockteamradar" }, - { 0x01D, "botsystemstatus" }, - { 0x01E, "botdebugdrawtrigger" }, - { 0x01F, "botflagmemoryevents" }, - { 0x020, "botgetclosestnavigablepoint" }, - { 0x021, "botgetmemoryevents" }, - { 0x022, "botgetteamdifficulty" }, - { 0x023, "botgetteamlimit" }, - { 0x024, "botmemoryflags" }, - { 0x025, "botsentientswap" }, - { 0x026, "botzonegetcount" }, - { 0x027, "botzonegetindoorpercent" }, - { 0x028, "botzonenearestcount" }, - { 0x029, "botzonesetteam" }, - { 0x02A, "bulletspread" }, - { 0x02B, "bullettracer" }, - { 0x02C, "calccsplinecorridor" }, - { 0x02D, "calccsplineposition" }, - { 0x02E, "calccsplinetangent" }, - { 0x02F, "calcrockingangles" }, - { 0x030, "calculatestartorientation" }, - { 0x031, "canspawn" }, - { 0x032, "canspawnturret" }, - { 0x033, "capsuletracepassed" }, - { 0x034, "ceil" }, - { 0x035, "changelevel" }, - { 0x036, "cinematic" }, - { 0x037, "cinematicgetframe" }, - { 0x038, "cinematicgettimeinmsec" }, - { 0x039, "cinematicingame" }, - { 0x03A, "cinematicingameloop" }, - { 0x03B, "cinematicingameloopresident" }, - { 0x03C, "cinematicingamesync" }, - { 0x03D, "clamp" }, - { 0x03E, "clearallcorpses" }, - { 0x03F, "clearlocalizedstrings" }, - { 0x040, "clearmatchdata" }, - { 0x041, "clientannouncement" }, - { 0x042, "clientprint" }, - { 0x043, "closer" }, - { 0x044, "combineangles" }, - { 0x045, "commitsave" }, - { 0x046, "commitwouldbevalid" }, - { 0x047, "connectnodepair" }, - { 0x048, "cos" }, - { 0x049, "createnavlink" }, - { 0x04A, "createthreatbiasgroup" }, - { 0x04B, "deleteglass" }, - { 0x04C, "destroyglass" }, - { 0x04D, "destroynavlink" }, - { 0x04E, "devsetminimapdvarsettings" }, - { 0x04F, "disableaudiotrigger" }, - { 0x050, "disableforcedsunshadows" }, - { 0x051, "disableouterspacemodellighting" }, - { 0x052, "disablepaspeaker" }, - { 0x053, "disconnectnodepair" }, - { 0x054, "distance" }, - { 0x055, "distance2d" }, - { 0x056, "distance2dsquared" }, - { 0x057, "distancesquared" }, - { 0x058, "drawcompassfriendlies" }, - { 0x059, "earthquake" }, - { 0x05A, "enableaudiotrigger" }, - { 0x05B, "enableforcednosunshadows" }, - { 0x05C, "enableforcedsunshadows" }, - { 0x05D, "enableouterspacemodellighting" }, - { 0x05E, "enablepaspeaker" }, - { 0x05F, "endlobby" }, - { 0x060, "endparty" }, - { 0x061, "exitlevel" }, - { 0x062, "exp" }, - { 0x063, "findentrances" }, - { 0x064, "float" }, - { 0x065, "floor" }, - { 0x066, "gamedvrprohibitrecording" }, - { 0x067, "gamedvrprohibitscreenshots" }, - { 0x068, "gamedvrsetscreenshotmetadata" }, - { 0x069, "gamedvrsetvideometadata" }, - { 0x06A, "gamedvrstartrecording" }, - { 0x06B, "gamedvrstoprecording" }, - { 0x06C, "getactiveclientcount" }, - { 0x06D, "getaiarray" }, - { 0x06E, "getaiarrayinradius" }, - { 0x06F, "getaicount" }, - { 0x070, "getaispeciesarray" }, - { 0x071, "getaiunittypearray" }, - { 0x072, "getallnodes" }, - { 0x073, "getallvehiclenodes" }, - { 0x074, "getangledelta" }, - { 0x075, "getangledelta3d" }, - { 0x076, "getanimlength" }, - { 0x077, "getarraykeys" }, - { 0x078, "getassignedteam" }, - { 0x079, "getbrushmodelcenter" }, - { 0x07A, "getbuildnumber" }, - { 0x07B, "getbuildversion" }, - { 0x07C, "getclientmatchdata" }, - { 0x07D, "getclosestnodeinsight" }, - { 0x07E, "getcorpsearray" }, - { 0x07F, "getcorpsearrayinradius" }, - { 0x080, "getcountertotal" }, - { 0x081, "getcsplinecount" }, - { 0x082, "getcsplinelength" }, - { 0x083, "getcsplinepointcorridordims" }, - { 0x084, "getcsplinepointcount" }, - { 0x085, "getcsplinepointdisttonextpoint" }, - { 0x086, "getcsplinepointid" }, - { 0x087, "getcsplinepointlabel" }, - { 0x088, "getcsplinepointposition" }, - { 0x089, "getcsplinepointtangent" }, - { 0x08A, "getcsplinepointtension" }, - { 0x08B, "getculldist" }, - { 0x08C, "getcycleoriginoffset" }, - { 0x08D, "getdvar" }, - { 0x08E, "getdvarfloat" }, - { 0x08F, "getdvarint" }, - { 0x090, "getgamebattlematchreportstate" }, - { 0x091, "getdvarvector" }, - { 0x092, "getenemysquaddata" }, - { 0x093, "getenemysquaddogtype" }, - { 0x094, "getent" }, - { 0x095, "getentarray" }, - { 0x096, "getentarrayinradius" }, - { 0x097, "getentchannelname" }, - { 0x098, "getentchannelscount" }, - { 0x099, "getfirstarraykey" }, - { 0x09A, "getfreeaicount" }, - { 0x09B, "getfxvisibility" }, - { 0x09C, "getgametypeindex" }, - { 0x09D, "getglass" }, - { 0x09E, "getglassarray" }, - { 0x09F, "getglassorigin" }, - { 0x0A0, "getgroundposition" }, - { 0x0A1, "getindexforluincstring" }, - { 0x0A2, "getkeybinding" }, - { 0x0A3, "getlastarraykey" }, - { 0x0A4, "getlinkednodes" }, - { 0x0A5, "getmapsunangles" }, - { 0x0A6, "getmapsundirection" }, - { 0x0A7, "getmapsunlight" }, - { 0x0A8, "getmapsuncolorraw" }, - { 0x0A9, "getmapsuncolorandintensity" }, - { 0x0AA, "getmatchdata" }, - { 0x0AB, "getmatchrulesdata" }, - { 0x0AC, "getmaxagents" }, - { 0x0AD, "getmissileowner" }, - { 0x0AE, "getmovedelta" }, - { 0x0AF, "getnextarraykey" }, - { 0x0B0, "getnode" }, - { 0x0B1, "getnodearray" }, - { 0x0B2, "getnodesinradius" }, - { 0x0B3, "getnodesinradiussorted" }, - { 0x0B4, "getnodesintrigger" }, - { 0x0B5, "getnodesonpath" }, - { 0x0B6, "getnodezone" }, - { 0x0B7, "getnorthyaw" }, - { 0x0B8, "getnotetracktimes" }, - { 0x0B9, "getnumparts" }, - { 0x0BA, "getnumvehicles" }, - { 0x0BB, "getomnvar" }, - { 0x0BC, "getpartname" }, - { 0x0BD, "getanimname" }, - { 0x0BE, "getpathdist" }, - { 0x0BF, "getplaylistid" }, - { 0x0C0, "getplaylistversion" }, - { 0x0C1, "getpredictedentityposition" }, - { 0x0C2, "getprevarraykey" }, - { 0x0C3, "getscriptablearray" }, - { 0x0C4, "getscriptablearrayinradius" }, - { 0x0C5, "getspawnarray" }, - { 0x0C6, "getspawner" }, - { 0x0C7, "getspawnerarray" }, - { 0x0C8, "getspawnerteamarray" }, - { 0x0C9, "getsquadassaultelo" }, - { 0x0CA, "getsquadassaultenemyprestige" }, - { 0x0CB, "getsquadassaultsquadindex" }, - { 0x0CC, "getstartangles" }, - { 0x0CD, "getstartorigin" }, - { 0x0CE, "getstarttime" }, - { 0x0CF, "getsticksconfig" }, - { 0x0D0, "getsubstr" }, - { 0x0D1, "getsystemtime" }, - { 0x0D2, "getteamplayersalive" }, - { 0x0D3, "getteamradar" }, - { 0x0D4, "getteamradarstrength" }, - { 0x0D5, "getteamscore" }, - { 0x0D6, "getthreatbias" }, - { 0x0D7, "gettime" }, - { 0x0D8, "gettimescale" }, - { 0x0D9, "gettimesincelastpaused" }, - { 0x0DA, "getuavstrengthlevelneutral" }, - { 0x0DB, "getuavstrengthlevelshowenemydirectional" }, - { 0x0DC, "getuavstrengthlevelshowenemyfastsweep" }, - { 0x0DD, "getuavstrengthmax" }, - { 0x0DE, "getuavstrengthmin" }, - { 0x0DF, "getvehiclenode" }, - { 0x0E0, "getvehiclenodearray" }, - { 0x0E1, "getweaponammopoolname" }, - { 0x0E2, "getweaponarray" }, - { 0x0E3, "getweaponarrayinradius" }, - { 0x0E4, "getweaponattachments" }, - { 0x0E5, "getweaponattachmentworldmodels" }, - { 0x0E6, "getweaponbasename" }, - { 0x0E7, "getweaponcamoname" }, - { 0x0E8, "getweaponclipmodel" }, - { 0x0E9, "getweaponexplosionradius" }, - { 0x0EA, "getweaponflashtagname" }, - { 0x0EB, "getweaponhidetags" }, - { 0x0EC, "getweaponmodel" }, - { 0x0ED, "getweaponreticlename" }, - { 0x0EE, "getzonecount" }, - { 0x0EF, "getzonenearest" }, - { 0x0F0, "getzonenodeforindex" }, - { 0x0F1, "getzonenodes" }, - { 0x0F2, "getzonenodesbydist" }, - { 0x0F3, "getzoneorigin" }, - { 0x0F4, "getzonepath" }, - { 0x0F5, "glassradiusdamage" }, - { 0x0F6, "hidemayhem" }, - { 0x0F7, "incrementcounter" }, - { 0x0F8, "instantlylogusageanalysisdata" }, - { 0x0F9, "int" }, - { 0x0FA, "invertangles" }, - { 0x0FB, "iprintln" }, - { 0x0FC, "iprintlnbold" }, - { 0x0FD, "isagent" }, - { 0x0FE, "isscriptedagent" }, - { 0x0FF, "isai" }, - { 0x100, "isalive" }, - { 0x101, "isarray" }, - { 0x102, "isbot" }, - { 0x103, "iscinematicloaded" }, - { 0x104, "iscinematicplaying" }, - { 0x105, "isdedicatedserver" }, - { 0x106, "isendstr" }, - { 0x107, "isstartstr" }, - { 0x108, "isenemyteam" }, - { 0x109, "isexplosivedamagemod" }, - { 0x10A, "isfloat" }, - { 0x10B, "isglassdestroyed" }, - { 0x10C, "isgodmode" }, - { 0x10D, "ishairrunning" }, - { 0x10E, "isint" }, - { 0x10F, "isistring" }, - { 0x110, "ismayhem" }, - { 0x111, "isnodeoccupied" }, - { 0x112, "isplayer" }, - { 0x113, "isplayernumber" }, - { 0x114, "ispointinvolume" }, - { 0x115, "issaverecentlyloaded" }, - { 0x116, "issavesuccessful" }, - { 0x117, "issentient" }, - { 0x118, "isspawner" }, - { 0x119, "issplitscreen" }, - { 0x11A, "issquadsmode" }, - { 0x11B, "isstring" }, - { 0x11C, "issubstr" }, - { 0x11D, "isteamradarblocked" }, - { 0x11E, "istransientloaded" }, - { 0x11F, "istransientqueued" }, - { 0x120, "isturretactive" }, - { 0x121, "isusingmatchrulesdata" }, - { 0x122, "isvalidmissile" }, - { 0x123, "isweaponcliponly" }, - { 0x124, "isweapondetonationtimed" }, - { 0x125, "kick" }, - { 0x126, "killfxontag" }, - { 0x127, "killmayhem" }, - { 0x128, "length" }, - { 0x129, "length2d" }, - { 0x12A, "length2dsquared" }, - { 0x12B, "lengthsquared" }, - { 0x12C, "lerpsunangles" }, - { 0x12D, "lerpsundirection" }, - { 0x12E, "levelsoundfade" }, - { 0x12F, "livestreamingenable" }, - { 0x130, "livestreamingsetbitrate" }, - { 0x131, "loadfx" }, - { 0x132, "loadluifile" }, - { 0x133, "loadstartpointtransients" }, - { 0x134, "loadtransient" }, - { 0x135, "log" }, - { 0x136, "logprint" }, - { 0x137, "logstring" }, - { 0x138, "lookupsoundlength" }, - { 0x139, "magicbullet" }, - { 0x13A, "magicgrenade" }, - { 0x13B, "magicgrenademanual" }, - { 0x13C, "map_restart" }, - { 0x13D, "mapexists" }, - { 0x13E, "matchend" }, - { 0x13F, "max" }, - { 0x140, "min" }, - { 0x141, "missile_createattractorent" }, - { 0x142, "missile_createattractororigin" }, - { 0x143, "missile_createrepulsorent" }, - { 0x144, "missile_createrepulsororigin" }, - { 0x145, "missile_deleteattractor" }, - { 0x146, "missionfailed" }, - { 0x147, "missionsuccess" }, - { 0x148, "musicplay" }, - { 0x149, "musicstop" }, - { 0x14A, "newclienthudelem" }, - { 0x14B, "newhudelem" }, - { 0x14C, "newteamhudelem" }, - { 0x14D, "nodeexposedtosky" }, - { 0x14E, "nodesvisible" }, - { 0x14F, "notifyoncommand" }, - { 0x150, "obituary" }, - { 0x151, "objective_current" }, - { 0x152, "objective_delete" }, - { 0x153, "objective_icon" }, - { 0x154, "objective_onentity" }, - { 0x155, "objective_setzoffset" }, - { 0x156, "objective_position" }, - { 0x157, "objective_setlocation" }, - { 0x158, "objective_unsetlocation" }, - { 0x159, "objective_setlabel" }, - { 0x15A, "objective_setfriendlylabel" }, - { 0x15B, "objective_setenemylabel" }, - { 0x15C, "objective_setneutrallabel" }, - { 0x15D, "objective_state" }, - { 0x15E, "objective_setpinned" }, - { 0x15F, "objective_pinforclient" }, - { 0x160, "objective_unpinforclient" }, - { 0x161, "objective_pinforteam" }, - { 0x162, "objective_unpinforteam" }, - { 0x163, "objective_setdescription" }, - { 0x164, "objective_setplayintro" }, - { 0x165, "objective_setplayoutro" }, - { 0x166, "objective_sethot" }, - { 0x167, "objective_setpulsate" }, - { 0x168, "objective_setshowdistance" }, - { 0x169, "objective_setrotateonminimap" }, - { 0x16A, "objective_setshowoncompass" }, - { 0x16B, "objective_setminimapiconsize" }, - { 0x16C, "objective_setbackground" }, - { 0x16D, "objective_setshowprogress" }, - { 0x16E, "objective_showprogressforclient" }, - { 0x16F, "objective_hideprogressforclient" }, - { 0x170, "objective_showprogressforteam" }, - { 0x171, "objective_hideprogressforteam" }, - { 0x172, "objective_setprogress" }, - { 0x173, "objective_setownerclient" }, - { 0x174, "objective_setownerteam" }, - { 0x175, "objective_setprogressclient" }, - { 0x176, "objective_setprogressteam" }, - { 0x177, "objective_addclienttomask" }, - { 0x178, "objective_addteamtomask" }, - { 0x179, "objective_addalltomask" }, - { 0x17A, "objective_removeclientfrommask" }, - { 0x17B, "objective_removeteamfrommask" }, - { 0x17C, "objective_removeallfrommask" }, - { 0x17D, "objective_showtoplayersinmask" }, - { 0x17E, "objective_hidefromplayersinmask" }, - { 0x17F, "objective_setfadedisabled" }, - { 0x180, "objective_ping" }, - { 0x181, "objective_setpings" }, - { 0x182, "objective_setpingsforteam" }, - { 0x183, "pausecinematicingame" }, - { 0x184, "pausemayhem" }, - { 0x185, "perlinnoise2d" }, - { 0x186, "physicsexplosionsphere" }, - { 0x187, "physicsjitter" }, - { 0x188, "physicsjolt" }, - { 0x189, "physicstrace" }, - { 0x18A, "playcinematicforall" }, - { 0x18B, "playerphysicstrace" }, - { 0x18C, "playfx" }, - { 0x18D, "playfxontag" }, - { 0x18E, "playfxontagforclients" }, - { 0x18F, "playloopedfx" }, - { 0x190, "playmayhem" }, - { 0x191, "playrumblelooponposition" }, - { 0x192, "playrumbleonposition" }, - { 0x193, "playsoundatpos" }, - { 0x194, "playworldsound" }, - { 0x195, "pointonsegmentnearesttopoint" }, - { 0x196, "positionwouldtelefrag" }, - { 0x197, "pow" }, - { 0x198, "precachedigitaldistortcodeassets" }, - { 0x199, "precachefxontag" }, - { 0x19A, "precacheitem" }, - { 0x19B, "precacheleaderboards" }, - { 0x19C, "precacheminimapicon" }, - { 0x19D, "precacheminimapsentrycodeassets" }, - { 0x19E, "precachemodel" }, - { 0x19F, "precachecompositemodel" }, - { 0x1A0, "precachempanim" }, - { 0x1A1, "precachenightvisioncodeassets" }, - { 0x1A2, "precacherumble" }, - { 0x1A3, "precacheshader" }, - { 0x1A4, "precachestatusicon" }, - { 0x1A5, "precachestring" }, - { 0x1A6, "precachetag" }, - { 0x1A7, "precacheturret" }, - { 0x1A8, "precachevehicle" }, - { 0x1A9, "preloadcinematicforall" }, - { 0x1AA, "queuedialog" }, - { 0x1AB, "radiusdamage" }, - { 0x1AC, "randomfloat" }, - { 0x1AD, "randomfloatrange" }, - { 0x1AE, "randomint" }, - { 0x1AF, "randomintrange" }, - { 0x1B0, "reconevent" }, - { 0x1B1, "reconspatialevent" }, - { 0x1B2, "remapstage" }, - { 0x1B3, "resetscriptusageanalysisdata" }, - { 0x1B4, "resetsundirection" }, - { 0x1B5, "resetsunlight" }, - { 0x1B6, "resettimeout" }, - { 0x1B7, "rotatepointaroundvector" }, - { 0x1B8, "rotatevector" }, - { 0x1B9, "rotatevectorinverted" }, - { 0x1BA, "savegame" }, - { 0x1BB, "savegamenocommit" }, - { 0x1BC, "screenshake" }, - { 0x1BD, "sendclientmatchdata" }, - { 0x1BE, "sendmatchdata" }, - { 0x1BF, "sendscriptusageanalysisdata" }, - { 0x1C0, "setac130ambience" }, - { 0x1C1, "setblur" }, - { 0x1C2, "setclientmatchdata" }, - { 0x1C3, "setclientmatchdatadef" }, - { 0x1C4, "setclientnamemode" }, - { 0x1C5, "setculldist" }, - { 0x1C6, "setdvar" }, - { 0x1C7, "setdvarifuninitialized" }, - { 0x1C8, "setdynamicdvar" }, - { 0x1C9, "setgameendtime" }, - { 0x1CA, "setglaregrimematerial" }, - { 0x1CB, "sethalfresparticles" }, - { 0x1CC, "setignoremegroup" }, - { 0x1CD, "setlasermaterial" }, - { 0x1CE, "setmapcenter" }, - { 0x1CF, "setmatchclientip" }, - { 0x1D0, "setmatchdata" }, - { 0x1D1, "setmatchdatadef" }, - { 0x1D2, "setmatchdataid" }, - { 0x1D3, "setminimap" }, - { 0x1D4, "setmusicstate" }, - { 0x1D5, "setnodepriority" }, - { 0x1D6, "setnojipscore" }, - { 0x1D7, "setnojiptime" }, - { 0x1D8, "setocclusionpreset" }, - { 0x1D9, "setomnvar" }, - { 0x1DA, "setomnvarforallclients" }, - { 0x1DB, "setomnvarbit" }, - { 0x1DC, "setplayerignoreradiusdamage" }, - { 0x1DD, "setplayerteamrank" }, - { 0x1DE, "doentitiessharehierarchy" }, - { 0x1DF, "setsaveddvar" }, - { 0x1E0, "setslowmotion" }, - { 0x1E1, "setslowmotionview" }, - { 0x1E2, "setsundirection" }, - { 0x1E3, "setsunflareposition" }, - { 0x1E4, "setsuncolorandintensity" }, - { 0x1E5, "setteammode" }, - { 0x1E6, "setteamradar" }, - { 0x1E7, "setteamradarstrength" }, - { 0x1E8, "setteamscore" }, - { 0x1E9, "setthermalbodymaterial" }, - { 0x1EA, "setthreatbias" }, - { 0x1EB, "setthreatbiasagainstall" }, - { 0x1EC, "settimescale" }, - { 0x1ED, "setturretnode" }, - { 0x1EE, "setumbraportalstate" }, - { 0x1EF, "setwinningteam" }, - { 0x1F0, "showmayhem" }, - { 0x1F1, "sighttracepassed" }, - { 0x1F2, "sin" }, - { 0x1F3, "sortbydistance" }, - { 0x1F4, "soundexists" }, - { 0x1F5, "soundfade" }, - { 0x1F6, "soundislooping" }, - { 0x1F7, "soundresettimescale" }, - { 0x1F8, "soundsettimescalefactor" }, - { 0x1F9, "spawn" }, - { 0x1FA, "spawnbrcircle" }, - { 0x1FB, "spawnfx" }, - { 0x1FC, "spawnfxforclient" }, - { 0x1FD, "spawnhelicopter" }, - { 0x1FE, "spawnloopingsound" }, - { 0x1FF, "spawnmayhem" }, - { 0x200, "spawnplane" }, - { 0x201, "spawnragdollconstraint" }, - { 0x202, "spawnsighttrace" }, - { 0x203, "spawnstruct" }, - { 0x204, "spawnturret" }, - { 0x205, "spawnvehicle" }, - { 0x206, "speechenable" }, - { 0x207, "speechenablegrammar" }, - { 0x208, "sqrt" }, - { 0x209, "squared" }, - { 0x20A, "stopallrumbles" }, - { 0x20B, "stopcinematicforall" }, - { 0x20C, "stopcinematicingame" }, - { 0x20D, "stopfxontag" }, - { 0x20E, "stricmp" }, - { 0x20F, "strtok" }, - { 0x210, "synctransients" }, - { 0x211, "tableexists" }, - { 0x212, "tablelookup" }, - { 0x213, "tablelookupbyrow" }, - { 0x214, "tablelookupgetnumrows" }, - { 0x215, "tablelookupgetnumcols" }, - { 0x216, "tablelookupistring" }, - { 0x217, "tablelookupistringbyrow" }, - { 0x218, "tablelookuprownum_startfromrow" }, - { 0x219, "tablelookuprownum_reversefromrow" }, - { 0x21A, "tablelookuprownum" }, - { 0x21B, "tan" }, - { 0x21C, "target_alloc" }, - { 0x21D, "target_clearreticlelockon" }, - { 0x21E, "target_drawcornersonly" }, - { 0x21F, "target_drawsingle" }, - { 0x220, "target_drawsquare" }, - { 0x221, "target_flush" }, - { 0x222, "target_getarray" }, - { 0x223, "target_gettargetatindex" }, - { 0x224, "target_getindexoftarget" }, - { 0x225, "target_hidefromplayer" }, - { 0x226, "target_isincircle" }, - { 0x227, "target_isinrect" }, - { 0x228, "target_istarget" }, - { 0x229, "target_remove" }, - { 0x22A, "target_set" }, - { 0x22B, "target_setattackmode" }, - { 0x22C, "target_setcolor" }, - { 0x22D, "target_setdelay" }, - { 0x22E, "target_setjavelinonly" }, - { 0x22F, "target_setmaxsize" }, - { 0x230, "target_setminsize" }, - { 0x231, "target_setoffscreenshader" }, - { 0x232, "target_setscaledrendermode" }, - { 0x233, "target_setshader" }, - { 0x234, "target_showtoplayer" }, - { 0x235, "target_startreticlelockon" }, - { 0x236, "teleportscene" }, - { 0x237, "threatbiasgroupexists" }, - { 0x238, "tolower" }, - { 0x239, "trajectorycalculateexitangle" }, - { 0x23A, "trajectorycalculateinitialvelocity" }, - { 0x23B, "trajectorycalculateminimumvelocity" }, - { 0x23C, "trajectorycanattemptaccuratejump" }, - { 0x23D, "trajectorycomputedeltaheightattime" }, - { 0x23E, "trajectoryestimatedesiredinairtime" }, - { 0x23F, "transformmove" }, - { 0x240, "triggerfx" }, - { 0x241, "triggerportableradarping" }, - { 0x242, "pinglocationenemyteams" }, - { 0x243, "triggeroneoffradarsweep" }, - { 0x244, "unblockteamradar" }, - { 0x245, "unloadalltransients" }, - { 0x246, "unloadtransient" }, - { 0x247, "unsetturretnode" }, - { 0x248, "updateclientnames" }, - { 0x249, "updategamerprofile" }, - { 0x24A, "updategamerprofileall" }, - { 0x24B, "vectorcross" }, - { 0x24C, "vectordot" }, - { 0x24D, "vectorfromlinetopoint" }, - { 0x24E, "vectorlerp" }, - { 0x24F, "vectornormalize" }, - { 0x250, "vectortoangles" }, - { 0x251, "vectortoyaw" }, - { 0x252, "vehicle_getarray" }, - { 0x253, "vehicle_getspawnerarray" }, - { 0x254, "vehicle_allowplayeruse" }, - { 0x255, "visionsetalternate" }, - { 0x256, "visionsetfadetoblack" }, - { 0x257, "visionsetmissilecam" }, - { 0x258, "visionsetnaked" }, - { 0x259, "visionsetnight" }, - { 0x25A, "visionsetpain" }, - { 0x25B, "visionsetthermal" }, - { 0x25C, "weaponaltweaponname" }, - { 0x25D, "weaponburstcount" }, - { 0x25E, "weaponclass" }, - { 0x25F, "weaponoffhandclass" }, - { 0x260, "weaponclipsize" }, - { 0x261, "weaponfightdist" }, - { 0x262, "weaponfiretime" }, - { 0x263, "weaponhasthermalscope" }, - { 0x264, "weaponcandrop" }, - { 0x265, "weaponinheritsperks" }, - { 0x266, "weaponinventorytype" }, - { 0x267, "weaponisauto" }, - { 0x268, "weaponisboltaction" }, - { 0x269, "weaponisimpaling" }, - { 0x26A, "weaponissemiauto" }, - { 0x26B, "weaponmaxammo" }, - { 0x26C, "weaponmaxdist" }, - { 0x26D, "weaponstartammo" }, - { 0x26E, "weapontype" }, - { 0x26F, "worldentnumber" }, - { 0x270, "adddebugcommand" }, - { 0x271, "assert" }, - { 0x272, "assertex" }, - { 0x273, "assertmsg" }, - { 0x274, "box" }, - { 0x275, "closefile" }, - { 0x276, "createprintchannel" }, - { 0x277, "cylinder" }, - { 0x278, "drawsoundshape" }, - { 0x279, "fgetarg" }, - { 0x27A, "fprintfields" }, - { 0x27B, "fprintln" }, - { 0x27C, "freadln" }, - { 0x27D, "getentbynum" }, - { 0x27E, "getreflectionlocs" }, - { 0x27F, "getsystemtimeinmicroseconds" }, - { 0x280, "getunarchiveddebugdvar" }, - { 0x281, "line" }, - { 0x282, "openfile" }, - { 0x283, "debugstar" }, - { 0x284, "orientedbox" }, - { 0x285, "debugaxis" }, - { 0x286, "print" }, - { 0x287, "print3d" }, - { 0x288, "println" }, - { 0x289, "printtoscreen2d" }, - { 0x28A, "setdebugangles" }, - { 0x28B, "setdebugorigin" }, - { 0x28C, "setdevdvar" }, - { 0x28D, "setdevdvarifuninitialized" }, - { 0x28E, "setprintchannel" }, - { 0x28F, "sphere" }, - { 0x290, "sysprint" }, - { 0x291, "physics_getbodylinvel" }, - { 0x292, "physics_getbodyangvel" }, - { 0x293, "physics_getbodylinangvel" }, - { 0x294, "findpathcustom" }, - { 0x295, "findpath3d" }, - { 0x296, "navtrace" }, - { 0x297, "navtrace3d" }, - { 0x298, "navisstraightlinereachable" }, - { 0x299, "getrandomnavpoint" }, - { 0x29A, "getrandomnavpoints" }, - { 0x29B, "getclosestpointonnavmesh" }, - { 0x29C, "createnavrepulsor" }, - { 0x29D, "destroynavrepulsor" }, - { 0x29E, "ispointonnavmesh" }, - { 0x29F, "createnavobstaclebybounds" }, - { 0x2A0, "createnavobstaclebyent" }, - { 0x2A1, "destroynavobstacle" }, - { 0x2A2, "createnavbadplacebybounds" }, - { 0x2A3, "createnavbadplacebyent" }, - { 0x2A4, "createnavobstaclebyboundsforlayer" }, - { 0x2A5, "createnavobstaclebyentforlayer" }, - { 0x2A6, "createnavmodifier" }, - { 0x2A7, "isnumber" }, - { 0x2A8, "preloadzones" }, - { 0x2A9, "physics_setgravity" }, - { 0x2AA, "isbotmatchmakingenabled" }, - { 0x2AB, "addmpbottoteam" }, - { 0x2AC, "ispreloadzonescomplete" }, - { 0x2AD, "physics_getbulletmissilecontents" }, - { 0x2AE, "assertdemo" }, - { 0x2AF, "physics_aabbbroadphasequery" }, - { 0x2B0, "physics_aabbquery" }, - { 0x2B1, "physics_raycast" }, - { 0x2B2, "physics_spherecast" }, - { 0x2B3, "physics_capsulecast" }, - { 0x2B4, "physics_shapecast" }, - { 0x2B5, "physics_querypoint" }, - { 0x2B6, "physics_getclosestpointtosphere" }, - { 0x2B7, "physics_getclosestpointtocapsule" }, - { 0x2B8, "physics_getclosestpoint" }, - { 0x2B9, "physics_createcontents" }, - { 0x2BA, "physics_getsurfacetypefromflags" }, - { 0x2BB, "pathsighttestfast" }, - { 0x2BC, "nodetoentitysighttest" }, - { 0x2BD, "weapongetdamagemax" }, - { 0x2BE, "weapongetdamagemin" }, - { 0x2BF, "precomputedlosdatatest" }, - { 0x2C0, "getislosdatafileloaded" }, - { 0x2C1, "stopfxontagforclients" }, - { 0x2C2, "physics_charactercast" }, - { 0x2C3, "physics_getclosestpointtocharacter" }, - { 0x2C4, "playfxontagforteam" }, - { 0x2C5, "physics_getbodymass" }, - { 0x2C6, "physics_getbodydynamicmass" }, - { 0x2C7, "physics_getbodycenterofmass" }, - { 0x2C8, "physics_setbodycenterofmassnormal" }, - { 0x2C9, "physics_getbodyaabb" }, - { 0x2CA, "cachespawnpathnodesincode" }, - { 0x2CB, "getaccuracyfraction" }, - { 0x2CC, "triggerportableradarpingteam" }, - { 0x2CD, "isvfxfile" }, - { 0x2CE, "isstruct" }, - { 0x2CF, "isvector" }, - { 0x2D0, "isent" }, - { 0x2D1, "isnode" }, - { 0x2D2, "isnonentspawner" }, - { 0x2D3, "setglobalsoundcontext" }, - { 0x2D4, "setaudiotriggerstate" }, - { 0x2D5, "finishplayerdeath" }, - { 0x2D6, "precachesuit" }, - { 0x2D7, "getcsplineid" }, - { 0x2D8, "spawnimpulsefield" }, - { 0x2D9, "clearstartpointtransients" }, - { 0x2DA, "isloadingsavegame" }, - { 0x2DB, "getsavegametransients" }, - { 0x2DC, "getclosestpointonnavmesh3d" }, - { 0x2DD, "ispointonnavmesh3d" }, - { 0x2DE, "waspreloadzonesstarted" }, - { 0x2DF, "getcsplinepointstring" }, - { 0x2E0, "calccsplineclosestpoint" }, - { 0x2E1, "weaponisbeam" }, - { 0x2E2, "navisstraightlinereachable3d" }, - { 0x2E3, "getcsplinepointtargetname" }, - { 0x2E4, "getcsplinepointtarget" }, - { 0x2E5, "getcsplinetargetname" }, - { 0x2E6, "getweaponloottable" }, - { 0x2E7, "getweaponvariantindex" }, - { 0x2E8, "areanynavvolumesloaded" }, - { 0x2E9, "projectileintercept" }, - { 0x2EA, "getgrenadefusetime" }, - { 0x2EB, "getgrenadefusetimeai" }, - { 0x2EC, "getgrenadedamageradius" }, - { 0x2ED, "getcsplineidarray" }, - { 0x2EE, "spawncovernode" }, - { 0x2EF, "despawncovernode" }, - { 0x2F0, "spawnscriptitem" }, - { 0x2F1, "areworldweaponsloaded" }, - { 0x2F2, "getmaxclients" }, - { 0x2F3, "settransientvisibility" }, - { 0x2F4, "vectortopitch" }, - { 0x2F5, "getserverhostname" }, - { 0x2F6, "anglestoleft" }, - { 0x2F7, "weaponusesenergybullets" }, - { 0x2F8, "testbrushedgesforgrapple" }, - { 0x2F9, "spawncoverwall" }, - { 0x2FA, "generateaxisanglesfromforwardvector" }, - { 0x2FB, "btregistertree" }, - { 0x2FC, "isenumvaluevalid" }, - { 0x2FD, "switchtransientset" }, - { 0x2FE, "loadstartpointtransientset" }, - { 0x2FF, "physics_setgravityragdollscalar" }, - { 0x300, "physics_setgravitydynentscalar" }, - { 0x301, "physics_setgravityparticlescalar" }, - { 0x302, "playfxontagsbetweenclients" }, - { 0x303, "playfxbetweenpoints" }, - { 0x304, "physics_volumecreate" }, - { 0x305, "issound3d" }, - { 0x306, "generateaxisanglesfromupvector" }, - { 0x307, "anglelerpquat" }, - { 0x308, "loadworldweapons" }, - { 0x309, "clearworldweapons" }, - { 0x30A, "anglelerpquatfrac" }, - { 0x30B, "archetypeassetloaded" }, - { 0x30C, "archetypegetalias" }, - { 0x30D, "archetypegetrandomalias" }, - { 0x30E, "archetypegetaliases" }, - { 0x30F, "archetypehasstate" }, - { 0x310, "computeweaponclientloadout" }, - { 0x311, "target_drawonradar" }, - { 0x312, "target_setradarcenter" }, - { 0x313, "target_offsetlocalspace" }, - { 0x314, "target_drawrotated" }, - { 0x315, "getangleindices" }, - { 0x316, "getangleindex" }, - { 0x317, "hasroomtoplaypeekout" }, - { 0x318, "getdobjcount" }, - { 0x319, "frontendscenecamerafade" }, - { 0x31A, "frontendscenecamerafov" }, - { 0x31B, "frontendscenegetactivesection" }, - { 0x31C, "frontendscenecameracharacters" }, - { 0x31D, "isspleveltransient" }, - { 0x31E, "isgamebattlematch" }, - { 0x31F, "physics_setgravityitemscalar" }, - { 0x320, "setsettletime" }, - { 0x321, "bbreportspawnfactors" }, - { 0x322, "bbreportspawntypes" }, - { 0x323, "bbreportspawnplayerdetails" }, - { 0x324, "setstreamsynconnextlevel" }, - { 0x325, "setpreloadimageprimeset" }, - { 0x326, "animisleaf" }, - { 0x327, "getweaponviewmodel" }, - { 0x328, "startpodium" }, - { 0x329, "playcinematicforalllooping" }, - { 0x32A, "frontendscenecameracinematic" }, - { 0x32B, "setcodcasterclientmatchdata" }, - { 0x32C, "getcodcasterclientmatchdata" }, - { 0x32D, "sendcodcasterclientmatchdata" }, - { 0x32E, "waitforalltransients" }, - { 0x32F, "waitfortransient" }, - { 0x330, "isloadinganytransients" }, - { 0x331, "getmlgsettings" }, - { 0x332, "setintrocameraactive" }, - { 0x333, "removeallcorpses" }, - { 0x334, "asmregistergenerichandler" }, - { 0x335, "asmdevgetallnotetrackaimstates" }, - { 0x336, "stopspectateplayer" }, - { 0x337, "weaponispreferreddrop" }, - { 0x338, "physics_setbodylinvel" }, - { 0x339, "physics_setbodyangvel" }, - { 0x33A, "physics_setbodylinangvel" }, - { 0x33B, "findclosestlospointwithinvolume" }, - { 0x33C, "findclosestpointbyapproxpathdist" }, - { 0x33D, "findclosestnonlospointwithinvolume" }, - { 0x33E, "findclosestnonlospointwithinradius" }, - { 0x33F, "findclosestlospointwithinradius" }, - { 0x340, "findopenlookdir" }, - { 0x341, "makeweapon" }, - { 0x342, "getcompleteweaponname" }, - { 0x343, "createheadicon" }, - { 0x344, "deleteheadicon" }, - { 0x345, "setheadiconimage" }, - { 0x346, "setheadiconfriendlyimage" }, - { 0x347, "setheadiconenemyimage" }, - { 0x348, "setheadiconneutralimage" }, - { 0x349, "setheadiconnaturaldistance" }, - { 0x34A, "setheadiconmaxdistance" }, - { 0x34B, "setheadiconsnaptoedges" }, - { 0x34C, "setheadicondrawthroughgeo" }, - { 0x34D, "setheadiconzoffset" }, - { 0x34E, "addclienttoheadiconmask" }, - { 0x34F, "addteamtoheadiconmask" }, - { 0x350, "removeclientfromheadiconmask" }, - { 0x351, "removeteamfromheadiconmask" }, - { 0x352, "showheadicontoplayersinmask" }, - { 0x353, "hideheadiconfromplayersinmask" }, - { 0x354, "setheadiconteam" }, - { 0x355, "setheadiconowner" }, - { 0x356, "createtargetmarkergroup" }, - { 0x357, "deletetargetmarkergroup" }, - { 0x358, "targetmarkergroupaddentity" }, - { 0x359, "targetmarkergroupremoveentity" }, - { 0x35A, "targetmarkergroupsetentitystate" }, - { 0x35B, "targetmarkergroupsetextrastate" }, - { 0x35C, "addclienttotargetmarkergroupmask" }, - { 0x35D, "addteamtotargetmarkergroupmask" }, - { 0x35E, "removeclientfromtargetmarkergroupmask" }, - { 0x35F, "removeteamfromtargetmarkergroupmask" }, - { 0x360, "showtargetmarkergrouptoplayersinmask" }, - { 0x361, "hidetargetmarkergroupfromplayersinmask" }, - { 0x362, "isweapon" }, - { 0x363, "issameweapon" }, - { 0x364, "isnullweapon" }, - { 0x365, "nullweapon" }, - { 0x366, "isundefinedweapon" }, - { 0x367, "getqueuedspleveltransients" }, - { 0x368, "getloadedspleveltransients" }, - { 0x369, "getallspleveltransients" }, - { 0x36A, "gettransientsinset" }, - { 0x36B, "gettransientsetnames" }, - { 0x36C, "makealtweapon" }, - { 0x36D, "makeweaponfromstring" }, - { 0x36E, "asmdevgetallstates" }, - { 0x36F, "getplayerspawnarray" }, - { 0x370, "disablespawnpoints" }, - { 0x371, "disablespawnpointsbyclassname" }, - { 0x372, "disablespawnpointbyindex" }, - { 0x373, "enablespawnpoints" }, - { 0x374, "enablespawnpointsbyclassname" }, - { 0x375, "enablespawnpointbyindex" }, - { 0x376, "registerspawnfactor" }, - { 0x377, "enablefrontlinecriticalfactor" }, - { 0x378, "registerspawnteamsmode" }, - { 0x379, "createspawninfluencepoint" }, - { 0x37A, "destroyspawninfluencepoint" }, - { 0x37B, "animsetgetanimfromindex" }, - { 0x37C, "animsetgetallanimindicesforalias" }, - { 0x37D, "analyticsstreamerlogfileendstream" }, - { 0x37E, "analyticsstreamerlogfilestartstream" }, - { 0x37F, "analyticsstreamerlogfilewritetobuffer" }, - { 0x380, "analyticsstreamerlogfiletagplayer" }, - { 0x381, "analyticsstreamerislogfilestreamingenabled" }, - { 0x382, "drawentitybounds" }, - { 0x383, "getscriptbundle" }, - { 0x384, "isintournament" }, - { 0x385, "dotournamentendgame" }, - { 0x386, "logtournamentdeath" }, - { 0x387, "updatetournamentroundtime" }, - { 0x388, "physics_raycastents" }, - { 0x389, "savepotgdata" }, - { 0x38A, "getpotgstarttime" }, - { 0x38B, "getpotgduration" }, - { 0x38C, "completescenetransition" }, - { 0x38D, "stopclientexploder" }, - { 0x38E, "loadinfiltransient" }, - { 0x38F, "unloadinfiltransient" }, - { 0x390, "unloadallinfilintrotransients" }, - { 0x391, "setspeedthreshold" }, - { 0x392, "animspeedthresholdsexist" }, - { 0x393, "hasanimspeedthresholdstring" }, - { 0x394, "getanimspeedthreshold" }, - { 0x395, "getnearestspeedthresholdname" }, - { 0x396, "getnextlowestspeedthresholdstring" }, - { 0x397, "getanimspeedbetweenthresholds" }, - { 0x398, "getcoveranglelimits" }, - { 0x399, "get3dcoveranglelimits" }, - { 0x39A, "getcovercrouchanglelimits" }, - { 0x39B, "isfunction" }, - { 0x39C, "isbuiltinfunction" }, - { 0x39D, "isbuiltinmethod" }, - { 0x39E, "isanimation" }, - { 0x39F, "dospawnaitype" }, - { 0x3A0, "havemapentseffects" }, - { 0x3A1, "isplatformconsole" }, - { 0x3A2, "isplatformpc" }, - { 0x3A3, "isplatformps4" }, - { 0x3A4, "isplatformxb3" }, - { 0x3A5, "spawninfluencepointlinkto" }, - { 0x3A6, "spawninfluencepointislinked" }, - { 0x3A7, "spawninfluencepointsetposition" }, - { 0x3A8, "dlog_recordevent" }, - { 0x3A9, "getentitylessscriptablearray" }, - { 0x3AA, "getentitylessscriptablearrayinradius" }, - { 0x3AB, "getlootscriptablearray" }, - { 0x3AC, "getlootscriptablearrayinradius" }, - { 0x3AD, "canceljoins" }, - { 0x3AE, "spawnscriptable" }, - { 0x3AF, "easepower" }, - { 0x3B0, "easeexponential" }, - { 0x3B1, "easelogarithmic" }, - { 0x3B2, "easesine" }, - { 0x3B3, "easeback" }, - { 0x3B4, "easeelastic" }, - { 0x3B5, "easebounce" }, - { 0x3B6, "spawnsound" }, - { 0x3B7, "getplayerrateofgamerevenue" }, - { 0x3B8, "botnodeavailabletoteam" }, - { 0x3B9, "getnodeowner" }, - { 0x3BA, "showcinematicletterboxing" }, - { 0x3BB, "hidecinematicletterboxing" }, - { 0x3BC, "getrandomnodedestination" }, - { 0x3BD, "getfakeaiarray" }, - { 0x3BE, "getfakeaiarrayinradius" }, - { 0x3BF, "onmatchbegin" }, - { 0x3C0, "onmatchend" }, - { 0x3C1, "isalliedsentient" }, - { 0x3C2, "istestclient" }, - { 0x3C3, "initmaxspeedforpathlengthtable" }, - { 0x3C4, "isnavmeshloaded" }, - { 0x3C5, "isscriptabledefined" }, - { 0x3C6, "visionsetkillcamthirdpersonnight" }, - { 0x3C7, "getnodeindex" }, - { 0x3C8, "getnodebyindex" }, - { 0x3C9, "nvidiahighlightsrequestpermissions" }, - { 0x3CA, "nvidiahighlightsisenabled" }, - { 0x3CB, "nvidiahighlightsbegingroup" }, - { 0x3CC, "nvidiahighlightsendgroup" }, - { 0x3CD, "nvidiahighlightsscreenshot" }, - { 0x3CE, "nvidiahighlightsvideo" }, - { 0x3CF, "nvidiahighlightsgetcount" }, - { 0x3D0, "nvidiahighlightssummary" }, - { 0x3D1, "nvidiahighlightscleanup" }, - { 0x3D2, "getscriptableinstancefromindex" }, - { 0x3D3, "calcscriptablepayloadgravityarc" }, - { 0x3D4, "getscriptablereservedremaining" }, - { 0x3D5, "enabledismembermenttag" }, - { 0x3D6, "disabledismembermenttag" }, - { 0x3D7, "spawnmapcircle" }, - { 0x3D8, "getmaxobjectivecount" }, - { 0x3D9, "spawncustomweaponscriptable" }, - { 0x3DA, "getnodecount" }, - { 0x3DB, "getsentientcounts" }, - { 0x3DC, "getsentientlimits" }, - { 0x3DD, "nvidiaanselisenabled" }, - { 0x3DE, "computedropbagpositions" }, - { 0x3DF, "getunusedlootcachepoints" }, - { 0x3E0, "getlootspawnpoint" }, - { 0x3E1, "getquestpoints" }, - { 0x3E2, "disablelootspawnpoint" }, - { 0x3E3, "getlootspawnpointcount" }, - { 0x3E4, "getlootspawnscriptableindexfirst" }, - { 0x3E5, "getdatetime" }, - { 0x3E6, "analyticsreset" }, - { 0x3E7, "analyticsaddevent" }, - { 0x3E8, "analyticswritecsv" }, - { 0x3E9, "objective_setspecialobjectivedisplay" }, - { 0x3EA, "hastacvis" }, - { 0x3EB, "enablegroundwarspawnlogic" }, - { 0x3EC, "getscriptablelootspawnedcountbyname" }, - { 0x3ED, "getscriptablelootspawnedcountbyrarity" }, - { 0x3EE, "getscriptablelootspawnedcountbytype" }, - { 0x3EF, "getscriptablelootcachecontents" }, - { 0x3F0, "pickscriptablelootitem" }, - { 0x3F1, "registerscriptedspawnpoints" }, - { 0x3F2, "getoriginforanimtime" }, - { 0x3F3, "getanglesforanimtime" }, - { 0x3F4, "getbnetigrplayerxpmultiplier" }, - { 0x3F5, "getbnetigrweaponxpmultiplier" }, - { 0x3F6, "sortbydistancecullbyradius" }, - { 0x3F7, "incrementpersistentstat" }, - { 0x3F8, "objective_sethideformlgspectator" }, - { 0x3F9, "objective_setshowformlgspectator" }, - { 0x3FA, "getdediserverguid" }, - { 0x3FB, "isdismembermentenabled" }, - { 0x3FC, "objective_mlgicon" }, - { 0x3FD, "objective_reset_mlgicon" }, - { 0x3FE, "resetglass" }, - { 0x3FF, "objective_setmlgbackground" }, - { 0x400, "weaponisrestricted" }, - { 0x401, "attachmentisrestricted" }, - { 0x402, "perkisrestricted" }, - { 0x403, "equipmentisrestricted" }, - { 0x404, "killstreakisrestricted" }, - { 0x405, "superisrestricted" }, - { 0x406, "setgamebattleplayerstats" }, - { 0x407, "setgamebattlematchstats" }, - { 0x408, "requestgamelobbyremainintact" }, - { 0x409, "createnavobstaclebyshape" }, - { 0x40A, "createnavbadplacebyshape" }, - { 0x40B, "createnavobstaclebyshapeforlayer" }, - { 0x40C, "setminimapcpraidmaze" }, - { 0x40D, "brmatchstarted" }, - { 0x40E, "vehicle_getarrayinradius" }, - { 0x40F, "tablesort" }, - { 0x410, "setteamplacement" }, - { 0x411, "soundsettimescalefactorfromtable" }, - { 0x412, "createheadiconatorigin" }, - { 0x413, "setheadicondrawinmap" }, - { 0x414, "objective_sethideelevation" }, - { 0x415, "playencryptedcinematicforall" }, - { 0x416, "getbnetigrbattlepassxpmultiplier" }, - { 0x417, "getscriptcachecontents" }, - { 0x418, "getweaponindex" }, - { 0x419, "radiusdamagestepped" }, - { 0x41A, "verifybunkercode" }, - { 0x41B, "getaltbunkerindexforname" }, - { 0x41C, "getplaylistname" }, - { 0x41D, "stopmusicstate" }, - { 0x41E, "_func_41E" }, - { 0x41F, "_func_41F" }, - { 0x420, "_func_420" }, - { 0x421, "_func_421" }, - { 0x422, "_func_422" }, - { 0x423, "_func_423" }, - { 0x424, "_func_424" }, - { 0x425, "_func_425" }, - { 0x426, "_func_426" }, - { 0x427, "_func_427" }, - { 0x428, "_func_428" }, - { 0x429, "_func_429" }, -}}; - -const std::array, 2032> method_list -{{ - { 0x8000, "addaieventlistener" }, - { 0x8001, "addontoviewmodel" }, - { 0x8002, "addpitch" }, - { 0x8003, "addroll" }, - { 0x8004, "addyaw" }, - { 0x8005, "adsbuttonpressed" }, - { 0x8006, "agentcanseesentient" }, - { 0x8007, "setaimstate" }, - { 0x8008, "aiphysicstrace" }, - { 0x8009, "aiphysicstracepassed" }, - { 0x800A, "allowads" }, - { 0x800B, "allowcrouch" }, - { 0x800C, "allowedstances" }, - { 0x800D, "allowfire" }, - { 0x800E, "allowjump" }, - { 0x800F, "allowlean" }, - { 0x8010, "allowmelee" }, - { 0x8011, "allowprone" }, - { 0x8012, "allowspectateteam" }, - { 0x8013, "allowsprint" }, - { 0x8014, "allowstand" }, - { 0x8015, "allowswim" }, - { 0x8016, "allowjog" }, - { 0x8017, "animcustom" }, - { 0x8018, "animmode" }, - { 0x8019, "animrelative" }, - { 0x801A, "animscripted" }, - { 0x801B, "animscriptedthirdperson" }, - { 0x801C, "anyammoforweaponmodes" }, - { 0x801D, "atdangerousnode" }, - { 0x801E, "attach" }, - { 0x801F, "attachpath" }, - { 0x8020, "attachshieldmodel" }, - { 0x8021, "attackbuttonpressed" }, - { 0x8022, "autoboltmissileeffects" }, - { 0x8023, "autospotoverlayoff" }, - { 0x8024, "autospotoverlayon" }, - { 0x8025, "beginlocationselection" }, - { 0x8026, "blendlinktoplayerviewmotion" }, - { 0x8027, "botcanseeentity" }, - { 0x8028, "botclearbutton" }, - { 0x8029, "botclearscriptenemy" }, - { 0x802A, "botclearscriptgoal" }, - { 0x802B, "botfindrandomgoal" }, - { 0x802C, "botfirstavailablegrenade" }, - { 0x802D, "botflagmemoryevents" }, - { 0x802E, "botgetdifficulty" }, - { 0x802F, "botgetdifficultysetting" }, - { 0x8030, "botgetentrancepoint" }, - { 0x8031, "botgetfovdot" }, - { 0x8032, "botgetfovdotz" }, - { 0x8033, "botgetimperfectenemyinfo" }, - { 0x8034, "botgetmemoryevents" }, - { 0x8035, "botgetnearestnode" }, - { 0x8036, "botgetnodesonpath" }, - { 0x8037, "botgetnegotiationstartnode" }, - { 0x8038, "botgetpathdist" }, - { 0x8039, "botgetpersonality" }, - { 0x803A, "botgetscriptgoal" }, - { 0x803B, "botgetscriptgoalnode" }, - { 0x803C, "botgetscriptgoalradius" }, - { 0x803D, "botgetscriptgoaltype" }, - { 0x803E, "botgetscriptgoalyaw" }, - { 0x803F, "botgetworldclosestedge" }, - { 0x8040, "botgetworldsize" }, - { 0x8041, "bothasscriptgoal" }, - { 0x8042, "botisrandomized" }, - { 0x8043, "botisdoingaisearch" }, - { 0x8044, "botlookatpoint" }, - { 0x8045, "botmemoryevent" }, - { 0x8046, "botmemoryselectpos" }, - { 0x8047, "botnodeavailable" }, - { 0x8048, "botnodepick" }, - { 0x8049, "botnodepickmultiple" }, - { 0x804A, "botnodescoremultiple" }, - { 0x804B, "botpredictenemycampspots" }, - { 0x804C, "botpredictseepoint" }, - { 0x804D, "botpressbutton" }, - { 0x804E, "botpursuingscriptgoal" }, - { 0x804F, "botsetattacker" }, - { 0x8050, "botsetawareness" }, - { 0x8051, "botsetdifficulty" }, - { 0x8052, "botsetdifficultysetting" }, - { 0x8053, "botsetflag" }, - { 0x8054, "botsetpathingstyle" }, - { 0x8055, "botsetpersonality" }, - { 0x8056, "botsetscriptenemy" }, - { 0x8057, "botsetscriptgoal" }, - { 0x8058, "botsetscriptgoalnode" }, - { 0x8059, "botsetscriptmove" }, - { 0x805A, "botsetstance" }, - { 0x805B, "botthrowscriptedgrenade" }, - { 0x805C, "botisthrowingscriptedgrenade" }, - { 0x805D, "buttonpressed" }, - { 0x805E, "cameralinkto" }, - { 0x805F, "cameraunlink" }, - { 0x8060, "canattackenemynode" }, - { 0x8061, "canattackenemynodefromexposed" }, - { 0x8062, "cancelmantle" }, - { 0x8063, "canmantle" }, - { 0x8064, "canplayerplacesentry" }, - { 0x8065, "canplayerplacetank" }, - { 0x8066, "cansee" }, - { 0x8067, "canshoot" }, - { 0x8068, "canshootenemy" }, - { 0x8069, "canspawnbotortestclient" }, - { 0x806A, "canuseturret" }, - { 0x806B, "capturnrate" }, - { 0x806C, "castdistantshadows" }, - { 0x806D, "castshadows" }, - { 0x806E, "castspotshadows" }, - { 0x806F, "changefontscaleovertime" }, - { 0x8070, "checkgrenadelaunch" }, - { 0x8071, "checkgrenadelaunchpos" }, - { 0x8072, "checkgrenadethrow" }, - { 0x8073, "checkgrenadethrowpos" }, - { 0x8074, "checkprone" }, - { 0x8075, "clearalltextafterhudelem" }, - { 0x8076, "clearanim" }, - { 0x8077, "clearclienttriggeraudiozone" }, - { 0x8078, "clearenemy" }, - { 0x8079, "clearentitytarget" }, - { 0x807A, "clearfixednodesafevolume" }, - { 0x807B, "cleargoalvolume" }, - { 0x807C, "cleargoalyaw" }, - { 0x807D, "clearlookatent" }, - { 0x807E, "clearperks" }, - { 0x807F, "clearpitchorient" }, - { 0x8080, "clearportableradar" }, - { 0x8081, "clearpotentialthreat" }, - { 0x8082, "clearpriorityclienttriggeraudiozone" }, - { 0x8083, "clearscrambler" }, - { 0x8084, "cleartargetent" }, - { 0x8085, "cleartargetentity" }, - { 0x8086, "cleartargetyaw" }, - { 0x8087, "clearturrettarget" }, - { 0x8088, "clearviewmodeladdons" }, - { 0x8089, "clientclaimtrigger" }, - { 0x808A, "clientreleasetrigger" }, - { 0x808B, "cloneagent" }, - { 0x808C, "clonebrushmodeltoscriptmodel" }, - { 0x808D, "cloneplayer" }, - { 0x808E, "closeingamemenu" }, - { 0x808F, "closemenu" }, - { 0x8090, "closepopupmenu" }, - { 0x8091, "connectnode" }, - { 0x8092, "connectpaths" }, - { 0x8093, "controlslinkto" }, - { 0x8094, "controlsunlink" }, - { 0x8095, "damageconetrace" }, - { 0x8096, "deactivateallocclusion" }, - { 0x8097, "deactivateeq" }, - { 0x8098, "deactivateocclusion" }, - { 0x8099, "deactivatereverb" }, - { 0x809A, "delete" }, - { 0x809B, "destroy" }, - { 0x809C, "detach" }, - { 0x809D, "detachall" }, - { 0x809E, "detachshieldmodel" }, - { 0x809F, "detonate" }, - { 0x80A0, "digitaldistortsetparams" }, - { 0x80A1, "disableaimassist" }, - { 0x80A2, "disableautoreload" }, - { 0x80A3, "disablebreaching" }, - { 0x80A4, "disableforcethirdpersonwhenspectating" }, - { 0x80A5, "disableforcehelmetwhenspectating" }, - { 0x80A6, "disableforceviewmodeldof" }, - { 0x80A7, "disablegrenadetouchdamage" }, - { 0x80A8, "disableinvulnerability" }, - { 0x80A9, "disablemissileboosting" }, - { 0x80AA, "disablemissilestick" }, - { 0x80AB, "disableoffhandweapons" }, - { 0x80AC, "disableplayeruse" }, - { 0x80AD, "disableslowaim" }, - { 0x80AE, "disableturretdismount" }, - { 0x80AF, "disableusability" }, - { 0x80B0, "disableweaponpickup" }, - { 0x80B1, "disableweapons" }, - { 0x80B2, "disableweaponswitch" }, - { 0x80B3, "disconnectnode" }, - { 0x80B4, "disconnectpaths" }, - { 0x80B5, "dismountvehicle" }, - { 0x80B6, "dockmovingplatform" }, - { 0x80B7, "dodamage" }, - { 0x80B8, "doesnodeallowstance" }, - { 0x80B9, "setcovermultinodetype" }, - { 0x80BA, "iscovermultinode" }, - { 0x80BB, "reevaluatemultinode" }, - { 0x80BC, "dontcastdistantshadows" }, - { 0x80BD, "dontcastshadows" }, - { 0x80BE, "dontinterpolate" }, - { 0x80BF, "dospawn" }, - { 0x80C0, "drivevehicleandcontrolturret" }, - { 0x80C1, "drivevehicleandcontrolturretoff" }, - { 0x80C2, "dropitem" }, - { 0x80C3, "dropscavengerbag" }, - { 0x80C4, "dropweapon" }, - { 0x80C5, "emissiveblend" }, - { 0x80C6, "setclientloadoutinfo" }, - { 0x80C7, "setclientextrasuper" }, - { 0x80C8, "setclientweaponinfo" }, - { 0x80C9, "setkillstreakpoints" }, - { 0x80CA, "setnextkillstreakcost" }, - { 0x80CB, "setgametypevip" }, - { 0x80CC, "getgametypevip" }, - { 0x80CD, "setnoteworthykillstreakactive" }, - { 0x80CE, "getnoteworthykillstreakactive" }, - { 0x80CF, "setspecialactive" }, - { 0x80D0, "getspecialactive" }, - { 0x80D1, "enableaimassist" }, - { 0x80D2, "enableanimstate" }, - { 0x80D3, "enableautoreload" }, - { 0x80D4, "enablebreaching" }, - { 0x80D5, "enabledeathshield" }, - { 0x80D6, "enableequipdeployvfx" }, - { 0x80D7, "enableforceviewmodeldof" }, - { 0x80D8, "enablegrenadetouchdamage" }, - { 0x80D9, "enablehealthshield" }, - { 0x80DA, "enableinvulnerability" }, - { 0x80DB, "enablelinkto" }, - { 0x80DC, "enablemissileboosting" }, - { 0x80DD, "enablemissilestick" }, - { 0x80DE, "enablemousesteer" }, - { 0x80DF, "enableoffhandweapons" }, - { 0x80E0, "enableplayeruse" }, - { 0x80E1, "enableslowaim" }, - { 0x80E2, "enableturretdismount" }, - { 0x80E3, "enableusability" }, - { 0x80E4, "enableweaponpickup" }, - { 0x80E5, "enableweapons" }, - { 0x80E6, "enableweaponswitch" }, - { 0x80E7, "endlocationselection" }, - { 0x80E8, "enterprone" }, - { 0x80E9, "exitprone" }, - { 0x80EA, "fadeoutshellshock" }, - { 0x80EB, "fadeovertime" }, - { 0x80EC, "findbestcovernode" }, - { 0x80ED, "findcovernode" }, - { 0x80EE, "findnearbycovernode" }, - { 0x80EF, "findreacquiredirectpath" }, - { 0x80F0, "findshufflecovernode" }, - { 0x80F1, "finishagentdamage" }, - { 0x80F2, "finishplayerdamage" }, - { 0x80F3, "fireweapon" }, - { 0x80F4, "flagenemyunattackable" }, - { 0x80F5, "forcedeathfall" }, - { 0x80F6, "forcemantle" }, - { 0x80F7, "forcemovingplatformentity" }, - { 0x80F8, "forcestartnegotiation" }, - { 0x80F9, "forceteleport" }, - { 0x80FA, "forcethirdpersonwhenspectating" }, - { 0x80FB, "forcehelmetwhenspectating" }, - { 0x80FC, "forceusehintoff" }, - { 0x80FD, "forceusehinton" }, - { 0x80FE, "forceviewmodelanimation" }, - { 0x80FF, "fragbuttonpressed" }, - { 0x8100, "freeentitysentient" }, - { 0x8101, "makecorpse" }, - { 0x8102, "suspendvehicle" }, - { 0x8103, "wakeupvehicle" }, - { 0x8104, "issuspendedvehicle" }, - { 0x8105, "freezecontrols" }, - { 0x8106, "freezelookcontrols" }, - { 0x8107, "getaimangle" }, - { 0x8108, "getweaponhudiconoverrideammo" }, - { 0x8109, "getammocount" }, - { 0x810A, "getammotype" }, - { 0x810B, "getanglestolikelyenemypath" }, - { 0x810C, "getanimentry" }, - { 0x810D, "getanimindexfromalias" }, - { 0x810E, "hasanimalias" }, - { 0x810F, "getanimentrycount" }, - { 0x8110, "getanimentryname" }, - { 0x8111, "getanimtime" }, - { 0x8112, "getanimweight" }, - { 0x8113, "getanimrate" }, - { 0x8114, "getattachignorecollision" }, - { 0x8115, "getattachmodelname" }, - { 0x8116, "getattachpos" }, - { 0x8117, "getattachsize" }, - { 0x8118, "getattachtagname" }, - { 0x8119, "getbarrelspinrate" }, - { 0x811A, "getbobrate" }, - { 0x811B, "getcentroid" }, - { 0x811C, "getclanidhigh" }, - { 0x811D, "getclanidlow" }, - { 0x811E, "getskill" }, - { 0x811F, "getclanwarsbonus" }, - { 0x8120, "getclosestenemysqdist" }, - { 0x8121, "getcorpseanim" }, - { 0x8122, "getcorpseentity" }, - { 0x8123, "getcovernode" }, - { 0x8124, "getcurrentoffhand" }, - { 0x8125, "getcurrentprimaryweapon" }, - { 0x8126, "getcurrentweapon" }, - { 0x8127, "getcurrentweaponclipammo" }, - { 0x8128, "getcustomizationbody" }, - { 0x8129, "getcustomizationhead" }, - { 0x812A, "getcustomizationviewmodel" }, - { 0x812B, "getdroptofloorposition" }, - { 0x812C, "getenemyinfo" }, - { 0x812D, "getenemysqdist" }, - { 0x812E, "getentitynumber" }, - { 0x812F, "getentityvelocity" }, - { 0x8130, "geteye" }, - { 0x8131, "getfireteammembers" }, - { 0x8132, "getfixednodesafevolume" }, - { 0x8133, "getfractionmaxammo" }, - { 0x8134, "getfractionstartammo" }, - { 0x8135, "getgoalspeedmph" }, - { 0x8136, "getgoalvolume" }, - { 0x8137, "getgroundenttype" }, - { 0x8138, "getguid" }, - { 0x8139, "gethighestnodestance" }, - { 0x813A, "gethybridscopestate" }, - { 0x813B, "getistouchingentities" }, - { 0x813C, "getjointype" }, - { 0x813D, "getlightcolor" }, - { 0x813E, "getlightfovinner" }, - { 0x813F, "getlightfovouter" }, - { 0x8140, "getlightintensity" }, - { 0x8141, "getlightuvintensity" }, - { 0x8142, "getlightradius" }, - { 0x8143, "getlinkedchildren" }, - { 0x8144, "getlinkedparent" }, - { 0x8145, "getlocalplayerprofiledata" }, - { 0x8146, "getlookaheaddir" }, - { 0x8147, "getmlgspectatorteam" }, - { 0x8148, "setmlgspectatorfromlobbydata" }, - { 0x8149, "ismlgfollower" }, - { 0x814A, "getmode" }, - { 0x814B, "getmotionangle" }, - { 0x814C, "getmotiontrackervisible" }, - { 0x814D, "getmovingplatformparent" }, - { 0x814E, "getmuzzleangle" }, - { 0x814F, "getmuzzlepos" }, - { 0x8150, "getmuzzlesideoffsetpos" }, - { 0x8151, "getnearestnode" }, - { 0x8152, "getnegotiationendnode" }, - { 0x8153, "getnegotiationendpos" }, - { 0x8154, "getnegotiationstartnode" }, - { 0x8155, "getnodenumber" }, - { 0x8156, "getnonstick" }, - { 0x8157, "getnormalhealth" }, - { 0x8158, "getnormalizedcameramovement" }, - { 0x8159, "getnormalizedmovement" }, - { 0x815A, "getoffhandprimaryclass" }, - { 0x815B, "getoffhandsecondaryclass" }, - { 0x815C, "getorigin" }, - { 0x815D, "getpathgoalpos" }, - { 0x815E, "getplayerangles" }, - { 0x815F, "getplayeruseentity" }, - { 0x8160, "getplayerdata" }, - { 0x8161, "getplayerintelisfound" }, - { 0x8162, "getplayerknifemodel" }, - { 0x8163, "getplayersetting" }, - { 0x8164, "getplayerssightingme" }, - { 0x8165, "getplayerviewheight" }, - { 0x8166, "getplayerweaponmodel" }, - { 0x8167, "getpointinbounds" }, - { 0x8168, "getrestedtime" }, - { 0x8169, "getshootatpos" }, - { 0x816A, "getsightedplayers" }, - { 0x816B, "getspectatingplayer" }, - { 0x816C, "getstance" }, - { 0x816D, "gettagangles" }, - { 0x816E, "gettagorigin" }, - { 0x816F, "tagexists" }, - { 0x8170, "gettargetentity" }, - { 0x8171, "getthirdpersoncrosshairoffset" }, - { 0x8172, "getthreatbiasgroup" }, - { 0x8173, "getturret" }, - { 0x8174, "getturretowner" }, - { 0x8175, "getturrettarget" }, - { 0x8176, "getturretweaponinfo" }, - { 0x8177, "getucdidhigh" }, - { 0x8178, "getucdidlow" }, - { 0x8179, "getvalidcoverpeekouts" }, - { 0x817A, "getvalidcovermultinodetypes" }, - { 0x817B, "getvehicleowner" }, - { 0x817C, "getownedvehicle" }, - { 0x817D, "getvelocity" }, - { 0x817E, "getviewkickscale" }, - { 0x817F, "getviewmodel" }, - { 0x8180, "getvieworigin" }, - { 0x8181, "getweaponammoclip" }, - { 0x8182, "getweaponammostock" }, - { 0x8183, "getweaponhudiconoverride" }, - { 0x8184, "getweaponslist" }, - { 0x8185, "getweaponslistall" }, - { 0x8186, "getweaponslistexclusives" }, - { 0x8187, "getweaponslistitems" }, - { 0x8188, "getweaponslistoffhands" }, - { 0x8189, "getweaponslistprimaries" }, - { 0x818A, "getweaponslistmodelonly" }, - { 0x818B, "getwheelsurface" }, - { 0x818C, "getxuid" }, - { 0x818D, "giveachievement" }, - { 0x818E, "givemaxammo" }, - { 0x818F, "givestartammo" }, - { 0x8190, "giveweapon" }, - { 0x8191, "glanceatentity" }, - { 0x8192, "glanceatpos" }, - { 0x8193, "hasenemybeenseen" }, - { 0x8194, "hasfemalecustomizationmodel" }, - { 0x8195, "hasloadedcustomizationplayerview" }, - { 0x8196, "hasperk" }, - { 0x8197, "hasweapon" }, - { 0x8198, "hide" }, - { 0x8199, "hideallparts" }, - { 0x819A, "hidehud" }, - { 0x819B, "hideonclient" }, - { 0x819C, "hidepart" }, - { 0x819D, "hidepart_allinstances" }, - { 0x819E, "hidepartandchildren_allinstances" }, - { 0x819F, "hideviewmodel" }, - { 0x81A0, "hudoutlinedisable" }, - { 0x81A1, "hudoutlinedisableforclient" }, - { 0x81A2, "hudoutlinedisableforclients" }, - { 0x81A3, "hudoutlineenable" }, - { 0x81A4, "hudoutlineenableforclient" }, - { 0x81A5, "hudoutlineenableforclients" }, - { 0x81A6, "hudoutlineviewmodelenable" }, - { 0x81A7, "hudoutlineviewmodeldisable" }, - { 0x81A8, "initriotshieldhealth" }, - { 0x81A9, "invisiblenotsolid" }, - { 0x81AA, "iprintln" }, - { 0x81AB, "iprintlnbold" }, - { 0x81AC, "isbadguy" }, - { 0x81AD, "iscovervalidagainstenemy" }, - { 0x81AE, "isdualwielding" }, - { 0x81AF, "isenemyaware" }, - { 0x81B0, "iseqenabled" }, - { 0x81B1, "isfireteamleader" }, - { 0x81B2, "isfiring" }, - { 0x81B3, "isfiringturret" }, - { 0x81B4, "isfiringvehicleturret" }, - { 0x81B5, "isgrenadepossafe" }, - { 0x81B6, "ishost" }, - { 0x81B7, "isindoor" }, - { 0x81B8, "isingoal" }, - { 0x81B9, "isinscriptedstate" }, - { 0x81BA, "isitemunlocked" }, - { 0x81BB, "isknownenemyinradius" }, - { 0x81BC, "isknownenemyinvolume" }, - { 0x81BD, "isleaning" }, - { 0x81BE, "islinked" }, - { 0x81BF, "islookingat" }, - { 0x81C0, "ismantling" }, - { 0x81C1, "ismeleeing" }, - { 0x81C2, "getmeleeattacktype" }, - { 0x81C3, "getmeleeattackvariant" }, - { 0x81C4, "getmeleeattackisalternate" }, - { 0x81C5, "ismlgspectator" }, - { 0x81C6, "ismovementfromgamepad" }, - { 0x81C7, "ismovesuppressed" }, - { 0x81C8, "isocclusionenabled" }, - { 0x81C9, "isoffhandweaponreadytothrow" }, - { 0x81CA, "isonground" }, - { 0x81CB, "isonladder" }, - { 0x81CC, "setbountycount" }, - { 0x81CD, "setperkicon" }, - { 0x81CE, "setsquadindex" }, - { 0x81CF, "getlobbysquadindex" }, - { 0x81D0, "ispathdirect" }, - { 0x81D1, "isragdoll" }, - { 0x81D2, "isreloading" }, - { 0x81D3, "issighted" }, - { 0x81D4, "issplitscreenplayer" }, - { 0x81D5, "issplitscreenplayerprimary" }, - { 0x81D6, "getothersplitscreenplayer" }, - { 0x81D7, "issprinting" }, - { 0x81D8, "issprintsliding" }, - { 0x81D9, "isstanceallowed" }, - { 0x81DA, "issuppressed" }, - { 0x81DB, "issuppressionwaiting" }, - { 0x81DC, "isswitchingweapon" }, - { 0x81DD, "israisingweapon" }, - { 0x81DE, "isdroppingweapon" }, - { 0x81DF, "istalking" }, - { 0x81E0, "isthrowinggrenade" }, - { 0x81E1, "istouching" }, - { 0x81E2, "istriggerenabled" }, - { 0x81E3, "isturretready" }, - { 0x81E4, "isusingonlinedataoffline" }, - { 0x81E5, "isusingturret" }, - { 0x81E6, "iswaitingonsound" }, - { 0x81E7, "itemweaponsetammo" }, - { 0x81E8, "joltbody" }, - { 0x81E9, "jumpbuttonpressed" }, - { 0x81EA, "kc_regweaponforfxremoval" }, - { 0x81EB, "kill" }, - { 0x81EC, "laseraltoff" }, - { 0x81ED, "laseralton" }, - { 0x81EE, "laseraltviewoff" }, - { 0x81EF, "laseraltviewon" }, - { 0x81F0, "laserforceoff" }, - { 0x81F1, "laserforceon" }, - { 0x81F2, "laserhidefromclient" }, - { 0x81F3, "laseroff" }, - { 0x81F4, "laseron" }, - { 0x81F5, "lastknownpos" }, - { 0x81F6, "lastknowntime" }, - { 0x81F7, "laststandrevive" }, - { 0x81F8, "launch" }, - { 0x81F9, "lerpfov" }, - { 0x81FA, "lerpfovscalefactor" }, - { 0x81FB, "lerpviewangleclamp" }, - { 0x81FC, "linkto" }, - { 0x81FD, "linktoblendtotag" }, - { 0x81FE, "linktomoveoffset" }, - { 0x81FF, "linktoplayerview" }, - { 0x8200, "linktoplayerviewfollowremoteeyes" }, - { 0x8201, "linktoplayerviewignoreparentrot" }, - { 0x8202, "linkwaypointtotargetwithoffset" }, - { 0x8203, "loadcustomizationplayerview" }, - { 0x8204, "localtoworldcoords" }, - { 0x8205, "logmatchdatadeath" }, - { 0x8206, "logclientmatchdatadeath" }, - { 0x8207, "logplayerendmatchdata" }, - { 0x8208, "logmatchdatalife" }, - { 0x8209, "logstring" }, - { 0x820A, "magicgrenade" }, - { 0x820B, "magicgrenademanual" }, - { 0x820C, "makecollidewithitemclip" }, - { 0x820D, "makeentitynomeleetarget" }, - { 0x820E, "makeentitysentient" }, - { 0x820F, "makefakeai" }, - { 0x8210, "makeportableradar" }, - { 0x8211, "makescrambler" }, - { 0x8212, "maketurretinoperable" }, - { 0x8213, "maketurretoperable" }, - { 0x8214, "makeunusable" }, - { 0x8215, "makeusable" }, - { 0x8216, "makevehiclesolid" }, - { 0x8217, "makevehiclesolidcapsule" }, - { 0x8218, "makevehiclesolidsphere" }, - { 0x8219, "markforeyeson" }, - { 0x821A, "maymovefrompointtopoint" }, - { 0x821B, "maymovetopoint" }, - { 0x821C, "melee" }, - { 0x821D, "meleebuttonpressed" }, - { 0x821E, "missile_cleartarget" }, - { 0x821F, "missile_setflightmodedirect" }, - { 0x8220, "missile_setflightmodetop" }, - { 0x8221, "missile_settargetent" }, - { 0x8222, "missile_settargetpos" }, - { 0x8223, "motionblurhqdisable" }, - { 0x8224, "motionblurhqenable" }, - { 0x8225, "mountvehicle" }, - { 0x8226, "movegravity" }, - { 0x8227, "moveovertime" }, - { 0x8228, "moveshieldmodel" }, - { 0x8229, "moveslide" }, - { 0x822A, "moveto" }, - { 0x822B, "movex" }, - { 0x822C, "movey" }, - { 0x822D, "movez" }, - { 0x822E, "nearclaimnode" }, - { 0x822F, "nearclaimnodeandangle" }, - { 0x8230, "nearnode" }, - { 0x8231, "newpip" }, - { 0x8232, "nightvisiongogglesforceoff" }, - { 0x8233, "nightvisiongogglesforceon" }, - { 0x8234, "nightvisionviewoff" }, - { 0x8235, "activatenightvisionblind" }, - { 0x8236, "setnightvisionblindweight" }, - { 0x8237, "nightvisionviewon" }, - { 0x8238, "nodeisdisconnected" }, - { 0x8239, "notifyonplayercommand" }, - { 0x823A, "notifyonplayercommandremove" }, - { 0x823B, "notsolid" }, - { 0x823C, "openmenu" }, - { 0x823D, "openpopupmenu" }, - { 0x823E, "openpopupmenunomouse" }, - { 0x823F, "orientmode" }, - { 0x8240, "painvisionoff" }, - { 0x8241, "painvisionon" }, - { 0x8242, "physicslaunchclient" }, - { 0x8243, "physicslaunchserver" }, - { 0x8244, "physicslaunchserveritem" }, - { 0x8245, "physicswarpto" }, - { 0x8246, "pickupgrenade" }, - { 0x8247, "pingplayer" }, - { 0x8248, "placespawnpoint" }, - { 0x8249, "playcontextsound" }, - { 0x824A, "player_recoilscaleoff" }, - { 0x824B, "player_recoilscaleon" }, - { 0x824C, "playerads" }, - { 0x824D, "playerclearstreamorigin" }, - { 0x824E, "playerforcedeathanim" }, - { 0x824F, "playerhide" }, - { 0x8250, "playerlinkedoffsetdisable" }, - { 0x8251, "playerlinkedoffsetenable" }, - { 0x8252, "playerlinkedsetforceparentvisible" }, - { 0x8253, "playerlinkedsetusebaseangleforviewclamp" }, - { 0x8254, "playerlinkedsetviewznear" }, - { 0x8255, "playerlinkedturretanglesdisable" }, - { 0x8256, "playerlinkedturretanglesenable" }, - { 0x8257, "playerlinkeduselinkedvelocity" }, - { 0x8258, "playerlinkto" }, - { 0x8259, "playerlinktoabsolute" }, - { 0x825A, "playerlinktoblend" }, - { 0x825B, "playerlinktodelta" }, - { 0x825C, "playerlinkweaponviewtodelta" }, - { 0x825D, "playermount" }, - { 0x825E, "playermounttype" }, - { 0x825F, "playersetgroundreferenceent" }, - { 0x8260, "playersetstreamorigin" }, - { 0x8261, "playexplosionsound" }, - { 0x8262, "playfx" }, - { 0x8263, "playlocalsound" }, - { 0x8264, "playloopsound" }, - { 0x8265, "playrumblelooponentity" }, - { 0x8266, "playrumbleonentity" }, - { 0x8267, "playrumbleonpositionforclient" }, - { 0x8268, "playrumblelooponpositionforclient" }, - { 0x8269, "playsound" }, - { 0x826A, "playsoundatviewheight" }, - { 0x826B, "playsoundonmovingent" }, - { 0x826C, "playsoundtoplayer" }, - { 0x826D, "playsoundtoteam" }, - { 0x826E, "playsurfacesound" }, - { 0x826F, "predictstreampos" }, - { 0x8270, "clearpredictedstreampos" }, - { 0x8271, "ispredictedstreamposready" }, - { 0x8272, "pushplayer" }, - { 0x8273, "pushplayervector" }, - { 0x8274, "queuedialogforplayer" }, - { 0x8275, "radiusdamage" }, - { 0x8276, "reacquiremove" }, - { 0x8277, "reacquirestep" }, - { 0x8278, "registerparty" }, - { 0x8279, "releaseclaimedtrigger" }, - { 0x827A, "remotecamerasoundscapeoff" }, - { 0x827B, "remotecamerasoundscapeon" }, - { 0x827C, "remotecontrolturret" }, - { 0x827D, "remotecontrolturretoff" }, - { 0x827E, "controlturreton" }, - { 0x827F, "controlturretoff" }, - { 0x8280, "remotecontrolvehicle" }, - { 0x8281, "remotecontrolvehicleoff" }, - { 0x8282, "remotecontrolvehicletarget" }, - { 0x8283, "remotecontrolvehicletargetoff" }, - { 0x8284, "removeaieventlistener" }, - { 0x8285, "removefrommovingplatformsystem" }, - { 0x8286, "reset" }, - { 0x8287, "resetspreadoverride" }, - { 0x8288, "restoredefaultdroppitch" }, - { 0x8289, "resumespeed" }, - { 0x828A, "setlookaheadtime" }, - { 0x828B, "getlookaheadtime" }, - { 0x828C, "returnplayercontrol" }, - { 0x828D, "ridevehicle" }, - { 0x828E, "rotateby" }, - { 0x828F, "rotatebylinked" }, - { 0x8290, "rotateovertime" }, - { 0x8291, "rotatepitch" }, - { 0x8292, "rotateroll" }, - { 0x8293, "rotateto" }, - { 0x8294, "rotatetolinked" }, - { 0x8295, "rotatevelocity" }, - { 0x8296, "rotateyaw" }, - { 0x8297, "safeteleport" }, - { 0x8298, "savematchrulestohistory" }, - { 0x8299, "sayall" }, - { 0x829A, "sayteam" }, - { 0x829B, "scaleovertime" }, - { 0x829C, "scalepitch" }, - { 0x829D, "scalevolume" }, - { 0x829E, "scragentbeginmelee" }, - { 0x829F, "scragentclaimnode" }, - { 0x82A0, "scragentdoanimlerp" }, - { 0x82A1, "scragentdoanimrelative" }, - { 0x82A2, "scragentdotrajectory" }, - { 0x82A3, "scragentgetgoalpos" }, - { 0x82A4, "scragentgetmaxturnspeed" }, - { 0x82A5, "scragentrelinquishclaimednode" }, - { 0x82A6, "scragentsetanimmode" }, - { 0x82A7, "scragentsetanimscale" }, - { 0x82A8, "scragentsetclipmode" }, - { 0x82A9, "scragentsetgoalentity" }, - { 0x82AA, "scragentsetgoalnode" }, - { 0x82AB, "scragentsetgoalpos" }, - { 0x82AC, "scragentsetgoalradius" }, - { 0x82AD, "scragentsetmaxturnspeed" }, - { 0x82AE, "scragentsetorientmode" }, - { 0x82AF, "scragentsetphysicsmode" }, - { 0x82B0, "scragentsetscripted" }, - { 0x82B1, "scragentsetunittype" }, - { 0x82B2, "scragentsetviewheight" }, - { 0x82B3, "scragentsetwallruncost" }, - { 0x82B4, "scragentsetwaypoint" }, - { 0x82B5, "scragentusemodelcollisionbounds" }, - { 0x82B6, "screenshakeonentity" }, - { 0x82B7, "scriptmodelclearanim" }, - { 0x82B8, "scriptmodelplayanim" }, - { 0x82B9, "scriptmodelplayanimdeltamotion" }, - { 0x82BA, "secondaryoffhandbuttonpressed" }, - { 0x82BB, "seerecently" }, - { 0x82BC, "sendleaderboards" }, - { 0x82BD, "setacceleration" }, - { 0x82BE, "setactionslot" }, - { 0x82BF, "setagentattacker" }, - { 0x82C0, "setaimspreadmovementscale" }, - { 0x82C1, "setairresistance" }, - { 0x82C2, "setaispread" }, - { 0x82C3, "setalienjumpcostscale" }, - { 0x82C4, "setalienruncostscale" }, - { 0x82C5, "setalientraversecostscale" }, - { 0x82C6, "setanim" }, - { 0x82C7, "setanimclass" }, - { 0x82C8, "setanimknob" }, - { 0x82C9, "setanimknoball" }, - { 0x82CA, "setanimknoballlimited" }, - { 0x82CB, "setanimknoballlimitedrestart" }, - { 0x82CC, "setanimknoballrestart" }, - { 0x82CD, "setanimknoblimited" }, - { 0x82CE, "setanimknoblimitedrestart" }, - { 0x82CF, "setanimknobrestart" }, - { 0x82D0, "setanimlimited" }, - { 0x82D1, "setanimlimitedrestart" }, - { 0x82D2, "setanimrestart" }, - { 0x82D3, "setanimstate" }, - { 0x82D4, "setanimtime" }, - { 0x82D5, "setanimrate" }, - { 0x82D6, "setanimblendcurve" }, - { 0x82D7, "setcustomnodegameparameter" }, - { 0x82D8, "isanimlooping" }, - { 0x82D9, "setautopickup" }, - { 0x82DA, "setautorotationdelay" }, - { 0x82DB, "setblurforplayer" }, - { 0x82DC, "setbobrate" }, - { 0x82DD, "setbottomarc" }, - { 0x82DE, "setcandamage" }, - { 0x82DF, "setcanradiusdamage" }, - { 0x82E0, "setcarddisplayslot" }, - { 0x82E1, "setchargemeleehudvisible" }, - { 0x82E2, "setclientdvar" }, - { 0x82E3, "setclientdvars" }, - { 0x82E4, "setclientomnvar" }, - { 0x82E5, "setclientomnvarbit" }, - { 0x82E6, "setclientowner" }, - { 0x82E7, "setclienttriggeraudiozone" }, - { 0x82E8, "setclienttriggeraudiozonelerp" }, - { 0x82E9, "setclienttriggeraudiozonepartial" }, - { 0x82EA, "setclienttriggeraudiozonepartialwithfade" }, - { 0x82EB, "setclock" }, - { 0x82EC, "setclockup" }, - { 0x82ED, "setclothtype" }, - { 0x82EE, "setconvergenceheightpercent" }, - { 0x82EF, "setconvergencetime" }, - { 0x82F0, "setcorpsefalling" }, - { 0x82F1, "setcorpseremovetimer" }, - { 0x82F2, "getcorpsephysicsorigin" }, - { 0x82F3, "setcursorhint" }, - { 0x82F4, "setdamagestage" }, - { 0x82F5, "setdeceleration" }, - { 0x82F6, "setdefaultaimlimits" }, - { 0x82F7, "setdefaultdroppitch" }, - { 0x82F8, "setdepthoffield" }, - { 0x82F9, "setdistributed2dsound" }, - { 0x82FA, "setdronegoalpos" }, - { 0x82FB, "setempjammed" }, - { 0x82FC, "setengagementmaxdist" }, - { 0x82FD, "setengagementmindist" }, - { 0x82FE, "setentityowner" }, - { 0x82FF, "setentitytarget" }, - { 0x8300, "seteyesonuplinkenabled" }, - { 0x8301, "setfixednodesafevolume" }, - { 0x8302, "setflaggedanim" }, - { 0x8303, "setflaggedanimknob" }, - { 0x8304, "setflaggedanimknoball" }, - { 0x8305, "setflaggedanimknoballrestart" }, - { 0x8306, "setflaggedanimknoblimited" }, - { 0x8307, "setflaggedanimknoblimitedrestart" }, - { 0x8308, "setflaggedanimknobrestart" }, - { 0x8309, "setflaggedanimlimited" }, - { 0x830A, "setflaggedanimlimitedrestart" }, - { 0x830B, "setflaggedanimrestart" }, - { 0x830C, "setflashbanged" }, - { 0x830D, "setfxkilldefondelete" }, - { 0x830E, "setgoalentity" }, - { 0x830F, "setgoalnode" }, - { 0x8310, "setgoalpath" }, - { 0x8311, "setgoalpos" }, - { 0x8312, "setgoalvolume" }, - { 0x8313, "setgoalvolumeauto" }, - { 0x8314, "setgoalyaw" }, - { 0x8315, "setgrenadecookscale" }, - { 0x8316, "setgrenadethrowscale" }, - { 0x8317, "sethintstring" }, - { 0x8318, "sethoverparams" }, - { 0x8319, "sethuddynlight" }, - { 0x831A, "sethybridscopestate" }, - { 0x831B, "setjitterparams" }, - { 0x831C, "setleftarc" }, - { 0x831D, "setlightcolor" }, - { 0x831E, "setlightfovrange" }, - { 0x831F, "setlightintensity" }, - { 0x8320, "setlightuvintensity" }, - { 0x8321, "setlightradius" }, - { 0x8322, "setlinkedangles" }, - { 0x8323, "setlocalplayerprofiledata" }, - { 0x8324, "setlookat" }, - { 0x8325, "setlookatent" }, - { 0x8326, "setlookatentity" }, - { 0x8327, "setlookatstateoverride" }, - { 0x8328, "clearlookatstateoverride" }, - { 0x8329, "setlookattext" }, - { 0x832A, "setmantlesoundflavor" }, - { 0x832B, "setmaxpitchroll" }, - { 0x832C, "setmissileminimapvisible" }, - { 0x832D, "setmlgcameradefaults" }, - { 0x832E, "setmlgselectedcameraicon" }, - { 0x832F, "setmlgspectator" }, - { 0x8330, "setmode" }, - { 0x8331, "setmodel" }, - { 0x8332, "setmotiontrackervisible" }, - { 0x8333, "setmovespeedscale" }, - { 0x8334, "setmovingplatformplayerturnrate" }, - { 0x8335, "setmovingplatformtrigger" }, - { 0x8336, "setneargoalnotifydist" }, - { 0x8337, "setnodeploy" }, - { 0x8338, "setnonstick" }, - { 0x8339, "setnormalhealth" }, - { 0x833A, "setocclusion" }, - { 0x833B, "setocclusionfromtable" }, - { 0x833C, "setoffhandprimaryclass" }, - { 0x833D, "setoffhandsecondaryclass" }, - { 0x833E, "setorigin" }, - { 0x833F, "setotherent" }, - { 0x8340, "setperk" }, - { 0x8341, "setpitchorient" }, - { 0x8342, "setplayerangles" }, - { 0x8343, "setplayercorpsedone" }, - { 0x8344, "setplayerdata" }, - { 0x8345, "setplayerintelfound" }, - { 0x8346, "setplayernamestring" }, - { 0x8347, "setplayerspread" }, - { 0x8348, "setpotentialthreat" }, - { 0x8349, "setpriorityclienttriggeraudiozone" }, - { 0x834A, "setpriorityclienttriggeraudiozonepartial" }, - { 0x834B, "setpriorityclienttriggeraudiozonepartialwithfade" }, - { 0x834C, "setproneanimnodes" }, - { 0x834D, "setpulsefx" }, - { 0x834E, "setrank" }, - { 0x834F, "setreverb" }, - { 0x8350, "setreverbfromtable" }, - { 0x8351, "setrightarc" }, - { 0x8352, "setscriptabledamageowner" }, - { 0x8353, "setscriptablepartstate" }, - { 0x8354, "setscriptmoverkillcam" }, - { 0x8355, "setsentrycarrier" }, - { 0x8356, "setsentryowner" }, - { 0x8357, "setturretowner" }, - { 0x8358, "setshader" }, - { 0x8359, "setsoundblend" }, - { 0x835A, "settransientsoundbank" }, - { 0x835B, "setspawnerteam" }, - { 0x835C, "setspawnweapon" }, - { 0x835D, "setspeakermapmonoto51" }, - { 0x835E, "setspeakermapmonotostereo" }, - { 0x835F, "setspectatedefaults" }, - { 0x8360, "setspreadoverride" }, - { 0x8361, "setstablemissile" }, - { 0x8362, "setstance" }, - { 0x8363, "setsuppressiontime" }, - { 0x8364, "setsurfacetype" }, - { 0x8365, "setswitchnode" }, - { 0x8366, "settalktospecies" }, - { 0x8367, "settargetent" }, - { 0x8368, "settargetentity" }, - { 0x8369, "settargetyaw" }, - { 0x836A, "setteamfortrigger" }, - { 0x836B, "settenthstimer" }, - { 0x836C, "settenthstimerstatic" }, - { 0x836D, "settenthstimerup" }, - { 0x836E, "settext" }, - { 0x836F, "setthreatbiasgroup" }, - { 0x8370, "settimer" }, - { 0x8371, "settimerstatic" }, - { 0x8372, "settimerup" }, - { 0x8373, "settimescalefactorfromtable" }, - { 0x8374, "settoparc" }, - { 0x8375, "setturningability" }, - { 0x8376, "setturretanim" }, - { 0x8377, "setturretcanaidetach" }, - { 0x8378, "setturretdismountorg" }, - { 0x8379, "setturretfov" }, - { 0x837A, "setturretignoregoals" }, - { 0x837B, "setturretminimapvisible" }, - { 0x837C, "setturretmodechangewait" }, - { 0x837D, "setturrettargetent" }, - { 0x837E, "setturrettargetvec" }, - { 0x837F, "setturretteam" }, - { 0x8380, "setusepriority" }, - { 0x8381, "setuseprioritymax" }, - { 0x8382, "setvalue" }, - { 0x8383, "setvehgoalpos" }, - { 0x8384, "setvehiclelookattext" }, - { 0x8385, "setvehicleteam" }, - { 0x8386, "setvehweapon" }, - { 0x8387, "setvelocity" }, - { 0x8388, "setviewangleresistance" }, - { 0x8389, "setviewkickscale" }, - { 0x838A, "setviewmodel" }, - { 0x838B, "setviewmodeldepth" }, - { 0x838C, "setviewmodeldepthoffield" }, - { 0x838D, "setvisionparams" }, - { 0x838E, "setwaitnode" }, - { 0x838F, "setwaitspeed" }, - { 0x8390, "setwatersheeting" }, - { 0x8391, "setwaypoint" }, - { 0x8392, "setwaypointedgestyle_rotatingicon" }, - { 0x8393, "setwaypointedgestyle_secondaryarrow" }, - { 0x8394, "setwaypointiconoffscreenonly" }, - { 0x8395, "setweaponammoclip" }, - { 0x8396, "setweaponammostock" }, - { 0x8397, "setweaponhudiconoverride" }, - { 0x8398, "setweaponhudiconoverrideammo" }, - { 0x8399, "setweaponmodelvariant" }, - { 0x839A, "setyawspeed" }, - { 0x839B, "setyawspeedbyname" }, - { 0x839C, "shellshock" }, - { 0x839D, "shoot" }, - { 0x839E, "shootblank" }, - { 0x839F, "shootstopsound" }, - { 0x83A0, "shootturret" }, - { 0x83A1, "shouldearlyragdoll" }, - { 0x83A2, "shouldplaymeleedeathanim" }, - { 0x83A3, "show" }, - { 0x83A4, "showallparts" }, - { 0x83A5, "showhud" }, - { 0x83A6, "showhudsplash" }, - { 0x83A7, "showonclient" }, - { 0x83A8, "showpart" }, - { 0x83A9, "showonlytoplayer" }, - { 0x83AA, "showtoplayer" }, - { 0x83AB, "showviewmodel" }, - { 0x83AC, "sightconetrace" }, - { 0x83AD, "snaptotargetentity" }, - { 0x83AE, "solid" }, - { 0x83AF, "spawn" }, - { 0x83B0, "spawnagent" }, - { 0x83B1, "spawndrone" }, - { 0x83B2, "spawnbotortestclient" }, - { 0x83B3, "springcamdisabled" }, - { 0x83B4, "springcamenabled" }, - { 0x83B5, "stalingradspawn" }, - { 0x83B6, "startac130" }, - { 0x83B7, "startbarrelspin" }, - { 0x83B8, "startcoverarrival" }, - { 0x83B9, "startcoverbehavior" }, - { 0x83BA, "startfiring" }, - { 0x83BB, "startpath" }, - { 0x83BC, "startpathfind" }, - { 0x83BD, "startpathnodes" }, - { 0x83BE, "path_getcurrentnode" }, - { 0x83BF, "path_getcurrenttime" }, - { 0x83C0, "path_getcurrentnodetime" }, - { 0x83C1, "stoppath" }, - { 0x83C2, "pausepath" }, - { 0x83C3, "resumepath" }, - { 0x83C4, "startragdoll" }, - { 0x83C5, "startragdollfromimpact" }, - { 0x83C6, "startscriptedanim" }, - { 0x83C7, "starttraversearrival" }, - { 0x83C8, "startusingheroonlylighting" }, - { 0x83C9, "startusinglessfrequentlighting" }, - { 0x83CA, "stopac130" }, - { 0x83CB, "stopanimscripted" }, - { 0x83CC, "stopbarrelspin" }, - { 0x83CD, "stopfiring" }, - { 0x83CE, "stoplocalsound" }, - { 0x83CF, "stoplookat" }, - { 0x83D0, "stoploopsound" }, - { 0x83D1, "stopmoveslide" }, - { 0x83D2, "stopridingvehicle" }, - { 0x83D3, "stoprumble" }, - { 0x83D4, "stopshellshock" }, - { 0x83D5, "stopsliding" }, - { 0x83D6, "stopsoundchannel" }, - { 0x83D7, "stopsounds" }, - { 0x83D8, "stopuseanimtree" }, - { 0x83D9, "stopuseturret" }, - { 0x83DA, "stopusingheroonlylighting" }, - { 0x83DB, "stopusinglessfrequentlighting" }, - { 0x83DC, "stunplayer" }, - { 0x83DD, "suicide" }, - { 0x83DE, "switchtooffhand" }, - { 0x83DF, "switchtoweapon" }, - { 0x83E0, "switchtoweaponimmediate" }, - { 0x83E1, "takeallweapons" }, - { 0x83E2, "takeweapon" }, - { 0x83E3, "teleport" }, - { 0x83E4, "teleportentityrelative" }, - { 0x83E5, "thermaldrawdisable" }, - { 0x83E6, "thermaldrawenable" }, - { 0x83E7, "thermalvisionfofoverlayoff" }, - { 0x83E8, "thermalvisionfofoverlayon" }, - { 0x83E9, "thermalvisionoff" }, - { 0x83EA, "thermalvisionon" }, - { 0x83EB, "thermalvisiononshadowoff" }, - { 0x83EC, "throwgrenade" }, - { 0x83ED, "triggerenable" }, - { 0x83EE, "triggerdisable" }, - { 0x83EF, "turretfiredisable" }, - { 0x83F0, "turretfireenable" }, - { 0x83F1, "turretoverheatdisable" }, - { 0x83F2, "turretisoverheatdisabled" }, - { 0x83F3, "turretsetbarrelspinenabled" }, - { 0x83F4, "undockmovingplatform" }, - { 0x83F5, "unlink" }, - { 0x83F6, "unlinkfromplayerview" }, - { 0x83F7, "unsetperk" }, - { 0x83F8, "updateentitywithweapons" }, - { 0x83F9, "getentityweapons" }, - { 0x83FA, "updateplayersightaccuracy" }, - { 0x83FB, "updateprone" }, - { 0x83FC, "useanimtree" }, - { 0x83FD, "usebuttonpressed" }, - { 0x83FE, "isuseinprogress" }, - { 0x83FF, "isuseavailable" }, - { 0x8400, "useby" }, - { 0x8401, "usecovernode" }, - { 0x8402, "usehintsinvehicle" }, - { 0x8403, "usehintsonturret" }, - { 0x8404, "usetriggerrequirelookat" }, - { 0x8405, "useturret" }, - { 0x8406, "usinggamepad" }, - { 0x8407, "vehicle_canturrettargetpoint" }, - { 0x8408, "vehicle_dospawn" }, - { 0x8409, "vehicle_finishdamage" }, - { 0x840A, "vehicle_getbodyvelocity" }, - { 0x840B, "vehicle_getspeed" }, - { 0x840C, "vehicle_getsteering" }, - { 0x840D, "vehicle_getthrottle" }, - { 0x840E, "vehicle_getvelocity" }, - { 0x840F, "vehicle_getangularvelocity" }, - { 0x8410, "vehicle_helisetai" }, - { 0x8411, "vehicle_isphysveh" }, - { 0x8412, "vehicle_orientto" }, - { 0x8413, "vehicle_rotateyaw" }, - { 0x8414, "vehicle_setspeed" }, - { 0x8415, "vehicle_setspeedimmediate" }, - { 0x8416, "vehicle_teleport" }, - { 0x8417, "vehicle_turnengineoff" }, - { 0x8418, "vehicle_turnengineon" }, - { 0x8419, "rcplane_settopspeed" }, - { 0x841A, "rcplane_settopspeedboost" }, - { 0x841B, "rcplane_setminspeed" }, - { 0x841C, "vehicleattackbuttonpressed" }, - { 0x841D, "vehicledriveto" }, - { 0x841E, "vehicleturretcontroloff" }, - { 0x841F, "vehicleturretcontrolon" }, - { 0x8420, "vehicleusealtblendedaudio" }, - { 0x8421, "vehphys_crash" }, - { 0x8422, "vehphys_disablecrashing" }, - { 0x8423, "vehphys_enablecrashing" }, - { 0x8424, "vehphys_launch" }, - { 0x8425, "vehphys_setconveyorbelt" }, - { 0x8426, "vehphys_forcekeyframedmotion" }, - { 0x8427, "vehphys_setdefaultmotion" }, - { 0x8428, "vibrate" }, - { 0x8429, "viewkick" }, - { 0x842A, "visiblesolid" }, - { 0x842B, "visionsetfadetoblackforplayer" }, - { 0x842C, "visionsetmissilecamforplayer" }, - { 0x842D, "visionsetnakedforplayer" }, - { 0x842E, "visionsetnightforplayer" }, - { 0x842F, "visionsetpainforplayer" }, - { 0x8430, "visionsetalternateforplayer" }, - { 0x8431, "increaseplayerconsecutivekills" }, - { 0x8432, "resetplayerconsecutivekills" }, - { 0x8433, "setplayersupermeterprogress" }, - { 0x8434, "visionsetthermalforplayer" }, - { 0x8435, "weaponlockfinalize" }, - { 0x8436, "weaponlockfree" }, - { 0x8437, "weaponlocknoclearance" }, - { 0x8438, "weaponlockstart" }, - { 0x8439, "weaponlocktargettooclose" }, - { 0x843A, "willneverchange" }, - { 0x843B, "worldpointinreticle_circle" }, - { 0x843C, "worldpointinreticle_rect" }, - { 0x843D, "worldpointtoscreenpos" }, - { 0x843E, "getanimassettype" }, - { 0x843F, "getdebugeye" }, - { 0x8440, "getentnum" }, - { 0x8441, "noclip" }, - { 0x8442, "setdevtext" }, - { 0x8443, "ufo" }, - { 0x8444, "allowdodge" }, - { 0x8445, "allowhighjump" }, - { 0x8446, "allowboostjump" }, - { 0x8447, "isjumping" }, - { 0x8448, "ishighjumping" }, - { 0x8449, "setworldupreference" }, - { 0x844A, "physics_getnumbodies" }, - { 0x844B, "physics_getbodyid" }, - { 0x844C, "physics_getplayergroundlinvel" }, - { 0x844D, "physics_createinstance" }, - { 0x844E, "physics_takecontrol" }, - { 0x844F, "physics_applyimpulse" }, - { 0x8450, "pathdisttogoal" }, - { 0x8451, "clearpath" }, - { 0x8452, "setdodgemeter" }, - { 0x8453, "getdodgemeter" }, - { 0x8454, "allowdoublejump" }, - { 0x8455, "allowmovement" }, - { 0x8456, "allowwallrun" }, - { 0x8457, "allowslide" }, - { 0x8458, "findpath" }, - { 0x8459, "hidefromplayer" }, - { 0x845A, "energy_getenergy" }, - { 0x845B, "energy_setenergy" }, - { 0x845C, "energy_getmax" }, - { 0x845D, "energy_setmax" }, - { 0x845E, "energy_getresttimems" }, - { 0x845F, "energy_setresttimems" }, - { 0x8460, "energy_getuserate" }, - { 0x8461, "energy_setuserate" }, - { 0x8462, "energy_getrestorerate" }, - { 0x8463, "energy_setrestorerate" }, - { 0x8464, "physics_getcharactercollisioncapsule" }, - { 0x8465, "teleportworldupreferenceangles" }, - { 0x8466, "disableoffhandsecondaryweapons" }, - { 0x8467, "enableoffhandsecondaryweapons" }, - { 0x8468, "sprintbuttonpressed" }, - { 0x8469, "enemyincrosshairs" }, - { 0x846A, "crouchbuttonpressed" }, - { 0x846B, "isweaponsenabled" }, - { 0x846C, "physics_getentitymass" }, - { 0x846D, "physics_getentitydynamicmass" }, - { 0x846E, "physics_getentitycenterofmass" }, - { 0x846F, "physics_getentityaabb" }, - { 0x8470, "playgestureviewmodel" }, - { 0x8471, "stopgestureviewmodel" }, - { 0x8472, "getgestureanimlength" }, - { 0x8473, "createnavrepulsor3d" }, - { 0x8474, "destroynavrepulsor3d" }, - { 0x8475, "iswallrunning" }, - { 0x8476, "playershow" }, - { 0x8477, "isthrowingbackgrenade" }, - { 0x8478, "launchgrenade" }, - { 0x8479, "assignweaponoffhandprimary" }, - { 0x847A, "assignweaponoffhandsecondary" }, - { 0x847B, "clearoffhandprimary" }, - { 0x847C, "clearoffhandsecondary" }, - { 0x847D, "earthquakeforplayer" }, - { 0x847E, "assignweaponprimaryslot" }, - { 0x847F, "assignweaponheavyslot" }, - { 0x8480, "getweaponslot" }, - { 0x8481, "setsuit" }, - { 0x8482, "getgroundentity" }, - { 0x8483, "getposonpath" }, - { 0x8484, "setcamerathirdperson" }, - { 0x8485, "setentitysoundcontext" }, - { 0x8486, "setplayermusicstate" }, - { 0x8487, "getnavspaceent" }, - { 0x8488, "setdemeanorviewmodel" }, - { 0x8489, "getdemeanorviewmodel" }, - { 0x848A, "getgestureviewmodel" }, - { 0x848B, "forceplaygestureviewmodel" }, - { 0x848C, "isgesturelooped" }, - { 0x848D, "allowreload" }, - { 0x848E, "allowmounttop" }, - { 0x848F, "allowmountside" }, - { 0x8490, "allowmantle" }, - { 0x8491, "offhandstopclienteffects" }, - { 0x8492, "cleardamageindicators" }, - { 0x8493, "isgestureplaying" }, - { 0x8494, "visiblenotsolid" }, - { 0x8495, "destroydamagepart" }, - { 0x8496, "destroyalldamageparts" }, - { 0x8497, "getnearnodelistforspawncheck" }, - { 0x8498, "setbtgoalpos" }, - { 0x8499, "setbtgoalent" }, - { 0x849A, "setbtgoalnode" }, - { 0x849B, "setbtgoalvolume" }, - { 0x849C, "clearbtgoal" }, - { 0x849D, "btgoalvalid" }, - { 0x849E, "getsecondarytargets" }, - { 0x849F, "canmelee" }, - { 0x84A0, "sethitlocdamagetable" }, - { 0x84A1, "shootcustomweapon" }, - { 0x84A2, "playerunlinkonjump" }, - { 0x84A3, "sethudtutorialmessage" }, - { 0x84A4, "clearhudtutorialmessage" }, - { 0x84A5, "initdamageparts" }, - { 0x84A6, "adddamagepart" }, - { 0x84A7, "addhudwarningmessage" }, - { 0x84A8, "clearhudwarningmessage" }, - { 0x84A9, "enablecallouts" }, - { 0x84AA, "setvehicledef" }, - { 0x84AB, "setuserange" }, - { 0x84AC, "setuseholdduration" }, - { 0x84AD, "setusehideprogressbar" }, - { 0x84AE, "setusewhenhandsoccupied" }, - { 0x84AF, "setusecommand" }, - { 0x84B0, "sethintdisplayrange" }, - { 0x84B1, "setusefov" }, - { 0x84B2, "sethintdisplayfov" }, - { 0x84B3, "sethinttag" }, - { 0x84B4, "sethintinoperable" }, - { 0x84B5, "sethintonobstruction" }, - { 0x84B6, "sethinticon" }, - { 0x84B7, "sethintrarity" }, - { 0x84B8, "getnavposition" }, - { 0x84B9, "actoraimassiston" }, - { 0x84BA, "actoraimassistoff" }, - { 0x84BB, "enablequickweaponswitch" }, - { 0x84BC, "btregistertreeinstance" }, - { 0x84BD, "btterminatetreeinstance" }, - { 0x84BE, "bttick" }, - { 0x84BF, "getlastpathpointwithingoal" }, - { 0x84C0, "sethintrequiresmashing" }, - { 0x84C1, "isstuck" }, - { 0x84C2, "iswithinscriptgoalradius" }, - { 0x84C3, "requeststopsoonnotify" }, - { 0x84C4, "setworlduptrigger" }, - { 0x84C5, "assignweaponoffhandspecial" }, - { 0x84C6, "clearoffhandspecial" }, - { 0x84C7, "setoffhandspecialclass" }, - { 0x84C8, "getoffhandspecialclass" }, - { 0x84C9, "getplayerprogression" }, - { 0x84CA, "setplayerprogression" }, - { 0x84CB, "initplayerloadoutnames" }, - { 0x84CC, "sendleveldata" }, - { 0x84CD, "enablecollisionnotifies" }, - { 0x84CE, "playerenabletriggers" }, - { 0x84CF, "playerdisabletriggers" }, - { 0x84D0, "getscriptedmeleetarget" }, - { 0x84D1, "setscriptedmeleeactive" }, - { 0x84D2, "isscriptedmeleeactive" }, - { 0x84D3, "sethandsoccupied" }, - { 0x84D4, "gethandsoccupied" }, - { 0x84D5, "setnextbulletdryfire" }, - { 0x84D6, "getshieldmaxenergy" }, - { 0x84D7, "getshieldcurrentenergy" }, - { 0x84D8, "physics_registerforcollisioncallback" }, - { 0x84D9, "physics_unregisterforcollisioncallback" }, - { 0x84DA, "playanimscriptevent" }, - { 0x84DB, "playanimscriptsceneevent" }, - { 0x84DC, "notifyonplayerupdate" }, - { 0x84DD, "setsoundduck" }, - { 0x84DE, "clearsoundduck" }, - { 0x84DF, "getsprintmeterfraction" }, - { 0x84E0, "getstairsstateatdist" }, - { 0x84E1, "stairswithindistance" }, - { 0x84E2, "setphasestatus" }, - { 0x84E3, "isinphase" }, - { 0x84E4, "knockback" }, - { 0x84E5, "allowoffhandshieldweapons" }, - { 0x84E6, "setspacejump" }, - { 0x84E7, "clearspacejump" }, - { 0x84E8, "vehicle_breakglass" }, - { 0x84E9, "vehicle_invoketriggers" }, - { 0x84EA, "controlagent" }, - { 0x84EB, "restorecontrolagent" }, - { 0x84EC, "enableavoidance" }, - { 0x84ED, "setavoidancereciprocity" }, - { 0x84EE, "setavoidanceradius" }, - { 0x84EF, "modifyspacejumppath" }, - { 0x84F0, "assignweaponmeleeslot" }, - { 0x84F1, "getthreatsight" }, - { 0x84F2, "setthreatsight" }, - { 0x84F3, "startspacejumpdeath" }, - { 0x84F4, "trackmovingplatformtilt" }, - { 0x84F5, "loadweaponsforplayer" }, - { 0x84F6, "hasloadedviewweapons" }, - { 0x84F7, "setworldupreferenceangles" }, - { 0x84F8, "zerograv" }, - { 0x84F9, "codemoveanimrate" }, - { 0x84FA, "setmoveanimknob" }, - { 0x84FB, "getgrenadetossvel" }, - { 0x84FC, "getspacejumpstate" }, - { 0x84FD, "getgesturestarttime" }, - { 0x84FE, "getmotionangle3d" }, - { 0x84FF, "aieventlistenerevent" }, - { 0x8500, "findbestcoverlist" }, - { 0x8501, "getnearbynegotiationinfo" }, - { 0x8502, "setcustomization" }, - { 0x8503, "loadcustomization" }, - { 0x8504, "showlegsandshadow" }, - { 0x8505, "hidelegsandshadow" }, - { 0x8506, "giveandfireoffhand" }, - { 0x8507, "setsolid" }, - { 0x8508, "setspacejumpentoverride" }, - { 0x8509, "clearspacejumpentoverride" }, - { 0x850A, "setspacegrapple" }, - { 0x850B, "enabletraversals" }, - { 0x850C, "setgrapplevolume" }, - { 0x850D, "setgrappleroundvolume" }, - { 0x850E, "clearspacegrapple" }, - { 0x850F, "spacegrappleavailable" }, - { 0x8510, "getspacegrapplewalkable" }, - { 0x8511, "setgrappleactor" }, - { 0x8512, "damagedamagepart" }, - { 0x8513, "getdamageparthealth" }, - { 0x8514, "hasloadedcustomizationplayerworld" }, - { 0x8515, "hasloadedcustomizationworldmodels" }, - { 0x8516, "hasloadedcustomizationviewmodels" }, - { 0x8517, "hasloadedworldweapons" }, - { 0x8518, "allowwalk" }, - { 0x8519, "getgesturenotetracktimes" }, - { 0x851A, "despawncoverwall" }, - { 0x851B, "scriptmodelplayanimdeltamotionfrompos" }, - { 0x851C, "forcespacejump" }, - { 0x851D, "getworldupreferenceangles" }, - { 0x851E, "normalizeworldupreferenceangles" }, - { 0x851F, "isalternatemode" }, - { 0x8520, "setballpassallowed" }, - { 0x8521, "physicsstopserver" }, - { 0x8522, "startbeam" }, - { 0x8523, "stopbeam" }, - { 0x8524, "turretgetaim" }, - { 0x8525, "botenemyfacesbot" }, - { 0x8526, "allowspacegrapplecancel" }, - { 0x8527, "setplayerghost" }, - { 0x8528, "setprioritysnap" }, - { 0x8529, "getweaponmeleeslot" }, - { 0x852A, "isinvulnerable" }, - { 0x852B, "physics_volumeenable" }, - { 0x852C, "physics_volumeaffectcharacters" }, - { 0x852D, "physics_volumeaffectmissiles" }, - { 0x852E, "physics_volumesetactivator" }, - { 0x852F, "physics_volumesetasgravityscalar" }, - { 0x8530, "physics_volumesetasdirectionalforce" }, - { 0x8531, "physics_volumesetasfocalforce" }, - { 0x8532, "setdead" }, - { 0x8533, "sethintstringparams" }, - { 0x8534, "physics_volumesetasgravityvector" }, - { 0x8535, "getposoutsidebadplace" }, - { 0x8536, "isinbadplace" }, - { 0x8537, "setturretalwaysmanned" }, - { 0x8538, "setturretholdstill" }, - { 0x8539, "setmoverweapon" }, - { 0x853A, "getplayerrollvelocity" }, - { 0x853B, "setvolumewalkingenabled" }, - { 0x853C, "loadworldweaponsforplayer" }, - { 0x853D, "getmuzzledir" }, - { 0x853E, "isusingoffhandshield" }, - { 0x853F, "getanimikweights" }, - { 0x8540, "turretcantarget" }, - { 0x8541, "assignweaponoffhandtaunt" }, - { 0x8542, "codemoverequested" }, - { 0x8543, "setvolumeupvector" }, - { 0x8544, "getspacegrappleentity" }, - { 0x8545, "cancelreload" }, - { 0x8546, "actorcalcsharpturnanim" }, - { 0x8547, "actorcalcstopdata" }, - { 0x8548, "scriptmoverplane" }, - { 0x8549, "scriptmoveroutline" }, - { 0x854A, "scriptmoverclearoutline" }, - { 0x854B, "setturretlockedon" }, - { 0x854C, "getoffhandslot" }, - { 0x854D, "getheldoffhand" }, - { 0x854E, "setmodelusesmaterialoverride" }, - { 0x854F, "doshieldoutlinesweep" }, - { 0x8550, "setdamageparthealth" }, - { 0x8551, "getscriptablepartstate" }, - { 0x8552, "actorgetgroundslope" }, - { 0x8553, "lerpfovbypreset" }, - { 0x8554, "getthrowbackweapon" }, - { 0x8555, "enableplayerbreathsystem" }, - { 0x8556, "limitedmovement" }, - { 0x8557, "getmodifierlocationonpath" }, - { 0x8558, "getmodifierlocationbetween" }, - { 0x8559, "setvolumegrappledisable" }, - { 0x855A, "allowswimpredicted" }, - { 0x855B, "setavoidancebounds" }, - { 0x855C, "sethintrequiresholding" }, - { 0x855D, "sethintlockplayermovement" }, - { 0x855E, "clearplayerhintlock" }, - { 0x855F, "abortspacejump" }, - { 0x8560, "spacegrapplebeginmove" }, - { 0x8561, "getxuidhigh" }, - { 0x8562, "getxuidlow" }, - { 0x8563, "getclantag" }, - { 0x8564, "setdroneturnparams" }, - { 0x8565, "gethighpriorityweapon" }, - { 0x8566, "ishighpriorityweapon" }, - { 0x8567, "sethighpriorityweapon" }, - { 0x8568, "clearhighpriorityweapon" }, - { 0x8569, "recordbreadcrumbdataforplayer" }, - { 0x856A, "logpinghistogram" }, - { 0x856B, "setshadowmodel" }, - { 0x856C, "setlegsmodel" }, - { 0x856D, "setmoverlaserweapon" }, - { 0x856E, "setmoverbehavior" }, - { 0x856F, "ragdollblendinit" }, - { 0x8570, "getspacegrappleplatform" }, - { 0x8571, "setcallouttext" }, - { 0x8572, "setlaserflag" }, - { 0x8573, "setvolumesnapenabled" }, - { 0x8574, "getgunangles" }, - { 0x8575, "disableemptyclipweaponswitch" }, - { 0x8576, "showlegs" }, - { 0x8577, "hidelegs" }, - { 0x8578, "showshadow" }, - { 0x8579, "hideshadow" }, - { 0x857A, "playequipmovesound" }, - { 0x857B, "playclothmovesound" }, - { 0x857C, "setdriftvelocity" }, - { 0x857D, "setdriftoffset" }, - { 0x857E, "forcehidegrenadehudwarning" }, - { 0x857F, "setasgametypeobjective" }, - { 0x8580, "setscriptablebeamlength" }, - { 0x8581, "enablemissilehint" }, - { 0x8582, "disableoffhandprimaryweapons" }, - { 0x8583, "enableoffhandprimaryweapons" }, - { 0x8584, "getmlgselectedcamera" }, - { 0x8585, "fixlinktointerpolationbug" }, - { 0x8586, "getplayeryolostate" }, - { 0x8587, "setplayeryolostate" }, - { 0x8588, "hasplayerdata" }, - { 0x8589, "clearscriptabledamageowner" }, - { 0x858A, "scriptmoverthermal" }, - { 0x858B, "scriptmoverclearthermal" }, - { 0x858C, "setc8obstacleflag" }, - { 0x858D, "clearcustomization" }, - { 0x858E, "clearweaponloadrequestsforplayer" }, - { 0x858F, "logplayerendmatchdatashotshits" }, - { 0x8590, "logplayerendmatchdataheadbody" }, - { 0x8591, "logplayerendmatchdatamatchresult" }, - { 0x8592, "lockdeathcamera" }, - { 0x8593, "missilethermal" }, - { 0x8594, "missileoutline" }, - { 0x8595, "iw7shiphack_setmaymovetime" }, - { 0x8596, "visionsetkillstreakforplayer" }, - { 0x8597, "logstatmatchguid" }, - { 0x8598, "sethasradar" }, - { 0x8599, "setisradarblocked" }, - { 0x859A, "setradarstrength" }, - { 0x859B, "vehicle_cleardrivingstate" }, - { 0x859C, "setwaypointbackground" }, - { 0x859D, "setmlgdraw" }, - { 0x859E, "setteaminhuddata" }, - { 0x859F, "logplayerendmatchdatagesture" }, - { 0x85A0, "logplayerendmatchdatamisc" }, - { 0x85A1, "asmtick" }, - { 0x85A2, "asmgetanim" }, - { 0x85A3, "asmhasstate" }, - { 0x85A4, "asmsetstate" }, - { 0x85A5, "asminstantiate" }, - { 0x85A6, "asmgetcurrentstate" }, - { 0x85A7, "asmcurrentstatehasflag" }, - { 0x85A8, "asmgetstatetransitioningfrom" }, - { 0x85A9, "asmevalpaintransition" }, - { 0x85AA, "asmhaspainstate" }, - { 0x85AB, "asmgetnotehandler" }, - { 0x85AC, "asmgetfacialstate" }, - { 0x85AD, "asmterminate" }, - { 0x85AE, "asmfireevent" }, - { 0x85AF, "asmfireephemeralevent" }, - { 0x85B0, "asmeventfired" }, - { 0x85B1, "asmephemeraleventfired" }, - { 0x85B2, "asmeventfiredwithin" }, - { 0x85B3, "asmclearephemeralevents" }, - { 0x85B4, "asmgeteventdata" }, - { 0x85B5, "asmgeteventtime" }, - { 0x85B6, "asmgetephemeraleventdata" }, - { 0x85B7, "asmdodeathtransition" }, - { 0x85B8, "getaiblackboard" }, - { 0x85B9, "clearaiblackboard" }, - { 0x85BA, "setanimset" }, - { 0x85BB, "getanimset" }, - { 0x85BC, "aisetdesiredspeed" }, - { 0x85BD, "aisetspeedscalemode" }, - { 0x85BE, "setaimangles" }, - { 0x85BF, "getnodehideyaw" }, - { 0x85C0, "getnodehideyawoffset" }, - { 0x85C1, "getnodesnapyawoffset" }, - { 0x85C2, "getnodeleanaimyaw" }, - { 0x85C3, "getnodeleanaimyawoffset" }, - { 0x85C4, "getnodeleanaimpitch" }, - { 0x85C5, "getnodeleanaimpitchoffset" }, - { 0x85C6, "islegacyagent" }, - { 0x85C7, "aisetanim" }, - { 0x85C8, "aisetanimlimited" }, - { 0x85C9, "aiclearanim" }, - { 0x85CA, "aisetanimknob" }, - { 0x85CB, "aisetanimknoblimited" }, - { 0x85CC, "aisetanimblendcurve" }, - { 0x85CD, "aisetanimtime" }, - { 0x85CE, "setpupildiameter" }, - { 0x85CF, "aisetanimrate" }, - { 0x85D0, "aigetanimweight" }, - { 0x85D1, "aigetanimtime" }, - { 0x85D2, "aisetanimknobrestart" }, - { 0x85D3, "finishtraverse" }, - { 0x85D4, "motionwarp" }, - { 0x85D5, "motionwarpwithanim" }, - { 0x85D6, "motionwarpcancel" }, - { 0x85D7, "getreacquirestate" }, - { 0x85D8, "reacquireclear" }, - { 0x85D9, "setbtgoalheight" }, - { 0x85DA, "setbtgoalradius" }, - { 0x85DB, "getallanimsforalias" }, - { 0x85DC, "getpointafternegotiation" }, - { 0x85DD, "aimayshoot" }, - { 0x85DE, "missiledonttrackkillcam" }, - { 0x85DF, "isspectatingplayer" }, - { 0x85E0, "spectateclientnum" }, - { 0x85E1, "setmlgfollowdroneactive" }, - { 0x85E2, "ismlgfollowdroneactive" }, - { 0x85E3, "setseatedanimconditional" }, - { 0x85E4, "istrialversion" }, - { 0x85E5, "missile_setphasestate" }, - { 0x85E6, "setnavlayer" }, - { 0x85E7, "setonwallanimconditional" }, - { 0x85E8, "enableworldup" }, - { 0x85E9, "getprivatepartysize" }, - { 0x85EA, "playannouncersound" }, - { 0x85EB, "player_getrecoilscale" }, - { 0x85EC, "setfiretimescaleon" }, - { 0x85ED, "setfiretimescaleoff" }, - { 0x85EE, "getfiretimescale" }, - { 0x85EF, "setkillcamentstickstolookatent" }, - { 0x85F0, "finishcoverarrival" }, - { 0x85F1, "forceboostonlyjump" }, - { 0x85F2, "setdronegoalent" }, - { 0x85F3, "setuavjammed" }, - { 0x85F4, "hastacvis" }, - { 0x85F5, "findlastpointonpathwithinvolume" }, - { 0x85F6, "copyenemyinfo" }, - { 0x85F7, "aipointinfov" }, - { 0x85F8, "isgunblockedbywall" }, - { 0x85F9, "playviewmodelanim" }, - { 0x85FA, "vehicleplayanim" }, - { 0x85FB, "canseeperipheral" }, - { 0x85FC, "resetthreatupdate" }, - { 0x85FD, "enableteamwalking" }, - { 0x85FE, "hasattachment" }, - { 0x85FF, "getbaseweapon" }, - { 0x8600, "getplayerlightlevel" }, - { 0x8601, "getaltweapon" }, - { 0x8602, "getnoaltweapon" }, - { 0x8603, "canuseattachment" }, - { 0x8604, "setimpactfx" }, - { 0x8605, "getspawnpointforplayer" }, - { 0x8606, "forceupdategoalpos" }, - { 0x8607, "finalizespawnpointchoiceforplayer" }, - { 0x8608, "dropweaponnovelocity" }, - { 0x8609, "vehphys_speedboost" }, - { 0x860A, "vehicle_settopspeedforward" }, - { 0x860B, "vehicle_settopspeedreverse" }, - { 0x860C, "isnightvisionon" }, - { 0x860D, "ambushiscurrentnodevalid" }, - { 0x860E, "ambushgetnextambushnode" }, - { 0x860F, "ambushcheckpath" }, - { 0x8610, "isthirdpersoncamvehicle" }, - { 0x8611, "setthirdpersoncamvehicle" }, - { 0x8612, "setcinematicmotionoverride" }, - { 0x8613, "clearcinematicmotionoverride" }, - { 0x8614, "playeradsnotreloading" }, - { 0x8615, "stancebuttonpressed" }, - { 0x8616, "setupmotionwarpforturn" }, - { 0x8617, "transfermarkstonewscriptmodel" }, - { 0x8618, "registerentityspawnviewer" }, - { 0x8619, "clearentityspawnviewer" }, - { 0x861A, "reportchallengeuserevent" }, - { 0x861B, "scriptmodelpauseanim" }, - { 0x861C, "updateaiminfo" }, - { 0x861D, "aigetdesiredspeed" }, - { 0x861E, "asmcurrentstatehasaimset" }, - { 0x861F, "asmcurrentstatehasshootadditive" }, - { 0x8620, "missilehidetrail" }, - { 0x8621, "vehicle_setworldcollisioncapsule" }, - { 0x8622, "aisettargetspeed" }, - { 0x8623, "setgunadditive" }, - { 0x8624, "aigettargetspeed" }, - { 0x8625, "getdesiredscaledspeedforposalongpath" }, - { 0x8626, "vehicle_gettopspeedforward" }, - { 0x8627, "vehicle_gettopspeedreverse" }, - { 0x8628, "vehicle_gettopspeedrotational" }, - { 0x8629, "vehicle_settopspeedrotational" }, - { 0x862A, "applydroneimpulsevelocity" }, - { 0x862B, "enableaudioportal" }, - { 0x862C, "vehphys_deactivate" }, - { 0x862D, "vehphys_enablecollisioncallback" }, - { 0x862E, "stopanimscriptsceneevent" }, - { 0x862F, "stopviewmodelanim" }, - { 0x8630, "setavoidanceignoreent" }, - { 0x8631, "clearavoidanceignoreent" }, - { 0x8632, "iscurrentenemyvalid" }, - { 0x8633, "canboundingoverwatchmove" }, - { 0x8634, "setcoverselectionfocusent" }, - { 0x8635, "isatvalidlongdeathspot" }, - { 0x8636, "enablephysicaldepthoffieldscripting" }, - { 0x8637, "disablephysicaldepthoffieldscripting" }, - { 0x8638, "resetphysicaldepthoffieldscripting" }, - { 0x8639, "setphysicaldepthoffield" }, - { 0x863A, "setadsphysicaldepthoffield" }, - { 0x863B, "setphysicalviewmodeldepthoffield" }, - { 0x863C, "setlensprofiledistort" }, - { 0x863D, "giveaccessory" }, - { 0x863E, "clearaccessory" }, - { 0x863F, "giveexecution" }, - { 0x8640, "clearexecution" }, - { 0x8641, "setweaponmodelcamo" }, - { 0x8642, "withattachment" }, - { 0x8643, "withoutattachment" }, - { 0x8644, "withattachments" }, - { 0x8645, "withoutattachments" }, - { 0x8646, "withotherattachment" }, - { 0x8647, "withoutotherattachment" }, - { 0x8648, "withcamo" }, - { 0x8649, "withoutcamo" }, - { 0x864A, "setsticker" }, - { 0x864B, "clearsticker" }, - { 0x864C, "clearstickers" }, - { 0x864D, "withreticle" }, - { 0x864E, "withoutreticle" }, - { 0x864F, "aiplaygesture" }, - { 0x8650, "aicleargesture" }, - { 0x8651, "isnodelmgmountable" }, - { 0x8652, "getscriptablehaspart" }, - { 0x8653, "getscriptableparthasstate" }, - { 0x8654, "getscriptablepartstatehasevent" }, - { 0x8655, "getscriptablepartstatefield" }, - { 0x8656, "getscriptablepartstateeventfield" }, - { 0x8657, "setmoveravatar" }, - { 0x8658, "setsoundsubmix" }, - { 0x8659, "clearsoundsubmix" }, - { 0x865A, "clearallsoundsubmixes" }, - { 0x865B, "scalesoundsubmix" }, - { 0x865C, "isviewmodelanimplaying" }, - { 0x865D, "isconsoleplayer" }, - { 0x865E, "ispcplayer" }, - { 0x865F, "isps4player" }, - { 0x8660, "isxb3player" }, - { 0x8661, "modifybasefov" }, - { 0x8662, "isnearanyplayer" }, - { 0x8663, "ignorecharacterduringspawnselection" }, - { 0x8664, "animscriptentervehicle" }, - { 0x8665, "animscriptexitvehicle" }, - { 0x8666, "vehicle_setheldweaponvisibility" }, - { 0x8667, "vehicle_setstowedweaponvisibility" }, - { 0x8668, "setnvgarealighteffect" }, - { 0x8669, "getcollision" }, - { 0x866A, "setcivilianfocus" }, - { 0x866B, "cameradefault" }, - { 0x866C, "cameraset" }, - { 0x866D, "animscriptsetinputparamreplicationstatus" }, - { 0x866E, "animscriptsetparachutestate" }, - { 0x866F, "animscriptexitparachutestate" }, - { 0x8670, "getleftstickx" }, - { 0x8671, "getleftsticky" }, - { 0x8672, "getrightstickx" }, - { 0x8673, "getrightsticky" }, - { 0x8674, "setscriptablepartzerostate_hack" }, - { 0x8675, "enablescriptablepartplayeruse" }, - { 0x8676, "disablescriptablepartplayeruse" }, - { 0x8677, "vehicleshowonminimap" }, - { 0x8678, "setadditionalstreampos" }, - { 0x8679, "clearadditionalstreampos" }, - { 0x867A, "isadditionalstreamposready" }, - { 0x867B, "setragdollnobloodpoolfx" }, - { 0x867C, "enablescriptableplayeruse" }, - { 0x867D, "disablescriptableplayeruse" }, - { 0x867E, "getapproxeyepos" }, - { 0x867F, "isentitywithincone" }, - { 0x8680, "choosearrivaltype" }, - { 0x8681, "clearimpactmarks" }, - { 0x8682, "getboundshalfsize" }, - { 0x8683, "getboundsmidpoint" }, - { 0x8684, "maymovecheckfriendlyfire" }, - { 0x8685, "skydive_beginfreefall" }, - { 0x8686, "skydive_deployparachute" }, - { 0x8687, "skydive_setdeploymentstatus" }, - { 0x8688, "skydive_setbasejumpingstatus" }, - { 0x8689, "skydive_interrupt" }, - { 0x868A, "skydive_setforcethirdpersonstatus" }, - { 0x868B, "isskydiving" }, - { 0x868C, "isinfreefall" }, - { 0x868D, "isparachuting" }, - { 0x868E, "shoulddisableskydivevfx" }, - { 0x868F, "setisinfilskydive" }, - { 0x8690, "setscriptablepayloadmodel" }, - { 0x8691, "setscriptablepayloadweapon" }, - { 0x8692, "freescriptable" }, - { 0x8693, "nodeisactivated" }, - { 0x8694, "triggersoundstart" }, - { 0x8695, "triggersoundstop" }, - { 0x8696, "setcarryobject" }, - { 0x8697, "resetcarryobject" }, - { 0x8698, "disableexecutionattack" }, - { 0x8699, "enableexecutionattack" }, - { 0x869A, "disableexecutionvictim" }, - { 0x869B, "enableexecutionvictim" }, - { 0x869C, "isinexecutionattack" }, - { 0x869D, "isinexecutionvictim" }, - { 0x869E, "setscriptableuselargerbounds" }, - { 0x869F, "aigetworldweaponoffset" }, - { 0x86A0, "allowsupersprint" }, - { 0x86A1, "refreshsprinttime" }, - { 0x86A2, "issupersprinting" }, - { 0x86A3, "setagentbounds" }, - { 0x86A4, "despawnagent" }, - { 0x86A5, "agentclearscriptvars" }, - { 0x86A6, "agentsetclipmode" }, - { 0x86A7, "agentsetfavoriteenemy" }, - { 0x86A8, "isnodeinbadplace" }, - { 0x86A9, "matchdataplayerexistingslot" }, - { 0x86AA, "matchdatafillplayerheader" }, - { 0x86AB, "scalesoundvolume" }, - { 0x86AC, "scalesoundpitch" }, - { 0x86AD, "setfacialindex" }, - { 0x86AE, "setcustomnodegameparameterbyte" }, - { 0x86AF, "vignettesetparams" }, - { 0x86B0, "vignettegetparams" }, - { 0x86B1, "vignettescriptdisable" }, - { 0x86B2, "brcirclemoveto" }, - { 0x86B3, "forcethreatupdate" }, - { 0x86B4, "getturretcurrentyaw" }, - { 0x86B5, "getturretcurrentpitch" }, - { 0x86B6, "getleftarc" }, - { 0x86B7, "getrightarc" }, - { 0x86B8, "gettoparc" }, - { 0x86B9, "getbottomarc" }, - { 0x86BA, "isturretinoperable" }, - { 0x86BB, "setupdooropen" }, - { 0x86BC, "cleardooropen" }, - { 0x86BD, "botpathexists" }, - { 0x86BE, "setbackupcoverfrompos" }, - { 0x86BF, "aiclearscriptdesiredspeed" }, - { 0x86C0, "getlinkedscriptableinstance" }, - { 0x86C1, "getscriptablelinkedentity" }, - { 0x86C2, "sprayevent" }, - { 0x86C3, "isscriptable" }, - { 0x86C4, "setupshootstyleadditive" }, - { 0x86C5, "shouldcautiousstrafe" }, - { 0x86C6, "getaccessorygesturename" }, - { 0x86C7, "scriptmoverdistancefade" }, - { 0x86C8, "scriptmovercleardistancefade" }, - { 0x86C9, "getadjustedexitdirection" }, - { 0x86CA, "setanimlookatneutraldir" }, - { 0x86CB, "setanimlookatranges" }, - { 0x86CC, "setuplookatfornotetrack" }, - { 0x86CD, "getclosestreachablepointonnavmesh" }, - { 0x86CE, "enablemissedbulletclientonly" }, - { 0x86CF, "getscriptableisloot" }, - { 0x86D0, "getscriptableisreserved" }, - { 0x86D1, "getscriptableislinked" }, - { 0x86D2, "getscriptableisusableonanypart" }, - { 0x86D3, "enableplayermarks" }, - { 0x86D4, "disableplayermarks" }, - { 0x86D5, "enableentitymarks" }, - { 0x86D6, "disableentitymarks" }, - { 0x86D7, "entityhasmark" }, - { 0x86D8, "entitymarkfilteredin" }, - { 0x86D9, "entitymarkfilteredout" }, - { 0x86DA, "getplayermarks" }, - { 0x86DB, "filteroutplayermarks" }, - { 0x86DC, "filterinplayermarks" }, - { 0x86DD, "enabledismemberment" }, - { 0x86DE, "disabledismemberment" }, - { 0x86DF, "enabletargetmarks" }, - { 0x86E0, "disabletargetmarks" }, - { 0x86E1, "enablestatelookat" }, - { 0x86E2, "enablescriptedlookat" }, - { 0x86E3, "dlog_recordplayerevent" }, - { 0x86E4, "entitymarkfilterindistance" }, - { 0x86E5, "targetmarklimits" }, - { 0x86E6, "isufo" }, - { 0x86E7, "isnoclip" }, - { 0x86E8, "getsquadindex" }, - { 0x86E9, "streamsetmaterialtouchuntilloaded" }, - { 0x86EA, "calloutmarkerping_create" }, - { 0x86EB, "calloutmarkerping_setfeedback" }, - { 0x86EC, "calloutmarkerping_delete" }, - { 0x86ED, "calloutmarkerping_hide" }, - { 0x86EE, "calloutmarkerping_show" }, - { 0x86EF, "calloutmarkerping_onentity" }, - { 0x86F0, "allownightvisiontoggle" }, - { 0x86F1, "getjuggdefaultmusicenabled" }, - { 0x86F2, "overridevehicleseatanimconditionals" }, - { 0x86F3, "aiprecalcshouldstartarrival" }, - { 0x86F4, "getscriptablepartcount" }, - { 0x86F5, "getscriptablepartnameatindex" }, - { 0x86F6, "usebuttondone" }, - { 0x86F7, "sendclientnetworktelemetry" }, - { 0x86F8, "getlastgroundorigin" }, - { 0x86F9, "vehicle_allowplayerstandon" }, - { 0x86FA, "vehicle_isonground" }, - { 0x86FB, "scriptabledoorfreeze" }, - { 0x86FC, "scriptabledoorisclosed" }, - { 0x86FD, "scriptabledoorisowned" }, - { 0x86FE, "scriptableisdoor" }, - { 0x86FF, "scriptabledoorisdouble" }, - { 0x8700, "setmapcirclecolorindex" }, - { 0x8701, "setmapcirclestyleindex" }, - { 0x8702, "setmapcircleiconindex" }, - { 0x8703, "vehicleshowonminimapforclient" }, - { 0x8704, "scriptabledoorangle" }, - { 0x8705, "setmovertransparentvolume" }, - { 0x8706, "haslastgroundorigin" }, - { 0x8707, "disableoffhandthrowback" }, - { 0x8708, "enableoffhandthrowback" }, - { 0x8709, "setplayeradvanceduavdot" }, - { 0x870A, "sethidenameplate" }, - { 0x870B, "startragdollfromvehiclehit" }, - { 0x870C, "vehiclepinonminimap" }, - { 0x870D, "vehswitchseatbuttonpressed" }, - { 0x870E, "aiupdatecoverexposetype" }, - { 0x870F, "aicalcsuppressspot" }, - { 0x8710, "scriptabledooropen" }, - { 0x8711, "scriptabledoorclose" }, - { 0x8712, "constraintoscriptgoalradius" }, - { 0x8713, "vehicle_getinputvalue" }, - { 0x8714, "getplayerip" }, - { 0x8715, "setstrafereverse" }, - { 0x8716, "updatelastcovertime" }, - { 0x8717, "getpartyid" }, - { 0x8718, "isguest" }, - { 0x8719, "getmissilevelocity" }, - { 0x871A, "scriptablesetparententity" }, - { 0x871B, "scriptableclearparententity" }, - { 0x871C, "validatecollision" }, - { 0x871D, "ctgsreportusermatchstats" }, - { 0x871E, "getclosestenemy" }, - { 0x871F, "getcurrentusereloadconfig" }, - { 0x8720, "getspawnbucketforplayer" }, - { 0x8721, "ismlgfreecamenabled" }, - { 0x8722, "disablereloading" }, - { 0x8723, "enablereloading" }, - { 0x8724, "forcereloading" }, - { 0x8725, "cancelreloading" }, - { 0x8726, "reloadbuttonpressed" }, - { 0x8727, "startragdollfromvehicleimpact" }, - { 0x8728, "isbnetkr15player" }, - { 0x8729, "isbnetigrplayer" }, - { 0x872A, "setclientkillstreakindexes" }, - { 0x872B, "resetclientkillstreakindexes" }, - { 0x872C, "setclientkillstreakavailability" }, - { 0x872D, "resetclientkillstreakavailability" }, - { 0x872E, "setpowerammo" }, - { 0x872F, "setpowerprogress" }, - { 0x8730, "trajectoryupdateoriginandangles" }, - { 0x8731, "clearladderstate" }, - { 0x8732, "getcovertacpoint" }, - { 0x8733, "setmlgdamagedone" }, - { 0x8734, "setcorpsemodel" }, - { 0x8735, "getplayergpadenabled" }, - { 0x8736, "getwartrackpassengerenabled" }, - { 0x8737, "startzeroarrival" }, - { 0x8738, "finishzeroarrival" }, - { 0x8739, "candoretreat" }, - { 0x873A, "copyloadoutbuttonpressed" }, - { 0x873B, "playcinematicforplayer" }, - { 0x873C, "playcinematicforplayerlooping" }, - { 0x873D, "preloadcinematicforplayer" }, - { 0x873E, "stopcinematicforplayer" }, - { 0x873F, "skydive_cutparachuteon" }, - { 0x8740, "skydive_cutparachuteoff" }, - { 0x8741, "skydive_cutautodeployon" }, - { 0x8742, "skydive_cutautodeployoff" }, - { 0x8743, "getclientomnvar" }, - { 0x8744, "weaponswitchbuttonpressed" }, - { 0x8745, "calloutmarkerping_entityzoffset" }, - { 0x8746, "allowspectateallteams" }, - { 0x8747, "ismlgaerialcamenabled" }, - { 0x8748, "setmlgmessagesent" }, - { 0x8749, "useinvisibleplayerduringspawnselection" }, - { 0x874A, "updatemlgammoinfo" }, - { 0x874B, "setbeingrevived" }, - { 0x874C, "getbeingrevived" }, - { 0x874D, "setisusingspecialist" }, - { 0x874E, "setmlgdominationpoint" }, - { 0x874F, "getfollowedplayer" }, - { 0x8750, "setmlgthirdpersonenabled" }, - { 0x8751, "updatecurrentweapon" }, - { 0x8752, "getmid1damage" }, - { 0x8753, "getmid2damage" }, - { 0x8754, "getmid3damage" }, - { 0x8755, "getweaponclassint" }, - { 0x8756, "clearvehiclesticker" }, - { 0x8757, "clearvehiclestickers" }, - { 0x8758, "getvehiclesticker" }, - { 0x8759, "setvehiclesticker" }, - { 0x875A, "aisetriotshieldweapon" }, - { 0x875B, "enablephysicsmoverpush" }, - { 0x875C, "clearvehiclecamo" }, - { 0x875D, "getvehiclecamo" }, - { 0x875E, "setvehiclecamo" }, - { 0x875F, "getexecutionpartner" }, - { 0x8760, "getmountconfigenabled" }, - { 0x8761, "scriptablecanbepinged" }, - { 0x8762, "scriptableislootcache" }, - { 0x8763, "scriptablegetmidpoint" }, - { 0x8764, "isplayerheadless" }, - { 0x8765, "calloutmarkerping_getactive" }, - { 0x8766, "calloutmarkerping_getent" }, - { 0x8767, "calloutmarkerping_getfeedback" }, - { 0x8768, "calloutmarkerping_getsavedzoffset" }, - { 0x8769, "selfrevivingdoneanimevent" }, - { 0x876A, "buddyrevivingdoneanimevent" }, - { 0x876B, "setlaststandreviving" }, - { 0x876C, "setlaststandselfreviving" }, - { 0x876D, "isholdingbreath" }, - { 0x876E, "setlaststandenabled" }, - { 0x876F, "enableplayeruseforallplayers" }, - { 0x8770, "disableplayeruseforallplayers" }, - { 0x8771, "activatekeypressed" }, - { 0x8772, "istacmapactive" }, - { 0x8773, "setmainstreamloaddist" }, - { 0x8774, "setadditionalstreamloaddist" }, - { 0x8775, "sendrequestgamerprofilecmd" }, - { 0x8776, "calloutmarkerping_getorigin" }, - { 0x8777, "setpredictedstreamloaddist" }, - { 0x8778, "setallstreamloaddist" }, - { 0x8779, "calloutmarkerping_getinventoryslot" }, - { 0x877A, "calloutmarkerping_getcreatedtime" }, - { 0x877B, "isdismembermentenabledforplayer" }, - { 0x877C, "sethasspecialistbonus" }, - { 0x877D, "clearvehicleturretsticker" }, - { 0x877E, "clearvehicleturretstickers" }, - { 0x877F, "getvehicleturretsticker" }, - { 0x8780, "setvehicleturretsticker" }, - { 0x8781, "clearvehicleturretcamo" }, - { 0x8782, "getvehicleturretcamo" }, - { 0x8783, "setvehicleturretcamo" }, - { 0x8784, "isbasejumpavailable" }, - { 0x8785, "sendclientmatchdataforclient" }, - { 0x8786, "setautoboxcalculationusingdobj" }, - { 0x8787, "setshowinrealism" }, - { 0x8788, "getuseholdkbmprofile" }, - { 0x8789, "sendcollectedclientanticheatdata" }, - { 0x878A, "setvehiclehornsound" }, - { 0x878B, "radiusdamagestepped" }, - { 0x878C, "setfacialindexfromasm" }, - { 0x878D, "calloutmarkerping_getgscobjectiveindex" }, - { 0x878E, "playencryptedcinematicforplayer" }, - { 0x878F, "getnodeoffset_code" }, - { 0x8790, "setarrivalanimdata" }, - { 0x8791, "aisuppressai_code" }, - { 0x8792, "playergetzoomlevelindex" }, - { 0x8793, "playergetzoomfov" }, - { 0x8794, "setmoveroptimized" }, - { 0x8795, "stopplayermusicstate" }, - { 0x8796, "setoverridearchetype_code" }, - { 0x8797, "clearoverridearchetype_code" }, - { 0x8798, "findoverridearchetype_code" }, - { 0x8799, "getbasearchetype_code" }, - { 0x879A, "setbasearchetype_code" }, - { 0x879B, "canaimwhilemoving_code" }, - { 0x879C, "forcenetfieldhighlod" }, - { 0x879D, "markkeyframedmover" }, - { 0x879E, "unmarkkeyframedmover" }, - { 0x879F, "validateloadoutownership" }, - { 0x87A0, "validateoperatorownership" }, - { 0x87A1, "setmoverantilagged" }, - { 0x87A2, "setwristwatchtime" }, - { 0x87A3, "clearwristwatchtime" }, - { 0x87A4, "_meth_87A4" }, - { 0x87A5, "_meth_87A5" }, - { 0x87A6, "_meth_87A6" }, - { 0x87A7, "_meth_87A7" }, - { 0x87A8, "_meth_87A8" }, - { 0x87A9, "_meth_87A9" }, - { 0x87AA, "_meth_87AA" }, - { 0x87AB, "_meth_87AB" }, - { 0x87AC, "_meth_87AC" }, - { 0x87AD, "_meth_87AD" }, - { 0x87AE, "_meth_87AE" }, - { 0x87AF, "_meth_87AF" }, - { 0x87B0, "_meth_87B0" }, - { 0x87B1, "_meth_87B1" }, - { 0x87B2, "_meth_87B2" }, - { 0x87B3, "_meth_87B3" }, - { 0x87B4, "_meth_87B4" }, - { 0x87B5, "_meth_87B5" }, - { 0x87B6, "_meth_87B6" }, - { 0x87B7, "_meth_87B7" }, - { 0x87B8, "_meth_87B8" }, - { 0x87B9, "_meth_87B9" }, - { 0x87BA, "_meth_87BA" }, - { 0x87BB, "_meth_87BB" }, - { 0x87BC, "_meth_87BC" }, - { 0x87BD, "_meth_87BD" }, - { 0x87BE, "_meth_87BE" }, - { 0x87BF, "_meth_87BF" }, - { 0x87C0, "_meth_87C0" }, - { 0x87C1, "_meth_87C1" }, - { 0x87C2, "_meth_87C2" }, - { 0x87C3, "_meth_87C3" }, - { 0x87C4, "_meth_87C4" }, - { 0x87C5, "_meth_87C5" }, - { 0x87C6, "_meth_87C6" }, - { 0x87C7, "_meth_87C7" }, - { 0x87C8, "_meth_87C8" }, - { 0x87C9, "_meth_87C9" }, - { 0x87CA, "_meth_87CA" }, - { 0x87CB, "_meth_87CB" }, - { 0x87CC, "_meth_87CC" }, - { 0x87CD, "_meth_87CD" }, - { 0x87CE, "_meth_87CE" }, - { 0x87CF, "_meth_87CF" }, - { 0x87D0, "_meth_87D0" }, - { 0x87D1, "_meth_87D1" }, - { 0x87D2, "_meth_87D2" }, - { 0x87D3, "_meth_87D3" }, - { 0x87D4, "_meth_87D4" }, - { 0x87D5, "_meth_87D5" }, - { 0x87D6, "_meth_87D6" }, - { 0x87D7, "_meth_87D7" }, - { 0x87D8, "_meth_87D8" }, - { 0x87D9, "_meth_87D9" }, - { 0x87DA, "_meth_87DA" }, - { 0x87DB, "_meth_87DB" }, - { 0x87DC, "_meth_87DC" }, - { 0x87DD, "_meth_87DD" }, - { 0x87DE, "_meth_87DE" }, - { 0x87DF, "_meth_87DF" }, - { 0x87E0, "_meth_87E0" }, - { 0x87E1, "_meth_87E1" }, - { 0x87E2, "_meth_87E2" }, - { 0x87E3, "_meth_87E3" }, - { 0x87E4, "_meth_87E4" }, - { 0x87E5, "_meth_87E5" }, - { 0x87E6, "_meth_87E6" }, - { 0x87E7, "_meth_87E7" }, - { 0x87E8, "_meth_87E8" }, - { 0x87E9, "_meth_87E9" }, - { 0x87EA, "_meth_87EA" }, - { 0x87EB, "_meth_87EB" }, - { 0x87EC, "_meth_87EC" }, - { 0x87ED, "_meth_87ED" }, - { 0x87EE, "_meth_87EE" }, - { 0x87EF, "_meth_87EF" }, -}}; - -const std::array, 72014> token_list +extern std::array, token_count> const token_list {{ { 0x0000, "" }, { 0x0001, "pl#" }, @@ -87358,53 +83772,4 @@ const std::array, 72014> token_list // { 0x1472F, "" }, }}; -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()); - function_map.reserve(function_list.size()); - function_map_rev.reserve(function_list.size()); - method_map.reserve(method_list.size()); - method_map_rev.reserve(method_list.size()); - token_map.reserve(token_list.size()); - token_map_rev.reserve(token_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 : function_list) - { - function_map.insert({ entry.first, entry.second }); - function_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : method_list) - { - method_map.insert({ entry.first, entry.second }); - method_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : token_list) - { - token_map.insert({ entry.first, entry.second }); - token_map_rev.insert({ entry.second, entry.first }); - } - } -}; - -__init__ _; - } // namespace xsk::gsc::iw8 - -#ifdef _MSC_VER -#pragma warning(pop) -#endif diff --git a/src/iw8/stdafx.cpp b/src/iw8/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/iw8/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/iw8/stdafx.hpp b/src/iw8/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/iw8/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/iw8/xsk/assembler.cpp b/src/iw8/xsk/assembler.cpp deleted file mode 100644 index 5d2e957e..00000000 --- a/src/iw8/xsk/assembler.cpp +++ /dev/null @@ -1,638 +0,0 @@ -// 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 "iw8.hpp" - -namespace xsk::gsc::iw8 -{ - -auto assembler::output_script() -> std::vector -{ - std::vector script; - - if (script_ == nullptr) return script; - - script.resize(script_->pos()); - std::memcpy(script.data(), script_->buffer().data(), script.size()); - - return script; -} - -auto assembler::output_stack() -> std::vector -{ - std::vector stack; - - if (stack_ == nullptr) return stack; - - stack.resize(stack_->pos()); - std::memcpy(stack.data(), stack_->buffer().data(), stack.size()); - - return stack; -} - -void assembler::assemble(const std::string& file, std::vector& data) -{ - std::vector assembly = utils::string::clean_buffer_lines(data); - std::vector functions; - function::ptr func = nullptr; - std::uint32_t index = 1; - std::uint16_t switchnum = 0; - - for (auto& line : assembly) - { - if (line == "" || line.substr(0, 2) == "//") - { - continue; - } - else if (line.substr(0, 4) == "sub_") - { - func = std::make_unique(); - func->index = index; - func->name = line.substr(4); - } - else if (line.substr(0, 4) == "end_") - { - if (func != nullptr) - { - func->size = index - func->index; - functions.push_back(std::move(func)); - } - } - else if (line.substr(0, 4) == "loc_") - { - func->labels[index] = line; - } - else - { - auto opdata = utils::string::parse_code(line); - - if (switchnum) - { - if (opdata[0] == "case" || opdata[0] == "default") - { - for (auto& entry : opdata) - { - func->instructions.back()->data.push_back(entry); - } - switchnum--; - continue; - } - - throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); - } - else - { - auto inst = std::make_unique(); - inst->index = index; - inst->opcode = resolver::opcode_id(opdata[0]); - inst->size = opcode_size(inst->opcode); - opdata.erase(opdata.begin()); - inst->data = std::move(opdata); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = inst->data[0].substr(4); - break; - case opcode::OP_endswitch: - switchnum = static_cast(std::stoi(inst->data[0])); - inst->size += 7 * switchnum; - break; - default: - break; - } - - index += inst->size; - func->instructions.push_back(std::move(inst)); - } - } - } - - assemble(file, functions); -} - -void assembler::assemble(const std::string& file, std::vector& funcs) -{ - script_ = std::make_unique(0x100000); - stack_ = std::make_unique(0x100000); - filename_ = file; - functions_ = std::move(funcs); - - script_->write(static_cast(opcode::OP_End)); - - for (const auto& func : functions_) - { - assemble_function(func); - } -} - -void assembler::assemble_function(const function::ptr& func) -{ - labels_ = func->labels; - - func->id = resolver::token_id(func->name); - - stack_->write(func->size); - stack_->write(func->id); - - if (func->id == 0) - { - stack_->write_c_string(encrypt_string(func->name)); - } - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_CastFieldObject: - case opcode::OP_plus: - case opcode::OP_GetGameRef: - case opcode::OP_GetThisthread: - case opcode::OP_greater: - case opcode::OP_shift_right: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_equality: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_notify: - case opcode::OP_PreScriptCall: - case opcode::OP_GetUndefined: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_size: - case opcode::OP_AddArray: - case opcode::OP_endon: - case opcode::OP_shift_left: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_Return: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetSelfObject: - case opcode::OP_GetGame: - case opcode::OP_EvalArray: - case opcode::OP_GetSelf: - case opcode::OP_End: - case opcode::OP_less_equal: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_checkclearparams: - case opcode::OP_waittillmatch2: - case opcode::OP_minus: - case opcode::OP_greater_equal: - case opcode::OP_vector: - case opcode::OP_ClearArray: - case opcode::OP_DecTop: - case opcode::OP_CastBool: - case opcode::OP_EvalArrayRef: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_waittill: - case opcode::OP_GetAnimObject: - case opcode::OP_mod: - case opcode::OP_clearparams: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_EmptyArray: - case opcode::OP_ClearVariableField: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_BoolComplement: - case opcode::OP_less: - case opcode::OP_BoolNot: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitframe: - case opcode::OP_GetLevelObject: - case opcode::OP_inc: - case opcode::OP_GetAnim: - case opcode::OP_SetVariableField: - case opcode::OP_divide: - case opcode::OP_multiply: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_bit_and: - case opcode::OP_voidCodepos: - case opcode::OP_inequality: - case opcode::OP_bit_ex_or: -/* case opcode::OP_NOP: - case opcode::OP_abort: - case opcode::OP_object: - case opcode::OP_thread_object: - case opcode::OP_EvalLocalVariable: - case opcode::OP_EvalLocalVariableRef: - case opcode::OP_breakpoint: - case opcode::OP_assignmentBreakpoint: - case opcode::OP_manualAndAssignmentBreakpoint:*/ - case opcode::OP_BoolNotAfterAnd: - case opcode::OP_IsDefined: - case opcode::OP_IsTrue: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->write(std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->write(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - 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(0); - stack_->write_c_string(encrypt_string(inst->data[0])); - break; - case opcode::OP_GetAnimation: - script_->write(0); - script_->write(0); - stack_->write_c_string(encrypt_string(inst->data[0])); - stack_->write_c_string(encrypt_string(inst->data[1])); - break; - case opcode::OP_GetAnimTree: - script_->write(0); - stack_->write_c_string(encrypt_string(inst->data[0])); - break; - case opcode::OP_waittillmatch: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - assemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - assemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - assemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - assemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - assemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - assemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - assemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - assemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - assemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - assemble_jump(inst, false, true); - break; - case opcode::OP_jump: - assemble_jump(inst, false, false); - break; - case opcode::OP_switch: - assemble_switch(inst); - break; - case opcode::OP_endswitch: - assemble_end_switch(inst); - break; -/* case opcode::OP_prof_begin: - script_->write(0); // TODO: skipped data - script_->write(0); - break; - case opcode::OP_prof_end: - script_->write(0); // TODO: skipped data - break; - case opcode::OP_EvalNewLocalArrayRefCached0_Precompiled: - case opcode::OP_SetNewLocalVariableFieldCached0_Precompiled: - case opcode::OP_CreateLocalVariable_Precompiled: - case opcode::OP_SafeCreateVariableFieldCached_Precompiled: - script_->write(static_cast(inst->opcode)); - script_->write(static_cast(std::stoi(inst->data[0]))); - break;*/ - case opcode::OP_FormalParams: -// case opcode::OP_FormalParams_Precompiled: - assemble_formal_params(inst); - break; -/* case opcode::OP_NativeGetLocalFunction: - case opcode::OP_NativeLocalFunctionCall: - case opcode::OP_NativeLocalFunctionCall2: - case opcode::OP_NativeLocalMethodCall: - assemble_local_call(inst, false); - break; - case opcode::OP_NativeGetFarFunction: - case opcode::OP_NativeFarFunctionCall: - case opcode::OP_NativeFarFunctionCall2: - case opcode::OP_NativeFarMethodCall: - assemble_far_call(inst, false); - break; - case opcode::OP_NativeLocalFunctionThreadCall: - case opcode::OP_NativeLocalMethodThreadCall: - case opcode::OP_NativeLocalFunctionChildThreadCall: - case opcode::OP_NativeLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_NativeFarFunctionThreadCall: - case opcode::OP_NativeFarMethodThreadCall: - case opcode::OP_NativeFarFunctionChildThreadCall: - case opcode::OP_NativeFarMethodChildThreadCall: - assemble_far_call(inst, true); - break;*/ - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } - - const auto id = method ? resolver::method_id(inst->data[0]) : resolver::function_id(inst->data[0]); - - script_->write(id); -} - -void assembler::assemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto addr = resolve_function(inst->data[0]); - const auto offset = static_cast(addr - inst->index - 1); - - assemble_offset(offset); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } -} - -void assembler::assemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->write(0); - script_->write(0); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[2]))); - } - - const auto file_id = resolver::token_id(inst->data[0]); - const auto func_id = resolver::token_id(inst->data[1]); - - stack_->write(file_id); - if (file_id == 0) stack_->write_c_string(encrypt_string(inst->data[0])); - stack_->write(func_id); - if (func_id == 0) stack_->write_c_string(encrypt_string(inst->data[1])); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const auto addr = resolve_label(inst->data[0]); - - script_->write(addr - inst->index - 4); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - - script_->write(static_cast(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); - stack_->write_c_string(encrypt_string(inst->data[1 + (3 * i) + 1])); - } - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 2]); - - assemble_offset(addr - index); - - index += 3; - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write(0); - stack_->write_c_string("\x01"); - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 1]); - - assemble_offset(addr - index); - - index += 3; - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::assemble_field_variable(const instruction::ptr& inst) -{ - auto id = resolver::token_id(inst->data[0]); - - if (id == 0) id = 0xFFFFFFFF; - - script_->write(id); - - if (id > max_string_id) - { - stack_->write(0); - stack_->write_c_string(encrypt_string(inst->data[0])); - } -} - -void assembler::assemble_formal_params(const instruction::ptr& inst) -{ - const auto count = std::stoi(inst->data[0]); - - script_->write(static_cast(count)); - - for (auto i = 1; i <= count; i++) - { - script_->write(static_cast(std::stoi(inst->data[i]))); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - const auto addr = resolve_label(inst->data[0]); - - if (expr) - { - script_->write(static_cast(addr - inst->index - 3)); - } - else if (back) - { - script_->write(static_cast((inst->index + 3) - addr)); - } - else - { - script_->write(static_cast(addr - inst->index - 5)); - } -} - -void assembler::assemble_offset(std::int32_t offset) -{ - std::array bytes = {}; - - offset = (offset << 8) >> 8; - - *reinterpret_cast(bytes.data()) = offset; - - script_->write(bytes[0]); - script_->write(bytes[1]); - script_->write(bytes[2]); -} - -auto assembler::resolve_function(const std::string& name) -> std::int32_t -{ - for (const auto& entry : functions_) - { - if (entry->name == name) - { - return entry->index; - } - } - - throw asm_error("couldn't resolve local function address of '" + name + "'!"); -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -auto assembler::encrypt_string(const std::string& str) -> std::string -{ - if (str.starts_with("_encstr_") && str.size() % 2 == 0) - { - std::string data{}; - - for (auto i = 8u; i < str.size(); i += 2) - { - data += static_cast(std::stoul(str.substr(i, 2), 0, 16)); - } - - return data; - } - - return str; -} - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/assembler.hpp b/src/iw8/xsk/assembler.hpp deleted file mode 100644 index 0f8c5872..00000000 --- a/src/iw8/xsk/assembler.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc::iw8 -{ - -class assembler : public gsc::assembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output_script() -> std::vector; - auto output_stack() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, std::vector& funcs); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void assemble_local_call(const instruction::ptr& inst, bool thread); - void assemble_far_call(const instruction::ptr& inst, bool thread); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void assemble_field_variable(const instruction::ptr& inst); - void assemble_formal_params(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst, bool expr, bool back); - void assemble_offset(std::int32_t offset); - auto resolve_function(const std::string& name) -> std::int32_t; - auto resolve_label(const std::string& name) -> std::int32_t; - auto encrypt_string(const std::string& str) -> std::string; -}; - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/compiler.cpp b/src/iw8/xsk/compiler.cpp deleted file mode 100644 index 6b9b1721..00000000 --- a/src/iw8/xsk/compiler.cpp +++ /dev/null @@ -1,3021 +0,0 @@ -// 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 "iw8.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -namespace xsk::gsc::iw8 -{ - -auto compiler::output() -> std::vector -{ - return std::move(assembly_); -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "an unknown error ocurred while parsing gsc file"); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_.clear(); - includes_.clear(); - animtrees_.clear(); - constants_.clear(); - local_functions_.clear(); - index_ = 1; - 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& inc : includes_) - { - if (inc.name == path) - { - throw comp_error(include->loc(), "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(), "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 developer block comment"); - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) -{ - const auto itr = constants_.find(constant->name->value); - - if (itr != constants_.end()) - throw comp_error(constant->loc(), "duplicated constant '" + constant->name->value + "'"); - - 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; - - auto blk = std::make_unique(); - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - break_blks_.clear(); - continue_blks_.clear(); - - process_thread(thread, blk); - - emit_expr_parameters(thread->params, blk); - emit_stmt_list(thread->stmt, blk, true); - emit_opcode(opcode::OP_End); - - function_->size = index_ - function_->index; - assembly_.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list, blk, last); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev, blk, last); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend, blk); - break; - case ast::kind::stmt_waitframe: - emit_stmt_waitframe(stmt.as_waitframe, blk); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if, blk, last); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse, blk, last); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case, blk); - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default, blk); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return, blk); - break; - case ast::kind::stmt_breakpoint: - emit_stmt_breakpoint(stmt.as_breakpoint, blk); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin, blk); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end, blk); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last) -{ - for (const auto& entry : stmt->list) - { - bool last_ = (&entry == &stmt->list.back() && last) ? true : false; - emit_stmt(entry, blk, last_); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last) -{ - emit_stmt_list(stmt->list, blk, last); -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - 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, const block::ptr& blk) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, blk, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, blk, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_endon); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } - - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->time, blk); - emit_opcode(opcode::OP_wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittill); - - for (const auto& entry : stmt->args->list) - { - variable_create(entry.as_identifier, blk); - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(entry.as_identifier, blk)); - } - - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - emit_expr_arguments(stmt->args, blk); - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_waittillmatch2); - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waittillFrameEnd); -} - -void compiler::emit_stmt_waitframe(const ast::stmt_waitframe::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waitframe); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - blk->transfer(stmt->blk); - - emit_stmt(stmt->stmt, stmt->blk, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last) -{ - std::vector childs; - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - blk->transfer(stmt->blk_if); - - emit_stmt(stmt->stmt_if, stmt->blk_if, last); - - emit_remove_local_vars(stmt->blk_if); - - if (stmt->blk_if->abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - - last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - - blk->transfer(stmt->blk_else); - - emit_stmt(stmt->stmt_else, stmt->blk_else, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk_else); - - if (stmt->blk_else->abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - - insert_label(end_loc); - - blk->init_from_child(childs); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_stmt(stmt->init, blk, false); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->blk_iter); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - can_break_ = true; - can_continue_ = true; - - emit_stmt(stmt->stmt, stmt->blk, false); - - if (stmt->blk->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->blk.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->blk_iter->init_from_child(continue_blks_); - - emit_stmt(stmt->iter, stmt->blk_iter, false); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_expr(stmt->array_expr, blk); - emit_expr_variable_ref(stmt->array, blk, true); - emit_expr_variable(stmt->array, blk); - emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); - emit_expr_variable_ref(stmt->key_expr, blk, true); - - blk->transfer(stmt->ctx); - stmt->ctx->loc_break = break_loc; - stmt->ctx->loc_continue = continue_loc; - - emit_create_local_vars(stmt->ctx); - - blk->local_vars_create_count = stmt->ctx->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->ctx_post); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr, blk); - emit_opcode(opcode::OP_IsDefined); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr, stmt->ctx); - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->array.as_identifier, stmt->ctx)); - emit_expr_variable_ref(stmt->value_expr, stmt->ctx, true); - emit_stmt(stmt->stmt, stmt->ctx, false); - - if (stmt->ctx->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->ctx.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->ctx_post->init_from_child(continue_blks_); - - emit_expr_variable(stmt->key_expr, stmt->ctx_post); - emit_expr_variable(stmt->array, stmt->ctx_post); - emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); - emit_expr_variable_ref(stmt->key_expr, stmt->ctx_post, true); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - emit_expr_clear_local(stmt->array.as_identifier, blk); - if (!stmt->use_key) emit_expr_clear_local(stmt->key_expr.as_identifier, blk); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_break = can_break_; - break_blks_.clear(); - can_break_ = false; - - auto jmptable_loc = create_label(); - auto break_loc = create_label(); - - emit_expr(stmt->test, blk); - 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; - block* default_ctx = nullptr; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - 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"); - } - - blk->transfer(case_->blk); - case_->blk->loc_break = break_loc; - emit_stmt_list(case_->stmt, case_->blk, false); - if (case_->stmt->list.size() > 0) - emit_remove_local_vars(case_->blk); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - - has_default = true; - default_ctx = entry.as_default->blk.get(); - - blk->transfer(entry.as_default->blk); - entry.as_default->blk->loc_break = break_loc; - emit_stmt_list(entry.as_default->stmt, entry.as_default->blk, false); - if (entry.as_default->stmt->list.size() > 0) - emit_remove_local_vars(entry.as_default->blk); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - } - blk->init_from_child(break_blks_); - } - - insert_label(jmptable_loc); - - emit_opcode(opcode::OP_endswitch, data); - - auto offset = static_cast(7 * stmt->stmt->list.size()); - function_->instructions.back()->size += offset; - index_ += offset; - - insert_label(break_loc); - - can_break_ = old_break; - break_blks_ = old_breaks; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) -{ - if (!can_break_ || blk->abort != abort_t::abort_none || blk->loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - break_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_break; - emit_opcode(opcode::OP_jump, blk->loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) -{ - if (!can_continue_ || blk->abort != abort_t::abort_none || blk->loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - continue_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_continue; - emit_opcode(opcode::OP_jump, blk->loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - blk->abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr, blk); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child, blk); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate, blk); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - break; - case ast::kind::expr_isdefined: - emit_expr_isdefined(expr.as_isdefined, blk); - break; - case ast::kind::expr_istrue: - emit_expr_istrue(expr.as_istrue, blk); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference, blk); - break; - case ast::kind::expr_add_array: - emit_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_thisthread: - emit_opcode(opcode::OP_GetThisthread); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - 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, blk); - 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, const block::ptr& blk) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue, blk); - } - else if (expr->lvalue == ast::kind::expr_tuple) - { - emit_expr(expr->rvalue, blk); - emit_expr_tuple(expr->lvalue.as_tuple, blk); - } - else - { - emit_expr(expr->rvalue, blk); - emit_expr_variable_ref(expr->lvalue, blk, true); - } - - return; - } - - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - 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_mod); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_ex_or); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, blk, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key, blk); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, blk, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj, blk); - 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, blk, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk) -{ - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); - else - emit_opcode(opcode::OP_ClearLocalVariableFieldCached, variable_access_index(expr, blk)); -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_inc); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_dec); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr, blk); - emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr, blk); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_equality); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_inequality); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_less); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_greater); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_less_equal); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_greater_equal); - 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_ex_or); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_mod); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - - if (expr->rvalue == ast::kind::expr_not) - { - emit_expr(expr->rvalue.as_not->rvalue, blk); - emit_opcode(opcode::OP_BoolNotAfterAnd); - } - else - { - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - } - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - - if (expr->rvalue == ast::kind::expr_not) - { - emit_expr(expr->rvalue.as_not->rvalue, blk); - emit_opcode(opcode::OP_BoolNotAfterAnd); - } - else - { - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - } - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt && mode_ == gsc::build::prod) - { - const auto& name = expr->name->value; - if (name == "assert" || name == "assertex" || name == "assertmsg") return; - } - - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal && expr->args->list.size() > 0) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptLocalFunctionCall, expr->name->value); - else - emit_opcode(opcode::OP_ScriptLocalFunctionCall2, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptFarFunctionCall, { expr->path->value, expr->name->value }); - else - emit_opcode(opcode::OP_ScriptFarFunctionCall2, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltin0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltin1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltin2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltin3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltin4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltin5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltin, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptLocalMethodCall, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFarMethodCall, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltinMethod0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltinMethod1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltinMethod2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltinMethod3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltinMethod4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltinMethod5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltinMethod, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_EmptyArray); - - for (const auto& arg : expr->args->list) - { - emit_expr(arg, blk); - emit_opcode(opcode::OP_AddArray); - } -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) -{ - auto num = static_cast(expr->list.size()); - - if (num) - { - std::vector data; - - data.push_back(utils::string::va("%d", num)); - - for (const auto& entry : expr->list) - { - variable_initialize(entry, blk); - data.push_back(variable_create_index(entry, blk)); - } - - emit_opcode(opcode::OP_FormalParams, data); - function_->instructions.back()->size += num; - index_ += num; - } - else - { - emit_opcode( opcode::OP_checkclearparams); - } -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry, blk); - } -} - -void compiler::emit_expr_isdefined(const ast::expr_isdefined::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->expr, blk); - emit_opcode(opcode::OP_IsDefined); -} - -void compiler::emit_expr_istrue(const ast::expr_istrue::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->expr, blk); - emit_opcode(opcode::OP_IsTrue); -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) -{ - bool method = false; - auto type = resolve_reference_type(expr, method); - - switch (type) - { - case ast::call::type::local: - emit_opcode(opcode::OP_GetLocalFunction, expr->name->value); - break; - case ast::call::type::far: - emit_opcode(opcode::OP_GetFarFunction, { expr->path->value, expr->name->value }); - break; - case ast::call::type::builtin: - if (method) - emit_opcode(opcode::OP_GetBuiltinMethod, expr->name->value); - else - emit_opcode(opcode::OP_GetBuiltinFunction, expr->name->value); - break; - } -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_size); -} - -void compiler::emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - emit_expr_variable_ref(expr->temp, blk, true); - - auto index = 0; - - for (const auto& entry : expr->list) - { - if (index == 0) - emit_opcode(opcode::OP_GetZero); - else - emit_opcode(opcode::OP_GetByte, utils::string::va("%d", index)); - - index++; - - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->temp.as_identifier, blk)); - - emit_expr_variable_ref(entry, blk, true); - } - - emit_expr_clear_local(expr->temp.as_identifier, blk); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, blk, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, blk, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, blk, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set) -{ - emit_expr(expr->key, blk); - - 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, blk, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - { - if (!variable_initialized(expr->obj.as_identifier, blk)) - { - variable_initialize(expr->obj.as_identifier, blk); - emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(expr->obj.as_identifier, blk)); - - if (!set) throw comp_error(expr->loc(), "INTERNAL: VAR CREATED BUT NOT SET!"); - } - else if (variable_stack_index(expr->obj.as_identifier, blk) == 0) - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached0); - } - else - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access_index(expr->obj.as_identifier, blk)); - } - - 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, const block::ptr& blk, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); - break; - case ast::kind::expr_anim: - set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); - break; - case ast::kind::expr_self: - set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - 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, blk); - 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_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, 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 + "'"); - } - - if (set) - { - if (!variable_initialized(expr, blk)) - { - variable_initialize(expr, blk); - emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(expr, blk)); - } - else if (variable_stack_index(expr, blk) == 0) - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached0); - } - else - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached, variable_access_index(expr, blk)); - } - } - else - { - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_EvalLocalVariableRefCached0); - else - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access_index(expr, blk)); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->key, blk); - - if (expr->obj == ast::kind::expr_identifier) - { - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->obj.as_identifier, blk)); - } - else - { - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_EvalArray); - } -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_EvalLevelFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_EvalAnimFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_EvalSelfFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, const block::ptr& blk) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - emit_expr(itr->second, blk); - return; - } - - // is local var - auto index = variable_stack_index(expr, blk); - - switch (index) - { - case 0: - emit_opcode(opcode::OP_EvalLocalVariableCached0); - break; - case 1: - emit_opcode(opcode::OP_EvalLocalVariableCached1); - break; - case 2: - emit_opcode(opcode::OP_EvalLocalVariableCached2); - break; - case 3: - emit_opcode(opcode::OP_EvalLocalVariableCached3); - break; - case 4: - emit_opcode(opcode::OP_EvalLocalVariableCached4); - break; - case 5: - emit_opcode(opcode::OP_EvalLocalVariableCached5); - break; - default: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access_index(expr, blk)); - break; - } -} - -void compiler::emit_expr_object(const ast::expr& expr, const block::ptr& blk) -{ - 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, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr.as_identifier, blk)); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk) -{ - std::vector data; - - bool isexpr = false; - - 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, blk); - emit_expr(expr->y, blk); - emit_expr(expr->x, blk); - 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(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimation, { "", expr->value }); - } - else - { - emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); - tree.loaded = true; - } -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error(expr->loc(), "trying to use animtree without specified using animtree"); - } - - auto& tree = animtrees_.back(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimTree, ""); - } - else - { - emit_opcode(opcode::OP_GetAnimTree, tree.name); - tree.loaded = true; - } -} - -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_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_create_local_vars(const block::ptr& blk) -{ - if (blk->local_vars_create_count != blk->local_vars_public_count) - { - for (auto i = blk->local_vars_create_count; i < blk->local_vars_public_count; i++) - { - auto data = utils::string::va("%d", blk->local_vars.at(i).create); - emit_opcode(opcode::OP_CreateLocalVariable, data); - blk->local_vars.at(i).init = true; - } - blk->local_vars_create_count = blk->local_vars_public_count; - } -} - -void compiler::emit_remove_local_vars(const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - auto count = blk->local_vars_create_count - blk->local_vars_public_count; - - if (count > 0) - { - auto data = utils::string::va("%d", count); - emit_opcode(opcode::OP_RemoveLocalVariables, data); - } - } -} - -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, const block::ptr& blk) -{ - process_expr_parameters(decl->params, blk); - process_stmt_list(decl->stmt, blk); -} - -void compiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - 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_waitframe: - case ast::kind::stmt_case: - case ast::kind::stmt_default: - 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, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk) -{ - process_stmt_list(stmt->list, blk); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - 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, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - blk->merge(childs); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - stmt->blk_if = std::make_unique(); - stmt->blk_else = std::make_unique(); - - blk->copy(stmt->blk_if); - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - blk->copy(stmt->blk_else); - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - blk->merge(childs); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - stmt->blk = std::make_unique(); - stmt->blk_iter = std::make_unique(); - - process_stmt(stmt->init, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->blk); - blk->copy(stmt->blk_iter); - - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_stmt(stmt->iter, stmt->blk_iter); - - blk->append({ stmt->blk_iter.get() }); - blk->merge({ stmt->blk_iter.get() }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto array_name = utils::string::va("_temp_%d", ++label_idx_); - auto key_name = utils::string::va("_temp_%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; - - // calculate variables - - stmt->ctx = std::make_unique(); - stmt->ctx_post = std::make_unique(); - - // calculate pre_expr variables - process_expr(stmt->array, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->ctx); - blk->copy(stmt->ctx_post); - - // calculate stmt variables & add missing array access as first stmt - process_expr(stmt->value_expr, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - continue_blks_.push_back(stmt->ctx.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_expr(stmt->key_expr, stmt->ctx_post); - - blk->append({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - // calculate variables - stmt->ctx = std::make_unique(); - std::vector childs; - auto abort = abort_t::abort_return; - bool has_default = false; - block* default_ctx = nullptr; - auto old_breaks = break_blks_; - break_blks_.clear(); - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->copy(entry.as_case->blk); - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort != abort_t::abort_none) - { - if (entry.as_case->blk->abort == abort_t::abort_break ) - { - entry.as_case->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_case->blk.get()); - } - else if (entry.as_case->blk->abort <= abort ) - { - abort = entry.as_case->blk->abort; - } - } - } - else if (entry == ast::kind::stmt_default) - { - entry.as_default->blk = std::make_unique(); - blk->copy(entry.as_default->blk); - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - has_default = true; - default_ctx = entry.as_default->blk.get(); - - if (entry.as_default->blk->abort != abort_t::abort_none) - { - if (entry.as_default->blk->abort == abort_t::abort_break ) - { - entry.as_default->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_default->blk.get()); - } - else if (entry.as_default->blk->abort <= abort ) - { - abort = entry.as_default->blk->abort; - } - } - } - } - - stmt->stmt =std::move(stmt_list); - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - } - - blk->append(break_blks_); - blk->merge(childs); - } - - break_blks_ = old_breaks; -} - -void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - break_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_break; - } -} - -void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - continue_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_continue; - } -} - -void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } -} - -void compiler::process_expr(const ast::expr& expr, const block::ptr& blk) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value, blk); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj, blk); - } - else if (expr == ast::kind::expr_tuple) - { - process_expr_tuple(expr.as_tuple, blk); - } -} - -void compiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - auto array = utils::string::va("_temp_%d", ++label_idx_); - expr->temp = ast::expr(std::make_unique(expr->loc(), array)); - - process_expr(expr->temp, blk); - - for (const auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk) -{ - for (const auto& entry : decl->list) - { - variable_register(entry->value, blk); - } -} - -void compiler::variable_register(const std::string& name, const block::ptr& blk) -{ - auto it = std::find_if (blk->local_vars.begin(), blk->local_vars.end(), - [&](const gsc::local_var& v) { return v.name == name; }); - - if (it == blk->local_vars.end()) - { - auto found = false; - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - blk->local_vars.push_back({ name, static_cast(i), false }); - found = true; - break; - } - } - - if (!found) - { - blk->local_vars.push_back({ name, stack_idx_, false }); - local_stack_.push_back(name); - stack_idx_++; - } - } -} - -void compiler::variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::uint32_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (!blk->local_vars[i].init) - { - for (std::uint32_t j = 0; j < i; j++) - { - if (!blk->local_vars[j].init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", blk->local_vars[j].create)); - blk->local_vars[j].init = true; - } - } - blk->local_vars[i].init = true; - blk->local_vars_create_count = i + 1; - return; - } - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -void compiler::variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - auto& var = blk->local_vars.at(i); - if (var.name == name->value) - { - if (!var.init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); - var.init = true; - blk->local_vars_create_count++; - } - return; - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return static_cast(blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - return utils::string::va("%d", blk->local_vars[i].create); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return utils::string::va("%d", blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - return blk->local_vars.at(i).init; - } - } - - 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_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jump: - case opcode::OP_jumpback: - case opcode::OP_switch: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_endswitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - -auto compiler::map_known_includes(const std::string&) -> bool -{ - return false; -} - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/compiler.hpp b/src/iw8/xsk/compiler.hpp deleted file mode 100644 index 3e17576c..00000000 --- a/src/iw8/xsk/compiler.hpp +++ /dev/null @@ -1,162 +0,0 @@ -// 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::gsc::iw8 -{ - -enum class opcode : std::uint8_t; - -class compiler : public gsc::compiler -{ - build mode_; - std::string filename_; - std::vector assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector break_blks_; - std::vector continue_blks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - -public: - auto output() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_constant(const ast::decl_constant::ptr& constant); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last); - void emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void emit_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt, const block::ptr& blk); - void emit_stmt_waitframe(const ast::stmt_waitframe::ptr& stmt, const block::ptr& blk); - void emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk); - void emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk); - void emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk); - void emit_expr(const ast::expr& expr, const block::ptr& blk); - void emit_expr_assign(const ast::expr_assign::ptr& expr, const block::ptr& blk); - void emit_expr_clear(const ast::expr& expr, const block::ptr& blk); - void emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk); - void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void emit_expr_isdefined(const ast::expr_isdefined::ptr& expr, const block::ptr& blk); - void emit_expr_istrue(const ast::expr_istrue::ptr& expr, const block::ptr& blk); - void emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk); - void emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_variable(const ast::expr& expr, const block::ptr& blk); - void emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void emit_expr_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_object(const ast::expr& expr, const block::ptr& blk); - void emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_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_create_local_vars(const block::ptr& blk); - void emit_remove_local_vars(const block::ptr& blk); - 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, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(const ast::expr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk); - void variable_register(const std::string& name, const block::ptr& blk); - void variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk); - void variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk); - auto variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t; - auto variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool; - 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; -}; - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/context.cpp b/src/iw8/xsk/context.cpp deleted file mode 100644 index ed18fa0e..00000000 --- a/src/iw8/xsk/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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 "iw8.hpp" - -namespace xsk::gsc::iw8 -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/context.hpp b/src/iw8/xsk/context.hpp deleted file mode 100644 index a0277fb6..00000000 --- a/src/iw8/xsk/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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::gsc::iw8 -{ - -class context : public gsc::context -{ - iw8::assembler assembler_; - iw8::disassembler disassembler_; - iw8::compiler compiler_; - iw8::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { return assembler_; } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { return compiler_; } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/decompiler.cpp b/src/iw8/xsk/decompiler.cpp deleted file mode 100644 index 5473a298..00000000 --- a/src/iw8/xsk/decompiler.cpp +++ /dev/null @@ -1,3479 +0,0 @@ -// 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 "iw8.hpp" - -namespace xsk::gsc::iw8 -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// IW8 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetLocalFunction: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalFunctionCall2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - 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_ScriptLocalFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalMethodCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodChildThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall2: - { - 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 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_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin1: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin3: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin4: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin5: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod1: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod2: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod3: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod4: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod5: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_waitframe: - { - auto stmt = ast::stmt(std::make_unique(loc)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_waittill: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto args = std::make_unique(loc); - auto node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_FormalParams: - { - auto count = std::stoi(inst->data[0]); - - for (auto i = 1; i <= count; i++) - { - func_->params->list.push_back(std::make_unique(loc, "var_" + inst->data[i])); - } - break; - } - case opcode::OP_IsDefined: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto node = std::make_unique(expr.loc(), std::move(expr)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_IsTrue: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto node = std::make_unique(expr.loc(), std::move(expr)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNotAfterAnd: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto node = std::make_unique(expr.loc(), std::move(expr)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // continue is at jumpback, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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 - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - auto use_key = true; - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - use_key = false; - } - - 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)), use_key)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(std::stoi(entry->value.substr(4))), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - auto var = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - auto var1 = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_isdefined: - process_expr(expr.as_isdefined->expr, blk); - break; - case ast::kind::expr_istrue: - process_expr(expr.as_istrue->expr, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); - blk->local_vars_create_count++; - } - - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/decompiler.hpp b/src/iw8/xsk/decompiler.hpp deleted file mode 100644 index 8b2a6e2e..00000000 --- a/src/iw8/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::iw8 -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/disassembler.cpp b/src/iw8/xsk/disassembler.cpp deleted file mode 100644 index 432d5728..00000000 --- a/src/iw8/xsk/disassembler.cpp +++ /dev/null @@ -1,655 +0,0 @@ -// 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 "iw8.hpp" - -namespace xsk::gsc::iw8 -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// IW8 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read(); - func->id = stack_->read(); - func->name = func->id == 0 ? decrypt_string(stack_->read_c_string()) : resolver::token_name(func->id); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_CastFieldObject: - case opcode::OP_plus: - case opcode::OP_GetGameRef: - case opcode::OP_GetThisthread: - case opcode::OP_greater: - case opcode::OP_shift_right: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_equality: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_notify: - case opcode::OP_PreScriptCall: - case opcode::OP_GetUndefined: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_size: - case opcode::OP_AddArray: - case opcode::OP_endon: - case opcode::OP_shift_left: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_Return: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetSelfObject: - case opcode::OP_GetGame: - case opcode::OP_EvalArray: - case opcode::OP_GetSelf: - case opcode::OP_End: - case opcode::OP_less_equal: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_checkclearparams: - case opcode::OP_waittillmatch2: - case opcode::OP_minus: - case opcode::OP_greater_equal: - case opcode::OP_vector: - case opcode::OP_ClearArray: - case opcode::OP_DecTop: - case opcode::OP_CastBool: - case opcode::OP_EvalArrayRef: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_waittill: - case opcode::OP_GetAnimObject: - case opcode::OP_mod: - case opcode::OP_clearparams: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_EmptyArray: - case opcode::OP_ClearVariableField: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_BoolComplement: - case opcode::OP_less: - case opcode::OP_BoolNot: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitframe: - case opcode::OP_GetLevelObject: - case opcode::OP_inc: - case opcode::OP_GetAnim: - case opcode::OP_SetVariableField: - case opcode::OP_divide: - case opcode::OP_multiply: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_bit_and: - case opcode::OP_voidCodepos: - case opcode::OP_inequality: - case opcode::OP_bit_ex_or: -// case opcode::OP_NOP: -// case opcode::OP_abort: -// case opcode::OP_object: -// case opcode::OP_thread_object: - case opcode::OP_EvalLocalVariable: - case opcode::OP_EvalLocalVariableRef: -// case opcode::OP_breakpoint: -// case opcode::OP_assignmentBreakpoint: -// case opcode::OP_manualAndAssignmentBreakpoint: - case opcode::OP_BoolNotAfterAnd: - case opcode::OP_IsDefined: - case opcode::OP_IsTrue: - 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->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetVector: - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(4); - inst->data.push_back(utils::string::to_literal(decrypt_string(stack_->read_c_string()))); - break; - case opcode::OP_GetAnimation: - script_->seek(8); - inst->data.push_back(utils::string::quote(decrypt_string(stack_->read_c_string()), false)); - inst->data.push_back(utils::string::quote(decrypt_string(stack_->read_c_string()), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(decrypt_string(stack_->read_c_string()), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - disassemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; -/* case opcode::OP_prof_begin: - script_->seek(5); // TODO: skipped data - break; - case opcode::OP_prof_end: - script_->seek(1); // TODO: skipped data - break; - case opcode::OP_EvalNewLocalArrayRefCached0_Precompiled: - case opcode::OP_SetNewLocalVariableFieldCached0_Precompiled: - case opcode::OP_CreateLocalVariable_Precompiled: - case opcode::OP_SafeCreateVariableFieldCached_Precompiled: - inst->data.push_back(utils::string::va("%i", script_->read())); - break;*/ - case opcode::OP_FormalParams: - case opcode::OP_FormalParams_Precompiled: - disassemble_formal_params(inst); - break; -/* case opcode::OP_NativeGetLocalFunction: - case opcode::OP_NativeLocalFunctionCall: - case opcode::OP_NativeLocalFunctionCall2: - case opcode::OP_NativeLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_NativeGetFarFunction: - case opcode::OP_NativeFarFunctionCall: - case opcode::OP_NativeFarFunctionCall2: - case opcode::OP_NativeFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_NativeLocalFunctionThreadCall: - case opcode::OP_NativeLocalMethodThreadCall: - case opcode::OP_NativeLocalFunctionChildThreadCall: - case opcode::OP_NativeLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_NativeFarFunctionThreadCall: - case opcode::OP_NativeFarMethodThreadCall: - case opcode::OP_NativeFarFunctionChildThreadCall: - case opcode::OP_NativeFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break;*/ - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto id = script_->read(); - const auto name = method ? resolver::method_name(id) : resolver::function_name(id); - inst->data.emplace(inst->data.begin(), name); -} - -void disassembler::disassemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto offset = disassemble_offset(); - - inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(3); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto file_id = stack_->read(); - const auto file_name = file_id == 0 ? decrypt_string(stack_->read_c_string()) : resolver::token_name(file_id); - const auto func_id = stack_->read(); - const auto func_name = func_id == 0 ? decrypt_string(stack_->read_c_string()) : resolver::token_name(func_id); - - inst->data.emplace(inst->data.begin(), func_name); - inst->data.emplace(inst->data.begin(), file_name); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read(); - 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) -{ - const auto count = script_->read(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read(); - - if (value < 0x100000 && value > 0) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(decrypt_string(stack_->read_c_string()), false)); - } - else if (value == 0) - { - inst->data.push_back("default"); - stack_->read_c_string(); // this should be always [0x01 0x00] unencrypted - } - else - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - index += 4; - - const auto addr = disassemble_offset() + index; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 3; - inst->size += 7; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - const auto id = script_->read(); - std::string name; - - if (id > max_string_id) - { - auto temp = stack_->read(); - name = temp == 0 ? decrypt_string(stack_->read_c_string()) : std::to_string(temp); - } - else - { - name = resolver::token_name(id); - } - - inst->data.push_back(name); -} - -void disassembler::disassemble_formal_params(const instruction::ptr& inst) -{ - const auto count = script_->read(); - - inst->size += count; - inst->data.push_back(utils::string::va("%i", count)); - - for (auto i = 0u; i < count; i++) - { - inst->data.push_back(utils::string::va("%d", script_->read())); - } -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read(); - } - else if (back) - { - addr = inst->index + 3 - script_->read(); - } - else - { - addr = inst->index + 5 + script_->read(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -auto disassembler::disassemble_offset() -> std::int32_t -{ - std::array bytes = {}; - - for (auto i = 0; i < 3; i++) - { - bytes[i] = script_->read(); - } - - auto offset = *reinterpret_cast(bytes.data()); - - offset = (offset << 8) >> 8; - - return offset; -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = resolve_function(inst->data[0]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -auto disassembler::decrypt_string(const std::string& str) -> std::string -{ - if (str.size() > 0 && ((static_cast(str[0]) & 0xC0) == 0x80)) - { - std::string data = "_encstr_"; - - for (auto i = 0u; i < str.size(); i++) - { - data = utils::string::va("%s%02X", data.data(), static_cast(str[i])); - } - - return data; - } - - return str; -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s\n", func->name.data())); - - 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())); - } - - print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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; - } - if (casenum != totalcase - 1) - { - output_->write_string("\n"); - } - } - } - break; - default: - for (auto& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - break; - } - - output_->write_string("\n"); -} - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/disassembler.hpp b/src/iw8/xsk/disassembler.hpp deleted file mode 100644 index 995a280d..00000000 --- a/src/iw8/xsk/disassembler.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// 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::gsc::iw8 -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_local_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_formal_params(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - auto disassemble_offset() -> std::int32_t; - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - auto decrypt_string(const std::string& str) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/iw8.cpp b/src/iw8/xsk/iw8.cpp deleted file mode 100644 index 1851ba80..00000000 --- a/src/iw8/xsk/iw8.cpp +++ /dev/null @@ -1,219 +0,0 @@ -// 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 "iw8.hpp" - -namespace xsk::gsc::iw8 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_CastFieldObject: - case opcode::OP_plus: - case opcode::OP_GetGameRef: - case opcode::OP_GetThisthread: - case opcode::OP_greater: - case opcode::OP_shift_right: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_equality: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_notify: - case opcode::OP_PreScriptCall: - case opcode::OP_GetUndefined: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_size: - case opcode::OP_AddArray: - case opcode::OP_endon: - case opcode::OP_shift_left: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_Return: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetSelfObject: - case opcode::OP_GetGame: - case opcode::OP_EvalArray: - case opcode::OP_GetSelf: - case opcode::OP_End: - case opcode::OP_less_equal: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_checkclearparams: - case opcode::OP_waittillmatch2: - case opcode::OP_minus: - case opcode::OP_greater_equal: - case opcode::OP_vector: - case opcode::OP_ClearArray: - case opcode::OP_DecTop: - case opcode::OP_CastBool: - case opcode::OP_EvalArrayRef: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_waittill: - case opcode::OP_GetAnimObject: - case opcode::OP_mod: - case opcode::OP_clearparams: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_EmptyArray: - case opcode::OP_ClearVariableField: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_BoolComplement: - case opcode::OP_less: - case opcode::OP_BoolNot: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitframe: - case opcode::OP_GetLevelObject: - case opcode::OP_inc: - case opcode::OP_GetAnim: - case opcode::OP_SetVariableField: - case opcode::OP_divide: - case opcode::OP_multiply: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_bit_and: - case opcode::OP_voidCodepos: - case opcode::OP_inequality: - case opcode::OP_bit_ex_or: -/* case opcode::OP_NOP: - case opcode::OP_abort: - case opcode::OP_object: - case opcode::OP_thread_object: - case opcode::OP_EvalLocalVariable: - case opcode::OP_EvalLocalVariableRef: - case opcode::OP_breakpoint: - case opcode::OP_assignmentBreakpoint: - case opcode::OP_manualAndAssignmentBreakpoint:*/ - case opcode::OP_BoolNotAfterAnd: - case opcode::OP_IsDefined: - case opcode::OP_IsTrue: - return 1; - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_waittillmatch: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_GetByte: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_GetNegByte: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_GetAnimTree: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_CallBuiltinPointer: -// case opcode::OP_prof_end: - case opcode::OP_FormalParams: -/* case opcode::OP_EvalNewLocalArrayRefCached0_Precompiled: - case opcode::OP_SetNewLocalVariableFieldCached0_Precompiled: - case opcode::OP_CreateLocalVariable_Precompiled: - case opcode::OP_SafeCreateVariableFieldCached_Precompiled: - case opcode::OP_FormalParams_Precompiled:*/ - return 2; - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_jumpback: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_endswitch: - case opcode::OP_GetUnsignedShort: - case opcode::OP_JumpOnFalse: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - return 3; - case opcode::OP_CallBuiltin: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_GetLocalFunction: - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarMethodCall: - case opcode::OP_ScriptLocalFunctionCall: -/* case opcode::OP_NativeGetLocalFunction: - case opcode::OP_NativeLocalFunctionCall: - case opcode::OP_NativeLocalFunctionCall2: - case opcode::OP_NativeLocalMethodCall: - case opcode::OP_NativeGetFarFunction: - case opcode::OP_NativeFarFunctionCall: - case opcode::OP_NativeFarFunctionCall2: - case opcode::OP_NativeFarMethodCall:*/ - return 4; - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_EvalFieldVariable: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_GetInteger: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_GetIString: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ScriptLocalMethodChildThreadCall: - case opcode::OP_GetFloat: - case opcode::OP_GetString: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_switch: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_jump: -/* case opcode::OP_NativeLocalFunctionThreadCall: - case opcode::OP_NativeLocalMethodThreadCall: - case opcode::OP_NativeLocalFunctionChildThreadCall: - case opcode::OP_NativeLocalMethodChildThreadCall: - case opcode::OP_NativeFarFunctionThreadCall: - case opcode::OP_NativeFarMethodThreadCall: - case opcode::OP_NativeFarFunctionChildThreadCall: - case opcode::OP_NativeFarMethodChildThreadCall:*/ - return 5; -/* case opcode::OP_prof_begin: - return 6;*/ - case opcode::OP_GetAnimation: - return 9; - case opcode::OP_GetVector: - return 13; - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/iw8.hpp b/src/iw8/xsk/iw8.hpp deleted file mode 100644 index 9596218e..00000000 --- a/src/iw8/xsk/iw8.hpp +++ /dev/null @@ -1,219 +0,0 @@ -// 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 "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::iw8 -{ - -constexpr std::uint32_t max_string_id = 0x1472F; - -enum class opcode : std::uint8_t -{ - OP_CastFieldObject = 0x0, - OP_SetLocalVariableFieldCached = 0x1, - OP_plus = 0x2, - OP_RemoveLocalVariables = 0x3, - OP_EvalSelfFieldVariableRef = 0x4, - OP_ScriptFarMethodChildThreadCall = 0x5, - OP_GetGameRef = 0x6, - OP_EvalAnimFieldVariable = 0x7, - OP_EvalLevelFieldVariableRef = 0x8, - OP_GetThisthread = 0x9, - OP_greater = 0xA, - OP_waittillmatch = 0xB, - OP_shift_right = 0xC, - OP_dec = 0xD, - OP_JumpOnTrue = 0xE, - OP_bit_or = 0xF, - OP_equality = 0x10, - OP_ClearLocalVariableFieldCached0 = 0x11, - OP_notify = 0x12, - OP_GetVector = 0x13, - OP_ScriptMethodChildThreadCallPointer = 0x14, - OP_PreScriptCall = 0x15, - OP_GetByte = 0x16, - OP_ScriptFarThreadCall = 0x17, - OP_SetSelfFieldVariableField = 0x18, - OP_JumpOnFalseExpr = 0x19, - OP_GetUndefined = 0x1A, - OP_jumpback = 0x1B, - OP_JumpOnTrueExpr = 0x1C, - OP_CallBuiltin0 = 0x1D, - OP_CallBuiltin1 = 0x1E, - OP_CallBuiltin2 = 0x1F, - OP_CallBuiltin3 = 0x20, - OP_CallBuiltin4 = 0x21, - OP_CallBuiltin5 = 0x22, - OP_CallBuiltin = 0x23, - OP_SetLocalVariableFieldCached0 = 0x24, - OP_ClearFieldVariable = 0x25, - OP_GetLevel = 0x26, - OP_size = 0x27, - OP_SafeSetWaittillVariableFieldCached = 0x28, - OP_ScriptLocalMethodThreadCall = 0x29, - OP_AddArray = 0x2A, - OP_endon = 0x2B, - OP_EvalFieldVariable = 0x2C, - OP_shift_left = 0x2D, - OP_EvalLocalArrayRefCached0 = 0x2E, - OP_Return = 0x2F, - OP_CreateLocalVariable = 0x30, - OP_SafeSetVariableFieldCached0 = 0x31, - OP_GetBuiltinFunction = 0x32, - OP_ScriptLocalMethodCall = 0x33, - OP_CallBuiltinMethodPointer = 0x34, - OP_ScriptLocalChildThreadCall = 0x35, - OP_GetSelfObject = 0x36, - OP_GetGame = 0x37, - OP_SetLevelFieldVariableField = 0x38, - OP_EvalArray = 0x39, - OP_GetSelf = 0x3A, - OP_End = 0x3B, - OP_EvalSelfFieldVariable = 0x3C, - OP_less_equal = 0x3D, - OP_EvalLocalVariableCached0 = 0x3E, - OP_EvalLocalVariableCached1 = 0x3F, - OP_EvalLocalVariableCached2 = 0x40, - OP_EvalLocalVariableCached3 = 0x41, - OP_EvalLocalVariableCached4 = 0x42, - OP_EvalLocalVariableCached5 = 0x43, - OP_EvalLocalVariableCached = 0x44, - OP_EvalNewLocalArrayRefCached0 = 0x45, - OP_ScriptChildThreadCallPointer = 0x46, - OP_EvalLocalVariableObjectCached = 0x47, - OP_ScriptLocalThreadCall = 0x48, - OP_GetInteger = 0x49, - OP_ScriptMethodCallPointer = 0x4A, - OP_checkclearparams = 0x4B, - OP_SetAnimFieldVariableField = 0x4C, - OP_waittillmatch2 = 0x4D, - OP_minus = 0x4E, - OP_ScriptLocalFunctionCall2 = 0x4F, - OP_GetNegUnsignedShort = 0x50, - OP_GetNegByte = 0x51, - OP_SafeCreateVariableFieldCached = 0x52, - OP_greater_equal = 0x53, - OP_vector = 0x54, - OP_GetBuiltinMethod = 0x55, - OP_endswitch = 0x56, - OP_ClearArray = 0x57, - OP_DecTop = 0x58, - OP_CastBool = 0x59, - OP_EvalArrayRef = 0x5A, - OP_SetNewLocalVariableFieldCached0 = 0x5B, - OP_GetZero = 0x5C, - OP_wait = 0x5D, - OP_waittill = 0x5E, - OP_GetIString = 0x5F, - OP_ScriptFarFunctionCall = 0x60, - OP_GetAnimObject = 0x61, - OP_GetAnimTree = 0x62, - OP_EvalLocalArrayCached = 0x63, - OP_mod = 0x64, - OP_ScriptFarMethodThreadCall = 0x65, - OP_GetUnsignedShort = 0x66, - OP_clearparams = 0x67, - OP_ScriptMethodThreadCallPointer = 0x68, - OP_ScriptFunctionCallPointer = 0x69, - OP_EmptyArray = 0x6A, - OP_SafeSetVariableFieldCached = 0x6B, - OP_ClearVariableField = 0x6C, - OP_EvalFieldVariableRef = 0x6D, - OP_ScriptLocalMethodChildThreadCall = 0x6E, - OP_EvalNewLocalVariableRefCached0 = 0x6F, - OP_GetFloat = 0x70, - OP_EvalLocalVariableRefCached = 0x71, - OP_JumpOnFalse = 0x72, - OP_BoolComplement = 0x73, - OP_ScriptThreadCallPointer = 0x74, - OP_ScriptFarFunctionCall2 = 0x75, - OP_less = 0x76, - OP_BoolNot = 0x77, - OP_waittillFrameEnd = 0x78, - OP_waitframe = 0x79, - OP_GetString = 0x7A, - OP_EvalLevelFieldVariable = 0x7B, - OP_GetLevelObject = 0x7C, - OP_inc = 0x7D, - OP_CallBuiltinMethod0 = 0x7E, - OP_CallBuiltinMethod1 = 0x7F, - OP_CallBuiltinMethod2 = 0x80, - OP_CallBuiltinMethod3 = 0x81, - OP_CallBuiltinMethod4 = 0x82, - OP_CallBuiltinMethod5 = 0x83, - OP_CallBuiltinMethod = 0x84, - OP_GetAnim = 0x85, - OP_switch = 0x86, - OP_SetVariableField = 0x87, - OP_divide = 0x88, - OP_GetLocalFunction = 0x89, - OP_ScriptFarChildThreadCall = 0x8A, - OP_multiply = 0x8B, - OP_ClearLocalVariableFieldCached = 0x8C, - OP_EvalAnimFieldVariableRef = 0x8D, - OP_EvalLocalArrayRefCached = 0x8E, - OP_EvalLocalVariableRefCached0 = 0x8F, - OP_bit_and = 0x90, - OP_GetAnimation = 0x91, - OP_GetFarFunction = 0x92, - OP_CallBuiltinPointer = 0x93, - OP_jump = 0x94, - OP_voidCodepos = 0x95, - OP_ScriptFarMethodCall = 0x96, - OP_inequality = 0x97, - OP_ScriptLocalFunctionCall = 0x98, - OP_bit_ex_or = 0x99, - OP_NOP = 0x9A, - OP_abort = 0x9B, - OP_object = 0x9C, - OP_thread_object = 0x9D, - OP_EvalLocalVariable = 0x9E, - OP_EvalLocalVariableRef = 0x9F, - OP_prof_begin = 0xA0, - OP_prof_end = 0xA1, - OP_breakpoint = 0xA2, - OP_assignmentBreakpoint = 0xA3, - OP_manualAndAssignmentBreakpoint = 0xA4, - OP_BoolNotAfterAnd = 0xA5, - OP_FormalParams = 0xA6, - OP_IsDefined = 0xA7, - OP_IsTrue = 0xA8, - OP_NativeGetLocalFunction = 0xA9, - OP_NativeLocalFunctionCall = 0xAA, - OP_NativeLocalFunctionCall2 = 0xAB, - OP_NativeLocalMethodCall = 0xAC, - OP_NativeLocalFunctionThreadCall = 0xAD, - OP_NativeLocalMethodThreadCall = 0xAE, - OP_NativeLocalFunctionChildThreadCall = 0xAF, - OP_NativeLocalMethodChildThreadCall = 0xB0, - OP_NativeGetFarFunction = 0xB1, - OP_NativeFarFunctionCall = 0xB2, - OP_NativeFarFunctionCall2 = 0xB3, - OP_NativeFarMethodCall = 0xB4, - OP_NativeFarFunctionThreadCall = 0xB5, - OP_NativeFarMethodThreadCall = 0xB6, - OP_NativeFarFunctionChildThreadCall = 0xB7, - OP_NativeFarMethodChildThreadCall = 0xB8, - OP_EvalNewLocalArrayRefCached0_Precompiled = 0xB9, - OP_SetNewLocalVariableFieldCached0_Precompiled = 0xBA, - OP_CreateLocalVariable_Precompiled = 0xBB, - OP_SafeCreateVariableFieldCached_Precompiled = 0xBC, - OP_FormalParams_Precompiled = 0xBD, - OP_count = 0xBE, -}; - -auto opcode_size(std::uint8_t op) -> std::uint32_t; - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/lexer.cpp b/src/iw8/xsk/lexer.cpp deleted file mode 100644 index 3f9229ce..00000000 --- a/src/iw8/xsk/lexer.cpp +++ /dev/null @@ -1,862 +0,0 @@ -// 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 "iw8.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -xsk::gsc::iw8::parser::symbol_type IW8lex(xsk::gsc::iw8::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::gsc::iw8 -{ - -const std::unordered_map keyword_map -{{ - { "#define", parser::token::SH_DEFINE }, - { "#undef", parser::token::SH_UNDEF }, - { "#ifdef", parser::token::SH_IFDEF }, - { "#ifndef", parser::token::SH_IFNDEF }, - { "#if", parser::token::SH_IF }, - { "#elif", parser::token::SH_ELIF }, - { "#else", parser::token::SH_ELSE }, - { "#endif", parser::token::SH_ENDIF }, - { "#inline", parser::token::INLINE }, - { "#include", parser::token::INCLUDE }, - { "#using_animtree", parser::token::USINGTREE }, - { "#animtree", parser::token::ANIMTREE }, - { "endon", parser::token::ENDON }, - { "notify", parser::token::NOTIFY }, - { "wait", parser::token::WAIT }, - { "waittill", parser::token::WAITTILL }, - { "waittillmatch", parser::token::WAITTILLMATCH }, - { "waittillframeend", parser::token::WAITTILLFRAMEEND }, - { "waitframe", parser::token::WAITFRAME }, - { "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 }, - { "childthread", parser::token::CHILDTHREAD }, - { "thisthread", parser::token::THISTHREAD }, - { "call", parser::token::CALL }, - { "true", parser::token::TRUE }, - { "false", parser::token::FALSE }, - { "undefined", parser::token::UNDEFINED }, - { "size", parser::token::SIZE }, - { "game", parser::token::GAME }, - { "self", parser::token::SELF }, - { "anim", parser::token::ANIM }, - { "level", parser::token::LEVEL }, - { "isdefined", parser::token::ISDEFINED }, - { "istrue", parser::token::ISTRUE }, -}}; - -buffer::buffer() : length(0) -{ - data = static_cast(std::malloc(max_buf_size)); -} - -buffer::~buffer() -{ - if (data) std::free(data); -} - -bool buffer::push(char c) -{ - if (length >= max_buf_size) - return false; - - data[length++] = c; - return true; -} - -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) -{ - -} - -void reader::init(const char* data, size_t size) -{ - if (data && size) - { - state = reader::ok; - buffer_pos = data; - bytes_remaining = static_cast(size); - last_byte = 0; - current_byte = *data; - } - else - { - state = reader::end; - buffer_pos = 0; - bytes_remaining = 0; - last_byte = 0; - current_byte = 0; - } -} - -void reader::advance() -{ - ++buffer_pos; - - if (bytes_remaining-- == 1) - { - state = reader::end; - bytes_remaining = 0; - last_byte = current_byte; - current_byte = 0; - } - else - { - last_byte = current_byte; - current_byte = *buffer_pos; - } -} - -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) -{ - reader_.init(data, size); -} - -void lexer::push_header(const std::string& file) -{ - try - { - if (header_top_++ >= 10) - throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - - auto data = resolver::file_data(file + ".gsh"); - - readers_.push(reader_); - locs_.push(loc_); - loc_.initialize(std::get<0>(data)); - reader_.init(std::get<1>(data), std::get<2>(data)); - clean_ = true; - } - catch (const std::exception& e) - { - throw error("parsing header file '" + file + "': " + e.what()); - } -} - -void lexer::pop_header() -{ - header_top_--; - loc_ = locs_.top(); - locs_.pop(); - reader_ = readers_.top(); - readers_.pop(); -} - -void lexer::ban_header(const location& loc) -{ - if (header_top_ > 0) - { - throw comp_error(loc, "not allowed inside a gsh file"); - } -} - -auto lexer::lex() -> parser::symbol_type -{ - buffer_.length = 0; - state_ = state::start; - - while (true) - { - const auto& state = reader_.state; - auto& last = reader_.last_byte; - auto& curr = reader_.current_byte; - auto path = false; - loc_.step(); - - if (state == reader::end) - { - if (indev_) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (header_top_ > 0) - pop_header(); - else - return parser::make_IW8EOF(loc_); - } - - if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') - clean_ = false; - - advance(); - - switch (last) - { - case ' ': - case '\t': - case '\r': - loc_.step(); - continue; - case '\n': - loc_.lines(); - loc_.step(); - clean_ = true; - continue; - case '\\': - throw comp_error(loc_, "invalid token ('\\')"); - case '/': - if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') - return parser::make_DIV(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_DIV(loc_); - - if (last == '#') - { - if (indev_) - throw comp_error(loc_, "cannot recurse devblock ('/#')"); - - if (mode_ == build::dev) - { - indev_ = true; - return parser::make_DEVBEGIN(loc_); - } - else - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '#' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - } - else if (last == '@') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched script doc comment start ('/@')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '@' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '*') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched multiline comment start ('/*')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '*' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '/') - { - while (true) - { - if (state == reader::end) - break; - - if (curr == '\n') - break; - - advance(); - } - } - continue; - case '#': - if (curr == '/') - { - if (!indev_) - throw comp_error(loc_, "unmatched devblock end ('#/')"); - - advance(); - indev_ = false; - return parser::make_DEVEND(loc_); - } - - buffer_.push(last); - advance(); - - while (state == reader::ok) - { - if (last != ' ' || last != '\t') - break; - - advance(); - } - - if (state == reader::end || !((last > 64 && last < 91) || (last > 96 && last < 123))) - throw comp_error(loc_, "invalid preprocessor directive ('#')"); - - state_ = state::preprocessor; - goto lex_name; - case '*': - if (curr != '=' && curr != '/') - return parser::make_MUL(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_MUL(loc_); - - throw comp_error(loc_, "unmatched multiline comment end ('*/')"); - case '"': - state_ = state::string; - goto lex_string; - case '.': - if (curr < '0' || curr > '9') - return parser::make_DOT(loc_); - goto lex_number; - case '(': - return parser::make_LPAREN(loc_); - case ')': - return parser::make_RPAREN(loc_); - case '{': - return parser::make_LBRACE(loc_); - case '}': - return parser::make_RBRACE(loc_); - case '[': - return parser::make_LBRACKET(loc_); - case ']': - return parser::make_RBRACKET(loc_); - case ',': - return parser::make_COMMA(loc_); - case ';': - return parser::make_SEMICOLON(loc_); - case ':': - if (curr != ':') - return parser::make_COLON(loc_); - - advance(); - return parser::make_DOUBLECOLON(loc_); - case '?': - return parser::make_QMARK(loc_); - case '=': - if (curr != '=') - return parser::make_ASSIGN(loc_); - - advance(); - return parser::make_EQUALITY(loc_); - case '+': - if (curr != '+' && curr != '=') - return parser::make_ADD(loc_); - - advance(); - - if (last == '+') - return parser::make_INCREMENT(loc_); - - return parser::make_ASSIGN_ADD(loc_); - case '-': - if (curr != '-' && curr != '=') - return parser::make_SUB(loc_); - - advance(); - - if (last == '-') - return parser::make_DECREMENT(loc_); - - return parser::make_ASSIGN_SUB(loc_); - case '%': - if (curr != '=') - return parser::make_MOD(loc_); - - advance(); - - return parser::make_ASSIGN_MOD(loc_); - case '|': - if (curr != '|' && curr != '=') - return parser::make_BITWISE_OR(loc_); - - advance(); - - if (last == '|') - return parser::make_OR(loc_); - - return parser::make_ASSIGN_BW_OR(loc_); - case '&': - if (curr != '&' && curr != '=' && curr != '"') - return parser::make_BITWISE_AND(loc_); - - advance(); - - if (last == '&') - return parser::make_AND(loc_); - - if (last == '=') - return parser::make_ASSIGN_BW_AND(loc_); - - state_ = state::localize; - goto lex_string; - case '^': - if (curr != '=') - return parser::make_BITWISE_EXOR(loc_); - - advance(); - return parser::make_ASSIGN_BW_EXOR(loc_); - case '!': - if (curr != '=') - return parser::make_NOT(loc_); - - advance(); - return parser::make_INEQUALITY(loc_); - case '~': - return parser::make_COMPLEMENT(loc_); - case '<': - if (curr != '<' && curr != '=') - return parser::make_LESS(loc_); - - advance(); - if (last == '=') - return parser::make_LESS_EQUAL(loc_); - - if (curr != '=') - return parser::make_LSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_LSHIFT(loc_); - case '>': - if (curr != '>' && curr != '=') - return parser::make_GREATER(loc_); - - advance(); - - if (last == '=') - return parser::make_GREATER_EQUAL(loc_); - - if (curr != '=') - return parser::make_RSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_RSHIFT(loc_); - default: - if (last >= '0' && last <= '9') - goto lex_number; - else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) - goto lex_name; - - throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); - } - -lex_string: - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched string start ('\"')"); - - if (curr == '"') - { - advance(); - break; - } - - if (curr == '\n') - throw comp_error(loc_, "unterminated string literal"); - - if (curr == '\\') - { - advance(); - - if (state == reader::end) - throw comp_error(loc_, "invalid token ('\')"); - - char c = curr; - switch (curr) - { - case 't': c = '\t'; break; - case 'r': c = '\r'; break; - case 'n': c = '\n'; break; - case '"': c = '\"'; break; - case '\\': c = '\\'; break; - default: break; - } - - if (!buffer_.push(c)) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); - -lex_name: - buffer_.push(last); - - while (true) - { - if (state == reader::end) - break; - - if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) - break; - - if (curr == '\\') - { - if (last == '\\') - throw comp_error(loc_, "invalid path '\\\\'"); - - path = true; - if (!buffer_.push('/')) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::preprocessor) - { - auto token = parser::token::IW8UNDEF; - - if (buffer_.length < 16) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - { - if (itr->second > parser::token::SH_ENDIF) - return parser::symbol_type(itr->second, loc_); - - token = itr->second; - } - } - - preprocessor_run(token); - - state_ = state::start; - continue; - } - else - { - if (buffer_.data[0] != '_') - { - for (auto i = 0u; i < buffer_.length; i++) - { - auto c = buffer_.data[i]; - - if (c > 64 && c < 91) - buffer_.data[i] = c + 32; - } - } - - if (buffer_.length < 17) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - return parser::symbol_type(itr->second, loc_); - } - - if (path) - { - if (buffer_.data[buffer_.length - 1] == '/') - throw comp_error(loc_, "invalid path end '\\'"); - - return parser::make_PATH(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - -lex_number: - if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) - { - buffer_.push(last); - - auto dot = last == '.' ? 1 : 0; - auto flt = 0; - - while (true) - { - if (state == reader::end) - break; - - if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) - throw comp_error(loc_, "invalid number literal"); - - if ((curr == '.' || curr == 'f') && last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr == 'f') - flt++; - else if (curr == '.') - dot++; - else if (!(curr > 47 && curr < 58)) - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f')) - throw comp_error(loc_, "invalid number literal"); - - if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); - } - else if (curr == 'o') - { - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) - throw comp_error(loc_, "invalid octal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!(curr > 47 && curr < 56)) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length <= 0) - throw comp_error(loc_, "invalid octal literal"); - - return parser::make_INTEGER(utils::string::oct_to_dec(buffer_.data), loc_); - } - else if (curr == 'b') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) - throw comp_error(loc_, "invalid binary literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr != '0' && curr != '1') - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid binary literal"); - - return parser::make_INTEGER(utils::string::bin_to_dec(buffer_.data), loc_); - } - else if (curr == 'x') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) - throw comp_error(loc_, "invalid hexadecimal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid hexadecimal literal"); - - return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); - } - - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); - } -} - -void lexer::advance() -{ - reader_.advance(); - loc_.end.column++; - - if (reader_.current_byte == '\\') [[unlikely]] - preprocessor_wrap(); -} - -void lexer::preprocessor_wrap() -{ - while (reader_.current_byte == '\\') - { - if (reader_.bytes_remaining == 1) - throw comp_error(loc_, "invalid token ('\\')"); - - if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') - break; - - if (reader_.buffer_pos[1] == '\r') - { - if (reader_.bytes_remaining <= 3 || reader_.buffer_pos[2] != '\n') - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 3; - reader_.bytes_remaining -= 3; - } - - if ((reader_.buffer_pos[1] == '\n')) - { - if (reader_.bytes_remaining == 2) - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 2; - reader_.bytes_remaining -= 2; - } - - if (reader_.bytes_remaining == 0) - { - reader_.state = reader::end; - reader_.current_byte = 0; - } - else - { - reader_.current_byte = *reader_.buffer_pos; - } - - loc_.lines(); - loc_.step(); - } -} - -void lexer::preprocessor_run(parser::token::token_kind_type token) -{ - if (!clean_) - throw comp_error(loc_, "invalid token ('#')"); - - switch (token) - { - case parser::token::SH_DEFINE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_UNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELSE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ENDIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - default: - throw comp_error(loc_, "unknown preprocessor directive"); - } -} - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/lexer.hpp b/src/iw8/xsk/lexer.hpp deleted file mode 100644 index 70f110a5..00000000 --- a/src/iw8/xsk/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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::gsc::iw8 -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/parser.cpp b/src/iw8/xsk/parser.cpp deleted file mode 100644 index 8e998797..00000000 --- a/src/iw8/xsk/parser.cpp +++ /dev/null @@ -1,4815 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::iw8::parser::symbol_type IW8lex(xsk::gsc::iw8::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex IW8lex - - - -#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 IW8DEBUG - -// 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 // !IW8DEBUG - -# 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 // !IW8DEBUG - -#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 gsc { namespace iw8 { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::gsc::iw8::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg) -#if IW8DEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - 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_add_array: // expr_add_array - value.YY_MOVE_OR_COPY< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - value.YY_MOVE_OR_COPY< ast::expr_isdefined::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istrue: // expr_istrue - value.YY_MOVE_OR_COPY< ast::expr_istrue::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.YY_MOVE_OR_COPY< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.YY_MOVE_OR_COPY< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.YY_MOVE_OR_COPY< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.YY_MOVE_OR_COPY< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.YY_MOVE_OR_COPY< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.YY_MOVE_OR_COPY< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.YY_MOVE_OR_COPY< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - value.move< ast::expr_isdefined::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istrue: // expr_istrue - value.move< ast::expr_istrue::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - value.copy< ast::expr_isdefined::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_istrue: // expr_istrue - value.copy< ast::expr_istrue::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.copy< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.copy< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.copy< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.copy< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - value.move< ast::expr_isdefined::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_istrue: // expr_istrue - value.move< ast::expr_istrue::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 IW8DEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if IW8DEBUG - 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 // IW8DEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - yylhs.value.emplace< ast::expr_add_array::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - yylhs.value.emplace< ast::expr_isdefined::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_istrue: // expr_istrue - yylhs.value.emplace< ast::expr_istrue::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - yylhs.value.emplace< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - yylhs.value.emplace< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - yylhs.value.emplace< ast::stmt_waitframe::ptr > (); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - yylhs.value.emplace< ast::stmt_waittill::ptr > (); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - yylhs.value.emplace< ast::stmt_waittillframeend::ptr > (); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - yylhs.value.emplace< ast::stmt_waittillmatch::ptr > (); - break; - - case symbol_kind::S_stmt_while: // stmt_while - yylhs.value.emplace< ast::stmt_while::ptr > (); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 267 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2080 "parser.cpp" - break; - - case 3: // root: %empty -#line 268 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2086 "parser.cpp" - break; - - case 4: // program: program inline -#line 273 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2092 "parser.cpp" - break; - - case 5: // program: program include -#line 275 "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 2098 "parser.cpp" - break; - - case 6: // program: program declaration -#line 277 "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 2104 "parser.cpp" - break; - - case 7: // program: inline -#line 279 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2110 "parser.cpp" - break; - - case 8: // program: include -#line 281 "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 2116 "parser.cpp" - break; - - case 9: // program: declaration -#line 283 "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 2122 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 287 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2128 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 292 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2134 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 296 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2140 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 297 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2146 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 298 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2152 "parser.cpp" - break; - - case 15: // declaration: decl_constant -#line 299 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } -#line 2158 "parser.cpp" - break; - - case 16: // declaration: decl_thread -#line 300 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2164 "parser.cpp" - break; - - case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 305 "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 2170 "parser.cpp" - break; - - case 18: // decl_constant: expr_identifier "=" expr ";" -#line 310 "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 2176 "parser.cpp" - break; - - case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 315 "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 2182 "parser.cpp" - break; - - case 20: // stmt: stmt_block -#line 319 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2188 "parser.cpp" - break; - - case 21: // stmt: stmt_call -#line 320 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2194 "parser.cpp" - break; - - case 22: // stmt: stmt_assign -#line 321 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2200 "parser.cpp" - break; - - case 23: // stmt: stmt_endon -#line 322 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2206 "parser.cpp" - break; - - case 24: // stmt: stmt_notify -#line 323 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2212 "parser.cpp" - break; - - case 25: // stmt: stmt_wait -#line 324 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2218 "parser.cpp" - break; - - case 26: // stmt: stmt_waittill -#line 325 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2224 "parser.cpp" - break; - - case 27: // stmt: stmt_waittillmatch -#line 326 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2230 "parser.cpp" - break; - - case 28: // stmt: stmt_waittillframeend -#line 327 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2236 "parser.cpp" - break; - - case 29: // stmt: stmt_waitframe -#line 328 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } -#line 2242 "parser.cpp" - break; - - case 30: // stmt: stmt_if -#line 329 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2248 "parser.cpp" - break; - - case 31: // stmt: stmt_ifelse -#line 330 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2254 "parser.cpp" - break; - - case 32: // stmt: stmt_while -#line 331 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2260 "parser.cpp" - break; - - case 33: // stmt: stmt_dowhile -#line 332 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2266 "parser.cpp" - break; - - case 34: // stmt: stmt_for -#line 333 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2272 "parser.cpp" - break; - - case 35: // stmt: stmt_foreach -#line 334 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2278 "parser.cpp" - break; - - case 36: // stmt: stmt_switch -#line 335 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2284 "parser.cpp" - break; - - case 37: // stmt: stmt_case -#line 336 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2290 "parser.cpp" - break; - - case 38: // stmt: stmt_default -#line 337 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2296 "parser.cpp" - break; - - case 39: // stmt: stmt_break -#line 338 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2302 "parser.cpp" - break; - - case 40: // stmt: stmt_continue -#line 339 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2308 "parser.cpp" - break; - - case 41: // stmt: stmt_return -#line 340 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2314 "parser.cpp" - break; - - case 42: // stmt: stmt_breakpoint -#line 341 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } -#line 2320 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_begin -#line 342 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2326 "parser.cpp" - break; - - case 44: // stmt: stmt_prof_end -#line 343 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2332 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt -#line 347 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2338 "parser.cpp" - break; - - case 46: // stmt_or_dev: stmt_dev -#line 348 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2344 "parser.cpp" - break; - - case 47: // stmt_list: stmt_list stmt -#line 353 "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 2350 "parser.cpp" - break; - - case 48: // stmt_list: stmt -#line 355 "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 2356 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 360 "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 2362 "parser.cpp" - break; - - case 50: // stmt_or_dev_list: stmt_or_dev -#line 362 "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 2368 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" stmt_list "#/" -#line 366 "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 2374 "parser.cpp" - break; - - case 52: // stmt_dev: "/#" "#/" -#line 367 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2380 "parser.cpp" - break; - - case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 371 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2386 "parser.cpp" - break; - - case 54: // stmt_block: "{" "}" -#line 372 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2392 "parser.cpp" - break; - - case 55: // stmt_expr: expr_assign -#line 377 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2398 "parser.cpp" - break; - - case 56: // stmt_expr: expr_increment -#line 379 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2404 "parser.cpp" - break; - - case 57: // stmt_expr: expr_decrement -#line 381 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2410 "parser.cpp" - break; - - case 58: // stmt_expr: %empty -#line 383 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2416 "parser.cpp" - break; - - case 59: // stmt_call: expr_call ";" -#line 388 "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 2422 "parser.cpp" - break; - - case 60: // stmt_call: expr_method ";" -#line 390 "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 2428 "parser.cpp" - break; - - case 61: // stmt_assign: expr_assign ";" -#line 395 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2434 "parser.cpp" - break; - - case 62: // stmt_assign: expr_increment ";" -#line 397 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2440 "parser.cpp" - break; - - case 63: // stmt_assign: expr_decrement ";" -#line 399 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2446 "parser.cpp" - break; - - case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 404 "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 2452 "parser.cpp" - break; - - case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 409 "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 2458 "parser.cpp" - break; - - case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 411 "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 2464 "parser.cpp" - break; - - case 67: // stmt_wait: "wait" expr ";" -#line 416 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2470 "parser.cpp" - break; - - case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 421 "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 2476 "parser.cpp" - break; - - case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 423 "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 2482 "parser.cpp" - break; - - case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 428 "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 2488 "parser.cpp" - break; - - case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 430 "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 2494 "parser.cpp" - break; - - case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 435 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2500 "parser.cpp" - break; - - case 73: // stmt_waitframe: "waitframe" ";" -#line 440 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2506 "parser.cpp" - break; - - case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 442 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2512 "parser.cpp" - break; - - case 75: // stmt_if: "if" "(" expr ")" stmt -#line 447 "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 2518 "parser.cpp" - break; - - case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 452 "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 2524 "parser.cpp" - break; - - case 77: // stmt_while: "while" "(" expr ")" stmt -#line 457 "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 2530 "parser.cpp" - break; - - case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 462 "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 2536 "parser.cpp" - break; - - case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 467 "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 2542 "parser.cpp" - break; - - case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 472 "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 2548 "parser.cpp" - break; - - case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 474 "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 2554 "parser.cpp" - break; - - case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 479 "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 2560 "parser.cpp" - break; - - case 83: // stmt_case: "case" expr_integer ":" -#line 484 "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 2566 "parser.cpp" - break; - - case 84: // stmt_case: "case" expr_string ":" -#line 486 "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 2572 "parser.cpp" - break; - - case 85: // stmt_default: "default" ":" -#line 491 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2578 "parser.cpp" - break; - - case 86: // stmt_break: "break" ";" -#line 496 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2584 "parser.cpp" - break; - - case 87: // stmt_continue: "continue" ";" -#line 501 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2590 "parser.cpp" - break; - - case 88: // stmt_return: "return" expr ";" -#line 506 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2596 "parser.cpp" - break; - - case 89: // stmt_return: "return" ";" -#line 508 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2602 "parser.cpp" - break; - - case 90: // stmt_breakpoint: "breakpoint" ";" -#line 513 "parser.ypp" - { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } -#line 2608 "parser.cpp" - break; - - case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 518 "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 2614 "parser.cpp" - break; - - case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 523 "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 2620 "parser.cpp" - break; - - case 93: // expr: expr_ternary -#line 527 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2626 "parser.cpp" - break; - - case 94: // expr: expr_binary -#line 528 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2632 "parser.cpp" - break; - - case 95: // expr: expr_primitive -#line 529 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2638 "parser.cpp" - break; - - case 96: // expr_or_empty: expr -#line 533 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2644 "parser.cpp" - break; - - case 97: // expr_or_empty: %empty -#line 534 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2650 "parser.cpp" - break; - - case 98: // expr_assign: expr_tuple "=" expr -#line 539 "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 2656 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "=" expr -#line 541 "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 2662 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "|=" expr -#line 543 "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 2668 "parser.cpp" - break; - - case 101: // expr_assign: expr_object "&=" expr -#line 545 "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 2674 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "^=" expr -#line 547 "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 2680 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "<<=" expr -#line 549 "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 2686 "parser.cpp" - break; - - case 104: // expr_assign: expr_object ">>=" expr -#line 551 "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 2692 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "+=" expr -#line 553 "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 2698 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "-=" expr -#line 555 "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 2704 "parser.cpp" - break; - - case 107: // expr_assign: expr_object "*=" expr -#line 557 "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 2710 "parser.cpp" - break; - - case 108: // expr_assign: expr_object "/=" expr -#line 559 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2716 "parser.cpp" - break; - - case 109: // expr_assign: expr_object "%=" expr -#line 561 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2722 "parser.cpp" - break; - - case 110: // expr_increment: "++" expr_object -#line 566 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2728 "parser.cpp" - break; - - case 111: // expr_increment: expr_object "++" -#line 568 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2734 "parser.cpp" - break; - - case 112: // expr_decrement: "--" 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 2740 "parser.cpp" - break; - - case 113: // expr_decrement: 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 2746 "parser.cpp" - break; - - case 114: // expr_ternary: expr "?" expr ":" expr -#line 580 "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 2752 "parser.cpp" - break; - - case 115: // expr_binary: expr "||" expr -#line 585 "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 2758 "parser.cpp" - break; - - case 116: // expr_binary: expr "&&" expr -#line 587 "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 2764 "parser.cpp" - break; - - case 117: // expr_binary: expr "==" expr -#line 589 "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 2770 "parser.cpp" - break; - - case 118: // expr_binary: expr "!=" expr -#line 591 "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 2776 "parser.cpp" - break; - - case 119: // expr_binary: expr "<=" expr -#line 593 "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 2782 "parser.cpp" - break; - - case 120: // expr_binary: expr ">=" expr -#line 595 "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 2788 "parser.cpp" - break; - - case 121: // expr_binary: expr "<" expr -#line 597 "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 2794 "parser.cpp" - break; - - case 122: // expr_binary: expr ">" expr -#line 599 "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 2800 "parser.cpp" - break; - - case 123: // expr_binary: expr "|" expr -#line 601 "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 2806 "parser.cpp" - break; - - case 124: // expr_binary: expr "&" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2812 "parser.cpp" - break; - - case 125: // expr_binary: expr "^" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2818 "parser.cpp" - break; - - case 126: // expr_binary: expr "<<" expr -#line 607 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2824 "parser.cpp" - break; - - case 127: // expr_binary: expr ">>" expr -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2830 "parser.cpp" - break; - - case 128: // expr_binary: expr "+" expr -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2836 "parser.cpp" - break; - - case 129: // expr_binary: expr "-" expr -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2842 "parser.cpp" - break; - - case 130: // expr_binary: expr "*" expr -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2848 "parser.cpp" - break; - - case 131: // expr_binary: expr "/" expr -#line 617 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2854 "parser.cpp" - break; - - case 132: // expr_binary: expr "%" expr -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2860 "parser.cpp" - break; - - case 133: // expr_primitive: expr_complement -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 2866 "parser.cpp" - break; - - case 134: // expr_primitive: expr_negate -#line 624 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 2872 "parser.cpp" - break; - - case 135: // expr_primitive: expr_not -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 2878 "parser.cpp" - break; - - case 136: // expr_primitive: expr_call -#line 626 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 2884 "parser.cpp" - break; - - case 137: // expr_primitive: expr_method -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 2890 "parser.cpp" - break; - - case 138: // expr_primitive: expr_add_array -#line 628 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } -#line 2896 "parser.cpp" - break; - - case 139: // expr_primitive: expr_isdefined -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_isdefined::ptr > ()); } -#line 2902 "parser.cpp" - break; - - case 140: // expr_primitive: expr_istrue -#line 630 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istrue::ptr > ()); } -#line 2908 "parser.cpp" - break; - - case 141: // expr_primitive: expr_reference -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 2914 "parser.cpp" - break; - - case 142: // expr_primitive: expr_array -#line 632 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 2920 "parser.cpp" - break; - - case 143: // expr_primitive: expr_field -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 2926 "parser.cpp" - break; - - case 144: // expr_primitive: expr_size -#line 634 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 2932 "parser.cpp" - break; - - case 145: // expr_primitive: expr_paren -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 2938 "parser.cpp" - break; - - case 146: // expr_primitive: expr_thisthread -#line 636 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } -#line 2944 "parser.cpp" - break; - - case 147: // expr_primitive: expr_empty_array -#line 637 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 2950 "parser.cpp" - break; - - case 148: // expr_primitive: expr_undefined -#line 638 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 2956 "parser.cpp" - break; - - case 149: // expr_primitive: expr_game -#line 639 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 2962 "parser.cpp" - break; - - case 150: // expr_primitive: expr_self -#line 640 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 2968 "parser.cpp" - break; - - case 151: // expr_primitive: expr_anim -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 2974 "parser.cpp" - break; - - case 152: // expr_primitive: expr_level -#line 642 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 2980 "parser.cpp" - break; - - case 153: // expr_primitive: expr_animation -#line 643 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 2986 "parser.cpp" - break; - - case 154: // expr_primitive: expr_animtree -#line 644 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 2992 "parser.cpp" - break; - - case 155: // expr_primitive: expr_identifier -#line 645 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 2998 "parser.cpp" - break; - - case 156: // expr_primitive: expr_istring -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 3004 "parser.cpp" - break; - - case 157: // expr_primitive: expr_string -#line 647 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 3010 "parser.cpp" - break; - - case 158: // expr_primitive: expr_vector -#line 648 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 3016 "parser.cpp" - break; - - case 159: // expr_primitive: expr_float -#line 649 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 3022 "parser.cpp" - break; - - case 160: // expr_primitive: expr_integer -#line 650 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 3028 "parser.cpp" - break; - - case 161: // expr_primitive: expr_false -#line 651 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 3034 "parser.cpp" - break; - - case 162: // expr_primitive: expr_true -#line 652 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 3040 "parser.cpp" - break; - - case 163: // expr_complement: "~" expr -#line 657 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3046 "parser.cpp" - break; - - case 164: // expr_negate: "-" expr_identifier -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 3052 "parser.cpp" - break; - - case 165: // expr_negate: "-" expr_paren -#line 664 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 3058 "parser.cpp" - break; - - case 166: // expr_negate: "-" expr_array -#line 666 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 3064 "parser.cpp" - break; - - case 167: // expr_negate: "-" expr_field -#line 668 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 3070 "parser.cpp" - break; - - case 168: // expr_not: "!" expr -#line 673 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3076 "parser.cpp" - break; - - case 169: // expr_call: expr_function -#line 677 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3082 "parser.cpp" - break; - - case 170: // expr_call: expr_pointer -#line 678 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3088 "parser.cpp" - break; - - case 171: // expr_method: expr_object expr_function -#line 681 "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 3094 "parser.cpp" - break; - - case 172: // expr_method: expr_object expr_pointer -#line 682 "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 3100 "parser.cpp" - break; - - case 173: // expr_function: expr_identifier "(" expr_arguments ")" -#line 687 "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 3106 "parser.cpp" - break; - - case 174: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 689 "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 3112 "parser.cpp" - break; - - case 175: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 691 "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 3118 "parser.cpp" - break; - - case 176: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 693 "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 3124 "parser.cpp" - break; - - case 177: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 695 "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::childthread); } -#line 3130 "parser.cpp" - break; - - case 178: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 697 "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::childthread); } -#line 3136 "parser.cpp" - break; - - case 179: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 702 "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 3142 "parser.cpp" - break; - - case 180: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 704 "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 3148 "parser.cpp" - break; - - case 181: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 706 "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::childthread); } -#line 3154 "parser.cpp" - break; - - case 182: // expr_pointer: "call" "[" "[" 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::builtin); } -#line 3160 "parser.cpp" - break; - - case 183: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 713 "parser.ypp" - { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } -#line 3166 "parser.cpp" - break; - - case 184: // expr_parameters: expr_parameters "," expr_identifier -#line 718 "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 3172 "parser.cpp" - break; - - case 185: // expr_parameters: expr_identifier -#line 720 "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 3178 "parser.cpp" - break; - - case 186: // expr_parameters: %empty -#line 722 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3184 "parser.cpp" - break; - - case 187: // expr_arguments: expr_arguments_no_empty -#line 727 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3190 "parser.cpp" - break; - - case 188: // expr_arguments: %empty -#line 729 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3196 "parser.cpp" - break; - - case 189: // expr_arguments_no_empty: expr_arguments "," expr -#line 734 "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 3202 "parser.cpp" - break; - - case 190: // expr_arguments_no_empty: expr -#line 736 "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 3208 "parser.cpp" - break; - - case 191: // expr_isdefined: "isdefined" "(" expr ")" -#line 741 "parser.ypp" - { yylhs.value.as < ast::expr_isdefined::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3214 "parser.cpp" - break; - - case 192: // expr_istrue: "istrue" "(" expr ")" -#line 746 "parser.ypp" - { yylhs.value.as < ast::expr_istrue::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3220 "parser.cpp" - break; - - case 193: // expr_reference: "::" expr_identifier -#line 751 "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 3226 "parser.cpp" - break; - - case 194: // expr_reference: expr_path "::" expr_identifier -#line 753 "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 3232 "parser.cpp" - break; - - case 195: // expr_tuple: "[" expr_tuple_arguments "]" -#line 758 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[1].value.as < ast::expr_tuple::ptr > ()); } -#line 3238 "parser.cpp" - break; - - case 196: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types -#line 763 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::move(yystack_[2].value.as < ast::expr_tuple::ptr > ()); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3244 "parser.cpp" - break; - - case 197: // expr_tuple_arguments: expr_tuple_types -#line 765 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3250 "parser.cpp" - break; - - case 198: // expr_tuple_types: expr_array -#line 769 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3256 "parser.cpp" - break; - - case 199: // expr_tuple_types: expr_field -#line 770 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3262 "parser.cpp" - break; - - case 200: // expr_tuple_types: expr_identifier -#line 771 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3268 "parser.cpp" - break; - - case 201: // expr_array: expr_object "[" expr "]" -#line 776 "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 3274 "parser.cpp" - break; - - case 202: // expr_field: expr_object "." expr_identifier_nosize -#line 781 "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 3280 "parser.cpp" - break; - - case 203: // expr_size: expr_object "." "size" -#line 786 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3286 "parser.cpp" - break; - - case 204: // expr_paren: "(" expr ")" -#line 791 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3292 "parser.cpp" - break; - - case 205: // expr_object: expr_call -#line 795 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3298 "parser.cpp" - break; - - case 206: // expr_object: expr_method -#line 796 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3304 "parser.cpp" - break; - - case 207: // expr_object: expr_array -#line 797 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3310 "parser.cpp" - break; - - case 208: // expr_object: expr_field -#line 798 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3316 "parser.cpp" - break; - - case 209: // expr_object: expr_game -#line 799 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3322 "parser.cpp" - break; - - case 210: // expr_object: expr_self -#line 800 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3328 "parser.cpp" - break; - - case 211: // expr_object: expr_anim -#line 801 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3334 "parser.cpp" - break; - - case 212: // expr_object: expr_level -#line 802 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3340 "parser.cpp" - break; - - case 213: // expr_object: expr_identifier -#line 803 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3346 "parser.cpp" - break; - - case 214: // expr_thisthread: "thisthread" -#line 808 "parser.ypp" - { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } -#line 3352 "parser.cpp" - break; - - case 215: // expr_empty_array: "[" "]" -#line 813 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3358 "parser.cpp" - break; - - case 216: // expr_undefined: "undefined" -#line 818 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3364 "parser.cpp" - break; - - case 217: // expr_game: "game" -#line 823 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3370 "parser.cpp" - break; - - case 218: // expr_self: "self" -#line 828 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3376 "parser.cpp" - break; - - case 219: // expr_anim: "anim" -#line 833 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3382 "parser.cpp" - break; - - case 220: // expr_level: "level" -#line 838 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3388 "parser.cpp" - break; - - case 221: // expr_animation: "%" "identifier" -#line 843 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3394 "parser.cpp" - break; - - case 222: // expr_animtree: "#animtree" -#line 848 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3400 "parser.cpp" - break; - - case 223: // expr_identifier_nosize: "identifier" -#line 853 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3406 "parser.cpp" - break; - - case 224: // expr_identifier: "identifier" -#line 858 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3412 "parser.cpp" - break; - - case 225: // expr_identifier: "size" -#line 860 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3418 "parser.cpp" - break; - - case 226: // expr_path: "identifier" -#line 865 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3424 "parser.cpp" - break; - - case 227: // expr_path: "path" -#line 867 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3430 "parser.cpp" - break; - - case 228: // expr_istring: "localized string" -#line 872 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3436 "parser.cpp" - break; - - case 229: // expr_string: "string literal" -#line 877 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3442 "parser.cpp" - break; - - case 230: // expr_vector: "(" expr "," expr "," expr ")" -#line 882 "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 3448 "parser.cpp" - break; - - case 231: // expr_float: "-" "float" -#line 887 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3454 "parser.cpp" - break; - - case 232: // expr_float: "float" -#line 889 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3460 "parser.cpp" - break; - - case 233: // expr_integer: "-" "integer" -#line 894 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3466 "parser.cpp" - break; - - case 234: // expr_integer: "integer" -#line 896 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3472 "parser.cpp" - break; - - case 235: // expr_false: "false" -#line 901 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3478 "parser.cpp" - break; - - case 236: // expr_true: "true" -#line 906 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3484 "parser.cpp" - break; - - -#line 3488 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "endon", "notify", "wait", - "waittill", "waittillmatch", "waittillframeend", "waitframe", "if", - "else", "do", "while", "for", "foreach", "in", "switch", "case", - "default", "break", "continue", "return", "breakpoint", "prof_begin", - "prof_end", "thread", "childthread", "thisthread", "call", "true", - "false", "undefined", "size", "game", "self", "anim", "level", - "isdefined", "istrue", "(", ")", "{", "}", "[", "]", ",", ".", "::", ":", - ";", "?", "++", "--", "<<", ">>", "||", "&&", "==", "!=", "<=", ">=", - "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", "%=", "|=", "&=", "^=", - ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", "%", "path", - "identifier", "string literal", "localized string", "float", "integer", - "SIZEOF", "ADD_ARRAY", "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_waitframe", - "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_negate", "expr_not", - "expr_call", "expr_method", "expr_function", "expr_pointer", - "expr_add_array", "expr_parameters", "expr_arguments", - "expr_arguments_no_empty", "expr_isdefined", "expr_istrue", - "expr_reference", "expr_tuple", "expr_tuple_arguments", - "expr_tuple_types", "expr_array", "expr_field", "expr_size", - "expr_paren", "expr_object", "expr_thisthread", "expr_empty_array", - "expr_undefined", "expr_game", "expr_self", "expr_anim", "expr_level", - "expr_animation", "expr_animtree", "expr_identifier_nosize", - "expr_identifier", "expr_path", "expr_istring", "expr_string", - "expr_vector", "expr_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 IW8DEBUG - // 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 IW8DEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if IW8DEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -296; - - const short parser::yytable_ninf_ = -227; - - const short - parser::yypact_[] = - { - 2, -296, -296, -24, -24, -29, -296, -296, 27, 2, - -296, -296, -296, -296, -296, -296, -35, -296, -296, -30, - -7, -49, -296, -296, -296, -296, -41, 1265, -296, -296, - -296, 45, -31, -296, -296, -27, -19, -296, 66, -296, - -296, -296, -296, -296, -296, -296, 72, 74, 1265, 1135, - -41, 1265, 1265, 817, 37, 73, -296, -296, -296, 2289, - -296, -296, -296, -296, -296, -296, 119, 430, -296, -296, - -296, -296, -296, -296, 604, 647, -296, -296, 750, -296, - -296, -296, 904, 981, 1060, 1161, -296, -296, -3, 84, - -296, -296, -296, -296, -296, -296, -296, 89, 102, -41, - 109, 115, 114, 120, 125, 122, 134, 1265, 1265, 1513, - 1135, -296, 2372, 135, 146, -296, -296, -296, 1265, 136, - -296, -296, -296, -296, 604, 647, -296, 1225, -296, -296, - -296, -296, -3, 144, -296, -296, 1265, 1265, 1265, 1265, - 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, - 1265, 1265, 1265, 1265, 1265, 1330, -26, -296, -296, 153, - 1265, -41, -296, 82, -296, -296, 1265, 1265, -41, 1265, - 1265, -41, 1265, 1679, 1713, -296, 1265, 1261, 1265, -296, - 1747, 1265, 112, -41, 2254, 91, 91, 2403, 2413, 758, - 758, 176, 176, 176, 176, 2444, 680, 543, 46, 46, - -296, -296, -296, 2059, -296, -296, -296, -14, -296, 159, - 1028, 1265, 152, -32, 166, 1456, 167, 172, 178, 179, - -39, 177, 171, 175, 1200, 191, 188, 189, -296, 150, - 382, 382, -296, -296, 949, -296, -296, -296, -296, -296, - -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, - -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, - -296, 192, 193, 194, 196, 198, 185, -296, -296, 1377, - 153, 2099, 22, 212, 2139, 24, 213, 2179, -296, -296, - 2218, 209, 2372, 1261, 159, 1265, -296, -296, 1265, -296, - -296, 1107, 2324, -296, 220, -296, 1265, 250, 1265, 833, - -41, 1265, 174, 216, 218, -296, -296, -296, -296, 2359, - -296, 1265, 1265, 1330, 8, -296, 105, 113, 10, 1225, - 1225, -296, -296, -296, -296, -296, -296, -296, 1265, 229, - 232, 233, 234, -296, -296, 1265, 1265, 1265, 1265, 1265, - 1265, 1265, 1265, 1265, 1265, 1265, 230, -296, 1265, 231, - -296, 1265, 235, 1265, 238, 2372, 28, -296, -296, -296, - 239, 1781, 242, 1815, 241, -296, -296, -296, 1477, -12, - 1849, -296, -296, -296, 31, 32, -296, 382, 2372, 1265, - 1265, 1265, 1265, 2372, 2372, 2372, 2372, 2372, 2372, 2372, - 2372, 2372, 2372, 2372, 243, 34, 255, 35, 259, 1883, - 1265, -296, -296, 1456, 1265, 1456, 1265, 1265, -41, 102, - 251, 253, -296, 1917, 1557, 1601, 1645, 1265, -296, 1265, - -296, 1265, -296, 43, 289, 1951, -296, 2372, 257, 1985, - 292, -296, -296, -296, 264, 265, 1265, 269, 1265, 270, - 1265, 52, 81, 90, -296, 1456, 293, 833, 1456, 1265, - -296, -296, 268, -296, 301, -296, 303, -296, -296, -296, - -296, -296, 304, -296, 2019, 296, 297, 298, 1456, 1456, - -296, -296, -296, -296, -296 - }; - - const unsigned char - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 225, 224, 0, 2, - 7, 8, 9, 14, 15, 16, 0, 227, 226, 0, - 0, 0, 1, 4, 5, 6, 186, 0, 10, 11, - 229, 0, 0, 185, 222, 0, 0, 214, 0, 236, - 235, 216, 217, 218, 219, 220, 0, 0, 0, 188, - 0, 0, 0, 0, 0, 224, 228, 232, 234, 0, - 93, 94, 95, 133, 134, 135, 136, 137, 169, 170, - 138, 139, 140, 141, 142, 143, 144, 145, 0, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 0, - 156, 157, 158, 159, 160, 161, 162, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 188, 215, 190, 0, 187, 193, 168, 163, 0, 0, - 231, 233, 205, 206, 166, 167, 165, 0, 209, 210, - 211, 212, 164, 0, 221, 18, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 171, 172, 0, - 188, 0, 17, 0, 19, 184, 0, 188, 0, 0, - 188, 0, 0, 0, 0, 204, 0, 190, 0, 183, - 0, 0, 0, 0, 0, 126, 127, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 128, 129, - 130, 131, 132, 0, 203, 223, 202, 0, 187, 194, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, - 0, 0, 45, 50, 0, 46, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 0, 0, 0, 205, 206, 0, 207, 208, 0, - 213, 0, 0, 0, 0, 0, 0, 0, 191, 192, - 0, 0, 189, 0, 0, 0, 201, 173, 188, 52, - 48, 0, 0, 72, 0, 73, 0, 0, 0, 58, - 0, 0, 0, 0, 0, 85, 86, 87, 89, 0, - 90, 188, 188, 0, 0, 197, 207, 208, 213, 110, - 112, 53, 49, 61, 62, 63, 59, 60, 0, 0, - 0, 0, 0, 111, 113, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 175, 188, 0, - 177, 188, 0, 0, 0, 114, 0, 51, 47, 67, - 0, 0, 0, 0, 0, 55, 56, 57, 0, 0, - 0, 84, 83, 88, 0, 0, 195, 0, 98, 0, - 0, 0, 0, 99, 105, 106, 107, 108, 109, 100, - 101, 102, 104, 103, 0, 0, 0, 0, 0, 0, - 188, 174, 74, 0, 0, 0, 97, 0, 0, 0, - 0, 0, 196, 0, 0, 0, 0, 188, 176, 188, - 178, 188, 230, 0, 75, 0, 77, 96, 0, 0, - 0, 82, 91, 92, 0, 0, 188, 0, 188, 0, - 188, 0, 0, 0, 179, 0, 0, 58, 0, 0, - 64, 66, 187, 69, 187, 71, 187, 180, 181, 182, - 76, 78, 0, 80, 0, 0, 0, 0, 0, 0, - 65, 68, 70, 79, 81 - }; - - const short - parser::yypgoto_[] = - { - -296, -296, -296, 354, 355, 356, -296, -296, -296, -144, - 133, -296, -296, -296, -97, -77, -296, -296, -296, -296, - -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, - -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, - 200, -296, -295, -292, -291, -296, -296, -296, -296, -296, - -296, -6, 101, -73, -66, -296, -296, -137, -47, -296, - -296, -296, -296, -296, -4, 337, 362, -296, 321, 368, - -296, -296, -296, 393, 442, 467, 501, -296, -296, -296, - 0, 7, -296, -18, -296, -296, 160, -296, -296 - }; - - const short - parser::yydefgoto_[] = - { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 232, - 233, 291, 234, 235, 236, 364, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 112, 428, 261, 262, 263, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 32, 113, 208, 71, - 72, 73, 266, 314, 315, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 206, - 88, 89, 90, 91, 92, 93, 94, 95, 96 - }; - - const short - parser::yytable_[] = - { - 16, 164, 114, 31, 365, 157, 6, 366, 367, 16, - 19, 20, 158, 1, 2, 3, 4, 5, 407, 26, - 6, 204, 294, 207, 98, 21, 33, 22, 6, 99, - 272, 100, 295, 275, 28, 101, 104, -213, -213, 103, - -213, 287, 102, 105, -213, 27, 178, 122, 408, 6, - 115, 160, 30, 132, 157, -213, 302, 29, -213, 7, - 133, 158, 30, 114, 160, 58, 290, 376, 377, -200, - -200, 297, 17, 55, 205, 17, 18, 347, 159, 350, - 17, 55, 178, 401, 178, 133, 410, 411, 178, 418, - 420, 178, 178, 210, 178, 178, -213, -213, 444, 165, - 97, 211, 7, 178, 212, 213, 214, 457, 215, 216, - 217, 218, 178, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 35, 36, 106, 38, 107, 159, 108, 6, - 42, 43, 44, 45, 133, -226, 458, 134, 163, 228, - 229, 178, 152, 153, 154, 459, 161, 358, 230, 231, - 178, 356, 365, 162, 123, 366, 367, 264, 163, -205, - -205, 209, -205, 270, -198, -198, -205, 166, 273, 167, - 133, 276, -199, -199, 374, 375, 168, -205, 169, 170, - -205, 17, 55, 284, 171, 150, 151, 152, 153, 154, - 35, 36, 172, 38, 181, 178, 157, 6, 42, 43, - 44, 45, 303, 158, 264, 179, 183, 160, 313, 264, - 270, 395, 205, 288, 397, 270, 293, 133, -205, -205, - 296, 298, 133, 122, 122, 122, 299, 59, 264, 318, - 270, 270, 300, 301, 270, 306, 133, 133, 133, 307, - 305, 133, 311, 312, 137, 138, 157, 157, 109, 17, - 55, 116, 117, 158, 158, 310, 323, 324, 325, 424, - 326, 426, 327, 423, 265, 328, 348, 351, 354, 159, - 150, 151, 152, 153, 154, 360, 133, 362, 121, 371, - 441, 372, 442, 379, 443, 264, 380, 381, 382, 394, - 396, 270, 400, 122, 398, 157, 404, 417, 133, 270, - 369, 460, 158, 402, 463, 406, 133, 173, 174, 419, - 177, 265, 431, 421, 445, 432, 265, 433, 180, 159, - 159, 447, 449, 465, 473, 474, 133, 133, 450, 451, - 123, 123, 123, 453, 455, 265, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 466, 461, 467, 468, - 470, 471, 472, 23, 24, 25, 271, 322, 159, 274, - 462, 122, 277, 412, 126, 133, 280, 318, 282, 0, - 304, 283, 0, 0, 133, 0, 0, 0, 0, 452, - 124, 454, 265, 456, 0, 0, 0, 264, 0, 264, - 123, 0, 0, 270, 0, 270, 0, 0, 430, 0, - 133, 292, 133, 0, 0, 125, 0, 0, 0, 0, - 0, 127, 35, 36, 309, 38, 0, 0, 0, 6, - 42, 43, 44, 45, 0, 0, 0, 0, 0, 264, - 119, 122, 264, 0, 0, 270, 128, 270, 270, 0, - 0, 0, 133, 0, 133, 133, 0, 0, 0, 0, - 0, 0, 264, 264, 0, 0, 0, 0, 270, 270, - -206, -206, 0, -206, 0, 133, 133, -206, 123, 0, - 0, 17, 55, 0, 0, 355, 0, 0, -206, 0, - 0, -206, 0, 0, 0, 129, 361, 0, 363, 0, - 267, 370, 0, 0, 265, 0, 265, 0, 0, 0, - 0, 0, 0, 283, 0, 0, 0, 0, 0, 0, - 130, 0, 0, 0, 0, 268, 0, 0, 378, -206, - -206, 269, 0, 0, 0, 383, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 265, 267, 123, 265, - 0, 0, 267, 399, 131, 0, 128, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 316, 267, 267, 265, - 265, 267, 268, 0, 0, 0, 0, 268, 269, 413, - 414, 415, 416, 269, 0, 0, 0, 0, 0, 0, - 0, 317, 268, 268, 0, 0, 268, 127, 319, 320, - 0, 0, 269, 128, 425, 129, 427, 429, 128, 0, - 0, 137, 138, 0, 0, 141, 142, 143, 144, 145, - 146, 0, 128, 128, 128, 0, 0, 128, 267, 0, - 130, 0, 0, 0, 0, 148, 267, 150, 151, 152, - 153, 154, 0, 0, -207, -207, 0, -207, 0, 464, - 0, -207, 129, 268, 0, 0, 0, 129, 0, 269, - 0, 268, -207, 0, 131, -207, 0, 368, 0, 0, - 0, 129, 129, 129, 0, 0, 129, 130, 0, 0, - 0, 0, 130, 0, 128, 0, 0, -208, -208, 0, - -208, 0, 128, 0, -208, 0, 130, 130, 130, 0, - 0, 130, 0, -207, -207, -208, 0, 0, -208, 0, - 0, 131, 0, 0, 316, 0, 131, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 131, 131, 131, 129, 0, 131, 0, 0, 0, 317, - 267, 129, 267, 0, 0, 127, -208, -208, 137, 138, - 0, 0, 141, 142, 143, 144, 145, 146, 130, 0, - 0, 0, 0, 0, 0, 268, 130, 268, 0, 0, - 128, 269, 0, 269, 150, 151, 152, 153, 154, 0, - 0, 0, 267, 0, 267, 267, 0, 0, 0, 0, - 35, 36, 131, 38, 0, 0, 128, 6, 128, 0, - 131, 0, 0, 0, 0, 267, 267, 268, 155, 268, - 268, 156, 0, 269, 0, 368, 269, 0, 0, 129, - 0, 0, 0, 0, 0, 0, 137, 138, 0, 0, - 268, 268, 143, 144, 145, 146, 269, 269, 128, 0, - 128, 128, 0, 0, 130, 129, 0, 129, 0, 17, - 55, 0, 150, 151, 152, 153, 154, 35, 36, 0, - 38, 128, 128, 0, 6, 42, 43, 44, 45, 0, - 130, 118, 130, 35, 36, 119, 38, 0, 131, 0, - 6, 42, 43, 44, 45, 0, 0, 129, 0, 129, - 129, 229, 0, 0, 0, 0, 0, 0, 0, 230, - 231, 0, 0, 0, 131, 0, 131, 0, 0, 0, - 129, 129, 130, 0, 130, 130, 17, 55, 0, 0, - 120, 121, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 55, 0, 130, 130, 0, 0, 0, - 0, 0, 0, 0, -209, -209, 131, -209, 131, 131, - 0, -209, 0, 0, 0, 0, 0, 0, 0, 0, - 210, 0, -209, 0, 0, -209, 0, 0, 211, 131, - 131, 212, 213, 214, 0, 215, 216, 217, 218, 0, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 35, - 36, 0, 38, 0, 0, 0, 6, 42, 43, 44, - 45, 0, 0, -209, -209, 163, 321, 229, 0, 0, - 0, 0, 0, 0, 0, 230, 231, 0, 0, 0, - 0, -210, -210, 0, -210, 0, 0, 0, -210, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -210, - 289, 0, -210, 0, 0, 0, 0, 211, 17, 55, - 212, 213, 214, 0, 215, 216, 217, 218, 0, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 35, 36, - 0, 38, 0, 0, 0, 6, 42, 43, 44, 45, - -210, -210, 0, 0, 163, 0, 229, 0, 0, 0, - 0, 0, 0, 0, 230, 231, 0, 0, 0, 0, - -211, -211, 0, -211, 0, 0, 0, -211, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -211, 357, - 0, -211, 0, 0, 0, 0, 211, 17, 55, 212, - 213, 214, 0, 215, 216, 217, 218, 0, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 35, 36, 0, - 38, 34, 0, 0, 6, 42, 43, 44, 45, -211, - -211, 0, 0, 163, 0, 229, 0, 0, 0, 0, - 0, 0, 0, 230, 231, 35, 36, 37, 38, 39, - 40, 41, 6, 42, 43, 44, 45, 46, 47, 48, - 0, 0, 0, 110, 111, 0, 0, 50, 0, 0, - 0, -212, -212, 0, -212, 0, 17, 55, -212, 0, - 0, 0, 0, 51, 52, 0, 34, 0, 0, -212, - 0, 0, -212, 0, 0, 0, 0, 0, 0, 0, - 53, 0, 0, 54, 17, 55, 30, 56, 57, 58, - 35, 36, 37, 38, 39, 40, 41, 6, 42, 43, - 44, 45, 46, 47, 48, 0, 0, 0, 49, 0, - -212, -212, 50, 0, 308, 35, 36, 0, 38, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 51, 52, - 0, 34, 0, 155, 0, 0, 182, 0, 0, 0, - 0, 0, 0, 0, 0, 53, 0, 0, 54, 17, - 55, 30, 56, 57, 58, 35, 36, 37, 38, 39, - 40, 41, 6, 42, 43, 44, 45, 46, 47, 48, - 281, 0, 0, 49, 17, 55, 136, 50, 0, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, - 0, 0, 0, 51, 52, 0, 34, 0, 0, 0, - 0, 0, 147, 148, 149, 150, 151, 152, 153, 154, - 53, 0, 0, 54, 17, 55, 30, 56, 57, 58, - 35, 36, 37, 38, 39, 40, 41, 6, 42, 43, - 44, 45, 46, 47, 48, 0, 0, 0, 110, 0, - 0, 0, 50, 0, 329, 330, 0, 331, 332, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 51, 52, - 0, 0, 0, 0, 0, 0, 0, 35, 36, 0, - 38, 0, 0, 0, 6, 53, 0, 0, 54, 17, - 55, 30, 56, 57, 58, 155, 0, 0, 182, 0, - 0, 0, 0, 333, 334, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 0, 0, - 0, 0, 0, 0, 0, 211, 17, 55, 212, 213, - 214, 0, 215, 216, 217, 218, 0, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 35, 36, 0, 38, - 0, 0, 0, 6, 42, 43, 44, 45, 0, 0, - 0, 0, 163, 0, 229, 0, 0, 35, 36, 0, - 38, 0, 230, 231, 6, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 155, 0, 0, 182, 0, - 0, 0, 0, 333, 334, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 17, 55, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 175, 0, - 0, 0, 0, 176, 0, 0, 17, 55, 136, 0, - 0, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 147, 148, 149, 150, 151, 152, - 153, 154, 435, 0, 0, 0, 0, 436, 0, 0, - 0, 0, 136, 0, 0, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 147, 148, - 149, 150, 151, 152, 153, 154, 437, 0, 0, 0, - 0, 438, 0, 0, 0, 0, 136, 0, 0, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 147, 148, 149, 150, 151, 152, 153, 154, - 439, 0, 0, 0, 0, 440, 0, 0, 0, 0, - 136, 0, 0, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 278, 0, 147, 148, 149, 150, - 151, 152, 153, 154, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 279, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 136, 0, - 0, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 175, 0, 147, 148, 149, 150, 151, 152, - 153, 154, 136, 0, 0, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 403, 0, 147, 148, - 149, 150, 151, 152, 153, 154, 136, 0, 0, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 405, 0, 147, 148, 149, 150, 151, 152, 153, 154, - 136, 0, 0, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 409, 0, 147, 148, 149, 150, - 151, 152, 153, 154, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 422, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 136, 0, - 0, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 434, 0, 147, 148, 149, 150, 151, 152, - 153, 154, 136, 0, 0, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 446, 0, 147, 148, - 149, 150, 151, 152, 153, 154, 136, 0, 0, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 448, 0, 147, 148, 149, 150, 151, 152, 153, 154, - 136, 0, 0, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 469, 0, 147, 148, 149, 150, - 151, 152, 153, 154, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 286, 0, - 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 346, 0, - 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 349, 0, - 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 352, 0, - 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 353, 0, - 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 147, - 148, 149, 150, 151, 152, 153, 154, 285, 0, 136, - 0, 0, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 147, 148, 149, 150, 151, - 152, 153, 154, 135, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 359, 136, - 0, 0, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 147, 148, 149, 150, 151, - 152, 153, 154, 373, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 136, 0, 0, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 0, 0, - 0, 0, 0, 147, 148, 149, 150, 151, 152, 153, - 154, 137, 138, 0, 140, 141, 142, 143, 144, 145, - 146, 137, 138, 0, 0, 141, 142, 143, 144, 145, - 146, 0, 0, 0, 147, 148, 149, 150, 151, 152, - 153, 154, 0, 0, 147, 148, 149, 150, 151, 152, - 153, 154, 137, 138, 0, 0, 141, 142, 143, 144, - 145, 146, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 148, 149, 150, 151, - 152, 153, 154 - }; - - const short - parser::yycheck_[] = - { - 0, 98, 49, 21, 299, 78, 47, 299, 299, 9, - 3, 4, 78, 11, 12, 13, 14, 15, 30, 54, - 47, 47, 54, 160, 55, 54, 26, 0, 47, 60, - 167, 58, 64, 170, 64, 35, 36, 40, 41, 58, - 43, 55, 35, 36, 47, 80, 60, 53, 60, 47, - 50, 54, 101, 53, 127, 58, 95, 64, 61, 100, - 53, 127, 101, 110, 54, 104, 210, 59, 60, 59, - 60, 215, 99, 100, 100, 99, 100, 55, 78, 55, - 99, 100, 60, 55, 60, 78, 55, 55, 60, 55, - 55, 60, 60, 11, 60, 60, 99, 100, 55, 99, - 55, 19, 100, 60, 22, 23, 24, 55, 26, 27, - 28, 29, 60, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 58, 43, 54, 127, 54, 47, - 48, 49, 50, 51, 127, 62, 55, 100, 56, 57, - 58, 60, 96, 97, 98, 55, 62, 291, 66, 67, - 60, 288, 447, 64, 53, 447, 447, 163, 56, 40, - 41, 161, 43, 163, 59, 60, 47, 58, 168, 54, - 163, 171, 59, 60, 311, 312, 62, 58, 58, 54, - 61, 99, 100, 183, 62, 94, 95, 96, 97, 98, - 40, 41, 58, 43, 58, 60, 269, 47, 48, 49, - 50, 51, 220, 269, 210, 59, 62, 54, 58, 215, - 210, 348, 100, 54, 351, 215, 64, 210, 99, 100, - 54, 54, 215, 229, 230, 231, 54, 27, 234, 229, - 230, 231, 54, 54, 234, 64, 229, 230, 231, 64, - 63, 234, 54, 54, 68, 69, 319, 320, 48, 99, - 100, 51, 52, 319, 320, 64, 64, 64, 64, 403, - 64, 405, 64, 400, 163, 80, 54, 54, 59, 269, - 94, 95, 96, 97, 98, 55, 269, 27, 104, 63, - 417, 63, 419, 54, 421, 291, 54, 54, 54, 59, - 59, 291, 54, 299, 59, 368, 54, 54, 291, 299, - 300, 445, 368, 64, 448, 64, 299, 107, 108, 54, - 110, 210, 409, 54, 25, 64, 215, 64, 118, 319, - 320, 64, 30, 55, 468, 469, 319, 320, 64, 64, - 229, 230, 231, 64, 64, 234, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 55, 64, 55, 55, - 64, 64, 64, 9, 9, 9, 166, 234, 368, 169, - 447, 377, 172, 377, 53, 368, 176, 377, 178, -1, - 220, 181, -1, -1, 377, -1, -1, -1, -1, 436, - 53, 438, 291, 440, -1, -1, -1, 403, -1, 405, - 299, -1, -1, 403, -1, 405, -1, -1, 408, -1, - 403, 211, 405, -1, -1, 53, -1, -1, -1, -1, - -1, 53, 40, 41, 224, 43, -1, -1, -1, 47, - 48, 49, 50, 51, -1, -1, -1, -1, -1, 445, - 58, 447, 448, -1, -1, 445, 53, 447, 448, -1, - -1, -1, 445, -1, 447, 448, -1, -1, -1, -1, - -1, -1, 468, 469, -1, -1, -1, -1, 468, 469, - 40, 41, -1, 43, -1, 468, 469, 47, 377, -1, - -1, 99, 100, -1, -1, 285, -1, -1, 58, -1, - -1, 61, -1, -1, -1, 53, 296, -1, 298, -1, - 163, 301, -1, -1, 403, -1, 405, -1, -1, -1, - -1, -1, -1, 313, -1, -1, -1, -1, -1, -1, - 53, -1, -1, -1, -1, 163, -1, -1, 328, 99, - 100, 163, -1, -1, -1, 335, 336, 337, 338, 339, - 340, 341, 342, 343, 344, 345, 445, 210, 447, 448, - -1, -1, 215, 353, 53, -1, 163, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 229, 230, 231, 468, - 469, 234, 210, -1, -1, -1, -1, 215, 210, 379, - 380, 381, 382, 215, -1, -1, -1, -1, -1, -1, - -1, 229, 230, 231, -1, -1, 234, 229, 230, 231, - -1, -1, 234, 210, 404, 163, 406, 407, 215, -1, - -1, 68, 69, -1, -1, 72, 73, 74, 75, 76, - 77, -1, 229, 230, 231, -1, -1, 234, 291, -1, - 163, -1, -1, -1, -1, 92, 299, 94, 95, 96, - 97, 98, -1, -1, 40, 41, -1, 43, -1, 449, - -1, 47, 210, 291, -1, -1, -1, 215, -1, 291, - -1, 299, 58, -1, 163, 61, -1, 299, -1, -1, - -1, 229, 230, 231, -1, -1, 234, 210, -1, -1, - -1, -1, 215, -1, 291, -1, -1, 40, 41, -1, - 43, -1, 299, -1, 47, -1, 229, 230, 231, -1, - -1, 234, -1, 99, 100, 58, -1, -1, 61, -1, - -1, 210, -1, -1, 377, -1, 215, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 229, 230, 231, 291, -1, 234, -1, -1, -1, 377, - 403, 299, 405, -1, -1, 377, 99, 100, 68, 69, - -1, -1, 72, 73, 74, 75, 76, 77, 291, -1, - -1, -1, -1, -1, -1, 403, 299, 405, -1, -1, - 377, 403, -1, 405, 94, 95, 96, 97, 98, -1, - -1, -1, 445, -1, 447, 448, -1, -1, -1, -1, - 40, 41, 291, 43, -1, -1, 403, 47, 405, -1, - 299, -1, -1, -1, -1, 468, 469, 445, 58, 447, - 448, 61, -1, 445, -1, 447, 448, -1, -1, 377, - -1, -1, -1, -1, -1, -1, 68, 69, -1, -1, - 468, 469, 74, 75, 76, 77, 468, 469, 445, -1, - 447, 448, -1, -1, 377, 403, -1, 405, -1, 99, - 100, -1, 94, 95, 96, 97, 98, 40, 41, -1, - 43, 468, 469, -1, 47, 48, 49, 50, 51, -1, - 403, 54, 405, 40, 41, 58, 43, -1, 377, -1, - 47, 48, 49, 50, 51, -1, -1, 445, -1, 447, - 448, 58, -1, -1, -1, -1, -1, -1, -1, 66, - 67, -1, -1, -1, 403, -1, 405, -1, -1, -1, - 468, 469, 445, -1, 447, 448, 99, 100, -1, -1, - 103, 104, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 99, 100, -1, 468, 469, -1, -1, -1, - -1, -1, -1, -1, 40, 41, 445, 43, 447, 448, - -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, - 11, -1, 58, -1, -1, 61, -1, -1, 19, 468, - 469, 22, 23, 24, -1, 26, 27, 28, 29, -1, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, -1, 43, -1, -1, -1, 47, 48, 49, 50, - 51, -1, -1, 99, 100, 56, 57, 58, -1, -1, - -1, -1, -1, -1, -1, 66, 67, -1, -1, -1, - -1, 40, 41, -1, 43, -1, -1, -1, 47, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, - 12, -1, 61, -1, -1, -1, -1, 19, 99, 100, - 22, 23, 24, -1, 26, 27, 28, 29, -1, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - -1, 43, -1, -1, -1, 47, 48, 49, 50, 51, - 99, 100, -1, -1, 56, -1, 58, -1, -1, -1, - -1, -1, -1, -1, 66, 67, -1, -1, -1, -1, - 40, 41, -1, 43, -1, -1, -1, 47, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 58, 12, - -1, 61, -1, -1, -1, -1, 19, 99, 100, 22, - 23, 24, -1, 26, 27, 28, 29, -1, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, -1, - 43, 16, -1, -1, 47, 48, 49, 50, 51, 99, - 100, -1, -1, 56, -1, 58, -1, -1, -1, -1, - -1, -1, -1, 66, 67, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - -1, -1, -1, 58, 59, -1, -1, 62, -1, -1, - -1, 40, 41, -1, 43, -1, 99, 100, 47, -1, - -1, -1, -1, 78, 79, -1, 16, -1, -1, 58, - -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, - 95, -1, -1, 98, 99, 100, 101, 102, 103, 104, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, -1, -1, -1, 58, -1, - 99, 100, 62, -1, 64, 40, 41, -1, 43, -1, - -1, -1, 47, -1, -1, -1, -1, -1, 78, 79, - -1, 16, -1, 58, -1, -1, 61, -1, -1, -1, - -1, -1, -1, -1, -1, 95, -1, -1, 98, 99, - 100, 101, 102, 103, 104, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 59, -1, -1, 58, 99, 100, 65, 62, -1, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, - -1, -1, -1, 78, 79, -1, 16, -1, -1, -1, - -1, -1, 91, 92, 93, 94, 95, 96, 97, 98, - 95, -1, -1, 98, 99, 100, 101, 102, 103, 104, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, -1, -1, -1, 58, -1, - -1, -1, 62, -1, 17, 18, -1, 20, 21, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 78, 79, - -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, - 43, -1, -1, -1, 47, 95, -1, -1, 98, 99, - 100, 101, 102, 103, 104, 58, -1, -1, 61, -1, - -1, -1, -1, 66, 67, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, - -1, -1, -1, -1, -1, 19, 99, 100, 22, 23, - 24, -1, 26, 27, 28, 29, -1, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, -1, 43, - -1, -1, -1, 47, 48, 49, 50, 51, -1, -1, - -1, -1, 56, -1, 58, -1, -1, 40, 41, -1, - 43, -1, 66, 67, 47, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 58, -1, -1, 61, -1, - -1, -1, -1, 66, 67, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 99, 100, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 55, -1, - -1, -1, -1, 60, -1, -1, 99, 100, 65, -1, - -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 91, 92, 93, 94, 95, 96, - 97, 98, 55, -1, -1, -1, -1, 60, -1, -1, - -1, -1, 65, -1, -1, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 91, 92, - 93, 94, 95, 96, 97, 98, 55, -1, -1, -1, - -1, 60, -1, -1, -1, -1, 65, -1, -1, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 91, 92, 93, 94, 95, 96, 97, 98, - 55, -1, -1, -1, -1, 60, -1, -1, -1, -1, - 65, -1, -1, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 55, -1, 91, 92, 93, 94, - 95, 96, 97, 98, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 65, -1, - -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 55, -1, 91, 92, 93, 94, 95, 96, - 97, 98, 65, -1, -1, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 55, -1, 91, 92, - 93, 94, 95, 96, 97, 98, 65, -1, -1, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 55, -1, 91, 92, 93, 94, 95, 96, 97, 98, - 65, -1, -1, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 55, -1, 91, 92, 93, 94, - 95, 96, 97, 98, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 65, -1, - -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 55, -1, 91, 92, 93, 94, 95, 96, - 97, 98, 65, -1, -1, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 55, -1, 91, 92, - 93, 94, 95, 96, 97, 98, 65, -1, -1, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 55, -1, 91, 92, 93, 94, 95, 96, 97, 98, - 65, -1, -1, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 55, -1, 91, 92, 93, 94, - 95, 96, 97, 98, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 59, -1, - -1, -1, -1, -1, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 59, -1, - -1, -1, -1, -1, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 59, -1, - -1, -1, -1, -1, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 59, -1, - -1, -1, -1, -1, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 60, -1, - -1, -1, -1, 65, -1, -1, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, - 92, 93, 94, 95, 96, 97, 98, 63, -1, 65, - -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 91, 92, 93, 94, 95, - 96, 97, 98, 64, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 64, 65, - -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 91, 92, 93, 94, 95, - 96, 97, 98, 64, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 65, -1, -1, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 91, 92, 93, 94, 95, 96, 97, 98, -1, -1, - -1, -1, -1, 91, 92, 93, 94, 95, 96, 97, - 98, 68, 69, -1, 71, 72, 73, 74, 75, 76, - 77, 68, 69, -1, -1, 72, 73, 74, 75, 76, - 77, -1, -1, -1, 91, 92, 93, 94, 95, 96, - 97, 98, -1, -1, 91, 92, 93, 94, 95, 96, - 97, 98, 68, 69, -1, -1, 72, 73, 74, 75, - 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, - 96, 97, 98 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 47, 100, 116, 117, - 118, 119, 120, 121, 122, 123, 195, 99, 100, 196, - 196, 54, 0, 118, 119, 120, 54, 80, 64, 64, - 101, 198, 171, 195, 16, 40, 41, 42, 43, 44, - 45, 46, 48, 49, 50, 51, 52, 53, 54, 58, - 62, 78, 79, 95, 98, 100, 102, 103, 104, 155, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 174, 175, 176, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 55, 55, 60, - 58, 195, 196, 58, 195, 196, 58, 54, 54, 155, - 58, 59, 155, 172, 173, 195, 155, 155, 54, 58, - 103, 104, 166, 167, 180, 181, 183, 184, 188, 189, - 190, 191, 195, 196, 100, 64, 65, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 91, 92, 93, - 94, 95, 96, 97, 98, 58, 61, 168, 169, 195, - 54, 62, 64, 56, 129, 195, 58, 54, 62, 58, - 54, 62, 58, 155, 155, 55, 60, 155, 60, 59, - 155, 58, 61, 62, 155, 155, 155, 155, 155, 155, - 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, - 155, 155, 155, 155, 47, 100, 194, 172, 173, 195, - 11, 19, 22, 23, 24, 26, 27, 28, 29, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 57, 58, - 66, 67, 124, 125, 127, 128, 129, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 157, 158, 159, 166, 167, 177, 180, 181, 184, - 195, 155, 172, 195, 155, 172, 195, 155, 55, 55, - 155, 59, 155, 155, 195, 63, 59, 55, 54, 12, - 124, 126, 155, 64, 54, 64, 54, 124, 54, 54, - 54, 54, 95, 198, 201, 63, 64, 64, 64, 155, - 64, 54, 54, 58, 178, 179, 180, 181, 195, 184, - 184, 57, 125, 64, 64, 64, 64, 64, 80, 17, - 18, 20, 21, 66, 67, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 59, 55, 54, 59, - 55, 54, 59, 60, 59, 155, 172, 12, 124, 64, - 55, 155, 27, 155, 130, 157, 158, 159, 184, 195, - 155, 63, 63, 64, 172, 172, 59, 60, 155, 54, - 54, 54, 54, 155, 155, 155, 155, 155, 155, 155, - 155, 155, 155, 155, 59, 172, 59, 172, 59, 155, - 54, 55, 64, 55, 54, 55, 64, 30, 60, 55, - 55, 55, 179, 155, 155, 155, 155, 54, 55, 54, - 55, 54, 55, 172, 124, 155, 124, 155, 156, 155, - 195, 129, 64, 64, 55, 55, 60, 55, 60, 55, - 60, 172, 172, 172, 55, 25, 55, 64, 55, 30, - 64, 64, 173, 64, 173, 64, 173, 55, 55, 55, - 124, 64, 130, 124, 155, 55, 55, 55, 55, 55, - 64, 64, 64, 124, 124 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 115, 116, 116, 117, 117, 117, 117, 117, 117, - 118, 119, 120, 120, 120, 120, 120, 121, 122, 123, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 125, 125, 126, 126, 127, - 127, 128, 128, 129, 129, 130, 130, 130, 130, 131, - 131, 132, 132, 132, 133, 134, 134, 135, 136, 136, - 137, 137, 138, 139, 139, 140, 141, 142, 143, 144, - 145, 145, 146, 147, 147, 148, 149, 150, 151, 151, - 152, 153, 154, 155, 155, 155, 156, 156, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 158, 158, 159, 159, 160, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 163, 164, 164, 164, 164, 165, 166, - 166, 167, 167, 168, 168, 168, 168, 168, 168, 169, - 169, 169, 169, 170, 171, 171, 171, 172, 172, 173, - 173, 174, 175, 176, 176, 177, 178, 178, 179, 179, - 179, 180, 181, 182, 183, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 195, 196, 196, 197, 198, - 199, 200, 200, 201, 201, 202, 203 - }; - - 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, 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, 2, 4, 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, 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, 2, 2, 2, 2, 2, 2, 1, - 1, 2, 2, 4, 6, 5, 7, 5, 7, 8, - 9, 9, 9, 3, 3, 1, 0, 1, 0, 3, - 1, 4, 4, 2, 3, 3, 3, 1, 1, 1, - 1, 4, 3, 3, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 7, 2, 1, 2, 1, 1, 1 - }; - - - - -#if IW8DEBUG - const short - parser::yyrline_[] = - { - 0, 267, 267, 268, 272, 274, 276, 278, 280, 282, - 287, 291, 296, 297, 298, 299, 300, 304, 309, 314, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 347, 348, 352, 354, 359, - 361, 366, 367, 371, 372, 376, 378, 380, 383, 387, - 389, 394, 396, 398, 403, 408, 410, 415, 420, 422, - 427, 429, 434, 439, 441, 446, 451, 456, 461, 466, - 471, 473, 478, 483, 485, 490, 495, 500, 505, 507, - 512, 517, 522, 527, 528, 529, 533, 534, 538, 540, - 542, 544, 546, 548, 550, 552, 554, 556, 558, 560, - 565, 567, 572, 574, 579, 584, 586, 588, 590, 592, - 594, 596, 598, 600, 602, 604, 606, 608, 610, 612, - 614, 616, 618, 623, 624, 625, 626, 627, 628, 629, - 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, - 650, 651, 652, 656, 661, 663, 665, 667, 672, 677, - 678, 681, 682, 686, 688, 690, 692, 694, 696, 701, - 703, 705, 707, 712, 717, 719, 722, 726, 729, 733, - 735, 740, 745, 750, 752, 757, 762, 764, 769, 770, - 771, 775, 780, 785, 790, 795, 796, 797, 798, 799, - 800, 801, 802, 803, 807, 812, 817, 822, 827, 832, - 837, 842, 847, 852, 857, 859, 864, 866, 871, 876, - 881, 886, 888, 893, 895, 900, 905 - }; - - 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 // IW8DEBUG - - -#line 13 "parser.ypp" -} } } // xsk::gsc::iw8 -#line 4808 "parser.cpp" - -#line 909 "parser.ypp" - - -void xsk::gsc::iw8::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/src/iw8/xsk/parser.hpp b/src/iw8/xsk/parser.hpp deleted file mode 100644 index a87f5b61..00000000 --- a/src/iw8/xsk/parser.hpp +++ /dev/null @@ -1,5703 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// 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::gsc::iw8::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_IW8_PARSER_HPP_INCLUDED -# define YY_IW8_PARSER_HPP_INCLUDED -// "%code requires" blocks. -#line 28 "parser.ypp" - -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "iw8.hpp" -namespace xsk::gsc::iw8 { class lexer; } - -#line 58 "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 IW8_ASSERT -# include -# define IW8_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 - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# 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 IW8DEBUG -# if defined YYDEBUG -#if YYDEBUG -# define IW8DEBUG 1 -# else -# define IW8DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define IW8DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined IW8DEBUG */ - -#line 13 "parser.ypp" -namespace xsk { namespace gsc { namespace iw8 { -#line 207 "parser.hpp" - - - - - /// A Bison parser. - class parser - { - public: -#ifdef IW8STYPE -# ifdef __GNUC__ -# pragma GCC message "bison: do not #define IW8STYPE in C++, use %define api.value.type" -# endif - typedef IW8STYPE value_type; -#else - /// 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 value_type - { - public: - /// Type of *this. - typedef value_type self_type; - - /// Empty construction. - value_type () YY_NOEXCEPT - : yyraw_ () - , yytypeid_ (YY_NULLPTR) - {} - - /// Construct and fill. - template - value_type (YY_RVREF (T) t) - : yytypeid_ (&typeid (T)) - { - IW8_ASSERT (sizeof (T) <= size); - new (yyas_ ()) T (YY_MOVE (t)); - } - -#if 201103L <= YY_CPLUSPLUS - /// Non copyable. - value_type (const self_type&) = delete; - /// Non copyable. - self_type& operator= (const self_type&) = delete; -#endif - - /// Destruction, allowed only if empty. - ~value_type () YY_NOEXCEPT - { - IW8_ASSERT (!yytypeid_); - } - -# if 201103L <= YY_CPLUSPLUS - /// Instantiate a \a T in here from \a t. - template - T& - emplace (U&&... u) - { - IW8_ASSERT (!yytypeid_); - IW8_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 () - { - IW8_ASSERT (!yytypeid_); - IW8_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) - { - IW8_ASSERT (!yytypeid_); - IW8_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 - { - IW8_ASSERT (yytypeid_); - IW8_ASSERT (*yytypeid_ == typeid (T)); - IW8_ASSERT (sizeof (T) <= size); - return *yyas_ (); - } - - /// Const accessor to a built \a T (for %printer). - template - const T& - as () const YY_NOEXCEPT - { - IW8_ASSERT (yytypeid_); - IW8_ASSERT (*yytypeid_ == typeid (T)); - IW8_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 - { - IW8_ASSERT (yytypeid_); - IW8_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. - value_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 = yyraw_; - return static_cast (yyp); - } - - /// Const accessor to raw memory as \a T. - template - const T* - yyas_ () const YY_NOEXCEPT - { - const void *yyp = 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_tuple - // expr_tuple_types - // expr_object - char dummy6[sizeof (ast::expr)]; - - // expr_add_array - char dummy7[sizeof (ast::expr_add_array::ptr)]; - - // expr_anim - char dummy8[sizeof (ast::expr_anim::ptr)]; - - // expr_animation - char dummy9[sizeof (ast::expr_animation::ptr)]; - - // expr_animtree - char dummy10[sizeof (ast::expr_animtree::ptr)]; - - // expr_arguments - // expr_arguments_no_empty - char dummy11[sizeof (ast::expr_arguments::ptr)]; - - // expr_array - char dummy12[sizeof (ast::expr_array::ptr)]; - - // expr_call - char dummy13[sizeof (ast::expr_call::ptr)]; - - // expr_complement - char dummy14[sizeof (ast::expr_complement::ptr)]; - - // expr_empty_array - char dummy15[sizeof (ast::expr_empty_array::ptr)]; - - // expr_false - char dummy16[sizeof (ast::expr_false::ptr)]; - - // expr_field - char dummy17[sizeof (ast::expr_field::ptr)]; - - // expr_float - char dummy18[sizeof (ast::expr_float::ptr)]; - - // expr_game - char dummy19[sizeof (ast::expr_game::ptr)]; - - // expr_identifier_nosize - // expr_identifier - char dummy20[sizeof (ast::expr_identifier::ptr)]; - - // expr_integer - char dummy21[sizeof (ast::expr_integer::ptr)]; - - // expr_isdefined - char dummy22[sizeof (ast::expr_isdefined::ptr)]; - - // expr_istring - char dummy23[sizeof (ast::expr_istring::ptr)]; - - // expr_istrue - char dummy24[sizeof (ast::expr_istrue::ptr)]; - - // expr_level - char dummy25[sizeof (ast::expr_level::ptr)]; - - // expr_method - char dummy26[sizeof (ast::expr_method::ptr)]; - - // expr_negate - char dummy27[sizeof (ast::expr_negate::ptr)]; - - // expr_not - char dummy28[sizeof (ast::expr_not::ptr)]; - - // expr_parameters - char dummy29[sizeof (ast::expr_parameters::ptr)]; - - // expr_paren - char dummy30[sizeof (ast::expr_paren::ptr)]; - - // expr_path - char dummy31[sizeof (ast::expr_path::ptr)]; - - // expr_reference - char dummy32[sizeof (ast::expr_reference::ptr)]; - - // expr_self - char dummy33[sizeof (ast::expr_self::ptr)]; - - // expr_size - char dummy34[sizeof (ast::expr_size::ptr)]; - - // expr_string - char dummy35[sizeof (ast::expr_string::ptr)]; - - // expr_thisthread - char dummy36[sizeof (ast::expr_thisthread::ptr)]; - - // expr_true - char dummy37[sizeof (ast::expr_true::ptr)]; - - // expr_tuple_arguments - char dummy38[sizeof (ast::expr_tuple::ptr)]; - - // expr_undefined - char dummy39[sizeof (ast::expr_undefined::ptr)]; - - // expr_vector - char dummy40[sizeof (ast::expr_vector::ptr)]; - - // include - char dummy41[sizeof (ast::include::ptr)]; - - // program - char dummy42[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy43[sizeof (ast::stmt)]; - - // stmt_assign - char dummy44[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy45[sizeof (ast::stmt_break::ptr)]; - - // stmt_breakpoint - char dummy46[sizeof (ast::stmt_breakpoint::ptr)]; - - // stmt_call - char dummy47[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy48[sizeof (ast::stmt_case::ptr)]; - - // stmt_continue - char dummy49[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy50[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy51[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy52[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy53[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy54[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy55[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy56[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy57[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy58[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy59[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy60[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy61[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy62[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy63[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy64[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy65[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waitframe - char dummy66[sizeof (ast::stmt_waitframe::ptr)]; - - // stmt_waittill - char dummy67[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy68[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy69[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy70[sizeof (ast::stmt_while::ptr)]; - - // "path" - // "identifier" - // "string literal" - // "localized string" - // "float" - // "integer" - char dummy71[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]; - }; - - /// Whether the content is built: if defined, the name of the stored type. - const std::type_info *yytypeid_; - }; - -#endif - /// Backward compatibility (Bison 3.8). - typedef value_type semantic_type; - - /// Symbol locations. - typedef xsk::gsc::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 - { - IW8EMPTY = -2, - IW8EOF = 0, // "end of file" - IW8error = 1, // error - IW8UNDEF = 2, // "invalid token" - SH_DEFINE = 3, // "#define" - SH_UNDEF = 4, // "#undef" - SH_IFDEF = 5, // "#ifdef" - SH_IFNDEF = 6, // "#ifndef" - SH_IF = 7, // "#if" - SH_ELIF = 8, // "#elif" - SH_ELSE = 9, // "#else" - SH_ENDIF = 10, // "#endif" - DEVBEGIN = 11, // "/#" - DEVEND = 12, // "#/" - INLINE = 13, // "#inline" - INCLUDE = 14, // "#include" - USINGTREE = 15, // "#using_animtree" - ANIMTREE = 16, // "#animtree" - ENDON = 17, // "endon" - NOTIFY = 18, // "notify" - WAIT = 19, // "wait" - WAITTILL = 20, // "waittill" - WAITTILLMATCH = 21, // "waittillmatch" - WAITTILLFRAMEEND = 22, // "waittillframeend" - WAITFRAME = 23, // "waitframe" - IF = 24, // "if" - ELSE = 25, // "else" - DO = 26, // "do" - WHILE = 27, // "while" - FOR = 28, // "for" - FOREACH = 29, // "foreach" - IN = 30, // "in" - SWITCH = 31, // "switch" - CASE = 32, // "case" - DEFAULT = 33, // "default" - BREAK = 34, // "break" - CONTINUE = 35, // "continue" - RETURN = 36, // "return" - BREAKPOINT = 37, // "breakpoint" - PROFBEGIN = 38, // "prof_begin" - PROFEND = 39, // "prof_end" - THREAD = 40, // "thread" - CHILDTHREAD = 41, // "childthread" - THISTHREAD = 42, // "thisthread" - CALL = 43, // "call" - TRUE = 44, // "true" - FALSE = 45, // "false" - UNDEFINED = 46, // "undefined" - SIZE = 47, // "size" - GAME = 48, // "game" - SELF = 49, // "self" - ANIM = 50, // "anim" - LEVEL = 51, // "level" - ISDEFINED = 52, // "isdefined" - ISTRUE = 53, // "istrue" - LPAREN = 54, // "(" - RPAREN = 55, // ")" - LBRACE = 56, // "{" - RBRACE = 57, // "}" - LBRACKET = 58, // "[" - RBRACKET = 59, // "]" - COMMA = 60, // "," - DOT = 61, // "." - DOUBLECOLON = 62, // "::" - COLON = 63, // ":" - SEMICOLON = 64, // ";" - QMARK = 65, // "?" - INCREMENT = 66, // "++" - DECREMENT = 67, // "--" - LSHIFT = 68, // "<<" - RSHIFT = 69, // ">>" - OR = 70, // "||" - AND = 71, // "&&" - EQUALITY = 72, // "==" - INEQUALITY = 73, // "!=" - LESS_EQUAL = 74, // "<=" - GREATER_EQUAL = 75, // ">=" - LESS = 76, // "<" - GREATER = 77, // ">" - NOT = 78, // "!" - COMPLEMENT = 79, // "~" - ASSIGN = 80, // "=" - ASSIGN_ADD = 81, // "+=" - ASSIGN_SUB = 82, // "-=" - ASSIGN_MUL = 83, // "*=" - ASSIGN_DIV = 84, // "/=" - ASSIGN_MOD = 85, // "%=" - ASSIGN_BW_OR = 86, // "|=" - ASSIGN_BW_AND = 87, // "&=" - ASSIGN_BW_EXOR = 88, // "^=" - ASSIGN_RSHIFT = 89, // ">>=" - ASSIGN_LSHIFT = 90, // "<<=" - BITWISE_OR = 91, // "|" - BITWISE_AND = 92, // "&" - BITWISE_EXOR = 93, // "^" - ADD = 94, // "+" - SUB = 95, // "-" - MUL = 96, // "*" - DIV = 97, // "/" - MOD = 98, // "%" - PATH = 99, // "path" - IDENTIFIER = 100, // "identifier" - STRING = 101, // "string literal" - ISTRING = 102, // "localized string" - FLOAT = 103, // "float" - INTEGER = 104, // "integer" - SIZEOF = 105, // SIZEOF - ADD_ARRAY = 106, // ADD_ARRAY - THEN = 107, // THEN - TERN = 108, // TERN - NEG = 109, // NEG - ANIMREF = 110, // ANIMREF - PREINC = 111, // PREINC - PREDEC = 112, // PREDEC - POSTINC = 113, // POSTINC - POSTDEC = 114 // POSTDEC - }; - /// Backward compatibility alias (Bison 3.6). - typedef token_kind_type yytokentype; - }; - - /// Token kind, as returned by yylex. - typedef token::token_kind_type 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 = 115, ///< Number of tokens. - S_YYEMPTY = -2, - S_YYEOF = 0, // "end of file" - S_YYerror = 1, // error - S_YYUNDEF = 2, // "invalid token" - S_SH_DEFINE = 3, // "#define" - S_SH_UNDEF = 4, // "#undef" - S_SH_IFDEF = 5, // "#ifdef" - S_SH_IFNDEF = 6, // "#ifndef" - S_SH_IF = 7, // "#if" - S_SH_ELIF = 8, // "#elif" - S_SH_ELSE = 9, // "#else" - S_SH_ENDIF = 10, // "#endif" - S_DEVBEGIN = 11, // "/#" - S_DEVEND = 12, // "#/" - S_INLINE = 13, // "#inline" - S_INCLUDE = 14, // "#include" - S_USINGTREE = 15, // "#using_animtree" - S_ANIMTREE = 16, // "#animtree" - S_ENDON = 17, // "endon" - S_NOTIFY = 18, // "notify" - S_WAIT = 19, // "wait" - S_WAITTILL = 20, // "waittill" - S_WAITTILLMATCH = 21, // "waittillmatch" - S_WAITTILLFRAMEEND = 22, // "waittillframeend" - S_WAITFRAME = 23, // "waitframe" - S_IF = 24, // "if" - S_ELSE = 25, // "else" - S_DO = 26, // "do" - S_WHILE = 27, // "while" - S_FOR = 28, // "for" - S_FOREACH = 29, // "foreach" - S_IN = 30, // "in" - S_SWITCH = 31, // "switch" - S_CASE = 32, // "case" - S_DEFAULT = 33, // "default" - S_BREAK = 34, // "break" - S_CONTINUE = 35, // "continue" - S_RETURN = 36, // "return" - S_BREAKPOINT = 37, // "breakpoint" - S_PROFBEGIN = 38, // "prof_begin" - S_PROFEND = 39, // "prof_end" - S_THREAD = 40, // "thread" - S_CHILDTHREAD = 41, // "childthread" - S_THISTHREAD = 42, // "thisthread" - S_CALL = 43, // "call" - S_TRUE = 44, // "true" - S_FALSE = 45, // "false" - S_UNDEFINED = 46, // "undefined" - S_SIZE = 47, // "size" - S_GAME = 48, // "game" - S_SELF = 49, // "self" - S_ANIM = 50, // "anim" - S_LEVEL = 51, // "level" - S_ISDEFINED = 52, // "isdefined" - S_ISTRUE = 53, // "istrue" - S_LPAREN = 54, // "(" - S_RPAREN = 55, // ")" - S_LBRACE = 56, // "{" - S_RBRACE = 57, // "}" - S_LBRACKET = 58, // "[" - S_RBRACKET = 59, // "]" - S_COMMA = 60, // "," - S_DOT = 61, // "." - S_DOUBLECOLON = 62, // "::" - S_COLON = 63, // ":" - S_SEMICOLON = 64, // ";" - S_QMARK = 65, // "?" - S_INCREMENT = 66, // "++" - S_DECREMENT = 67, // "--" - S_LSHIFT = 68, // "<<" - S_RSHIFT = 69, // ">>" - S_OR = 70, // "||" - S_AND = 71, // "&&" - S_EQUALITY = 72, // "==" - S_INEQUALITY = 73, // "!=" - S_LESS_EQUAL = 74, // "<=" - S_GREATER_EQUAL = 75, // ">=" - S_LESS = 76, // "<" - S_GREATER = 77, // ">" - S_NOT = 78, // "!" - S_COMPLEMENT = 79, // "~" - S_ASSIGN = 80, // "=" - S_ASSIGN_ADD = 81, // "+=" - S_ASSIGN_SUB = 82, // "-=" - S_ASSIGN_MUL = 83, // "*=" - S_ASSIGN_DIV = 84, // "/=" - S_ASSIGN_MOD = 85, // "%=" - S_ASSIGN_BW_OR = 86, // "|=" - S_ASSIGN_BW_AND = 87, // "&=" - S_ASSIGN_BW_EXOR = 88, // "^=" - S_ASSIGN_RSHIFT = 89, // ">>=" - S_ASSIGN_LSHIFT = 90, // "<<=" - S_BITWISE_OR = 91, // "|" - S_BITWISE_AND = 92, // "&" - S_BITWISE_EXOR = 93, // "^" - S_ADD = 94, // "+" - S_SUB = 95, // "-" - S_MUL = 96, // "*" - S_DIV = 97, // "/" - S_MOD = 98, // "%" - S_PATH = 99, // "path" - S_IDENTIFIER = 100, // "identifier" - S_STRING = 101, // "string literal" - S_ISTRING = 102, // "localized string" - S_FLOAT = 103, // "float" - S_INTEGER = 104, // "integer" - S_SIZEOF = 105, // SIZEOF - S_ADD_ARRAY = 106, // ADD_ARRAY - S_THEN = 107, // THEN - S_TERN = 108, // TERN - S_NEG = 109, // NEG - S_ANIMREF = 110, // ANIMREF - S_PREINC = 111, // PREINC - S_PREDEC = 112, // PREDEC - S_POSTINC = 113, // POSTINC - S_POSTDEC = 114, // POSTDEC - S_YYACCEPT = 115, // $accept - S_root = 116, // root - S_program = 117, // program - S_inline = 118, // inline - S_include = 119, // include - S_declaration = 120, // declaration - S_decl_usingtree = 121, // decl_usingtree - S_decl_constant = 122, // decl_constant - S_decl_thread = 123, // decl_thread - S_stmt = 124, // stmt - S_stmt_or_dev = 125, // stmt_or_dev - S_stmt_list = 126, // stmt_list - S_stmt_or_dev_list = 127, // stmt_or_dev_list - S_stmt_dev = 128, // stmt_dev - S_stmt_block = 129, // stmt_block - S_stmt_expr = 130, // stmt_expr - S_stmt_call = 131, // stmt_call - S_stmt_assign = 132, // stmt_assign - S_stmt_endon = 133, // stmt_endon - S_stmt_notify = 134, // stmt_notify - S_stmt_wait = 135, // stmt_wait - S_stmt_waittill = 136, // stmt_waittill - S_stmt_waittillmatch = 137, // stmt_waittillmatch - S_stmt_waittillframeend = 138, // stmt_waittillframeend - S_stmt_waitframe = 139, // stmt_waitframe - S_stmt_if = 140, // stmt_if - S_stmt_ifelse = 141, // stmt_ifelse - S_stmt_while = 142, // stmt_while - S_stmt_dowhile = 143, // stmt_dowhile - S_stmt_for = 144, // stmt_for - S_stmt_foreach = 145, // stmt_foreach - S_stmt_switch = 146, // stmt_switch - S_stmt_case = 147, // stmt_case - S_stmt_default = 148, // stmt_default - S_stmt_break = 149, // stmt_break - S_stmt_continue = 150, // stmt_continue - S_stmt_return = 151, // stmt_return - S_stmt_breakpoint = 152, // stmt_breakpoint - S_stmt_prof_begin = 153, // stmt_prof_begin - S_stmt_prof_end = 154, // stmt_prof_end - S_expr = 155, // expr - S_expr_or_empty = 156, // expr_or_empty - S_expr_assign = 157, // expr_assign - S_expr_increment = 158, // expr_increment - S_expr_decrement = 159, // expr_decrement - S_expr_ternary = 160, // expr_ternary - S_expr_binary = 161, // expr_binary - S_expr_primitive = 162, // expr_primitive - S_expr_complement = 163, // expr_complement - S_expr_negate = 164, // expr_negate - S_expr_not = 165, // expr_not - S_expr_call = 166, // expr_call - S_expr_method = 167, // expr_method - S_expr_function = 168, // expr_function - S_expr_pointer = 169, // expr_pointer - S_expr_add_array = 170, // expr_add_array - S_expr_parameters = 171, // expr_parameters - S_expr_arguments = 172, // expr_arguments - S_expr_arguments_no_empty = 173, // expr_arguments_no_empty - S_expr_isdefined = 174, // expr_isdefined - S_expr_istrue = 175, // expr_istrue - S_expr_reference = 176, // expr_reference - S_expr_tuple = 177, // expr_tuple - S_expr_tuple_arguments = 178, // expr_tuple_arguments - S_expr_tuple_types = 179, // expr_tuple_types - S_expr_array = 180, // expr_array - S_expr_field = 181, // expr_field - S_expr_size = 182, // expr_size - S_expr_paren = 183, // expr_paren - S_expr_object = 184, // expr_object - S_expr_thisthread = 185, // expr_thisthread - S_expr_empty_array = 186, // expr_empty_array - S_expr_undefined = 187, // expr_undefined - S_expr_game = 188, // expr_game - S_expr_self = 189, // expr_self - S_expr_anim = 190, // expr_anim - S_expr_level = 191, // expr_level - S_expr_animation = 192, // expr_animation - S_expr_animtree = 193, // expr_animtree - S_expr_identifier_nosize = 194, // expr_identifier_nosize - S_expr_identifier = 195, // expr_identifier - S_expr_path = 196, // expr_path - S_expr_istring = 197, // expr_istring - S_expr_string = 198, // expr_string - S_expr_vector = 199, // expr_vector - S_expr_float = 200, // expr_float - S_expr_integer = 201, // expr_integer - S_expr_false = 202, // expr_false - S_expr_true = 203 // 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 () YY_NOEXCEPT - : 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_istrue: // expr_istrue - value.move< ast::expr_istrue::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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::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_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_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_add_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_add_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_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_animtree::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_animtree::ptr& v, const location_type& l) - : 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_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_istrue::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_istrue::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_negate::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l) - : 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_thisthread::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_thisthread::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_tuple::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_tuple::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::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_waitframe::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_waitframe::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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.template destroy< ast::expr_add_array::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_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - 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_identifier_nosize: // expr_identifier_nosize - 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_istrue: // expr_istrue - value.template destroy< ast::expr_istrue::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_negate: // expr_negate - value.template destroy< ast::expr_negate::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_thisthread: // expr_thisthread - value.template destroy< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.template destroy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.template destroy< ast::stmt_waitframe::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_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_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. - value_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 - { - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; - - /// Default constructor. - by_kind () YY_NOEXCEPT; - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that) YY_NOEXCEPT; -#endif - - /// Copy constructor. - by_kind (const by_kind& that) YY_NOEXCEPT; - - /// Constructor from (external) token numbers. - by_kind (kind_type t) YY_NOEXCEPT; - - - - /// 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 () YY_NOEXCEPT {} - - /// Constructor for valueless symbols, and symbols from each type. -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, location_type l) - : super_type (token_kind_type (tok), std::move (l)) -#else - symbol_type (int tok, const location_type& l) - : super_type (token_kind_type (tok), l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - IW8_ASSERT (tok == token::IW8EOF - || (token::IW8error <= tok && tok <= token::MOD) - || (token::SIZEOF <= tok && tok <= token::POSTDEC)); -#endif - } -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, std::string v, location_type l) - : super_type (token_kind_type (tok), std::move (v), std::move (l)) -#else - symbol_type (int tok, const std::string& v, const location_type& l) - : super_type (token_kind_type (tok), v, l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - IW8_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); -#endif - } - }; - - /// Build a parser object. - parser (xsk::gsc::iw8::lexer& lexer_yyarg, xsk::gsc::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 IW8DEBUG - /// 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 token kind. -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW8EOF (location_type l) - { - return symbol_type (token::IW8EOF, std::move (l)); - } -#else - static - symbol_type - make_IW8EOF (const location_type& l) - { - return symbol_type (token::IW8EOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW8error (location_type l) - { - return symbol_type (token::IW8error, std::move (l)); - } -#else - static - symbol_type - make_IW8error (const location_type& l) - { - return symbol_type (token::IW8error, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_IW8UNDEF (location_type l) - { - return symbol_type (token::IW8UNDEF, std::move (l)); - } -#else - static - symbol_type - make_IW8UNDEF (const location_type& l) - { - return symbol_type (token::IW8UNDEF, 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_ANIMTREE (location_type l) - { - return symbol_type (token::ANIMTREE, std::move (l)); - } -#else - static - symbol_type - make_ANIMTREE (const location_type& l) - { - return symbol_type (token::ANIMTREE, 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_WAITFRAME (location_type l) - { - return symbol_type (token::WAITFRAME, std::move (l)); - } -#else - static - symbol_type - make_WAITFRAME (const location_type& l) - { - return symbol_type (token::WAITFRAME, 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_CHILDTHREAD (location_type l) - { - return symbol_type (token::CHILDTHREAD, std::move (l)); - } -#else - static - symbol_type - make_CHILDTHREAD (const location_type& l) - { - return symbol_type (token::CHILDTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_THISTHREAD (location_type l) - { - return symbol_type (token::THISTHREAD, std::move (l)); - } -#else - static - symbol_type - make_THISTHREAD (const location_type& l) - { - return symbol_type (token::THISTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_CALL (location_type l) - { - return symbol_type (token::CALL, std::move (l)); - } -#else - static - symbol_type - make_CALL (const location_type& l) - { - return symbol_type (token::CALL, 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_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_ISTRUE (location_type l) - { - return symbol_type (token::ISTRUE, std::move (l)); - } -#else - static - symbol_type - make_ISTRUE (const location_type& l) - { - return symbol_type (token::ISTRUE, 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_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_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_SIZEOF (location_type l) - { - return symbol_type (token::SIZEOF, std::move (l)); - } -#else - static - symbol_type - make_SIZEOF (const location_type& l) - { - return symbol_type (token::SIZEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_ADD_ARRAY (location_type l) - { - return symbol_type (token::ADD_ARRAY, std::move (l)); - } -#else - static - symbol_type - make_ADD_ARRAY (const location_type& l) - { - return symbol_type (token::ADD_ARRAY, 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) YY_NOEXCEPT; - - /// 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) YY_NOEXCEPT; - - 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_kind_type enum. - static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; - - - - // 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 symbol kind of the accessing symbol of - // state STATE-NUM. - static const unsigned char yystos_[]; - - // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. - static const unsigned char yyr1_[]; - - // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. - static const signed char yyr2_[]; - - -#if IW8DEBUG - // 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT; - - /// Constants. - enum - { - yylast_ = 2542, ///< Last index in yytable_. - yynnts_ = 89, ///< Number of nonterminal symbols. - yyfinal_ = 22 ///< Termination state number. - }; - - - // User arguments. - xsk::gsc::iw8::lexer& lexer; - xsk::gsc::ast::program::ptr& ast; - - }; - - inline - parser::symbol_kind_type - parser::yytranslate_ (int t) YY_NOEXCEPT - { - 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::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_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.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_identifier_nosize: // expr_identifier_nosize - 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_istrue: // expr_istrue - value.copy< ast::expr_istrue::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_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); - 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_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_istrue: // expr_istrue - value.move< ast::expr_istrue::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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::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_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_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 () YY_NOEXCEPT - : kind_ (symbol_kind::S_YYEMPTY) - {} - -#if 201103L <= YY_CPLUSPLUS - inline - parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT - : kind_ (that.kind_) - { - that.clear (); - } -#endif - - inline - parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT - : kind_ (that.kind_) - {} - - inline - parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT - : 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::gsc::iw8 -#line 5699 "parser.hpp" - - - - -#endif // !YY_IW8_PARSER_HPP_INCLUDED diff --git a/src/iw8/xsk/resolver.hpp b/src/iw8/xsk/resolver.hpp deleted file mode 100644 index 0be8ceda..00000000 --- a/src/iw8/xsk/resolver.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::iw8 -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint32_t; - static auto token_name(std::uint32_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::gsc::iw8 diff --git a/src/iw9/iw9.cpp b/src/iw9/iw9.cpp new file mode 100644 index 00000000..991f39aa --- /dev/null +++ b/src/iw9/iw9.cpp @@ -0,0 +1,58 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw9.hpp" + +namespace xsk::gsc::iw9 +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, path_count> const path_list; +extern std::array, hash_count> const hash_list; + +context::context() : gsc::context(props::str4| props::waitframe | props::params | props::boolfuncs | props::boolnotand | props::hash | props::farcall | props::foreach, + engine::iw9, endian::little, system::pc, 0) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + // func_map_.reserve(func_list.size()); + // func_map_rev_.reserve(func_list.size()); + // meth_map_.reserve(meth_list.size()); + // meth_map_rev_.reserve(meth_list.size()); + path_map_.reserve(path_list.size()); + hash_map_.reserve(hash_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + // for (auto const& entry : func_list) + // { + // func_map_.insert({ entry.first, entry.second }); + // func_map_rev_.insert({ entry.second, entry.first }); + // } + + // for (auto const& entry : meth_list) + // { + // meth_map_.insert({ entry.first, entry.second }); + // meth_map_rev_.insert({ entry.second, entry.first }); + // } + + for (auto const& entry : path_list) + { + path_map_.insert({ entry.first, entry.second }); + } + + for (auto const& entry : hash_list) + { + hash_map_.insert({ entry.first, entry.second }); + } +} + +} // namespace xsk::gsc::iw9 diff --git a/src/iw9/iw9.hpp b/src/iw9/iw9.hpp new file mode 100644 index 00000000..5255fec1 --- /dev/null +++ b/src/iw9/iw9.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::iw9 +{ + +constexpr usize code_count = 167; +constexpr usize func_count = 905; +constexpr usize meth_count = 1469; +constexpr usize path_count = 1467; +constexpr usize hash_count = 73500; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::iw9 diff --git a/src/iw9/iw9_code.cpp b/src/iw9/iw9_code.cpp new file mode 100644 index 00000000..5e61a12d --- /dev/null +++ b/src/iw9/iw9_code.cpp @@ -0,0 +1,182 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw9.hpp" + +namespace xsk::gsc::iw9 +{ + +extern std::array, code_count> const code_list +{{ + { 0x00, opcode::OP_CastFieldObject }, + { 0x01, opcode::OP_SetLocalVariableFieldCached }, + { 0x02, opcode::OP_plus }, + { 0x03, opcode::OP_RemoveLocalVariables }, + { 0x04, opcode::OP_EvalSelfFieldVariableRef }, + { 0x05, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x06, opcode::OP_GetGameRef }, + { 0x07, opcode::OP_EvalAnimFieldVariable }, + { 0x08, opcode::OP_EvalLevelFieldVariableRef }, + { 0x09, opcode::OP_GetThisthread }, + { 0x0A, opcode::OP_greater }, + { 0x0B, opcode::OP_waittillmatch }, + { 0x0C, opcode::OP_shift_right }, + { 0x0D, opcode::OP_dec }, + { 0x0E, opcode::OP_JumpOnTrue }, + { 0x0F, opcode::OP_bit_or }, + { 0x10, opcode::OP_equality }, + { 0x11, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x12, opcode::OP_notify }, + { 0x13, opcode::OP_GetVector }, + { 0x14, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x15, opcode::OP_PreScriptCall }, + { 0x16, opcode::OP_GetByte }, + { 0x17, opcode::OP_ScriptFarThreadCall }, + { 0x18, opcode::OP_SetSelfFieldVariableField }, + { 0x19, opcode::OP_JumpOnFalseExpr }, + { 0x1A, opcode::OP_GetUndefined }, + { 0x1B, opcode::OP_jumpback }, + { 0x1C, opcode::OP_JumpOnTrueExpr }, + { 0x1D, opcode::OP_CallBuiltin }, + { 0x1E, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x1F, opcode::OP_ClearFieldVariable }, + { 0x20, opcode::OP_GetLevel }, + { 0x21, opcode::OP_size }, + { 0x22, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x23, opcode::OP_AddArray }, + { 0x24, opcode::OP_endon }, + { 0x25, opcode::OP_EvalFieldVariable }, + { 0x26, opcode::OP_shift_left }, + { 0x27, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x28, opcode::OP_Return }, + { 0x29, opcode::OP_CreateLocalVariable }, + { 0x2A, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x2B, opcode::OP_GetBuiltinFunction }, + { 0x2C, opcode::OP_CallBuiltinMethodPointer }, + { 0x2D, opcode::OP_GetSelfObject }, + { 0x2E, opcode::OP_GetGame }, + { 0x2F, opcode::OP_SetLevelFieldVariableField }, + { 0x30, opcode::OP_EvalArray }, + { 0x31, opcode::OP_GetSelf }, + { 0x32, opcode::OP_End }, + { 0x33, opcode::OP_EvalSelfFieldVariable }, + { 0x34, opcode::OP_less_equal }, + { 0x35, opcode::OP_EvalLocalVariableCached0 }, + { 0x36, opcode::OP_EvalLocalVariableCached1 }, + { 0x37, opcode::OP_EvalLocalVariableCached2 }, + { 0x38, opcode::OP_EvalLocalVariableCached3 }, + { 0x39, opcode::OP_EvalLocalVariableCached4 }, + { 0x3A, opcode::OP_EvalLocalVariableCached5 }, + { 0x3B, opcode::OP_EvalLocalVariableCached }, + { 0x3C, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x3D, opcode::OP_ScriptChildThreadCallPointer }, + { 0x3E, opcode::OP_EvalLocalVariableObjectCached }, + { 0x3F, opcode::OP_GetUnsignedInt }, + { 0x40, opcode::OP_ScriptMethodCallPointer }, + { 0x41, opcode::OP_checkclearparams }, + { 0x42, opcode::OP_SetAnimFieldVariableField }, + { 0x43, opcode::OP_waittillmatch2 }, + { 0x44, opcode::OP_minus }, + { 0x45, opcode::OP_GetNegUnsignedShort }, + { 0x46, opcode::OP_GetNegByte }, + { 0x47, opcode::OP_SafeCreateVariableFieldCached }, + { 0x48, opcode::OP_greater_equal }, + { 0x49, opcode::OP_vector }, + { 0x4A, opcode::OP_GetBuiltinMethod }, + { 0x4B, opcode::OP_endswitch }, + { 0x4C, opcode::OP_ClearArray }, + { 0x4D, opcode::OP_DecTop }, + { 0x4E, opcode::OP_CastBool }, + { 0x4F, opcode::OP_EvalArrayRef }, + { 0x50, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x51, opcode::OP_GetZero }, + { 0x52, opcode::OP_wait }, + { 0x53, opcode::OP_waittill }, + { 0x54, opcode::OP_GetIString }, + { 0x55, opcode::OP_ScriptFarFunctionCall }, + { 0x56, opcode::OP_GetAnimObject }, + { 0x57, opcode::OP_GetAnimTree }, + { 0x58, opcode::OP_EvalLocalArrayCached }, + { 0x59, opcode::OP_mod }, + { 0x5A, opcode::OP_ScriptFarMethodThreadCall }, + { 0x5B, opcode::OP_GetUnsignedShort }, + { 0x5C, opcode::OP_clearparams }, + { 0x5D, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x5E, opcode::OP_ScriptFunctionCallPointer }, + { 0x5F, opcode::OP_EmptyArray }, + { 0x60, opcode::OP_SafeSetVariableFieldCached }, + { 0x61, opcode::OP_ClearVariableField }, + { 0x62, opcode::OP_EvalFieldVariableRef }, + { 0x63, opcode::OP_EvalNewLocalVariableRefCached0 }, + { 0x64, opcode::OP_GetFloat }, + { 0x65, opcode::OP_EvalLocalVariableRefCached }, + { 0x66, opcode::OP_JumpOnFalse }, + { 0x67, opcode::OP_BoolComplement }, + { 0x68, opcode::OP_ScriptThreadCallPointer }, + { 0x69, opcode::OP_less }, + { 0x6A, opcode::OP_BoolNot }, + { 0x6B, opcode::OP_waittillFrameEnd }, + { 0x6C, opcode::OP_waitframe }, + { 0x6D, opcode::OP_GetString }, + { 0x6E, opcode::OP_EvalLevelFieldVariable }, + { 0x6F, opcode::OP_GetLevelObject }, + { 0x70, opcode::OP_inc }, + { 0x71, opcode::OP_CallBuiltinMethod }, + { 0x72, opcode::OP_GetAnim }, + { 0x73, opcode::OP_switch }, + { 0x74, opcode::OP_SetVariableField }, + { 0x75, opcode::OP_divide }, + { 0x76, opcode::OP_ScriptFarChildThreadCall }, + { 0x77, opcode::OP_multiply }, + { 0x78, opcode::OP_ClearLocalVariableFieldCached }, + { 0x79, opcode::OP_EvalAnimFieldVariableRef }, + { 0x7A, opcode::OP_EvalLocalArrayRefCached }, + { 0x7B, opcode::OP_EvalLocalVariableRefCached0 }, + { 0x7C, opcode::OP_bit_and }, + { 0x7D, opcode::OP_GetAnimation }, + { 0x7E, opcode::OP_GetFarFunction }, + { 0x7F, opcode::OP_CallBuiltinPointer }, + { 0x80, opcode::OP_jump }, + { 0x81, opcode::OP_voidCodepos }, + { 0x82, opcode::OP_ScriptFarMethodCall }, + { 0x83, opcode::OP_inequality }, + { 0x84, opcode::OP_bit_ex_or }, + { 0x85, opcode::OP_GetStatHash }, + { 0x86, opcode::OP_GetUnkxHash }, + { 0x87, opcode::OP_GetEnumHash }, + { 0x88, opcode::OP_GetDvarHash }, + { 0x89, opcode::OP_GetNegUnsignedInt }, + { 0x8A, opcode::OP_GetInteger64 }, + { 0x8B, opcode::OP_iw9_139 }, + { 0x8C, opcode::OP_iw9_140 }, + { 0x8D, opcode::OP_iw9_141 }, + { 0x8E, opcode::OP_iw9_142 }, + { 0x8F, opcode::OP_iw9_143 }, + { 0x90, opcode::OP_iw9_144 }, + { 0x91, opcode::OP_prof_begin }, + { 0x92, opcode::OP_prof_end }, + { 0x93, opcode::OP_breakpoint }, + { 0x94, opcode::OP_assignmentBreakpoint }, + { 0x95, opcode::OP_manualAndAssignmentBreakpoint }, + { 0x96, opcode::OP_BoolNotAfterAnd }, + { 0x97, opcode::OP_FormalParams }, + { 0x98, opcode::OP_IsDefined }, + { 0x99, opcode::OP_IsTrue }, + { 0x9A, opcode::OP_NativeGetFarFunction }, + { 0x9B, opcode::OP_NativeFarFunctionCall }, + { 0x9C, opcode::OP_NativeFarMethodCall }, + { 0x9D, opcode::OP_NativeFarFunctionThreadCall }, + { 0x9E, opcode::OP_NativeFarMethodThreadCall }, + { 0x9F, opcode::OP_NativeFarFunctionChildThreadCall }, + { 0xA0, opcode::OP_NativeFarMethodChildThreadCall }, + { 0xA1, opcode::OP_EvalNewLocalArrayRefCached0_Precompiled }, + { 0xA2, opcode::OP_SetNewLocalVariableFieldCached0_Precompiled }, + { 0xA3, opcode::OP_CreateLocalVariable_Precompiled }, + { 0xA4, opcode::OP_SafeCreateVariableFieldCached_Precompiled }, + { 0xA5, opcode::OP_FormalParams_Precompiled }, + { 0xA6, opcode::OP_iw9_166 }, +}}; + +} // namespace xsk::gsc::iw9 diff --git a/src/iw9/iw9_func.cpp b/src/iw9/iw9_func.cpp new file mode 100644 index 00000000..1bf8f087 --- /dev/null +++ b/src/iw9/iw9_func.cpp @@ -0,0 +1,920 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw9.hpp" + +namespace xsk::gsc::iw9 +{ + +extern std::array, func_count> const func_list +{{ + { 0x8B8C2A03A244E13F, "abs" }, + { 0x6B8C32B811EEE56C, "absangleclamp180" }, + { 0x36AEC2FDE5F71C73, "acos" }, + { 0xFCAEA5036636456A, "activateclientexploder" }, + { 0x391D06A5E35A0A49, "addagent" }, + { 0x381637A422422A95, "addbot" }, + { 0x725CF1C4EC163911, "addclienttoheadiconmask" }, + { 0x27BEFD4503A26500, "addclienttotargetmarkergroupmask" }, + { 0xA82E9D84CBDF8082, "addmpbottoteam" }, + { 0x1B18261ADDCC4ABB, "addteamtoheadiconmask" }, + { 0x124C814836EDDF9A, "addteamtotargetmarkergroupmask" }, + { 0x6B8712AC8B7052BE, "analyticsaddevent" }, + { 0x2376DCB267163556, "analyticsreset" }, + { 0x516C393D4DE149F9, "analyticsstreamerislogfilestreamingenabled" }, + { 0x37946B9BF7B0539C, "analyticsstreamerlogfilestartstream" }, + { 0x0BDDDED7E12896BC, "analyticsstreamerlogfilewritetobuffer" }, + { 0x7C06F14CAD98028A, "analyticswritecsv" }, + { 0x2E3278D571FE8AC3, "angleclamp" }, + { 0x55E9029216EA81CE, "angleclamp180" }, + { 0x42EA4D476F755D8E, "anglelerpquat" }, + { 0x2373DBE7869D05CA, "anglelerpquatfrac" }, + { 0x0505FBD2C78CF2D9, "anglesdelta" }, + { 0x3B788DDF6CA7F51D, "anglestoaxis" }, + { 0x6343041D48C52FD1, "anglestoforward" }, + { 0xDCED42AFDD45D69D, "anglestoleft" }, + { 0xF3142D73646911D6, "anglestoright" }, + { 0xE1CBCAB0B57B6631, "anglestoup" }, + { 0x36B981852DABD9DF, "animhasnotetrack" }, + { 0x71E3ABD9638BAC1C, "animisleaf" }, + { 0xF1035857C8351BC6, "animsetgetallanimindicesforalias" }, + { 0xA43B51737A0652FB, "animsetgetanimfromindex" }, + { 0xA1FF7D977FCE07C2, "animspeedthresholdsexist" }, + { 0x00F96EA8330B0696, "announcement" }, + { 0xEC966AE82B55FE85, "archetypeassetloaded" }, + { 0x4E35CFA4DBAB26A0, "archetypegetalias" }, + { 0x8D4C0AB4DBE60024, "archetypegetaliases" }, + { 0x7C617FDBF8A1D2F5, "archetypegetrandomalias" }, + { 0x89E06AD28A6AE7A5, "archetypehasstate" }, + { 0x509F4DFD3E1493FA, "asin" }, + { 0xF7EC644D4449F752, "asmregistergenerichandler" }, + { 0x5D1B78FD467E651B, "atan" }, + { 0x609248DB2DB6A45D, "attachmentisrestricted" }, + { 0x2762A17097581ABF, "averagenormal" }, + { 0xCF312D855FA246B2, "averagepoint" }, + { 0x5823D1A59130B985, "axistoangles" }, + { 0xB6B35DC666442DEE, "badplace_cylinder" }, + { 0xEEC38B024A15ADEB, "badplace_delete" }, + { 0xAA71D9EE0DC3A497, "badplace_global" }, + { 0xD0943990D5EEF45C, "bbprint" }, + { 0x1ADDEF15650266BA, "bbreportspawnfactors" }, + { 0xC385631C41395A23, "bbreportspawnplayerdetails" }, + { 0xF252F2E64170C5AB, "bbreportspawntypes" }, + { 0xB395C6D47AF18AFA, "botflagmemoryevents" }, + { 0xBF745B124E5013D0, "botgetclosestnavigablepoint" }, + { 0x64621D232DB36960, "botgetmemoryevents" }, + { 0x84E09A9B32BBD124, "botmemoryflags" }, + { 0x471AB069482204CD, "botsystemstatus" }, + { 0x65722C9348936997, "botzonegetcount" }, + { 0x08571B9770CC1164, "botzonegetindoorpercent" }, + { 0x80E7F70BD51AD3C5, "botzonenearestcount" }, + { 0xB86FE41D2AA7EA85, "botzonesetteam" }, + { 0x32C47BFD01CB7273, "brmatchstarted" }, + { 0x50FCD55FB71CC036, "bulletspread" }, + { 0x3DCDB95F89A31506, "cachespawnpathnodesincode" }, + { 0x5A6E56CA5BEF9DC1, "calcscriptablepayloadgravityarc" }, + { 0x928268723F2C1394, "canceljoins" }, + { 0x6509B3A63C63C6DC, "canspawn" }, + { 0x661C6B917C59AD05, "capsuletracepassed" }, + { 0x16A3B22475E0E3E4, "ceil" }, + { 0xB1F586D611B74900, "clamp" }, + { 0x276DE4115DB4DD92, "combineangles" }, + { 0x404DC2BA3A480531, "computedropbagpositions" }, + { 0xA5488403B3EDF318, "cos" }, + { 0x6AE1EE7C9EFEC4BE, "createheadicon" }, + { 0x718B3F3E9ED3DEC5, "createheadiconatorigin" }, + { 0xAA5B6775C83BB198, "createnavbadplacebybounds" }, + { 0x740CD79D53241E2A, "createnavbadplacebyent" }, + { 0x4865714999953C56, "createnavbadplacebyshape" }, + { 0xDE8005E35B477D23, "createnavobstaclebybounds" }, + { 0x2270D99159991C6F, "createnavobstaclebyent" }, + { 0xAF282DF026CDAFC0, "createnavrepulsor" }, + { 0x0EFC898F3F9BE993, "createspawninfluencepoint" }, + { 0x5F43069F286831F1, "createtargetmarkergroup" }, + { 0x3CC3DE7DB472C9E7, "createthreatbiasgroup" }, + { 0x120EF59307207451, "deleteheadicon" }, + { 0xDF3072ED3271EA7C, "deletetargetmarkergroup" }, + { 0xF905D520D83D3A64, "despawncovernode" }, + { 0xDB2D0107C273A6F6, "destroynavlink" }, + { 0xDE3E3EB9A110B31F, "destroynavobstacle" }, + { 0x0A5B749FD2530538, "destroynavrepulsor" }, + { 0xC5EC404716322E3B, "destroyspawninfluencepoint" }, + { 0x5778BD7F90E6902A, "disablelootspawnpoint" }, + { 0x8665F01027BDBF8F, "disablespawnpointbyindex" }, + { 0xD1D50219898BD2BD, "disablespawnpoints" }, + { 0xE1B25D40E4D29FFF, "disablespawnpointsbyclassname" }, + { 0xB4FF3960D7C8162E, "distance" }, + { 0x4D9A080429F7BCD0, "distance2d" }, + { 0x1D1DE5374B805F71, "distance2dsquared" }, + { 0x0062D746FEE72D9B, "distancesquared" }, + { 0x5CB82E5914C9C59F, "dlog_recordevent" }, + { 0x2D17DDD166A62582, "dotournamentendgame" }, + { 0x0D471BEB98E219FC, "earthquake" }, + { 0xBE5F80DA9BAEA259, "enablefrontlinecriticalfactor" }, + { 0x9D3F5C96127DDADE, "enablegroundwarspawnlogic" }, + { 0xAAAF2E915E142F38, "enablespawnpointbyindex" }, + { 0x6065E0A29DB35746, "enablespawnpointsbyclassname" }, + { 0x7A90688F925364DE, "endlobby" }, + { 0x99C74E2466ABDE86, "equipmentisrestricted" }, + { 0x5708FBBAEC69F8F9, "exitlevel" }, + { 0xC2F0DB03C9E845D4, "exp" }, + { 0x399DED0682B263FC, "findclosestlospointwithinradius" }, + { 0x160D900BFEAA97B0, "findclosestlospointwithinvolume" }, + { 0x21A2CA31B658CDFD, "findclosestnonlospointwithinvolume" }, + { 0x611864A3FDA1AEA3, "findclosestpointbyapproxpathdist" }, + { 0xCFA49837CDF76F45, "findentrances" }, + { 0xF23EF3E292D3D21E, "findpathcustom" }, + { 0xF9004909DAD666A9, "float" }, + { 0xF8D45309DAA61641, "floor" }, + { 0x1413B6BF238DF91B, "generateaxisanglesfromforwardvector" }, + { 0x6410D7AAAD3C0D81, "generateaxisanglesfromupvector" }, + { 0xDFDD62C710B4AE25, "getactiveclientcount" }, + { 0xD2261A887C1B7A1E, "getaiarray" }, + { 0x3164F28155ED07DF, "getaiarrayinradius" }, + { 0x64A5501BC44597FC, "getaicount" }, + { 0x555E2759CE9D949A, "getaispeciesarray" }, + { 0xE8EFBD9AD34EC2A4, "getaiunittypearray" }, + { 0x56C76109C045BB83, "getallnodes" }, + { 0xD79BCEAA7F07851F, "getallvehiclenodes" }, + { 0x4A6030C56BB90B87, "getaltbunkerindexforname" }, + { 0x8D075621AB418874, "getangledelta" }, + { 0x4E1C039356866AF3, "getangledelta3d" }, + { 0x625E382AA78498D6, "getangleindex" }, + { 0xE9D315D450E49767, "getangleindices" }, + { 0xE2041E05EF74CBAE, "getanglesforanimtime" }, + { 0x170380CF79A235EE, "getanimlength" }, + { 0x7D25358925BF7F51, "getanimname" }, + { 0x9501B55A55920B70, "getanimspeedthreshold" }, + { 0x359E715AF5E401DC, "getarraykeys" }, + { 0xE654652A8C0B5674, "getbnetigrbattlepassxpmultiplier" }, + { 0x6A8A0B2E8ADCE0FA, "getbnetigrplayerxpmultiplier" }, + { 0xF9DC057C609A5954, "getbuildnumber" }, + { 0xAE1BE4F31CDE3C53, "getbuildversion" }, + { 0xAB6F82DD5CE0482D, "getclientmatchdata" }, + { 0x367C224E33F41C4E, "getclosestnodeinsight" }, + { 0x57FCFAC4E3859DC7, "getclosestpointonnavmesh" }, + { 0x08496EC60376420F, "getcompleteweaponname" }, + { 0x711EE46B94BCBE00, "getcorpsearray" }, + { 0x98B011DDE8E31F35, "getcorpseorigin" }, + { 0x9B03FC86F937FC39, "getdediserverguid" }, + { 0xE170DE7C1E9A3DDE, "getdvar" }, + { 0xAB10A695B43FC2B4, "getdvarfloat" }, + { 0x0FBDB5FD2AC2902F, "getdvarint" }, + { 0xF54D1AAD9E652735, "getdvarvector" }, + { 0x0C8DBAB7E3C0AEC0, "getent" }, + { 0xBEBE1FB6103CC4BD, "getentarray" }, + { 0xF04DC495B0AC5AB4, "getentarrayinradius" }, + { 0x2EB520693F94EC8B, "getentbynum" }, + { 0x23D8DFA245A80857, "getentitylessscriptablearray" }, + { 0x4CCFEE6F73819653, "getfirstarraykey" }, + { 0x207E63A0EFAF536F, "getgametypeindex" }, + { 0x111D0617FA0F1589, "getglass" }, + { 0xC9E3106638D7482A, "getgrenadethrowoffset" }, + { 0x38F84F7565AFCD8F, "getgroundposition" }, + { 0x6A643D9E84CB4138, "getislosdatafileloaded" }, + { 0xD23D2BAEFD870413, "getlinkednodes" }, + { 0x38473C5775ACD08F, "getlootscriptablearray" }, + { 0x3E072AB52F07B68A, "getlootscriptablearrayinradius" }, + { 0xE84E7152D07AB486, "getlootspawnpoint" }, + { 0x60C8C8B35722F9F5, "getlootspawnpointcount" }, + { 0xB237F55700BC2111, "getlootspawnscriptableindexfirst" }, + { 0xFF09EC899B4054D0, "getmapsuncolorandintensity" }, + { 0xE82EE54B1EB59D1C, "getmatchdata" }, + { 0xBFB4DFA13137B023, "getmatchrulesdata" }, + { 0x26399837D65B48B1, "getmaxagents" }, + { 0xAF75A9E6A061640D, "getmaxclients" }, + { 0x4EEEDCA5ACC19195, "getmaxobjectivecount" }, + { 0x05B5A3E6ECEFED34, "getmissileowner" }, + { 0xC3B9720BCA1629FC, "getmovedelta" }, + { 0x90C9D2B3D2BCE77E, "getnearestspeedthresholdname" }, + { 0x6DB433AE7304A362, "getnextarraykey" }, + { 0x55F88573B2E75DE7, "getnextlowestspeedthresholdstring" }, + { 0xCAD27105451A9113, "getnode" }, + { 0x4E96FA1643DEDA68, "getnodearray" }, + { 0xCEDEF6B7CA332112, "getnodebyindex" }, + { 0x8DCCA05D04F390F2, "getnodecount" }, + { 0x7053959A620E7326, "getnodeowner" }, + { 0x0065B77EB03063FD, "getnodesinradius" }, + { 0xA49DD65E8C162370, "getnodesinradiussorted" }, + { 0xBBF13EF22E817CC1, "getnodesintrigger" }, + { 0x7EA028E7C12C9DD2, "getnodesonpath" }, + { 0xF440E23CA48B5979, "getnodezone" }, + { 0x6952A2E805B3EA05, "getnorthyaw" }, + { 0x784E1D9EC7E7A590, "getnotetracktimes" }, + { 0x3639B0105491F241, "getnumparts" }, + { 0x2BFB04C093125E04, "getomnvar" }, + { 0x003D97A77A1F7B2C, "getoriginforanimtime" }, + { 0xE985C2A3D4C5BB7D, "getpartname" }, + { 0x5E0445E9F348AFD4, "getpathdist" }, + { 0xA9429CC8A1D362A9, "getplayerrateofgamerevenue" }, + { 0xA88305D68AE8C220, "getplaylistid" }, + { 0xC1488101461674E6, "getplaylistname" }, + { 0x85C156B2BD33A617, "getplaylistversion" }, + { 0x06886788DD1586CB, "getpotgduration" }, + { 0x75097F1DC39A1684, "getpotgstarttime" }, + { 0xF8AE3902300DEA2D, "getpredictedentityposition" }, + { 0x8E58DC4B701BE708, "getquestpoints" }, + { 0xD559E028A160777D, "getrandomnavpoint" }, + { 0x951F075AE725D3CA, "getrandomnavpoints" }, + { 0xEA667F987463D9D1, "getscriptablearray" }, + { 0x0ED975376766E160, "getscriptablearrayinradius" }, + { 0x50871E4C2A9E6E51, "getscriptableinstancefromindex" }, + { 0x070D4DD6A65FDF16, "getscriptablelootcachecontents" }, + { 0x8EE44084DD6A921D, "getscriptablelootspawnedcountbyname" }, + { 0x8E68E5926CC82D34, "getscriptbundle" }, + { 0x0E016C7FE6DF4904, "getscriptcachecontents" }, + { 0x24DD8F25209F58F9, "getsentientcounts" }, + { 0x6C49BC0A237EE171, "getsentientlimits" }, + { 0x5719A2537A1CBED9, "getserverhostname" }, + { 0x4D2BA4C1617E1E0F, "getspawnarray" }, + { 0x94B8F4812077F6BD, "getstartangles" }, + { 0x3BE921663A496C43, "getstartorigin" }, + { 0x094F85A4DB0F161E, "getsubstr" }, + { 0xC5AC7565BEFE4BEB, "getsystemtime" }, + { 0x4E57E270868FE799, "getsystemtimeinmicroseconds" }, + { 0x9A9892E6421DEB21, "getteamplayersalive" }, + { 0xABAD2CF9C915E3B2, "getteamradar" }, + { 0xB9584A96908DF850, "getteamscore" }, + { 0x9B7FF7EF73C3451A, "gettime" }, + { 0xEC1978FE66EC71F9, "getuavstrengthlevelneutral" }, + { 0x61607293C1127BE3, "getuavstrengthlevelshowenemydirectional" }, + { 0x14D7EE0E0D7460FD, "getuavstrengthlevelshowenemyfastsweep" }, + { 0x7AB3ED3C16AF18C6, "getuavstrengthmax" }, + { 0x7A90DF3C1688B244, "getuavstrengthmin" }, + { 0x0726B569C1CA15E4, "getunusedlootcachepoints" }, + { 0x2E5AAF66AD98CD59, "getvehiclenode" }, + { 0x2189D165FB6121C2, "getvehiclenodearray" }, + { 0x2652C60802BAB274, "getweaponammopoolname" }, + { 0x0DC4A40BC6C89268, "getweaponarray" }, + { 0xDE7FCEAE0EB250D5, "getweaponarrayinradius" }, + { 0xB069155475C5D877, "getweaponattachments" }, + { 0x7A039BFD9561A394, "getweaponattachmentworldmodels" }, + { 0x21CFC2E451602B7D, "getweaponbasename" }, + { 0xF46B21821D93E97C, "getweaponcamoname" }, + { 0xD1FC5439963EC66A, "getweaponclipmodel" }, + { 0x2900B116C752DA09, "getweaponindex" }, + { 0xA00FDFEC452D09A7, "getweaponloottable" }, + { 0x071963656C0A40D0, "getweaponmodel" }, + { 0xFF95F119CE4B3860, "getweaponvariantindex" }, + { 0x24CC2BF690D70A10, "getzonecount" }, + { 0xC0A2A42BD9BE8095, "getzonenearest" }, + { 0x0ECA810F03A755B0, "getzonenodeforindex" }, + { 0x1761D6450391AAC6, "getzonenodes" }, + { 0xCB719ED303CD104F, "getzonenodesbydist" }, + { 0xC019620F18D62CBB, "getzoneorigin" }, + { 0x52D83C57A558D812, "getzonepath" }, + { 0x98FFDCD771506CF8, "glassradiusdamage" }, + { 0x2BF45DCAEBDB87A5, "hastacvis" }, + { 0x3DB5EF460BC6C165, "havemapentseffects" }, + { 0xA7C4864A84C689D3, "hideheadiconfromplayersinmask" }, + { 0x0047FD8FCDF90B0E, "id_0047FD8FCDF90B0E" }, + { 0x03875866B3A6D349, "id_03875866B3A6D349" }, + { 0x03B6961B424A382F, "id_03B6961B424A382F" }, + { 0x03CB5DA19764BAA3, "id_03CB5DA19764BAA3" }, + { 0x03E193B0415E8658, "id_03E193B0415E8658" }, + { 0x054AC2394A29B65F, "id_054AC2394A29B65F" }, + { 0x05651D05B13FCF64, "id_05651D05B13FCF64" }, + { 0x060D6151AF81A343, "id_060D6151AF81A343" }, + { 0x067E2B3DDA1BEE8A, "id_067E2B3DDA1BEE8A" }, + { 0x06A36B14E6B79459, "id_06A36B14E6B79459" }, + { 0x074756A08469CA5E, "id_074756A08469CA5E" }, + { 0x08345F2AC499E5AB, "id_08345F2AC499E5AB" }, + { 0x08581F011CE975A6, "id_08581F011CE975A6" }, + { 0x08858434F2625BF7, "id_08858434F2625BF7" }, + { 0x0F28FD66285FA2C9, "id_0F28FD66285FA2C9" }, + { 0x0F65A948BFF3A538, "id_0F65A948BFF3A538" }, + { 0x10CF685DA2BFFEDA, "id_10CF685DA2BFFEDA" }, + { 0x113DC070D175DAFF, "id_113DC070D175DAFF" }, + { 0x11E88C88F89143FE, "id_11E88C88F89143FE" }, + { 0x1473E5C0181C7AD0, "id_1473E5C0181C7AD0" }, + { 0x148FD200D203457A, "id_148FD200D203457A" }, + { 0x1611D0F6B5F84B9A, "id_1611D0F6B5F84B9A" }, + { 0x16BAE3E0B0AA09E3, "id_16BAE3E0B0AA09E3" }, + { 0x1823FF50BB28148D, "id_1823FF50BB28148D" }, + { 0x18B16CD8DEF5E879, "id_18B16CD8DEF5E879" }, + { 0x1A3DD0FBFE26893F, "id_1A3DD0FBFE26893F" }, + { 0x1AD3C760A0D54763, "id_1AD3C760A0D54763" }, + { 0x1B688B532168CD14, "id_1B688B532168CD14" }, + { 0x1BB1470F934A81EB, "id_1BB1470F934A81EB" }, + { 0x1C161B20F0C6C6B5, "id_1C161B20F0C6C6B5" }, + { 0x1DB72F37B2E59440, "id_1DB72F37B2E59440" }, + { 0x1DD1F56BC3D72B7E, "id_1DD1F56BC3D72B7E" }, + { 0x1E231FC15FDAB31D, "id_1E231FC15FDAB31D" }, + { 0x1E73E03E20E15DFF, "id_1E73E03E20E15DFF" }, + { 0x1EB7D2791D3C536F, "id_1EB7D2791D3C536F" }, + { 0x2030CC4AD67D1634, "id_2030CC4AD67D1634" }, + { 0x20D5809A5332448F, "id_20D5809A5332448F" }, + { 0x216C67AB6749137A, "id_216C67AB6749137A" }, + { 0x22993FE73B6D16F4, "id_22993FE73B6D16F4" }, + { 0x2336488258354FBC, "id_2336488258354FBC" }, + { 0x24E85292B191399C, "id_24E85292B191399C" }, + { 0x25040278E58D8DA3, "id_25040278E58D8DA3" }, + { 0x28EEFFCB2337321E, "id_28EEFFCB2337321E" }, + { 0x2A627FA5FD1CE263, "id_2A627FA5FD1CE263" }, + { 0x2A781949ACE88CA4, "id_2A781949ACE88CA4" }, + { 0x2AFCE3C4640B03C9, "id_2AFCE3C4640B03C9" }, + { 0x2CE39E65A48D5EC0, "id_2CE39E65A48D5EC0" }, + { 0x2E84A570D6AF300A, "id_2E84A570D6AF300A" }, + { 0x2EF675C13CA1C4AF, "id_2EF675C13CA1C4AF" }, + { 0x30DDBFD5E5E2A771, "id_30DDBFD5E5E2A771" }, + { 0x31A67E5538887627, "id_31A67E5538887627" }, + { 0x3211981142EC5AEE, "id_3211981142EC5AEE" }, + { 0x32E4BF54FA0F8C07, "id_32E4BF54FA0F8C07" }, + { 0x332B73D2ECA8C367, "id_332B73D2ECA8C367" }, + { 0x347F34CAC350B5DD, "id_347F34CAC350B5DD" }, + { 0x356AECA51EC05BC0, "id_356AECA51EC05BC0" }, + { 0x36ED24909DABB916, "id_36ED24909DABB916" }, + { 0x373416B9EC7DD155, "id_373416B9EC7DD155" }, + { 0x38AE83992C7EB8A5, "id_38AE83992C7EB8A5" }, + { 0x3C1C3F98CD23089E, "id_3C1C3F98CD23089E" }, + { 0x401D0838F4F47C3E, "id_401D0838F4F47C3E" }, + { 0x405CA75FC1A4EC12, "id_405CA75FC1A4EC12" }, + { 0x40FD49171FAD19D3, "id_40FD49171FAD19D3" }, + { 0x425D34DDD114F3DE, "id_425D34DDD114F3DE" }, + { 0x4358B309FDCC6D44, "id_4358B309FDCC6D44" }, + { 0x4476B9B75CB95D99, "id_4476B9B75CB95D99" }, + { 0x468420FFD9205765, "id_468420FFD9205765" }, + { 0x48DC7B5F7E9E4061, "id_48DC7B5F7E9E4061" }, + { 0x4AD9053267734CF2, "id_4AD9053267734CF2" }, + { 0x4ADD228B999C26AA, "id_4ADD228B999C26AA" }, + { 0x4AF71893064929F8, "id_4AF71893064929F8" }, + { 0x4AFDEFC72472A638, "id_4AFDEFC72472A638" }, + { 0x4F344EC5B7C45A3F, "id_4F344EC5B7C45A3F" }, + { 0x4F9373A1227DB35C, "id_4F9373A1227DB35C" }, + { 0x4FEB334351C0C1CA, "id_4FEB334351C0C1CA" }, + { 0x4FF17EFD15D01D3F, "id_4FF17EFD15D01D3F" }, + { 0x50F8A8F765BAD85E, "id_50F8A8F765BAD85E" }, + { 0x5162A2AAAD39B2C7, "id_5162A2AAAD39B2C7" }, + { 0x51F396445BAA7FA6, "id_51F396445BAA7FA6" }, + { 0x531194F673A06DE5, "id_531194F673A06DE5" }, + { 0x538E92208B641725, "id_538E92208B641725" }, + { 0x53F71C9DBFE19CE9, "id_53F71C9DBFE19CE9" }, + { 0x5508DDEA3A84DF39, "id_5508DDEA3A84DF39" }, + { 0x55DB7A4374ED4B1B, "id_55DB7A4374ED4B1B" }, + { 0x572838690D80D959, "id_572838690D80D959" }, + { 0x57A19C163B50D584, "id_57A19C163B50D584" }, + { 0x58585BBAA46F6BBA, "id_58585BBAA46F6BBA" }, + { 0x58FB674A1DD27075, "id_58FB674A1DD27075" }, + { 0x5A05C362AF7E301B, "id_5A05C362AF7E301B" }, + { 0x5B8C2AF0033C3A14, "id_5B8C2AF0033C3A14" }, + { 0x5D6132045B29BAF5, "id_5D6132045B29BAF5" }, + { 0x5EDDC94E0785D7A2, "id_5EDDC94E0785D7A2" }, + { 0x5FAAB6FEF1BAF5AE, "id_5FAAB6FEF1BAF5AE" }, + { 0x61B03C8C194A6733, "id_61B03C8C194A6733" }, + { 0x626B6E017A257E10, "id_626B6E017A257E10" }, + { 0x63C101C16F5F40BE, "id_63C101C16F5F40BE" }, + { 0x6527364C1ECCA6C6, "id_6527364C1ECCA6C6" }, + { 0x65EEF2622BD403CF, "id_65EEF2622BD403CF" }, + { 0x667F43CE2EE5B5DD, "id_667F43CE2EE5B5DD" }, + { 0x6730D890F604CABE, "id_6730D890F604CABE" }, + { 0x67A97472E5A6C64C, "id_67A97472E5A6C64C" }, + { 0x67FEE9F22662295C, "id_67FEE9F22662295C" }, + { 0x67FF0340E1C92259, "id_67FF0340E1C92259" }, + { 0x69E0176E97B04CC7, "id_69E0176E97B04CC7" }, + { 0x6A9090E74FD4E90A, "id_6A9090E74FD4E90A" }, + { 0x6B4AB6C856A01415, "id_6B4AB6C856A01415" }, + { 0x6B9F8406E6153597, "id_6B9F8406E6153597" }, + { 0x6BF2B684ED87AD5E, "id_6BF2B684ED87AD5E" }, + { 0x6DAA1CA6FED22CF3, "id_6DAA1CA6FED22CF3" }, + { 0x6EB2235636D28921, "id_6EB2235636D28921" }, + { 0x6F642674E19EBC2A, "id_6F642674E19EBC2A" }, + { 0x6F9B54CEA87F1C9E, "id_6F9B54CEA87F1C9E" }, + { 0x718D435F9750C1B5, "id_718D435F9750C1B5" }, + { 0x71A28A935629A941, "id_71A28A935629A941" }, + { 0x72066AA981916ECC, "id_72066AA981916ECC" }, + { 0x73E183E02834309D, "id_73E183E02834309D" }, + { 0x75391F72C52786A5, "id_75391F72C52786A5" }, + { 0x75B035199842693D, "id_75B035199842693D" }, + { 0x767CEA82B001F645, "id_767CEA82B001F645" }, + { 0x76B285B4BAE7356C, "id_76B285B4BAE7356C" }, + { 0x76B92DB94020C5CE, "id_76B92DB94020C5CE" }, + { 0x776BDB2810E99635, "id_776BDB2810E99635" }, + { 0x778365A5DD216A2B, "id_778365A5DD216A2B" }, + { 0x77BFC94EE479C823, "id_77BFC94EE479C823" }, + { 0x785F60047ABCFA05, "id_785F60047ABCFA05" }, + { 0x79404C2FCCA1C184, "id_79404C2FCCA1C184" }, + { 0x7A21AA652F0613B0, "id_7A21AA652F0613B0" }, + { 0x7A37F9BAB9677061, "id_7A37F9BAB9677061" }, + { 0x7AFB89FC511BF315, "id_7AFB89FC511BF315" }, + { 0x7BCD667FC073FC12, "id_7BCD667FC073FC12" }, + { 0x7C093AAEC980131B, "id_7C093AAEC980131B" }, + { 0x7C612AC92BA98DCB, "id_7C612AC92BA98DCB" }, + { 0x7E3F22E620F3F71E, "id_7E3F22E620F3F71E" }, + { 0x7E7B315FCB2B9159, "id_7E7B315FCB2B9159" }, + { 0x7EB04CA16D045775, "id_7EB04CA16D045775" }, + { 0x7EE4E0E48FE05C22, "id_7EE4E0E48FE05C22" }, + { 0x8107C79679A9F8E1, "id_8107C79679A9F8E1" }, + { 0x811510B694DDD963, "id_811510B694DDD963" }, + { 0x824881E424DA15B4, "id_824881E424DA15B4" }, + { 0x8294C13E5683B0A3, "id_8294C13E5683B0A3" }, + { 0x82D95BA721744147, "id_82D95BA721744147" }, + { 0x846C101D2C3FE49A, "id_846C101D2C3FE49A" }, + { 0x848155BE2B7DA2CB, "id_848155BE2B7DA2CB" }, + { 0x85F0E7ABCA18AD51, "id_85F0E7ABCA18AD51" }, + { 0x865F9C5D005F9A08, "id_865F9C5D005F9A08" }, + { 0x869CCB4E3451B8C6, "id_869CCB4E3451B8C6" }, + { 0x87E4FF0E078152E9, "id_87E4FF0E078152E9" }, + { 0x87FAE2B26DBC397D, "id_87FAE2B26DBC397D" }, + { 0x891B1FB6A51B97B0, "id_891B1FB6A51B97B0" }, + { 0x8B71EB96E1636EDC, "id_8B71EB96E1636EDC" }, + { 0x8BA164C5A84FBB48, "id_8BA164C5A84FBB48" }, + { 0x8CE5803B7D377D72, "id_8CE5803B7D377D72" }, + { 0x8D0E1F40856173F4, "id_8D0E1F40856173F4" }, + { 0x904672268EB8E3FE, "id_904672268EB8E3FE" }, + { 0x906E53C2FB9D3F9C, "id_906E53C2FB9D3F9C" }, + { 0x90814EE949699BAA, "id_90814EE949699BAA" }, + { 0x90B5B6E99AEF29D6, "id_90B5B6E99AEF29D6" }, + { 0x90FAF3F11984372A, "id_90FAF3F11984372A" }, + { 0x90FB4916AA7FD9F3, "id_90FB4916AA7FD9F3" }, + { 0x910A912F327B8D34, "id_910A912F327B8D34" }, + { 0x91A28C56C45A736F, "id_91A28C56C45A736F" }, + { 0x9241A75CB048508D, "id_9241A75CB048508D" }, + { 0x941528A2553E5D82, "id_941528A2553E5D82" }, + { 0x9427CB5974C925D9, "id_9427CB5974C925D9" }, + { 0x949690BFCBCDC8CF, "id_949690BFCBCDC8CF" }, + { 0x94C7AE7049488358, "id_94C7AE7049488358" }, + { 0x95C6391212A25F7C, "id_95C6391212A25F7C" }, + { 0x96B7FC7E35353254, "id_96B7FC7E35353254" }, + { 0x96D228FA8E72A818, "id_96D228FA8E72A818" }, + { 0x9752A69F79A06B7A, "id_9752A69F79A06B7A" }, + { 0x97B31127037043B6, "id_97B31127037043B6" }, + { 0x9846F68B2EDD52D5, "id_9846F68B2EDD52D5" }, + { 0x98DEAE9464F6C005, "id_98DEAE9464F6C005" }, + { 0x9912FB866ADA47D7, "id_9912FB866ADA47D7" }, + { 0x9986ADA1C79FEE45, "id_9986ADA1C79FEE45" }, + { 0x9A83377C98BCE82A, "id_9A83377C98BCE82A" }, + { 0x9BE1E9F1351A5C97, "id_9BE1E9F1351A5C97" }, + { 0x9C8F4AD66661C757, "id_9C8F4AD66661C757" }, + { 0x9D1E19C311CBE199, "id_9D1E19C311CBE199" }, + { 0x9D30FD63965BAFA9, "id_9D30FD63965BAFA9" }, + { 0x9F617BB5CF59DBF0, "id_9F617BB5CF59DBF0" }, + { 0x9F9BA8A4756DB8C7, "id_9F9BA8A4756DB8C7" }, + { 0xA0CCCF0B4C466B2C, "id_A0CCCF0B4C466B2C" }, + { 0xA0CFB616F44B7907, "id_A0CFB616F44B7907" }, + { 0xA1054A8C2BC6C36D, "id_A1054A8C2BC6C36D" }, + { 0xA13E72E0427ECAD2, "id_A13E72E0427ECAD2" }, + { 0xA16750CD44F57931, "id_A16750CD44F57931" }, + { 0xA1A5654DB94DBB07, "id_A1A5654DB94DBB07" }, + { 0xA30E6BFA5C581E40, "id_A30E6BFA5C581E40" }, + { 0xA3385E8751DE04A3, "id_A3385E8751DE04A3" }, + { 0xA39E9894083F4513, "id_A39E9894083F4513" }, + { 0xA59E04A186FEDA43, "id_A59E04A186FEDA43" }, + { 0xA794FCF9545F2062, "id_A794FCF9545F2062" }, + { 0xAA2A76E5B30B25DA, "id_AA2A76E5B30B25DA" }, + { 0xAA940A5B82D4D6A3, "id_AA940A5B82D4D6A3" }, + { 0xAAD7A0EA8AC4CA23, "id_AAD7A0EA8AC4CA23" }, + { 0xAAE8B5DC22C12D2C, "id_AAE8B5DC22C12D2C" }, + { 0xAB26892D96278702, "id_AB26892D96278702" }, + { 0xAB839AAC87B49838, "id_AB839AAC87B49838" }, + { 0xABBD4595D76CCC5E, "id_ABBD4595D76CCC5E" }, + { 0xADF0D34FF483C35A, "id_ADF0D34FF483C35A" }, + { 0xADFD4002C83FE6B2, "id_ADFD4002C83FE6B2" }, + { 0xAE368FAD1A1DC337, "id_AE368FAD1A1DC337" }, + { 0xAF2D9A459EBD113D, "id_AF2D9A459EBD113D" }, + { 0xB1EEF70090B5B7B5, "id_B1EEF70090B5B7B5" }, + { 0xB3B3E822F262EBDA, "id_B3B3E822F262EBDA" }, + { 0xB49CDE2A52702967, "id_B49CDE2A52702967" }, + { 0xB4B9401715CF98EA, "id_B4B9401715CF98EA" }, + { 0xB4EBE6632D7E8EFE, "id_B4EBE6632D7E8EFE" }, + { 0xB9E807F454D30FE4, "id_B9E807F454D30FE4" }, + { 0xBB92A5000082832A, "id_BB92A5000082832A" }, + { 0xBBFC94714C82788B, "id_BBFC94714C82788B" }, + { 0xBC5DF124338CEFEA, "id_BC5DF124338CEFEA" }, + { 0xBC97202BA2DB4CF4, "id_BC97202BA2DB4CF4" }, + { 0xBF304EFE09A7CEEB, "id_BF304EFE09A7CEEB" }, + { 0xBF3237AB00FD71A1, "id_BF3237AB00FD71A1" }, + { 0xC047D7FFE7A83501, "id_C047D7FFE7A83501" }, + { 0xC080F7EF04FC3970, "id_C080F7EF04FC3970" }, + { 0xC1AA7C066EC92CA5, "id_C1AA7C066EC92CA5" }, + { 0xC30ACBB55783D011, "id_C30ACBB55783D011" }, + { 0xC36E3161B08CC355, "id_C36E3161B08CC355" }, + { 0xC36F897D56E28169, "id_C36F897D56E28169" }, + { 0xC3FAFA01F5D05D23, "id_C3FAFA01F5D05D23" }, + { 0xC5CF558181E12D1F, "id_C5CF558181E12D1F" }, + { 0xC6D15635447865C5, "id_C6D15635447865C5" }, + { 0xC7F2F8CD775A57F8, "id_C7F2F8CD775A57F8" }, + { 0xC838F02B25DA3712, "id_C838F02B25DA3712" }, + { 0xC8BCC9DBBF542CE3, "id_C8BCC9DBBF542CE3" }, + { 0xC98DF02C041ADCCB, "id_C98DF02C041ADCCB" }, + { 0xCA9AF9C7FABD79A0, "id_CA9AF9C7FABD79A0" }, + { 0xCB5DC7BD04B05B04, "id_CB5DC7BD04B05B04" }, + { 0xCDAB88BA2CE79251, "id_CDAB88BA2CE79251" }, + { 0xCE30512FCD3A11A1, "id_CE30512FCD3A11A1" }, + { 0xCE9D0299637C2C24, "id_CE9D0299637C2C24" }, + { 0xCF14FFC946066DBD, "id_CF14FFC946066DBD" }, + { 0xD002A41ABEA504BB, "id_D002A41ABEA504BB" }, + { 0xD03495FE6418377B, "id_D03495FE6418377B" }, + { 0xD159656D2B07F8A5, "id_D159656D2B07F8A5" }, + { 0xD1B64C3D055CEEB0, "id_D1B64C3D055CEEB0" }, + { 0xD1E52856DC19C5D0, "id_D1E52856DC19C5D0" }, + { 0xD291656CEA83ED81, "id_D291656CEA83ED81" }, + { 0xD2C13FC95E4E8962, "id_D2C13FC95E4E8962" }, + { 0xD3D3F12A9FD105EB, "id_D3D3F12A9FD105EB" }, + { 0xD47580052756D597, "id_D47580052756D597" }, + { 0xD559A384B9C4E7D9, "id_D559A384B9C4E7D9" }, + { 0xD57D61C9F7B4AA77, "id_D57D61C9F7B4AA77" }, + { 0xD76CC64B205084A3, "id_D76CC64B205084A3" }, + { 0xD85A1E614464B733, "id_D85A1E614464B733" }, + { 0xDACFB39159904E2C, "id_DACFB39159904E2C" }, + { 0xDAF6C5596BB31DFF, "id_DAF6C5596BB31DFF" }, + { 0xDC0D4632189B623A, "id_DC0D4632189B623A" }, + { 0xDC11C1CAFFE56E16, "id_DC11C1CAFFE56E16" }, + { 0xDCCECA58C71CEB5F, "id_DCCECA58C71CEB5F" }, + { 0xDCFEEA6332BCA22F, "id_DCFEEA6332BCA22F" }, + { 0xDDE0CCE873A8C5A2, "id_DDE0CCE873A8C5A2" }, + { 0xDF4360488E5C458E, "id_DF4360488E5C458E" }, + { 0xE004A29F97015C17, "id_E004A29F97015C17" }, + { 0xE00CC8C1C5CC38FB, "id_E00CC8C1C5CC38FB" }, + { 0xE0E1F4CEEEEF5F34, "id_E0E1F4CEEEEF5F34" }, + { 0xE45E5FD94EC4AF36, "id_E45E5FD94EC4AF36" }, + { 0xE4DA167DC330B3D3, "id_E4DA167DC330B3D3" }, + { 0xE777ACC966FBD44D, "id_E777ACC966FBD44D" }, + { 0xE812B7065161DA79, "id_E812B7065161DA79" }, + { 0xE843253D046AD859, "id_E843253D046AD859" }, + { 0xEA1DDEF8AEDE7460, "id_EA1DDEF8AEDE7460" }, + { 0xEAC0CD99C9C6D8EE, "id_EAC0CD99C9C6D8EE" }, + { 0xEB1A045A6D299C6A, "id_EB1A045A6D299C6A" }, + { 0xEB7F544259415A09, "id_EB7F544259415A09" }, + { 0xED9B1DDD2EC82DAB, "id_ED9B1DDD2EC82DAB" }, + { 0xEE7C0CCDE65DE2EC, "id_EE7C0CCDE65DE2EC" }, + { 0xEE990C1808DF152B, "id_EE990C1808DF152B" }, + { 0xEFAAB797904D13E8, "id_EFAAB797904D13E8" }, + { 0xF0EF5D175747F19F, "id_F0EF5D175747F19F" }, + { 0xF159C10D5CF8F0B4, "id_F159C10D5CF8F0B4" }, + { 0xF30A6D3194F97C09, "id_F30A6D3194F97C09" }, + { 0xF53F47C5E7E21548, "id_F53F47C5E7E21548" }, + { 0xF581838CE4328F7A, "id_F581838CE4328F7A" }, + { 0xF6E735E018927744, "id_F6E735E018927744" }, + { 0xF76FF66A6601D9C9, "id_F76FF66A6601D9C9" }, + { 0xF92878651D302FE9, "id_F92878651D302FE9" }, + { 0xFA689AEE146FBCF9, "id_FA689AEE146FBCF9" }, + { 0xFCE201C1F66B31B6, "id_FCE201C1F66B31B6" }, + { 0xFCE61CB0E2F1FC68, "id_FCE61CB0E2F1FC68" }, + { 0xFF39FD6D3D8E4D65, "id_FF39FD6D3D8E4D65" }, + { 0x4EA053254706D5BD, "incrementpersistentstat" }, + { 0x4AAFCE7C893FD652, "initmaxspeedforpathlengthtable" }, + { 0xFE746F03F612D132, "int" }, + { 0x072FD0EDFA661869, "invertangles" }, + { 0x0100402BE61E8FE5, "iprintln" }, + { 0xD55733A782411736, "iprintlnbold" }, + { 0x928A745F7350025A, "isagent" }, + { 0xDFF8B9B70D60D62B, "isai" }, + { 0x18C261D4FDBEF322, "isalive" }, + { 0xB2AA8FF1CAB4A6A8, "isalliedsentient" }, + { 0x3A25C41ABB736B89, "isanimation" }, + { 0x3982CF5D9216534A, "isarray" }, + { 0x1C2935928BA5D0C2, "isbot" }, + { 0x64991DD2B7EE86AF, "isbotmatchmakingenabled" }, + { 0x8A510C83ECB35FBC, "isbuiltinfunction" }, + { 0x3F16845C60D220DD, "isbuiltinmethod" }, + { 0xDE9426BD1E623CD1, "isdedicatedserver" }, + { 0x8D28B21F27721342, "isdismembermentenabled" }, + { 0xD292FBFBD21DDEA9, "isendstr" }, + { 0x27E9578D1B9DC9DE, "isenemyteam" }, + { 0x2CC05E9298930E36, "isent" }, + { 0x807167589C541911, "isenumvaluevalid" }, + { 0xECEEF82056E1540F, "isexplosivedamagemod" }, + { 0x72EE6514D71D3FB9, "isfloat" }, + { 0x5422EA0EC806AC45, "isfunction" }, + { 0x1F944D78747160EE, "isglassdestroyed" }, + { 0x64BA0292C0D993C2, "isint" }, + { 0x6B6EA9CB782AA0BD, "isintournament" }, + { 0x22DAE82707E8B9A1, "isistring" }, + { 0x1BBFE434E7188CE6, "isnavmeshloaded" }, + { 0x4FDA996426233549, "isnode" }, + { 0xC8FAEFA04F41C504, "isnullweapon" }, + { 0x484F9A24E56E152C, "isnumber" }, + { 0x3BBA92C48CDB30EC, "isplayer" }, + { 0xB6540A030A73B9E8, "ispointinvolume" }, + { 0xC9D6B620E84D8544, "ispointonnavmesh" }, + { 0xD59E8A5B4D2A5237, "issameweapon" }, + { 0x668A5BAF81FAEAF4, "isscriptedagent" }, + { 0xE7F087BFE8DC410B, "issentient" }, + { 0x9201912739E835CB, "isspawner" }, + { 0x8111B3B6AF823F60, "isspeedwithincqbrange" }, + { 0xAB5C872AAB166DAB, "issplitscreen" }, + { 0xE656ED5AF282BFAA, "isstartstr" }, + { 0xD1596A0C7AB424DC, "isstring" }, + { 0x22527B0BFA0FDFC4, "isstruct" }, + { 0x34464C8AE347C11C, "issubstr" }, + { 0xFF3638EB9326FFD2, "istestclient" }, + { 0x63D4E8DCCBB9C2B7, "isundefinedweapon" }, + { 0x44A27992B7E821A3, "isusingmatchrulesdata" }, + { 0xB288A8536C3679DB, "isvalidmissile" }, + { 0xCEA6BEBD921BDE7E, "isvector" }, + { 0x5A840C1EBAACAA9D, "isvfxfile" }, + { 0x9135D80302B5E03D, "isweapon" }, + { 0x205A9DE76BB29BDB, "kick" }, + { 0xA36C9B1FC6F8372E, "killfxontag" }, + { 0x44B3D8925330D25E, "killstreakisrestricted" }, + { 0x8B0A09F19AA88FE9, "length" }, + { 0x396F5F9CECAC6B3F, "length2d" }, + { 0xD867AC5386664884, "length2dsquared" }, + { 0x32F5B4EF8F0DB13A, "lengthsquared" }, + { 0x085705AC4F53922B, "loadfx" }, + { 0xF17A0FD4CB553CDD, "loadinfiltransient" }, + { 0x470E5B042B50F70D, "log" }, + { 0x82EBAE39BD40E2A0, "logprint" }, + { 0xDBB644B603B68500, "logstring" }, + { 0xDEFBEF7D3DD27768, "logtournamentdeath" }, + { 0x53DCAE38566A2F8A, "lookupsoundlength" }, + { 0x38715CB55BC22DF0, "magicbullet" }, + { 0x9A10E3E7BF8B0740, "magicgrenademanual" }, + { 0x91EA328853B97D56, "makealtweapon" }, + { 0xB12F8D416DD22E3B, "makeweapon" }, + { 0x2D875F7FD1CCBEC2, "makeweaponfromstring" }, + { 0xFC0E529B3967C9A9, "map_restart" }, + { 0x365921041E437555, "max" }, + { 0x367C0B041E698CAB, "min" }, + { 0xE0A650A545DF6E39, "missile_createattractorent" }, + { 0x866EA0107F3BED93, "missile_createrepulsorent" }, + { 0xCC9DE66B400CA79D, "missile_deleteattractor" }, + { 0xF5ED07D10232CF4B, "navtrace" }, + { 0x234C751B1170BFE4, "navtrace3d" }, + { 0x75F8CF5BE6B33C28, "newclienthudelem" }, + { 0x92499933C47A3AE1, "newhudelem" }, + { 0x01DF8C0BFDAE9C0A, "newteamhudelem" }, + { 0x4CBC32992729F3EB, "nodeexposedtosky" }, + { 0x35B57BB4A7A80270, "nodesvisible" }, + { 0xCDEA9AC85AA14A14, "nullweapon" }, + { 0x9CD59F6ABB6B99EE, "obituary" }, + { 0x6560CE855AADCFE6, "objective_addalltomask" }, + { 0xEA1A4961151001EA, "objective_addclienttomask" }, + { 0x30D2C6D74286A7B8, "objective_addteamtomask" }, + { 0xA2DE641D1DF59F36, "objective_delete" }, + { 0x63AB75EF21B0A746, "objective_hidefromplayersinmask" }, + { 0xB6C1C61B18D49F4A, "objective_hideprogressforclient" }, + { 0x50DE8F0B4CC55A20, "objective_hideprogressforteam" }, + { 0x7E166827A7C934EC, "objective_icon" }, + { 0x1D4DC14AA48CC897, "objective_onentity" }, + { 0x71AFC0D41B65FDF0, "objective_pinforclient" }, + { 0x6B97A8F9CF13711E, "objective_pinforteam" }, + { 0x44D76BFD03BB4E75, "objective_ping" }, + { 0x23CC142CDD66C626, "objective_position" }, + { 0xCDC000C732F0D130, "objective_removeallfrommask" }, + { 0x905660322B19334E, "objective_removeclientfrommask" }, + { 0x566D01C39660D218, "objective_removeteamfrommask" }, + { 0x0B7212FC6154A32B, "objective_setbackground" }, + { 0xDCB12040A9AA95AB, "objective_setdescription" }, + { 0xF140EC04954C75FD, "objective_setenemylabel" }, + { 0x3C95AA6B4CE28749, "objective_setfadedisabled" }, + { 0x848ED3B9F4E2FD72, "objective_setfriendlylabel" }, + { 0x6E25CB6284FFA7EE, "objective_sethideelevation" }, + { 0x054AB7CB5E1102B1, "objective_sethideformlgspectator" }, + { 0x625EBE35CFC01106, "objective_sethot" }, + { 0xBB20B416A000E8FF, "objective_setlabel" }, + { 0x6F1B06DFB62EFC70, "objective_setlocation" }, + { 0x4503B6478C49A6EA, "objective_setminimapiconsize" }, + { 0xED9F8E3DE6A78F9C, "objective_setneutrallabel" }, + { 0x9369D736201293F1, "objective_setownerclient" }, + { 0x5C6CCD7351B97793, "objective_setownerteam" }, + { 0xF11FF10702E689A8, "objective_setpings" }, + { 0xE63667A39D1C8D26, "objective_setpingsforteam" }, + { 0xAF42936B038B0C81, "objective_setpinned" }, + { 0x3285542F59BAFF21, "objective_setplayintro" }, + { 0xB59AC4192FBB6678, "objective_setplayoutro" }, + { 0x6F5306F624F82378, "objective_setprogress" }, + { 0x1DE89A072DF7D097, "objective_setprogressclient" }, + { 0x674A50D05D56E0C1, "objective_setprogressteam" }, + { 0x7F262CA3482A4247, "objective_setpulsate" }, + { 0x449B8519F0527B8C, "objective_setrotateonminimap" }, + { 0xE83382E0403F0801, "objective_setshowdistance" }, + { 0x787F4A114EEB6EEA, "objective_setshowformlgspectator" }, + { 0x5EA765D296293E19, "objective_setshowoncompass" }, + { 0xB7C5D30C376DD5A5, "objective_setshowprogress" }, + { 0x858B7B4F452C5001, "objective_setspecialobjectivedisplay" }, + { 0x89A041E4D59D7EBC, "objective_setzoffset" }, + { 0x8C3B2EF2C8F4C61D, "objective_showprogressforclient" }, + { 0x85E40CF23AD24B37, "objective_showprogressforteam" }, + { 0x31C2A57DDD2FEC16, "objective_showtoplayersinmask" }, + { 0xCF96E48E5C978872, "objective_state" }, + { 0x1C127761C5994AE7, "objective_unpinforclient" }, + { 0xFC32A2C3246B4A91, "objective_unpinforteam" }, + { 0x062BA5D5023C7605, "objective_unsetlocation" }, + { 0x489AD3F08CB8E7DE, "onmatchbegin" }, + { 0xBD3E6568BC29FE0A, "onmatchend" }, + { 0x336B42962804DFC0, "perkisrestricted" }, + { 0x6830D53F6694D032, "physics_aabbbroadphasequery" }, + { 0x569E0E990C945E35, "physics_capsulecast" }, + { 0x079E65D15B202499, "physics_charactercast" }, + { 0x367C678B3AA742BD, "physics_createcontents" }, + { 0x99D645EF617A5196, "physics_getbodyangvel" }, + { 0xA691B65D41509913, "physics_getbodylinvel" }, + { 0xB472E62B1E3C0C4A, "physics_getclosestpointtocapsule" }, + { 0xDB86EEA9812DBE1E, "physics_getclosestpointtocharacter" }, + { 0x3D7DF78DE27D4CB2, "physics_getclosestpointtosphere" }, + { 0x82B59E3403E30A4F, "physics_getsurfacetypefromflags" }, + { 0x4B5E797ED44B8015, "physics_querypoint" }, + { 0x1B7977F51B0DBAFE, "physics_raycast" }, + { 0x2A262511EC9D1DA8, "physics_raycastents" }, + { 0xD4DD66B1CD883F52, "physics_setbodyangvel" }, + { 0x6D8F30830275A40A, "physics_setbodycenterofmassnormal" }, + { 0xDCBEF2DE7B2C0D60, "physics_setgravityragdollscalar" }, + { 0xCEEA065B0685F23D, "physics_spherecast" }, + { 0xD6F4A3D51C33B83C, "physicsexplosionsphere" }, + { 0x51098421B1A0A6CB, "physicstrace" }, + { 0x19EFFA98E12566A6, "pickscriptablelootitem" }, + { 0x9A71BDFBA60040B8, "pinglocationenemyteams" }, + { 0x79A97FB38B905652, "playcinematicforall" }, + { 0x8AEB615D060AEEDE, "playerphysicstrace" }, + { 0xF2AB0CCAA1936131, "playfx" }, + { 0x09F95D9D84D5FEC8, "playfxbetweenpoints" }, + { 0x81FA59F435BAAFF4, "playfxontag" }, + { 0xCC59876E3B76DF2D, "playfxontagforclients" }, + { 0x6D620514D6003242, "playfxontagforteam" }, + { 0x2F74AB3064687D89, "playfxontagsbetweenclients" }, + { 0x4F308F0961AAE12A, "playloopedfx" }, + { 0xF1D6542136A2EE0C, "playrumbleonposition" }, + { 0xD16FE2D258A1484B, "playsoundatpos" }, + { 0xC2A44782196C5FE4, "playworldsound" }, + { 0x11311E2C0761274A, "pointonsegmentnearesttopoint" }, + { 0x8C8D26CB23BDF2D7, "positionwouldtelefrag" }, + { 0xB205BF0302D9F5D9, "pow" }, + { 0xC127FB2963C0DD54, "precacheleaderboards" }, + { 0xD51845E7A477CC0D, "precachemodel" }, + { 0xA0369B903C4EFFD0, "precachempanim" }, + { 0x6E4DBF54753F54C5, "precacherumble" }, + { 0x71811FF55B13A641, "precacheshader" }, + { 0x32A08FF5234BBDC9, "precachestring" }, + { 0xA66D439C2A53F33A, "precacheturret" }, + { 0x096B26E7A96B0510, "precachevehicle" }, + { 0xB849B7A222A2A5E1, "precomputedlosdatatest" }, + { 0x983B6C41C33D73B1, "preloadcinematicforall" }, + { 0xA83C7989EF41EBD9, "preventrecentanimindex" }, + { 0x88161920AA6B4BDC, "projectileintercept" }, + { 0x58E0C6F34140CE1E, "radiusdamage" }, + { 0x49D03642E41DCD65, "radiusdamagestepped" }, + { 0xF50D66D3BF7C1184, "randomfloat" }, + { 0xC4C0C8BB2E4B99C9, "randomfloatrange" }, + { 0x7C1308153F8D8B3F, "randomint" }, + { 0x327F85E8A7FCD114, "randomintrange" }, + { 0x525D2A65802A8D86, "registerscriptedspawnpoints" }, + { 0x1EF582512068A13C, "registerspawnfactor" }, + { 0xA31E2B04174C4694, "registerspawnteamsmode" }, + { 0x0319AA966EC6348D, "removeallcorpses" }, + { 0x2AE639306F1856D5, "removeclientfromheadiconmask" }, + { 0x2E1E4B7A7CE07C94, "removeclientfromtargetmarkergroupmask" }, + { 0x4B14C19146FC587B, "removeteamfromheadiconmask" }, + { 0xBA9E8C86EE01675A, "removeteamfromtargetmarkergroupmask" }, + { 0xC25A5441AD803B47, "requestgamelobbyremainintact" }, + { 0xCC646B48D005CC17, "resetsundirection" }, + { 0x7E18FEF3FC8F4266, "resetsunlight" }, + { 0x705826E39EDA649E, "rotatepointaroundvector" }, + { 0x914E68D7AAE1363D, "rotatevector" }, + { 0x4F240DF91A3AEA90, "rotatevectorinverted" }, + { 0xCF1C282E214ECE08, "savepotgdata" }, + { 0x35AC3C7D8721DD6D, "sendclientmatchdata" }, + { 0xA1EFA0987429855C, "sendmatchdata" }, + { 0x62E4B8EB1AD42ECE, "setaudiotriggerstate" }, + { 0xE5CD943858514EB9, "setclientmatchdata" }, + { 0x2B3937EF6ADCB1A0, "setclientmatchdatadef" }, + { 0x96881106BB83B904, "setclientnamemode" }, + { 0xCE214750DC0AE4A2, "setdvar" }, + { 0xCBAAB1C2DD1316BC, "setdvarifuninitialized" }, + { 0x7E01CE72AF912D09, "setdynamicdvar" }, + { 0xCABB1EE236F0E2A3, "setgameendtime" }, + { 0x50B9287BFC950E7A, "setglobalsoundcontext" }, + { 0xC585364A0951C101, "setheadicondrawinmap" }, + { 0x801BB28F0F6E1CEC, "setheadicondrawthroughgeo" }, + { 0xB16EFC2330F72431, "setheadiconenemyimage" }, + { 0x1ED067EFD0BDA61C, "setheadiconfriendlyimage" }, + { 0xFE0BB20ED1004E35, "setheadiconimage" }, + { 0x9188D457E1C02EAD, "setheadiconmaxdistance" }, + { 0xE55BE646C45F203E, "setheadiconnaturaldistance" }, + { 0xBDB35C26BC39959C, "setheadiconneutralimage" }, + { 0xF0C52C9DDD65153F, "setheadiconowner" }, + { 0x3BC6B7B18904113D, "setheadiconsnaptoedges" }, + { 0x388F9EC2E8D135F1, "setheadiconteam" }, + { 0x868283C3D609D9B1, "setheadiconzoffset" }, + { 0x87D8875AF6B96F26, "setignoremegroup" }, + { 0x3222F073E7ED8706, "setintrocameraactive" }, + { 0x4C172AFD3E7FC71A, "setmapcenter" }, + { 0xF0B3E265281C9578, "setmatchdata" }, + { 0xB61CFE63550F401F, "setmatchdatadef" }, + { 0xBD8324262B651D7E, "setminimap" }, + { 0x9F346919D86CFB0E, "setminimapcpraidmaze" }, + { 0xD123B1929FD57EDF, "setmusicstate" }, + { 0x215D3B1C67CAD94F, "setnojipscore" }, + { 0xAB5626A0B896E64A, "setnojiptime" }, + { 0xB824F75E75473D68, "setomnvar" }, + { 0x4FB497C6D56F9553, "setomnvarbit" }, + { 0x9A4BFB65359D7CF6, "setomnvarforallclients" }, + { 0x9DACBD04A08885DD, "setplayerteamrank" }, + { 0xDF1849A2B8EDA32F, "setsaveddvar" }, + { 0xF3C26D3E51ABB52C, "setslowmotion" }, + { 0xB5582BE2882607AD, "setspeedthreshold" }, + { 0x4E5BC736030D8E24, "setsuncolorandintensity" }, + { 0x19E634CAC61946E8, "setsundirection" }, + { 0xDEBF37F886B3F00D, "setteammode" }, + { 0x866AFF0DD65FFC31, "setteamplacement" }, + { 0xB2B12127C556CA2E, "setteamradar" }, + { 0xCCDC4706A4B7C4B7, "setteamradarstrength" }, + { 0xFD76B98CFC5F8554, "setteamscore" }, + { 0xD65793CE1C9C065E, "setthreatbias" }, + { 0x48D75A7952D05E38, "setthreatbiasagainstall" }, + { 0x036490874D74D8DC, "setwinningteam" }, + { 0x52F136AD243DE103, "showheadicontoplayersinmask" }, + { 0x4A758FC1E9807763, "sighttracepassed" }, + { 0xBE5501030B116029, "sin" }, + { 0x4351D0A15B2E02E7, "sortbydistance" }, + { 0x0C84955F6378CCA4, "sortbydistancecullbyradius" }, + { 0x07E88C43D642AEE8, "soundexists" }, + { 0x9DF2A283F9468D92, "soundislooping" }, + { 0x4EDA6F8C72028186, "soundsettimescalefactorfromtable" }, + { 0x6CCF6CA6FEDDADAC, "spawn" }, + { 0xF11A7F097572F54C, "spawnbrcircle" }, + { 0x1280B5C6141A2417, "spawncovernode" }, + { 0xEDB4D07571F1AA28, "spawncustomweaponscriptable" }, + { 0x8F0E7F42D7EFC2F2, "spawnfx" }, + { 0xAF9C7CC86562340A, "spawnfxforclient" }, + { 0x79A328B021CFB84D, "spawnhelicopter" }, + { 0x1564854171C42186, "spawninfluencepointsetposition" }, + { 0x9B5B97D68ABA554D, "spawnloopingsound" }, + { 0x24D24C95B862626C, "spawnragdollconstraint" }, + { 0x2F739952ADD6C193, "spawnscriptable" }, + { 0x1EE7D67E3E0AE8F6, "spawnsighttrace" }, + { 0x7509D740E35B3E5D, "spawnstruct" }, + { 0x37DA1E5739869436, "spawnturret" }, + { 0x2C627FB15B002CD4, "spawnvehicle" }, + { 0x1939CEB1AB04BFE3, "sqrt" }, + { 0xBE17571B6AF76AD2, "squared" }, + { 0xBDB385DC3DD0DA13, "startpodium" }, + { 0x46FE5B7871A4A207, "stopclientexploder" }, + { 0xA306E1AEE8A0B70A, "stopfxontag" }, + { 0x3C61FF68CFAF6DD3, "stopfxontagforclients" }, + { 0x5FC5025071CAB9CF, "stopspectateplayer" }, + { 0xAD0B65AEEFC12231, "stricmp" }, + { 0xEEE525E9016DDE8A, "strtok" }, + { 0xDA82820D2B425CF9, "superisrestricted" }, + { 0x966E88DFB74CAFBD, "sysprint" }, + { 0x55AD4A41F3A2D39B, "tableexists" }, + { 0x0BE25726970CE125, "tablelookup" }, + { 0x9D5C543E46BFFF30, "tablelookupbyrow" }, + { 0xA65CB634D219D426, "tablelookupgetnumcols" }, + { 0xBABEC7BA46116D58, "tablelookupgetnumrows" }, + { 0x537CA7C0411D6F25, "tablelookupistring" }, + { 0x22D291A87E05E930, "tablelookupistringbyrow" }, + { 0x1B7667ECB41EC4B9, "tablelookuprownum" }, + { 0x8EF75EF2844772B0, "tablelookuprownum_reversefromrow" }, + { 0x05BF4F2DE69C0A33, "tablesort" }, + { 0xE9B07A032AC9FFDC, "tan" }, + { 0x3D86498F5D522563, "targetmarkergroupaddentity" }, + { 0x0047D1521AA3FBD6, "targetmarkergroupremoveentity" }, + { 0xB9B752A2D5500E55, "targetmarkergroupsetentitystate" }, + { 0x9252E618277ABAAC, "targetmarkergroupsetextrastate" }, + { 0x12CC27C466327497, "threatbiasgroupexists" }, + { 0xCE475A45E43822D5, "tolower" }, + { 0x7578AF7C1677CA57, "trajectorycalculateinitialvelocity" }, + { 0xA9375CC0F47ADA2E, "transformmove" }, + { 0xB257604520289B01, "triggerfx" }, + { 0xF888F7734857411E, "triggeroneoffradarsweep" }, + { 0xB2C8B53DB2296D9C, "triggerportableradarping" }, + { 0x13304675CAFF520D, "triggerportableradarpingteam" }, + { 0x5ACD90BD8062EBF6, "unloadallinfilintrotransients" }, + { 0xE651BA88AF7BECCE, "unloadinfiltransient" }, + { 0x2A38C7625EA6C340, "updatetournamentroundtime" }, + { 0xF87C442920FF20DE, "vectorcross" }, + { 0x15041625C089ADF5, "vectordot" }, + { 0x93560E221C52A63D, "vectorfromlinetopoint" }, + { 0xF18F1B4BB3C8FE73, "vectorlerp" }, + { 0x14ADC0EA67FC5D95, "vectornormalize" }, + { 0x3552F0323AC56C53, "vectortoangles" }, + { 0x3DA89CB6FDA9BD4F, "vectortopitch" }, + { 0x34BC71F4E1AEB0CE, "vectortoyaw" }, + { 0xB2D78295B07D9963, "vehicle_allowplayeruse" }, + { 0x276093684C8DE69D, "vehicle_getarray" }, + { 0xBFC2C90DCBB3B194, "vehicle_getarrayinradius" }, + { 0x4B80355F5E611F59, "vehicle_getspawnerarray" }, + { 0x29C2460B02CBF904, "verifybunkercode" }, + { 0xE041D2BB8C4DF9C7, "visionsetfadetoblack" }, + { 0x49E8D29A62E52190, "visionsetkillcamthirdpersonnight" }, + { 0x3C168B5E98085E04, "visionsetmissilecam" }, + { 0xDBBA5E405F4EE702, "visionsetnaked" }, + { 0x2A218785BB3715B3, "visionsetnight" }, + { 0x10B1CD97E2E817DF, "visionsetpain" }, + { 0xBD049F3320C79E26, "visionsetthermal" }, + { 0x85EAF06BA8F5118B, "weaponaltweaponname" }, + { 0x44B6F5BA4F10E400, "weaponburstcount" }, + { 0xE90C568DAB085464, "weaponcandrop" }, + { 0x4913ABA743F96247, "weaponclass" }, + { 0xCA63C9289E5C8E42, "weaponclipsize" }, + { 0x67942A6AC05E30A8, "weaponfiretime" }, + { 0x6E1583245AAEB860, "weapongetdamagemax" }, + { 0x782A54EE78518276, "weaponinheritsperks" }, + { 0xF653A7423857A97F, "weaponinventorytype" }, + { 0xFFD512398892BAAE, "weaponisauto" }, + { 0x9F41147EF749ECD2, "weaponisbeam" }, + { 0xF904D69CAD962F64, "weaponisboltaction" }, + { 0x29C3C93EF86585CB, "weaponispreferreddrop" }, + { 0x7CBBA9113F200C64, "weaponisrestricted" }, + { 0xAD7B46FFAB32C590, "weaponissemiauto" }, + { 0xC1D707E904E7E463, "weaponmaxammo" }, + { 0xC223FAB439E4D78D, "weaponstartammo" }, + { 0x7C9C92FAE76F6225, "weapontype" }, + { 0x0B3DBB4E9F6C3AE6, "weaponusesenergybullets" }, + { 0x1DD47568265FE555, "worldentnumber" }, +}}; + +} // namespace xsk::gsc::iw9 diff --git a/src/iw9/xsk/resolver.cpp b/src/iw9/iw9_hash.cpp similarity index 97% rename from src/iw9/xsk/resolver.cpp rename to src/iw9/iw9_hash.cpp index a28b022c..dc0bf2aa 100644 --- a/src/iw9/xsk/resolver.cpp +++ b/src/iw9/iw9_hash.cpp @@ -1,1960 +1,14 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" #include "iw9.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - namespace xsk::gsc::iw9 { -std::unordered_map path_map; -std::unordered_map hash_map; -std::unordered_map opcode_map; -std::unordered_map opcode_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string&) -> std::uint32_t -{ - return 0; -} - -auto resolver::token_name(std::uint32_t id) -> std::string -{ - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - /* const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - }*/ - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - /*const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - }*/ - - return false; -} - -void resolver::add_function(const std::string& , std::uint16_t ) -{ - /*const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - throw error(utils::string::va("builtin function '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - function_map.insert({ id, *str }); - function_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - function_map.insert({ id, *ins.first }); - function_map_rev.insert({ *ins.first, id }); - } - }*/ -} - -void resolver::add_method(const std::string& , std::uint16_t ) -{ - /*const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - throw error(utils::string::va("builtin method '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - method_map.insert({ id, *str }); - method_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - method_map.insert({ id, *ins.first }); - method_map_rev.insert({ *ins.first, 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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -auto resolver::path_id(const std::string& name) -> std::uint64_t -{ - if (name.starts_with("id_")) - { - return static_cast(std::stoull(name.substr(3), nullptr, 16)); - } - - const char* str = name.data(); - uint64_t hash = 0x47F5817A5EF961BA; - - while ( *str ) - { - uint8_t byte = *str++; - - if (byte == '\\') - { - byte = '/'; - } - else if (static_cast(byte - 65) <= 25) - { - byte += 32; - } - - hash = (uint64_t)0x100000001B3 * ((uint64_t)byte ^ hash); - } - - return hash & 0x7FFFFFFFFFFFFFFF; -} - -auto resolver::path_name(std::uint64_t id) -> std::string -{ - const auto itr = path_map.find(id); - - if (itr != path_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("id_%016llX", id); -} - -auto resolver::hash_id(const std::string& name) -> std::uint64_t -{ - if (name.starts_with("id_")) - { - return static_cast(std::stoull(name.substr(3), nullptr, 16)); - } - - const char* str = name.data(); - uint64_t hash = 0x79D6530B0BB9B5D1; - - while ( *str ) - { - uint8_t byte = *str++; - - if (static_cast(byte - 65) <= 25) - { - byte += 32; - } - - hash = (uint64_t)0x10000000233 * ((uint64_t)byte ^ hash); - } - - return hash; -} - -auto resolver::hash_name(std::uint64_t id) -> std::string -{ - const auto itr = hash_map.find(id); - - if (itr != hash_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("id_%016llX", id); -} - -const std::array, 167> opcode_list -{{ - { 0x00, "OP_CastFieldObject" }, - { 0x01, "OP_SetLocalVariableFieldCached" }, - { 0x02, "OP_plus" }, - { 0x03, "OP_RemoveLocalVariables" }, - { 0x04, "OP_EvalSelfFieldVariableRef" }, - { 0x05, "OP_ScriptFarMethodChildThreadCall" }, - { 0x06, "OP_GetGameRef" }, - { 0x07, "OP_EvalAnimFieldVariable" }, - { 0x08, "OP_EvalLevelFieldVariableRef" }, - { 0x09, "OP_GetThisthread" }, - { 0x0A, "OP_greater" }, - { 0x0B, "OP_waittillmatch" }, - { 0x0C, "OP_shift_right" }, - { 0x0D, "OP_dec" }, - { 0x0E, "OP_JumpOnTrue" }, - { 0x0F, "OP_bit_or" }, - { 0x10, "OP_equality" }, - { 0x11, "OP_ClearLocalVariableFieldCached0" }, - { 0x12, "OP_notify" }, - { 0x13, "OP_GetVector" }, - { 0x14, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x15, "OP_PreScriptCall" }, - { 0x16, "OP_GetByte" }, - { 0x17, "OP_ScriptFarThreadCall" }, - { 0x18, "OP_SetSelfFieldVariableField" }, - { 0x19, "OP_JumpOnFalseExpr" }, - { 0x1A, "OP_GetUndefined" }, - { 0x1B, "OP_jumpback" }, - { 0x1C, "OP_JumpOnTrueExpr" }, - { 0x1D, "OP_CallBuiltin" }, - { 0x1E, "OP_SetLocalVariableFieldCached0" }, - { 0x1F, "OP_ClearFieldVariable" }, - { 0x20, "OP_GetLevel" }, - { 0x21, "OP_size" }, - { 0x22, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x23, "OP_AddArray" }, - { 0x24, "OP_endon" }, - { 0x25, "OP_EvalFieldVariable" }, - { 0x26, "OP_shift_left" }, - { 0x27, "OP_EvalLocalArrayRefCached0" }, - { 0x28, "OP_Return" }, - { 0x29, "OP_CreateLocalVariable" }, - { 0x2A, "OP_SafeSetVariableFieldCached0" }, - { 0x2B, "OP_GetBuiltinFunction" }, - { 0x2C, "OP_CallBuiltinMethodPointer" }, - { 0x2D, "OP_GetSelfObject" }, - { 0x2E, "OP_GetGame" }, - { 0x2F, "OP_SetLevelFieldVariableField" }, - { 0x30, "OP_EvalArray" }, - { 0x31, "OP_GetSelf" }, - { 0x32, "OP_End" }, - { 0x33, "OP_EvalSelfFieldVariable" }, - { 0x34, "OP_less_equal" }, - { 0x35, "OP_EvalLocalVariableCached0" }, - { 0x36, "OP_EvalLocalVariableCached1" }, - { 0x37, "OP_EvalLocalVariableCached2" }, - { 0x38, "OP_EvalLocalVariableCached3" }, - { 0x39, "OP_EvalLocalVariableCached4" }, - { 0x3A, "OP_EvalLocalVariableCached5" }, - { 0x3B, "OP_EvalLocalVariableCached" }, - { 0x3C, "OP_EvalNewLocalArrayRefCached0" }, - { 0x3D, "OP_ScriptChildThreadCallPointer" }, - { 0x3E, "OP_EvalLocalVariableObjectCached" }, - { 0x3F, "OP_GetInteger" }, - { 0x40, "OP_ScriptMethodCallPointer" }, - { 0x41, "OP_checkclearparams" }, - { 0x42, "OP_SetAnimFieldVariableField" }, - { 0x43, "OP_waittillmatch2" }, - { 0x44, "OP_minus" }, - { 0x45, "OP_GetNegUnsignedShort" }, - { 0x46, "OP_GetNegByte" }, - { 0x47, "OP_SafeCreateVariableFieldCached" }, - { 0x48, "OP_greater_equal" }, - { 0x49, "OP_vector" }, - { 0x4A, "OP_GetBuiltinMethod" }, - { 0x4B, "OP_endswitch" }, - { 0x4C, "OP_ClearArray" }, - { 0x4D, "OP_DecTop" }, - { 0x4E, "OP_CastBool" }, - { 0x4F, "OP_EvalArrayRef" }, - { 0x50, "OP_SetNewLocalVariableFieldCached0" }, - { 0x51, "OP_GetZero" }, - { 0x52, "OP_wait" }, - { 0x53, "OP_waittill" }, - { 0x54, "OP_GetIString" }, - { 0x55, "OP_ScriptFarFunctionCall" }, - { 0x56, "OP_GetAnimObject" }, - { 0x57, "OP_GetAnimTree" }, - { 0x58, "OP_EvalLocalArrayCached" }, - { 0x59, "OP_mod" }, - { 0x5A, "OP_ScriptFarMethodThreadCall" }, - { 0x5B, "OP_GetUnsignedShort" }, - { 0x5C, "OP_clearparams" }, - { 0x5D, "OP_ScriptMethodThreadCallPointer" }, - { 0x5E, "OP_ScriptFunctionCallPointer" }, - { 0x5F, "OP_EmptyArray" }, - { 0x60, "OP_SafeSetVariableFieldCached" }, - { 0x61, "OP_ClearVariableField" }, - { 0x62, "OP_EvalFieldVariableRef" }, - { 0x63, "OP_EvalNewLocalVariableRefCached0" }, - { 0x64, "OP_GetFloat" }, - { 0x65, "OP_EvalLocalVariableRefCached" }, - { 0x66, "OP_JumpOnFalse" }, - { 0x67, "OP_BoolComplement" }, - { 0x68, "OP_ScriptThreadCallPointer" }, - { 0x69, "OP_less" }, - { 0x6A, "OP_BoolNot" }, - { 0x6B, "OP_waittillFrameEnd" }, - { 0x6C, "OP_waitframe" }, - { 0x6D, "OP_GetString" }, - { 0x6E, "OP_EvalLevelFieldVariable" }, - { 0x6F, "OP_GetLevelObject" }, - { 0x70, "OP_inc" }, - { 0x71, "OP_CallBuiltinMethod" }, - { 0x72, "OP_GetAnim" }, - { 0x73, "OP_switch" }, - { 0x74, "OP_SetVariableField" }, - { 0x75, "OP_divide" }, - { 0x76, "OP_ScriptFarChildThreadCall" }, - { 0x77, "OP_multiply" }, - { 0x78, "OP_ClearLocalVariableFieldCached" }, - { 0x79, "OP_EvalAnimFieldVariableRef" }, - { 0x7A, "OP_EvalLocalArrayRefCached" }, - { 0x7B, "OP_EvalLocalVariableRefCached0" }, - { 0x7C, "OP_bit_and" }, - { 0x7D, "OP_GetAnimation" }, - { 0x7E, "OP_GetFarFunction" }, - { 0x7F, "OP_CallBuiltinPointer" }, - { 0x80, "OP_jump" }, - { 0x81, "OP_voidCodepos" }, - { 0x82, "OP_ScriptFarMethodCall" }, - { 0x83, "OP_inequality" }, - { 0x84, "OP_bit_ex_or" }, - { 0x85, "OP_unk_133" }, - { 0x86, "OP_unk_134" }, - { 0x87, "OP_unk_135" }, - { 0x88, "OP_unk_136" }, - { 0x89, "OP_unk_137" }, - { 0x8A, "OP_unk_138" }, - { 0x8B, "OP_unk_139" }, - { 0x8C, "OP_unk_140" }, - { 0x8D, "OP_unk_141" }, - { 0x8E, "OP_unk_142" }, - { 0x8F, "OP_unk_143" }, - { 0x90, "OP_unk_144" }, - { 0x91, "OP_prof_begin" }, - { 0x92, "OP_prof_end" }, - { 0x93, "OP_breakpoint" }, - { 0x94, "OP_assignmentBreakpoint" }, - { 0x95, "OP_manualAndAssignmentBreakpoint" }, - { 0x96, "OP_BoolNotAfterAnd" }, - { 0x97, "OP_FormalParams" }, - { 0x98, "OP_IsDefined" }, - { 0x99, "OP_IsTrue" }, - { 0x9A, "OP_NativeGetFarFunction" }, - { 0x9B, "OP_NativeFarFunctionCall" }, - { 0x9C, "OP_NativeFarMethodCall" }, - { 0x9D, "OP_NativeFarFunctionThreadCall" }, - { 0x9E, "OP_NativeFarMethodThreadCall" }, - { 0x9F, "OP_NativeFarFunctionChildThreadCall" }, - { 0xA0, "OP_NativeFarMethodChildThreadCall" }, - { 0xA1, "OP_EvalNewLocalArrayRefCached0_Precompiled" }, - { 0xA2, "OP_SetNewLocalVariableFieldCached0_Precompiled" }, - { 0xA3, "OP_CreateLocalVariable_Precompiled" }, - { 0xA4, "OP_SafeCreateVariableFieldCached_Precompiled" }, - { 0xA5, "OP_FormalParams_Precompiled" }, - { 0xA6, "OP_unk_166" }, -}}; - -const std::array, 1467> path_list - {{ - { 0x32B7CDEED77D057E, "aiasm/civilian_cp_mp.gsc" }, - { 0x35A8E19B6286841E, "aiasm/civilian_mp.gsc" }, - { 0x7BAFE83F61723E58, "aiasm/civilian_sp.gsc" }, - { 0x2127A642689029E9, "aiasm/corner_cover_lean_shoot_cp_mp.gsc" }, - { 0x333F6EDE791A319F, "aiasm/corner_cover_lean_shoot_lw_mp.gsc" }, - { 0x419E457945C8652F, "aiasm/corner_cover_lean_shoot_mp.gsc" }, - { 0x7EDFAEDD76BA2A51, "aiasm/corner_cover_lean_shoot_sp.gsc" }, - { 0x6E56118DF645BCA9, "aiasm/dog_sp.gsc" }, - { 0x16788B23F7813A68, "aiasm/gesture_cp_mp.gsc" }, - { 0x0ED276256A336066, "aiasm/gesture_lw_mp.gsc" }, - { 0x2795CA2381AA1844, "aiasm/gesture_mp.gsc" }, - { 0x2373D48CF1D539B2, "aiasm/gesture_sp.gsc" }, - { 0x43217414BF8D7DBD, "aiasm/playerasm_mp.gsc" }, - { 0x478A5FF3300717F3, "aiasm/playerasm_sp.gsc" }, - { 0x09AC75F6223F719E, "aiasm/playerasm_sub_mp.gsc" }, - { 0x4FB37C9A212B2BD8, "aiasm/playerasm_sub_sp.gsc" }, - { 0x0FFC1613209C0E58, "aiasm/playerasm_void_mp.gsc" }, - { 0x49F50F6F21B0541E, "aiasm/playerasm_void_sp.gsc" }, - { 0x5432728299F31554, "aiasm/shoot_cp_mp.gsc" }, - { 0x286144B1799A88A2, "aiasm/shoot_lw_mp.gsc" }, - { 0x10267C55A210F0F0, "aiasm/shoot_mp.gsc" }, - { 0x05CAC6B43278B186, "aiasm/shoot_sp.gsc" }, - { 0x328B3030A65A8DB9, "aiasm/soldier_cp_mp.gsc" }, - { 0x18EE7AE10A52C8AF, "aiasm/soldier_lw_mp.gsc" }, - { 0x7255A31B670CE75F, "aiasm/soldier_mp.gsc" }, - { 0x172F5F8FC2C75DE1, "aiasm/soldier_sp.gsc" }, - { 0x37C1B87B79431128, "aiasm/suicidebomber_cp_mp.gsc" }, - { 0x2C40FE6A0EC96C04, "aiasm/suicidebomber_mp.gsc" }, - { 0x550008D869D66172, "aiasm/suicidebomber_sp.gsc" }, - { 0x68EC7E7BF5163661, "behaviortree/civilian.gsc" }, - { 0x4656969CDA1E5CEF, "behaviortree/civilian_agent.gsc" }, - { 0x53D6FE189C685458, "behaviortree/dog.gsc" }, - { 0x24F62F137306493C, "behaviortree/enemy_combatant.gsc" }, - { 0x001A2DFEDF315CD4, "behaviortree/juggernaut.gsc" }, - { 0x3545F03861FF9002, "behaviortree/juggernaut_agent.gsc" }, - { 0x6EE5DEE1A5469C09, "behaviortree/riotshield_cp.gsc" }, - { 0x4A89B79CBA6C453A, "behaviortree/soldier_agent.gsc" }, - { 0x3913DFDA05BB57B4, "behaviortree/soldier_agent_lw.gsc" }, - { 0x14B00477671C5A35, "behaviortree/suicidebomber.gsc" }, - { 0x015FB07B24C5AB0B, "behaviortree/suicidebomber_agent.gsc" }, - { 0x47D04779AE171058, "character/alq_syrkistan_female_scarf_purple.gsc" }, - { 0x6C3519078B1737B3, "character/alq_syrkistan_female_scarf_red.gsc" }, - { 0x7D70597F5DB87585, "character/character_al_qatala_desert_ar.gsc" }, - { 0x3BCFDED5E8FA3F50, "character/character_al_qatala_desert_ar_2.gsc" }, - { 0x7F0555B36D1B08E7, "character/character_al_qatala_desert_ar_3.gsc" }, - { 0x091151E289AFEC2E, "character/character_al_qatala_desert_ar_4.gsc" }, - { 0x66ACAC5596212D71, "character/character_al_qatala_desert_cqc.gsc" }, - { 0x33D66FE7D0A6C65C, "character/character_al_qatala_desert_lmg.gsc" }, - { 0x693C29D64B83755B, "character/character_al_qatala_trials.gsc" }, - { 0x28D27A7FACD64502, "character/character_al_qatala_urban_a6_variant.gsc" }, - { 0x200DABCFA3F18E26, "character/character_al_qatala_urban_ar_variant.gsc" }, - { 0x67D8AE51DA6C4EFC, "character/character_al_qatala_urban_bomber.gsc" }, - { 0x41A511B8916C1089, "character/character_al_qatala_urban_civ_1.gsc" }, - { 0x409CCDA81170F930, "character/character_al_qatala_urban_civ_2.gsc" }, - { 0x273D48B5958B8D47, "character/character_al_qatala_urban_civ_3.gsc" }, - { 0x0B3544DFCD06A18E, "character/character_al_qatala_urban_civ_4.gsc" }, - { 0x52D13DDA867630AD, "character/character_al_qatala_urban_civ_5.gsc" }, - { 0x1DEA48BDB7A13064, "character/character_al_qatala_urban_civ_6.gsc" }, - { 0x3C2731B3892A740B, "character/character_al_qatala_urban_civ_7.gsc" }, - { 0x6A96208943F72722, "character/character_al_qatala_urban_civ_8.gsc" }, - { 0x7F65697EC7FCE331, "character/character_al_qatala_urban_civ_9.gsc" }, - { 0x627139B9D8490BEF, "character/character_al_qatala_urban_cqb_variant.gsc" }, - { 0x6230AB696721E119, "character/character_al_qatala_urban_lmg_variant.gsc" }, - { 0x77613AB13516E118, "character/character_ally_so15_1.gsc" }, - { 0x76E53FCC7B105391, "character/character_ally_so15_2.gsc" }, - { 0x389AF6D20F0BEC82, "character/character_ally_so15_3.gsc" }, - { 0x0EBB6067A2162225, "character/character_barkov_captive.gsc" }, - { 0x1D36C5707B65CDAE, "character/character_civ_male_rus_clerical_1.gsc" }, - { 0x2203B66A6A693DAB, "character/character_civ_male_rus_clerical_2.gsc" }, - { 0x03C7CD7498E1AD04, "character/character_civ_male_rus_clerical_3.gsc" }, - { 0x116EB4D7BA1A9325, "character/character_civ_russian_police_officer.gsc" }, - { 0x4189709E138E122A, "character/character_civilian_me_female.gsc" }, - { 0x337298E549E7BD86, "character/character_civilian_me_female_cp.gsc" }, - { 0x51269A20A066B219, "character/character_civilian_me_female_embassy.gsc" }, - { 0x20161DEE5F3AE149, "character/character_civilian_me_female_embassy_mom.gsc" }, - { 0x791B25003E6B5145, "character/character_civilian_me_female_veil.gsc" }, - { 0x23F85B6079106E91, "character/character_civilian_me_female_wrap.gsc" }, - { 0x6D0E56A9475AD25F, "character/character_civilian_me_male.gsc" }, - { 0x37143DC2FAC56392, "character/character_civilian_me_male_cinderblock_a.gsc" }, - { 0x09E8BCA98403E59F, "character/character_civilian_me_male_cinderblock_b.gsc" }, - { 0x1DA485C7183FFCA8, "character/character_civilian_me_male_cinderblock_c.gsc" }, - { 0x09D771CD39D94225, "character/character_civilian_me_male_cinderblock_d.gsc" }, - { 0x70B7DCC7D8389289, "character/character_civilian_me_male_cp.gsc" }, - { 0x22ECAB79EA596F7A, "character/character_civilian_me_male_dist.gsc" }, - { 0x2B6D95B6438D19A0, "character/character_civilian_me_male_embassy.gsc" }, - { 0x137DC0CB6B7460A6, "character/character_civilian_me_male_embassy_dad.gsc" }, - { 0x76CA634F874C672A, "character/character_civilian_me_male_veil.gsc" }, - { 0x610B43115246DE2E, "character/character_civilian_syrkistan_boy_1_1.gsc" }, - { 0x5D21AD9A400E70D7, "character/character_civilian_syrkistan_boy_2_1.gsc" }, - { 0x4CF99888FC3EC7F8, "character/character_civilian_syrkistan_boy_3_1.gsc" }, - { 0x6137D6C723640951, "character/character_civilian_syrkistan_boy_4_1.gsc" }, - { 0x36F017124778241A, "character/character_civilian_syrkistan_boy_5_1.gsc" }, - { 0x1C344EAD431AF8E3, "character/character_civilian_syrkistan_boy_6_1.gsc" }, - { 0x0087DF9778DA2043, "character/character_cp_al_qatala_desert_9_rpg.gsc" }, - { 0x5018FC9098084EB5, "character/character_cp_al_qatala_desert_ar.gsc" }, - { 0x3B90ACE942FE6100, "character/character_cp_al_qatala_desert_ar_2.gsc" }, - { 0x79F725E3AF1B9457, "character/character_cp_al_qatala_desert_ar_3.gsc" }, - { 0x31DCE20CAB248FDE, "character/character_cp_al_qatala_desert_ar_4.gsc" }, - { 0x5663E69D507E036A, "character/character_cp_al_qatala_desert_ar_tmtyl.gsc" }, - { 0x69D669F2F0DDF801, "character/character_cp_al_qatala_desert_cqc.gsc" }, - { 0x2F829372490537B7, "character/character_cp_al_qatala_desert_dmr.gsc" }, - { 0x78168B35E6EA884C, "character/character_cp_al_qatala_desert_lmg.gsc" }, - { 0x26E76D730B28C81B, "character/character_cp_bombvest_hostage.gsc" }, - { 0x596130FFA3E43EA5, "character/character_cp_hero_hadir_urban.gsc" }, - { 0x2DAE60132549BD8A, "character/character_cp_usmc_basic_ar_1.gsc" }, - { 0x2A41200200874537, "character/character_cp_usmc_basic_ar_2.gsc" }, - { 0x1555A70C7C68BCE0, "character/character_cp_usmc_basic_ar_3.gsc" }, - { 0x0188D3129E026F1D, "character/character_cp_usmc_basic_ar_4.gsc" }, - { 0x0EA4C80B05AD5611, "character/character_cp_usmc_basic_lmg.gsc" }, - { 0x4C9E5A90FD6E6856, "character/character_eastern_yegor_1_1.gsc" }, - { 0x5B6F2B7F6E1A7D74, "character/character_hero_alex_desert.gsc" }, - { 0x085E4BF0387DCC41, "character/character_hero_alex_urban.gsc" }, - { 0x453D6608C94C2B9E, "character/character_hero_farah_disguised.gsc" }, - { 0x47777F0FBD33FF73, "character/character_hero_farah_disguised_soldier.gsc" }, - { 0x005C0E9023E37121, "character/character_hero_griggs_desert.gsc" }, - { 0x6A23AC3A138CE399, "character/character_hero_hadir_prisoner.gsc" }, - { 0x69AABD445950F51C, "character/character_hero_hadir_pw.gsc" }, - { 0x1CBC9F5D1D540B75, "character/character_hero_hadir_urban.gsc" }, - { 0x52B3F7DE0CC8C5F1, "character/character_hero_hadir_young.gsc" }, - { 0x40F23A56192060C5, "character/character_hero_kyle_desert.gsc" }, - { 0x7B684CCC1B07C05C, "character/character_hero_kyle_so15.gsc" }, - { 0x08C34A575093B8A9, "character/character_hero_kyle_undercover.gsc" }, - { 0x1B79AB3405B3751A, "character/character_hero_kyle_urban.gsc" }, - { 0x451AEEDC4CA9161C, "character/character_hero_kyle_woodland.gsc" }, - { 0x426913BC4E3F4DC6, "character/character_hero_kyle_woodland_nvg.gsc" }, - { 0x2723CCC9E0A03B2B, "character/character_hero_nikolai_lab.gsc" }, - { 0x7CC80E4CE0545179, "character/character_hero_nikolai_st_petersburg.gsc" }, - { 0x2CC7174D35C83369, "character/character_hero_price_desert.gsc" }, - { 0x6B9A34CAFADA0815, "character/character_hero_price_undercover.gsc" }, - { 0x57636F9B14953B96, "character/character_hero_price_urban.gsc" }, - { 0x6BADEA8BBC8ECFF0, "character/character_hero_price_urban_nvg.gsc" }, - { 0x7E82081490932D78, "character/character_hero_price_woodland.gsc" }, - { 0x012F75E2C60E0D42, "character/character_hero_price_woodland_nvg.gsc" }, - { 0x6E1433B72452308E, "character/character_hero_price_young.gsc" }, - { 0x5461025BF55F9847, "character/character_hero_tarik.gsc" }, - { 0x7E99F8DD3615036E, "character/character_iw8_al_qatala_desert_1.gsc" }, - { 0x2CE1E9DC0D171E6B, "character/character_iw8_al_qatala_desert_2.gsc" }, - { 0x3524015605241B87, "character/character_iw8_al_qatala_desert_2_rpg_helmet.gsc" }, - { 0x0EA500E63B8DDAC4, "character/character_iw8_al_qatala_desert_3.gsc" }, - { 0x3509C5B5FA7A7269, "character/character_iw8_al_qatala_desert_4.gsc" }, - { 0x20A67CC076CFD53A, "character/character_iw8_al_qatala_desert_5.gsc" }, - { 0x1AA1FCB2FE99EF27, "character/character_iw8_al_qatala_desert_6.gsc" }, - { 0x315785D0955DA390, "character/character_iw8_al_qatala_desert_7.gsc" }, - { 0x2D444CB8578641D5, "character/character_iw8_al_qatala_desert_8.gsc" }, - { 0x3A0751AA833475F6, "character/character_iw8_al_qatala_desert_9.gsc" }, - { 0x00EE231B82F51E36, "character/character_iw8_al_qatala_desert_9_rpg.gsc" }, - { 0x17795A290BA768B1, "character/character_iw8_al_qatala_urban_01.gsc" }, - { 0x11E65938DDAAC8B8, "character/character_iw8_al_qatala_urban_02.gsc" }, - { 0x2663D22E616ACC2F, "character/character_iw8_al_qatala_urban_03.gsc" }, - { 0x08318E5C45CF4496, "character/character_iw8_al_qatala_urban_04.gsc" }, - { 0x549D853A17441CF5, "character/character_iw8_al_qatala_urban_05.gsc" }, - { 0x7045D5559D4B15CC, "character/character_iw8_al_qatala_urban_06.gsc" }, - { 0x64577D431C7881F3, "character/character_iw8_al_qatala_urban_07.gsc" }, - { 0x395ACEA1275F0CC0, "character/character_iw8_al_qatala_urban_08_long_jacket.gsc" }, - { 0x2F6FB39CC102F8C0, "character/character_iw8_al_qatala_urban_bombvest.gsc" }, - { 0x27230CF4F02F517E, "character/character_iw8_al_qatala_urban_female_01.gsc" }, - { 0x2C617BDCFFC30A3B, "character/character_iw8_al_qatala_urban_female_02.gsc" }, - { 0x628490D413593CD4, "character/character_iw8_al_qatala_urban_female_03.gsc" }, - { 0x31F2D7BA99B436B9, "character/character_iw8_al_qatala_urban_female_04.gsc" }, - { 0x492F90D830EA234A, "character/character_iw8_al_qatala_urban_female_05.gsc" }, - { 0x6F3D50CBF42655F7, "character/character_iw8_al_qatala_urban_female_06.gsc" }, - { 0x57D35D134766141E, "character/character_iw8_cp_al_qatala_urban_bombvest.gsc" }, - { 0x082467C472E9E5ED, "character/character_iw8_russian_army_1.gsc" }, - { 0x69527A4B7BDE4891, "character/character_iw8_russian_army_1_safehouse.gsc" }, - { 0x6E95E4E953B03E57, "character/character_iw8_russian_army_1_safehouse_finale.gsc" }, - { 0x64ED3F563E509B56, "character/character_iw8_russian_army_1_trial.gsc" }, - { 0x79148E17CC8D265D, "character/character_iw8_russian_army_2_hood.gsc" }, - { 0x089F00BB868D0981, "character/character_iw8_russian_army_2_hood_safehouse.gsc" }, - { 0x2EC5BC25F6CEA447, "character/character_iw8_russian_army_2_hood_safehouse_finale.gsc" }, - { 0x438EEB058B821551, "character/character_iw8_russian_army_ar_1_balaclava.gsc" }, - { 0x627FDF1F24DC8CA9, "character/character_iw8_russian_army_ar_1_gasmask.gsc" }, - { 0x1CA9792A92FA0EBE, "character/character_iw8_russian_army_ar_1_gasmask_only.gsc" }, - { 0x55A0AA5A5407B600, "character/character_iw8_russian_army_ar_2_balaclava.gsc" }, - { 0x03906ED8412FD030, "character/character_iw8_russian_army_ar_2_gasmask.gsc" }, - { 0x29849111779F2715, "character/character_iw8_russian_army_ar_2_gasmask_only.gsc" }, - { 0x276F3934A343126C, "character/character_iw8_russian_army_ar_3_gasmask_only.gsc" }, - { 0x38D665C0206BB9C6, "character/character_iw8_russian_army_ar_4_gasmask.gsc" }, - { 0x30F56F4478BA814B, "character/character_iw8_russian_army_ar_4_gasmask_only.gsc" }, - { 0x4960FD2F0E080DFD, "character/character_iw8_russian_army_ar_5_gasmask.gsc" }, - { 0x08237C8CDAB9C00A, "character/character_iw8_russian_army_ar_5_gasmask_only.gsc" }, - { 0x31896C80BB6B4EE1, "character/character_iw8_russian_army_ar_6_gasmask_only.gsc" }, - { 0x1F4B1E0349126906, "character/character_iw8_russian_weapon_smugglers_1.gsc" }, - { 0x4D254F021FB66BE3, "character/character_iw8_russian_weapon_smugglers_2.gsc" }, - { 0x2D026713651899FC, "character/character_iw8_russian_weapon_smugglers_3.gsc" }, - { 0x28822DFB26E46661, "character/character_iw8_russian_weapon_smugglers_4.gsc" }, - { 0x41FDA2EDA2E231D2, "character/character_iw8_russian_weapon_smugglers_5.gsc" }, - { 0x74CA2CA435FC7DD5, "character/character_iw8_russian_weapon_smugglers_burned_1.gsc" }, - { 0x5634362338C36664, "character/character_iw8_sla_rebel_female_1_1.gsc" }, - { 0x32AF76B779B47F01, "character/character_iw8_sla_rebel_female_2_1.gsc" }, - { 0x4F315F4967FD0C4A, "character/character_iw8_sla_rebel_female_3_1.gsc" }, - { 0x21F0CD280B29DF07, "character/character_iw8_sla_rebel_female_4_1.gsc" }, - { 0x61452D7E0EA76EA8, "character/character_iw8_sla_rebel_female_5_1.gsc" }, - { 0x56409BEE34A7B4E5, "character/character_iw8_sla_rebel_female_6_1.gsc" }, - { 0x66CCB84CD932427A, "character/character_iw8_sla_rebels_female_prisoner_1.gsc" }, - { 0x642F383F63E13867, "character/character_iw8_sla_rebels_female_prisoner_2.gsc" }, - { 0x20F9C161DFC06ED0, "character/character_iw8_sla_rebels_female_prisoner_3.gsc" }, - { 0x0FC32D6454CBDBCD, "character/character_iw8_sla_rebels_female_prisoner_4.gsc" }, - { 0x6E3B346E80761BAE, "character/character_iw8_sla_rebels_female_prisoner_5.gsc" }, - { 0x1489A8B1F1D0EE4A, "character/character_london_police_hivis.gsc" }, - { 0x15E911C2E47193B4, "character/character_opforce_juggernaut.gsc" }, - { 0x2DD3DAD0CA9F5E5B, "character/character_opforce_juggernaut_br.gsc" }, - { 0x5944FEB3C51E74C4, "character/character_opforce_juggernaut_cp.gsc" }, - { 0x6C9A166E5B3334AB, "character/character_opforce_juggernaut_trial.gsc" }, - { 0x4AC1BF8FC81ADD26, "character/character_rus_pilot_helicopter.gsc" }, - { 0x76D28628026B250C, "character/character_russian_boss_hometown.gsc" }, - { 0x7E5A5D8646CDA55C, "character/character_russian_boss_hometown_cp.gsc" }, - { 0x1BED238A56A2DA97, "character/character_russian_suits.gsc" }, - { 0x7736F327E4B23BC7, "character/character_sas_pilot_helicopter.gsc" }, - { 0x50F17E68CDF54D91, "character/character_sas_pilot_helicopter_cp.gsc" }, - { 0x3A6FF6FC7439D36B, "character/character_sas_urban_ar.gsc" }, - { 0x06F81DAC10AC2D33, "character/character_sas_urban_ar_1.gsc" }, - { 0x2AD32EC53A04A2D6, "character/character_sas_urban_ar_2.gsc" }, - { 0x20BA25A7F3782635, "character/character_sas_urban_ar_3.gsc" }, - { 0x3486F9A1D1DE73F8, "character/character_sas_urban_ar_4.gsc" }, - { 0x4E42483143ACD6A7, "character/character_sas_urban_cqc.gsc" }, - { 0x5A5FB221017E5599, "character/character_sas_urban_dmr.gsc" }, - { 0x0E00A175CD3C099D, "character/character_sas_urban_nvg_ar.gsc" }, - { 0x539E2577B90A987F, "character/character_sas_urban_nvg_dmr.gsc" }, - { 0x094687C777BF3F17, "character/character_sas_woodland_nvg.gsc" }, - { 0x313F5ABF4B84D0CF, "character/character_sla_rebels_male_ar.gsc" }, - { 0x4D837508859FFBA6, "character/character_sla_rebels_male_ar_2_1.gsc" }, - { 0x35FDB6D23CDEB3EC, "character/character_sla_rebels_male_cqb.gsc" }, - { 0x7A59C84A65618589, "character/character_sla_rebels_male_cqb_2_1.gsc" }, - { 0x22DD6113102F3365, "character/character_sla_rebels_male_dmr.gsc" }, - { 0x69480EEFB6BA5468, "character/character_sla_rebels_male_dmr_2_1.gsc" }, - { 0x2B128BB7F062073A, "character/character_sla_rebels_male_lmg.gsc" }, - { 0x6418EDAF39CA3043, "character/character_sla_rebels_male_lmg_2_1.gsc" }, - { 0x4219B6C7F817F165, "character/character_spetsnaz_ar.gsc" }, - { 0x641E66EDABFEBB7B, "character/character_spetsnaz_ar_cp.gsc" }, - { 0x17DA0A253C54B0FB, "character/character_spetsnaz_ar_nvg.gsc" }, - { 0x3E42514A2682BEB5, "character/character_spetsnaz_ar_nvg_cp.gsc" }, - { 0x56ADD4E7B00011F2, "character/character_spetsnaz_ar_nvg_fixed.gsc" }, - { 0x6BB8F6CAED380A0E, "character/character_spetsnaz_ar_nvg_fixed_cp.gsc" }, - { 0x30E7C7F43DEAD23E, "character/character_spetsnaz_ar_trial.gsc" }, - { 0x70F0EC4DAEB4AE51, "character/character_spetsnaz_cqc.gsc" }, - { 0x170918A4881CC5B7, "character/character_spetsnaz_cqc_cp.gsc" }, - { 0x7889943617BE8CD7, "character/character_spetsnaz_cqc_nvg.gsc" }, - { 0x13C1AA5F4765A401, "character/character_spetsnaz_cqc_nvg_cp.gsc" }, - { 0x47E0A378DA1A8E12, "character/character_spetsnaz_cqc_trial.gsc" }, - { 0x7CE85BA6ABEDEA11, "character/character_spetsnaz_dmr_cp.gsc" }, - { 0x7C85DC1BDE3E9B97, "character/character_spetsnaz_dmr_cp_nvg.gsc" }, - { 0x4525678513A55130, "character/character_spetsnaz_dmr_trial.gsc" }, - { 0x30655A40A32B3E87, "character/character_spetsnaz_gasmask_ar.gsc" }, - { 0x5C98EFE42BA9CD51, "character/character_spetsnaz_gasmask_ar_cp.gsc" }, - { 0x3829F9EFD28EF970, "character/character_spetsnaz_gasmask_ar_trial.gsc" }, - { 0x13E562E39A0560DB, "character/character_spetsnaz_gasmask_cqc.gsc" }, - { 0x324C128AB55ECFD5, "character/character_spetsnaz_gasmask_cqc_cp.gsc" }, - { 0x37350F9E6ED949DC, "character/character_spetsnaz_gasmask_cqc_trial.gsc" }, - { 0x1B9F8D5B8D8BD522, "character/character_spetsnaz_gasmask_lmg.gsc" }, - { 0x38D41A1CB0C0EA5E, "character/character_spetsnaz_gasmask_lmg_cp.gsc" }, - { 0x166B11563999BC01, "character/character_spetsnaz_gasmask_lmg_trial.gsc" }, - { 0x4000F1C13DF8C3FE, "character/character_spetsnaz_gasmask_nohelmet_ar.gsc" }, - { 0x4C03E444E5AE90BA, "character/character_spetsnaz_gasmask_nohelmet_ar_cp.gsc" }, - { 0x101352BEA05224CC, "character/character_spetsnaz_gasmask_nohelmet_cqc.gsc" }, - { 0x5729CA7C3938D91C, "character/character_spetsnaz_gasmask_nohelmet_cqc_cp.gsc" }, - { 0x183764699C0BCD81, "character/character_spetsnaz_gasmask_nohelmet_lmg.gsc" }, - { 0x78ED867ED4FA07C7, "character/character_spetsnaz_gasmask_nohelmet_lmg_cp.gsc" }, - { 0x27B67CF1F7740E3C, "character/character_spetsnaz_lmg.gsc" }, - { 0x290155ACC542FD2C, "character/character_spetsnaz_lmg_cp.gsc" }, - { 0x0EAB76E4D130A0D6, "character/character_spetsnaz_lmg_cp_nvg.gsc" }, - { 0x3C73067B384FE983, "character/character_spetsnaz_lmg_trial.gsc" }, - { 0x12AC8E46F9F1B1D7, "character/character_spetsnaz_riotshield_cp.gsc" }, - { 0x49F5485BC147C97D, "character/character_usmc_ar.gsc" }, - { 0x6F04D7795F35B4BA, "character/character_usmc_basic_ar_1.gsc" }, - { 0x5BF02C47B4E9291D, "character/character_usmc_basic_ar_1_tape.gsc" }, - { 0x6900576BE6FFCEA7, "character/character_usmc_basic_ar_2.gsc" }, - { 0x7FB5E0897DC38310, "character/character_usmc_basic_ar_3.gsc" }, - { 0x4E462338C5E5027B, "character/character_usmc_basic_ar_3_tape.gsc" }, - { 0x6B194C8BEFEBC70D, "character/character_usmc_basic_ar_4.gsc" }, - { 0x75C35CB1CA43C8A8, "character/character_usmc_basic_ar_4_tape.gsc" }, - { 0x0BDEF97EF9E75B41, "character/character_usmc_basic_lmg.gsc" }, - { 0x41CD176219AD0F88, "character/character_usmc_raiders_ar_1.gsc" }, - { 0x18475A669837B301, "character/character_usmc_raiders_ar_2.gsc" }, - { 0x5892D3891710BEF2, "character/character_usmc_raiders_ar_3.gsc" }, - { 0x3CEA7B6D9109B883, "character/character_usmc_raiders_ar_4.gsc" }, - { 0x1CC7937ED66BE69C, "character/character_usmc_raiders_ar_5.gsc" }, - { 0x33F310BE3CF9124E, "character/character_villain_barkov_old.gsc" }, - { 0x4194584749801B49, "character/character_villain_enforcer_st_petersburg.gsc" }, - { 0x08F8C84C5C288DCF, "character/character_villain_wolf.gsc" }, - { 0x0BAA1424E598BDD0, "character/character_villain_wolf_bombvest.gsc" }, - { 0x58DD4308ADBF221F, "character/civ_al_qatala_urban_civ_female.gsc" }, - { 0x2F833547C8153977, "character/civ_al_qatala_urban_civ_female_bluetop.gsc" }, - { 0x02AE0175D9620C61, "character/civ_al_qatala_urban_civ_female_turquoise.gsc" }, - { 0x68D553ABF58DA9BE, "character/civ_al_qatala_urban_civ_female_whitetop.gsc" }, - { 0x6692AC662B0566F4, "character/civ_child_interrogation.gsc" }, - { 0x09112FF428E6966B, "character/civ_embassy_ambassador_assistant.gsc" }, - { 0x0D5AC5FBC289F77D, "character/civ_embassy_office_worker_female_1_1.gsc" }, - { 0x5A986F95EA1207FB, "character/civ_embassy_office_worker_female_1_1_smallhead.gsc" }, - { 0x52D552F82C405F74, "character/civ_embassy_office_worker_female_1_2.gsc" }, - { 0x17A313607EC7D300, "character/civ_embassy_office_worker_female_2_1.gsc" }, - { 0x197A1774AE32A599, "character/civ_embassy_office_worker_female_2_2.gsc" }, - { 0x548626A53E42A848, "character/civ_embassy_office_worker_male_1_1.gsc" }, - { 0x2E6669A9BFB074C1, "character/civ_embassy_office_worker_male_1_2.gsc" }, - { 0x41D0E2C753A7ACB2, "character/civ_embassy_office_worker_male_1_3.gsc" }, - { 0x7F0C7FC98922F685, "character/civ_embassy_office_worker_male_2_1.gsc" }, - { 0x707E0BB5096A3F9C, "character/civ_embassy_office_worker_male_2_2.gsc" }, - { 0x10A0F3A3C4081183, "character/civ_embassy_office_worker_male_2_3.gsc" }, - { 0x2C494BBF4A0F17F2, "character/civ_embassy_office_worker_male_2_4.gsc" }, - { 0x22C2C5FE4B6B3368, "character/civ_female_interrogation.gsc" }, - { 0x3362BFAC36550623, "character/civ_london_female_02_skintone_dark.gsc" }, - { 0x4D39F545494121FB, "character/civ_london_female_02_skintone_light.gsc" }, - { 0x55603631F9C1D6E1, "character/civ_london_female_02_skintone_med.gsc" }, - { 0x2A243841281837A0, "character/civ_london_female_03_skintone_dark.gsc" }, - { 0x392556CBACA7C63A, "character/civ_london_female_03_skintone_light.gsc" }, - { 0x03C8FCB79090D614, "character/civ_london_female_03_skintone_med.gsc" }, - { 0x626D10F8763CC956, "character/civ_london_female_skintone_light.gsc" }, - { 0x112B6172A8E03232, "character/civ_london_female_skintone_light_anim_safe.gsc" }, - { 0x4D4ED05775D54B60, "character/civ_london_female_skintone_med.gsc" }, - { 0x3581B5A8CD365E20, "character/civ_london_female_skintone_med_anim_safe.gsc" }, - { 0x76B402B54F12A90D, "character/civ_london_male_embassy_adam.gsc" }, - { 0x6C5F37B73038304F, "character/civ_london_male_embassy_ambassador.gsc" }, - { 0x31B4AF71A67FDEA5, "character/civ_london_male_skintone_light.gsc" }, - { 0x539ED76185B302CF, "character/civ_london_male_skintone_med.gsc" }, - { 0x546EEEEBDC1E25F2, "character/civ_russian_female.gsc" }, - { 0x2703F00D7AFD0CA7, "character/civ_russian_male.gsc" }, - { 0x5401B4AF4E767031, "character/civ_russian_male_cp.gsc" }, - { 0x0CC64E08F07608B4, "character/civ_syrkistan_female_nurse_mask.gsc" }, - { 0x32CF52C0A4B4C8B7, "character/civ_syrkistan_female_nurse_nomask.gsc" }, - { 0x2BBFC1556DA4EF40, "character/civ_syrkistan_female_scarf_dress_blue.gsc" }, - { 0x0345FA4A960C66DE, "character/civ_syrkistan_female_scarf_dress_orange.gsc" }, - { 0x2A37A70872AA63E0, "character/civ_syrkistan_female_scarf_dress_pink.gsc" }, - { 0x426EF33A261B7799, "character/civ_syrkistan_female_scarf_green.gsc" }, - { 0x466E1F43A0586C85, "character/civ_syrkistan_female_scarf_long_blue.gsc" }, - { 0x7C4DE9361E63B59D, "character/civ_syrkistan_female_scarf_long_brown.gsc" }, - { 0x1F527F885BA419F1, "character/civ_syrkistan_girl_1_1.gsc" }, - { 0x18081CF8B9A9DA94, "character/civ_syrkistan_girl_2_1.gsc" }, - { 0x4E107BA6CC8AA783, "character/civ_syrkistan_girl_3_1.gsc" }, - { 0x67AF09749E4A06CE, "character/civ_syrkistan_girl_4_1.gsc" }, - { 0x69399199AA50AF95, "character/civ_syrkistan_girl_5_1.gsc" }, - { 0x2BB5C587708E9798, "character/civ_syrkistan_girl_6_1.gsc" }, - { 0x672A73FD8EF30F77, "character/civ_syrkistan_girl_7_1.gsc" }, - { 0x23AE83E6F81BD759, "character/civ_syrkistan_male_doctor_mask.gsc" }, - { 0x5BB195F5D6C021FA, "character/civ_syrkistan_male_doctor_nomask.gsc" }, - { 0x2FB06984712C831F, "character/civ_tugofwar_male_cp.gsc" }, - { 0x14D32184C28E8194, "character/civ_uk_female_coat_blue.gsc" }, - { 0x79800D0D98A1EA7C, "character/civ_western_cold_boy.gsc" }, - { 0x32EE021D62E7D89A, "character/civ_western_cold_girl.gsc" }, - { 0x67D1396D2B710E12, "character/hero_xo_farah_variant.gsc" }, - { 0x71D8FA6A424DD963, "character/test_character_alq_embassy.gsc" }, - { 0x25B99F89A4C9696E, "character/test_character_civ_female_rus_clerical.gsc" }, - { 0x626E03DD36BDC6CF, "character/test_character_civ_male_london_01.gsc" }, - { 0x5B7D895F06BC7241, "character/test_character_civ_male_rus_clerical.gsc" }, - { 0x1BE7F0EB0E52CA40, "character/test_character_cp_crew_male_vest_picc_01.gsc" }, - { 0x1955C748B00BEC22, "character/test_character_crew_male_vest_picc_01.gsc" }, - { 0x78E39294A33F71EA, "character/test_character_dog.gsc" }, - { 0x15AE8137379807E9, "character/test_character_farah_father.gsc" }, - { 0x06915CAA9316909E, "scripts/aitypes/alert.gsc" }, - { 0x027FF5BAFD325163, "scripts/aitypes/assets.gsc" }, - { 0x0974236B390FBD2A, "scripts/aitypes/bt_action_api.gsc" }, - { 0x088804CFE1C28645, "scripts/aitypes/bt_state_api.gsc" }, - { 0x68089CE1EA270B3B, "scripts/aitypes/bt_util.gsc" }, - { 0x69FDEC9FC8CCFB18, "scripts/aitypes/c12api.gsc" }, - { 0x015EDFA8E2BDACE2, "scripts/aitypes/combat.gsc" }, - { 0x6C59B261C6CF53C8, "scripts/aitypes/combat_mp.gsc" }, - { 0x3C36BCB5F2B1856E, "scripts/aitypes/combat_sp.gsc" }, - { 0x6ADCC148F9B3971B, "scripts/aitypes/common.gsc" }, - { 0x0FC0E00E7CF9B73B, "scripts/aitypes/cover.gsc" }, - { 0x5D8472F0F6851F3A, "scripts/aitypes/dismember.gsc" }, - { 0x1B1733A424733305, "scripts/aitypes/dog/combat.gsc" }, - { 0x61EF79F49C19C9AA, "scripts/aitypes/grenade_response.gsc" }, - { 0x7A383E1E6C824150, "scripts/aitypes/human/civilian_logic.gsc" }, - { 0x40E26106E37768BA, "scripts/aitypes/juggernaut/behaviors.gsc" }, - { 0x09F3D607A2667EBC, "scripts/aitypes/melee.gsc" }, - { 0x2B92E11988DD75FC, "scripts/aitypes/melee_sp.gsc" }, - { 0x3FECCEEDD2675490, "scripts/aitypes/patrol.gsc" }, - { 0x201E1A94F1554A07, "scripts/aitypes/riotshield/riotshield.gsc" }, - { 0x2E9D38C750386509, "scripts/aitypes/robot_dismember.gsc" }, - { 0x544C874800E20BAA, "scripts/aitypes/soldier/agent_setup.gsc" }, - { 0x7997E75E8C58A096, "scripts/aitypes/squad.gsc" }, - { 0x4B3E96950DE06E8C, "scripts/aitypes/squad_movement.gsc" }, - { 0x25EC558982515BD3, "scripts/aitypes/stealth.gsc" }, - { 0x74CB2F5C7F07F60A, "scripts/aitypes/suicidebomber/combat.gsc" }, - { 0x11F8482D601A0E8B, "scripts/aitypes/suicidebomber/setup_agent.gsc" }, - { 0x412F6C016572E634, "scripts/aitypes/throwgrenade.gsc" }, - { 0x009260F116382760, "scripts/aitypes/vehicle.gsc" }, - { 0x1ADB4918CECB4F6A, "scripts/aitypes/weapon.gsc" }, - { 0x0C7FA313D48D792B, "scripts/asm/asm.gsc" }, - { 0x2161B5FA22FA7E26, "scripts/asm/asm_bb.gsc" }, - { 0x547B73EF8F00503B, "scripts/asm/asm_mp.gsc" }, - { 0x1CD62A16E0D5DD95, "scripts/asm/asm_sp.gsc" }, - { 0x5BEE3EC20D14B069, "scripts/asm/civilian/script_funcs.gsc" }, - { 0x49410A43C4B33594, "scripts/asm/dog/move.gsc" }, - { 0x22A56195290EDD97, "scripts/asm/gesture.gsc" }, - { 0x55BE6492B84E43C1, "scripts/asm/gesture/script_funcs.gsc" }, - { 0x260BE52CAB2E0891, "scripts/asm/juggernaut/juggernaut.gsc" }, - { 0x53615BFEFEAE0BC2, "scripts/asm/seeker/melee.gsc" }, - { 0x669A259AF13C5E60, "scripts/asm/shared/mp/utility.gsc" }, - { 0x23366F933E3CF3A6, "scripts/asm/shared/sp/utility.gsc" }, - { 0x48E99BBFB1C38498, "scripts/asm/shared/utility.gsc" }, - { 0x6815796065987415, "scripts/asm/shoot/script_funcs.gsc" }, - { 0x48CFCAC846FDE7EC, "scripts/asm/soldier/arrival.gsc" }, - { 0x15C58B3443C8F5AA, "scripts/asm/soldier/cover.gsc" }, - { 0x4FA7F12CF0B115EA, "scripts/asm/soldier/cp.gsc" }, - { 0x15911D67A81B41FA, "scripts/asm/soldier/custom.gsc" }, - { 0x498A94B2B971C46B, "scripts/asm/soldier/death.gsc" }, - { 0x4482EF346D9A8971, "scripts/asm/soldier/grenade_response.gsc" }, - { 0x15F86984DA58CDA7, "scripts/asm/soldier/ground_turret.gsc" }, - { 0x7C21424B9BAF1D83, "scripts/asm/soldier/interactable.gsc" }, - { 0x793ED8A24E515D55, "scripts/asm/soldier/lmg.gsc" }, - { 0x1C26AA437F78EC66, "scripts/asm/soldier/long_death.gsc" }, - { 0x473FB7B284CF9EDD, "scripts/asm/soldier/melee.gsc" }, - { 0x7430CC4DC955D54C, "scripts/asm/soldier/move.gsc" }, - { 0x349C0B9D73BC7BEC, "scripts/asm/soldier/mp/gesture_script_funcs.gsc" }, - { 0x2E42A30B207A31F7, "scripts/asm/soldier/mp/melee.gsc" }, - { 0x0F5F3AF38B9CE328, "scripts/asm/soldier/mp/script_funcs.gsc" }, - { 0x3D342FD57D1AB889, "scripts/asm/soldier/pain.gsc" }, - { 0x0D61CBBD5CF60E27, "scripts/asm/soldier/patrol.gsc" }, - { 0x48BE9A3E6E3CB250, "scripts/asm/soldier/patrol_idle.gsc" }, - { 0x7DCD7FACEB87E0DA, "scripts/asm/soldier/script_funcs.gsc" }, - { 0x2FC5F0C2A4C01B47, "scripts/asm/soldier/smartobject.gsc" }, - { 0x51A1C4EE4E4055E9, "scripts/asm/soldier/sp/melee.gsc" }, - { 0x3ECDB4A40E3CC60E, "scripts/asm/soldier/sp/script_funcs.gsc" }, - { 0x01D019CB9DAA869F, "scripts/asm/soldier/throwgrenade.gsc" }, - { 0x55C37F8D19CC80E7, "scripts/asm/soldier/traverse.gsc" }, - { 0x41AD1F1424DD3CC9, "scripts/asm/soldier/vehicle.gsc" }, - { 0x1BADAF71B53D50F3, "scripts/asm/suicidebomber/suicidebomber.gsc" }, - { 0x401F827F9CA276D7, "scripts/asm/track.gsc" }, - { 0x2AE0C65FFBA71F3C, "scripts/asm/traverse.gsc" }, - { 0x6F81AE0370D9FD4C, "scripts/code/ai.gsc" }, - { 0x01299D55C0D48CC2, "scripts/code/ai_shooting.gsc" }, - { 0x3B7877BFCEC26473, "scripts/code/character.gsc" }, - { 0x2B0D7E2A0F096CD1, "scripts/code/delete.gsc" }, - { 0x34A720E17D0E697B, "scripts/code/struct.gsc" }, - { 0x659C5B2112E17034, "scripts/common/ai.gsc" }, - { 0x7C0FA206E882CECB, "scripts/common/anim.gsc" }, - { 0x7A6DBD11DBD96EDB, "scripts/common/basic_wind.gsc" }, - { 0x59BAC1035C67173C, "scripts/common/bcs_location_trigs.gsc" }, - { 0x2FFC9CC854107314, "scripts/common/create_cover_nodes.gsc" }, - { 0x75152F52D4583A69, "scripts/common/create_script_utility.gsc" }, - { 0x21486AC5E51045AC, "scripts/common/createfx.gsc" }, - { 0x3B7AF1FD5F2FBB0B, "scripts/common/createfxmenu.gsc" }, - { 0x25660DC6A1A4925F, "scripts/common/csplines.gsc" }, - { 0x30C42DCABD30A39B, "scripts/common/debug_graycard.gsc" }, - { 0x7BABF1485CAE49AB, "scripts/common/debug_reflection.gsc" }, - { 0x3A68A1BDABCACFF8, "scripts/common/elevator.gsc" }, - { 0x0BF3584572AA2FEB, "scripts/common/exploder.gsc" }, - { 0x547435A3732A58C4, "scripts/common/fx.gsc" }, - { 0x22DA8B656744450B, "scripts/common/gameskill.gsc" }, - { 0x200FD802F1105446, "scripts/common/input_allow.gsc" }, - { 0x6318547A70575AE4, "scripts/common/interactive.gsc" }, - { 0x69C2C8AD1C1A4602, "scripts/common/lbravo_ai_infil.gsc" }, - { 0x16448E4E69E35554, "scripts/common/mocap_ar.gsc" }, - { 0x7B165416C1291173, "scripts/common/notetrack.gsc" }, - { 0x4DA9FC5BA0EF1B33, "scripts/common/painter.gsc" }, - { 0x3510835C04D231DF, "scripts/common/rockable_vehicles.gsc" }, - { 0x3B96C3C24CBD640D, "scripts/common/screens.gsc" }, - { 0x70A710E9C0B2022D, "scripts/common/scriptable.gsc" }, - { 0x2C127AAC33157CB4, "scripts/common/turret.gsc" }, - { 0x569B10679FE8CF60, "scripts/common/ui.gsc" }, - { 0x692B19B8E5F8F9E8, "scripts/common/utility.gsc" }, - { 0x4A975D4EC578D9B0, "scripts/common/vehicle.gsc" }, - { 0x1DA5EE063934C32C, "scripts/common/vehicle_aianim.gsc" }, - { 0x7B28CBA57F879E5B, "scripts/common/vehicle_build.gsc" }, - { 0x6D7498659E4F29AE, "scripts/common/vehicle_code.gsc" }, - { 0x1DAFAEBC95981B6E, "scripts/common/vehicle_lights.gsc" }, - { 0x52E0904904AD8537, "scripts/common/vehicle_paths.gsc" }, - { 0x2F491F1DD7B13125, "scripts/common/vehicle_treadfx.gsc" }, - { 0x405C84A849DDC4FB, "scripts/cp/agents/agents.gsc" }, - { 0x10122B3722577A77, "scripts/cp/agents/gametype_cp_specops.gsc" }, - { 0x65E1DFAB60102E56, "scripts/cp/agents/gametype_cp_strike.gsc" }, - { 0x06956673F919E9E6, "scripts/cp/agents/gametype_cp_survival.gsc" }, - { 0x5F75DE291FA2FE7A, "scripts/cp/agents/gametype_cp_wave_survival.gsc" }, - { 0x6E861200387556E9, "scripts/cp/agents/gametype_cp_wave_sv.gsc" }, - { 0x5754FAA22F6AAA4F, "scripts/cp/agents/soldier_agent_spec.gsc" }, - { 0x056F189DC0896467, "scripts/cp/animation_suite.gsc" }, - { 0x05E7E74A6FD92E01, "scripts/cp/astar.gsc" }, - { 0x6D5BA21672C0B8C5, "scripts/cp/bomb_defusal/coop_bomb_defusal.gsc" }, - { 0x604E0C0070C6DCA0, "scripts/cp/calloutmarkerping_cp.gsc" }, - { 0x35EA29F9BD5D2F7E, "scripts/cp/challenges_cp.gsc" }, - { 0x023A633AC3893869, "scripts/cp/classes/cp_class_progression.gsc" }, - { 0x7C4C41D3546BB30A, "scripts/cp/compass.gsc" }, - { 0x41DD26B3A399A786, "scripts/cp/coop_createfx.gsc" }, - { 0x0A7B6C06E6FAEFEB, "scripts/cp/coop_escape.gsc" }, - { 0x68B37C1D85B7E9E0, "scripts/cp/coop_escort.gsc" }, - { 0x7D5265119FD77B8E, "scripts/cp/coop_fx.gsc" }, - { 0x21CE68A1EC9DC5BD, "scripts/cp/coop_personal_ents.gsc" }, - { 0x62E660BE1C9E00D0, "scripts/cp/coop_priority_queue.gsc" }, - { 0x3847B28F27EF1719, "scripts/cp/coop_stealth.gsc" }, - { 0x62E168CCD910BE81, "scripts/cp/coop_super.gsc" }, - { 0x50952380C88E8FAE, "scripts/cp/cp_accessories.gsc" }, - { 0x36B30489B2EC202B, "scripts/cp/cp_achievement.gsc" }, - { 0x289A9D58A559EC35, "scripts/cp/cp_adrenaline_crate.gsc" }, - { 0x0EE49FBD69A66DBD, "scripts/cp/cp_agent_damage.gsc" }, - { 0x5BA9955F5F7C5E56, "scripts/cp/cp_agent_patrol.gsc" }, - { 0x55ACBC2CDAEAA753, "scripts/cp/cp_agent_utils.gsc" }, - { 0x5D1BDBB0E8564315, "scripts/cp/cp_ai_spawn_anim_skits.gsc" }, - { 0x2F6B6BF9F9432559, "scripts/cp/cp_aiparachute.gsc" }, - { 0x0F377DF950536F95, "scripts/cp/cp_aitype_structs_ally_usmc.gsc" }, - { 0x54A590FCE0C11C95, "scripts/cp/cp_aitype_structs_enemy_alq.gsc" }, - { 0x448DD552F3B44DE4, "scripts/cp/cp_ammo_crate.gsc" }, - { 0x0C0338520796EBF4, "scripts/cp/cp_analytics.gsc" }, - { 0x11CC830B10EC9E27, "scripts/cp/cp_anim.gsc" }, - { 0x3AAFE0ECAC1FDE8F, "scripts/cp/cp_armor.gsc" }, - { 0x46BB2A6790B9851B, "scripts/cp/cp_armor_crate.gsc" }, - { 0x160BC2B853762904, "scripts/cp/cp_awards.gsc" }, - { 0x5C9273E0753F93F7, "scripts/cp/cp_battlechatter.gsc" }, - { 0x083851F1CB94F27C, "scripts/cp/cp_battlechatter_ai.gsc" }, - { 0x1CD928C73A3C7AED, "scripts/cp/cp_breach_c4.gsc" }, - { 0x26E61A39B49A2D61, "scripts/cp/cp_c4.gsc" }, - { 0x0D3AF535878CE6A1, "scripts/cp/cp_challenge.gsc" }, - { 0x77CEB810FB262D44, "scripts/cp/cp_checkpoint.gsc" }, - { 0x274B3B919A446B08, "scripts/cp/cp_circuit_breaker.gsc" }, - { 0x66B6D782FB63652E, "scripts/cp/cp_claymore.gsc" }, - { 0x0AE604151E11DB2C, "scripts/cp/cp_compass.gsc" }, - { 0x3B12F328DD1C03E3, "scripts/cp/cp_computerscreen.gsc" }, - { 0x79B0E7CC995DD9D8, "scripts/cp/cp_convoy_manager.gsc" }, - { 0x2E1125AF53E52D26, "scripts/cp/cp_convoy_manager_code.gsc" }, - { 0x2C415637F5D843BE, "scripts/cp/cp_core_gamescore.gsc" }, - { 0x65DD81F3017F5CAD, "scripts/cp/cp_create_script_utility.gsc" }, - { 0x2BD44F94DBFDD1BF, "scripts/cp/cp_damage.gsc" }, - { 0x79678F455E1BAE9C, "scripts/cp/cp_damagefeedback.gsc" }, - { 0x0B39A8DB9AB23587, "scripts/cp/cp_debug.gsc" }, - { 0x19D8325A65696BEC, "scripts/cp/cp_deployablebox.gsc" }, - { 0x6BB1B234318E600C, "scripts/cp/cp_destruction.gsc" }, - { 0x1E66FFA1ABB2E499, "scripts/cp/cp_dev_hud.gsc" }, - { 0x4BD2BA471F17FD24, "scripts/cp/cp_dialogue.gsc" }, - { 0x19CB693D3542F849, "scripts/cp/cp_disguise.gsc" }, - { 0x75A639502844BC46, "scripts/cp/cp_door.gsc" }, - { 0x4CFB447F698AF057, "scripts/cp/cp_drone_strike.gsc" }, - { 0x4C07635B8E253F91, "scripts/cp/cp_electricswitch.gsc" }, - { 0x73F12CC9B65A9264, "scripts/cp/cp_elevator.gsc" }, - { 0x729BFF892DF4D9FF, "scripts/cp/cp_endgame.gsc" }, - { 0x24BD5A7A5FC72606, "scripts/cp/cp_enemy_drone_turret.gsc" }, - { 0x3C605EEE483F1C75, "scripts/cp/cp_enemy_sentry_turret.gsc" }, - { 0x68818DD6020A3887, "scripts/cp/cp_enemy_tank.gsc" }, - { 0x7FA8962E0706F150, "scripts/cp/cp_equipment.gsc" }, - { 0x6394291F25436853, "scripts/cp/cp_escalation.gsc" }, - { 0x20055BA1138A8A43, "scripts/cp/cp_events.gsc" }, - { 0x499369DA3F41F053, "scripts/cp/cp_flares.gsc" }, - { 0x49F97D6E0D4F141C, "scripts/cp/cp_gamescore.gsc" }, - { 0x4C8018F9FF5EE237, "scripts/cp/cp_gameskill.gsc" }, - { 0x72C3C07972988B3A, "scripts/cp/cp_gastrap.gsc" }, - { 0x1DADE61B2677915B, "scripts/cp/cp_globallogic.gsc" }, - { 0x3FAD8171AC52C26D, "scripts/cp/cp_globalthreat.gsc" }, - { 0x4AD2AE2940C76DEA, "scripts/cp/cp_grenade_crate.gsc" }, - { 0x3CE6569E07B2E327, "scripts/cp/cp_hacking.gsc" }, - { 0x3E40218F8932A799, "scripts/cp/cp_hostage.gsc" }, - { 0x595F86A2BB6ADE56, "scripts/cp/cp_hostmigration.gsc" }, - { 0x543CB32E96D20FF9, "scripts/cp/cp_hud_message.gsc" }, - { 0x151D81BF634AAD5C, "scripts/cp/cp_hud_util.gsc" }, - { 0x013C7C6E617BFDA4, "scripts/cp/cp_infilexfil.gsc" }, - { 0x36D208603073D4AC, "scripts/cp/cp_interaction.gsc" }, - { 0x62F044B0BDE21572, "scripts/cp/cp_juggernaut.gsc" }, - { 0x1EEB362406E2139A, "scripts/cp/cp_kidnapper.gsc" }, - { 0x4073C1DE36946D4E, "scripts/cp/cp_ladder.gsc" }, - { 0x132D62A694A66E00, "scripts/cp/cp_laststand.gsc" }, - { 0x41F8DCD8474CD588, "scripts/cp/cp_loadout.gsc" }, - { 0x6721E69491B4F122, "scripts/cp/cp_manned_turret.gsc" }, - { 0x78589419EEF19156, "scripts/cp/cp_mapselect.gsc" }, - { 0x46707B4CCAE70331, "scripts/cp/cp_matchdata.gsc" }, - { 0x314A4197D2CF4C94, "scripts/cp/cp_merits.gsc" }, - { 0x6D71D59B1E04DAD4, "scripts/cp/cp_missilelauncher.gsc" }, - { 0x23D156EB33881960, "scripts/cp/cp_modular_spawning.gsc" }, - { 0x394726D755FA7F04, "scripts/cp/cp_movers.gsc" }, - { 0x436617F5ADA283AE, "scripts/cp/cp_munitions.gsc" }, - { 0x4105B921C7A84DF8, "scripts/cp/cp_music_and_dialog.gsc" }, - { 0x09DD76076AFA2AA3, "scripts/cp/cp_objective_mechanics.gsc" }, - { 0x7A2F1D02E511EC5A, "scripts/cp/cp_objectives.gsc" }, - { 0x2C5E6CC8E8B7747C, "scripts/cp/cp_objectives_events.gsc" }, - { 0x735FDF50A470071A, "scripts/cp/cp_outline.gsc" }, - { 0x3E212ACF2CC9EA85, "scripts/cp/cp_outline_utility.gsc" }, - { 0x73E73FCA13CCD95C, "scripts/cp/cp_outofbounds.gsc" }, - { 0x1287EAC158212373, "scripts/cp/cp_persistence.gsc" }, - { 0x42FC6259D39D4FE4, "scripts/cp/cp_pickup_hostage.gsc" }, - { 0x721F5F6C6EABDD5B, "scripts/cp/cp_player_battlechatter.gsc" }, - { 0x79F7187B2F8EC442, "scripts/cp/cp_playerchatter.gsc" }, - { 0x7CA04657035BFE5D, "scripts/cp/cp_points.gsc" }, - { 0x7F3615DDBB6372C8, "scripts/cp/cp_powers.gsc" }, - { 0x08DC23A8D8BAD4C3, "scripts/cp/cp_puzzles_core.gsc" }, - { 0x483CDEC62A993616, "scripts/cp/cp_quest.gsc" }, - { 0x2720F2C0EEF1847C, "scripts/cp/cp_rank.gsc" }, - { 0x1E349F6532636F4A, "scripts/cp/cp_relics.gsc" }, - { 0x60ABB2EDB1338747, "scripts/cp/cp_remote_tank.gsc" }, - { 0x00ECDC0601E07F09, "scripts/cp/cp_reward.gsc" }, - { 0x126F12D0A469E47E, "scripts/cp/cp_scriptable_states.gsc" }, - { 0x4A93F3F847237123, "scripts/cp/cp_scriptmover_util.gsc" }, - { 0x25ED60BD2F4EA1F8, "scripts/cp/cp_skits.gsc" }, - { 0x3F387D484A0707C4, "scripts/cp/cp_smg_prototype.gsc" }, - { 0x6B4715003EA60CAD, "scripts/cp/cp_snakecam.gsc" }, - { 0x5AB40AA9E7FBD159, "scripts/cp/cp_spawn_factor.gsc" }, - { 0x28B2968BED25CDBE, "scripts/cp/cp_spawner_scoring.gsc" }, - { 0x293B992A2249F427, "scripts/cp/cp_spawning.gsc" }, - { 0x6C4EFA38D9C4B14E, "scripts/cp/cp_spawning_util.gsc" }, - { 0x48A22E190B3C937B, "scripts/cp/cp_squadmanager.gsc" }, - { 0x2FE06DE324077B78, "scripts/cp/cp_stealth_zombie.gsc" }, - { 0x2BB0F43E94BDC558, "scripts/cp/cp_strike_debug.gsc" }, - { 0x277ACFFF23CDF23D, "scripts/cp/cp_traversalassist.gsc" }, - { 0x2132AFACF8AF45A8, "scripts/cp/cp_trigger_spawn.gsc" }, - { 0x2A5E5A422CE4E9D0, "scripts/cp/cp_turret.gsc" }, - { 0x55E7B7B36A41E879, "scripts/cp/cp_vehicle_structs.gsc" }, - { 0x4D8013A60BD4C8FB, "scripts/cp/cp_vehicle_turretdrone.gsc" }, - { 0x705070321815B6C3, "scripts/cp/cp_vehicles.gsc" }, - { 0x27F63F0BE922A0D3, "scripts/cp/cp_vip.gsc" }, - { 0x059F5880FFCCAAF7, "scripts/cp/cp_visionsets.gsc" }, - { 0x2B69DBD597BCE765, "scripts/cp/cp_vo.gsc" }, - { 0x1C546092D05D8344, "scripts/cp/cp_wall_buys.gsc" }, - { 0x418552E46A3464DB, "scripts/cp/cp_wave_spawning.gsc" }, - { 0x0B27F513235A49F6, "scripts/cp/cp_weapon.gsc" }, - { 0x4159CAEE51B2FA49, "scripts/cp/cp_weapon_autosentry.gsc" }, - { 0x37A60B7D589FEEFD, "scripts/cp/cp_weapon_upgrade.gsc" }, - { 0x1F22B3E6E26E904C, "scripts/cp/cp_weaponrank.gsc" }, - { 0x51668D1005BA4945, "scripts/cp/cp_weapons.gsc" }, - { 0x089B97E3AB1D86BC, "scripts/cp/crafting_system.gsc" }, - { 0x5A4ADAD6D823A135, "scripts/cp/crate_drops/cp_crate_drops.gsc" }, - { 0x50B2A6EDDE41AA2E, "scripts/cp/crate_drops/cp_crate_drops_cs.gsc" }, - { 0x234683D1B1309737, "scripts/cp/dedicated.gsc" }, - { 0x2992CA5600A39A84, "scripts/cp/drone/emp_drone.gsc" }, - { 0x6563DD1C0DB7EEB8, "scripts/cp/drone/scout_drone.gsc" }, - { 0x0F63DE2324CD0A73, "scripts/cp/drone/utility.gsc" }, - { 0x6F1A8D1455F4B483, "scripts/cp/emp_debuff_cp.gsc" }, - { 0x7034768B987DCC5A, "scripts/cp/equipment/cp_adrenaline.gsc" }, - { 0x3DEA9FE4B123C89C, "scripts/cp/equipment/cp_at_mine.gsc" }, - { 0x7F8C3E1308318968, "scripts/cp/equipment/cp_decoy_grenade.gsc" }, - { 0x2DD9AE325464900D, "scripts/cp/equipment/cp_gas_grenade.gsc" }, - { 0x79411BE27480A61B, "scripts/cp/equipment/cp_incendiarylauncher.gsc" }, - { 0x3AA23057F7A1DA26, "scripts/cp/equipment/cp_javelin.gsc" }, - { 0x4A1F5B8DBD8EE120, "scripts/cp/equipment/cp_snapshot_grenade.gsc" }, - { 0x55FCDDC3879C791B, "scripts/cp/equipment/cp_stinger.gsc" }, - { 0x5FDF216092548A5F, "scripts/cp/equipment/cp_thermite.gsc" }, - { 0x6E157D31BFA255A7, "scripts/cp/equipment/cp_trophy_system.gsc" }, - { 0x024D396DBAC5EACC, "scripts/cp/equipment/nvg.gsc" }, - { 0x2971096D244C08A9, "scripts/cp/equipment/throwing_knife_cp.gsc" }, - { 0x13D36FE5666830E0, "scripts/cp/execution.gsc" }, - { 0x4F7F576DE1DCE67B, "scripts/cp/extraction/cp_extraction.gsc" }, - { 0x0DA52CED873B216E, "scripts/cp/factions/faction_progression.gsc" }, - { 0x1D156FFAA6303170, "scripts/cp/gestures_cp.gsc" }, - { 0x182955D3F35EB8F1, "scripts/cp/helicopter/chopper_boss.gsc" }, - { 0x11845DB74B81359F, "scripts/cp/helicopter/cp_helicopter.gsc" }, - { 0x72046D774C498C82, "scripts/cp/helicopter/utility.gsc" }, - { 0x37200B0B79C2EF45, "scripts/cp/infilexfil/blima_exfil.gsc" }, - { 0x78A156FE8BE93D79, "scripts/cp/infilexfil/cp_fulton.gsc" }, - { 0x19EE9AE3BB56EEDF, "scripts/cp/infilexfil/infilexfil.gsc" }, - { 0x15BE0F50D6E10D48, "scripts/cp/infilexfil/lbravo_infil_cp.gsc" }, - { 0x59861361D1C462C0, "scripts/cp/init_cp_mp.gsc" }, - { 0x762FABC1B3DB8E09, "scripts/cp/intel/cp_intel.gsc" }, - { 0x66B95516D39196A1, "scripts/cp/inventory/cp_ac130.gsc" }, - { 0x1D3630F1A437E071, "scripts/cp/inventory/cp_target_marker.gsc" }, - { 0x5D8F456289A1D209, "scripts/cp/killstreaks/airdrop_cp.gsc" }, - { 0x2D0318BFB4B92462, "scripts/cp/killstreaks/airdrop_multiple_cp.gsc" }, - { 0x41487CD704154DB4, "scripts/cp/killstreaks/airstrike_cp.gsc" }, - { 0x07615068E3C982AD, "scripts/cp/killstreaks/chopper_gunner_cp.gsc" }, - { 0x24414BB83B2F2627, "scripts/cp/killstreaks/chopper_support_cp.gsc" }, - { 0x75EF61B8FA1851D7, "scripts/cp/killstreaks/cruise_predator_cp.gsc" }, - { 0x5C331B181262E30F, "scripts/cp/killstreaks/emp_drone_cp.gsc" }, - { 0x38D20730D37456E8, "scripts/cp/killstreaks/emp_drone_targeted_cp.gsc" }, - { 0x2B368CB92B87ABCA, "scripts/cp/killstreaks/gunship_cp.gsc" }, - { 0x66BFF03F5F3A9627, "scripts/cp/killstreaks/helper_drone_cp.gsc" }, - { 0x20E2F9F4FDAFF8BE, "scripts/cp/killstreaks/init_cp.gsc" }, - { 0x62761DCD7830BB44, "scripts/cp/killstreaks/juggernaut_cp.gsc" }, - { 0x379BB8C3760185C1, "scripts/cp/killstreaks/manual_turret_cp.gsc" }, - { 0x617CD7DACAE8B0AF, "scripts/cp/killstreaks/nuke_cp.gsc" }, - { 0x3FDC0D8E4813F83E, "scripts/cp/killstreaks/sentry_gun_cp.gsc" }, - { 0x48C42FBBA757D4C0, "scripts/cp/killstreaks/toma_strike_cp.gsc" }, - { 0x6E23C318CA220FA2, "scripts/cp/killstreaks/uav_cp.gsc" }, - { 0x616AC24964989CC7, "scripts/cp/killstreaks/white_phosphorus_cp.gsc" }, - { 0x555547ED1870372D, "scripts/cp/laser_traps/cp_laser_traps.gsc" }, - { 0x6A0B0E660F7EDB04, "scripts/cp/loot_system.gsc" }, - { 0x7E9D90E98B1AE85B, "scripts/cp/perks/cp_perk_utility.gsc" }, - { 0x37F000531EFB9D03, "scripts/cp/perks/cp_perks.gsc" }, - { 0x63407818698EE089, "scripts/cp/perks/cp_prestige.gsc" }, - { 0x057EC8322297A84E, "scripts/cp/pingcallout_cp.gsc" }, - { 0x502187EE15ADB8B1, "scripts/cp/powers/coop_molotov.gsc" }, - { 0x44A1A202E6133294, "scripts/cp/powers/cp_tactical_cover.gsc" }, - { 0x2D28088944F7766D, "scripts/cp/pvpe/pvpe.gsc" }, - { 0x0E4F3E49398FDBE5, "scripts/cp/pvpve/pvpve.gsc" }, - { 0x2837C33EF529314B, "scripts/cp/radio_tower/cp_radio_tower.gsc" }, - { 0x66FFCF39AE863223, "scripts/cp/raid_utility.gsc" }, - { 0x3BFD40AADA1034F6, "scripts/cp/respawn/cp_ac130_respawn.gsc" }, - { 0x28290868030F4DAD, "scripts/cp/respawn/cp_respawn.gsc" }, - { 0x537196C25A85B8A3, "scripts/cp/scriptable.gsc" }, - { 0x267AE50D73BFF6EE, "scripts/cp/so_globallogic.gsc" }, - { 0x494B527121EA82C5, "scripts/cp/so_laststand.gsc" }, - { 0x4CAE33BC187465E1, "scripts/cp/so_trigger.gsc" }, - { 0x5EF6C5C3AFDBA79D, "scripts/cp/so_utility.gsc" }, - { 0x62B2946CC63C0E99, "scripts/cp/so_utility_code.gsc" }, - { 0x48A12E277630CD65, "scripts/cp/stealth/manager.gsc" }, - { 0x15CAA49E8AB60CD8, "scripts/cp/survival/survival_loadout.gsc" }, - { 0x18E0E81A33DEC69E, "scripts/cp/tripwire_cp.gsc" }, - { 0x704D66AFC508AC3A, "scripts/cp/utility.gsc" }, - { 0x0AC80AB8D0901385, "scripts/cp/utility/auto_ascender_ai.gsc" }, - { 0x22598C6DFF6DBD60, "scripts/cp/utility/cp_controlled_callbacks.gsc" }, - { 0x10D8EB6F75795C29, "scripts/cp/utility/cp_safehouse_util.gsc" }, - { 0x428ADA98EB353632, "scripts/cp/utility/disconnect_event_aggregator.gsc" }, - { 0x2E7F32867417B1F6, "scripts/cp/utility/entity.gsc" }, - { 0x137A641CADC5DF20, "scripts/cp/utility/game_utility_cp.gsc" }, - { 0x71E60CC0B80CD0C5, "scripts/cp/utility/join_team_aggregator.gsc" }, - { 0x541F624691B67877, "scripts/cp/utility/lui_game_event_aggregator.gsc" }, - { 0x0B32BD37527ED5D0, "scripts/cp/utility/player.gsc" }, - { 0x667E082B97EDF486, "scripts/cp/utility/player_frame_update_aggregator.gsc" }, - { 0x4C9CFAABC41E2549, "scripts/cp/utility/player_utility_cp.gsc" }, - { 0x406B1E63095AC90E, "scripts/cp/utility/script.gsc" }, - { 0x1D00ED5404824759, "scripts/cp/utility/spawn_event_aggregator.gsc" }, - { 0x1A988F4238CC134A, "scripts/cp/vehicle.gsc" }, - { 0x3D3EEA27753FAC8D, "scripts/cp/vehicle_push/coop_vehicle_push.gsc" }, - { 0x0C8738F5E61AA3AD, "scripts/cp/vehicle_race/coop_vehicle_race.gsc" }, - { 0x1314F8CA41250C97, "scripts/cp/vehicles/apc_rus_cp.gsc" }, - { 0x7C1DC9B75012D20D, "scripts/cp/vehicles/atv_cp.gsc" }, - { 0x7E563E37F833241C, "scripts/cp/vehicles/big_bird_cp.gsc" }, - { 0x2D7CCD517FA86B5E, "scripts/cp/vehicles/cargo_truck_cp.gsc" }, - { 0x7E1F90B8FCC90D4B, "scripts/cp/vehicles/cargo_truck_mg_cp.gsc" }, - { 0x7F25952EB846B8E7, "scripts/cp/vehicles/cop_car_cp.gsc" }, - { 0x2587FE3CA828F536, "scripts/cp/vehicles/cp_heli_trip.gsc" }, - { 0x5D1664FAC671C656, "scripts/cp/vehicles/cp_helicopter_mi8.gsc" }, - { 0x30D9B647A58A56EF, "scripts/cp/vehicles/damage_cp.gsc" }, - { 0x1B2D7444824E829F, "scripts/cp/vehicles/hoopty_cp.gsc" }, - { 0x414B805680AEA797, "scripts/cp/vehicles/hoopty_truck_cp.gsc" }, - { 0x7917E328F45F245C, "scripts/cp/vehicles/jeep_cp.gsc" }, - { 0x4BFB17F9785E3B09, "scripts/cp/vehicles/large_transport_cp.gsc" }, - { 0x74469C864FA3300F, "scripts/cp/vehicles/light_tank_cp.gsc" }, - { 0x15E9979C98CB018C, "scripts/cp/vehicles/little_bird_cp.gsc" }, - { 0x2755B9F0595CAD15, "scripts/cp/vehicles/little_bird_mg_cp.gsc" }, - { 0x714C6548AB77A9D2, "scripts/cp/vehicles/med_transport_cp.gsc" }, - { 0x48462C9702C7F928, "scripts/cp/vehicles/pickup_truck_cp.gsc" }, - { 0x14993A596C0F22BB, "scripts/cp/vehicles/tac_rover_cp.gsc" }, - { 0x2D9DAB3C26B8A7AF, "scripts/cp/vehicles/technical_cp.gsc" }, - { 0x6EDB5C8081558415, "scripts/cp/vehicles/van_cp.gsc" }, - { 0x2B561C2CA275B62F, "scripts/cp/vehicles/vehicle_compass_cp.gsc" }, - { 0x09601F6FC1B3CDDA, "scripts/cp/vehicles/vehicle_cp.gsc" }, - { 0x4FBCA012BFA97E70, "scripts/cp/vehicles/vehicle_damage_cp.gsc" }, - { 0x394EEDA98D15D2C9, "scripts/cp/vehicles/vehicle_interact_cp.gsc" }, - { 0x1A436D415B296844, "scripts/cp/vehicles/vehicle_occupancy_cp.gsc" }, - { 0x08EA223C76EADE2B, "scripts/cp/vehicles/vehicle_oob_cp.gsc" }, - { 0x4510C91C8E5B6F12, "scripts/cp/vehicles/vehicle_spawn_cp.gsc" }, - { 0x6E2D0AB181B939D5, "scripts/cp/whizby.gsc" }, - { 0x5E5302BED1C9AB54, "scripts/cp/zombies/cp_consumables.gsc" }, - { 0x2AA3F2FD74992588, "scripts/cp/zombies/zombieclientmatchdata.gsc" }, - { 0x2B531F520DE8BE5D, "scripts/cp_mp/agents/agent_init.gsc" }, - { 0x21497CDFD058C796, "scripts/cp_mp/anim_scene.gsc" }, - { 0x057ECDF06AE2850F, "scripts/cp_mp/auto_ascender.gsc" }, - { 0x22C673C32C214B45, "scripts/cp_mp/auto_ascender_solo.gsc" }, - { 0x42B73095B90A5E40, "scripts/cp_mp/calloutmarkerping.gsc" }, - { 0x0EAACDDDEB82E2A2, "scripts/cp_mp/challenges.gsc" }, - { 0x610D10F06693A54C, "scripts/cp_mp/crossbow.gsc" }, - { 0x327F500C1192BBCC, "scripts/cp_mp/dragonsbreath.gsc" }, - { 0x310453FFD4B826CD, "scripts/cp_mp/emp_debuff.gsc" }, - { 0x34E0212BD6EB0B7B, "scripts/cp_mp/ent_manager.gsc" }, - { 0x58FDF2A4B13652E7, "scripts/cp_mp/entityheadicons.gsc" }, - { 0x59CAA65F7660D01F, "scripts/cp_mp/equipment/throwing_knife.gsc" }, - { 0x5CD95D34030AEF00, "scripts/cp_mp/execution.gsc" }, - { 0x0394B0216927D91B, "scripts/cp_mp/frontendutils.gsc" }, - { 0x79872B5D956B01EF, "scripts/cp_mp/gasmask.gsc" }, - { 0x068220E8E0090A70, "scripts/cp_mp/gestures.gsc" }, - { 0x4D92F0BDF2AE519C, "scripts/cp_mp/hostmigration.gsc" }, - { 0x3CBDD179351907FF, "scripts/cp_mp/killstreaks/airdrop.gsc" }, - { 0x29B9E1ED7F863326, "scripts/cp_mp/killstreaks/airdrop_multiple.gsc" }, - { 0x7EC888EDE02276A4, "scripts/cp_mp/killstreaks/airstrike.gsc" }, - { 0x3AFD0B936DD113D3, "scripts/cp_mp/killstreaks/chopper_gunner.gsc" }, - { 0x1A6122CD2AABBB81, "scripts/cp_mp/killstreaks/chopper_support.gsc" }, - { 0x493C15D9C046FE11, "scripts/cp_mp/killstreaks/cruise_predator.gsc" }, - { 0x12D33BE994A1E409, "scripts/cp_mp/killstreaks/emp_drone.gsc" }, - { 0x3D32F0014AE692A8, "scripts/cp_mp/killstreaks/emp_drone_targeted.gsc" }, - { 0x7B63B2C4EFF07F0E, "scripts/cp_mp/killstreaks/gunship.gsc" }, - { 0x796277B7D8384901, "scripts/cp_mp/killstreaks/helper_drone.gsc" }, - { 0x5D15FEFDE0156662, "scripts/cp_mp/killstreaks/init.gsc" }, - { 0x77A457A5D8F67854, "scripts/cp_mp/killstreaks/juggernaut.gsc" }, - { 0x5B79F7D46D6479DD, "scripts/cp_mp/killstreaks/killstreakdeploy.gsc" }, - { 0x37A6DF148102BC77, "scripts/cp_mp/killstreaks/manual_turret.gsc" }, - { 0x099B9AE87B9F00A9, "scripts/cp_mp/killstreaks/nuke.gsc" }, - { 0x319B26E5DA0E9AA2, "scripts/cp_mp/killstreaks/sentry_gun.gsc" }, - { 0x531984808E0A74E0, "scripts/cp_mp/killstreaks/toma_strike.gsc" }, - { 0x599E12F80C250C26, "scripts/cp_mp/killstreaks/uav.gsc" }, - { 0x4FA625E08B5F76E1, "scripts/cp_mp/killstreaks/white_phosphorus.gsc" }, - { 0x358A4C8214A89870, "scripts/cp_mp/mortar_launcher.gsc" }, - { 0x13D7519ECADA5FEA, "scripts/cp_mp/outofrange.gsc" }, - { 0x49863B206F5403F9, "scripts/cp_mp/parachute.gsc" }, - { 0x1762D7B022D62EC7, "scripts/cp_mp/pet_watch.gsc" }, - { 0x11C55E2B1FDB5952, "scripts/cp_mp/pingcallout.gsc" }, - { 0x67867A1F12BFFE59, "scripts/cp_mp/powershud.gsc" }, - { 0x3252C18D08B50FA7, "scripts/cp_mp/targetmarkergroups.gsc" }, - { 0x4F3E271314233182, "scripts/cp_mp/tripwire.gsc" }, - { 0x3E80883B1C2C99EA, "scripts/cp_mp/utility/callback_group.gsc" }, - { 0x530723981CD177B3, "scripts/cp_mp/utility/damage_utility.gsc" }, - { 0x725B0F2DCBE6355D, "scripts/cp_mp/utility/debug_utility.gsc" }, - { 0x2A1F65FFEC5045C2, "scripts/cp_mp/utility/dialog_utility.gsc" }, - { 0x6867234FFDC3D080, "scripts/cp_mp/utility/game_utility.gsc" }, - { 0x6067C167A3F99BBE, "scripts/cp_mp/utility/inventory_utility.gsc" }, - { 0x28B34FF40BDC5650, "scripts/cp_mp/utility/killstreak_utility.gsc" }, - { 0x2E16EF26A0FFD44D, "scripts/cp_mp/utility/omnvar_utility.gsc" }, - { 0x211923DEDCAFA6FF, "scripts/cp_mp/utility/player_utility.gsc" }, - { 0x629BF3BE88C38481, "scripts/cp_mp/utility/script_utility.gsc" }, - { 0x4ADB0DFC58C787C2, "scripts/cp_mp/utility/scriptable_door_utility.gsc" }, - { 0x4F467DF70D327452, "scripts/cp_mp/utility/shellshock_utility.gsc" }, - { 0x0AA432172D0E22B0, "scripts/cp_mp/utility/train_utility.gsc" }, - { 0x4B8FA1B777292D0C, "scripts/cp_mp/utility/vehicle_omnvar_utility.gsc" }, - { 0x1D0CF33B53E307AE, "scripts/cp_mp/utility/weapon_utility.gsc" }, - { 0x76C93B759C20A1D1, "scripts/cp_mp/vehicles/apc_rus.gsc" }, - { 0x75D95066D2C8F9B3, "scripts/cp_mp/vehicles/atv.gsc" }, - { 0x79BF3825A29C802C, "scripts/cp_mp/vehicles/big_bird.gsc" }, - { 0x36FD1BA91582B102, "scripts/cp_mp/vehicles/cargo_truck.gsc" }, - { 0x22B1DE31D2721635, "scripts/cp_mp/vehicles/cargo_truck_mg.gsc" }, - { 0x38D5E2DD897D3241, "scripts/cp_mp/vehicles/cop_car.gsc" }, - { 0x2E1B586227A20CEF, "scripts/cp_mp/vehicles/customization/battle_tracks.gsc" }, - { 0x22F5232830940339, "scripts/cp_mp/vehicles/hoopty.gsc" }, - { 0x3D00154BABB8D851, "scripts/cp_mp/vehicles/hoopty_truck.gsc" }, - { 0x67953482877E2F2C, "scripts/cp_mp/vehicles/jeep.gsc" }, - { 0x622D09A3F1D899BF, "scripts/cp_mp/vehicles/large_transport.gsc" }, - { 0x67E6850B771B9C89, "scripts/cp_mp/vehicles/light_tank.gsc" }, - { 0x4C822A64AB8A0BBC, "scripts/cp_mp/vehicles/little_bird.gsc" }, - { 0x664C60C6B4325FBB, "scripts/cp_mp/vehicles/little_bird_mg.gsc" }, - { 0x2C1C5D4D18A61876, "scripts/cp_mp/vehicles/med_transport.gsc" }, - { 0x1E06CF212F559628, "scripts/cp_mp/vehicles/pickup_truck.gsc" }, - { 0x4DA9787D96781405, "scripts/cp_mp/vehicles/tac_rover.gsc" }, - { 0x27C4FFEF9D1A1E29, "scripts/cp_mp/vehicles/technical.gsc" }, - { 0x7405E9F971AEA03B, "scripts/cp_mp/vehicles/van.gsc" }, - { 0x7584507A08593DFE, "scripts/cp_mp/vehicles/vehicle.gsc" }, - { 0x0873A961AAF63D09, "scripts/cp_mp/vehicles/vehicle_collision.gsc" }, - { 0x53DAF50CB5B28A69, "scripts/cp_mp/vehicles/vehicle_compass.gsc" }, - { 0x1971B0AC5B8846B0, "scripts/cp_mp/vehicles/vehicle_damage.gsc" }, - { 0x5457C66E69E57487, "scripts/cp_mp/vehicles/vehicle_dlog.gsc" }, - { 0x6AFAA0F7EB512CFF, "scripts/cp_mp/vehicles/vehicle_interact.gsc" }, - { 0x6695768C8D8C0AC9, "scripts/cp_mp/vehicles/vehicle_mines.gsc" }, - { 0x1C66378FB8B32394, "scripts/cp_mp/vehicles/vehicle_occupancy.gsc" }, - { 0x715D43F039E876B6, "scripts/cp_mp/vehicles/vehicle_spawn.gsc" }, - { 0x0A7D1715B70FF548, "scripts/cp_mp/vehicles/vehicle_tracking.gsc" }, - { 0x052407859F1EE32A, "scripts/cp_mp/xmike109.gsc" }, - { 0x26AEEAA01EAA6490, "scripts/engine/dev.gsc" }, - { 0x0EF47F6B12175664, "scripts/engine/flags.gsc" }, - { 0x00A3E73C9CCEAFB1, "scripts/engine/math.gsc" }, - { 0x1685AE0605A93B68, "scripts/engine/scriptable.gsc" }, - { 0x68C270174E9CD90F, "scripts/engine/scriptable_door.gsc" }, - { 0x43CD7D39C04B0B1B, "scripts/engine/sp/objectives.gsc" }, - { 0x63847839C2EB90CF, "scripts/engine/sp/utility.gsc" }, - { 0x1F8967BAF0600893, "scripts/engine/sp/utility_code.gsc" }, - { 0x062CEB051D758BFE, "scripts/engine/trace.gsc" }, - { 0x4A55403D502E794F, "scripts/engine/utility.gsc" }, - { 0x09E8FC39CD2F6663, "scripts/game/sp/door.gsc" }, - { 0x5E0DDEE0791E26CF, "scripts/game/sp/load.gsc" }, - { 0x700102F2560F3709, "scripts/game/sp/outline.gsc" }, - { 0x5EA18269586EF376, "scripts/game/sp/player.gsc" }, - { 0x0D957B719A00CC94, "scripts/game/sp/stealth/manager.gsc" }, - { 0x5B685ED8CE43EEC7, "scripts/game/sp/trigger.gsc" }, - { 0x36DAF6000B4D77F8, "scripts/models/interactive_utility.gsc" }, - { 0x64EACF6046BF3D0E, "scripts/mp/accessories.gsc" }, - { 0x13D14023C67003BF, "scripts/mp/accolades.gsc" }, - { 0x39F58EA1AAEC2704, "scripts/mp/agents/agent_common.gsc" }, - { 0x2DF9D011999F18C5, "scripts/mp/agents/agent_utility.gsc" }, - { 0x069E2E8BEBE24A71, "scripts/mp/agents/agents.gsc" }, - { 0x1BBD73F73D2EF1B9, "scripts/mp/agents/alien/agents.gsc" }, - { 0x4CB10753200A48D0, "scripts/mp/agents/juggernaut/juggernaut_agent.gsc" }, - { 0x76A7F3AEE85CD833, "scripts/mp/agents/scriptedagents.gsc" }, - { 0x203A40177CB16AD2, "scripts/mp/agents/soldier/soldier_agent.gsc" }, - { 0x099823E985D28A2A, "scripts/mp/agents/suicidebomber/suicidebomber_agent.gsc" }, - { 0x774A3800757E6127, "scripts/mp/ammorestock.gsc" }, - { 0x6451646090824DA0, "scripts/mp/analyticslog.gsc" }, - { 0x73B60289C107FA07, "scripts/mp/anim.gsc" }, - { 0x5C483C780DB0B4AD, "scripts/mp/animatedmodels.gsc" }, - { 0x036E9988C3BE2565, "scripts/mp/animation_suite.gsc" }, - { 0x5FED28AD3185123C, "scripts/mp/arbitrary_up.gsc" }, - { 0x69A005BA63022C32, "scripts/mp/archetypes/archassault.gsc" }, - { 0x344756288E55ECDC, "scripts/mp/archetypes/archcommon.gsc" }, - { 0x46CF841695574F2A, "scripts/mp/areas.gsc" }, - { 0x1582197658C00E0F, "scripts/mp/arm_objectives/arm_obj_capture.gsc" }, - { 0x0BB3B3FCF1E71C68, "scripts/mp/arm_objectives/arm_obj_nuke.gsc" }, - { 0x31FCFD26E002B5AD, "scripts/mp/art.gsc" }, - { 0x2CC9B45597129EE2, "scripts/mp/audio.gsc" }, - { 0x699319EBB3058664, "scripts/mp/awards.gsc" }, - { 0x09002E3F894F958F, "scripts/mp/battlechatter_mp.gsc" }, - { 0x2AE8954A31D1803F, "scripts/mp/battlechatter_trigs.gsc" }, - { 0x266C7A1B794E081D, "scripts/mp/bots/bots.gsc" }, - { 0x347C8A067853B721, "scripts/mp/bots/bots_killstreaks.gsc" }, - { 0x6D3FF989D9009D95, "scripts/mp/bots/bots_killstreaks_remote_vehicle.gsc" }, - { 0x715B1AE771EA5B66, "scripts/mp/bots/bots_loadout.gsc" }, - { 0x1AAA79412E7BC206, "scripts/mp/bots/bots_personality.gsc" }, - { 0x60842FAF6B334477, "scripts/mp/bots/bots_sentry.gsc" }, - { 0x4145A7B3D8867DC9, "scripts/mp/bots/bots_strategy.gsc" }, - { 0x6A4DD5B41C09D1DC, "scripts/mp/bots/bots_util.gsc" }, - { 0x2205C1B16EDB84F5, "scripts/mp/bounty.gsc" }, - { 0x6748E0ED34B820E0, "scripts/mp/brclientmatchdata.gsc" }, - { 0x4D6081907AE68B01, "scripts/mp/brmatchdata.gsc" }, - { 0x47E0A020EF1BD449, "scripts/mp/broshot.gsc" }, - { 0x78985E1693DBFC76, "scripts/mp/broshot_utilities.gsc" }, - { 0x22FC1806B758E28C, "scripts/mp/callbacksetup.gsc" }, - { 0x235CCFCBDDE6F11C, "scripts/mp/calloutmarkerping_mp.gsc" }, - { 0x7001F79CFE5FF18F, "scripts/mp/callouts.gsc" }, - { 0x2FC321D925A41E8F, "scripts/mp/carriable.gsc" }, - { 0x5035FF3B2CDC2C78, "scripts/mp/challengefunctions.gsc" }, - { 0x1576A58623076050, "scripts/mp/challenges.gsc" }, - { 0x403A175F4355A4D6, "scripts/mp/challenges_mp.gsc" }, - { 0x366CA3A566B6972B, "scripts/mp/cinematic_replays/cinematic_replays.gsc" }, - { 0x062B082B02843BE8, "scripts/mp/class.gsc" }, - { 0x6256D4509C1489D0, "scripts/mp/clientmatchdata.gsc" }, - { 0x5BBC3347BA096E70, "scripts/mp/codcasterclientmatchdata.gsc" }, - { 0x054823A29593228C, "scripts/mp/compass.gsc" }, - { 0x6CA75CE7FE1AAC52, "scripts/mp/cranked.gsc" }, - { 0x515715367B555558, "scripts/mp/createfx.gsc" }, - { 0x4C9F3A24FEABDE1F, "scripts/mp/damage.gsc" }, - { 0x0AB66257F363A87C, "scripts/mp/damagefeedback.gsc" }, - { 0x706E421915FE0EC2, "scripts/mp/deathicons.gsc" }, - { 0x08B0AE017A7B271D, "scripts/mp/dedicated.gsc" }, - { 0x7AD2C20674B3130B, "scripts/mp/destructables.gsc" }, - { 0x2DCD44765B157D94, "scripts/mp/destructible.gsc" }, - { 0x7262B27DE233448F, "scripts/mp/dev.gsc" }, - { 0x578FB8CED8601826, "scripts/mp/door.gsc" }, - { 0x0091857B22BC390B, "scripts/mp/emp_debuff_mp.gsc" }, - { 0x6B0663A111030B30, "scripts/mp/equipment.gsc" }, - { 0x5195DCD5F2C7BAA0, "scripts/mp/equipment/adrenaline.gsc" }, - { 0x6220E12CD13C3ED3, "scripts/mp/equipment/advanced_supply_drop.gsc" }, - { 0x34501F9ECF90E137, "scripts/mp/equipment/ammo_box.gsc" }, - { 0x45459AD0B3175243, "scripts/mp/equipment/armor_plate.gsc" }, - { 0x55FA19D619695CBA, "scripts/mp/equipment/at_mine.gsc" }, - { 0x7A2AF52457AE0749, "scripts/mp/equipment/bandage.gsc" }, - { 0x7D848B7984C32341, "scripts/mp/equipment/binoculars.gsc" }, - { 0x107FE0BE820063D4, "scripts/mp/equipment/c4.gsc" }, - { 0x2C9121F81520D673, "scripts/mp/equipment/claymore.gsc" }, - { 0x51568199B1AF4A56, "scripts/mp/equipment/concussion_grenade.gsc" }, - { 0x1D31961E095E6EF6, "scripts/mp/equipment/decoy_grenade.gsc" }, - { 0x40B914EACAA3AA0C, "scripts/mp/equipment/emp_grenade.gsc" }, - { 0x1EDC017AA10C8CBC, "scripts/mp/equipment/flash_grenade.gsc" }, - { 0x5E747F703EDB679F, "scripts/mp/equipment/fulton.gsc" }, - { 0x7373E282602728FB, "scripts/mp/equipment/gas_grenade.gsc" }, - { 0x17E1C85F6522B03E, "scripts/mp/equipment/hb_sensor.gsc" }, - { 0x36BC9A97851A00C1, "scripts/mp/equipment/molotov.gsc" }, - { 0x356D29B50E0D748A, "scripts/mp/equipment/nvg.gsc" }, - { 0x1975B2A6D9277F52, "scripts/mp/equipment/snapshot_grenade.gsc" }, - { 0x6BD6931761011BDE, "scripts/mp/equipment/support_box.gsc" }, - { 0x62E0B7188E7534AB, "scripts/mp/equipment/tac_insert.gsc" }, - { 0x0E6F637D07D400CA, "scripts/mp/equipment/tactical_cover.gsc" }, - { 0x7624ADA505D2A7AD, "scripts/mp/equipment/thermite.gsc" }, - { 0x4FFAF2388B3485F9, "scripts/mp/equipment/throwing_knife_mp.gsc" }, - { 0x384F37134A7FC089, "scripts/mp/equipment/trophy_system.gsc" }, - { 0x72525C7AD16B9DBF, "scripts/mp/equipment/weapon_drop.gsc" }, - { 0x08BAE979BBAB4744, "scripts/mp/equipment/wristrocket.gsc" }, - { 0x58D07AF23A255EDD, "scripts/mp/equipment_interact.gsc" }, - { 0x66CF1FB5A503DC23, "scripts/mp/events.gsc" }, - { 0x70E69A9871881054, "scripts/mp/execution_mp.gsc" }, - { 0x6C56BE85DC248D98, "scripts/mp/final_killcam.gsc" }, - { 0x778027EDF01BD587, "scripts/mp/flags.gsc" }, - { 0x2652A8D02E4D8616, "scripts/mp/flashpoint.gsc" }, - { 0x4B4D37F69AE2EE32, "scripts/mp/friendicons.gsc" }, - { 0x706C46647D245B88, "scripts/mp/fx.gsc" }, - { 0x184C00AF74E45F30, "scripts/mp/gamelogic.gsc" }, - { 0x08EB711E37ED0AFA, "scripts/mp/gameobjects.gsc" }, - { 0x267A69C97E3C6C7C, "scripts/mp/gamescore.gsc" }, - { 0x6A8018994EBC5564, "scripts/mp/gestures_mp.gsc" }, - { 0x5411D5BC326E2B16, "scripts/mp/global_fx.gsc" }, - { 0x650FA6593ACFEE24, "scripts/mp/global_fx_code.gsc" }, - { 0x60BE114DF57C78E6, "scripts/mp/globalentities.gsc" }, - { 0x3FA219AD83E2CEBB, "scripts/mp/globallogic.gsc" }, - { 0x6FC56E06DD73EFE6, "scripts/mp/healthoverlay.gsc" }, - { 0x5242C074CD388A30, "scripts/mp/heavyarmor.gsc" }, - { 0x35B1921537324436, "scripts/mp/hostmigration.gsc" }, - { 0x026F0756F77CFCFD, "scripts/mp/hud.gsc" }, - { 0x52A6D55588CB0819, "scripts/mp/hud_message.gsc" }, - { 0x64AFAE76CCB166FC, "scripts/mp/hud_util.gsc" }, - { 0x462BDA75FFA6B33D, "scripts/mp/infilexfil/infilexfil.gsc" }, - { 0x42BAB28F5AE5F14E, "scripts/mp/infilexfil/lbravo_infil.gsc" }, - { 0x734ED556D535A69C, "scripts/mp/infilexfil/mi8_infil.gsc" }, - { 0x6B0802F0AC29060A, "scripts/mp/infilexfil/rappel_hackney_infil.gsc" }, - { 0x21333AE88F67B6A6, "scripts/mp/infilexfil/tango72_infil.gsc" }, - { 0x4CEDFC60057078BB, "scripts/mp/infilexfil/umike_infil.gsc" }, - { 0x6EE7F325AE4106A3, "scripts/mp/infilexfil/van_hackney_infil.gsc" }, - { 0x062B0889104A0D53, "scripts/mp/infilexfil/vindia_infil.gsc" }, - { 0x116CEABE045DE636, "scripts/mp/init_cp_mp.gsc" }, - { 0x61785096CD84035F, "scripts/mp/javelin.gsc" }, - { 0x1B31527B4E9781D2, "scripts/mp/juggernaut.gsc" }, - { 0x5732201DEF3A65C7, "scripts/mp/killcam.gsc" }, - { 0x32F367E853EFE0D6, "scripts/mp/killstreaks/agent_killstreak.gsc" }, - { 0x731DAAA368B23D4D, "scripts/mp/killstreaks/airdrop_mp.gsc" }, - { 0x1966DFCBD2D268D2, "scripts/mp/killstreaks/airdrop_multiple_mp.gsc" }, - { 0x5EB2D51A1D6C552C, "scripts/mp/killstreaks/airstrike_mp.gsc" }, - { 0x6FF86FEE6AED42AE, "scripts/mp/killstreaks/autosentry.gsc" }, - { 0x6D49F8837731F254, "scripts/mp/killstreaks/chill_common.gsc" }, - { 0x418B7A968E4F7C79, "scripts/mp/killstreaks/chopper_gunner_mp.gsc" }, - { 0x6B4907D1FFFDCE37, "scripts/mp/killstreaks/chopper_support_mp.gsc" }, - { 0x34FF41F4B3FA424F, "scripts/mp/killstreaks/cruise_predator_mp.gsc" }, - { 0x53BB6FF768A47B95, "scripts/mp/killstreaks/death_switch.gsc" }, - { 0x08AFBBC16473D488, "scripts/mp/killstreaks/deployablebox.gsc" }, - { 0x31463F34A13101FD, "scripts/mp/killstreaks/deployablebox_vest.gsc" }, - { 0x37BB89B7C584D340, "scripts/mp/killstreaks/dronehive.gsc" }, - { 0x10662A1ACF0EBE7E, "scripts/mp/killstreaks/emp.gsc" }, - { 0x2F7C1B498F830663, "scripts/mp/killstreaks/emp_drone_mp.gsc" }, - { 0x64C3321543BBEFD8, "scripts/mp/killstreaks/emp_drone_targeted_mp.gsc" }, - { 0x2FF254B9E27B9387, "scripts/mp/killstreaks/flares.gsc" }, - { 0x465B9DE35EFC49F2, "scripts/mp/killstreaks/gunship_mp.gsc" }, - { 0x300A0A4C67DA0BBB, "scripts/mp/killstreaks/helicopter.gsc" }, - { 0x44C9AA44134DB592, "scripts/mp/killstreaks/helicopter_pilot.gsc" }, - { 0x250950A7F930FE33, "scripts/mp/killstreaks/helper_drone.gsc" }, - { 0x7D681FCF8E7487F3, "scripts/mp/killstreaks/helper_drone_mp.gsc" }, - { 0x7D5D18083C3669C2, "scripts/mp/killstreaks/hover_jet.gsc" }, - { 0x54B4BE63F861801A, "scripts/mp/killstreaks/init_mp.gsc" }, - { 0x3406DC94C9535A80, "scripts/mp/killstreaks/jackal.gsc" }, - { 0x41D9F3E9C0FED124, "scripts/mp/killstreaks/juggernaut_mp.gsc" }, - { 0x380B66B9CD34D48B, "scripts/mp/killstreaks/killstreaks.gsc" }, - { 0x1272B945C902B191, "scripts/mp/killstreaks/manual_turret_mp.gsc" }, - { 0x0DABA2E9A8350242, "scripts/mp/killstreaks/mapselect.gsc" }, - { 0x0C4EEB121BA27B97, "scripts/mp/killstreaks/nuke.gsc" }, - { 0x6737E57A4723484F, "scripts/mp/killstreaks/nuke_mp.gsc" }, - { 0x1636BB4817605A4F, "scripts/mp/killstreaks/placeable.gsc" }, - { 0x693AF273776F420A, "scripts/mp/killstreaks/plane.gsc" }, - { 0x56F2DCFF53F2245F, "scripts/mp/killstreaks/proxyagent.gsc" }, - { 0x3DA7B46BA89E263E, "scripts/mp/killstreaks/remotemissile.gsc" }, - { 0x5174EF0A925C8314, "scripts/mp/killstreaks/remotetank.gsc" }, - { 0x3D9FB1EE60CBAD42, "scripts/mp/killstreaks/remoteturret.gsc" }, - { 0x21B311364005EBAA, "scripts/mp/killstreaks/remoteuav.gsc" }, - { 0x57AB0F132F2DA29E, "scripts/mp/killstreaks/sentry_gun_mp.gsc" }, - { 0x2458F30EAB0498D8, "scripts/mp/killstreaks/target_marker.gsc" }, - { 0x04A9FF33C9C66EC4, "scripts/mp/killstreaks/throwback_marker.gsc" }, - { 0x3D049B8395ABB6E4, "scripts/mp/killstreaks/toma_strike_mp.gsc" }, - { 0x19EC0FE0C3415CA2, "scripts/mp/killstreaks/uav_mp.gsc" }, - { 0x3DCF889324D28903, "scripts/mp/killstreaks/white_phosphorus_mp.gsc" }, - { 0x08C8E132AF264960, "scripts/mp/laststand.gsc" }, - { 0x7F22DB280E8CC6C9, "scripts/mp/launcher_target_lead.gsc" }, - { 0x3C56D7D289AAAF81, "scripts/mp/lightarmor.gsc" }, - { 0x21F4499C4ABFF7BF, "scripts/mp/lightbar.gsc" }, - { 0x7D419D1DFD062946, "scripts/mp/load.gsc" }, - { 0x5CEFBBF3A6A9A8B0, "scripts/mp/loot.gsc" }, - { 0x6FEFACA85CCC3691, "scripts/mp/matchdata.gsc" }, - { 0x59A28AA393C6BB32, "scripts/mp/matchrecording.gsc" }, - { 0x3AFE00DA9A5BB422, "scripts/mp/matchstats.gsc" }, - { 0x498B9015FC4A2548, "scripts/mp/menus.gsc" }, - { 0x16B87C6B95574BD0, "scripts/mp/minefields.gsc" }, - { 0x3317E070395BD534, "scripts/mp/missilelauncher.gsc" }, - { 0x3931ECB959834BBD, "scripts/mp/motiondetectors.gsc" }, - { 0x5A11116778A6D864, "scripts/mp/movers.gsc" }, - { 0x4DB5D44A376C1C35, "scripts/mp/mp_agent.gsc" }, - { 0x7AF5DD2BC2CC926D, "scripts/mp/mp_agent_damage.gsc" }, - { 0x37397E0B9CA7C1D8, "scripts/mp/music_and_dialog.gsc" }, - { 0x5C0063AB6B81303F, "scripts/mp/objidpoolmanager.gsc" }, - { 0x73B96343B87E992A, "scripts/mp/objpoints.gsc" }, - { 0x66D1063967FA26FA, "scripts/mp/outline.gsc" }, - { 0x125E1DE662C614BC, "scripts/mp/outofbounds.gsc" }, - { 0x6F3C39F8B9544B50, "scripts/mp/passives.gsc" }, - { 0x7B33D78CAC102B89, "scripts/mp/perks/headgear.gsc" }, - { 0x65682009E2287F13, "scripts/mp/perks/perk_equipmentping.gsc" }, - { 0x4B3976A0DF8B09A3, "scripts/mp/perks/perk_mark_targets.gsc" }, - { 0x594C46BDBBC57CA3, "scripts/mp/perks/perkfunctions.gsc" }, - { 0x4F61C97BBA28F546, "scripts/mp/perks/perkpackage.gsc" }, - { 0x52B5F3FAED29F517, "scripts/mp/perks/perks.gsc" }, - { 0x1FC5765DB46366C6, "scripts/mp/perks/weaponpassives.gsc" }, - { 0x7283136DAF802C53, "scripts/mp/persistence.gsc" }, - { 0x10E7A93D981318CA, "scripts/mp/pingcallout_mp.gsc" }, - { 0x1C8476F56CBCD27C, "scripts/mp/playeractions.gsc" }, - { 0x6F294F32B60C71F4, "scripts/mp/playercards.gsc" }, - { 0x344020C171EC72D5, "scripts/mp/playerlogic.gsc" }, - { 0x35E7732D85CF4FB4, "scripts/mp/playerstats.gsc" }, - { 0x28264B40CEFBE224, "scripts/mp/playerstats_interface.gsc" }, - { 0x71CDF59D18E9F382, "scripts/mp/potg.gsc" }, - { 0x22085D5A2D267F34, "scripts/mp/potg_events.gsc" }, - { 0x5CCC4374F6C041E3, "scripts/mp/radiation.gsc" }, - { 0x1BF41126054F4E1D, "scripts/mp/rally_point.gsc" }, - { 0x5B79F5CE7E653825, "scripts/mp/rangefinder.gsc" }, - { 0x5CD1439734C434DC, "scripts/mp/rank.gsc" }, - { 0x0C5ABF1CDB1BB1A5, "scripts/mp/riotshield.gsc" }, - { 0x16617DE231BF5280, "scripts/mp/scoreboard.gsc" }, - { 0x6ECD08699CCB09B5, "scripts/mp/screenshotcity.gsc" }, - { 0x525CD9B94F8850C1, "scripts/mp/scriptable.gsc" }, - { 0x36B0C9C343A37CC3, "scripts/mp/secrethunt.gsc" }, - { 0x7911684723811DF3, "scripts/mp/sentientpoolmanager.gsc" }, - { 0x12971CEBDD7FFF70, "scripts/mp/serversettings.gsc" }, - { 0x374464F426BC84E2, "scripts/mp/shellshock.gsc" }, - { 0x27C5D22C922F2128, "scripts/mp/spawncamera.gsc" }, - { 0x4590A825A33E1804, "scripts/mp/spawnfactor.gsc" }, - { 0x6024AD55E5032489, "scripts/mp/spawnlogic.gsc" }, - { 0x0C46589F289D961A, "scripts/mp/spawnscoring.gsc" }, - { 0x08F3CB4DBABAE3A5, "scripts/mp/spawnselection.gsc" }, - { 0x10107DC25F5BD62E, "scripts/mp/spectating.gsc" }, - { 0x2F2F0B2412213D7A, "scripts/mp/subway/fast_travel_subway_car.gsc" }, - { 0x037052EFEC602BD0, "scripts/mp/subway/fast_travel_subway_station.gsc" }, - { 0x4FCA32F463C5E4FA, "scripts/mp/supers.gsc" }, - { 0x57886B1B2348AA4E, "scripts/mp/supers/laststand_heal.gsc" }, - { 0x648662AC64713336, "scripts/mp/supers/spawnbeacon.gsc" }, - { 0x1E5E1BFD8FA7E030, "scripts/mp/supers/super_deadsilence.gsc" }, - { 0x09711BB6E8ABDC00, "scripts/mp/supers/super_stoppingpower.gsc" }, - { 0x0BB2B63F19A7FA8E, "scripts/mp/tac_ops/hostage_utility.gsc" }, - { 0x4EAAC25F24AF4921, "scripts/mp/tac_ops/hvt_utility.gsc" }, - { 0x3DADDE2C4C9D2D5C, "scripts/mp/tac_ops/radio_utility.gsc" }, - { 0x3321FCDA17B126B6, "scripts/mp/tac_ops/roles_utility.gsc" }, - { 0x78DE14F10227476E, "scripts/mp/tac_ops_map.gsc" }, - { 0x57D62CB7DDC6066A, "scripts/mp/teamrevive.gsc" }, - { 0x18A132AEEE23136E, "scripts/mp/teams.gsc" }, - { 0x5AE66D06F20630A9, "scripts/mp/trials/mp_cave_am_create_script.gsc" }, - { 0x28FDBC01EA4D3110, "scripts/mp/trials/mp_emporium_create_script_floorislava.gsc" }, - { 0x1CB7E984BFB2488C, "scripts/mp/trials/mp_euphrates_create_script.gsc" }, - { 0x146CF05CA89271EB, "scripts/mp/trials/mp_euphrates_create_script_gunnonlinear.gsc" }, - { 0x16D75E0530ECE1EE, "scripts/mp/trials/mp_harbor_floorislava_create_script.gsc" }, - { 0x6977064AFBA29D1A, "scripts/mp/trials/mp_m_cornfield_floor_is_lava_create_script.gsc" }, - { 0x5AF91DAD24C6122C, "scripts/mp/trials/mp_m_king_create_script.gsc" }, - { 0x4CF1D51227BEDB38, "scripts/mp/trials/mp_m_trench_create_script_gunnonlinear.gsc" }, - { 0x2A4BF9C81FFB99CD, "scripts/mp/trials/mp_oilrig_create_script.gsc" }, - { 0x0A19E4D5955D28E9, "scripts/mp/trials/mp_t_reflex_create_script_quadrace.gsc" }, - { 0x560D4B5E8DCB4FBB, "scripts/mp/trials/mp_trial_helicopter_port_create_a_script.gsc" }, - { 0x758374748F03BA22, "scripts/mp/trials/mp_trials_patches.gsc" }, - { 0x01A0AEA59EE8415F, "scripts/mp/trials/mp_trials_patches_petrograd.gsc" }, - { 0x32F57BF21B863A72, "scripts/mp/trials/mp_trl_boneyard_gw_race.gsc" }, - { 0x7CEF55681AF4328D, "scripts/mp/trials/mp_trl_cleararea.gsc" }, - { 0x7BD04BF9AB7DA819, "scripts/mp/trials/mp_trl_create_a_script_race_euphrates.gsc" }, - { 0x70150D6A872B30AB, "scripts/mp/trials/mp_trl_destroy.gsc" }, - { 0x701C8CAC53E33D3D, "scripts/mp/trials/mp_trl_floorislava.gsc" }, - { 0x48DCA902ACA6E531, "scripts/mp/trials/mp_trl_gunslinger.gsc" }, - { 0x4BAFEADA1AF601F4, "scripts/mp/trials/mp_trl_gunslinger_crash_create_script.gsc" }, - { 0x6AE1A60E4389B2B2, "scripts/mp/trials/mp_trl_gunslinger_knife_create_script.gsc" }, - { 0x1F5F365E79A4CB06, "scripts/mp/trials/mp_trl_gunslinger_memory_create_script.gsc" }, - { 0x2A458B918FBEE4BD, "scripts/mp/trials/mp_trl_quarry_raceislava_trial_create_a_script.gsc" }, - { 0x1B7097EC3A830F81, "scripts/mp/trials/trial_arm_course.gsc" }, - { 0x755511650CD06136, "scripts/mp/trials/trial_enemy_sentry_turret.gsc" }, - { 0x52EF15C2A99B4FA5, "scripts/mp/trials/trial_gun_course.gsc" }, - { 0x555A14CE795197B8, "scripts/mp/trials/trial_jugg.gsc" }, - { 0x7F0B6B5CE716473A, "scripts/mp/trials/trial_pitcher.gsc" }, - { 0x2BBBC965F1309702, "scripts/mp/trials/trial_race.gsc" }, - { 0x18B92FCB75257F1C, "scripts/mp/trials/trial_sniper.gsc" }, - { 0x69E30AD84737C849, "scripts/mp/trials/trial_target_utility.gsc" }, - { 0x1806953AC216FC93, "scripts/mp/trials/trial_utility.gsc" }, - { 0x6595ED698585F630, "scripts/mp/turret.gsc" }, - { 0x546166D9A45E52AB, "scripts/mp/tweakables.gsc" }, - { 0x726F9C562FDFEA72, "scripts/mp/utility/damage.gsc" }, - { 0x68765C58AD964CD8, "scripts/mp/utility/debug.gsc" }, - { 0x5102C8E257A6D97F, "scripts/mp/utility/dialog.gsc" }, - { 0x65C8E60DC93B7808, "scripts/mp/utility/disconnect_event_aggregator.gsc" }, - { 0x53682FA3E19AB419, "scripts/mp/utility/dvars.gsc" }, - { 0x6CC9E656B7F35004, "scripts/mp/utility/entity.gsc" }, - { 0x2CE6AE9812D8AF5F, "scripts/mp/utility/equipment.gsc" }, - { 0x22A6A30CD2CAED85, "scripts/mp/utility/game.gsc" }, - { 0x5CCABDBD8A103980, "scripts/mp/utility/game_utility_mp.gsc" }, - { 0x346A8591FB832D05, "scripts/mp/utility/infilexfil.gsc" }, - { 0x5278688E19C483F3, "scripts/mp/utility/inventory.gsc" }, - { 0x5F5A6BED6ACC0B64, "scripts/mp/utility/join_squad_aggregator.gsc" }, - { 0x65D0191B88E1EAB3, "scripts/mp/utility/join_team_aggregator.gsc" }, - { 0x34BFC6AB4B788F91, "scripts/mp/utility/killstreak.gsc" }, - { 0x6D5439C109277E9A, "scripts/mp/utility/lower_message.gsc" }, - { 0x59D70D752E63BE95, "scripts/mp/utility/lui_game_event_aggregator.gsc" }, - { 0x382545849986FBC1, "scripts/mp/utility/outline.gsc" }, - { 0x749DAD28EFF4EEDB, "scripts/mp/utility/perk.gsc" }, - { 0x06849A875AF56E3E, "scripts/mp/utility/player.gsc" }, - { 0x2968631C69B98F88, "scripts/mp/utility/player_frame_update_aggregator.gsc" }, - { 0x655F3CC5D8227E98, "scripts/mp/utility/points.gsc" }, - { 0x443F13D5D348E548, "scripts/mp/utility/print.gsc" }, - { 0x0158CC290FA3E45C, "scripts/mp/utility/script.gsc" }, - { 0x5B1C34DC6525743C, "scripts/mp/utility/sound.gsc" }, - { 0x5A7FFCF1A1689317, "scripts/mp/utility/spawn_event_aggregator.gsc" }, - { 0x76CDBC7F46DC44F4, "scripts/mp/utility/stats.gsc" }, - { 0x0C388E97BB998325, "scripts/mp/utility/teams.gsc" }, - { 0x49F522925767314F, "scripts/mp/utility/trigger.gsc" }, - { 0x317DCAEF347397FD, "scripts/mp/utility/usability.gsc" }, - { 0x23EF6C1E2FC0A20F, "scripts/mp/utility/weapon.gsc" }, - { 0x57753F84D1563669, "scripts/mp/validation.gsc" }, - { 0x2AD5131D424A1D6F, "scripts/mp/vehicles/apc_rus_mp.gsc" }, - { 0x700290C5E608CF6D, "scripts/mp/vehicles/atv_mp.gsc" }, - { 0x5DD46724A68EA9E0, "scripts/mp/vehicles/big_bird_mp.gsc" }, - { 0x226CFA6284FF8DEF, "scripts/mp/vehicles/cargo_truck_mg_mp.gsc" }, - { 0x735ED6DE3271380E, "scripts/mp/vehicles/cargo_truck_mp.gsc" }, - { 0x40BB647A723C2CBB, "scripts/mp/vehicles/cop_car_mp.gsc" }, - { 0x67554F1A4F439EB7, "scripts/mp/vehicles/damage.gsc" }, - { 0x77520AD4056E9E6B, "scripts/mp/vehicles/hoopty_mp.gsc" }, - { 0x00F06430868A2143, "scripts/mp/vehicles/hoopty_truck_mp.gsc" }, - { 0x340B7EAF5002BD58, "scripts/mp/vehicles/jeep_mp.gsc" }, - { 0x5746D1CDFF1769B5, "scripts/mp/vehicles/large_transport_mp.gsc" }, - { 0x515CCBB057ACEED3, "scripts/mp/vehicles/light_tank_mp.gsc" }, - { 0x35C97E2C73946069, "scripts/mp/vehicles/little_bird_mg_mp.gsc" }, - { 0x4DCC21A5E61A448C, "scripts/mp/vehicles/little_bird_mp.gsc" }, - { 0x175B69D8F2B89D12, "scripts/mp/vehicles/med_transport_mp.gsc" }, - { 0x683AE4F9A5D01CA8, "scripts/mp/vehicles/pickup_truck_mp.gsc" }, - { 0x3C247B48F5F99B73, "scripts/mp/vehicles/tac_rover_mp.gsc" }, - { 0x1CE08BF2C58FB9BB, "scripts/mp/vehicles/technical_mp.gsc" }, - { 0x185E0BB2EA68BF11, "scripts/mp/vehicles/van_mp.gsc" }, - { 0x631F011549331C7B, "scripts/mp/vehicles/vehicle_compass_mp.gsc" }, - { 0x47DDC686CD783C08, "scripts/mp/vehicles/vehicle_damage_mp.gsc" }, - { 0x4D5CC7E7083AE661, "scripts/mp/vehicles/vehicle_interact_mp.gsc" }, - { 0x45161D316AB714FB, "scripts/mp/vehicles/vehicle_mines_mp.gsc" }, - { 0x19A564D17590E1BA, "scripts/mp/vehicles/vehicle_mp.gsc" }, - { 0x1222322394E3DDE0, "scripts/mp/vehicles/vehicle_occupancy_mp.gsc" }, - { 0x5D65FF68246F4EBB, "scripts/mp/vehicles/vehicle_oob_mp.gsc" }, - { 0x36B297F0D12A223A, "scripts/mp/vehicles/vehicle_spawn_mp.gsc" }, - { 0x0A1ACDAA4ABD9DAC, "scripts/mp/weaponrank.gsc" }, - { 0x64D6DB6054238125, "scripts/mp/weapons.gsc" }, - { 0x7CCBD586E3BAFF77, "scripts/mp/whizby.gsc" }, - { 0x5E0F9B34A9395449, "scripts/smartobjects/stealth_exposed_fire_up.gsc" }, - { 0x150FC9212F421DE4, "scripts/smartobjects/stealth_knock_off_30.gsc" }, - { 0x24674926856260DA, "scripts/smartobjects/stealth_knock_off_36.gsc" }, - { 0x4D3CEACA4AAD6CDD, "scripts/smartobjects/stealth_lean_table_30.gsc" }, - { 0x22D637BE981416F7, "scripts/smartobjects/stealth_lean_table_36.gsc" }, - { 0x71F7FA98864D18D8, "scripts/smartobjects/stealth_lean_table_l_30.gsc" }, - { 0x68442FBBEE7347B6, "scripts/smartobjects/stealth_lean_table_l_36.gsc" }, - { 0x51B544802610585A, "scripts/smartobjects/stealth_lean_table_r_30.gsc" }, - { 0x425DC47ACFF01564, "scripts/smartobjects/stealth_lean_table_r_36.gsc" }, - { 0x4E41300518E961AC, "scripts/smartobjects/stealth_lean_wall_l.gsc" }, - { 0x5D0EE174FC0B8A2A, "scripts/smartobjects/stealth_lean_wall_r.gsc" }, - { 0x659CA7FD38DEAF8F, "scripts/smartobjects/stealth_look_around.gsc" }, - { 0x5878CA794EDCBED6, "scripts/smartobjects/stealth_look_down.gsc" }, - { 0x4ED712F46A19B58E, "scripts/smartobjects/stealth_look_high.gsc" }, - { 0x53104E0B5F742530, "scripts/smartobjects/stealth_look_over.gsc" }, - { 0x1B332AFF743D3690, "scripts/smartobjects/stealth_look_under_10.gsc" }, - { 0x5DA43BCDA90B41E2, "scripts/smartobjects/stealth_look_under_30.gsc" }, - { 0x4F20BE7ABA0F15CF, "scripts/smartobjects/stealth_look_up.gsc" }, - { 0x6ADFF4313BF0028A, "scripts/smartobjects/stealth_rage_bash.gsc" }, - { 0x7020B6FE2D960C61, "scripts/smartobjects/stealth_rage_bash_l.gsc" }, - { 0x25A42FC67218C38B, "scripts/smartobjects/stealth_rage_bash_r.gsc" }, - { 0x715A1A96449870AA, "scripts/smartobjects/stealth_rage_kick.gsc" }, - { 0x25D9F453DA2E67C1, "scripts/smartobjects/stealth_rage_kick_l.gsc" }, - { 0x58B37147398F676B, "scripts/smartobjects/stealth_rage_kick_r.gsc" }, - { 0x27E688562D2DD6EE, "scripts/smartobjects/stealth_rage_punch.gsc" }, - { 0x321A4C86508CC1C2, "scripts/smartobjects/utility.gsc" }, - { 0x378FC85E571E7186, "scripts/sp/analytics.gsc" }, - { 0x58937D0256A1E2AD, "scripts/sp/anim.gsc" }, - { 0x302B310CF5F281F9, "scripts/sp/anim_notetrack.gsc" }, - { 0x4E6F0300DC3EF45F, "scripts/sp/art.gsc" }, - { 0x4207755BFDB48B74, "scripts/sp/audio.gsc" }, - { 0x1DA1788C3403A19E, "scripts/sp/autosave.gsc" }, - { 0x4A81C087EFED4B9C, "scripts/sp/colors.gsc" }, - { 0x3039452DFDE7FBBA, "scripts/sp/compass.gsc" }, - { 0x5893ADB02CDAE4F6, "scripts/sp/createfx.gsc" }, - { 0x5CB72CC7E5761F50, "scripts/sp/credits.gsc" }, - { 0x53013CFCD4DE3AB2, "scripts/sp/damagefeedback.gsc" }, - { 0x40B3883467EEF7A5, "scripts/sp/debug.gsc" }, - { 0x7F2603B0C235A0CF, "scripts/sp/debug_menu.gsc" }, - { 0x7F3BDDB3EA2462AB, "scripts/sp/debug_spawnai.gsc" }, - { 0x3E507F6E5BDBCD0E, "scripts/sp/destructibles/barrel_common.gsc" }, - { 0x26A4001904D98E21, "scripts/sp/destructibles/destructible_vehicle.gsc" }, - { 0x188209D7A6D9661D, "scripts/sp/destructibles/oil_barrel.gsc" }, - { 0x46E2E6E6321E4530, "scripts/sp/destructibles/red_barrel.gsc" }, - { 0x317FD45510A25464, "scripts/sp/destructibles/water_barrel.gsc" }, - { 0x17F2C690F3A59C64, "scripts/sp/door.gsc" }, - { 0x63DE70BAA2A6268D, "scripts/sp/door_ai.gsc" }, - { 0x5329AD582F86465A, "scripts/sp/door_internal.gsc" }, - { 0x5B32CC4BCFF6BF34, "scripts/sp/door_scriptable.gsc" }, - { 0x4B4058A03BDDE3FC, "scripts/sp/drone.gsc" }, - { 0x6DCA794AEA1C9BF5, "scripts/sp/drone_ai.gsc" }, - { 0x084AF360809289A2, "scripts/sp/drone_base.gsc" }, - { 0x279E1925F3241F5E, "scripts/sp/drone_civilian.gsc" }, - { 0x7372F05154F7CF79, "scripts/sp/endmission.gsc" }, - { 0x1E4C74716BDBF1AA, "scripts/sp/equipment/c4.gsc" }, - { 0x60C7BC918A3C2D17, "scripts/sp/equipment/flash.gsc" }, - { 0x581014825671F061, "scripts/sp/equipment/frag.gsc" }, - { 0x046CA9E7416BA3B6, "scripts/sp/equipment/green_beam.gsc" }, - { 0x6549CFD94ABD4097, "scripts/sp/equipment/ied.gsc" }, - { 0x7B7988D739347D8F, "scripts/sp/equipment/incendiarylauncher.gsc" }, - { 0x1E74C44DA9B867E7, "scripts/sp/equipment/molotov.gsc" }, - { 0x760766D73663E89B, "scripts/sp/equipment/noisemaker.gsc" }, - { 0x629495DD20A7676C, "scripts/sp/equipment/offhands.gsc" }, - { 0x3506CF049DCDF381, "scripts/sp/equipment/pipebomb.gsc" }, - { 0x7920811A39B75195, "scripts/sp/equipment/semtex.gsc" }, - { 0x036FD89CA842AEF9, "scripts/sp/equipment/signal.gsc" }, - { 0x783B35AF6737F35C, "scripts/sp/equipment/smoke.gsc" }, - { 0x5170F99B18418184, "scripts/sp/equipment/teargas.gsc" }, - { 0x5B1A0AE8FBC8C294, "scripts/sp/equipment/throwingknife.gsc" }, - { 0x3D29B911D6B3719B, "scripts/sp/equipment/tripwire.gsc" }, - { 0x293F278F9CF34658, "scripts/sp/fakeactor.gsc" }, - { 0x4A91B05009A9DBC7, "scripts/sp/fakeactor_node.gsc" }, - { 0x159A6C716E66F4B9, "scripts/sp/flags.gsc" }, - { 0x0497F620360B162D, "scripts/sp/footsteps.gsc" }, - { 0x68D2819FB2878D27, "scripts/sp/friendlyfire.gsc" }, - { 0x2A5B848A0353F970, "scripts/sp/gamer_profile.gsc" }, - { 0x7F5F30902DFFCF79, "scripts/sp/gameskill.gsc" }, - { 0x05B1415C1B5D0F61, "scripts/sp/geo_mover.gsc" }, - { 0x1ED0C34577F0DA0E, "scripts/sp/gibbing.gsc" }, - { 0x2D4CE59734F5DAE6, "scripts/sp/glass.gsc" }, - { 0x13C0801E30856000, "scripts/sp/global_fx.gsc" }, - { 0x09487322CAC9297E, "scripts/sp/global_fx_code.gsc" }, - { 0x07C250FED32DCA82, "scripts/sp/helicopter_ai.gsc" }, - { 0x3643E7DC7F2606AA, "scripts/sp/helicopter_globals.gsc" }, - { 0x7F3FFC10F2BFB1FB, "scripts/sp/hud.gsc" }, - { 0x73A1E31545226A6A, "scripts/sp/hud_util.gsc" }, - { 0x737B1C2C8C9472DD, "scripts/sp/idles.gsc" }, - { 0x0D7ECC9DA600EC47, "scripts/sp/intelligence.gsc" }, - { 0x08E4D21CA0DE77C2, "scripts/sp/interactables/dynolight.gsc" }, - { 0x773AB997A5729886, "scripts/sp/interaction.gsc" }, - { 0x1A108372A314490E, "scripts/sp/interaction_manager.gsc" }, - { 0x72DCB1863F7ED720, "scripts/sp/introscreen.gsc" }, - { 0x31BE5B920616DCB1, "scripts/sp/lights.gsc" }, - { 0x0524E8E6BEEE6F64, "scripts/sp/load.gsc" }, - { 0x2B649E446E1D813A, "scripts/sp/load_code.gsc" }, - { 0x501C1DB481E23452, "scripts/sp/loot.gsc" }, - { 0x5F7F27440541EF2A, "scripts/sp/mg_penetration.gsc" }, - { 0x72BB98237AE73D8A, "scripts/sp/mgturret.gsc" }, - { 0x09A98F653FFF265A, "scripts/sp/names.gsc" }, - { 0x172D002C28F413E6, "scripts/sp/nvg/nvg_ai.gsc" }, - { 0x587C769EC1C5F759, "scripts/sp/nvg/nvg_player.gsc" }, - { 0x0DD7835B9CBE1CA8, "scripts/sp/outline.gsc" }, - { 0x4A778814F1B1E996, "scripts/sp/patrol.gsc" }, - { 0x700CDF1663CF9DA7, "scripts/sp/pausemenu.gsc" }, - { 0x01DD8C2481AC6E8A, "scripts/sp/pip_util.gsc" }, - { 0x6A4190022C745CFD, "scripts/sp/player.gsc" }, - { 0x3A83E235D70BD495, "scripts/sp/player/ally_equipment.gsc" }, - { 0x167428C4C368615C, "scripts/sp/player/ballistics.gsc" }, - { 0x4F44B6686CAC35FC, "scripts/sp/player/bullet_feedback.gsc" }, - { 0x5354D3AB606FAD12, "scripts/sp/player/context_melee.gsc" }, - { 0x52AD10B20F9C9A8C, "scripts/sp/player/cursor_hint.gsc" }, - { 0x1A06A2EE09C533BA, "scripts/sp/player/flare.gsc" }, - { 0x446F9DA3A686E968, "scripts/sp/player/gestures.gsc" }, - { 0x3739A09FCC88DEAC, "scripts/sp/player/offhand_box.gsc" }, - { 0x379C2358A1B97624, "scripts/sp/player/playerchatter.gsc" }, - { 0x7DD293F8DDCDE64D, "scripts/sp/player/teenagefarah.gsc" }, - { 0x10587A0683D82922, "scripts/sp/player/youngfarrah.gsc" }, - { 0x4540A3F6BEB7E5D0, "scripts/sp/player_death.gsc" }, - { 0x19E020D7B19C133C, "scripts/sp/player_rig.gsc" }, - { 0x19AA72688C1A1921, "scripts/sp/player_stats.gsc" }, - { 0x22627F7B6B1A1FEC, "scripts/sp/script_items.gsc" }, - { 0x0918A19212085653, "scripts/sp/scriptable.gsc" }, - { 0x4C2ADCF8B7083295, "scripts/sp/scripted_weapon_assignment.gsc" }, - { 0x5C82DC488283308D, "scripts/sp/scriptedsniper.gsc" }, - { 0x0A945DBD6C5969C6, "scripts/sp/slowmo_init.gsc" }, - { 0x031396CE3A2ABBBA, "scripts/sp/spawner.gsc" }, - { 0x430A633BAE3FC6A9, "scripts/sp/stairtrain.gsc" }, - { 0x456556E2BFEC9461, "scripts/sp/starts.gsc" }, - { 0x74398FB8AB8E9EDA, "scripts/sp/statemachine.gsc" }, - { 0x21E827F136E28A04, "scripts/sp/stayahead.gsc" }, - { 0x4B47D1A240B4C54D, "scripts/sp/stealth/idle_sitting.gsc" }, - { 0x04FD7AE7467577B5, "scripts/sp/stealth/manager.gsc" }, - { 0x4ECE1947BC018ED1, "scripts/sp/stealth/player.gsc" }, - { 0x42FBC16A2A3CDB0D, "scripts/sp/stealth/tagging.gsc" }, - { 0x03E816B921D0B226, "scripts/sp/stealth/utility.gsc" }, - { 0x59525EDBC77F3C84, "scripts/sp/stinger.gsc" }, - { 0x5E58E8E8D674E067, "scripts/sp/traffic_system.gsc" }, - { 0x1974079C607A332C, "scripts/sp/treadfx.gsc" }, - { 0x73438D963E182E4E, "scripts/sp/trigger.gsc" }, - { 0x24DB68BD2DAEE08A, "scripts/sp/utility.gsc" }, - { 0x4748BF91627A1C3A, "scripts/sp/vehicle.gsc" }, - { 0x635B93BA2B90F882, "scripts/sp/vehicle_aianim.gsc" }, - { 0x1F4F2DB8287A420D, "scripts/sp/vehicle_build.gsc" }, - { 0x351975F16D321880, "scripts/sp/vehicle_code.gsc" }, - { 0x6D8AAD7D0495CD99, "scripts/sp/vehicle_heavy_destruction.gsc" }, - { 0x52DA195F1171EFEB, "scripts/sp/vehicle_interact.gsc" }, - { 0x2D0432F65B1FD9B0, "scripts/sp/vehicle_lights.gsc" }, - { 0x653022EEAAC72479, "scripts/sp/vehicle_paths.gsc" }, - { 0x07EE8BAD86C952E4, "scripts/sp/vehicle_treads.gsc" }, - { 0x4B1E5F62D78F9304, "scripts/sp/vision.gsc" }, - { 0x0645528CB1B1EF14, "scripts/stealth/callbacks.gsc" }, - { 0x21FB20A3C1CA8CCF, "scripts/stealth/clear_regions.gsc" }, - { 0x146A17616F44667A, "scripts/stealth/corpse.gsc" }, - { 0x191339F5C1A6195B, "scripts/stealth/debug.gsc" }, - { 0x1CA4F62D92DD5210, "scripts/stealth/enemy.gsc" }, - { 0x20B2DF6CB9AFF8F0, "scripts/stealth/event.gsc" }, - { 0x3175B03723124101, "scripts/stealth/friendly.gsc" }, - { 0x331896EDB4223103, "scripts/stealth/group.gsc" }, - { 0x0CEA8F165A816A0C, "scripts/stealth/init.gsc" }, - { 0x70530A265A9F5903, "scripts/stealth/manager.gsc" }, - { 0x2D4E31A32FB4EADB, "scripts/stealth/neutral.gsc" }, - { 0x211D04EFBA6BDD8B, "scripts/stealth/player.gsc" }, - { 0x163386F8246EA03C, "scripts/stealth/threat_sight.gsc" }, - { 0x7EB69E8C5218D5D0, "scripts/stealth/utility.gsc" }, - { 0x09D0561FF8DED2FB, "scripts/unittest/call.gsc" }, - { 0x33374ABA53CCEFA3, "scripts/unittest/cond.gsc" }, - { 0x60C3BF3F97AAD8A1, "scripts/unittest/error.gsc" }, - { 0x7D417D07A4E5621D, "scripts/unittest/loop.gsc" }, - { 0x7A3248CECDABBB87, "scripts/unittest/ops.gsc" }, - { 0x4484932699BA0155, "scripts/unittest/patch.gsc" }, - { 0x46E026730332CC63, "scripts/unittest/patch_far.gsc" }, - { 0x3FB3888869A3BBAC, "scripts/unittest/patch_new.gsc" }, - { 0x1C177F8B59EA24BF, "scripts/unittest/switch.gsc" }, - { 0x2ACE7209907A93EA, "scripts/unittest/threads.gsc" }, - { 0x508F2C4AFE4464DD, "scripts/unittest/unittest.gsc" }, - { 0x78A054D0158094FB, "scripts/unittest/util.gsc" }, - { 0x6E8449CF88F1EADA, "scripts/unittest/variables.gsc" }, - { 0x2001A12EABCEA3F5, "scripts/vehicle/apache.gsc" }, - { 0x39C5ABE7337EC7C2, "scripts/vehicle/asierra.gsc" }, - { 0x6043CCF093C23E56, "scripts/vehicle/attack_heli.gsc" }, - { 0x199A1F4363AFB888, "scripts/vehicle/blima.gsc" }, - { 0x481D6433B953BE14, "scripts/vehicle/blima_ground.gsc" }, - { 0x42ADD57A1535B9C3, "scripts/vehicle/bromeo.gsc" }, - { 0x1AA8D9019B401C0E, "scripts/vehicle/decho.gsc" }, - { 0x1FA661E0EC7A2E34, "scripts/vehicle/drone_improvised.gsc" }, - { 0x203A417B3F26B482, "scripts/vehicle/empty.gsc" }, - { 0x15A70AD2B561D11D, "scripts/vehicle/empty_heli.gsc" }, - { 0x304FB8A7A53594F4, "scripts/vehicle/empty_nocollision.gsc" }, - { 0x4ECFC469719C5667, "scripts/vehicle/empty_turret.gsc" }, - { 0x639687EEE6B8EDBF, "scripts/vehicle/lbravo.gsc" }, - { 0x5B6F151AAEED75B4, "scripts/vehicle/london_cab.gsc" }, - { 0x4E826AB3BA315311, "scripts/vehicle/mindia8.gsc" }, - { 0x711704083FA820D7, "scripts/vehicle/mindia8_jugg.gsc" }, - { 0x497045F94EA799B2, "scripts/vehicle/mkilo23.gsc" }, - { 0x623A55B1697311EA, "scripts/vehicle/mkilo23_ai_infil.gsc" }, - { 0x707BAFC0054976B7, "scripts/vehicle/palfa.gsc" }, - { 0x05F006A1931E24DC, "scripts/vehicle/pindia.gsc" }, - { 0x0E4A4BCD834BD23D, "scripts/vehicle/ralfa.gsc" }, - { 0x08BC8E8C7995D6CF, "scripts/vehicle/secho.gsc" }, - { 0x7D931927C317D34B, "scripts/vehicle/skilo.gsc" }, - { 0x242DE32B27BC25C1, "scripts/vehicle/stango.gsc" }, - { 0x583BF3991C6D6325, "scripts/vehicle/suniform25.gsc" }, - { 0x5E6D5DE83F5DAE1E, "scripts/vehicle/techo.gsc" }, - { 0x39329602384C75ED, "scripts/vehicle/tromeo.gsc" }, - { 0x073D801F600ADD92, "scripts/vehicle/umike.gsc" }, - { 0x1E0A39FECFB8CD77, "scripts/vehicle/vehicle_common.gsc" }, - { 0x6A9EA1E319F74B9C, "scripts/vehicle/victor40.gsc" }, - { 0x7B40C4E7C4800A3A, "scripts/vehicle/vindia.gsc" }, - { 0x4D6149376990F3A2, "scripts/vehicle/walfa.gsc" }, - { 0x09D2D9B2FB9B5D8D, "scripts/vehicle/zuniform.gsc" }, - { 0x1968DF0F374CD0BC, "xmodelalias/alias_hero_stpetersburg_nikilai_body.gsc" }, - { 0x63CFE7F1AAFAD8CA, "xmodelalias/bodies_al_qatala_desert_01.gsc" }, - { 0x09DDA7E56E370B77, "xmodelalias/bodies_al_qatala_desert_02.gsc" }, - { 0x74F32EEFEA1A3620, "xmodelalias/bodies_al_qatala_desert_03.gsc" }, - { 0x7D24E7ED8D69F254, "xmodelalias/bodies_al_qatala_desert_07.gsc" }, - { 0x20557FB431C0D152, "xmodelalias/bodies_al_qatala_desert_09.gsc" }, - { 0x4792B9C474781B03, "xmodelalias/bodies_al_qatala_urban_a6_variant.gsc" }, - { 0x7C2D12F859DD5799, "xmodelalias/bodies_al_qatala_urban_ar.gsc" }, - { 0x2A6CEE3395C1645F, "xmodelalias/bodies_al_qatala_urban_ar_variant.gsc" }, - { 0x500291E60F31CCD5, "xmodelalias/bodies_al_qatala_urban_bomber.gsc" }, - { 0x351EAF226C7BE860, "xmodelalias/bodies_al_qatala_urban_cqb_variant.gsc" }, - { 0x6B7FA02503D72E1A, "xmodelalias/bodies_al_qatala_urban_lmg_variant.gsc" }, - { 0x750BAC0C2857D581, "xmodelalias/bodies_civ_al_qatala_urban_female.gsc" }, - { 0x3638CC05A9A86A8C, "xmodelalias/bodies_civ_russian_police_officer.gsc" }, - { 0x46F20AF39225ADD9, "xmodelalias/bodies_civ_western_cold_boy.gsc" }, - { 0x27C72E88CD6F7171, "xmodelalias/bodies_civ_western_cold_girl.gsc" }, - { 0x7AA00C4824C2C01E, "xmodelalias/bodies_sas_urban_ar.gsc" }, - { 0x0EBC709082B1546C, "xmodelalias/bodies_sas_urban_cqc.gsc" }, - { 0x32C415EC9D5EDD7E, "xmodelalias/bodies_sas_urban_dmr.gsc" }, - { 0x7E19D609E22641A4, "xmodelalias/bodies_sas_woodland_ar.gsc" }, - { 0x6CF15480414136F6, "xmodelalias/bodies_spetsnaz_ar.gsc" }, - { 0x2D88ACD05A29DB4E, "xmodelalias/civ_russian_male_body_1.gsc" }, - { 0x7406BAE08EB204D0, "xmodelalias/civ_russian_male_head_1.gsc" }, - { 0x15EF279651DCFDCF, "xmodelalias/civilian_london_female_body_02_skintone_dark.gsc" }, - { 0x60394823A2363E1F, "xmodelalias/civilian_london_female_body_02_skintone_light.gsc" }, - { 0x3C8C0E8AD64EEBB5, "xmodelalias/civilian_london_female_body_02_skintone_med.gsc" }, - { 0x18C1E36AE92D394F, "xmodelalias/civilian_london_female_body_skintone_01.gsc" }, - { 0x223DAC67D524C31B, "xmodelalias/civilian_london_female_body_skintone_01_anim_safe.gsc" }, - { 0x2FBE796151B2A1B4, "xmodelalias/civilian_london_female_body_skintone_med.gsc" }, - { 0x0F679FD605A69D24, "xmodelalias/civilian_london_female_body_skintone_med_anim_safe.gsc" }, - { 0x115281D4522A1404, "xmodelalias/civilian_london_female_head_skintone_light.gsc" }, - { 0x31C04A026E139B02, "xmodelalias/civilian_london_female_head_skintone_med.gsc" }, - { 0x1673C08D3BE4AE9F, "xmodelalias/civilian_london_female_heads_skintone_dark.gsc" }, - { 0x1E066541EEB7D69D, "xmodelalias/civilian_london_female_heads_skintone_dark_nohair.gsc" }, - { 0x5B8E6FDFE0E1B94F, "xmodelalias/civilian_london_female_heads_skintone_light.gsc" }, - { 0x01ABEE48E066BEAD, "xmodelalias/civilian_london_female_heads_skintone_light_nohair.gsc" }, - { 0x5F3139A12D66CEC5, "xmodelalias/civilian_london_female_heads_skintone_med.gsc" }, - { 0x3FAE036CBDCF1B37, "xmodelalias/civilian_london_female_heads_skintone_med_nohair.gsc" }, - { 0x52C13E4168F72DB3, "xmodelalias/civilian_london_male_body_skintone_light.gsc" }, - { 0x016E06A0BBAAA959, "xmodelalias/civilian_london_male_body_skintone_med.gsc" }, - { 0x34726B0BFF780D69, "xmodelalias/civilian_me_female_bodies.gsc" }, - { 0x04B40D1EA1126B1C, "xmodelalias/civilian_me_female_embassy_bodies.gsc" }, - { 0x2B41AE39A79A7022, "xmodelalias/civilian_me_female_heads.gsc" }, - { 0x67F0EF4494C59910, "xmodelalias/civilian_me_female_veil_bodies.gsc" }, - { 0x123898B3EB05C744, "xmodelalias/civilian_me_female_wrap_bodies.gsc" }, - { 0x21A9A4608C8EC98D, "xmodelalias/civilian_me_female_wrap_heads.gsc" }, - { 0x2B46F5F29E39E461, "xmodelalias/civilian_me_male_veil_bodies.gsc" }, - { 0x5E41D667569898DA, "xmodelalias/civilian_me_male_veil_heads.gsc" }, - { 0x3FCB0B609850C8AA, "xmodelalias/civilian_russian_female_body.gsc" }, - { 0x269E9459BF0FB3C8, "xmodelalias/civilian_russian_female_head.gsc" }, - { 0x431A591A41AF76DB, "xmodelalias/civilian_syrkistan_female_head.gsc" }, - { 0x0CB6FAE1D89AB8AC, "xmodelalias/civilian_syrkistan_female_head_no_hair.gsc" }, - { 0x756CBE2A2DEFE576, "xmodelalias/civilian_syrkistan_male_body.gsc" }, - { 0x3A97C88651C9ADB9, "xmodelalias/civilian_syrkistan_male_body_dist.gsc" }, - { 0x655BAFD7450B7EBD, "xmodelalias/civilian_syrkistan_male_body_embassy.gsc" }, - { 0x5C1F2FF15EF59F24, "xmodelalias/civilian_syrkistan_male_head.gsc" }, - { 0x291A99C3C1D2520E, "xmodelalias/civilian_uk_male_heads_skintone_light.gsc" }, - { 0x53BE65E259C850F8, "xmodelalias/civilian_uk_male_heads_skintone_med.gsc" }, - { 0x1A770865F3E0213E, "xmodelalias/hats_civ_russian_police_officer.gsc" }, - { 0x29FC815BDE49F867, "xmodelalias/heads_al_qatala_desert.gsc" }, - { 0x2420665E75332A77, "xmodelalias/heads_al_qatala_desert_03.gsc" }, - { 0x3A983E2D38BCF052, "xmodelalias/heads_al_qatala_desert_08.gsc" }, - { 0x0AB8D3A2D44320F1, "xmodelalias/heads_al_qatala_desert_bomber.gsc" }, - { 0x0EA4FAD5C0FB4A2C, "xmodelalias/heads_al_qatala_tmtyl.gsc" }, - { 0x1B561F178FEF18E3, "xmodelalias/heads_al_qatala_urban_04.gsc" }, - { 0x7B333728D55146FC, "xmodelalias/heads_al_qatala_urban_05.gsc" }, - { 0x5F8AA70D4F49E165, "xmodelalias/heads_al_qatala_urban_06.gsc" }, - { 0x30B2046800230E0E, "xmodelalias/heads_al_qatala_urban_ar_variant.gsc" }, - { 0x42ED7DFB5FA7E710, "xmodelalias/heads_civ_al_qatala_urban_female.gsc" }, - { 0x7F3538979A978A6D, "xmodelalias/heads_civ_russian_police_officer.gsc" }, - { 0x5CD359CBCE951B70, "xmodelalias/heads_civ_western_cold_boy.gsc" }, - { 0x76B841822EB4767E, "xmodelalias/heads_civ_western_cold_girl.gsc" }, - { 0x6AA2552F6B9D4DBE, "xmodelalias/heads_london_police.gsc" }, - { 0x348FD0E2DD0D7729, "xmodelalias/heads_sas_urban.gsc" }, - { 0x248084AD2A220B0F, "xmodelalias/heads_sas_urban_nvg.gsc" }, - { 0x0997082582A6C9BF, "xmodelalias/heads_sas_woodland_nvg.gsc" }, - { 0x2635EC9C3FB164AF, "xmodelalias/heads_usmc_male.gsc" }, - { 0x7BEA7A236E989767, "xmodelalias/russian_army_ar_1_hats_gasmask.gsc" }, - { 0x2E3CDC890B1F4BA8, "xmodelalias/russian_army_ar_2_hats_gasmask.gsc" }, - { 0x47FB9EDA20E0AF12, "xmodelalias/russian_army_ar_4_hats_gasmask.gsc" }, - { 0x453DF43B64B4A9F3, "xmodelalias/russian_army_ar_5_hats_gasmask.gsc" }, - { 0x5951E4088AA9334B, "xmodelalias/russian_army_bodies_1.gsc" }, - { 0x4A830263D4CAED70, "xmodelalias/russian_army_bodies_1_light.gsc" }, - { 0x24FAF734CBA3EACE, "xmodelalias/russian_army_bodies_2.gsc" }, - { 0x0424D7DEDA010305, "xmodelalias/russian_army_bodies_2_light.gsc" }, - { 0x50AE8A53F7025665, "xmodelalias/russian_army_hats.gsc" }, - { 0x4B829CC774F72F19, "xmodelalias/russian_army_hats_safehouse.gsc" }, - { 0x08DD7BF5DE21FB78, "xmodelalias/russian_army_heads.gsc" }, - { 0x1F37ACCFC04F4186, "xmodelalias/russian_army_heads_gasmask.gsc" }, - { 0x5F5F33C65239A5E8, "xmodelalias/russian_army_heads_safehouse.gsc" }, - { 0x63487AB57AA2A5CB, "xmodelalias/test_alias_civ_london_male_1_body.gsc" }, - { 0x60B785787652FD92, "xmodelalias/test_enemy_picc_heads.gsc" }, - }}; - -const std::array, 73500> hash_list +extern std::array, hash_count> const hash_list {{ { 0xAC0E9D4AC96B3934, "-" }, { 0xAC0E2F4AC96A474A, "_" }, @@ -75458,40 +73512,4 @@ const std::array, 73500> hash_list { 0x4CA8EF8D936C1E3E, "zvelscale" }, }}; -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()); - hash_map.reserve(hash_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 : path_list) - { - path_map.insert({ entry.first, entry.second }); - } - - for (const auto& entry : hash_list) - { - hash_map.insert({ entry.first, entry.second }); - } - } -}; - -__init__ _; - -} // namespace xsk::gsc::iw8 - -#ifdef _MSC_VER -#pragma warning(pop) -#endif +} // namespace xsk::gsc::iw9 diff --git a/src/iw9/iw9_meth.cpp b/src/iw9/iw9_meth.cpp new file mode 100644 index 00000000..64f2d1ae --- /dev/null +++ b/src/iw9/iw9_meth.cpp @@ -0,0 +1,1486 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw9.hpp" + +namespace xsk::gsc::iw9 +{ + +extern std::array, meth_count> const meth_list +{{ + { 0x19259C1E86EB4C53, "activatekeypressed" }, + { 0xF3CC081A63CA907D, "activatenightvisionblind" }, + { 0xA8198F52317E627B, "actorcalcstopdata" }, + { 0x736F92D8B416AE68, "actorgetgroundslope" }, + { 0x930AF79C0700A38E, "addpitch" }, + { 0x9B2C1872EFE45EF3, "addroll" }, + { 0x9DDC53A46CF105E3, "addyaw" }, + { 0x5C4FCF2DEB5C3A39, "adsbuttonpressed" }, + { 0x637E7C3C320B3C9A, "agentsetfavoriteenemy" }, + { 0xAE20BA1C641567DD, "aicalcsuppressspot" }, + { 0x14C4A10ABC8C2009, "aiclearanim" }, + { 0xA8070F6B853A0BEF, "aicleargesture" }, + { 0x8641492DC3B31396, "aiclearscriptdesiredspeed" }, + { 0x338283E13F3B9D27, "aieventlistenerevent" }, + { 0xCEE8B3A816D44839, "aigetanimtime" }, + { 0xCB069B4A97247D00, "aigetanimweight" }, + { 0x290C13657C578C40, "aigetdesiredspeed" }, + { 0xACFFF3AE5582BA33, "aigettargetspeed" }, + { 0x433DD0758C715F99, "aiphysicstrace" }, + { 0x5CEA42D85E228F5D, "aiphysicstracepassed" }, + { 0xC306E44C71B2C160, "aiplaygesture" }, + { 0xDE0D8FF41C23B2D3, "aipointinfov" }, + { 0x80DD137AE389EF74, "aisetanim" }, + { 0xFA87C3BEE01A0B46, "aisetanimlimited" }, + { 0xEF65BBA1D7447C66, "aisetanimrate" }, + { 0xB8BA5F18765F9FD5, "aisetanimtime" }, + { 0x3DBBE34C1A0BC2EC, "aisetdesiredspeed" }, + { 0xA68AC5A644C41F17, "aisettargetspeed" }, + { 0x9DB284F072067010, "allowads" }, + { 0x601779292F46392D, "allowboostjump" }, + { 0xFDA0999207F43D1C, "allowcrouch" }, + { 0x35A7145754356801, "allowdodge" }, + { 0x9598D881B4FE28F7, "allowdoublejump" }, + { 0xF697698F27CE6E30, "allowedstances" }, + { 0x1CD54024E4D07BAA, "allowfire" }, + { 0x9A31102598FA3F8E, "allowhighjump" }, + { 0xE66F45F0A76A7F12, "allowjog" }, + { 0xBA43183F1D30A19E, "allowjump" }, + { 0xE89BC60E544F3BFA, "allowlean" }, + { 0x24ED1DDB10271025, "allowmantle" }, + { 0x53B6A43616BDF0EE, "allowmelee" }, + { 0x78DF870F5BEE4B4C, "allowmountside" }, + { 0x557B9BA2536BEA56, "allowmounttop" }, + { 0x1C2B519F49F319C7, "allowmovement" }, + { 0x0A366F552E34DECC, "allowoffhandshieldweapons" }, + { 0x3D1AD04216543A64, "allowprone" }, + { 0x9A71BC30056B190B, "allowreload" }, + { 0xED21220DC576BE6B, "allowslide" }, + { 0x4E40AB48F12B71EA, "allowspectateallteams" }, + { 0xDA8DCB531B8C1F54, "allowspectateteam" }, + { 0xB5710E3317E54AC6, "allowsprint" }, + { 0x1FFF1C4AFCFCCB3A, "allowstand" }, + { 0xB44C33331628B5CD, "allowsupersprint" }, + { 0xDE2DDDEDE5572D3F, "allowwallrun" }, + { 0xE3731F2031493FAF, "animmode" }, + { 0x6EB0B18320064D3C, "animrelative" }, + { 0xADD01DDB70BB0996, "animscripted" }, + { 0x4997BBA6A64F4490, "animscriptsetinputparamreplicationstatus" }, + { 0x7E49FB772AE94992, "anyammoforweaponmodes" }, + { 0xBE40C3D8F49C8CF1, "applydroneimpulsevelocity" }, + { 0x3AB4CEDA8A5D1E29, "asmclearephemeralevents" }, + { 0x64347E69FCAB664D, "asmcurrentstatehasaimset" }, + { 0xFB5B18C1997D6DCC, "asmcurrentstatehasflag" }, + { 0x5AB3FD5337B101FA, "asmdodeathtransition" }, + { 0xDC3FD01372B3B6AB, "asmephemeraleventfired" }, + { 0x3CB143E5163ED1ED, "asmevalpaintransition" }, + { 0x8D2632EAA32E24D4, "asmeventfired" }, + { 0x812DA0A47A9BC9E3, "asmeventfiredwithin" }, + { 0x1C4C3BA542A7DD3D, "asmfireephemeralevent" }, + { 0xA9A19B77A9DE2138, "asmfireevent" }, + { 0x3F352955A2120F5D, "asmgetanim" }, + { 0x062DCE37A914F48E, "asmgetcurrentstate" }, + { 0x67501EBE1EAF07F5, "asmgetephemeraleventdata" }, + { 0x77F4137E7159C7F8, "asmgeteventdata" }, + { 0x628BC1FFDA83C869, "asmgeteventtime" }, + { 0x50D5C2968B365F88, "asmgetnotehandler" }, + { 0x3408E3DD2D8FD202, "asmgetstatetransitioningfrom" }, + { 0x6861CAA31A203A39, "asmhaspainstate" }, + { 0x72A1EE6E5B84EAE1, "asmhasstate" }, + { 0xDC206F1C60EABB94, "asminstantiate" }, + { 0xBC5D1270BD7DF9A9, "asmsetstate" }, + { 0x10AB0A9FCF60E433, "asmterminate" }, + { 0x459AE5CFE773AAB1, "asmtick" }, + { 0xAFBA63A404EB8144, "assignweaponmeleeslot" }, + { 0x50440BA78DB9577A, "assignweaponoffhandprimary" }, + { 0xB866BD91BACC7FC6, "assignweaponoffhandsecondary" }, + { 0x49C95526FABE641F, "assignweaponoffhandspecial" }, + { 0x416D42F33F6C1328, "assignweaponoffhandtaunt" }, + { 0x2BF4669385DDB7DE, "assignweaponprimaryslot" }, + { 0x694AC5737C6FE890, "attach" }, + { 0xF492C2700D2A0D97, "attachpath" }, + { 0x3E2E36F9F85E429E, "attachshieldmodel" }, + { 0x5801698BEC4E134D, "attackbuttonpressed" }, + { 0xF71F6C9F232F6C97, "autospotoverlayoff" }, + { 0xD5BF41D515E35ED3, "autospotoverlayon" }, + { 0x7AE959754011A83B, "bb_shootparamsvalid" }, + { 0x23987328CE284AB1, "beginlocationselection" }, + { 0xE2593C056AC2D3C4, "botcanseeentity" }, + { 0xAB061338F693FFA3, "botclearbutton" }, + { 0x814BC500AD0F0C80, "botclearscriptenemy" }, + { 0x1D1F4CF1EDBE0A17, "botclearscriptgoal" }, + { 0x75E5392E4DF3782D, "botfindrandomgoal" }, + { 0xEEDCD324D98FFBB3, "botfirstavailablegrenade" }, + { 0xA0790E92695CBFF3, "botgetdifficulty" }, + { 0x7CCB15C662B32379, "botgetdifficultysetting" }, + { 0x643FE099D2BD29D4, "botgetfovdot" }, + { 0xAAC95241BC3564F7, "botgetimperfectenemyinfo" }, + { 0x301BC18CCFD0705D, "botgetnodesonpath" }, + { 0xC000EFC9F366A479, "botgetpathdist" }, + { 0xEA74CFA7DA5A2C9E, "botgetpersonality" }, + { 0x3168BB27D90AACBE, "botgetscriptgoal" }, + { 0x3189C2338390FE6A, "botgetscriptgoalnode" }, + { 0x649CF8562D705B4C, "botgetscriptgoalradius" }, + { 0x041C27AAE699397E, "botgetscriptgoaltype" }, + { 0x231ED2D91363CC81, "botgetscriptgoalyaw" }, + { 0x6372D90F03B7DFFB, "botgetworldsize" }, + { 0x542534FCE4C77A9A, "bothasscriptgoal" }, + { 0x9C51530081AF2D57, "botisrandomized" }, + { 0x4A11862CAD657EA2, "botlookatpoint" }, + { 0x84C7239F0E111577, "botmemoryevent" }, + { 0x73A6DDDAB610BD25, "botnodeavailable" }, + { 0x273C0605EEC46A2F, "botnodepick" }, + { 0x53E96ED952D8C14B, "botnodepickmultiple" }, + { 0xE08800D6169FF950, "botnodescoremultiple" }, + { 0x9DDB345F84C51439, "botpathexists" }, + { 0xE730F3DFC91872B9, "botpredictenemycampspots" }, + { 0xDDA2005BA81FF908, "botpredictseepoint" }, + { 0x9FBC3A0153BAC305, "botpressbutton" }, + { 0xADA3F47721BD9293, "botpursuingscriptgoal" }, + { 0xBCE0353497653219, "botsetattacker" }, + { 0x99A0513BC71C8EAF, "botsetawareness" }, + { 0x2E9D4B3E8575A7B7, "botsetdifficulty" }, + { 0xE32AE68C631D14BD, "botsetdifficultysetting" }, + { 0xA67B12299918B6BC, "botsetflag" }, + { 0xD640CD81837C3340, "botsetpathingstyle" }, + { 0x39E7AA71A794C4A2, "botsetpersonality" }, + { 0x3DD8E801C05DCE07, "botsetscriptenemy" }, + { 0xB57BDF89353B7502, "botsetscriptgoal" }, + { 0x1FF92DACE5F1EB1E, "botsetscriptgoalnode" }, + { 0x02C9E39F1CE82A08, "botsetscriptmove" }, + { 0xA570093A92D4C2FE, "botsetstance" }, + { 0xB51EE21A70627ECE, "botthrowscriptedgrenade" }, + { 0x455958663C870B5D, "brcirclemoveto" }, + { 0x6979E1A94FBE945A, "btgoalvalid" }, + { 0x9B42BF283F649C41, "btregistertreeinstance" }, + { 0x0E16BCD3034A5F69, "btterminatetreeinstance" }, + { 0x07FD3534F1CFE3C0, "buddyrevivingdoneanimevent" }, + { 0x8F5E8DA9CEEBBD45, "buttonpressed" }, + { 0xBE53BD2B5A63CE1E, "calloutmarkerping_create" }, + { 0x08476720F4CEEBF5, "calloutmarkerping_delete" }, + { 0xA57C51A62C1F5F90, "calloutmarkerping_getactive" }, + { 0xEFE8FC48BEC31433, "calloutmarkerping_getent" }, + { 0x10D613FB5D94E888, "calloutmarkerping_getgscobjectiveindex" }, + { 0x9BC35FA781520CF0, "calloutmarkerping_getorigin" }, + { 0x4C2F685A35B71A96, "calloutmarkerping_gettype" }, + { 0x8B084BBC77D63C7A, "calloutmarkerping_hide" }, + { 0xE43AC9A3965FB787, "cameradefault" }, + { 0x617F7D9B0B9FF8E7, "cameralinkto" }, + { 0xD659B80D0B8E85DA, "cameraset" }, + { 0xC360D55C8FB00D7D, "cameraunlink" }, + { 0x9E3BE62D3EC96FB7, "canattackenemynode" }, + { 0x51F2E90013286A04, "cancelmantle" }, + { 0xB1EC040F35321946, "cancelreload" }, + { 0xCD96439B0527AD8A, "cancelreloading" }, + { 0x1BED8E239645D390, "canplayerplacesentry" }, + { 0xDED5955B6297818B, "canplayerplacetank" }, + { 0x8BDD8CC548397384, "cansee" }, + { 0x6C1135DCB6BB5B9C, "canshoot" }, + { 0x8B63A7348687B370, "canshootenemy" }, + { 0xB06EADC7E1067B6B, "canspawnbotortestclient" }, + { 0x3FCD7DB37A0CB94E, "cansuppressenemyfromexposed" }, + { 0xE91438B9B5C772F5, "canuseattachment" }, + { 0x6520EF64E489492D, "changefontscaleovertime" }, + { 0x462519E8C31D93B9, "checkgrenadethrowpos" }, + { 0xC538D8F10A46CD59, "choosearrivaltype" }, + { 0xD0444A371CEC6D6C, "clearaccessory" }, + { 0x5818DCBDF32BF2B3, "clearadditionalstreampos" }, + { 0x2848F85016809A15, "clearaiblackboard" }, + { 0x0A4A89A82EA8BF84, "clearallsoundsubmixes" }, + { 0x69C8927D5832CAEA, "clearalltextafterhudelem" }, + { 0xDFAE09B98B7236DF, "clearanim" }, + { 0x5D5CD1CC7834E4BB, "clearbtgoal" }, + { 0x6A72C38A8D646A21, "clearcinematicmotionoverride" }, + { 0xA87718F4C645AB6D, "clearclienttriggeraudiozone" }, + { 0x0729CC3BCC0C1811, "cleardamageindicators" }, + { 0x764CFB30338AFD82, "cleardooropen" }, + { 0x46CF9B9F2C001C42, "clearentityspawnviewer" }, + { 0x6330AFCB41C05FF8, "clearentitytarget" }, + { 0x490AEAD0DA64F70C, "clearexecution" }, + { 0x094745FC32BE4093, "cleargoalvolume" }, + { 0x6BD1D6D886EB222C, "cleargoalyaw" }, + { 0xA765E4EE4494885A, "clearhighpriorityweapon" }, + { 0xACE673D5F52C528C, "clearhudtutorialmessage" }, + { 0x5F8321225422AA13, "clearladderstate" }, + { 0xBF58B76FDC4B6695, "clearlookatent" }, + { 0x1A4E80DCC59A18EC, "clearoffhandprimary" }, + { 0xC2632333A871E944, "clearoffhandsecondary" }, + { 0xC6E4D6C2BB9A8391, "clearoffhandspecial" }, + { 0x3359AF728FFBE9A9, "clearoverridearchetype" }, + { 0xCB01711839B5112D, "clearpath" }, + { 0xAE0674A864099CAB, "clearperks" }, + { 0x04BEDD9521C9EF17, "clearportableradar" }, + { 0x5A0500CE07A57204, "clearpredictedstreampos" }, + { 0x271D5F01CF132135, "clearscrambler" }, + { 0x6974A877625337B7, "clearscriptabledamageowner" }, + { 0x8ED21B9D35C2AB01, "clearsoundsubmix" }, + { 0x6EE6A733927A2CD0, "cleartargetentity" }, + { 0x0F7BA58B23A12C12, "cleartargetyaw" }, + { 0xFFFDD39AE6A7E189, "clearturrettarget" }, + { 0x4BE8BA8BA9476AB5, "clearwristwatchtime" }, + { 0x8D7D044743F2108E, "clientclaimtrigger" }, + { 0xF5D175E029066025, "clientreleasetrigger" }, + { 0x18E2E8038458EBD3, "cloneagent" }, + { 0x9159EA89E3137322, "clonebrushmodeltoscriptmodel" }, + { 0x4E26709EFB461DAF, "cloneplayer" }, + { 0x9AFCC2584B8E6312, "codemoveanimrate" }, + { 0x2B2E57CA3E2704C3, "codemoverequested" }, + { 0xFFBED949DF01807F, "connectpaths" }, + { 0xCADC621B920BDA6F, "controlagent" }, + { 0xEF8AB20D0499F4CA, "controlslinkto" }, + { 0x32F21A56DCA2908C, "controlsunlink" }, + { 0xA957B3E034932A49, "controlturretoff" }, + { 0xBE96046BB5858F8D, "controlturreton" }, + { 0x21A927030AE57A92, "copyloadoutbuttonpressed" }, + { 0x04FCE80F55B2FA8F, "crouchbuttonpressed" }, + { 0x1B8899B4130634A5, "ctgsreportusermatchstats" }, + { 0xAB0543A15D0F6594, "damageconetrace" }, + { 0x516A79E0AECB5E0C, "damagedamagepart" }, + { 0x33827C42853B31E6, "delete" }, + { 0x3141B3A448CEDB1A, "demeanoroverride" }, + { 0x3961363A2A60EB1E, "despawnagent" }, + { 0x0EE6B37D2CAE13B9, "destroy" }, + { 0xAC1FB28A323BB226, "detach" }, + { 0x97D1F666CB21BE05, "detachall" }, + { 0x8573688D3169B508, "detachshieldmodel" }, + { 0xEE3AE75954C1CE25, "detonate" }, + { 0x76CCF7D167F7ECA1, "disableautoreload" }, + { 0x8786D61C7A0D8432, "disableemptyclipweaponswitch" }, + { 0x0C611D532ACA50DE, "disableentitymarks" }, + { 0x30811E9089FF4B2F, "disableexecutionattack" }, + { 0x4C989A340C325057, "disableexecutionvictim" }, + { 0xDB41A42C21FEA7E6, "disableinvulnerability" }, + { 0xD514DCBCB263C630, "disablemissileboosting" }, + { 0xD94233429B3741FA, "disableoffhandprimaryweapons" }, + { 0x7E5E003B97B864A2, "disableoffhandsecondaryweapons" }, + { 0x6B9B4A1973383BC0, "disableoffhandthrowback" }, + { 0x04195080F571379E, "disableoffhandweapons" }, + { 0xA09FF8D4DB2FEAD7, "disablephysicaldepthoffieldscripting" }, + { 0x83213333C4E4E4A4, "disableplayermarks" }, + { 0x766594025CFA0369, "disableplayeruse" }, + { 0xAC2037BC44F1B45F, "disableplayeruseforallplayers" }, + { 0x7DD290B701C9D1CA, "disablereloading" }, + { 0x2CB7335C039B2F03, "disablescriptablepartplayeruse" }, + { 0x938D0A30D2C86274, "disablescriptableplayeruse" }, + { 0x98C0E17CD64660E8, "disabletargetmarks" }, + { 0x3B362CFB6BFE5FA4, "disableturretdismount" }, + { 0xB97BF302A995D03B, "disableusability" }, + { 0x5FAC5D9E49092C5F, "disableweaponpickup" }, + { 0x13D48E98713D3634, "disableweapons" }, + { 0xFED7B4323FFBACAF, "disableweaponswitch" }, + { 0x9FB3C456E0449C79, "disconnectpaths" }, + { 0x44362B47D0CD3B48, "dlog_recordplayerevent" }, + { 0xB66AF8C7826E62F1, "dodamage" }, + { 0xA5AB3B3C6B3B68B1, "doesnodeallowstance" }, + { 0xD97C3150F73B6859, "dontinterpolate" }, + { 0x5C6D654990A1F2E7, "dropitem" }, + { 0x2482603EE761779E, "dropscavengerbag" }, + { 0xDB80535FDEB421AC, "dropweapon" }, + { 0x2293E5201125AD3C, "dropweaponnovelocity" }, + { 0xA2672CA84BAB52C2, "earthquakeforplayer" }, + { 0xAE7F39F218308CAC, "enableaimassist" }, + { 0x585CF9B7FA84EFB4, "enableanimstate" }, + { 0xA8717DD4154974A2, "enableaudioportal" }, + { 0x3260D29F9586F21C, "enableautoreload" }, + { 0xE9C4421866E6FA8F, "enablecollisionnotifies" }, + { 0x9A2EFB5D142A62FD, "enableentitymarks" }, + { 0xBA7C858810941B9B, "enableequipdeployvfx" }, + { 0xA644AEE4905C2D54, "enableexecutionattack" }, + { 0xC334F0EB2D31B188, "enableexecutionvictim" }, + { 0x6091D91ED8BC5231, "enableinvulnerability" }, + { 0x9D510A070D1AF387, "enablelinkto" }, + { 0x0D3C4613784DC66B, "enablemissileboosting" }, + { 0x9D28D345507AF8F3, "enablemissilehint" }, + { 0x4F77ED1F436E1B05, "enableoffhandprimaryweapons" }, + { 0x852D33465469D2D5, "enableoffhandsecondaryweapons" }, + { 0x3CB1578BFD31CEFD, "enableoffhandthrowback" }, + { 0x29BE14E5FCED4997, "enableoffhandweapons" }, + { 0x218521A2147E0E3C, "enablephysicaldepthoffieldscripting" }, + { 0x88EC1E2F345EA814, "enableplayerbreathsystem" }, + { 0x920314B4526ABB8F, "enableplayermarks" }, + { 0xB0CCB977E93A2462, "enableplayeruse" }, + { 0xF3EF37ACAB707F8A, "enableplayeruseforallplayers" }, + { 0xF5920A37AC95A6F5, "enablequickweaponswitch" }, + { 0x6D1E743EA0646119, "enablereloading" }, + { 0x1D8394B642B7A8BC, "enablescriptablepartplayeruse" }, + { 0xBEB2AFDE496F7EB7, "enablescriptableplayeruse" }, + { 0xBE75A091C5C77AE1, "enablestatelookat" }, + { 0x42D5BF515F42C7A7, "enabletargetmarks" }, + { 0x4B12264783E60CA1, "enabletraversals" }, + { 0x64B1E5FE48525E35, "enableturretdismount" }, + { 0x5F257F5B49C8BF20, "enableusability" }, + { 0x8904144C9B467F5E, "enableweaponpickup" }, + { 0x84D0A0846521E72B, "enableweapons" }, + { 0x7DEF2F95232E6A02, "enableweaponswitch" }, + { 0xE27C0C9DE2C6125B, "enableworldup" }, + { 0xD7325855CB9D247D, "endlocationselection" }, + { 0xE4D57E3B6126FB5E, "energy_getenergy" }, + { 0xA945DFC5D12785B8, "energy_getmax" }, + { 0x737ACF5761C35DA6, "energy_getrestorerate" }, + { 0x69E49C7F4BAE2BD1, "energy_getresttimems" }, + { 0x42D95463E2266752, "energy_setenergy" }, + { 0x78340E6D82B1A99C, "energy_setmax" }, + { 0x434CE91D23123192, "energy_setrestorerate" }, + { 0xD02FE3EE2F008115, "energy_setresttimems" }, + { 0xC3F6229BD2017B71, "enterprone" }, + { 0xE10DFDA30D1A6727, "entityhasmark" }, + { 0x0BEF480330D02537, "entitymarkfilteredin" }, + { 0xF8B18BEC5778C611, "exitprone" }, + { 0x80065872B7B344CC, "fadeovertime" }, + { 0x24333E8A53C67DC9, "filterinplayermarks" }, + { 0x290DB6F8863477A6, "filteroutplayermarks" }, + { 0x37BEED9DB5A56EE7, "finalizespawnpointchoiceforplayer" }, + { 0xE24C8757B0964077, "findbestcovernode" }, + { 0x9192D9F7170B6311, "findoverridearchetype" }, + { 0xD7BB4E6AD754C615, "findpath" }, + { 0x6B626BC794254D8A, "finishagentdamage" }, + { 0x4F1159C237F5BFBA, "finishcoverarrival" }, + { 0x5935FE270073E706, "finishplayerdamage" }, + { 0x0837B7CD34B93ECC, "finishtraverse" }, + { 0xA567DB9E6311A191, "fireweapon" }, + { 0x19A5E47108E352C5, "fixlinktointerpolationbug" }, + { 0x66406BBD240E6D25, "forcehidegrenadehudwarning" }, + { 0xC08B08A8D1E10340, "forcenetfieldhighlod" }, + { 0x1FFE9D92588409C5, "forceplaygestureviewmodel" }, + { 0x8C50F5A53981EDCB, "forcereloading" }, + { 0x20A8F7AF5908695B, "forceteleport" }, + { 0x8C63E3735C75C73C, "forcethirdpersonwhenspectating" }, + { 0xCA2C60E9F91280B1, "forcethreatupdate" }, + { 0xBA4314F91BACDC00, "forceupdategoalpos" }, + { 0x0F27AA784307463F, "forceusehintoff" }, + { 0xF1139CA45CE1293B, "forceusehinton" }, + { 0x90D7F2777E666285, "fragbuttonpressed" }, + { 0x890555BEFBC57362, "freeentitysentient" }, + { 0x5543243AF73F1DE0, "freescriptable" }, + { 0xFE71F7DFBFD66D30, "freezecontrols" }, + { 0x1D8F7FD83FC9CEB7, "freezelookcontrols" }, + { 0x78FE84F510FC20B2, "getadjustedexitdirection" }, + { 0x4A2C55648B431CB4, "getaiblackboard" }, + { 0xACEBC6109AD99183, "getaimangle" }, + { 0x42C30CDD42E3D1EE, "getaltweapon" }, + { 0x7756FF8269A9CCB8, "getammocount" }, + { 0x0731E533A7951969, "getammotype" }, + { 0xBFE497ABBC577FC2, "getanimentry" }, + { 0x90DFB1D0FF1BCDA9, "getanimentrycount" }, + { 0x6E6FEB5D014721F8, "getanimrate" }, + { 0x9FDA67E65C664EEB, "getanimtime" }, + { 0x54012304A10181D6, "getapproxeyepos" }, + { 0x39EA083459BE8FA0, "getattachmodelname" }, + { 0xFC228F813B070BAF, "getattachsize" }, + { 0x6D4807C92FBCC10D, "getattachtagname" }, + { 0x2871F21A217667C1, "getbasearchetype" }, + { 0xAA194F050AA9C9FE, "getbaseweapon" }, + { 0x8758617AAC36330D, "getbeingrevived" }, + { 0xB38FC07C71FFD98A, "getboundshalfsize" }, + { 0xBD5FF1F12E234881, "getclantag" }, + { 0x020651BDAA374DAB, "getclientomnvar" }, + { 0xAC6AFC868F52D2F2, "getclosestenemy" }, + { 0xCBAE2EC01077A99A, "getclosestenemysqdist" }, + { 0x8BEF2E61C22E7D60, "getclosestreachablepointonnavmesh" }, + { 0xEAAB55A2B24AD482, "getcorpseanim" }, + { 0xF5728068784324D4, "getcorpseentity" }, + { 0xA662905B1D181E42, "getcorpsephysicsorigin" }, + { 0x5C4ABBAD6C13E1D8, "getcovertacpoint" }, + { 0xFCE68B394743E06A, "getcurrentprimaryweapon" }, + { 0x4D4A4579357AF348, "getcurrentusereloadconfig" }, + { 0x72FFAE5F008B8030, "getcurrentweapon" }, + { 0xF11422DBB0A770F0, "getcurrentweaponclipammo" }, + { 0x4E08FA0D13F76834, "getcustomizationbody" }, + { 0x3A0056213CF9EF3A, "getcustomizationhead" }, + { 0xE412A28904C3C23E, "getcustomizationviewmodel" }, + { 0x1A44039B2D7C1265, "getdamageparthealth" }, + { 0x02C6BD8D5B2C223E, "getdemeanorviewmodel" }, + { 0xD91E7EA59D56681F, "getdesiredscaledspeedforposalongpath" }, + { 0xDA60E1E9FC92B900, "getdroptofloorposition" }, + { 0x505B46E0E78A3EB1, "getenemyinfo" }, + { 0x834D6E34D701302D, "getentitynumber" }, + { 0x9B8CAEF2CFF98357, "getentityvelocity" }, + { 0x68B7558706F19F07, "getexecutionpartner" }, + { 0x0C42CBB7E36E1BDC, "geteye" }, + { 0xC4ED79257F74DE31, "getfireteammembers" }, + { 0xC92B0BA7F18A6AE3, "getfractionmaxammo" }, + { 0x2383D03FDAB13453, "getgestureanimlength" }, + { 0x3728A40040AB0E6E, "getgoalvolume" }, + { 0xF575698F50939C87, "getgrenadetossvel" }, + { 0x27AE5B328B1597F7, "getgroundentity" }, + { 0xCF97F9388F3DF976, "getguid" }, + { 0x263618842BF0888F, "getgunangles" }, + { 0x412A8C191A597FDC, "getheldoffhand" }, + { 0x001D0E7756376929, "gethighestnodestance" }, + { 0x9A2FCCAA25330FD7, "gethighpriorityweapon" }, + { 0x68EB84CBB371CD08, "gethybridscopestate" }, + { 0x67F37F949013D10D, "getistouchingentities" }, + { 0x9ECFE1DC10E4DDBB, "getjointype" }, + { 0xECF731B34620FD8D, "getjuggdefaultmusicenabled" }, + { 0x4F05BA64929988B6, "getlastgroundorigin" }, + { 0x7260F6ED685E81D2, "getlightintensity" }, + { 0x98CD3ED6BCD276B1, "getlinkedchildren" }, + { 0xFF434A450AD5AF46, "getlinkedparent" }, + { 0xB110B73EE3EA2DA2, "getlinkedscriptableinstance" }, + { 0x52429473328E120F, "getmid1damage" }, + { 0x31C19BAFF1A2DD9E, "getmid2damage" }, + { 0xCE2CB0DF273B88BD, "getmid3damage" }, + { 0xAF42AA8B18EA2112, "getmissilevelocity" }, + { 0x18E1978BEBD8896D, "getmlgselectedcamera" }, + { 0x41E85121BC46C30C, "getmode" }, + { 0x1E42449855AF5F2B, "getmodifierlocationonpath" }, + { 0xB31C2FFD77E42CFC, "getmotionangle" }, + { 0xC655B3E515670E32, "getmovingplatformparent" }, + { 0x16B4C40F3B68D721, "getmuzzleangle" }, + { 0xDFCEA01BE4B93639, "getmuzzledir" }, + { 0xBD827B1B0FE02C88, "getmuzzlepos" }, + { 0xD8316461941038FF, "getnavposition" }, + { 0xF913AFB37E3ACB1F, "getnavspaceent" }, + { 0x5B5C93FC476648AD, "getnearbynegotiationinfo" }, + { 0xB3807516A20AB6C7, "getnearestnode" }, + { 0x269D1A1D92B06C45, "getnearnodelistforspawncheck" }, + { 0x60BC41B12AEFD87D, "getnegotiationendnode" }, + { 0xAA781E0294DA0719, "getnegotiationendpos" }, + { 0xF5C41D832C446228, "getnegotiationstartnode" }, + { 0x187037AC04F1BCF3, "getnoaltweapon" }, + { 0xB9FF46DE77CFE692, "getnodenumber" }, + { 0x013B4AB41511FE19, "getnodeyawoffset" }, + { 0x5FDB3449578E6D2A, "getnonstick" }, + { 0x5DB16564E21F36AA, "getnormalhealth" }, + { 0x0857CAEF5EA14F2F, "getnormalizedmovement" }, + { 0x20B0D712B013CD8D, "getorigin" }, + { 0xD2A9CDBDF6FDFBE4, "getothersplitscreenplayer" }, + { 0xDB03AE3261685460, "getpartyid" }, + { 0x57DB283948DBA836, "getplayerangles" }, + { 0x19D41038FF220E62, "getplayerdata" }, + { 0x6D7406A6E5276FA4, "getplayerlightlevel" }, + { 0x4DCAA5B350E13F5E, "getplayerssightingme" }, + { 0x6771B103926E7A7A, "getplayeruseentity" }, + { 0x54D8512FAE666B94, "getplayerviewheight" }, + { 0xE5AD73B1AC0F0210, "getpointafternegotiation" }, + { 0xAD8C6970F720E939, "getpointinbounds" }, + { 0x273A78C9937F1B45, "getposonpath" }, + { 0xDF807FFBBE4823E3, "getprivatepartysize" }, + { 0x2E1998B0A4E41CF7, "getreacquirestate" }, + { 0xC3EA39852504CDCD, "getremainingburstdelaytime" }, + { 0xEE3C37717DD5FBF9, "getscriptablehaspart" }, + { 0xB697BC60BFB1C61E, "getscriptableisloot" }, + { 0x744107E620F5B4E0, "getscriptableisreserved" }, + { 0xCB58DDF897C15F70, "getscriptableisusableonanypart" }, + { 0xE88C6C8564CD1CE0, "getscriptableparthasstate" }, + { 0xE1E657CE44F37EDA, "getscriptablepartstate" }, + { 0x1C0D8A5083B6A18E, "getscriptedmeleetarget" }, + { 0xF30E03565A9BEFFB, "getsecondarytargets" }, + { 0xE4F23D15B994114B, "getshootatpos" }, + { 0x80795300D78E3A10, "getshootfrompos" }, + { 0x5105208115CD7444, "getshootpos" }, + { 0xC3E1DA1B1520CEED, "getsightedplayers" }, + { 0x99B8A467578F9BF0, "getskill" }, + { 0xB7214990D1297F8E, "getspawnbucketforplayer" }, + { 0xB4DFBE6F29BA0B66, "getspawnpointforplayer" }, + { 0xC38D93DE541F7AAA, "getspectatingplayer" }, + { 0xDB92A9BACD4CFEA5, "getstairsenterdist" }, + { 0x33CE3A923FCA11E7, "getstairsstateatdist" }, + { 0xCB9AFFF5598E3197, "getstance" }, + { 0x737F4A037C6AF72D, "gettagangles" }, + { 0x7F19025A98976973, "gettagorigin" }, + { 0x84EE99E3644B9D35, "gettargetentity" }, + { 0x70B6A9E2750FB1A5, "getthreatbiasgroup" }, + { 0x6FDB1E37C61C5B08, "getthreatsight" }, + { 0x604E4F718E43CFF2, "getthrowbackweapon" }, + { 0x5DC0C6E389CB612D, "getturret" }, + { 0x7E22D64685D6F44C, "getturretowner" }, + { 0x7A31CC2E8B86E730, "getturrettarget" }, + { 0x83BE7790433ADFC2, "getuseholdkbmprofile" }, + { 0x30170B3205A80E4C, "getvalidcovermultinodetypes" }, + { 0x6FD69054E5D65AC8, "getvalidcoverpeekouts" }, + { 0x400A7F7FCC3306B8, "getvehicleowner" }, + { 0xFCF21CB82CA79A74, "getvelocity" }, + { 0x2BCAC343C17B1672, "getviewkickscale" }, + { 0x2E7840803DE856B0, "getvieworigin" }, + { 0x4EE2A09BA05725F3, "getwartrackpassengerenabled" }, + { 0xAF42AA595919798F, "getweaponammoclip" }, + { 0x9A7F509646E1EF99, "getweaponammostock" }, + { 0x2D0D72FB575CDA31, "getweaponmeleeslot" }, + { 0xBAADE0C480696A88, "getweaponslist" }, + { 0x1ACB4F4C167FDECB, "getweaponslistall" }, + { 0x1775DC5132893599, "getweaponslistexclusives" }, + { 0x0C53938F1D65306C, "getweaponslistitems" }, + { 0xBFA8D72FC7A0EEC1, "getweaponslistoffhands" }, + { 0xD41C6447657A015E, "getweaponslistprimaries" }, + { 0x05D93FB5E2BF2E2D, "getworldupreferenceangles" }, + { 0x17975D502B433E51, "getxuid" }, + { 0xD8935EEBA17F1DB1, "getxuidhigh" }, + { 0x6525E4093AC8C15D, "getxuidlow" }, + { 0xCFD94459ABE0D302, "giveaccessory" }, + { 0xCD350B8CB786A21F, "giveachievement" }, + { 0xE9F7FB3B9F2DA2F7, "giveandfireoffhand" }, + { 0xCB4BD8C0114EF7D6, "giveexecution" }, + { 0xA48787F7C04D6C58, "givemaxammo" }, + { 0x91991726F6EAE8D2, "givestartammo" }, + { 0xEB90439FF464A7D4, "giveweapon" }, + { 0x46D468323565D63B, "glanceatentity" }, + { 0xE84C347205D6B6DA, "glanceatpos" }, + { 0x9FBE963140D0E772, "hasattachment" }, + { 0x0B329FB597C6AE29, "hasfemalecustomizationmodel" }, + { 0x527EA6DE6281D2CA, "haslastgroundorigin" }, + { 0x2978A43CB47BDD23, "hasloadedcustomizationplayerview" }, + { 0xBBEC0624530F7778, "hasloadedcustomizationviewmodels" }, + { 0x1EAE77053CFC5DE4, "hasloadedviewweapons" }, + { 0xD4D2077A777A58A6, "hasplayerdata" }, + { 0x2BF45DCAEBDB87A5, "hastacvis" }, + { 0xE28E592D8C367227, "hasweapon" }, + { 0x32C573CA9CC63169, "hide" }, + { 0x55010FB1508E6E62, "hideallparts" }, + { 0xBDD991788098D54C, "hidefromplayer" }, + { 0x8656DF4A0C4E8DE0, "hidepart" }, + { 0x9B7A1927CACBBFAE, "hidepartandchildren_allinstances" }, + { 0x31F6BB2999CD5EF0, "hudoutlinedisable" }, + { 0xC293BF1899F1A290, "hudoutlinedisableforclient" }, + { 0xDC90261A8E693939, "hudoutlinedisableforclients" }, + { 0xD0A5456E513E66B3, "hudoutlineenable" }, + { 0xA099A979CA65F9C5, "hudoutlineenableforclient" }, + { 0x97E96CD81E442B42, "hudoutlineenableforclients" }, + { 0x394E89398C3FCD9A, "hudoutlineviewmodeldisable" }, + { 0x961FF3459F34EA11, "hudoutlineviewmodelenable" }, + { 0x0131F6FB305015D0, "id_0131F6FB305015D0" }, + { 0x01E8542A707A8002, "id_01E8542A707A8002" }, + { 0x0236BB8DE012BBAE, "id_0236BB8DE012BBAE" }, + { 0x038932CC1EF28756, "id_038932CC1EF28756" }, + { 0x03DDA404001A83EE, "id_03DDA404001A83EE" }, + { 0x05C5C9CBAE3114B0, "id_05C5C9CBAE3114B0" }, + { 0x0617199566A43446, "id_0617199566A43446" }, + { 0x063E394BE383AEC3, "id_063E394BE383AEC3" }, + { 0x06EF849BEE4B12DD, "id_06EF849BEE4B12DD" }, + { 0x0928FE2F2298BEAC, "id_0928FE2F2298BEAC" }, + { 0x0A055801DA45D769, "id_0A055801DA45D769" }, + { 0x0A7E757D42B550A6, "id_0A7E757D42B550A6" }, + { 0x0AA7CFAF65F9B354, "id_0AA7CFAF65F9B354" }, + { 0x0BDCB37A9431E654, "id_0BDCB37A9431E654" }, + { 0x0C26A2350F081DC6, "id_0C26A2350F081DC6" }, + { 0x0C7F3AC96DD01424, "id_0C7F3AC96DD01424" }, + { 0x0CEBD47970F60E9B, "id_0CEBD47970F60E9B" }, + { 0x0DF8FAD503896462, "id_0DF8FAD503896462" }, + { 0x0F134F30C17FAEAF, "id_0F134F30C17FAEAF" }, + { 0x0F5FC845BE4CA3BE, "id_0F5FC845BE4CA3BE" }, + { 0x0F7CFF9F6DAFB297, "id_0F7CFF9F6DAFB297" }, + { 0x0F96CAFFD866A1B2, "id_0F96CAFFD866A1B2" }, + { 0x100D3BF35FCA6A7F, "id_100D3BF35FCA6A7F" }, + { 0x106BCE0AEEE91D2C, "id_106BCE0AEEE91D2C" }, + { 0x113C9C35CAF6F029, "id_113C9C35CAF6F029" }, + { 0x11C1DE42F0B2B2A7, "id_11C1DE42F0B2B2A7" }, + { 0x129CBB4366307F50, "id_129CBB4366307F50" }, + { 0x12BCADDB0B667075, "id_12BCADDB0B667075" }, + { 0x136ADFF8F817FAD6, "id_136ADFF8F817FAD6" }, + { 0x136D20776DF768D2, "id_136D20776DF768D2" }, + { 0x148259B5EDF82F38, "id_148259B5EDF82F38" }, + { 0x1807967EA2130C2D, "id_1807967EA2130C2D" }, + { 0x1AFF80C5FC5A3EEA, "id_1AFF80C5FC5A3EEA" }, + { 0x1C339DAABA3F71DB, "id_1C339DAABA3F71DB" }, + { 0x1CD1EE312FD03BB4, "id_1CD1EE312FD03BB4" }, + { 0x2129E0E4D014E1B3, "id_2129E0E4D014E1B3" }, + { 0x22A4A7E20BFE463B, "id_22A4A7E20BFE463B" }, + { 0x247AD6A91F6A4FFE, "id_247AD6A91F6A4FFE" }, + { 0x24CB3B5E0D4216B1, "id_24CB3B5E0D4216B1" }, + { 0x24EB7F77BC5E5950, "id_24EB7F77BC5E5950" }, + { 0x27BB46EAF2ECD374, "id_27BB46EAF2ECD374" }, + { 0x2E8DE69E35A63F1D, "id_2E8DE69E35A63F1D" }, + { 0x2EBB84EC61FCFAAF, "id_2EBB84EC61FCFAAF" }, + { 0x2F6B8C6721D18B0B, "id_2F6B8C6721D18B0B" }, + { 0x31F315111C6A03C2, "id_31F315111C6A03C2" }, + { 0x33010A90BCF48DB4, "id_33010A90BCF48DB4" }, + { 0x337E400EAD27B7BD, "id_337E400EAD27B7BD" }, + { 0x35501B42058D4DE9, "id_35501B42058D4DE9" }, + { 0x360874D9808F0724, "id_360874D9808F0724" }, + { 0x362521BCB3A1BA25, "id_362521BCB3A1BA25" }, + { 0x368AF07F7897FD79, "id_368AF07F7897FD79" }, + { 0x38E25FA379161404, "id_38E25FA379161404" }, + { 0x3993C643D423122A, "id_3993C643D423122A" }, + { 0x3AA858D217FB4A1A, "id_3AA858D217FB4A1A" }, + { 0x3AC2D6250A4C3F42, "id_3AC2D6250A4C3F42" }, + { 0x3C6BB30AE7106B7A, "id_3C6BB30AE7106B7A" }, + { 0x3DE79443C911D4A5, "id_3DE79443C911D4A5" }, + { 0x3FEB119F85F6CD82, "id_3FEB119F85F6CD82" }, + { 0x4012509DBD1CEE6F, "id_4012509DBD1CEE6F" }, + { 0x415FE9EECA7B2E2B, "id_415FE9EECA7B2E2B" }, + { 0x451319F93D30EBE5, "id_451319F93D30EBE5" }, + { 0x45AF0F78C1D76035, "id_45AF0F78C1D76035" }, + { 0x46CA2675C0578280, "id_46CA2675C0578280" }, + { 0x47933F5EB9F65AFE, "id_47933F5EB9F65AFE" }, + { 0x47A2FC8FDEEDA75F, "id_47A2FC8FDEEDA75F" }, + { 0x480DEAF73792CCF1, "id_480DEAF73792CCF1" }, + { 0x481C2A63F2BA3332, "id_481C2A63F2BA3332" }, + { 0x4A13111B050F0B72, "id_4A13111B050F0B72" }, + { 0x4BEB9F7715504995, "id_4BEB9F7715504995" }, + { 0x4C108309DC0D7FD2, "id_4C108309DC0D7FD2" }, + { 0x4CD0EAF5381F92DB, "id_4CD0EAF5381F92DB" }, + { 0x4DB6FC194702D153, "id_4DB6FC194702D153" }, + { 0x4E8D00B0EE5D3BBB, "id_4E8D00B0EE5D3BBB" }, + { 0x4EA7891F787C6725, "id_4EA7891F787C6725" }, + { 0x4EB77980AFFDBEFB, "id_4EB77980AFFDBEFB" }, + { 0x4F1027E74D5073C4, "id_4F1027E74D5073C4" }, + { 0x4F19CF7B3C28ACD7, "id_4F19CF7B3C28ACD7" }, + { 0x504A5E2DF31069A4, "id_504A5E2DF31069A4" }, + { 0x50B964D023C440E8, "id_50B964D023C440E8" }, + { 0x5226227BCE83EBE9, "id_5226227BCE83EBE9" }, + { 0x522FB0CBB445CDC8, "id_522FB0CBB445CDC8" }, + { 0x523285BABAB34E5B, "id_523285BABAB34E5B" }, + { 0x5304F90E15C214D2, "id_5304F90E15C214D2" }, + { 0x5329138A845B7AA6, "id_5329138A845B7AA6" }, + { 0x53FB16FCB6043BBC, "id_53FB16FCB6043BBC" }, + { 0x555E2D32E2756625, "id_555E2D32E2756625" }, + { 0x5621E511B99964A7, "id_5621E511B99964A7" }, + { 0x564951237DCCFEC8, "id_564951237DCCFEC8" }, + { 0x5762CF97C6F1A2C1, "id_5762CF97C6F1A2C1" }, + { 0x5847240C0F9900F2, "id_5847240C0F9900F2" }, + { 0x5919151DD97650D2, "id_5919151DD97650D2" }, + { 0x5B5D9B0857469A76, "id_5B5D9B0857469A76" }, + { 0x5BE35054519DA350, "id_5BE35054519DA350" }, + { 0x5CBCEA7C92BD937F, "id_5CBCEA7C92BD937F" }, + { 0x5E69FA9CFA2546EC, "id_5E69FA9CFA2546EC" }, + { 0x616C0CA219597829, "id_616C0CA219597829" }, + { 0x62004D7561FD321E, "id_62004D7561FD321E" }, + { 0x635E39FC16A64657, "id_635E39FC16A64657" }, + { 0x638EEBEFF841E16A, "id_638EEBEFF841E16A" }, + { 0x644ED519CAC9722B, "id_644ED519CAC9722B" }, + { 0x64D8AE560C3EC9B6, "id_64D8AE560C3EC9B6" }, + { 0x65AA053C077C003A, "id_65AA053C077C003A" }, + { 0x670863FC4008C3D8, "id_670863FC4008C3D8" }, + { 0x681750C19A6216CA, "id_681750C19A6216CA" }, + { 0x68F50ADA6E19D8F4, "id_68F50ADA6E19D8F4" }, + { 0x6954A8D7BA8CD9FB, "id_6954A8D7BA8CD9FB" }, + { 0x6A325F91941ED47C, "id_6A325F91941ED47C" }, + { 0x6ADB0980232F3EFF, "id_6ADB0980232F3EFF" }, + { 0x6B4C8718BC36D1EF, "id_6B4C8718BC36D1EF" }, + { 0x6B75060E643E52E9, "id_6B75060E643E52E9" }, + { 0x6D14D24A1888C646, "id_6D14D24A1888C646" }, + { 0x6D897C252A37C080, "id_6D897C252A37C080" }, + { 0x6DC7C9BE085F4137, "id_6DC7C9BE085F4137" }, + { 0x6F55D55CCFF20D14, "id_6F55D55CCFF20D14" }, + { 0x6FB381A0318778F5, "id_6FB381A0318778F5" }, + { 0x720152D5D95E2D86, "id_720152D5D95E2D86" }, + { 0x7398D812FCA0292F, "id_7398D812FCA0292F" }, + { 0x73CC0F04C4C5001D, "id_73CC0F04C4C5001D" }, + { 0x73DEC7A4D991183E, "id_73DEC7A4D991183E" }, + { 0x73EF2FE03A776CD7, "id_73EF2FE03A776CD7" }, + { 0x742E699E544869C2, "id_742E699E544869C2" }, + { 0x746D32FAC66E0B73, "id_746D32FAC66E0B73" }, + { 0x75BCEB766D71DD0A, "id_75BCEB766D71DD0A" }, + { 0x75FEDA26550D4F0E, "id_75FEDA26550D4F0E" }, + { 0x76B3CFB91EF40B3B, "id_76B3CFB91EF40B3B" }, + { 0x76D6356C94F30473, "id_76D6356C94F30473" }, + { 0x76FA53E72547FF02, "id_76FA53E72547FF02" }, + { 0x770B783881F2C148, "id_770B783881F2C148" }, + + { 0x77320E794D35465A, "id_77320E794D35465A" }, + { 0x7739EDA9DBAC25AC, "id_7739EDA9DBAC25AC" }, + { 0x784F000D59E38105, "id_784F000D59E38105" }, + { 0x786FEE88B4749DFF, "id_786FEE88B4749DFF" }, + { 0x788D3C14D6B4BA6B, "id_788D3C14D6B4BA6B" }, + { 0x78EC884C707A6ADC, "id_78EC884C707A6ADC" }, + { 0x792B01BD9710F266, "id_792B01BD9710F266" }, + { 0x793F941D7DFF15ED, "id_793F941D7DFF15ED" }, + { 0x7ADFCC654DD371DA, "id_7ADFCC654DD371DA" }, + { 0x7B738B973A0B7F94, "id_7B738B973A0B7F94" }, + { 0x7E483D6E6B4B5688, "id_7E483D6E6B4B5688" }, + { 0x7E73001E97FE87B9, "id_7E73001E97FE87B9" }, + { 0x7EE20CF3C0390E21, "id_7EE20CF3C0390E21" }, + { 0x80715C3A9A2DDF68, "id_80715C3A9A2DDF68" }, + { 0x80902296B05BE00A, "id_80902296B05BE00A" }, + { 0x82DC9AE1B5CADB32, "id_82DC9AE1B5CADB32" }, + { 0x8420670EAFC8D391, "id_8420670EAFC8D391" }, + { 0x853086956EE45C36, "id_853086956EE45C36" }, + { 0x869F129F31D72088, "id_869F129F31D72088" }, + { 0x86AF48E06C94360A, "id_86AF48E06C94360A" }, + { 0x89931185060D4D6F, "id_89931185060D4D6F" }, + { 0x8ABE5A968CC3C220, "id_8ABE5A968CC3C220" }, + { 0x8B7829A01E6B58AA, "id_8B7829A01E6B58AA" }, + { 0x8CA38A054F432FF2, "id_8CA38A054F432FF2" }, + { 0x8FA29BF693C94B27, "id_8FA29BF693C94B27" }, + { 0x8FF8FD7841F6EBA2, "id_8FF8FD7841F6EBA2" }, + { 0x90069777043E7833, "id_90069777043E7833" }, + { 0x9215CE6FC83759B9, "id_9215CE6FC83759B9" }, + { 0x9227C84D3FB311A3, "id_9227C84D3FB311A3" }, + { 0x923D9644AB0B076F, "id_923D9644AB0B076F" }, + { 0x92435C7A6AE85C3C, "id_92435C7A6AE85C3C" }, + { 0x952292D70C3BD39C, "id_952292D70C3BD39C" }, + { 0x95874C67F460495F, "id_95874C67F460495F" }, + { 0x95D5375059C2A022, "id_95D5375059C2A022" }, + { 0x95F0EDA7E462E30F, "id_95F0EDA7E462E30F" }, + { 0x95F24FBB015EE513, "id_95F24FBB015EE513" }, + { 0x962A6476FE1C33EE, "id_962A6476FE1C33EE" }, + { 0x96F814CC20CBF3D5, "id_96F814CC20CBF3D5" }, + { 0x97BB81ACBB14C09C, "id_97BB81ACBB14C09C" }, + { 0x97E11A84480635BC, "id_97E11A84480635BC" }, + { 0x989FAA3E2F2D8C47, "id_989FAA3E2F2D8C47" }, + { 0x98A42C6D882AAE10, "id_98A42C6D882AAE10" }, + { 0x9A5E0E2D6D715BB1, "id_9A5E0E2D6D715BB1" }, + { 0x9AF4C9B2CC1BF989, "id_9AF4C9B2CC1BF989" }, + { 0x9B28BD480AAAD85F, "id_9B28BD480AAAD85F" }, + { 0x9B5704D0633B87FA, "id_9B5704D0633B87FA" }, + { 0x9C471A7E95A2747E, "id_9C471A7E95A2747E" }, + { 0x9CA5B32676727F92, "id_9CA5B32676727F92" }, + { 0x9CC921A57FF4DEB5, "id_9CC921A57FF4DEB5" }, + { 0x9DE349505D658EFF, "id_9DE349505D658EFF" }, + { 0x9E200FD4120297E8, "id_9E200FD4120297E8" }, + { 0x9E7F47B1711DCA62, "id_9E7F47B1711DCA62" }, + { 0x9EFF7048A5747CC5, "id_9EFF7048A5747CC5" }, + { 0xA29879BF1276A08A, "id_A29879BF1276A08A" }, + { 0xA33073D6FD58E58E, "id_A33073D6FD58E58E" }, + { 0xA4A9E73B2D25FF8B, "id_A4A9E73B2D25FF8B" }, + { 0xA7DE57196F4B5D16, "id_A7DE57196F4B5D16" }, + { 0xAA015A529E61C67D, "id_AA015A529E61C67D" }, + { 0xAB2BDDB6CD03A29D, "id_AB2BDDB6CD03A29D" }, + { 0xAC1512504BA75F25, "id_AC1512504BA75F25" }, + { 0xAD3C975CB94E4736, "id_AD3C975CB94E4736" }, + { 0xAF4B9B0F0E7C6C42, "id_AF4B9B0F0E7C6C42" }, + { 0xB02C8E799779BC10, "id_B02C8E799779BC10" }, + { 0xB096B58FB3808D26, "id_B096B58FB3808D26" }, + { 0xB0AF0DD0F9B4FDDF, "id_B0AF0DD0F9B4FDDF" }, + { 0xB13377D16B8E41DE, "id_B13377D16B8E41DE" }, + { 0xB1E64D364CF55B73, "id_B1E64D364CF55B73" }, + { 0xB2617441D2B73E0B, "id_B2617441D2B73E0B" }, + { 0xB2ED366433A3D074, "id_B2ED366433A3D074" }, + { 0xB32C297F5ACB1689, "id_B32C297F5ACB1689" }, + { 0xB4D14C500183CBD6, "id_B4D14C500183CBD6" }, + { 0xB661B022700BA72F, "id_B661B022700BA72F" }, + { 0xB88C89BB7CD1AB8E, "id_B88C89BB7CD1AB8E" }, + { 0xB96CEA3BA44FC035, "id_B96CEA3BA44FC035" }, + { 0xBABD8AF3054D8ABE, "id_BABD8AF3054D8ABE" }, + { 0xBAC81C2C3A5BEBE0, "id_BAC81C2C3A5BEBE0" }, + { 0xBACD2D0ACDF8559E, "id_BACD2D0ACDF8559E" }, + { 0xBB04491D50D9E43E, "id_BB04491D50D9E43E" }, + { 0xBB91C271085A7728, "id_BB91C271085A7728" }, + { 0xBC667001F9DD3808, "id_BC667001F9DD3808" }, + { 0xBCB138D52B53D94D, "id_BCB138D52B53D94D" }, + { 0xBCC86382F02470E6, "id_BCC86382F02470E6" }, + { 0xBE2F606DBAA90A7D, "id_BE2F606DBAA90A7D" }, + { 0xBFE38F2FB8999E70, "id_BFE38F2FB8999E70" }, + { 0xC0505F05660D120C, "id_C0505F05660D120C" }, + { 0xC0A39ABE7EC43AD8, "id_C0A39ABE7EC43AD8" }, + { 0xC0DE39048EEDDE94, "id_C0DE39048EEDDE94" }, + { 0xC1092F42B6BBE490, "id_C1092F42B6BBE490" }, + { 0xC22254916FDFA3E5, "id_C22254916FDFA3E5" }, + { 0xC33DBA6864D01D35, "id_C33DBA6864D01D35" }, + { 0xC3A5505BC8F25A14, "id_C3A5505BC8F25A14" }, + { 0xC4E0716FBD549E2D, "id_C4E0716FBD549E2D" }, + { 0xC4F5A500340FE6C2, "id_C4F5A500340FE6C2" }, + { 0xC5140FFF72FECA2D, "id_C5140FFF72FECA2D" }, + { 0xC664A2459D6F3EAA, "id_C664A2459D6F3EAA" }, + { 0xC682F38A22EA89D6, "id_C682F38A22EA89D6" }, + { 0xC6CB3E654225077A, "id_C6CB3E654225077A" }, + { 0xC982E24E79A06BD1, "id_C982E24E79A06BD1" }, + { 0xCA38A887735B9B48, "id_CA38A887735B9B48" }, + { 0xD00232775A05290E, "id_D00232775A05290E" }, + { 0xD043DD116C449128, "id_D043DD116C449128" }, + { 0xD068AF002E4ECAB5, "id_D068AF002E4ECAB5" }, + { 0xD09168B16803F5BE, "id_D09168B16803F5BE" }, + { 0xD2E41C7603BA7697, "id_D2E41C7603BA7697" }, + { 0xD493E7FE15E5EAF4, "id_D493E7FE15E5EAF4" }, + { 0xD5592214ACC99425, "id_D5592214ACC99425" }, + { 0xD743EBE29C5A6E7F, "id_D743EBE29C5A6E7F" }, + { 0xD87E1768229D0E3E, "id_D87E1768229D0E3E" }, + { 0xD90515F5E17DBC6F, "id_D90515F5E17DBC6F" }, + { 0xD92F18565AAD28EC, "id_D92F18565AAD28EC" }, + { 0xD955A85131DC6E69, "id_D955A85131DC6E69" }, + { 0xDA187BCAE911D661, "id_DA187BCAE911D661" }, + { 0xDA5D6F8B4926CB90, "id_DA5D6F8B4926CB90" }, + { 0xDB073176839D77FB, "id_DB073176839D77FB" }, + { 0xDB099ADC4053DA52, "id_DB099ADC4053DA52" }, + { 0xDBEA4C5599DD67DE, "id_DBEA4C5599DD67DE" }, + { 0xDBF8692A4C239DCF, "id_DBF8692A4C239DCF" }, + { 0xDCEC5EA95982C90C, "id_DCEC5EA95982C90C" }, + { 0xDD5661EBE3C9A5A2, "id_DD5661EBE3C9A5A2" }, + { 0xDD6D30B9EC87C1B3, "id_DD6D30B9EC87C1B3" }, + { 0xDF303D9C05757E6B, "id_DF303D9C05757E6B" }, + { 0xDF95FE0FCEE94BF3, "id_DF95FE0FCEE94BF3" }, + { 0xDFB78B3E724AD620, "id_DFB78B3E724AD620" }, + { 0xE0201404A8B6F664, "id_E0201404A8B6F664" }, + { 0xE1B085052385D056, "id_E1B085052385D056" }, + { 0xE29E60C655E1220B, "id_E29E60C655E1220B" }, + { 0xE2FC2D773338E90F, "id_E2FC2D773338E90F" }, + { 0xE3DADB2823F1DA8A, "id_E3DADB2823F1DA8A" }, + { 0xE40102956C887F7C, "id_E40102956C887F7C" }, + { 0xE451EECC3A7441C3, "id_E451EECC3A7441C3" }, + { 0xE4A38A7C9732F011, "id_E4A38A7C9732F011" }, + { 0xE4B58A023E0DA030, "id_E4B58A023E0DA030" }, + { 0xE4CCD01FB7EC7A6F, "id_E4CCD01FB7EC7A6F" }, + { 0xE4FE23E19F4BF900, "id_E4FE23E19F4BF900" }, + { 0xE5BF22923D0004BC, "id_E5BF22923D0004BC" }, + { 0xE5D1AE0CF82E3E7A, "id_E5D1AE0CF82E3E7A" }, + { 0xE64EA2B4E79C4B74, "id_E64EA2B4E79C4B74" }, + { 0xE69D7896FA6E5D23, "id_E69D7896FA6E5D23" }, + { 0xE70C1FC3C2E5E05F, "id_E70C1FC3C2E5E05F" }, + { 0xE862ED56B787162B, "id_E862ED56B787162B" }, + { 0xE89F2BDB307F137E, "id_E89F2BDB307F137E" }, + { 0xE8CA4080D02A0BB4, "id_E8CA4080D02A0BB4" }, + { 0xE8E6D2926FD6D61E, "id_E8E6D2926FD6D61E" }, + { 0xE99626ADD202FE1A, "id_E99626ADD202FE1A" }, + { 0xEA50442798FCA4C1, "id_EA50442798FCA4C1" }, + { 0xEA63241A4D3092C4, "id_EA63241A4D3092C4" }, + { 0xEB0326E0C8803F41, "id_EB0326E0C8803F41" }, + { 0xEB2255B847E6681C, "id_EB2255B847E6681C" }, + { 0xEC5F4851431F3382, "id_EC5F4851431F3382" }, + { 0xEE85446AFC7CB0A8, "id_EE85446AFC7CB0A8" }, + { 0xEF7982D1F82E7A51, "id_EF7982D1F82E7A51" }, + { 0xF1DCADC8F7C3477C, "id_F1DCADC8F7C3477C" }, + { 0xF23F106F8976771D, "id_F23F106F8976771D" }, + { 0xF35957C991FCFD3F, "id_F35957C991FCFD3F" }, + { 0xF484B2C51E0D6F5E, "id_F484B2C51E0D6F5E" }, + { 0xF4D54A90334A7DEA, "id_F4D54A90334A7DEA" }, + { 0xF51FF412609193B9, "id_F51FF412609193B9" }, + { 0xF566102230D6730D, "id_F566102230D6730D" }, + { 0xF662E31DF8183BF8, "id_F662E31DF8183BF8" }, + { 0xF6C07D6EA7D83A5A, "id_F6C07D6EA7D83A5A" }, + { 0xF771642D3445111F, "id_F771642D3445111F" }, + { 0xF7D83C92F61DCC31, "id_F7D83C92F61DCC31" }, + { 0xFA1DA77265660058, "id_FA1DA77265660058" }, + { 0xFAC544C98A3D9EB4, "id_FAC544C98A3D9EB4" }, + { 0xFB02BE5D663ECA13, "id_FB02BE5D663ECA13" }, + { 0xFC1C1E51058904A3, "id_FC1C1E51058904A3" }, + { 0xFD165588822885F4, "id_FD165588822885F4" }, + { 0xFDA3FD9342329F97, "id_FDA3FD9342329F97" }, + { 0xFE283BAD58880808, "id_FE283BAD58880808" }, + { 0xFF4AA047884E7A14, "id_FF4AA047884E7A14" }, + { 0xFC315ED3FE3A507C, "ignorecharacterduringspawnselection" }, + { 0x0100402BE61E8FE5, "iprintln" }, + { 0xD55733A782411736, "iprintlnbold" }, + { 0x1183AF9C0E182E99, "isadditionalstreamposready" }, + { 0xAD7A433C5FDC0E1E, "isalternatemode" }, + { 0x4F9F707A93134F1A, "isatvalidlongdeathspot" }, + { 0x998B957242400227, "isbadguy" }, + { 0x2E13C350C246A363, "isbasejumpavailable" }, + { 0x354A88A1AE97D097, "isbnetigrplayer" }, + { 0xFFD1B2A9EFBE4C8F, "isconsoleplayer" }, + { 0x8895A2C2DF3CE1B6, "iscoverinvalidagainstenemy" }, + { 0xFEE4F7BDB29FDEB1, "iscovermultinode" }, + { 0x2044642E85837DD4, "iscurrentenemyvalid" }, + { 0x7C088C03910E07FC, "isdismembermentenabledforplayer" }, + { 0x6B2989BFC261D754, "isdroppingweapon" }, + { 0x97A4853615108E0A, "isdualwielding" }, + { 0xABA489205543F8CD, "isfireteamleader" }, + { 0xBFC3BABF6E5F87F8, "isfiringturret" }, + { 0x9CBA61B67B617A8C, "isfiringvehicleturret" }, + { 0x08F3BA7AA1F0DD0E, "isgestureplaying" }, + { 0x53650589F7A84347, "isguest" }, + { 0xAF0D0F39FC4B4B67, "ishighjumping" }, + { 0xA248D29E7073AC21, "ishighpriorityweapon" }, + { 0xC70FA4A09705B8BE, "isholdingbreath" }, + { 0xE22B75DA9E05AF3B, "ishost" }, + { 0xCFA4F7139B71EF7C, "isinexecutionattack" }, + { 0x47A9783005DC7250, "isinexecutionvictim" }, + { 0x337EB814D7F501A1, "isinfreefall" }, + { 0x443B962DAA3D5115, "isinscriptedstate" }, + { 0x549D91F864FDC52E, "isinvulnerable" }, + { 0x0AF4CE53A5E49A87, "isitemunlocked" }, + { 0x82472A3FD59ED647, "isjumping" }, + { 0x2C270E1FD42FF3A1, "isknownenemyinradius" }, + { 0x3193DFE64E15ADBC, "islinked" }, + { 0x5E2AB0068E5BAD5D, "ismantling" }, + { 0xC803F85ABCFED831, "ismeleeing" }, + { 0xD176EA93DB1DBF97, "ismlgaerialcamenabled" }, + { 0x06E612AEE08B73FC, "ismlgfollowdroneactive" }, + { 0x850140D0692B9657, "ismlgfreecamenabled" }, + { 0x36E2A39DC6B2F1CA, "isnearanyplayer" }, + { 0xDF8BC664F794195C, "isnightvisionon" }, + { 0x5424D7ECD54FE164, "isnodeinbadplace" }, + { 0x2A39239644A01B94, "isnodelmgmountable" }, + { 0x14E63B2DEDCCCD69, "isoffhandweaponreadytothrow" }, + { 0x05854427EC968B7F, "isonground" }, + { 0xC126FCCAEC23F3C0, "isonladder" }, + { 0x95403901630F2409, "isonornearstairs" }, + { 0xBF19835F22615D63, "isparachuting" }, + { 0x75A43CE5D923D115, "ispcplayer" }, + { 0x1D0F11FD5BAD5637, "isplayerheadless" }, + { 0xA1C0A51CE6F35F86, "ispredictedstreamposready" }, + { 0xE5774856243EE461, "isps4player" }, + { 0x52E412942FA24FC4, "isragdoll" }, + { 0x3C41DCAA52BF73CC, "israisingweapon" }, + { 0x1DA1DA85FE03A260, "isreloading" }, + { 0x3B81A5990EFCC8C2, "isscriptable" }, + { 0xF505EE964E5B6BD3, "isscriptedmeleeactive" }, + { 0xAF29E282A6FCB9BC, "isshooting" }, + { 0x322A3E09BE24DC4C, "issilenced" }, + { 0xD3F7B7E11D3FB7F3, "isskydiving" }, + { 0x3EE3F152E67352AC, "isspectatingplayer" }, + { 0xF3D6A963ECAA233A, "issplitscreenplayer" }, + { 0xD51DDAB4EBF3E3EC, "issplitscreenplayerprimary" }, + { 0x557CC86610E7D32F, "issprinting" }, + { 0xFBF875A0A2714155, "issprintsliding" }, + { 0x36C4363105C3D7EF, "isstanceallowed" }, + { 0x2E2A1792F87C048C, "issupersprinting" }, + { 0x24A0D5CF0C69F123, "issuppressed" }, + { 0xE777FD61D84D169A, "issuspendedvehicle" }, + { 0xCE513DBB211B9CA3, "isswitchingweapon" }, + { 0x2939787B838BFAF5, "istacmapactive" }, + { 0x70E1AC84D8EDAF90, "isthrowingbackgrenade" }, + { 0x5E0155D2ED8E1135, "isthrowinggrenade" }, + { 0x0952E3B5B0E09694, "istouching" }, + { 0x13F0E59341B21AB3, "isufo" }, + { 0x136A900C25453ABD, "isusable" }, + { 0x4D2CBCA7C991FEB8, "isuseinprogress" }, + { 0xFBEE7A8A7B4601DB, "isusingonlinedataoffline" }, + { 0x0DBB58D02382A2AD, "isusingturret" }, + { 0x2214763653399E92, "isviewmodelanimplaying" }, + { 0x7A54580B6C0B6650, "iswallrunning" }, + { 0x9468C8B50277030D, "isxb3player" }, + { 0xDBA49092EEFE681C, "itemweaponsetammo" }, + { 0x949B7A1A9760A5CD, "jumpbuttonpressed" }, + { 0x206784E76BC07965, "kill" }, + { 0x8119E0C3586A7D2C, "knockback" }, + { 0xFA924B0DC8E0DE95, "laseroff" }, + { 0x3A590F4852A892D9, "laseron" }, + { 0xAE9CBF99AAEB0F96, "lastknownpos" }, + { 0x34064B9A0DA77AAD, "lastknowntime" }, + { 0x027976C5F014BF4A, "laststandrevive" }, + { 0xC2ADFD0D96DC80C0, "launchgrenade" }, + { 0xCEE19669A2EFC067, "lerpfov" }, + { 0x7C10F8E02B200109, "lerpfovbypreset" }, + { 0x82627BF045193E88, "lerpfovscalefactor" }, + { 0x5D35558E8668CB0F, "lerpviewangleclamp" }, + { 0x38026163121F9DE4, "linkto" }, + { 0x4FD0FA317DA15A0A, "linktoblendtotag" }, + { 0x56A794B1996910EE, "linktomoveoffset" }, + { 0xC06DDF84A15F473E, "loadcustomization" }, + { 0xEF18097941689102, "loadcustomizationplayerview" }, + { 0x0FD4A80EF9C97C60, "loadweaponsforplayer" }, + { 0x6ACCA95A7E2802D9, "localtoworldcoords" }, + { 0xA0E3C8E718CB4F1B, "lockdeathcamera" }, + { 0xA688A581F7CAB1EB, "logclientmatchdatadeath" }, + { 0xB43A7D1A20473665, "logstatmatchguid" }, + { 0x43D87A9D6D453AFD, "longdeathkillme" }, + { 0x9A10E3E7BF8B0740, "magicgrenademanual" }, + { 0xB20AA8605B19F156, "makecollidewithitemclip" }, + { 0xBB0274C3BA779683, "makecorpse" }, + { 0x37EF5C04D3C15FA8, "makeentitynomeleetarget" }, + { 0x963D4EF848D1ED5E, "makeentitysentient" }, + { 0x56C1537EFC753438, "makeportableradar" }, + { 0xE545F16822C65F8A, "makescrambler" }, + { 0xBA79FA0D16F114A6, "maketurretinoperable" }, + { 0x69EB22C39445E14D, "maketurretoperable" }, + { 0x600F9A09F8A95B80, "makeunusable" }, + { 0x5E03F3D2F6B324F7, "makeusable" }, + { 0x027105C762E67937, "makevehiclesolidcapsule" }, + { 0xD5E1B048322A19D9, "markkeyframedmover" }, + { 0x1208072961CF4FE8, "maymovefrompointtopoint" }, + { 0x7E1E3E65BDD0F1CC, "maymovetopoint" }, + { 0x375174A05799AFF7, "melee" }, + { 0x2AF9A19237332C6F, "meleebuttonpressed" }, + { 0xB597980CC9953180, "missile_cleartarget" }, + { 0x801565473C6ACE64, "missile_setflightmodedirect" }, + { 0x2784B2E0F7BCA454, "missile_setflightmodetop" }, + { 0x82AB453DA7D13C1E, "missile_settargetent" }, + { 0x3F125D3E31D9399D, "missile_settargetpos" }, + { 0x5EC31CB01343AF2D, "missilehidetrail" }, + { 0xDA68A2AA5E34A15B, "missileoutline" }, + { 0x415DD90F47E20FE2, "missilethermal" }, + { 0xDFACCFEDC85292CA, "motionblurhqenable" }, + { 0xA9AD565C79A02795, "motionwarp" }, + { 0x07D53324F93E09AB, "motionwarpcancel" }, + { 0xC13CC23AC019EEA4, "motionwarpwithanim" }, + { 0xC49B76F0D7CF924E, "movegravity" }, + { 0xEEACFC952A4FDFFB, "moveovertime" }, + { 0x94F7291A2571CEDE, "moveshieldmodel" }, + { 0x976E1205710620D9, "moveto" }, + { 0x431D708AB1FDC9DE, "movez" }, + { 0x31C036BFB46D27DB, "nearnode" }, + { 0x15C5920A5F714A21, "nightvisionviewoff" }, + { 0x191AEFE9BCDF64A5, "nightvisionviewon" }, + { 0x476ADAB9443FCB00, "nodeisactivated" }, + { 0x29EF823BD979B44E, "nodeisdisconnected" }, + { 0x5D4BDA38743E3DE2, "normalizeworldupreferenceangles" }, + { 0x515D894BBD5F0E45, "notifyonplayercommand" }, + { 0xF2B3F015CECCDB1D, "notifyonplayercommandremove" }, + { 0x6DE2B3ED80D71599, "notsolid" }, + { 0xD4D4447319E69852, "openmenu" }, + { 0xCD011DBE54679E33, "orientmode" }, + { 0xCD8D697AA951B0CE, "overridevehicleseatanimconditionals" }, + { 0x4729E2D36EF1B42A, "painvisionoff" }, + { 0xB65223104A5063B0, "painvisionon" }, + { 0xAD41EEAE8A5EEACC, "pathdisttogoal" }, + { 0xA934D958262A217C, "physics_applyimpulse" }, + { 0x3EEB27F83E98FEF0, "physics_getbodyid" }, + { 0x01C7217B55ACFB77, "physics_getcharactercollisioncapsule" }, + { 0x8032876808722532, "physics_getentitycenterofmass" }, + { 0xBF2EF5A235C9027B, "physics_getnumbodies" }, + { 0xDCDF1A14A0836038, "physics_registerforcollisioncallback" }, + { 0xD536A7E7E1CDE7FD, "physics_takecontrol" }, + { 0xD674DED8F59FC6A3, "physics_unregisterforcollisioncallback" }, + { 0x42B47A751E2E910A, "physicslaunchclient" }, + { 0xDEAA6DA341CAEF26, "physicslaunchserver" }, + { 0x3F14AA5B107E63E5, "physicslaunchserveritem" }, + { 0x16D21B5D75F7DF39, "physicsstopserver" }, + { 0x0AD502E3712A9B51, "pickupgrenade" }, + { 0xBBC12D42B4B589A9, "playanimscriptsceneevent" }, + { 0x1B1459FB74EA5DD5, "playannouncersound" }, + { 0x8092F0FA42D27AD6, "playcinematicforplayer" }, + { 0xC4CA7CECEDFEABED, "playcontextsound" }, + { 0x702C59AAD70DE21D, "player_getrecoilscale" }, + { 0xB83D2875E1B5C358, "player_recoilscaleoff" }, + { 0xD5CE63413B833596, "player_recoilscaleon" }, + { 0x10B99B4DC0B762BE, "playerads" }, + { 0x6C7B4C09E6E4AF7A, "playerforcedeathanim" }, + { 0x23D57C0EE77ECA92, "playergetzoomfov" }, + { 0xD6FCEDD015907869, "playergetzoomlevelindex" }, + { 0xC5F49129807B6DBC, "playerhide" }, + { 0xB4E9878536500501, "playerlinkedoffsetenable" }, + { 0x6F3A5F61463D3048, "playerlinkedsetforceparentvisible" }, + { 0x6BEA5FD0573DDD8E, "playerlinkedsetviewznear" }, + { 0xE13D68A4C5BAA1CA, "playerlinkeduselinkedvelocity" }, + { 0x733BE819A1666F65, "playerlinkto" }, + { 0x3C987E407112563C, "playerlinktoabsolute" }, + { 0xA8EA433BF4D40CB8, "playerlinktoblend" }, + { 0x08E2642E7D6C0301, "playerlinktodelta" }, + { 0x7A24FF605E712786, "playerlinkweaponviewtodelta" }, + { 0x32C2E36C3236BBF9, "playermount" }, + { 0x421F7DCF6587AA71, "playermounttype" }, + { 0x455D4B5D336BC159, "playersetgroundreferenceent" }, + { 0xFB8EABB47F7119B5, "playershow" }, + { 0xF2AB0CCAA1936131, "playfx" }, + { 0x9E4502486BFAECA4, "playgestureviewmodel" }, + { 0x3DB5EA986E1F62B5, "playlocalsound" }, + { 0x0D20160E05F281EC, "playloopsound" }, + { 0x75E82B2CA719790A, "playrumblelooponentity" }, + { 0x7522193772135B58, "playrumbleonentity" }, + { 0x8BBBD8F8750572F4, "playrumbleonpositionforclient" }, + { 0xB6822A392212C77E, "playsound" }, + { 0x518A6C635FF8B5E5, "playsoundatviewheight" }, + { 0xCB26B834A7E2AC4E, "playsoundonmovingent" }, + { 0x869BA4F74AF06F52, "playsoundtoplayer" }, + { 0x58C8C959F8FE05AA, "playsoundtoteam" }, + { 0x9910BC7BF126C419, "playsurfacesound" }, + { 0xAF443AA988C18886, "playviewmodelanim" }, + { 0xDBD7F7415F250EA3, "preloadcinematicforplayer" }, + { 0xC2FB9BCF5578804C, "pushplayer" }, + { 0xD045628329BD0482, "queuedialogforplayer" }, + { 0x58E0C6F34140CE1E, "radiusdamage" }, + { 0x49D03642E41DCD65, "radiusdamagestepped" }, + + { 0x51689D477D3C685D, "reacquireclear" }, + { 0x2D8C5D5E891CEEB9, "recordbreadcrumbdataforplayer" }, + { 0x2C1FB27D8E761105, "refreshsprinttime" }, + { 0x8279D03EDC04E908, "registerentityspawnviewer" }, + { 0x1B02B1A674BC6201, "releaseclaimedtrigger" }, + { 0x34D6343AD173A672, "reloadbuttonpressed" }, + { 0xDB33EB691EFD0D82, "remotecontrolturret" }, + { 0x9FACE0D760AEADBF, "remotecontrolturretoff" }, + { 0x0A6F7DC10BC5A418, "remotecontrolvehicle" }, + { 0x9C1AD98241F7BD1D, "remotecontrolvehicleoff" }, + { 0xE3EF1175A71922A1, "remotecontrolvehicletarget" }, + { 0x4956DC83E3B26B06, "remotecontrolvehicletargetoff" }, + { 0xE8BE7D7A22735601, "reportchallengeuserevent" }, + { 0xE5E040BDB7CC9CBA, "requestcoverfind" }, + { 0xA468A24A60145DA0, "resetcarryobject" }, + { 0xE4D2129692A6C795, "resetthreatupdate" }, + { 0x5559B4FC5E22DC2B, "restorecontrolagent" }, + { 0xB9C68E7707082A7F, "restoredefaultdroppitch" }, + { 0x7C8304EF21B55CD9, "resumespeed" }, + { 0x7F0E394B79F19B5F, "rotateby" }, + { 0xFB0FF6167E305A44, "rotatepitch" }, + { 0x7FD6BB59E3019339, "rotateroll" }, + { 0x7EBF274B799AC5AB, "rotateto" }, + { 0x292AEEB8DB3D2085, "rotatevelocity" }, + { 0x15B74BFCF9933419, "rotateyaw" }, + { 0xB088F1585321F7AF, "safeteleport" }, + { 0xCCDE27C9C11196FE, "scaleovertime" }, + { 0xB809AC1036CF22C0, "scalesoundsubmix" }, + { 0x7FAD766DE6D8ADCC, "scriptableclearparententity" }, + { 0xD03730CFA8EE9AD5, "scriptabledoorangle" }, + { 0x4AD86B554A2E11BA, "scriptabledoorclose" }, + { 0xFEAA8CC14DA9BEA5, "scriptabledoorfreeze" }, + { 0x78694549A77DB1AE, "scriptabledoorisclosed" }, + { 0x40326050A9153AEF, "scriptabledoorisdouble" }, + { 0xBA31EB954C31B76E, "scriptabledooropen" }, + { 0x7ABFE86CC48F668A, "scriptableisdoor" }, + { 0x6F545DF30122E29A, "scriptableislootcache" }, + { 0x9219AF9F67542729, "scriptablesetparententity" }, + { 0x9AE2117391974459, "scriptmodelclearanim" }, + { 0xDE98681558CAD9EA, "scriptmodelpauseanim" }, + { 0x09E174ECD75DE8BC, "scriptmodelplayanim" }, + { 0xA5198E1EB36AE440, "scriptmodelplayanimdeltamotion" }, + { 0x25ABF1FBB5938A6A, "scriptmodelplayanimdeltamotionfrompos" }, + { 0xE310514352CD641F, "scriptmoveroutline" }, + { 0x60AE9BB0E39B36C3, "scriptmoverplane" }, + { 0x2E210CF155D9BA96, "scriptmoverthermal" }, + { 0x745853CA4FAD5B87, "secondaryoffhandbuttonpressed" }, + { 0x9FFD73625B3646D0, "seerecently" }, + { 0x2903AFAD91CA4384, "selfrevivingdoneanimevent" }, + { 0x5440363EE12FC3F7, "sendclientmatchdataforclient" }, + { 0x3640483506E89211, "sendclientnetworktelemetry" }, + { 0x92F7FA9A56F46EF4, "sendcollectedclientanticheatdata" }, + { 0x3CBC6AE4B3882E27, "sendrequestgamerprofilecmd" }, + { 0x0800010A64025099, "setactionslot" }, + { 0x4EC39EF3C52DD7AA, "setadditionalstreamloaddist" }, + { 0xEDA0D4776218A30F, "setagentattacker" }, + { 0x61CED00CD028B214, "setaimangles" }, + { 0xB5C8AA1B95369720, "setaimspreadmovementscale" }, + { 0x16E3EAD3E001C669, "setaimstate" }, + { 0x94C333C56CDCF6A4, "setairresistance" }, + { 0x6A71C8A4CAEEB7E6, "setallstreamloaddist" }, + { 0xA6F7349E855BB16E, "setanim" }, + { 0xF8DB660363CD0F1C, "setanimblendcurve" }, + { 0x83C5C089A6662CB2, "setanimknob" }, + { 0x699E7E54248CEAE9, "setanimknoball" }, + { 0x1178E186C1EB5E43, "setanimknoblimitedrestart" }, + { 0xFBE65152BFC18D84, "setanimlimited" }, + { 0xD30D9EAC4791DA2C, "setanimrate" }, + { 0x7507F7D7DE662BF6, "setanimset" }, + { 0xDA68E6A480118A93, "setanimstate" }, + { 0xA76B9A7A81E3D027, "setanimtime" }, + { 0x7E3E695C9DF9A44C, "setasgametypeobjective" }, + { 0x845FD1883B16D8C7, "setautoboxcalculationusingdobj" }, + { 0x199EE7A9109B83C5, "setautorotationdelay" }, + { 0x9B04D0D80B67238D, "setbasearchetype" }, + { 0xFA58E64A81D84271, "setbeingrevived" }, + { 0xDFE22B69F94B801C, "setblurforplayer" }, + { 0x4415213846426EC8, "setbottomarc" }, + { 0xB8D3909ABC3E314B, "setbountycount" }, + { 0x448D7218EB5FDED6, "setbtgoalnode" }, + { 0xF79709B49A110070, "setbtgoalpos" }, + { 0x339105EFD3AADB18, "setbtgoalradius" }, + { 0x19E687CF8367DB4C, "setbtgoalvolume" }, + { 0xA55B7FE1C97E5D34, "setcamerathirdperson" }, + { 0x356819225EDC6D6A, "setcandamage" }, + { 0x29F8BE7C905F78C4, "setcanradiusdamage" }, + { 0xC37D6A56EE096211, "setcarryobject" }, + { 0xEFA34B3BD76AB202, "setcinematicmotionoverride" }, + { 0x420B956C70B8A9B5, "setclientdvar" }, + { 0xF823637BE61D5E72, "setclientdvars" }, + { 0xA9F7BF48C6A337C4, "setclientloadoutinfo" }, + { 0xCF4A59A7DA29163F, "setclientomnvar" }, + { 0x7D395FD1E1B5D0FA, "setclientomnvarbit" }, + { 0x7B11B72B190081CF, "setclientowner" }, + { 0xB816511774032160, "setclienttriggeraudiozone" }, + { 0x224677F80B260FD9, "setclienttriggeraudiozonepartial" }, + { 0x7B017E6CD2303EBB, "setclienttriggeraudiozonepartialwithfade" }, + { 0x21734AB49C792DB0, "setclientweaponinfo" }, + { 0xA50E39B31B70F141, "setclothtype" }, + { 0x60198A1263223C9C, "setconvergenceheightpercent" }, + { 0x7FE1EFE0D0136ED5, "setconvergencetime" }, + { 0xCC1CD4209D7A4DE2, "setcorpsefalling" }, + { 0x915BEC61CA7FB80C, "setcorpsemodel" }, + { 0x647DEED2255D043F, "setcovermultinodetype" }, + { 0x5DE1E1163044E0B5, "setcoverselectionfocusent" }, + { 0x3624B7F4E7596303, "setcoverstate" }, + { 0x19C6A66A083E8AF8, "setcursorhint" }, + { 0xB1EEB27570D6ED7C, "setcustomization" }, + { 0x61175119C28A60B5, "setcustomnodegameparameter" }, + { 0x7C8AAC37C13137CF, "setcustomnodegameparameterbyte" }, + { 0x9E3216F5FEBA6150, "setdamagestage" }, + { 0x88C106D6AA60EF01, "setdefaultaimlimits" }, + { 0xBF7A78978F2A8AE9, "setdefaultdroppitch" }, + { 0x7164655874AB601A, "setdemeanorviewmodel" }, + { 0x16129957EFE1A59B, "setdepthoffield" }, + { 0xDBF1A17848BA24F9, "setdronegoalent" }, + { 0x8C7D7FE296725286, "setdroneturnparams" }, + { 0x7418CCBAEEE2CFBD, "setempjammed" }, + { 0x4E3C0B0F05CA317A, "setengagementmaxdist" }, + { 0xFBFFE670C07C5F94, "setengagementmindist" }, + { 0x131E74C5FB574777, "setentityowner" }, + { 0xC6BCE45528AD77E6, "setentitysoundcontext" }, + { 0x465C54866A06BA59, "setentitytarget" }, + { 0x043B7B3E882317F5, "setfacialindex" }, + { 0xE181B8F9C5892260, "setfacialindexfromasm" }, + { 0x98961C2470EDEBE5, "setfiretimescaleoff" }, + { 0xC1C1DA41167B2049, "setfiretimescaleon" }, + { 0xBF072468AB740072, "setflaggedanim" }, + { 0x30914D89D3B2C2EC, "setflaggedanimknoballrestart" }, + { 0x3D92FD817C0068B9, "setflaggedanimknobrestart" }, + { 0x97CB64F1B6FECC75, "setflaggedanimrestart" }, + { 0xBD3E7494C510D24A, "setfxkilldefondelete" }, + { 0xC740BD0661421E00, "setgametypevip" }, + { 0xA37A143EBDC5FBE3, "setgoalentity" }, + { 0xB5DDE109D973F9A4, "setgoalnode" }, + { 0xDCD96EBF4807BB0F, "setgoalpath" }, + { 0x5F4B645EEB2BE032, "setgoalpos" }, + { 0x924B69BBF11C3D1A, "setgoalvolume" }, + { 0x2080696666861855, "setgoalvolumeauto" }, + { 0xF8A1415E9F8309D3, "setgoalyaw" }, + { 0x3EEC6D4896030833, "setgrenadecookscale" }, + { 0xBEAACD93383CD3DD, "setgrenadethrowscale" }, + { 0xAEAEB6EBF5752210, "sethidenameplate" }, + { 0xDF8F516DB947A193, "sethighpriorityweapon" }, + { 0xAF4D8FCD1CDA31A7, "sethintdisplayfov" }, + { 0xE0291B1C46EB6229, "sethintdisplayrange" }, + { 0x0FE2CFDBF8F7DDE3, "sethinticon" }, + { 0x052FD87A9E10F9C1, "sethintinoperable" }, + { 0x7BAE9CD4A4AEFA81, "sethintlockplayermovement" }, + { 0xCDCED9A9140BCA27, "sethintonobstruction" }, + { 0x77BD4AB1D35F8651, "sethintrequiresholding" }, + { 0x6ED9AEFC87512025, "sethintrequiresmashing" }, + { 0x5E078C8BEEF579C7, "sethintstring" }, + { 0x0692F8D173043225, "sethintstringparams" }, + { 0x38C11CFF2D24D1C6, "sethinttag" }, + { 0x5F01EA671A4A707D, "sethitlocdamagetable" }, + { 0xA37087C58CEE7985, "sethoverparams" }, + { 0x99C6946EE400915D, "sethudtutorialmessage" }, + { 0x0C77306E33114AAC, "sethybridscopestate" }, + { 0x11AB3F43B94F333E, "setisinfilskydive" }, + { 0x606F6E100BC9BA6E, "setkillcamentstickstolookatent" }, + { 0xF30F80473C77F3FA, "setlaststandenabled" }, + { 0x6EC67EFD82CF5DEF, "setlaststandreviving" }, + { 0xD864E6FE5B0B5805, "setlaststandselfreviving" }, + { 0x2A2CFC46B8B2BA4A, "setleftarc" }, + { 0xDA1A5E27C3D6D286, "setlightintensity" }, + { 0x9B8A9C1F1DBA53A9, "setlookat" }, + { 0xD15325AC6898C7BE, "setlookatent" }, + { 0x398B1F68D174741E, "setlookatentity" }, + { 0x7471725ABD400582, "setlookatstateoverride" }, + { 0x2FEB7640817D1634, "setmaxpitchroll" }, + { 0x9BCE21A14F834E9A, "setmissileminimapvisible" }, + { 0x6C5BADFF4788D06E, "setmlgcameradefaults" }, + { 0x9212BA57654124F3, "setmlgdominationpoint" }, + { 0x65DF8DAAAFA09281, "setmlgdraw" }, + { 0x46A44C18DAD075CA, "setmlgfollowdroneactive" }, + { 0x47AD51F5D0E2FDF0, "setmode" }, + { 0x8528DB9A6333BE14, "setmodel" }, + { 0x04BE5ACE79CF8303, "setmoveanimknob" }, + { 0x207B8CF40E54C7A0, "setmoverantilagged" }, + { 0x9BED6A8CB759605F, "setmoverlaserweapon" }, + { 0x80E465F0ABE53F35, "setmoveroptimized" }, + { 0xE94B041EE3224208, "setmovertransparentvolume" }, + { 0x33E8B245D1151905, "setmovespeedscale" }, + { 0xD7A7562D6E27E40F, "setneargoalnotifydist" }, + { 0x2F40B130D0CAACC5, "setnextkillstreakcost" }, + { 0x9B1A46959EDDA10F, "setnodeploy" }, + { 0x330C7BB271BC92CE, "setnonstick" }, + { 0xCF59AC654203D386, "setnormalhealth" }, + { 0x808653E3B8DD8A44, "setnoteworthykillstreakactive" }, + { 0xC0E6761089F48089, "setorigin" }, + { 0xB75E7AA514E243A0, "setotherent" }, + { 0x7BB6DB8D0DA2C782, "setoverridearchetype" }, + { 0x9945C43F022BCDA7, "setperk" }, + { 0xFC6D40AD473BF46A, "setphysicaldepthoffield" }, + { 0x0F5347A04B2C971C, "setphysicalviewmodeldepthoffield" }, + { 0xE4770C44C3CE4CA7, "setplayeradvanceduavdot" }, + { 0x50F526AFC8D1B05A, "setplayerangles" }, + { 0x33761F22BB94BA0A, "setplayercorpsedone" }, + { 0xC97170F05A4273D6, "setplayerdata" }, + { 0xC02A57A2D415010D, "setplayerghost" }, + { 0x2079A7E2FEDDEDCE, "setplayermusicstate" }, + { 0x706C78D3BF1FEC28, "setplayernamestring" }, + { 0xB2904AFC25325645, "setplayersupermeterprogress" }, + { 0xC104C897C061F206, "setpowerammo" }, + { 0xEC7A92BDB152C85B, "setpowerprogress" }, + { 0xE9ED5E7A500370A9, "setpredictedstreamloaddist" }, + { 0xE7628DFAFE09AB13, "setproneanimnodes" }, + { 0x0A3CD51B7331145E, "setpulsefx" }, + { 0xBC1EBC1064990EB5, "setrank" }, + { 0xA1105879F656AC7D, "setrightarc" }, + { 0x6B61992F636C116E, "setscriptablepartstate" }, + { 0x52324CA972893909, "setscriptedmeleeactive" }, + { 0x3EAB08675E050008, "setscriptmoverkillcam" }, + { 0x1E7F80699BC6819C, "setsentrycarrier" }, + { 0x1AAD380906843627, "setsentryowner" }, + { 0x0838C5067EB63142, "setshader" }, + { 0xF3BC2A582E390AE0, "setshowinrealism" }, + { 0xE4839454F3DEE902, "setsolid" }, + { 0x5F8997BDDD1FB192, "setsoundsubmix" }, + { 0xE49FCFA17706CF72, "setspawnweapon" }, + { 0x58C87C06B659FEA0, "setspecialactive" }, + { 0x6EFDAEDE8879529E, "setspectatedefaults" }, + { 0x26B4FEF183754743, "setstance" }, + { 0x8748809F16F1752B, "setstealthstate" }, + { 0xC90746B234179FBA, "setsticker" }, + { 0x34ACA198CCA75DCA, "setstrafereverse" }, + { 0x161AC8F19725E406, "setsuit" }, + { 0xC3668FC3CA19CAB7, "setswitchnode" }, + { 0x2863D0CF08EF1E97, "settargetent" }, + { 0xC9FE09196CFDC2C9, "settargetentity" }, + { 0x936055CDE07E8ECD, "settargetyaw" }, + { 0xC700BAFF9C1C727B, "setteamfortrigger" }, + { 0xB8D385FB77E62FB2, "setteaminhuddata" }, + { 0xB74822D110A663E8, "settenthstimer" }, + { 0xA74EC9AEACCB957E, "settenthstimerstatic" }, + { 0x0D111800505F0EF5, "settenthstimerup" }, + { 0x3B6C54DF1B0F1A90, "settext" }, + { 0xF4F4073F15E417D1, "setthreatbiasgroup" }, + { 0x5E75891E658CB72C, "setthreatsight" }, + { 0xBEDBA48E033DD05C, "settimer" }, + { 0x1DAB5DF51A0E5932, "settoparc" }, + { 0xE43B8C8BCF8B6694, "settransientsoundbank" }, + { 0x87CF4AB33BE8CA52, "setturningability" }, + { 0x6B2BCBE7E88A0A32, "setturretminimapvisible" }, + { 0x8D2398F54716898F, "setturretmodechangewait" }, + { 0x589722C2DBD1F608, "setturretowner" }, + { 0x79CE232BD36F9D79, "setturrettargetent" }, + { 0x9FEFD52B33A4250E, "setturrettargetvec" }, + { 0xE09823DDF5AD4AC0, "setturretteam" }, + { 0x2EAA2C02BDE5F13E, "setupdooropen" }, + { 0x45E9B63CF87632AA, "setupshootstyleadditive" }, + { 0x5DFA7198714E5FD5, "setuptraversaltransitioncheck" }, + { 0xF664B12FBD6EAEE8, "setuseanimgoalweight" }, + { 0x09711A1F05CF6B8F, "setusecommand" }, + { 0x1FFBD733E2F27609, "setusefov" }, + { 0xB983AE4FF89F76FE, "setusehideprogressbar" }, + { 0xD1C9AE7652D6693B, "setuseholdduration" }, + { 0x0DD6E9FEBDBCBF62, "setusepriority" }, + { 0x6DCD687726707784, "setuseprioritymax" }, + { 0xF72374CB0E5CA50B, "setuserange" }, + { 0xF0DADAE659A4774C, "setusewhenhandsoccupied" }, + { 0x3B4E7C8BE54B470C, "setvalue" }, + { 0x7C60A3A55EDCCEC5, "setvehgoalpos" }, + { 0xDD96FF37208C07C7, "setvehiclehornsound" }, + { 0x7EFF9C83345619BC, "setvehiclelookattext" }, + { 0x04EB579A54436DF4, "setvehicleteam" }, + { 0x497B2C1AC502A8BB, "setvehicleturretcamo" }, + { 0xEA67DBF5ACDC45EE, "setvehweapon" }, + { 0x04D8F5B6AAE712D0, "setvelocity" }, + { 0xE1D5057A96E5F98C, "setviewangleresistance" }, + { 0xF0153AA1332BD986, "setviewkickscale" }, + { 0x64A1C02BA23228AF, "setviewmodel" }, + { 0x63EC7B1BEF6E50F3, "setviewmodeldepthoffield" }, + { 0x54E081BA0ADDDAB1, "setwaitspeed" }, + { 0xEF03D55BDD173010, "setwaypoint" }, + { 0xA574CC0E1CAFFF63, "setweaponammoclip" }, + { 0xD9F66597CF2E088D, "setweaponammostock" }, + { 0x26C369289B0B64FC, "setworlduptrigger" }, + { 0xAA345F49E9A09B68, "setwristwatchtime" }, + { 0x58C627E2341302E5, "setyawspeed" }, + { 0xE9487C34D030B9CF, "setyawspeedbyname" }, + { 0x88A8B9FF9184EEE9, "shellshock" }, + { 0x58FB0BEE469D5CCC, "shoot" }, + { 0xCD8A8508C3D452FB, "shootstopsound" }, + { 0xF65B1386D7A33656, "shootturret" }, + { 0x46872FC9238C4778, "shouldcautiousstrafe" }, + { 0x5AF7999E869B53FF, "shoulddisableskydivevfx" }, + { 0xDBDEC500EC9DB110, "shoulddoarrival" }, + { 0x9E5CB11A086B7E0F, "shouldplaymeleedeathanim" }, + { 0x98FE6EB14DE14AD8, "show" }, + { 0xDD0926AA6B6C4DEE, "showonlytoplayer" }, + { 0xA1C15CA5EE0C0C8D, "showpart" }, + { 0x610F54DDC34996FC, "showtoplayer" }, + { 0xA3A9D96B4B392332, "sightconetrace" }, + { 0xBD4E1C00758B924D, "skydive_beginfreefall" }, + { 0xD1C024E6D77B5978, "skydive_cutautodeployoff" }, + { 0x1A64960151C66736, "skydive_cutautodeployon" }, + { 0xBD1CBDD7CAFF6973, "skydive_cutparachuteoff" }, + { 0x61D5A03C67942A0F, "skydive_cutparachuteon" }, + { 0x9095D9F205B914FD, "skydive_deployparachute" }, + { 0x1E8B22086157B180, "skydive_interrupt" }, + { 0x96B8BD1111FEC094, "skydive_setbasejumpingstatus" }, + { 0xA6E743AD69D8B276, "skydive_setdeploymentstatus" }, + { 0xBE11A55DBDD53914, "skydive_setforcethirdpersonstatus" }, + { 0xB1F9D353023D45EE, "snaptotargetentity" }, + { 0xAC2B76795B790EC0, "solid" }, + { 0x6CCF6CA6FEDDADAC, "spawn" }, + { 0x7F177E2F85CBC705, "spawnagent" }, + { 0xA1428A9C6B06639B, "spawnbotortestclient" }, + { 0x6B8869453E76F7A3, "spectateclientnum" }, + { 0x7F0A39E703D1E51A, "sprayevent" }, + { 0x8F32CF05009B3B75, "sprintbuttonpressed" }, + { 0xF6878310F3D0C3DD, "stancebuttonpressed" }, + { 0xC66484EBF4A41EEF, "startbarrelspin" }, + { 0x1900695570EAA577, "startcoverarrival" }, + { 0x7C6D08D33FDCCCB8, "startfiring" }, + { 0xA21B2B93ACF98B04, "startpath" }, + { 0xB5922C087D5BFD89, "startpathnodes" }, + { 0x9307AF8B6551263E, "startragdoll" }, + { 0x3F1C3EE1256D1070, "startragdollfromimpact" }, + { 0xB986A8A060916467, "startragdollfromvehiclehit" }, + { 0x06FCAF68667EBF7C, "startragdollfromvehicleimpact" }, + { 0x459F2652891BBCD6, "starttraversearrival" }, + { 0x9BF00CDA2FDB55F6, "stopanimscripted" }, + { 0x467D9391A8D5622F, "stopanimscriptsceneevent" }, + { 0x746F48798C5814C1, "stopbarrelspin" }, + { 0x97F94CF017DA2BAC, "stopcinematicforplayer" }, + { 0x71B4453BF4EA43EE, "stopfiring" }, + { 0x56626789187C3146, "stopgestureviewmodel" }, + { 0xBDE04DFCFC9D41BB, "stoplocalsound" }, + { 0xB73E3E2EF157BE0F, "stoplookat" }, + { 0x8EF065AA55A0B9E6, "stoploopsound" }, + { 0x6C59C1B53A4BD16A, "stoppath" }, + { 0x1814F963D7C37168, "stopplayermusicstate" }, + { 0x98058395B18BA4A0, "stoprumble" }, + { 0xDF09C394CF0B3649, "stopshellshock" }, + { 0xCA8387762CF0E263, "stopsoundchannel" }, + { 0x14BD52B189187161, "stopsounds" }, + { 0x6BDD6C8FA0057E7D, "stopuseanimtree" }, + { 0xE6C3AFC994720FF2, "stopuseturret" }, + { 0xDF7A77630E496764, "stopviewmodelanim" }, + { 0x772F1A57C3B9CBB0, "stunplayer" }, + { 0xD5AB9E003A1D793B, "suicide" }, + { 0x002E6622018C35AD, "suspendvehicle" }, + { 0xE4A06A2A93F2D8B0, "switchtoweapon" }, + { 0x23F1E7CDB57DB225, "switchtoweaponimmediate" }, + { 0xF141A9F474B26DE7, "tagexists" }, + { 0x947D52379684AAE2, "takeallweapons" }, + { 0xCFC1B1FDE0D91D12, "takeweapon" }, + { 0x80E77424121A327E, "thermaldrawdisable" }, + { 0x56322C26A98381B5, "thermaldrawenable" }, + { 0x5E9A7C3FE40CAC89, "thermalvisionoff" }, + { 0xF0BF31739BEA43CD, "thermalvisionon" }, + { 0x1A9C119A91C39C5B, "throwgrenade" }, + { 0x2909CC10719523D8, "trajectoryupdateoriginandangles" }, + { 0x270FB8B79E8C7EF9, "triggerdisable" }, + { 0xCEBABBF3971319E0, "triggerenable" }, + { 0xCE3DB6EACD29EEEA, "turretcantarget" }, + { 0xB3B8E566C250CB81, "turretfiredisable" }, + { 0x1C542EB7ACBD2FB8, "turretfireenable" }, + { 0xAEFEF23E049922DE, "unlink" }, + { 0x89945C9CD38BD142, "unsetperk" }, + { 0x019CE23E123E2B91, "updatecurrentweapon" }, + { 0xD349A9F469EAFF10, "updateentitywithweapons" }, + { 0xC15262C4BC2CD6F5, "updatelaserstatus" }, + { 0x51180BAA0B5D1158, "updatemlgammoinfo" }, + { 0x18A779BE9D01D223, "updateplayersightaccuracy" }, + { 0x09FD74E8975FEE9D, "useanimtree" }, + { 0xF2B4E7DE3A1E096C, "usebuttondone" }, + { 0x15D4BBD770503B12, "usebuttonpressed" }, + { 0x7E5EA2A72AC75F75, "useby" }, + { 0xC5FA32DADFDAC3D3, "usecovernode" }, + { 0xB20F0FDFCF3DA030, "useinvisibleplayerduringspawnselection" }, + { 0x620E3F5DC2DDC112, "useturret" }, + { 0x67DBB93248694048, "usevehicle" }, + { 0x2C0D2E4989439AE6, "usinggamepad" }, + { 0x097817DF5001A131, "validatecollision" }, + { 0xA9DD7C0C8EC1DF69, "vehicle_breakglass" }, + { 0x072BC7E0EB5F5585, "vehicle_canturrettargetpoint" }, + { 0x40E611F62F4E7691, "vehicle_cleardrivingstate" }, + { 0x12C7A56DCF28EFC2, "vehicle_finishdamage" }, + { 0x762D429C4012715D, "vehicle_getangularvelocity" }, + { 0xBB31CA9C547B5EDD, "vehicle_getinputvalue" }, + { 0x1A1C561484138DAB, "vehicle_getspeed" }, + { 0x07B2EBDFABE68E2F, "vehicle_getsteering" }, + { 0xC66AD5B2401442AB, "vehicle_gettopspeedforward" }, + { 0xD65AA22531EF21B8, "vehicle_gettopspeedreverse" }, + { 0xEEB34A6D644935D3, "vehicle_getvelocity" }, + { 0x16A7508E16388D02, "vehicle_helisetai" }, + { 0x3416A299E32A8B11, "vehicle_invoketriggers" }, + { 0xFFF2AFFEC96572EE, "vehicle_isonground" }, + { 0x2F0E685BD37C709B, "vehicle_isphysveh" }, + { 0x0F3D67D9A3BD7B27, "vehicle_setspeed" }, + { 0xF4B0E8D80C0F94D0, "vehicle_setspeedimmediate" }, + { 0xB97557F3269381F0, "vehicle_setstowedweaponvisibility" }, + { 0x931EDDFD031E5047, "vehicle_settopspeedforward" }, + { 0xCFB698B22BD42E14, "vehicle_settopspeedreverse" }, + { 0xE774BFB4EAC728DF, "vehicle_teleport" }, + { 0xE6D9D70B8A0ECE0A, "vehicle_turnengineoff" }, + { 0x9FA495583BCFC210, "vehicle_turnengineon" }, + { 0x902FB35B28FA3F18, "vehicledriveto" }, + { 0xD05AECB5BF8C3514, "vehicleplayanim" }, + { 0xA49B310B79468A06, "vehicleshowonminimap" }, + { 0x04628E4DADF3B686, "vehicleshowonminimapforclient" }, + { 0xEA7F9ECCF2E5D388, "vehphys_crash" }, + { 0x24A660F3D791D161, "vehphys_enablecollisioncallback" }, + { 0xBB3B94C36B0703DE, "vehphys_forcekeyframedmotion" }, + { 0x6CBC1D651691C6AE, "vehphys_setdefaultmotion" }, + { 0x0B4F9E77F28BAFE1, "vehswitchseatbuttonpressed" }, + { 0x9A71A972D2912E4A, "viewkick" }, + { 0x55F0FF7ADA3D6D0B, "visionsetfadetoblackforplayer" }, + { 0xDDD1DCF3590C21B5, "visionsetkillstreakforplayer" }, + { 0x9A86C90E5062F16A, "visionsetmissilecamforplayer" }, + { 0x4C2996825F502ABC, "visionsetnakedforplayer" }, + { 0xF5E8CB73A674D2B8, "visionsetthermalforplayer" }, + { 0x30E31D7850DB1BD0, "weaponlockfinalize" }, + { 0x18EA4E0DCA268D70, "weaponlockfree" }, + { 0x20BB9AA7AC131AC2, "weaponlockstart" }, + { 0x21805AD45CDADE5D, "weaponswitchbuttonpressed" }, + { 0x6573A24DD0C9EE25, "willneverchange" }, + { 0x88B126C3A1642568, "withattachment" }, + { 0xEC228C87B4519479, "withcamo" }, + { 0x48983E12A3C3235A, "withoutattachment" }, + { 0x9B720CFD6045AAB7, "withreticle" }, + { 0x9022990247099FBD, "worldpointinreticle_circle" }, + { 0x5A8883342BFCDD7B, "worldpointinreticle_rect" }, + { 0xF96F3F3F4A76206C, "worldpointtoscreenpos" }, +}}; + +} // namespace xsk::gsc::iw9 diff --git a/src/iw9/iw9_path.cpp b/src/iw9/iw9_path.cpp new file mode 100644 index 00000000..ae1098ce --- /dev/null +++ b/src/iw9/iw9_path.cpp @@ -0,0 +1,1482 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "iw9.hpp" + +namespace xsk::gsc::iw9 +{ + +extern std::array, path_count> const path_list +{{ + { 0x32B7CDEED77D057E, "aiasm/civilian_cp_mp.gsc" }, + { 0x35A8E19B6286841E, "aiasm/civilian_mp.gsc" }, + { 0x7BAFE83F61723E58, "aiasm/civilian_sp.gsc" }, + { 0x2127A642689029E9, "aiasm/corner_cover_lean_shoot_cp_mp.gsc" }, + { 0x333F6EDE791A319F, "aiasm/corner_cover_lean_shoot_lw_mp.gsc" }, + { 0x419E457945C8652F, "aiasm/corner_cover_lean_shoot_mp.gsc" }, + { 0x7EDFAEDD76BA2A51, "aiasm/corner_cover_lean_shoot_sp.gsc" }, + { 0x6E56118DF645BCA9, "aiasm/dog_sp.gsc" }, + { 0x16788B23F7813A68, "aiasm/gesture_cp_mp.gsc" }, + { 0x0ED276256A336066, "aiasm/gesture_lw_mp.gsc" }, + { 0x2795CA2381AA1844, "aiasm/gesture_mp.gsc" }, + { 0x2373D48CF1D539B2, "aiasm/gesture_sp.gsc" }, + { 0x43217414BF8D7DBD, "aiasm/playerasm_mp.gsc" }, + { 0x478A5FF3300717F3, "aiasm/playerasm_sp.gsc" }, + { 0x09AC75F6223F719E, "aiasm/playerasm_sub_mp.gsc" }, + { 0x4FB37C9A212B2BD8, "aiasm/playerasm_sub_sp.gsc" }, + { 0x0FFC1613209C0E58, "aiasm/playerasm_void_mp.gsc" }, + { 0x49F50F6F21B0541E, "aiasm/playerasm_void_sp.gsc" }, + { 0x5432728299F31554, "aiasm/shoot_cp_mp.gsc" }, + { 0x286144B1799A88A2, "aiasm/shoot_lw_mp.gsc" }, + { 0x10267C55A210F0F0, "aiasm/shoot_mp.gsc" }, + { 0x05CAC6B43278B186, "aiasm/shoot_sp.gsc" }, + { 0x328B3030A65A8DB9, "aiasm/soldier_cp_mp.gsc" }, + { 0x18EE7AE10A52C8AF, "aiasm/soldier_lw_mp.gsc" }, + { 0x7255A31B670CE75F, "aiasm/soldier_mp.gsc" }, + { 0x172F5F8FC2C75DE1, "aiasm/soldier_sp.gsc" }, + { 0x37C1B87B79431128, "aiasm/suicidebomber_cp_mp.gsc" }, + { 0x2C40FE6A0EC96C04, "aiasm/suicidebomber_mp.gsc" }, + { 0x550008D869D66172, "aiasm/suicidebomber_sp.gsc" }, + { 0x68EC7E7BF5163661, "behaviortree/civilian.gsc" }, + { 0x4656969CDA1E5CEF, "behaviortree/civilian_agent.gsc" }, + { 0x53D6FE189C685458, "behaviortree/dog.gsc" }, + { 0x24F62F137306493C, "behaviortree/enemy_combatant.gsc" }, + { 0x001A2DFEDF315CD4, "behaviortree/juggernaut.gsc" }, + { 0x3545F03861FF9002, "behaviortree/juggernaut_agent.gsc" }, + { 0x6EE5DEE1A5469C09, "behaviortree/riotshield_cp.gsc" }, + { 0x4A89B79CBA6C453A, "behaviortree/soldier_agent.gsc" }, + { 0x3913DFDA05BB57B4, "behaviortree/soldier_agent_lw.gsc" }, + { 0x14B00477671C5A35, "behaviortree/suicidebomber.gsc" }, + { 0x015FB07B24C5AB0B, "behaviortree/suicidebomber_agent.gsc" }, + { 0x47D04779AE171058, "character/alq_syrkistan_female_scarf_purple.gsc" }, + { 0x6C3519078B1737B3, "character/alq_syrkistan_female_scarf_red.gsc" }, + { 0x7D70597F5DB87585, "character/character_al_qatala_desert_ar.gsc" }, + { 0x3BCFDED5E8FA3F50, "character/character_al_qatala_desert_ar_2.gsc" }, + { 0x7F0555B36D1B08E7, "character/character_al_qatala_desert_ar_3.gsc" }, + { 0x091151E289AFEC2E, "character/character_al_qatala_desert_ar_4.gsc" }, + { 0x66ACAC5596212D71, "character/character_al_qatala_desert_cqc.gsc" }, + { 0x33D66FE7D0A6C65C, "character/character_al_qatala_desert_lmg.gsc" }, + { 0x693C29D64B83755B, "character/character_al_qatala_trials.gsc" }, + { 0x28D27A7FACD64502, "character/character_al_qatala_urban_a6_variant.gsc" }, + { 0x200DABCFA3F18E26, "character/character_al_qatala_urban_ar_variant.gsc" }, + { 0x67D8AE51DA6C4EFC, "character/character_al_qatala_urban_bomber.gsc" }, + { 0x41A511B8916C1089, "character/character_al_qatala_urban_civ_1.gsc" }, + { 0x409CCDA81170F930, "character/character_al_qatala_urban_civ_2.gsc" }, + { 0x273D48B5958B8D47, "character/character_al_qatala_urban_civ_3.gsc" }, + { 0x0B3544DFCD06A18E, "character/character_al_qatala_urban_civ_4.gsc" }, + { 0x52D13DDA867630AD, "character/character_al_qatala_urban_civ_5.gsc" }, + { 0x1DEA48BDB7A13064, "character/character_al_qatala_urban_civ_6.gsc" }, + { 0x3C2731B3892A740B, "character/character_al_qatala_urban_civ_7.gsc" }, + { 0x6A96208943F72722, "character/character_al_qatala_urban_civ_8.gsc" }, + { 0x7F65697EC7FCE331, "character/character_al_qatala_urban_civ_9.gsc" }, + { 0x627139B9D8490BEF, "character/character_al_qatala_urban_cqb_variant.gsc" }, + { 0x6230AB696721E119, "character/character_al_qatala_urban_lmg_variant.gsc" }, + { 0x77613AB13516E118, "character/character_ally_so15_1.gsc" }, + { 0x76E53FCC7B105391, "character/character_ally_so15_2.gsc" }, + { 0x389AF6D20F0BEC82, "character/character_ally_so15_3.gsc" }, + { 0x0EBB6067A2162225, "character/character_barkov_captive.gsc" }, + { 0x1D36C5707B65CDAE, "character/character_civ_male_rus_clerical_1.gsc" }, + { 0x2203B66A6A693DAB, "character/character_civ_male_rus_clerical_2.gsc" }, + { 0x03C7CD7498E1AD04, "character/character_civ_male_rus_clerical_3.gsc" }, + { 0x116EB4D7BA1A9325, "character/character_civ_russian_police_officer.gsc" }, + { 0x4189709E138E122A, "character/character_civilian_me_female.gsc" }, + { 0x337298E549E7BD86, "character/character_civilian_me_female_cp.gsc" }, + { 0x51269A20A066B219, "character/character_civilian_me_female_embassy.gsc" }, + { 0x20161DEE5F3AE149, "character/character_civilian_me_female_embassy_mom.gsc" }, + { 0x791B25003E6B5145, "character/character_civilian_me_female_veil.gsc" }, + { 0x23F85B6079106E91, "character/character_civilian_me_female_wrap.gsc" }, + { 0x6D0E56A9475AD25F, "character/character_civilian_me_male.gsc" }, + { 0x37143DC2FAC56392, "character/character_civilian_me_male_cinderblock_a.gsc" }, + { 0x09E8BCA98403E59F, "character/character_civilian_me_male_cinderblock_b.gsc" }, + { 0x1DA485C7183FFCA8, "character/character_civilian_me_male_cinderblock_c.gsc" }, + { 0x09D771CD39D94225, "character/character_civilian_me_male_cinderblock_d.gsc" }, + { 0x70B7DCC7D8389289, "character/character_civilian_me_male_cp.gsc" }, + { 0x22ECAB79EA596F7A, "character/character_civilian_me_male_dist.gsc" }, + { 0x2B6D95B6438D19A0, "character/character_civilian_me_male_embassy.gsc" }, + { 0x137DC0CB6B7460A6, "character/character_civilian_me_male_embassy_dad.gsc" }, + { 0x76CA634F874C672A, "character/character_civilian_me_male_veil.gsc" }, + { 0x610B43115246DE2E, "character/character_civilian_syrkistan_boy_1_1.gsc" }, + { 0x5D21AD9A400E70D7, "character/character_civilian_syrkistan_boy_2_1.gsc" }, + { 0x4CF99888FC3EC7F8, "character/character_civilian_syrkistan_boy_3_1.gsc" }, + { 0x6137D6C723640951, "character/character_civilian_syrkistan_boy_4_1.gsc" }, + { 0x36F017124778241A, "character/character_civilian_syrkistan_boy_5_1.gsc" }, + { 0x1C344EAD431AF8E3, "character/character_civilian_syrkistan_boy_6_1.gsc" }, + { 0x0087DF9778DA2043, "character/character_cp_al_qatala_desert_9_rpg.gsc" }, + { 0x5018FC9098084EB5, "character/character_cp_al_qatala_desert_ar.gsc" }, + { 0x3B90ACE942FE6100, "character/character_cp_al_qatala_desert_ar_2.gsc" }, + { 0x79F725E3AF1B9457, "character/character_cp_al_qatala_desert_ar_3.gsc" }, + { 0x31DCE20CAB248FDE, "character/character_cp_al_qatala_desert_ar_4.gsc" }, + { 0x5663E69D507E036A, "character/character_cp_al_qatala_desert_ar_tmtyl.gsc" }, + { 0x69D669F2F0DDF801, "character/character_cp_al_qatala_desert_cqc.gsc" }, + { 0x2F829372490537B7, "character/character_cp_al_qatala_desert_dmr.gsc" }, + { 0x78168B35E6EA884C, "character/character_cp_al_qatala_desert_lmg.gsc" }, + { 0x26E76D730B28C81B, "character/character_cp_bombvest_hostage.gsc" }, + { 0x596130FFA3E43EA5, "character/character_cp_hero_hadir_urban.gsc" }, + { 0x2DAE60132549BD8A, "character/character_cp_usmc_basic_ar_1.gsc" }, + { 0x2A41200200874537, "character/character_cp_usmc_basic_ar_2.gsc" }, + { 0x1555A70C7C68BCE0, "character/character_cp_usmc_basic_ar_3.gsc" }, + { 0x0188D3129E026F1D, "character/character_cp_usmc_basic_ar_4.gsc" }, + { 0x0EA4C80B05AD5611, "character/character_cp_usmc_basic_lmg.gsc" }, + { 0x4C9E5A90FD6E6856, "character/character_eastern_yegor_1_1.gsc" }, + { 0x5B6F2B7F6E1A7D74, "character/character_hero_alex_desert.gsc" }, + { 0x085E4BF0387DCC41, "character/character_hero_alex_urban.gsc" }, + { 0x453D6608C94C2B9E, "character/character_hero_farah_disguised.gsc" }, + { 0x47777F0FBD33FF73, "character/character_hero_farah_disguised_soldier.gsc" }, + { 0x005C0E9023E37121, "character/character_hero_griggs_desert.gsc" }, + { 0x6A23AC3A138CE399, "character/character_hero_hadir_prisoner.gsc" }, + { 0x69AABD445950F51C, "character/character_hero_hadir_pw.gsc" }, + { 0x1CBC9F5D1D540B75, "character/character_hero_hadir_urban.gsc" }, + { 0x52B3F7DE0CC8C5F1, "character/character_hero_hadir_young.gsc" }, + { 0x40F23A56192060C5, "character/character_hero_kyle_desert.gsc" }, + { 0x7B684CCC1B07C05C, "character/character_hero_kyle_so15.gsc" }, + { 0x08C34A575093B8A9, "character/character_hero_kyle_undercover.gsc" }, + { 0x1B79AB3405B3751A, "character/character_hero_kyle_urban.gsc" }, + { 0x451AEEDC4CA9161C, "character/character_hero_kyle_woodland.gsc" }, + { 0x426913BC4E3F4DC6, "character/character_hero_kyle_woodland_nvg.gsc" }, + { 0x2723CCC9E0A03B2B, "character/character_hero_nikolai_lab.gsc" }, + { 0x7CC80E4CE0545179, "character/character_hero_nikolai_st_petersburg.gsc" }, + { 0x2CC7174D35C83369, "character/character_hero_price_desert.gsc" }, + { 0x6B9A34CAFADA0815, "character/character_hero_price_undercover.gsc" }, + { 0x57636F9B14953B96, "character/character_hero_price_urban.gsc" }, + { 0x6BADEA8BBC8ECFF0, "character/character_hero_price_urban_nvg.gsc" }, + { 0x7E82081490932D78, "character/character_hero_price_woodland.gsc" }, + { 0x012F75E2C60E0D42, "character/character_hero_price_woodland_nvg.gsc" }, + { 0x6E1433B72452308E, "character/character_hero_price_young.gsc" }, + { 0x5461025BF55F9847, "character/character_hero_tarik.gsc" }, + { 0x7E99F8DD3615036E, "character/character_iw8_al_qatala_desert_1.gsc" }, + { 0x2CE1E9DC0D171E6B, "character/character_iw8_al_qatala_desert_2.gsc" }, + { 0x3524015605241B87, "character/character_iw8_al_qatala_desert_2_rpg_helmet.gsc" }, + { 0x0EA500E63B8DDAC4, "character/character_iw8_al_qatala_desert_3.gsc" }, + { 0x3509C5B5FA7A7269, "character/character_iw8_al_qatala_desert_4.gsc" }, + { 0x20A67CC076CFD53A, "character/character_iw8_al_qatala_desert_5.gsc" }, + { 0x1AA1FCB2FE99EF27, "character/character_iw8_al_qatala_desert_6.gsc" }, + { 0x315785D0955DA390, "character/character_iw8_al_qatala_desert_7.gsc" }, + { 0x2D444CB8578641D5, "character/character_iw8_al_qatala_desert_8.gsc" }, + { 0x3A0751AA833475F6, "character/character_iw8_al_qatala_desert_9.gsc" }, + { 0x00EE231B82F51E36, "character/character_iw8_al_qatala_desert_9_rpg.gsc" }, + { 0x17795A290BA768B1, "character/character_iw8_al_qatala_urban_01.gsc" }, + { 0x11E65938DDAAC8B8, "character/character_iw8_al_qatala_urban_02.gsc" }, + { 0x2663D22E616ACC2F, "character/character_iw8_al_qatala_urban_03.gsc" }, + { 0x08318E5C45CF4496, "character/character_iw8_al_qatala_urban_04.gsc" }, + { 0x549D853A17441CF5, "character/character_iw8_al_qatala_urban_05.gsc" }, + { 0x7045D5559D4B15CC, "character/character_iw8_al_qatala_urban_06.gsc" }, + { 0x64577D431C7881F3, "character/character_iw8_al_qatala_urban_07.gsc" }, + { 0x395ACEA1275F0CC0, "character/character_iw8_al_qatala_urban_08_long_jacket.gsc" }, + { 0x2F6FB39CC102F8C0, "character/character_iw8_al_qatala_urban_bombvest.gsc" }, + { 0x27230CF4F02F517E, "character/character_iw8_al_qatala_urban_female_01.gsc" }, + { 0x2C617BDCFFC30A3B, "character/character_iw8_al_qatala_urban_female_02.gsc" }, + { 0x628490D413593CD4, "character/character_iw8_al_qatala_urban_female_03.gsc" }, + { 0x31F2D7BA99B436B9, "character/character_iw8_al_qatala_urban_female_04.gsc" }, + { 0x492F90D830EA234A, "character/character_iw8_al_qatala_urban_female_05.gsc" }, + { 0x6F3D50CBF42655F7, "character/character_iw8_al_qatala_urban_female_06.gsc" }, + { 0x57D35D134766141E, "character/character_iw8_cp_al_qatala_urban_bombvest.gsc" }, + { 0x082467C472E9E5ED, "character/character_iw8_russian_army_1.gsc" }, + { 0x69527A4B7BDE4891, "character/character_iw8_russian_army_1_safehouse.gsc" }, + { 0x6E95E4E953B03E57, "character/character_iw8_russian_army_1_safehouse_finale.gsc" }, + { 0x64ED3F563E509B56, "character/character_iw8_russian_army_1_trial.gsc" }, + { 0x79148E17CC8D265D, "character/character_iw8_russian_army_2_hood.gsc" }, + { 0x089F00BB868D0981, "character/character_iw8_russian_army_2_hood_safehouse.gsc" }, + { 0x2EC5BC25F6CEA447, "character/character_iw8_russian_army_2_hood_safehouse_finale.gsc" }, + { 0x438EEB058B821551, "character/character_iw8_russian_army_ar_1_balaclava.gsc" }, + { 0x627FDF1F24DC8CA9, "character/character_iw8_russian_army_ar_1_gasmask.gsc" }, + { 0x1CA9792A92FA0EBE, "character/character_iw8_russian_army_ar_1_gasmask_only.gsc" }, + { 0x55A0AA5A5407B600, "character/character_iw8_russian_army_ar_2_balaclava.gsc" }, + { 0x03906ED8412FD030, "character/character_iw8_russian_army_ar_2_gasmask.gsc" }, + { 0x29849111779F2715, "character/character_iw8_russian_army_ar_2_gasmask_only.gsc" }, + { 0x276F3934A343126C, "character/character_iw8_russian_army_ar_3_gasmask_only.gsc" }, + { 0x38D665C0206BB9C6, "character/character_iw8_russian_army_ar_4_gasmask.gsc" }, + { 0x30F56F4478BA814B, "character/character_iw8_russian_army_ar_4_gasmask_only.gsc" }, + { 0x4960FD2F0E080DFD, "character/character_iw8_russian_army_ar_5_gasmask.gsc" }, + { 0x08237C8CDAB9C00A, "character/character_iw8_russian_army_ar_5_gasmask_only.gsc" }, + { 0x31896C80BB6B4EE1, "character/character_iw8_russian_army_ar_6_gasmask_only.gsc" }, + { 0x1F4B1E0349126906, "character/character_iw8_russian_weapon_smugglers_1.gsc" }, + { 0x4D254F021FB66BE3, "character/character_iw8_russian_weapon_smugglers_2.gsc" }, + { 0x2D026713651899FC, "character/character_iw8_russian_weapon_smugglers_3.gsc" }, + { 0x28822DFB26E46661, "character/character_iw8_russian_weapon_smugglers_4.gsc" }, + { 0x41FDA2EDA2E231D2, "character/character_iw8_russian_weapon_smugglers_5.gsc" }, + { 0x74CA2CA435FC7DD5, "character/character_iw8_russian_weapon_smugglers_burned_1.gsc" }, + { 0x5634362338C36664, "character/character_iw8_sla_rebel_female_1_1.gsc" }, + { 0x32AF76B779B47F01, "character/character_iw8_sla_rebel_female_2_1.gsc" }, + { 0x4F315F4967FD0C4A, "character/character_iw8_sla_rebel_female_3_1.gsc" }, + { 0x21F0CD280B29DF07, "character/character_iw8_sla_rebel_female_4_1.gsc" }, + { 0x61452D7E0EA76EA8, "character/character_iw8_sla_rebel_female_5_1.gsc" }, + { 0x56409BEE34A7B4E5, "character/character_iw8_sla_rebel_female_6_1.gsc" }, + { 0x66CCB84CD932427A, "character/character_iw8_sla_rebels_female_prisoner_1.gsc" }, + { 0x642F383F63E13867, "character/character_iw8_sla_rebels_female_prisoner_2.gsc" }, + { 0x20F9C161DFC06ED0, "character/character_iw8_sla_rebels_female_prisoner_3.gsc" }, + { 0x0FC32D6454CBDBCD, "character/character_iw8_sla_rebels_female_prisoner_4.gsc" }, + { 0x6E3B346E80761BAE, "character/character_iw8_sla_rebels_female_prisoner_5.gsc" }, + { 0x1489A8B1F1D0EE4A, "character/character_london_police_hivis.gsc" }, + { 0x15E911C2E47193B4, "character/character_opforce_juggernaut.gsc" }, + { 0x2DD3DAD0CA9F5E5B, "character/character_opforce_juggernaut_br.gsc" }, + { 0x5944FEB3C51E74C4, "character/character_opforce_juggernaut_cp.gsc" }, + { 0x6C9A166E5B3334AB, "character/character_opforce_juggernaut_trial.gsc" }, + { 0x4AC1BF8FC81ADD26, "character/character_rus_pilot_helicopter.gsc" }, + { 0x76D28628026B250C, "character/character_russian_boss_hometown.gsc" }, + { 0x7E5A5D8646CDA55C, "character/character_russian_boss_hometown_cp.gsc" }, + { 0x1BED238A56A2DA97, "character/character_russian_suits.gsc" }, + { 0x7736F327E4B23BC7, "character/character_sas_pilot_helicopter.gsc" }, + { 0x50F17E68CDF54D91, "character/character_sas_pilot_helicopter_cp.gsc" }, + { 0x3A6FF6FC7439D36B, "character/character_sas_urban_ar.gsc" }, + { 0x06F81DAC10AC2D33, "character/character_sas_urban_ar_1.gsc" }, + { 0x2AD32EC53A04A2D6, "character/character_sas_urban_ar_2.gsc" }, + { 0x20BA25A7F3782635, "character/character_sas_urban_ar_3.gsc" }, + { 0x3486F9A1D1DE73F8, "character/character_sas_urban_ar_4.gsc" }, + { 0x4E42483143ACD6A7, "character/character_sas_urban_cqc.gsc" }, + { 0x5A5FB221017E5599, "character/character_sas_urban_dmr.gsc" }, + { 0x0E00A175CD3C099D, "character/character_sas_urban_nvg_ar.gsc" }, + { 0x539E2577B90A987F, "character/character_sas_urban_nvg_dmr.gsc" }, + { 0x094687C777BF3F17, "character/character_sas_woodland_nvg.gsc" }, + { 0x313F5ABF4B84D0CF, "character/character_sla_rebels_male_ar.gsc" }, + { 0x4D837508859FFBA6, "character/character_sla_rebels_male_ar_2_1.gsc" }, + { 0x35FDB6D23CDEB3EC, "character/character_sla_rebels_male_cqb.gsc" }, + { 0x7A59C84A65618589, "character/character_sla_rebels_male_cqb_2_1.gsc" }, + { 0x22DD6113102F3365, "character/character_sla_rebels_male_dmr.gsc" }, + { 0x69480EEFB6BA5468, "character/character_sla_rebels_male_dmr_2_1.gsc" }, + { 0x2B128BB7F062073A, "character/character_sla_rebels_male_lmg.gsc" }, + { 0x6418EDAF39CA3043, "character/character_sla_rebels_male_lmg_2_1.gsc" }, + { 0x4219B6C7F817F165, "character/character_spetsnaz_ar.gsc" }, + { 0x641E66EDABFEBB7B, "character/character_spetsnaz_ar_cp.gsc" }, + { 0x17DA0A253C54B0FB, "character/character_spetsnaz_ar_nvg.gsc" }, + { 0x3E42514A2682BEB5, "character/character_spetsnaz_ar_nvg_cp.gsc" }, + { 0x56ADD4E7B00011F2, "character/character_spetsnaz_ar_nvg_fixed.gsc" }, + { 0x6BB8F6CAED380A0E, "character/character_spetsnaz_ar_nvg_fixed_cp.gsc" }, + { 0x30E7C7F43DEAD23E, "character/character_spetsnaz_ar_trial.gsc" }, + { 0x70F0EC4DAEB4AE51, "character/character_spetsnaz_cqc.gsc" }, + { 0x170918A4881CC5B7, "character/character_spetsnaz_cqc_cp.gsc" }, + { 0x7889943617BE8CD7, "character/character_spetsnaz_cqc_nvg.gsc" }, + { 0x13C1AA5F4765A401, "character/character_spetsnaz_cqc_nvg_cp.gsc" }, + { 0x47E0A378DA1A8E12, "character/character_spetsnaz_cqc_trial.gsc" }, + { 0x7CE85BA6ABEDEA11, "character/character_spetsnaz_dmr_cp.gsc" }, + { 0x7C85DC1BDE3E9B97, "character/character_spetsnaz_dmr_cp_nvg.gsc" }, + { 0x4525678513A55130, "character/character_spetsnaz_dmr_trial.gsc" }, + { 0x30655A40A32B3E87, "character/character_spetsnaz_gasmask_ar.gsc" }, + { 0x5C98EFE42BA9CD51, "character/character_spetsnaz_gasmask_ar_cp.gsc" }, + { 0x3829F9EFD28EF970, "character/character_spetsnaz_gasmask_ar_trial.gsc" }, + { 0x13E562E39A0560DB, "character/character_spetsnaz_gasmask_cqc.gsc" }, + { 0x324C128AB55ECFD5, "character/character_spetsnaz_gasmask_cqc_cp.gsc" }, + { 0x37350F9E6ED949DC, "character/character_spetsnaz_gasmask_cqc_trial.gsc" }, + { 0x1B9F8D5B8D8BD522, "character/character_spetsnaz_gasmask_lmg.gsc" }, + { 0x38D41A1CB0C0EA5E, "character/character_spetsnaz_gasmask_lmg_cp.gsc" }, + { 0x166B11563999BC01, "character/character_spetsnaz_gasmask_lmg_trial.gsc" }, + { 0x4000F1C13DF8C3FE, "character/character_spetsnaz_gasmask_nohelmet_ar.gsc" }, + { 0x4C03E444E5AE90BA, "character/character_spetsnaz_gasmask_nohelmet_ar_cp.gsc" }, + { 0x101352BEA05224CC, "character/character_spetsnaz_gasmask_nohelmet_cqc.gsc" }, + { 0x5729CA7C3938D91C, "character/character_spetsnaz_gasmask_nohelmet_cqc_cp.gsc" }, + { 0x183764699C0BCD81, "character/character_spetsnaz_gasmask_nohelmet_lmg.gsc" }, + { 0x78ED867ED4FA07C7, "character/character_spetsnaz_gasmask_nohelmet_lmg_cp.gsc" }, + { 0x27B67CF1F7740E3C, "character/character_spetsnaz_lmg.gsc" }, + { 0x290155ACC542FD2C, "character/character_spetsnaz_lmg_cp.gsc" }, + { 0x0EAB76E4D130A0D6, "character/character_spetsnaz_lmg_cp_nvg.gsc" }, + { 0x3C73067B384FE983, "character/character_spetsnaz_lmg_trial.gsc" }, + { 0x12AC8E46F9F1B1D7, "character/character_spetsnaz_riotshield_cp.gsc" }, + { 0x49F5485BC147C97D, "character/character_usmc_ar.gsc" }, + { 0x6F04D7795F35B4BA, "character/character_usmc_basic_ar_1.gsc" }, + { 0x5BF02C47B4E9291D, "character/character_usmc_basic_ar_1_tape.gsc" }, + { 0x6900576BE6FFCEA7, "character/character_usmc_basic_ar_2.gsc" }, + { 0x7FB5E0897DC38310, "character/character_usmc_basic_ar_3.gsc" }, + { 0x4E462338C5E5027B, "character/character_usmc_basic_ar_3_tape.gsc" }, + { 0x6B194C8BEFEBC70D, "character/character_usmc_basic_ar_4.gsc" }, + { 0x75C35CB1CA43C8A8, "character/character_usmc_basic_ar_4_tape.gsc" }, + { 0x0BDEF97EF9E75B41, "character/character_usmc_basic_lmg.gsc" }, + { 0x41CD176219AD0F88, "character/character_usmc_raiders_ar_1.gsc" }, + { 0x18475A669837B301, "character/character_usmc_raiders_ar_2.gsc" }, + { 0x5892D3891710BEF2, "character/character_usmc_raiders_ar_3.gsc" }, + { 0x3CEA7B6D9109B883, "character/character_usmc_raiders_ar_4.gsc" }, + { 0x1CC7937ED66BE69C, "character/character_usmc_raiders_ar_5.gsc" }, + { 0x33F310BE3CF9124E, "character/character_villain_barkov_old.gsc" }, + { 0x4194584749801B49, "character/character_villain_enforcer_st_petersburg.gsc" }, + { 0x08F8C84C5C288DCF, "character/character_villain_wolf.gsc" }, + { 0x0BAA1424E598BDD0, "character/character_villain_wolf_bombvest.gsc" }, + { 0x58DD4308ADBF221F, "character/civ_al_qatala_urban_civ_female.gsc" }, + { 0x2F833547C8153977, "character/civ_al_qatala_urban_civ_female_bluetop.gsc" }, + { 0x02AE0175D9620C61, "character/civ_al_qatala_urban_civ_female_turquoise.gsc" }, + { 0x68D553ABF58DA9BE, "character/civ_al_qatala_urban_civ_female_whitetop.gsc" }, + { 0x6692AC662B0566F4, "character/civ_child_interrogation.gsc" }, + { 0x09112FF428E6966B, "character/civ_embassy_ambassador_assistant.gsc" }, + { 0x0D5AC5FBC289F77D, "character/civ_embassy_office_worker_female_1_1.gsc" }, + { 0x5A986F95EA1207FB, "character/civ_embassy_office_worker_female_1_1_smallhead.gsc" }, + { 0x52D552F82C405F74, "character/civ_embassy_office_worker_female_1_2.gsc" }, + { 0x17A313607EC7D300, "character/civ_embassy_office_worker_female_2_1.gsc" }, + { 0x197A1774AE32A599, "character/civ_embassy_office_worker_female_2_2.gsc" }, + { 0x548626A53E42A848, "character/civ_embassy_office_worker_male_1_1.gsc" }, + { 0x2E6669A9BFB074C1, "character/civ_embassy_office_worker_male_1_2.gsc" }, + { 0x41D0E2C753A7ACB2, "character/civ_embassy_office_worker_male_1_3.gsc" }, + { 0x7F0C7FC98922F685, "character/civ_embassy_office_worker_male_2_1.gsc" }, + { 0x707E0BB5096A3F9C, "character/civ_embassy_office_worker_male_2_2.gsc" }, + { 0x10A0F3A3C4081183, "character/civ_embassy_office_worker_male_2_3.gsc" }, + { 0x2C494BBF4A0F17F2, "character/civ_embassy_office_worker_male_2_4.gsc" }, + { 0x22C2C5FE4B6B3368, "character/civ_female_interrogation.gsc" }, + { 0x3362BFAC36550623, "character/civ_london_female_02_skintone_dark.gsc" }, + { 0x4D39F545494121FB, "character/civ_london_female_02_skintone_light.gsc" }, + { 0x55603631F9C1D6E1, "character/civ_london_female_02_skintone_med.gsc" }, + { 0x2A243841281837A0, "character/civ_london_female_03_skintone_dark.gsc" }, + { 0x392556CBACA7C63A, "character/civ_london_female_03_skintone_light.gsc" }, + { 0x03C8FCB79090D614, "character/civ_london_female_03_skintone_med.gsc" }, + { 0x626D10F8763CC956, "character/civ_london_female_skintone_light.gsc" }, + { 0x112B6172A8E03232, "character/civ_london_female_skintone_light_anim_safe.gsc" }, + { 0x4D4ED05775D54B60, "character/civ_london_female_skintone_med.gsc" }, + { 0x3581B5A8CD365E20, "character/civ_london_female_skintone_med_anim_safe.gsc" }, + { 0x76B402B54F12A90D, "character/civ_london_male_embassy_adam.gsc" }, + { 0x6C5F37B73038304F, "character/civ_london_male_embassy_ambassador.gsc" }, + { 0x31B4AF71A67FDEA5, "character/civ_london_male_skintone_light.gsc" }, + { 0x539ED76185B302CF, "character/civ_london_male_skintone_med.gsc" }, + { 0x546EEEEBDC1E25F2, "character/civ_russian_female.gsc" }, + { 0x2703F00D7AFD0CA7, "character/civ_russian_male.gsc" }, + { 0x5401B4AF4E767031, "character/civ_russian_male_cp.gsc" }, + { 0x0CC64E08F07608B4, "character/civ_syrkistan_female_nurse_mask.gsc" }, + { 0x32CF52C0A4B4C8B7, "character/civ_syrkistan_female_nurse_nomask.gsc" }, + { 0x2BBFC1556DA4EF40, "character/civ_syrkistan_female_scarf_dress_blue.gsc" }, + { 0x0345FA4A960C66DE, "character/civ_syrkistan_female_scarf_dress_orange.gsc" }, + { 0x2A37A70872AA63E0, "character/civ_syrkistan_female_scarf_dress_pink.gsc" }, + { 0x426EF33A261B7799, "character/civ_syrkistan_female_scarf_green.gsc" }, + { 0x466E1F43A0586C85, "character/civ_syrkistan_female_scarf_long_blue.gsc" }, + { 0x7C4DE9361E63B59D, "character/civ_syrkistan_female_scarf_long_brown.gsc" }, + { 0x1F527F885BA419F1, "character/civ_syrkistan_girl_1_1.gsc" }, + { 0x18081CF8B9A9DA94, "character/civ_syrkistan_girl_2_1.gsc" }, + { 0x4E107BA6CC8AA783, "character/civ_syrkistan_girl_3_1.gsc" }, + { 0x67AF09749E4A06CE, "character/civ_syrkistan_girl_4_1.gsc" }, + { 0x69399199AA50AF95, "character/civ_syrkistan_girl_5_1.gsc" }, + { 0x2BB5C587708E9798, "character/civ_syrkistan_girl_6_1.gsc" }, + { 0x672A73FD8EF30F77, "character/civ_syrkistan_girl_7_1.gsc" }, + { 0x23AE83E6F81BD759, "character/civ_syrkistan_male_doctor_mask.gsc" }, + { 0x5BB195F5D6C021FA, "character/civ_syrkistan_male_doctor_nomask.gsc" }, + { 0x2FB06984712C831F, "character/civ_tugofwar_male_cp.gsc" }, + { 0x14D32184C28E8194, "character/civ_uk_female_coat_blue.gsc" }, + { 0x79800D0D98A1EA7C, "character/civ_western_cold_boy.gsc" }, + { 0x32EE021D62E7D89A, "character/civ_western_cold_girl.gsc" }, + { 0x67D1396D2B710E12, "character/hero_xo_farah_variant.gsc" }, + { 0x71D8FA6A424DD963, "character/test_character_alq_embassy.gsc" }, + { 0x25B99F89A4C9696E, "character/test_character_civ_female_rus_clerical.gsc" }, + { 0x626E03DD36BDC6CF, "character/test_character_civ_male_london_01.gsc" }, + { 0x5B7D895F06BC7241, "character/test_character_civ_male_rus_clerical.gsc" }, + { 0x1BE7F0EB0E52CA40, "character/test_character_cp_crew_male_vest_picc_01.gsc" }, + { 0x1955C748B00BEC22, "character/test_character_crew_male_vest_picc_01.gsc" }, + { 0x78E39294A33F71EA, "character/test_character_dog.gsc" }, + { 0x15AE8137379807E9, "character/test_character_farah_father.gsc" }, + { 0x06915CAA9316909E, "scripts/aitypes/alert.gsc" }, + { 0x027FF5BAFD325163, "scripts/aitypes/assets.gsc" }, + { 0x0974236B390FBD2A, "scripts/aitypes/bt_action_api.gsc" }, + { 0x088804CFE1C28645, "scripts/aitypes/bt_state_api.gsc" }, + { 0x68089CE1EA270B3B, "scripts/aitypes/bt_util.gsc" }, + { 0x69FDEC9FC8CCFB18, "scripts/aitypes/c12api.gsc" }, + { 0x015EDFA8E2BDACE2, "scripts/aitypes/combat.gsc" }, + { 0x6C59B261C6CF53C8, "scripts/aitypes/combat_mp.gsc" }, + { 0x3C36BCB5F2B1856E, "scripts/aitypes/combat_sp.gsc" }, + { 0x6ADCC148F9B3971B, "scripts/aitypes/common.gsc" }, + { 0x0FC0E00E7CF9B73B, "scripts/aitypes/cover.gsc" }, + { 0x5D8472F0F6851F3A, "scripts/aitypes/dismember.gsc" }, + { 0x1B1733A424733305, "scripts/aitypes/dog/combat.gsc" }, + { 0x61EF79F49C19C9AA, "scripts/aitypes/grenade_response.gsc" }, + { 0x7A383E1E6C824150, "scripts/aitypes/human/civilian_logic.gsc" }, + { 0x40E26106E37768BA, "scripts/aitypes/juggernaut/behaviors.gsc" }, + { 0x09F3D607A2667EBC, "scripts/aitypes/melee.gsc" }, + { 0x2B92E11988DD75FC, "scripts/aitypes/melee_sp.gsc" }, + { 0x3FECCEEDD2675490, "scripts/aitypes/patrol.gsc" }, + { 0x201E1A94F1554A07, "scripts/aitypes/riotshield/riotshield.gsc" }, + { 0x2E9D38C750386509, "scripts/aitypes/robot_dismember.gsc" }, + { 0x544C874800E20BAA, "scripts/aitypes/soldier/agent_setup.gsc" }, + { 0x7997E75E8C58A096, "scripts/aitypes/squad.gsc" }, + { 0x4B3E96950DE06E8C, "scripts/aitypes/squad_movement.gsc" }, + { 0x25EC558982515BD3, "scripts/aitypes/stealth.gsc" }, + { 0x74CB2F5C7F07F60A, "scripts/aitypes/suicidebomber/combat.gsc" }, + { 0x11F8482D601A0E8B, "scripts/aitypes/suicidebomber/setup_agent.gsc" }, + { 0x412F6C016572E634, "scripts/aitypes/throwgrenade.gsc" }, + { 0x009260F116382760, "scripts/aitypes/vehicle.gsc" }, + { 0x1ADB4918CECB4F6A, "scripts/aitypes/weapon.gsc" }, + { 0x0C7FA313D48D792B, "scripts/asm/asm.gsc" }, + { 0x2161B5FA22FA7E26, "scripts/asm/asm_bb.gsc" }, + { 0x547B73EF8F00503B, "scripts/asm/asm_mp.gsc" }, + { 0x1CD62A16E0D5DD95, "scripts/asm/asm_sp.gsc" }, + { 0x5BEE3EC20D14B069, "scripts/asm/civilian/script_funcs.gsc" }, + { 0x49410A43C4B33594, "scripts/asm/dog/move.gsc" }, + { 0x22A56195290EDD97, "scripts/asm/gesture.gsc" }, + { 0x55BE6492B84E43C1, "scripts/asm/gesture/script_funcs.gsc" }, + { 0x260BE52CAB2E0891, "scripts/asm/juggernaut/juggernaut.gsc" }, + { 0x53615BFEFEAE0BC2, "scripts/asm/seeker/melee.gsc" }, + { 0x669A259AF13C5E60, "scripts/asm/shared/mp/utility.gsc" }, + { 0x23366F933E3CF3A6, "scripts/asm/shared/sp/utility.gsc" }, + { 0x48E99BBFB1C38498, "scripts/asm/shared/utility.gsc" }, + { 0x6815796065987415, "scripts/asm/shoot/script_funcs.gsc" }, + { 0x48CFCAC846FDE7EC, "scripts/asm/soldier/arrival.gsc" }, + { 0x15C58B3443C8F5AA, "scripts/asm/soldier/cover.gsc" }, + { 0x4FA7F12CF0B115EA, "scripts/asm/soldier/cp.gsc" }, + { 0x15911D67A81B41FA, "scripts/asm/soldier/custom.gsc" }, + { 0x498A94B2B971C46B, "scripts/asm/soldier/death.gsc" }, + { 0x4482EF346D9A8971, "scripts/asm/soldier/grenade_response.gsc" }, + { 0x15F86984DA58CDA7, "scripts/asm/soldier/ground_turret.gsc" }, + { 0x7C21424B9BAF1D83, "scripts/asm/soldier/interactable.gsc" }, + { 0x793ED8A24E515D55, "scripts/asm/soldier/lmg.gsc" }, + { 0x1C26AA437F78EC66, "scripts/asm/soldier/long_death.gsc" }, + { 0x473FB7B284CF9EDD, "scripts/asm/soldier/melee.gsc" }, + { 0x7430CC4DC955D54C, "scripts/asm/soldier/move.gsc" }, + { 0x349C0B9D73BC7BEC, "scripts/asm/soldier/mp/gesture_script_funcs.gsc" }, + { 0x2E42A30B207A31F7, "scripts/asm/soldier/mp/melee.gsc" }, + { 0x0F5F3AF38B9CE328, "scripts/asm/soldier/mp/script_funcs.gsc" }, + { 0x3D342FD57D1AB889, "scripts/asm/soldier/pain.gsc" }, + { 0x0D61CBBD5CF60E27, "scripts/asm/soldier/patrol.gsc" }, + { 0x48BE9A3E6E3CB250, "scripts/asm/soldier/patrol_idle.gsc" }, + { 0x7DCD7FACEB87E0DA, "scripts/asm/soldier/script_funcs.gsc" }, + { 0x2FC5F0C2A4C01B47, "scripts/asm/soldier/smartobject.gsc" }, + { 0x51A1C4EE4E4055E9, "scripts/asm/soldier/sp/melee.gsc" }, + { 0x3ECDB4A40E3CC60E, "scripts/asm/soldier/sp/script_funcs.gsc" }, + { 0x01D019CB9DAA869F, "scripts/asm/soldier/throwgrenade.gsc" }, + { 0x55C37F8D19CC80E7, "scripts/asm/soldier/traverse.gsc" }, + { 0x41AD1F1424DD3CC9, "scripts/asm/soldier/vehicle.gsc" }, + { 0x1BADAF71B53D50F3, "scripts/asm/suicidebomber/suicidebomber.gsc" }, + { 0x401F827F9CA276D7, "scripts/asm/track.gsc" }, + { 0x2AE0C65FFBA71F3C, "scripts/asm/traverse.gsc" }, + { 0x6F81AE0370D9FD4C, "scripts/code/ai.gsc" }, + { 0x01299D55C0D48CC2, "scripts/code/ai_shooting.gsc" }, + { 0x3B7877BFCEC26473, "scripts/code/character.gsc" }, + { 0x2B0D7E2A0F096CD1, "scripts/code/delete.gsc" }, + { 0x34A720E17D0E697B, "scripts/code/struct.gsc" }, + { 0x659C5B2112E17034, "scripts/common/ai.gsc" }, + { 0x7C0FA206E882CECB, "scripts/common/anim.gsc" }, + { 0x7A6DBD11DBD96EDB, "scripts/common/basic_wind.gsc" }, + { 0x59BAC1035C67173C, "scripts/common/bcs_location_trigs.gsc" }, + { 0x2FFC9CC854107314, "scripts/common/create_cover_nodes.gsc" }, + { 0x75152F52D4583A69, "scripts/common/create_script_utility.gsc" }, + { 0x21486AC5E51045AC, "scripts/common/createfx.gsc" }, + { 0x3B7AF1FD5F2FBB0B, "scripts/common/createfxmenu.gsc" }, + { 0x25660DC6A1A4925F, "scripts/common/csplines.gsc" }, + { 0x30C42DCABD30A39B, "scripts/common/debug_graycard.gsc" }, + { 0x7BABF1485CAE49AB, "scripts/common/debug_reflection.gsc" }, + { 0x3A68A1BDABCACFF8, "scripts/common/elevator.gsc" }, + { 0x0BF3584572AA2FEB, "scripts/common/exploder.gsc" }, + { 0x547435A3732A58C4, "scripts/common/fx.gsc" }, + { 0x22DA8B656744450B, "scripts/common/gameskill.gsc" }, + { 0x200FD802F1105446, "scripts/common/input_allow.gsc" }, + { 0x6318547A70575AE4, "scripts/common/interactive.gsc" }, + { 0x69C2C8AD1C1A4602, "scripts/common/lbravo_ai_infil.gsc" }, + { 0x16448E4E69E35554, "scripts/common/mocap_ar.gsc" }, + { 0x7B165416C1291173, "scripts/common/notetrack.gsc" }, + { 0x4DA9FC5BA0EF1B33, "scripts/common/painter.gsc" }, + { 0x3510835C04D231DF, "scripts/common/rockable_vehicles.gsc" }, + { 0x3B96C3C24CBD640D, "scripts/common/screens.gsc" }, + { 0x70A710E9C0B2022D, "scripts/common/scriptable.gsc" }, + { 0x2C127AAC33157CB4, "scripts/common/turret.gsc" }, + { 0x569B10679FE8CF60, "scripts/common/ui.gsc" }, + { 0x692B19B8E5F8F9E8, "scripts/common/utility.gsc" }, + { 0x4A975D4EC578D9B0, "scripts/common/vehicle.gsc" }, + { 0x1DA5EE063934C32C, "scripts/common/vehicle_aianim.gsc" }, + { 0x7B28CBA57F879E5B, "scripts/common/vehicle_build.gsc" }, + { 0x6D7498659E4F29AE, "scripts/common/vehicle_code.gsc" }, + { 0x1DAFAEBC95981B6E, "scripts/common/vehicle_lights.gsc" }, + { 0x52E0904904AD8537, "scripts/common/vehicle_paths.gsc" }, + { 0x2F491F1DD7B13125, "scripts/common/vehicle_treadfx.gsc" }, + { 0x405C84A849DDC4FB, "scripts/cp/agents/agents.gsc" }, + { 0x10122B3722577A77, "scripts/cp/agents/gametype_cp_specops.gsc" }, + { 0x65E1DFAB60102E56, "scripts/cp/agents/gametype_cp_strike.gsc" }, + { 0x06956673F919E9E6, "scripts/cp/agents/gametype_cp_survival.gsc" }, + { 0x5F75DE291FA2FE7A, "scripts/cp/agents/gametype_cp_wave_survival.gsc" }, + { 0x6E861200387556E9, "scripts/cp/agents/gametype_cp_wave_sv.gsc" }, + { 0x5754FAA22F6AAA4F, "scripts/cp/agents/soldier_agent_spec.gsc" }, + { 0x056F189DC0896467, "scripts/cp/animation_suite.gsc" }, + { 0x05E7E74A6FD92E01, "scripts/cp/astar.gsc" }, + { 0x6D5BA21672C0B8C5, "scripts/cp/bomb_defusal/coop_bomb_defusal.gsc" }, + { 0x604E0C0070C6DCA0, "scripts/cp/calloutmarkerping_cp.gsc" }, + { 0x35EA29F9BD5D2F7E, "scripts/cp/challenges_cp.gsc" }, + { 0x023A633AC3893869, "scripts/cp/classes/cp_class_progression.gsc" }, + { 0x7C4C41D3546BB30A, "scripts/cp/compass.gsc" }, + { 0x41DD26B3A399A786, "scripts/cp/coop_createfx.gsc" }, + { 0x0A7B6C06E6FAEFEB, "scripts/cp/coop_escape.gsc" }, + { 0x68B37C1D85B7E9E0, "scripts/cp/coop_escort.gsc" }, + { 0x7D5265119FD77B8E, "scripts/cp/coop_fx.gsc" }, + { 0x21CE68A1EC9DC5BD, "scripts/cp/coop_personal_ents.gsc" }, + { 0x62E660BE1C9E00D0, "scripts/cp/coop_priority_queue.gsc" }, + { 0x3847B28F27EF1719, "scripts/cp/coop_stealth.gsc" }, + { 0x62E168CCD910BE81, "scripts/cp/coop_super.gsc" }, + { 0x50952380C88E8FAE, "scripts/cp/cp_accessories.gsc" }, + { 0x36B30489B2EC202B, "scripts/cp/cp_achievement.gsc" }, + { 0x289A9D58A559EC35, "scripts/cp/cp_adrenaline_crate.gsc" }, + { 0x0EE49FBD69A66DBD, "scripts/cp/cp_agent_damage.gsc" }, + { 0x5BA9955F5F7C5E56, "scripts/cp/cp_agent_patrol.gsc" }, + { 0x55ACBC2CDAEAA753, "scripts/cp/cp_agent_utils.gsc" }, + { 0x5D1BDBB0E8564315, "scripts/cp/cp_ai_spawn_anim_skits.gsc" }, + { 0x2F6B6BF9F9432559, "scripts/cp/cp_aiparachute.gsc" }, + { 0x0F377DF950536F95, "scripts/cp/cp_aitype_structs_ally_usmc.gsc" }, + { 0x54A590FCE0C11C95, "scripts/cp/cp_aitype_structs_enemy_alq.gsc" }, + { 0x448DD552F3B44DE4, "scripts/cp/cp_ammo_crate.gsc" }, + { 0x0C0338520796EBF4, "scripts/cp/cp_analytics.gsc" }, + { 0x11CC830B10EC9E27, "scripts/cp/cp_anim.gsc" }, + { 0x3AAFE0ECAC1FDE8F, "scripts/cp/cp_armor.gsc" }, + { 0x46BB2A6790B9851B, "scripts/cp/cp_armor_crate.gsc" }, + { 0x160BC2B853762904, "scripts/cp/cp_awards.gsc" }, + { 0x5C9273E0753F93F7, "scripts/cp/cp_battlechatter.gsc" }, + { 0x083851F1CB94F27C, "scripts/cp/cp_battlechatter_ai.gsc" }, + { 0x1CD928C73A3C7AED, "scripts/cp/cp_breach_c4.gsc" }, + { 0x26E61A39B49A2D61, "scripts/cp/cp_c4.gsc" }, + { 0x0D3AF535878CE6A1, "scripts/cp/cp_challenge.gsc" }, + { 0x77CEB810FB262D44, "scripts/cp/cp_checkpoint.gsc" }, + { 0x274B3B919A446B08, "scripts/cp/cp_circuit_breaker.gsc" }, + { 0x66B6D782FB63652E, "scripts/cp/cp_claymore.gsc" }, + { 0x0AE604151E11DB2C, "scripts/cp/cp_compass.gsc" }, + { 0x3B12F328DD1C03E3, "scripts/cp/cp_computerscreen.gsc" }, + { 0x79B0E7CC995DD9D8, "scripts/cp/cp_convoy_manager.gsc" }, + { 0x2E1125AF53E52D26, "scripts/cp/cp_convoy_manager_code.gsc" }, + { 0x2C415637F5D843BE, "scripts/cp/cp_core_gamescore.gsc" }, + { 0x65DD81F3017F5CAD, "scripts/cp/cp_create_script_utility.gsc" }, + { 0x2BD44F94DBFDD1BF, "scripts/cp/cp_damage.gsc" }, + { 0x79678F455E1BAE9C, "scripts/cp/cp_damagefeedback.gsc" }, + { 0x0B39A8DB9AB23587, "scripts/cp/cp_debug.gsc" }, + { 0x19D8325A65696BEC, "scripts/cp/cp_deployablebox.gsc" }, + { 0x6BB1B234318E600C, "scripts/cp/cp_destruction.gsc" }, + { 0x1E66FFA1ABB2E499, "scripts/cp/cp_dev_hud.gsc" }, + { 0x4BD2BA471F17FD24, "scripts/cp/cp_dialogue.gsc" }, + { 0x19CB693D3542F849, "scripts/cp/cp_disguise.gsc" }, + { 0x75A639502844BC46, "scripts/cp/cp_door.gsc" }, + { 0x4CFB447F698AF057, "scripts/cp/cp_drone_strike.gsc" }, + { 0x4C07635B8E253F91, "scripts/cp/cp_electricswitch.gsc" }, + { 0x73F12CC9B65A9264, "scripts/cp/cp_elevator.gsc" }, + { 0x729BFF892DF4D9FF, "scripts/cp/cp_endgame.gsc" }, + { 0x24BD5A7A5FC72606, "scripts/cp/cp_enemy_drone_turret.gsc" }, + { 0x3C605EEE483F1C75, "scripts/cp/cp_enemy_sentry_turret.gsc" }, + { 0x68818DD6020A3887, "scripts/cp/cp_enemy_tank.gsc" }, + { 0x7FA8962E0706F150, "scripts/cp/cp_equipment.gsc" }, + { 0x6394291F25436853, "scripts/cp/cp_escalation.gsc" }, + { 0x20055BA1138A8A43, "scripts/cp/cp_events.gsc" }, + { 0x499369DA3F41F053, "scripts/cp/cp_flares.gsc" }, + { 0x49F97D6E0D4F141C, "scripts/cp/cp_gamescore.gsc" }, + { 0x4C8018F9FF5EE237, "scripts/cp/cp_gameskill.gsc" }, + { 0x72C3C07972988B3A, "scripts/cp/cp_gastrap.gsc" }, + { 0x1DADE61B2677915B, "scripts/cp/cp_globallogic.gsc" }, + { 0x3FAD8171AC52C26D, "scripts/cp/cp_globalthreat.gsc" }, + { 0x4AD2AE2940C76DEA, "scripts/cp/cp_grenade_crate.gsc" }, + { 0x3CE6569E07B2E327, "scripts/cp/cp_hacking.gsc" }, + { 0x3E40218F8932A799, "scripts/cp/cp_hostage.gsc" }, + { 0x595F86A2BB6ADE56, "scripts/cp/cp_hostmigration.gsc" }, + { 0x543CB32E96D20FF9, "scripts/cp/cp_hud_message.gsc" }, + { 0x151D81BF634AAD5C, "scripts/cp/cp_hud_util.gsc" }, + { 0x013C7C6E617BFDA4, "scripts/cp/cp_infilexfil.gsc" }, + { 0x36D208603073D4AC, "scripts/cp/cp_interaction.gsc" }, + { 0x62F044B0BDE21572, "scripts/cp/cp_juggernaut.gsc" }, + { 0x1EEB362406E2139A, "scripts/cp/cp_kidnapper.gsc" }, + { 0x4073C1DE36946D4E, "scripts/cp/cp_ladder.gsc" }, + { 0x132D62A694A66E00, "scripts/cp/cp_laststand.gsc" }, + { 0x41F8DCD8474CD588, "scripts/cp/cp_loadout.gsc" }, + { 0x6721E69491B4F122, "scripts/cp/cp_manned_turret.gsc" }, + { 0x78589419EEF19156, "scripts/cp/cp_mapselect.gsc" }, + { 0x46707B4CCAE70331, "scripts/cp/cp_matchdata.gsc" }, + { 0x314A4197D2CF4C94, "scripts/cp/cp_merits.gsc" }, + { 0x6D71D59B1E04DAD4, "scripts/cp/cp_missilelauncher.gsc" }, + { 0x23D156EB33881960, "scripts/cp/cp_modular_spawning.gsc" }, + { 0x394726D755FA7F04, "scripts/cp/cp_movers.gsc" }, + { 0x436617F5ADA283AE, "scripts/cp/cp_munitions.gsc" }, + { 0x4105B921C7A84DF8, "scripts/cp/cp_music_and_dialog.gsc" }, + { 0x09DD76076AFA2AA3, "scripts/cp/cp_objective_mechanics.gsc" }, + { 0x7A2F1D02E511EC5A, "scripts/cp/cp_objectives.gsc" }, + { 0x2C5E6CC8E8B7747C, "scripts/cp/cp_objectives_events.gsc" }, + { 0x735FDF50A470071A, "scripts/cp/cp_outline.gsc" }, + { 0x3E212ACF2CC9EA85, "scripts/cp/cp_outline_utility.gsc" }, + { 0x73E73FCA13CCD95C, "scripts/cp/cp_outofbounds.gsc" }, + { 0x1287EAC158212373, "scripts/cp/cp_persistence.gsc" }, + { 0x42FC6259D39D4FE4, "scripts/cp/cp_pickup_hostage.gsc" }, + { 0x721F5F6C6EABDD5B, "scripts/cp/cp_player_battlechatter.gsc" }, + { 0x79F7187B2F8EC442, "scripts/cp/cp_playerchatter.gsc" }, + { 0x7CA04657035BFE5D, "scripts/cp/cp_points.gsc" }, + { 0x7F3615DDBB6372C8, "scripts/cp/cp_powers.gsc" }, + { 0x08DC23A8D8BAD4C3, "scripts/cp/cp_puzzles_core.gsc" }, + { 0x483CDEC62A993616, "scripts/cp/cp_quest.gsc" }, + { 0x2720F2C0EEF1847C, "scripts/cp/cp_rank.gsc" }, + { 0x1E349F6532636F4A, "scripts/cp/cp_relics.gsc" }, + { 0x60ABB2EDB1338747, "scripts/cp/cp_remote_tank.gsc" }, + { 0x00ECDC0601E07F09, "scripts/cp/cp_reward.gsc" }, + { 0x126F12D0A469E47E, "scripts/cp/cp_scriptable_states.gsc" }, + { 0x4A93F3F847237123, "scripts/cp/cp_scriptmover_util.gsc" }, + { 0x25ED60BD2F4EA1F8, "scripts/cp/cp_skits.gsc" }, + { 0x3F387D484A0707C4, "scripts/cp/cp_smg_prototype.gsc" }, + { 0x6B4715003EA60CAD, "scripts/cp/cp_snakecam.gsc" }, + { 0x5AB40AA9E7FBD159, "scripts/cp/cp_spawn_factor.gsc" }, + { 0x28B2968BED25CDBE, "scripts/cp/cp_spawner_scoring.gsc" }, + { 0x293B992A2249F427, "scripts/cp/cp_spawning.gsc" }, + { 0x6C4EFA38D9C4B14E, "scripts/cp/cp_spawning_util.gsc" }, + { 0x48A22E190B3C937B, "scripts/cp/cp_squadmanager.gsc" }, + { 0x2FE06DE324077B78, "scripts/cp/cp_stealth_zombie.gsc" }, + { 0x2BB0F43E94BDC558, "scripts/cp/cp_strike_debug.gsc" }, + { 0x277ACFFF23CDF23D, "scripts/cp/cp_traversalassist.gsc" }, + { 0x2132AFACF8AF45A8, "scripts/cp/cp_trigger_spawn.gsc" }, + { 0x2A5E5A422CE4E9D0, "scripts/cp/cp_turret.gsc" }, + { 0x55E7B7B36A41E879, "scripts/cp/cp_vehicle_structs.gsc" }, + { 0x4D8013A60BD4C8FB, "scripts/cp/cp_vehicle_turretdrone.gsc" }, + { 0x705070321815B6C3, "scripts/cp/cp_vehicles.gsc" }, + { 0x27F63F0BE922A0D3, "scripts/cp/cp_vip.gsc" }, + { 0x059F5880FFCCAAF7, "scripts/cp/cp_visionsets.gsc" }, + { 0x2B69DBD597BCE765, "scripts/cp/cp_vo.gsc" }, + { 0x1C546092D05D8344, "scripts/cp/cp_wall_buys.gsc" }, + { 0x418552E46A3464DB, "scripts/cp/cp_wave_spawning.gsc" }, + { 0x0B27F513235A49F6, "scripts/cp/cp_weapon.gsc" }, + { 0x4159CAEE51B2FA49, "scripts/cp/cp_weapon_autosentry.gsc" }, + { 0x37A60B7D589FEEFD, "scripts/cp/cp_weapon_upgrade.gsc" }, + { 0x1F22B3E6E26E904C, "scripts/cp/cp_weaponrank.gsc" }, + { 0x51668D1005BA4945, "scripts/cp/cp_weapons.gsc" }, + { 0x089B97E3AB1D86BC, "scripts/cp/crafting_system.gsc" }, + { 0x5A4ADAD6D823A135, "scripts/cp/crate_drops/cp_crate_drops.gsc" }, + { 0x50B2A6EDDE41AA2E, "scripts/cp/crate_drops/cp_crate_drops_cs.gsc" }, + { 0x234683D1B1309737, "scripts/cp/dedicated.gsc" }, + { 0x2992CA5600A39A84, "scripts/cp/drone/emp_drone.gsc" }, + { 0x6563DD1C0DB7EEB8, "scripts/cp/drone/scout_drone.gsc" }, + { 0x0F63DE2324CD0A73, "scripts/cp/drone/utility.gsc" }, + { 0x6F1A8D1455F4B483, "scripts/cp/emp_debuff_cp.gsc" }, + { 0x7034768B987DCC5A, "scripts/cp/equipment/cp_adrenaline.gsc" }, + { 0x3DEA9FE4B123C89C, "scripts/cp/equipment/cp_at_mine.gsc" }, + { 0x7F8C3E1308318968, "scripts/cp/equipment/cp_decoy_grenade.gsc" }, + { 0x2DD9AE325464900D, "scripts/cp/equipment/cp_gas_grenade.gsc" }, + { 0x79411BE27480A61B, "scripts/cp/equipment/cp_incendiarylauncher.gsc" }, + { 0x3AA23057F7A1DA26, "scripts/cp/equipment/cp_javelin.gsc" }, + { 0x4A1F5B8DBD8EE120, "scripts/cp/equipment/cp_snapshot_grenade.gsc" }, + { 0x55FCDDC3879C791B, "scripts/cp/equipment/cp_stinger.gsc" }, + { 0x5FDF216092548A5F, "scripts/cp/equipment/cp_thermite.gsc" }, + { 0x6E157D31BFA255A7, "scripts/cp/equipment/cp_trophy_system.gsc" }, + { 0x024D396DBAC5EACC, "scripts/cp/equipment/nvg.gsc" }, + { 0x2971096D244C08A9, "scripts/cp/equipment/throwing_knife_cp.gsc" }, + { 0x13D36FE5666830E0, "scripts/cp/execution.gsc" }, + { 0x4F7F576DE1DCE67B, "scripts/cp/extraction/cp_extraction.gsc" }, + { 0x0DA52CED873B216E, "scripts/cp/factions/faction_progression.gsc" }, + { 0x1D156FFAA6303170, "scripts/cp/gestures_cp.gsc" }, + { 0x182955D3F35EB8F1, "scripts/cp/helicopter/chopper_boss.gsc" }, + { 0x11845DB74B81359F, "scripts/cp/helicopter/cp_helicopter.gsc" }, + { 0x72046D774C498C82, "scripts/cp/helicopter/utility.gsc" }, + { 0x37200B0B79C2EF45, "scripts/cp/infilexfil/blima_exfil.gsc" }, + { 0x78A156FE8BE93D79, "scripts/cp/infilexfil/cp_fulton.gsc" }, + { 0x19EE9AE3BB56EEDF, "scripts/cp/infilexfil/infilexfil.gsc" }, + { 0x15BE0F50D6E10D48, "scripts/cp/infilexfil/lbravo_infil_cp.gsc" }, + { 0x59861361D1C462C0, "scripts/cp/init_cp_mp.gsc" }, + { 0x762FABC1B3DB8E09, "scripts/cp/intel/cp_intel.gsc" }, + { 0x66B95516D39196A1, "scripts/cp/inventory/cp_ac130.gsc" }, + { 0x1D3630F1A437E071, "scripts/cp/inventory/cp_target_marker.gsc" }, + { 0x5D8F456289A1D209, "scripts/cp/killstreaks/airdrop_cp.gsc" }, + { 0x2D0318BFB4B92462, "scripts/cp/killstreaks/airdrop_multiple_cp.gsc" }, + { 0x41487CD704154DB4, "scripts/cp/killstreaks/airstrike_cp.gsc" }, + { 0x07615068E3C982AD, "scripts/cp/killstreaks/chopper_gunner_cp.gsc" }, + { 0x24414BB83B2F2627, "scripts/cp/killstreaks/chopper_support_cp.gsc" }, + { 0x75EF61B8FA1851D7, "scripts/cp/killstreaks/cruise_predator_cp.gsc" }, + { 0x5C331B181262E30F, "scripts/cp/killstreaks/emp_drone_cp.gsc" }, + { 0x38D20730D37456E8, "scripts/cp/killstreaks/emp_drone_targeted_cp.gsc" }, + { 0x2B368CB92B87ABCA, "scripts/cp/killstreaks/gunship_cp.gsc" }, + { 0x66BFF03F5F3A9627, "scripts/cp/killstreaks/helper_drone_cp.gsc" }, + { 0x20E2F9F4FDAFF8BE, "scripts/cp/killstreaks/init_cp.gsc" }, + { 0x62761DCD7830BB44, "scripts/cp/killstreaks/juggernaut_cp.gsc" }, + { 0x379BB8C3760185C1, "scripts/cp/killstreaks/manual_turret_cp.gsc" }, + { 0x617CD7DACAE8B0AF, "scripts/cp/killstreaks/nuke_cp.gsc" }, + { 0x3FDC0D8E4813F83E, "scripts/cp/killstreaks/sentry_gun_cp.gsc" }, + { 0x48C42FBBA757D4C0, "scripts/cp/killstreaks/toma_strike_cp.gsc" }, + { 0x6E23C318CA220FA2, "scripts/cp/killstreaks/uav_cp.gsc" }, + { 0x616AC24964989CC7, "scripts/cp/killstreaks/white_phosphorus_cp.gsc" }, + { 0x555547ED1870372D, "scripts/cp/laser_traps/cp_laser_traps.gsc" }, + { 0x6A0B0E660F7EDB04, "scripts/cp/loot_system.gsc" }, + { 0x7E9D90E98B1AE85B, "scripts/cp/perks/cp_perk_utility.gsc" }, + { 0x37F000531EFB9D03, "scripts/cp/perks/cp_perks.gsc" }, + { 0x63407818698EE089, "scripts/cp/perks/cp_prestige.gsc" }, + { 0x057EC8322297A84E, "scripts/cp/pingcallout_cp.gsc" }, + { 0x502187EE15ADB8B1, "scripts/cp/powers/coop_molotov.gsc" }, + { 0x44A1A202E6133294, "scripts/cp/powers/cp_tactical_cover.gsc" }, + { 0x2D28088944F7766D, "scripts/cp/pvpe/pvpe.gsc" }, + { 0x0E4F3E49398FDBE5, "scripts/cp/pvpve/pvpve.gsc" }, + { 0x2837C33EF529314B, "scripts/cp/radio_tower/cp_radio_tower.gsc" }, + { 0x66FFCF39AE863223, "scripts/cp/raid_utility.gsc" }, + { 0x3BFD40AADA1034F6, "scripts/cp/respawn/cp_ac130_respawn.gsc" }, + { 0x28290868030F4DAD, "scripts/cp/respawn/cp_respawn.gsc" }, + { 0x537196C25A85B8A3, "scripts/cp/scriptable.gsc" }, + { 0x267AE50D73BFF6EE, "scripts/cp/so_globallogic.gsc" }, + { 0x494B527121EA82C5, "scripts/cp/so_laststand.gsc" }, + { 0x4CAE33BC187465E1, "scripts/cp/so_trigger.gsc" }, + { 0x5EF6C5C3AFDBA79D, "scripts/cp/so_utility.gsc" }, + { 0x62B2946CC63C0E99, "scripts/cp/so_utility_code.gsc" }, + { 0x48A12E277630CD65, "scripts/cp/stealth/manager.gsc" }, + { 0x15CAA49E8AB60CD8, "scripts/cp/survival/survival_loadout.gsc" }, + { 0x18E0E81A33DEC69E, "scripts/cp/tripwire_cp.gsc" }, + { 0x704D66AFC508AC3A, "scripts/cp/utility.gsc" }, + { 0x0AC80AB8D0901385, "scripts/cp/utility/auto_ascender_ai.gsc" }, + { 0x22598C6DFF6DBD60, "scripts/cp/utility/cp_controlled_callbacks.gsc" }, + { 0x10D8EB6F75795C29, "scripts/cp/utility/cp_safehouse_util.gsc" }, + { 0x428ADA98EB353632, "scripts/cp/utility/disconnect_event_aggregator.gsc" }, + { 0x2E7F32867417B1F6, "scripts/cp/utility/entity.gsc" }, + { 0x137A641CADC5DF20, "scripts/cp/utility/game_utility_cp.gsc" }, + { 0x71E60CC0B80CD0C5, "scripts/cp/utility/join_team_aggregator.gsc" }, + { 0x541F624691B67877, "scripts/cp/utility/lui_game_event_aggregator.gsc" }, + { 0x0B32BD37527ED5D0, "scripts/cp/utility/player.gsc" }, + { 0x667E082B97EDF486, "scripts/cp/utility/player_frame_update_aggregator.gsc" }, + { 0x4C9CFAABC41E2549, "scripts/cp/utility/player_utility_cp.gsc" }, + { 0x406B1E63095AC90E, "scripts/cp/utility/script.gsc" }, + { 0x1D00ED5404824759, "scripts/cp/utility/spawn_event_aggregator.gsc" }, + { 0x1A988F4238CC134A, "scripts/cp/vehicle.gsc" }, + { 0x3D3EEA27753FAC8D, "scripts/cp/vehicle_push/coop_vehicle_push.gsc" }, + { 0x0C8738F5E61AA3AD, "scripts/cp/vehicle_race/coop_vehicle_race.gsc" }, + { 0x1314F8CA41250C97, "scripts/cp/vehicles/apc_rus_cp.gsc" }, + { 0x7C1DC9B75012D20D, "scripts/cp/vehicles/atv_cp.gsc" }, + { 0x7E563E37F833241C, "scripts/cp/vehicles/big_bird_cp.gsc" }, + { 0x2D7CCD517FA86B5E, "scripts/cp/vehicles/cargo_truck_cp.gsc" }, + { 0x7E1F90B8FCC90D4B, "scripts/cp/vehicles/cargo_truck_mg_cp.gsc" }, + { 0x7F25952EB846B8E7, "scripts/cp/vehicles/cop_car_cp.gsc" }, + { 0x2587FE3CA828F536, "scripts/cp/vehicles/cp_heli_trip.gsc" }, + { 0x5D1664FAC671C656, "scripts/cp/vehicles/cp_helicopter_mi8.gsc" }, + { 0x30D9B647A58A56EF, "scripts/cp/vehicles/damage_cp.gsc" }, + { 0x1B2D7444824E829F, "scripts/cp/vehicles/hoopty_cp.gsc" }, + { 0x414B805680AEA797, "scripts/cp/vehicles/hoopty_truck_cp.gsc" }, + { 0x7917E328F45F245C, "scripts/cp/vehicles/jeep_cp.gsc" }, + { 0x4BFB17F9785E3B09, "scripts/cp/vehicles/large_transport_cp.gsc" }, + { 0x74469C864FA3300F, "scripts/cp/vehicles/light_tank_cp.gsc" }, + { 0x15E9979C98CB018C, "scripts/cp/vehicles/little_bird_cp.gsc" }, + { 0x2755B9F0595CAD15, "scripts/cp/vehicles/little_bird_mg_cp.gsc" }, + { 0x714C6548AB77A9D2, "scripts/cp/vehicles/med_transport_cp.gsc" }, + { 0x48462C9702C7F928, "scripts/cp/vehicles/pickup_truck_cp.gsc" }, + { 0x14993A596C0F22BB, "scripts/cp/vehicles/tac_rover_cp.gsc" }, + { 0x2D9DAB3C26B8A7AF, "scripts/cp/vehicles/technical_cp.gsc" }, + { 0x6EDB5C8081558415, "scripts/cp/vehicles/van_cp.gsc" }, + { 0x2B561C2CA275B62F, "scripts/cp/vehicles/vehicle_compass_cp.gsc" }, + { 0x09601F6FC1B3CDDA, "scripts/cp/vehicles/vehicle_cp.gsc" }, + { 0x4FBCA012BFA97E70, "scripts/cp/vehicles/vehicle_damage_cp.gsc" }, + { 0x394EEDA98D15D2C9, "scripts/cp/vehicles/vehicle_interact_cp.gsc" }, + { 0x1A436D415B296844, "scripts/cp/vehicles/vehicle_occupancy_cp.gsc" }, + { 0x08EA223C76EADE2B, "scripts/cp/vehicles/vehicle_oob_cp.gsc" }, + { 0x4510C91C8E5B6F12, "scripts/cp/vehicles/vehicle_spawn_cp.gsc" }, + { 0x6E2D0AB181B939D5, "scripts/cp/whizby.gsc" }, + { 0x5E5302BED1C9AB54, "scripts/cp/zombies/cp_consumables.gsc" }, + { 0x2AA3F2FD74992588, "scripts/cp/zombies/zombieclientmatchdata.gsc" }, + { 0x2B531F520DE8BE5D, "scripts/cp_mp/agents/agent_init.gsc" }, + { 0x21497CDFD058C796, "scripts/cp_mp/anim_scene.gsc" }, + { 0x057ECDF06AE2850F, "scripts/cp_mp/auto_ascender.gsc" }, + { 0x22C673C32C214B45, "scripts/cp_mp/auto_ascender_solo.gsc" }, + { 0x42B73095B90A5E40, "scripts/cp_mp/calloutmarkerping.gsc" }, + { 0x0EAACDDDEB82E2A2, "scripts/cp_mp/challenges.gsc" }, + { 0x610D10F06693A54C, "scripts/cp_mp/crossbow.gsc" }, + { 0x327F500C1192BBCC, "scripts/cp_mp/dragonsbreath.gsc" }, + { 0x310453FFD4B826CD, "scripts/cp_mp/emp_debuff.gsc" }, + { 0x34E0212BD6EB0B7B, "scripts/cp_mp/ent_manager.gsc" }, + { 0x58FDF2A4B13652E7, "scripts/cp_mp/entityheadicons.gsc" }, + { 0x59CAA65F7660D01F, "scripts/cp_mp/equipment/throwing_knife.gsc" }, + { 0x5CD95D34030AEF00, "scripts/cp_mp/execution.gsc" }, + { 0x0394B0216927D91B, "scripts/cp_mp/frontendutils.gsc" }, + { 0x79872B5D956B01EF, "scripts/cp_mp/gasmask.gsc" }, + { 0x068220E8E0090A70, "scripts/cp_mp/gestures.gsc" }, + { 0x4D92F0BDF2AE519C, "scripts/cp_mp/hostmigration.gsc" }, + { 0x3CBDD179351907FF, "scripts/cp_mp/killstreaks/airdrop.gsc" }, + { 0x29B9E1ED7F863326, "scripts/cp_mp/killstreaks/airdrop_multiple.gsc" }, + { 0x7EC888EDE02276A4, "scripts/cp_mp/killstreaks/airstrike.gsc" }, + { 0x3AFD0B936DD113D3, "scripts/cp_mp/killstreaks/chopper_gunner.gsc" }, + { 0x1A6122CD2AABBB81, "scripts/cp_mp/killstreaks/chopper_support.gsc" }, + { 0x493C15D9C046FE11, "scripts/cp_mp/killstreaks/cruise_predator.gsc" }, + { 0x12D33BE994A1E409, "scripts/cp_mp/killstreaks/emp_drone.gsc" }, + { 0x3D32F0014AE692A8, "scripts/cp_mp/killstreaks/emp_drone_targeted.gsc" }, + { 0x7B63B2C4EFF07F0E, "scripts/cp_mp/killstreaks/gunship.gsc" }, + { 0x796277B7D8384901, "scripts/cp_mp/killstreaks/helper_drone.gsc" }, + { 0x5D15FEFDE0156662, "scripts/cp_mp/killstreaks/init.gsc" }, + { 0x77A457A5D8F67854, "scripts/cp_mp/killstreaks/juggernaut.gsc" }, + { 0x5B79F7D46D6479DD, "scripts/cp_mp/killstreaks/killstreakdeploy.gsc" }, + { 0x37A6DF148102BC77, "scripts/cp_mp/killstreaks/manual_turret.gsc" }, + { 0x099B9AE87B9F00A9, "scripts/cp_mp/killstreaks/nuke.gsc" }, + { 0x319B26E5DA0E9AA2, "scripts/cp_mp/killstreaks/sentry_gun.gsc" }, + { 0x531984808E0A74E0, "scripts/cp_mp/killstreaks/toma_strike.gsc" }, + { 0x599E12F80C250C26, "scripts/cp_mp/killstreaks/uav.gsc" }, + { 0x4FA625E08B5F76E1, "scripts/cp_mp/killstreaks/white_phosphorus.gsc" }, + { 0x358A4C8214A89870, "scripts/cp_mp/mortar_launcher.gsc" }, + { 0x13D7519ECADA5FEA, "scripts/cp_mp/outofrange.gsc" }, + { 0x49863B206F5403F9, "scripts/cp_mp/parachute.gsc" }, + { 0x1762D7B022D62EC7, "scripts/cp_mp/pet_watch.gsc" }, + { 0x11C55E2B1FDB5952, "scripts/cp_mp/pingcallout.gsc" }, + { 0x67867A1F12BFFE59, "scripts/cp_mp/powershud.gsc" }, + { 0x3252C18D08B50FA7, "scripts/cp_mp/targetmarkergroups.gsc" }, + { 0x4F3E271314233182, "scripts/cp_mp/tripwire.gsc" }, + { 0x3E80883B1C2C99EA, "scripts/cp_mp/utility/callback_group.gsc" }, + { 0x530723981CD177B3, "scripts/cp_mp/utility/damage_utility.gsc" }, + { 0x725B0F2DCBE6355D, "scripts/cp_mp/utility/debug_utility.gsc" }, + { 0x2A1F65FFEC5045C2, "scripts/cp_mp/utility/dialog_utility.gsc" }, + { 0x6867234FFDC3D080, "scripts/cp_mp/utility/game_utility.gsc" }, + { 0x6067C167A3F99BBE, "scripts/cp_mp/utility/inventory_utility.gsc" }, + { 0x28B34FF40BDC5650, "scripts/cp_mp/utility/killstreak_utility.gsc" }, + { 0x2E16EF26A0FFD44D, "scripts/cp_mp/utility/omnvar_utility.gsc" }, + { 0x211923DEDCAFA6FF, "scripts/cp_mp/utility/player_utility.gsc" }, + { 0x629BF3BE88C38481, "scripts/cp_mp/utility/script_utility.gsc" }, + { 0x4ADB0DFC58C787C2, "scripts/cp_mp/utility/scriptable_door_utility.gsc" }, + { 0x4F467DF70D327452, "scripts/cp_mp/utility/shellshock_utility.gsc" }, + { 0x0AA432172D0E22B0, "scripts/cp_mp/utility/train_utility.gsc" }, + { 0x4B8FA1B777292D0C, "scripts/cp_mp/utility/vehicle_omnvar_utility.gsc" }, + { 0x1D0CF33B53E307AE, "scripts/cp_mp/utility/weapon_utility.gsc" }, + { 0x76C93B759C20A1D1, "scripts/cp_mp/vehicles/apc_rus.gsc" }, + { 0x75D95066D2C8F9B3, "scripts/cp_mp/vehicles/atv.gsc" }, + { 0x79BF3825A29C802C, "scripts/cp_mp/vehicles/big_bird.gsc" }, + { 0x36FD1BA91582B102, "scripts/cp_mp/vehicles/cargo_truck.gsc" }, + { 0x22B1DE31D2721635, "scripts/cp_mp/vehicles/cargo_truck_mg.gsc" }, + { 0x38D5E2DD897D3241, "scripts/cp_mp/vehicles/cop_car.gsc" }, + { 0x2E1B586227A20CEF, "scripts/cp_mp/vehicles/customization/battle_tracks.gsc" }, + { 0x22F5232830940339, "scripts/cp_mp/vehicles/hoopty.gsc" }, + { 0x3D00154BABB8D851, "scripts/cp_mp/vehicles/hoopty_truck.gsc" }, + { 0x67953482877E2F2C, "scripts/cp_mp/vehicles/jeep.gsc" }, + { 0x622D09A3F1D899BF, "scripts/cp_mp/vehicles/large_transport.gsc" }, + { 0x67E6850B771B9C89, "scripts/cp_mp/vehicles/light_tank.gsc" }, + { 0x4C822A64AB8A0BBC, "scripts/cp_mp/vehicles/little_bird.gsc" }, + { 0x664C60C6B4325FBB, "scripts/cp_mp/vehicles/little_bird_mg.gsc" }, + { 0x2C1C5D4D18A61876, "scripts/cp_mp/vehicles/med_transport.gsc" }, + { 0x1E06CF212F559628, "scripts/cp_mp/vehicles/pickup_truck.gsc" }, + { 0x4DA9787D96781405, "scripts/cp_mp/vehicles/tac_rover.gsc" }, + { 0x27C4FFEF9D1A1E29, "scripts/cp_mp/vehicles/technical.gsc" }, + { 0x7405E9F971AEA03B, "scripts/cp_mp/vehicles/van.gsc" }, + { 0x7584507A08593DFE, "scripts/cp_mp/vehicles/vehicle.gsc" }, + { 0x0873A961AAF63D09, "scripts/cp_mp/vehicles/vehicle_collision.gsc" }, + { 0x53DAF50CB5B28A69, "scripts/cp_mp/vehicles/vehicle_compass.gsc" }, + { 0x1971B0AC5B8846B0, "scripts/cp_mp/vehicles/vehicle_damage.gsc" }, + { 0x5457C66E69E57487, "scripts/cp_mp/vehicles/vehicle_dlog.gsc" }, + { 0x6AFAA0F7EB512CFF, "scripts/cp_mp/vehicles/vehicle_interact.gsc" }, + { 0x6695768C8D8C0AC9, "scripts/cp_mp/vehicles/vehicle_mines.gsc" }, + { 0x1C66378FB8B32394, "scripts/cp_mp/vehicles/vehicle_occupancy.gsc" }, + { 0x715D43F039E876B6, "scripts/cp_mp/vehicles/vehicle_spawn.gsc" }, + { 0x0A7D1715B70FF548, "scripts/cp_mp/vehicles/vehicle_tracking.gsc" }, + { 0x052407859F1EE32A, "scripts/cp_mp/xmike109.gsc" }, + { 0x26AEEAA01EAA6490, "scripts/engine/dev.gsc" }, + { 0x0EF47F6B12175664, "scripts/engine/flags.gsc" }, + { 0x00A3E73C9CCEAFB1, "scripts/engine/math.gsc" }, + { 0x1685AE0605A93B68, "scripts/engine/scriptable.gsc" }, + { 0x68C270174E9CD90F, "scripts/engine/scriptable_door.gsc" }, + { 0x43CD7D39C04B0B1B, "scripts/engine/sp/objectives.gsc" }, + { 0x63847839C2EB90CF, "scripts/engine/sp/utility.gsc" }, + { 0x1F8967BAF0600893, "scripts/engine/sp/utility_code.gsc" }, + { 0x062CEB051D758BFE, "scripts/engine/trace.gsc" }, + { 0x4A55403D502E794F, "scripts/engine/utility.gsc" }, + { 0x09E8FC39CD2F6663, "scripts/game/sp/door.gsc" }, + { 0x5E0DDEE0791E26CF, "scripts/game/sp/load.gsc" }, + { 0x700102F2560F3709, "scripts/game/sp/outline.gsc" }, + { 0x5EA18269586EF376, "scripts/game/sp/player.gsc" }, + { 0x0D957B719A00CC94, "scripts/game/sp/stealth/manager.gsc" }, + { 0x5B685ED8CE43EEC7, "scripts/game/sp/trigger.gsc" }, + { 0x36DAF6000B4D77F8, "scripts/models/interactive_utility.gsc" }, + { 0x64EACF6046BF3D0E, "scripts/mp/accessories.gsc" }, + { 0x13D14023C67003BF, "scripts/mp/accolades.gsc" }, + { 0x39F58EA1AAEC2704, "scripts/mp/agents/agent_common.gsc" }, + { 0x2DF9D011999F18C5, "scripts/mp/agents/agent_utility.gsc" }, + { 0x069E2E8BEBE24A71, "scripts/mp/agents/agents.gsc" }, + { 0x1BBD73F73D2EF1B9, "scripts/mp/agents/alien/agents.gsc" }, + { 0x4CB10753200A48D0, "scripts/mp/agents/juggernaut/juggernaut_agent.gsc" }, + { 0x76A7F3AEE85CD833, "scripts/mp/agents/scriptedagents.gsc" }, + { 0x203A40177CB16AD2, "scripts/mp/agents/soldier/soldier_agent.gsc" }, + { 0x099823E985D28A2A, "scripts/mp/agents/suicidebomber/suicidebomber_agent.gsc" }, + { 0x774A3800757E6127, "scripts/mp/ammorestock.gsc" }, + { 0x6451646090824DA0, "scripts/mp/analyticslog.gsc" }, + { 0x73B60289C107FA07, "scripts/mp/anim.gsc" }, + { 0x5C483C780DB0B4AD, "scripts/mp/animatedmodels.gsc" }, + { 0x036E9988C3BE2565, "scripts/mp/animation_suite.gsc" }, + { 0x5FED28AD3185123C, "scripts/mp/arbitrary_up.gsc" }, + { 0x69A005BA63022C32, "scripts/mp/archetypes/archassault.gsc" }, + { 0x344756288E55ECDC, "scripts/mp/archetypes/archcommon.gsc" }, + { 0x46CF841695574F2A, "scripts/mp/areas.gsc" }, + { 0x1582197658C00E0F, "scripts/mp/arm_objectives/arm_obj_capture.gsc" }, + { 0x0BB3B3FCF1E71C68, "scripts/mp/arm_objectives/arm_obj_nuke.gsc" }, + { 0x31FCFD26E002B5AD, "scripts/mp/art.gsc" }, + { 0x2CC9B45597129EE2, "scripts/mp/audio.gsc" }, + { 0x699319EBB3058664, "scripts/mp/awards.gsc" }, + { 0x09002E3F894F958F, "scripts/mp/battlechatter_mp.gsc" }, + { 0x2AE8954A31D1803F, "scripts/mp/battlechatter_trigs.gsc" }, + { 0x266C7A1B794E081D, "scripts/mp/bots/bots.gsc" }, + { 0x347C8A067853B721, "scripts/mp/bots/bots_killstreaks.gsc" }, + { 0x6D3FF989D9009D95, "scripts/mp/bots/bots_killstreaks_remote_vehicle.gsc" }, + { 0x715B1AE771EA5B66, "scripts/mp/bots/bots_loadout.gsc" }, + { 0x1AAA79412E7BC206, "scripts/mp/bots/bots_personality.gsc" }, + { 0x60842FAF6B334477, "scripts/mp/bots/bots_sentry.gsc" }, + { 0x4145A7B3D8867DC9, "scripts/mp/bots/bots_strategy.gsc" }, + { 0x6A4DD5B41C09D1DC, "scripts/mp/bots/bots_util.gsc" }, + { 0x2205C1B16EDB84F5, "scripts/mp/bounty.gsc" }, + { 0x6748E0ED34B820E0, "scripts/mp/brclientmatchdata.gsc" }, + { 0x4D6081907AE68B01, "scripts/mp/brmatchdata.gsc" }, + { 0x47E0A020EF1BD449, "scripts/mp/broshot.gsc" }, + { 0x78985E1693DBFC76, "scripts/mp/broshot_utilities.gsc" }, + { 0x22FC1806B758E28C, "scripts/mp/callbacksetup.gsc" }, + { 0x235CCFCBDDE6F11C, "scripts/mp/calloutmarkerping_mp.gsc" }, + { 0x7001F79CFE5FF18F, "scripts/mp/callouts.gsc" }, + { 0x2FC321D925A41E8F, "scripts/mp/carriable.gsc" }, + { 0x5035FF3B2CDC2C78, "scripts/mp/challengefunctions.gsc" }, + { 0x1576A58623076050, "scripts/mp/challenges.gsc" }, + { 0x403A175F4355A4D6, "scripts/mp/challenges_mp.gsc" }, + { 0x366CA3A566B6972B, "scripts/mp/cinematic_replays/cinematic_replays.gsc" }, + { 0x062B082B02843BE8, "scripts/mp/class.gsc" }, + { 0x6256D4509C1489D0, "scripts/mp/clientmatchdata.gsc" }, + { 0x5BBC3347BA096E70, "scripts/mp/codcasterclientmatchdata.gsc" }, + { 0x054823A29593228C, "scripts/mp/compass.gsc" }, + { 0x6CA75CE7FE1AAC52, "scripts/mp/cranked.gsc" }, + { 0x515715367B555558, "scripts/mp/createfx.gsc" }, + { 0x4C9F3A24FEABDE1F, "scripts/mp/damage.gsc" }, + { 0x0AB66257F363A87C, "scripts/mp/damagefeedback.gsc" }, + { 0x706E421915FE0EC2, "scripts/mp/deathicons.gsc" }, + { 0x08B0AE017A7B271D, "scripts/mp/dedicated.gsc" }, + { 0x7AD2C20674B3130B, "scripts/mp/destructables.gsc" }, + { 0x2DCD44765B157D94, "scripts/mp/destructible.gsc" }, + { 0x7262B27DE233448F, "scripts/mp/dev.gsc" }, + { 0x578FB8CED8601826, "scripts/mp/door.gsc" }, + { 0x0091857B22BC390B, "scripts/mp/emp_debuff_mp.gsc" }, + { 0x6B0663A111030B30, "scripts/mp/equipment.gsc" }, + { 0x5195DCD5F2C7BAA0, "scripts/mp/equipment/adrenaline.gsc" }, + { 0x6220E12CD13C3ED3, "scripts/mp/equipment/advanced_supply_drop.gsc" }, + { 0x34501F9ECF90E137, "scripts/mp/equipment/ammo_box.gsc" }, + { 0x45459AD0B3175243, "scripts/mp/equipment/armor_plate.gsc" }, + { 0x55FA19D619695CBA, "scripts/mp/equipment/at_mine.gsc" }, + { 0x7A2AF52457AE0749, "scripts/mp/equipment/bandage.gsc" }, + { 0x7D848B7984C32341, "scripts/mp/equipment/binoculars.gsc" }, + { 0x107FE0BE820063D4, "scripts/mp/equipment/c4.gsc" }, + { 0x2C9121F81520D673, "scripts/mp/equipment/claymore.gsc" }, + { 0x51568199B1AF4A56, "scripts/mp/equipment/concussion_grenade.gsc" }, + { 0x1D31961E095E6EF6, "scripts/mp/equipment/decoy_grenade.gsc" }, + { 0x40B914EACAA3AA0C, "scripts/mp/equipment/emp_grenade.gsc" }, + { 0x1EDC017AA10C8CBC, "scripts/mp/equipment/flash_grenade.gsc" }, + { 0x5E747F703EDB679F, "scripts/mp/equipment/fulton.gsc" }, + { 0x7373E282602728FB, "scripts/mp/equipment/gas_grenade.gsc" }, + { 0x17E1C85F6522B03E, "scripts/mp/equipment/hb_sensor.gsc" }, + { 0x36BC9A97851A00C1, "scripts/mp/equipment/molotov.gsc" }, + { 0x356D29B50E0D748A, "scripts/mp/equipment/nvg.gsc" }, + { 0x1975B2A6D9277F52, "scripts/mp/equipment/snapshot_grenade.gsc" }, + { 0x6BD6931761011BDE, "scripts/mp/equipment/support_box.gsc" }, + { 0x62E0B7188E7534AB, "scripts/mp/equipment/tac_insert.gsc" }, + { 0x0E6F637D07D400CA, "scripts/mp/equipment/tactical_cover.gsc" }, + { 0x7624ADA505D2A7AD, "scripts/mp/equipment/thermite.gsc" }, + { 0x4FFAF2388B3485F9, "scripts/mp/equipment/throwing_knife_mp.gsc" }, + { 0x384F37134A7FC089, "scripts/mp/equipment/trophy_system.gsc" }, + { 0x72525C7AD16B9DBF, "scripts/mp/equipment/weapon_drop.gsc" }, + { 0x08BAE979BBAB4744, "scripts/mp/equipment/wristrocket.gsc" }, + { 0x58D07AF23A255EDD, "scripts/mp/equipment_interact.gsc" }, + { 0x66CF1FB5A503DC23, "scripts/mp/events.gsc" }, + { 0x70E69A9871881054, "scripts/mp/execution_mp.gsc" }, + { 0x6C56BE85DC248D98, "scripts/mp/final_killcam.gsc" }, + { 0x778027EDF01BD587, "scripts/mp/flags.gsc" }, + { 0x2652A8D02E4D8616, "scripts/mp/flashpoint.gsc" }, + { 0x4B4D37F69AE2EE32, "scripts/mp/friendicons.gsc" }, + { 0x706C46647D245B88, "scripts/mp/fx.gsc" }, + { 0x184C00AF74E45F30, "scripts/mp/gamelogic.gsc" }, + { 0x08EB711E37ED0AFA, "scripts/mp/gameobjects.gsc" }, + { 0x267A69C97E3C6C7C, "scripts/mp/gamescore.gsc" }, + { 0x6A8018994EBC5564, "scripts/mp/gestures_mp.gsc" }, + { 0x5411D5BC326E2B16, "scripts/mp/global_fx.gsc" }, + { 0x650FA6593ACFEE24, "scripts/mp/global_fx_code.gsc" }, + { 0x60BE114DF57C78E6, "scripts/mp/globalentities.gsc" }, + { 0x3FA219AD83E2CEBB, "scripts/mp/globallogic.gsc" }, + { 0x6FC56E06DD73EFE6, "scripts/mp/healthoverlay.gsc" }, + { 0x5242C074CD388A30, "scripts/mp/heavyarmor.gsc" }, + { 0x35B1921537324436, "scripts/mp/hostmigration.gsc" }, + { 0x026F0756F77CFCFD, "scripts/mp/hud.gsc" }, + { 0x52A6D55588CB0819, "scripts/mp/hud_message.gsc" }, + { 0x64AFAE76CCB166FC, "scripts/mp/hud_util.gsc" }, + { 0x462BDA75FFA6B33D, "scripts/mp/infilexfil/infilexfil.gsc" }, + { 0x42BAB28F5AE5F14E, "scripts/mp/infilexfil/lbravo_infil.gsc" }, + { 0x734ED556D535A69C, "scripts/mp/infilexfil/mi8_infil.gsc" }, + { 0x6B0802F0AC29060A, "scripts/mp/infilexfil/rappel_hackney_infil.gsc" }, + { 0x21333AE88F67B6A6, "scripts/mp/infilexfil/tango72_infil.gsc" }, + { 0x4CEDFC60057078BB, "scripts/mp/infilexfil/umike_infil.gsc" }, + { 0x6EE7F325AE4106A3, "scripts/mp/infilexfil/van_hackney_infil.gsc" }, + { 0x062B0889104A0D53, "scripts/mp/infilexfil/vindia_infil.gsc" }, + { 0x116CEABE045DE636, "scripts/mp/init_cp_mp.gsc" }, + { 0x61785096CD84035F, "scripts/mp/javelin.gsc" }, + { 0x1B31527B4E9781D2, "scripts/mp/juggernaut.gsc" }, + { 0x5732201DEF3A65C7, "scripts/mp/killcam.gsc" }, + { 0x32F367E853EFE0D6, "scripts/mp/killstreaks/agent_killstreak.gsc" }, + { 0x731DAAA368B23D4D, "scripts/mp/killstreaks/airdrop_mp.gsc" }, + { 0x1966DFCBD2D268D2, "scripts/mp/killstreaks/airdrop_multiple_mp.gsc" }, + { 0x5EB2D51A1D6C552C, "scripts/mp/killstreaks/airstrike_mp.gsc" }, + { 0x6FF86FEE6AED42AE, "scripts/mp/killstreaks/autosentry.gsc" }, + { 0x6D49F8837731F254, "scripts/mp/killstreaks/chill_common.gsc" }, + { 0x418B7A968E4F7C79, "scripts/mp/killstreaks/chopper_gunner_mp.gsc" }, + { 0x6B4907D1FFFDCE37, "scripts/mp/killstreaks/chopper_support_mp.gsc" }, + { 0x34FF41F4B3FA424F, "scripts/mp/killstreaks/cruise_predator_mp.gsc" }, + { 0x53BB6FF768A47B95, "scripts/mp/killstreaks/death_switch.gsc" }, + { 0x08AFBBC16473D488, "scripts/mp/killstreaks/deployablebox.gsc" }, + { 0x31463F34A13101FD, "scripts/mp/killstreaks/deployablebox_vest.gsc" }, + { 0x37BB89B7C584D340, "scripts/mp/killstreaks/dronehive.gsc" }, + { 0x10662A1ACF0EBE7E, "scripts/mp/killstreaks/emp.gsc" }, + { 0x2F7C1B498F830663, "scripts/mp/killstreaks/emp_drone_mp.gsc" }, + { 0x64C3321543BBEFD8, "scripts/mp/killstreaks/emp_drone_targeted_mp.gsc" }, + { 0x2FF254B9E27B9387, "scripts/mp/killstreaks/flares.gsc" }, + { 0x465B9DE35EFC49F2, "scripts/mp/killstreaks/gunship_mp.gsc" }, + { 0x300A0A4C67DA0BBB, "scripts/mp/killstreaks/helicopter.gsc" }, + { 0x44C9AA44134DB592, "scripts/mp/killstreaks/helicopter_pilot.gsc" }, + { 0x250950A7F930FE33, "scripts/mp/killstreaks/helper_drone.gsc" }, + { 0x7D681FCF8E7487F3, "scripts/mp/killstreaks/helper_drone_mp.gsc" }, + { 0x7D5D18083C3669C2, "scripts/mp/killstreaks/hover_jet.gsc" }, + { 0x54B4BE63F861801A, "scripts/mp/killstreaks/init_mp.gsc" }, + { 0x3406DC94C9535A80, "scripts/mp/killstreaks/jackal.gsc" }, + { 0x41D9F3E9C0FED124, "scripts/mp/killstreaks/juggernaut_mp.gsc" }, + { 0x380B66B9CD34D48B, "scripts/mp/killstreaks/killstreaks.gsc" }, + { 0x1272B945C902B191, "scripts/mp/killstreaks/manual_turret_mp.gsc" }, + { 0x0DABA2E9A8350242, "scripts/mp/killstreaks/mapselect.gsc" }, + { 0x0C4EEB121BA27B97, "scripts/mp/killstreaks/nuke.gsc" }, + { 0x6737E57A4723484F, "scripts/mp/killstreaks/nuke_mp.gsc" }, + { 0x1636BB4817605A4F, "scripts/mp/killstreaks/placeable.gsc" }, + { 0x693AF273776F420A, "scripts/mp/killstreaks/plane.gsc" }, + { 0x56F2DCFF53F2245F, "scripts/mp/killstreaks/proxyagent.gsc" }, + { 0x3DA7B46BA89E263E, "scripts/mp/killstreaks/remotemissile.gsc" }, + { 0x5174EF0A925C8314, "scripts/mp/killstreaks/remotetank.gsc" }, + { 0x3D9FB1EE60CBAD42, "scripts/mp/killstreaks/remoteturret.gsc" }, + { 0x21B311364005EBAA, "scripts/mp/killstreaks/remoteuav.gsc" }, + { 0x57AB0F132F2DA29E, "scripts/mp/killstreaks/sentry_gun_mp.gsc" }, + { 0x2458F30EAB0498D8, "scripts/mp/killstreaks/target_marker.gsc" }, + { 0x04A9FF33C9C66EC4, "scripts/mp/killstreaks/throwback_marker.gsc" }, + { 0x3D049B8395ABB6E4, "scripts/mp/killstreaks/toma_strike_mp.gsc" }, + { 0x19EC0FE0C3415CA2, "scripts/mp/killstreaks/uav_mp.gsc" }, + { 0x3DCF889324D28903, "scripts/mp/killstreaks/white_phosphorus_mp.gsc" }, + { 0x08C8E132AF264960, "scripts/mp/laststand.gsc" }, + { 0x7F22DB280E8CC6C9, "scripts/mp/launcher_target_lead.gsc" }, + { 0x3C56D7D289AAAF81, "scripts/mp/lightarmor.gsc" }, + { 0x21F4499C4ABFF7BF, "scripts/mp/lightbar.gsc" }, + { 0x7D419D1DFD062946, "scripts/mp/load.gsc" }, + { 0x5CEFBBF3A6A9A8B0, "scripts/mp/loot.gsc" }, + { 0x6FEFACA85CCC3691, "scripts/mp/matchdata.gsc" }, + { 0x59A28AA393C6BB32, "scripts/mp/matchrecording.gsc" }, + { 0x3AFE00DA9A5BB422, "scripts/mp/matchstats.gsc" }, + { 0x498B9015FC4A2548, "scripts/mp/menus.gsc" }, + { 0x16B87C6B95574BD0, "scripts/mp/minefields.gsc" }, + { 0x3317E070395BD534, "scripts/mp/missilelauncher.gsc" }, + { 0x3931ECB959834BBD, "scripts/mp/motiondetectors.gsc" }, + { 0x5A11116778A6D864, "scripts/mp/movers.gsc" }, + { 0x4DB5D44A376C1C35, "scripts/mp/mp_agent.gsc" }, + { 0x7AF5DD2BC2CC926D, "scripts/mp/mp_agent_damage.gsc" }, + { 0x37397E0B9CA7C1D8, "scripts/mp/music_and_dialog.gsc" }, + { 0x5C0063AB6B81303F, "scripts/mp/objidpoolmanager.gsc" }, + { 0x73B96343B87E992A, "scripts/mp/objpoints.gsc" }, + { 0x66D1063967FA26FA, "scripts/mp/outline.gsc" }, + { 0x125E1DE662C614BC, "scripts/mp/outofbounds.gsc" }, + { 0x6F3C39F8B9544B50, "scripts/mp/passives.gsc" }, + { 0x7B33D78CAC102B89, "scripts/mp/perks/headgear.gsc" }, + { 0x65682009E2287F13, "scripts/mp/perks/perk_equipmentping.gsc" }, + { 0x4B3976A0DF8B09A3, "scripts/mp/perks/perk_mark_targets.gsc" }, + { 0x594C46BDBBC57CA3, "scripts/mp/perks/perkfunctions.gsc" }, + { 0x4F61C97BBA28F546, "scripts/mp/perks/perkpackage.gsc" }, + { 0x52B5F3FAED29F517, "scripts/mp/perks/perks.gsc" }, + { 0x1FC5765DB46366C6, "scripts/mp/perks/weaponpassives.gsc" }, + { 0x7283136DAF802C53, "scripts/mp/persistence.gsc" }, + { 0x10E7A93D981318CA, "scripts/mp/pingcallout_mp.gsc" }, + { 0x1C8476F56CBCD27C, "scripts/mp/playeractions.gsc" }, + { 0x6F294F32B60C71F4, "scripts/mp/playercards.gsc" }, + { 0x344020C171EC72D5, "scripts/mp/playerlogic.gsc" }, + { 0x35E7732D85CF4FB4, "scripts/mp/playerstats.gsc" }, + { 0x28264B40CEFBE224, "scripts/mp/playerstats_interface.gsc" }, + { 0x71CDF59D18E9F382, "scripts/mp/potg.gsc" }, + { 0x22085D5A2D267F34, "scripts/mp/potg_events.gsc" }, + { 0x5CCC4374F6C041E3, "scripts/mp/radiation.gsc" }, + { 0x1BF41126054F4E1D, "scripts/mp/rally_point.gsc" }, + { 0x5B79F5CE7E653825, "scripts/mp/rangefinder.gsc" }, + { 0x5CD1439734C434DC, "scripts/mp/rank.gsc" }, + { 0x0C5ABF1CDB1BB1A5, "scripts/mp/riotshield.gsc" }, + { 0x16617DE231BF5280, "scripts/mp/scoreboard.gsc" }, + { 0x6ECD08699CCB09B5, "scripts/mp/screenshotcity.gsc" }, + { 0x525CD9B94F8850C1, "scripts/mp/scriptable.gsc" }, + { 0x36B0C9C343A37CC3, "scripts/mp/secrethunt.gsc" }, + { 0x7911684723811DF3, "scripts/mp/sentientpoolmanager.gsc" }, + { 0x12971CEBDD7FFF70, "scripts/mp/serversettings.gsc" }, + { 0x374464F426BC84E2, "scripts/mp/shellshock.gsc" }, + { 0x27C5D22C922F2128, "scripts/mp/spawncamera.gsc" }, + { 0x4590A825A33E1804, "scripts/mp/spawnfactor.gsc" }, + { 0x6024AD55E5032489, "scripts/mp/spawnlogic.gsc" }, + { 0x0C46589F289D961A, "scripts/mp/spawnscoring.gsc" }, + { 0x08F3CB4DBABAE3A5, "scripts/mp/spawnselection.gsc" }, + { 0x10107DC25F5BD62E, "scripts/mp/spectating.gsc" }, + { 0x2F2F0B2412213D7A, "scripts/mp/subway/fast_travel_subway_car.gsc" }, + { 0x037052EFEC602BD0, "scripts/mp/subway/fast_travel_subway_station.gsc" }, + { 0x4FCA32F463C5E4FA, "scripts/mp/supers.gsc" }, + { 0x57886B1B2348AA4E, "scripts/mp/supers/laststand_heal.gsc" }, + { 0x648662AC64713336, "scripts/mp/supers/spawnbeacon.gsc" }, + { 0x1E5E1BFD8FA7E030, "scripts/mp/supers/super_deadsilence.gsc" }, + { 0x09711BB6E8ABDC00, "scripts/mp/supers/super_stoppingpower.gsc" }, + { 0x0BB2B63F19A7FA8E, "scripts/mp/tac_ops/hostage_utility.gsc" }, + { 0x4EAAC25F24AF4921, "scripts/mp/tac_ops/hvt_utility.gsc" }, + { 0x3DADDE2C4C9D2D5C, "scripts/mp/tac_ops/radio_utility.gsc" }, + { 0x3321FCDA17B126B6, "scripts/mp/tac_ops/roles_utility.gsc" }, + { 0x78DE14F10227476E, "scripts/mp/tac_ops_map.gsc" }, + { 0x57D62CB7DDC6066A, "scripts/mp/teamrevive.gsc" }, + { 0x18A132AEEE23136E, "scripts/mp/teams.gsc" }, + { 0x5AE66D06F20630A9, "scripts/mp/trials/mp_cave_am_create_script.gsc" }, + { 0x28FDBC01EA4D3110, "scripts/mp/trials/mp_emporium_create_script_floorislava.gsc" }, + { 0x1CB7E984BFB2488C, "scripts/mp/trials/mp_euphrates_create_script.gsc" }, + { 0x146CF05CA89271EB, "scripts/mp/trials/mp_euphrates_create_script_gunnonlinear.gsc" }, + { 0x16D75E0530ECE1EE, "scripts/mp/trials/mp_harbor_floorislava_create_script.gsc" }, + { 0x6977064AFBA29D1A, "scripts/mp/trials/mp_m_cornfield_floor_is_lava_create_script.gsc" }, + { 0x5AF91DAD24C6122C, "scripts/mp/trials/mp_m_king_create_script.gsc" }, + { 0x4CF1D51227BEDB38, "scripts/mp/trials/mp_m_trench_create_script_gunnonlinear.gsc" }, + { 0x2A4BF9C81FFB99CD, "scripts/mp/trials/mp_oilrig_create_script.gsc" }, + { 0x0A19E4D5955D28E9, "scripts/mp/trials/mp_t_reflex_create_script_quadrace.gsc" }, + { 0x560D4B5E8DCB4FBB, "scripts/mp/trials/mp_trial_helicopter_port_create_a_script.gsc" }, + { 0x758374748F03BA22, "scripts/mp/trials/mp_trials_patches.gsc" }, + { 0x01A0AEA59EE8415F, "scripts/mp/trials/mp_trials_patches_petrograd.gsc" }, + { 0x32F57BF21B863A72, "scripts/mp/trials/mp_trl_boneyard_gw_race.gsc" }, + { 0x7CEF55681AF4328D, "scripts/mp/trials/mp_trl_cleararea.gsc" }, + { 0x7BD04BF9AB7DA819, "scripts/mp/trials/mp_trl_create_a_script_race_euphrates.gsc" }, + { 0x70150D6A872B30AB, "scripts/mp/trials/mp_trl_destroy.gsc" }, + { 0x701C8CAC53E33D3D, "scripts/mp/trials/mp_trl_floorislava.gsc" }, + { 0x48DCA902ACA6E531, "scripts/mp/trials/mp_trl_gunslinger.gsc" }, + { 0x4BAFEADA1AF601F4, "scripts/mp/trials/mp_trl_gunslinger_crash_create_script.gsc" }, + { 0x6AE1A60E4389B2B2, "scripts/mp/trials/mp_trl_gunslinger_knife_create_script.gsc" }, + { 0x1F5F365E79A4CB06, "scripts/mp/trials/mp_trl_gunslinger_memory_create_script.gsc" }, + { 0x2A458B918FBEE4BD, "scripts/mp/trials/mp_trl_quarry_raceislava_trial_create_a_script.gsc" }, + { 0x1B7097EC3A830F81, "scripts/mp/trials/trial_arm_course.gsc" }, + { 0x755511650CD06136, "scripts/mp/trials/trial_enemy_sentry_turret.gsc" }, + { 0x52EF15C2A99B4FA5, "scripts/mp/trials/trial_gun_course.gsc" }, + { 0x555A14CE795197B8, "scripts/mp/trials/trial_jugg.gsc" }, + { 0x7F0B6B5CE716473A, "scripts/mp/trials/trial_pitcher.gsc" }, + { 0x2BBBC965F1309702, "scripts/mp/trials/trial_race.gsc" }, + { 0x18B92FCB75257F1C, "scripts/mp/trials/trial_sniper.gsc" }, + { 0x69E30AD84737C849, "scripts/mp/trials/trial_target_utility.gsc" }, + { 0x1806953AC216FC93, "scripts/mp/trials/trial_utility.gsc" }, + { 0x6595ED698585F630, "scripts/mp/turret.gsc" }, + { 0x546166D9A45E52AB, "scripts/mp/tweakables.gsc" }, + { 0x726F9C562FDFEA72, "scripts/mp/utility/damage.gsc" }, + { 0x68765C58AD964CD8, "scripts/mp/utility/debug.gsc" }, + { 0x5102C8E257A6D97F, "scripts/mp/utility/dialog.gsc" }, + { 0x65C8E60DC93B7808, "scripts/mp/utility/disconnect_event_aggregator.gsc" }, + { 0x53682FA3E19AB419, "scripts/mp/utility/dvars.gsc" }, + { 0x6CC9E656B7F35004, "scripts/mp/utility/entity.gsc" }, + { 0x2CE6AE9812D8AF5F, "scripts/mp/utility/equipment.gsc" }, + { 0x22A6A30CD2CAED85, "scripts/mp/utility/game.gsc" }, + { 0x5CCABDBD8A103980, "scripts/mp/utility/game_utility_mp.gsc" }, + { 0x346A8591FB832D05, "scripts/mp/utility/infilexfil.gsc" }, + { 0x5278688E19C483F3, "scripts/mp/utility/inventory.gsc" }, + { 0x5F5A6BED6ACC0B64, "scripts/mp/utility/join_squad_aggregator.gsc" }, + { 0x65D0191B88E1EAB3, "scripts/mp/utility/join_team_aggregator.gsc" }, + { 0x34BFC6AB4B788F91, "scripts/mp/utility/killstreak.gsc" }, + { 0x6D5439C109277E9A, "scripts/mp/utility/lower_message.gsc" }, + { 0x59D70D752E63BE95, "scripts/mp/utility/lui_game_event_aggregator.gsc" }, + { 0x382545849986FBC1, "scripts/mp/utility/outline.gsc" }, + { 0x749DAD28EFF4EEDB, "scripts/mp/utility/perk.gsc" }, + { 0x06849A875AF56E3E, "scripts/mp/utility/player.gsc" }, + { 0x2968631C69B98F88, "scripts/mp/utility/player_frame_update_aggregator.gsc" }, + { 0x655F3CC5D8227E98, "scripts/mp/utility/points.gsc" }, + { 0x443F13D5D348E548, "scripts/mp/utility/print.gsc" }, + { 0x0158CC290FA3E45C, "scripts/mp/utility/script.gsc" }, + { 0x5B1C34DC6525743C, "scripts/mp/utility/sound.gsc" }, + { 0x5A7FFCF1A1689317, "scripts/mp/utility/spawn_event_aggregator.gsc" }, + { 0x76CDBC7F46DC44F4, "scripts/mp/utility/stats.gsc" }, + { 0x0C388E97BB998325, "scripts/mp/utility/teams.gsc" }, + { 0x49F522925767314F, "scripts/mp/utility/trigger.gsc" }, + { 0x317DCAEF347397FD, "scripts/mp/utility/usability.gsc" }, + { 0x23EF6C1E2FC0A20F, "scripts/mp/utility/weapon.gsc" }, + { 0x57753F84D1563669, "scripts/mp/validation.gsc" }, + { 0x2AD5131D424A1D6F, "scripts/mp/vehicles/apc_rus_mp.gsc" }, + { 0x700290C5E608CF6D, "scripts/mp/vehicles/atv_mp.gsc" }, + { 0x5DD46724A68EA9E0, "scripts/mp/vehicles/big_bird_mp.gsc" }, + { 0x226CFA6284FF8DEF, "scripts/mp/vehicles/cargo_truck_mg_mp.gsc" }, + { 0x735ED6DE3271380E, "scripts/mp/vehicles/cargo_truck_mp.gsc" }, + { 0x40BB647A723C2CBB, "scripts/mp/vehicles/cop_car_mp.gsc" }, + { 0x67554F1A4F439EB7, "scripts/mp/vehicles/damage.gsc" }, + { 0x77520AD4056E9E6B, "scripts/mp/vehicles/hoopty_mp.gsc" }, + { 0x00F06430868A2143, "scripts/mp/vehicles/hoopty_truck_mp.gsc" }, + { 0x340B7EAF5002BD58, "scripts/mp/vehicles/jeep_mp.gsc" }, + { 0x5746D1CDFF1769B5, "scripts/mp/vehicles/large_transport_mp.gsc" }, + { 0x515CCBB057ACEED3, "scripts/mp/vehicles/light_tank_mp.gsc" }, + { 0x35C97E2C73946069, "scripts/mp/vehicles/little_bird_mg_mp.gsc" }, + { 0x4DCC21A5E61A448C, "scripts/mp/vehicles/little_bird_mp.gsc" }, + { 0x175B69D8F2B89D12, "scripts/mp/vehicles/med_transport_mp.gsc" }, + { 0x683AE4F9A5D01CA8, "scripts/mp/vehicles/pickup_truck_mp.gsc" }, + { 0x3C247B48F5F99B73, "scripts/mp/vehicles/tac_rover_mp.gsc" }, + { 0x1CE08BF2C58FB9BB, "scripts/mp/vehicles/technical_mp.gsc" }, + { 0x185E0BB2EA68BF11, "scripts/mp/vehicles/van_mp.gsc" }, + { 0x631F011549331C7B, "scripts/mp/vehicles/vehicle_compass_mp.gsc" }, + { 0x47DDC686CD783C08, "scripts/mp/vehicles/vehicle_damage_mp.gsc" }, + { 0x4D5CC7E7083AE661, "scripts/mp/vehicles/vehicle_interact_mp.gsc" }, + { 0x45161D316AB714FB, "scripts/mp/vehicles/vehicle_mines_mp.gsc" }, + { 0x19A564D17590E1BA, "scripts/mp/vehicles/vehicle_mp.gsc" }, + { 0x1222322394E3DDE0, "scripts/mp/vehicles/vehicle_occupancy_mp.gsc" }, + { 0x5D65FF68246F4EBB, "scripts/mp/vehicles/vehicle_oob_mp.gsc" }, + { 0x36B297F0D12A223A, "scripts/mp/vehicles/vehicle_spawn_mp.gsc" }, + { 0x0A1ACDAA4ABD9DAC, "scripts/mp/weaponrank.gsc" }, + { 0x64D6DB6054238125, "scripts/mp/weapons.gsc" }, + { 0x7CCBD586E3BAFF77, "scripts/mp/whizby.gsc" }, + { 0x5E0F9B34A9395449, "scripts/smartobjects/stealth_exposed_fire_up.gsc" }, + { 0x150FC9212F421DE4, "scripts/smartobjects/stealth_knock_off_30.gsc" }, + { 0x24674926856260DA, "scripts/smartobjects/stealth_knock_off_36.gsc" }, + { 0x4D3CEACA4AAD6CDD, "scripts/smartobjects/stealth_lean_table_30.gsc" }, + { 0x22D637BE981416F7, "scripts/smartobjects/stealth_lean_table_36.gsc" }, + { 0x71F7FA98864D18D8, "scripts/smartobjects/stealth_lean_table_l_30.gsc" }, + { 0x68442FBBEE7347B6, "scripts/smartobjects/stealth_lean_table_l_36.gsc" }, + { 0x51B544802610585A, "scripts/smartobjects/stealth_lean_table_r_30.gsc" }, + { 0x425DC47ACFF01564, "scripts/smartobjects/stealth_lean_table_r_36.gsc" }, + { 0x4E41300518E961AC, "scripts/smartobjects/stealth_lean_wall_l.gsc" }, + { 0x5D0EE174FC0B8A2A, "scripts/smartobjects/stealth_lean_wall_r.gsc" }, + { 0x659CA7FD38DEAF8F, "scripts/smartobjects/stealth_look_around.gsc" }, + { 0x5878CA794EDCBED6, "scripts/smartobjects/stealth_look_down.gsc" }, + { 0x4ED712F46A19B58E, "scripts/smartobjects/stealth_look_high.gsc" }, + { 0x53104E0B5F742530, "scripts/smartobjects/stealth_look_over.gsc" }, + { 0x1B332AFF743D3690, "scripts/smartobjects/stealth_look_under_10.gsc" }, + { 0x5DA43BCDA90B41E2, "scripts/smartobjects/stealth_look_under_30.gsc" }, + { 0x4F20BE7ABA0F15CF, "scripts/smartobjects/stealth_look_up.gsc" }, + { 0x6ADFF4313BF0028A, "scripts/smartobjects/stealth_rage_bash.gsc" }, + { 0x7020B6FE2D960C61, "scripts/smartobjects/stealth_rage_bash_l.gsc" }, + { 0x25A42FC67218C38B, "scripts/smartobjects/stealth_rage_bash_r.gsc" }, + { 0x715A1A96449870AA, "scripts/smartobjects/stealth_rage_kick.gsc" }, + { 0x25D9F453DA2E67C1, "scripts/smartobjects/stealth_rage_kick_l.gsc" }, + { 0x58B37147398F676B, "scripts/smartobjects/stealth_rage_kick_r.gsc" }, + { 0x27E688562D2DD6EE, "scripts/smartobjects/stealth_rage_punch.gsc" }, + { 0x321A4C86508CC1C2, "scripts/smartobjects/utility.gsc" }, + { 0x378FC85E571E7186, "scripts/sp/analytics.gsc" }, + { 0x58937D0256A1E2AD, "scripts/sp/anim.gsc" }, + { 0x302B310CF5F281F9, "scripts/sp/anim_notetrack.gsc" }, + { 0x4E6F0300DC3EF45F, "scripts/sp/art.gsc" }, + { 0x4207755BFDB48B74, "scripts/sp/audio.gsc" }, + { 0x1DA1788C3403A19E, "scripts/sp/autosave.gsc" }, + { 0x4A81C087EFED4B9C, "scripts/sp/colors.gsc" }, + { 0x3039452DFDE7FBBA, "scripts/sp/compass.gsc" }, + { 0x5893ADB02CDAE4F6, "scripts/sp/createfx.gsc" }, + { 0x5CB72CC7E5761F50, "scripts/sp/credits.gsc" }, + { 0x53013CFCD4DE3AB2, "scripts/sp/damagefeedback.gsc" }, + { 0x40B3883467EEF7A5, "scripts/sp/debug.gsc" }, + { 0x7F2603B0C235A0CF, "scripts/sp/debug_menu.gsc" }, + { 0x7F3BDDB3EA2462AB, "scripts/sp/debug_spawnai.gsc" }, + { 0x3E507F6E5BDBCD0E, "scripts/sp/destructibles/barrel_common.gsc" }, + { 0x26A4001904D98E21, "scripts/sp/destructibles/destructible_vehicle.gsc" }, + { 0x188209D7A6D9661D, "scripts/sp/destructibles/oil_barrel.gsc" }, + { 0x46E2E6E6321E4530, "scripts/sp/destructibles/red_barrel.gsc" }, + { 0x317FD45510A25464, "scripts/sp/destructibles/water_barrel.gsc" }, + { 0x17F2C690F3A59C64, "scripts/sp/door.gsc" }, + { 0x63DE70BAA2A6268D, "scripts/sp/door_ai.gsc" }, + { 0x5329AD582F86465A, "scripts/sp/door_internal.gsc" }, + { 0x5B32CC4BCFF6BF34, "scripts/sp/door_scriptable.gsc" }, + { 0x4B4058A03BDDE3FC, "scripts/sp/drone.gsc" }, + { 0x6DCA794AEA1C9BF5, "scripts/sp/drone_ai.gsc" }, + { 0x084AF360809289A2, "scripts/sp/drone_base.gsc" }, + { 0x279E1925F3241F5E, "scripts/sp/drone_civilian.gsc" }, + { 0x7372F05154F7CF79, "scripts/sp/endmission.gsc" }, + { 0x1E4C74716BDBF1AA, "scripts/sp/equipment/c4.gsc" }, + { 0x60C7BC918A3C2D17, "scripts/sp/equipment/flash.gsc" }, + { 0x581014825671F061, "scripts/sp/equipment/frag.gsc" }, + { 0x046CA9E7416BA3B6, "scripts/sp/equipment/green_beam.gsc" }, + { 0x6549CFD94ABD4097, "scripts/sp/equipment/ied.gsc" }, + { 0x7B7988D739347D8F, "scripts/sp/equipment/incendiarylauncher.gsc" }, + { 0x1E74C44DA9B867E7, "scripts/sp/equipment/molotov.gsc" }, + { 0x760766D73663E89B, "scripts/sp/equipment/noisemaker.gsc" }, + { 0x629495DD20A7676C, "scripts/sp/equipment/offhands.gsc" }, + { 0x3506CF049DCDF381, "scripts/sp/equipment/pipebomb.gsc" }, + { 0x7920811A39B75195, "scripts/sp/equipment/semtex.gsc" }, + { 0x036FD89CA842AEF9, "scripts/sp/equipment/signal.gsc" }, + { 0x783B35AF6737F35C, "scripts/sp/equipment/smoke.gsc" }, + { 0x5170F99B18418184, "scripts/sp/equipment/teargas.gsc" }, + { 0x5B1A0AE8FBC8C294, "scripts/sp/equipment/throwingknife.gsc" }, + { 0x3D29B911D6B3719B, "scripts/sp/equipment/tripwire.gsc" }, + { 0x293F278F9CF34658, "scripts/sp/fakeactor.gsc" }, + { 0x4A91B05009A9DBC7, "scripts/sp/fakeactor_node.gsc" }, + { 0x159A6C716E66F4B9, "scripts/sp/flags.gsc" }, + { 0x0497F620360B162D, "scripts/sp/footsteps.gsc" }, + { 0x68D2819FB2878D27, "scripts/sp/friendlyfire.gsc" }, + { 0x2A5B848A0353F970, "scripts/sp/gamer_profile.gsc" }, + { 0x7F5F30902DFFCF79, "scripts/sp/gameskill.gsc" }, + { 0x05B1415C1B5D0F61, "scripts/sp/geo_mover.gsc" }, + { 0x1ED0C34577F0DA0E, "scripts/sp/gibbing.gsc" }, + { 0x2D4CE59734F5DAE6, "scripts/sp/glass.gsc" }, + { 0x13C0801E30856000, "scripts/sp/global_fx.gsc" }, + { 0x09487322CAC9297E, "scripts/sp/global_fx_code.gsc" }, + { 0x07C250FED32DCA82, "scripts/sp/helicopter_ai.gsc" }, + { 0x3643E7DC7F2606AA, "scripts/sp/helicopter_globals.gsc" }, + { 0x7F3FFC10F2BFB1FB, "scripts/sp/hud.gsc" }, + { 0x73A1E31545226A6A, "scripts/sp/hud_util.gsc" }, + { 0x737B1C2C8C9472DD, "scripts/sp/idles.gsc" }, + { 0x0D7ECC9DA600EC47, "scripts/sp/intelligence.gsc" }, + { 0x08E4D21CA0DE77C2, "scripts/sp/interactables/dynolight.gsc" }, + { 0x773AB997A5729886, "scripts/sp/interaction.gsc" }, + { 0x1A108372A314490E, "scripts/sp/interaction_manager.gsc" }, + { 0x72DCB1863F7ED720, "scripts/sp/introscreen.gsc" }, + { 0x31BE5B920616DCB1, "scripts/sp/lights.gsc" }, + { 0x0524E8E6BEEE6F64, "scripts/sp/load.gsc" }, + { 0x2B649E446E1D813A, "scripts/sp/load_code.gsc" }, + { 0x501C1DB481E23452, "scripts/sp/loot.gsc" }, + { 0x5F7F27440541EF2A, "scripts/sp/mg_penetration.gsc" }, + { 0x72BB98237AE73D8A, "scripts/sp/mgturret.gsc" }, + { 0x09A98F653FFF265A, "scripts/sp/names.gsc" }, + { 0x172D002C28F413E6, "scripts/sp/nvg/nvg_ai.gsc" }, + { 0x587C769EC1C5F759, "scripts/sp/nvg/nvg_player.gsc" }, + { 0x0DD7835B9CBE1CA8, "scripts/sp/outline.gsc" }, + { 0x4A778814F1B1E996, "scripts/sp/patrol.gsc" }, + { 0x700CDF1663CF9DA7, "scripts/sp/pausemenu.gsc" }, + { 0x01DD8C2481AC6E8A, "scripts/sp/pip_util.gsc" }, + { 0x6A4190022C745CFD, "scripts/sp/player.gsc" }, + { 0x3A83E235D70BD495, "scripts/sp/player/ally_equipment.gsc" }, + { 0x167428C4C368615C, "scripts/sp/player/ballistics.gsc" }, + { 0x4F44B6686CAC35FC, "scripts/sp/player/bullet_feedback.gsc" }, + { 0x5354D3AB606FAD12, "scripts/sp/player/context_melee.gsc" }, + { 0x52AD10B20F9C9A8C, "scripts/sp/player/cursor_hint.gsc" }, + { 0x1A06A2EE09C533BA, "scripts/sp/player/flare.gsc" }, + { 0x446F9DA3A686E968, "scripts/sp/player/gestures.gsc" }, + { 0x3739A09FCC88DEAC, "scripts/sp/player/offhand_box.gsc" }, + { 0x379C2358A1B97624, "scripts/sp/player/playerchatter.gsc" }, + { 0x7DD293F8DDCDE64D, "scripts/sp/player/teenagefarah.gsc" }, + { 0x10587A0683D82922, "scripts/sp/player/youngfarrah.gsc" }, + { 0x4540A3F6BEB7E5D0, "scripts/sp/player_death.gsc" }, + { 0x19E020D7B19C133C, "scripts/sp/player_rig.gsc" }, + { 0x19AA72688C1A1921, "scripts/sp/player_stats.gsc" }, + { 0x22627F7B6B1A1FEC, "scripts/sp/script_items.gsc" }, + { 0x0918A19212085653, "scripts/sp/scriptable.gsc" }, + { 0x4C2ADCF8B7083295, "scripts/sp/scripted_weapon_assignment.gsc" }, + { 0x5C82DC488283308D, "scripts/sp/scriptedsniper.gsc" }, + { 0x0A945DBD6C5969C6, "scripts/sp/slowmo_init.gsc" }, + { 0x031396CE3A2ABBBA, "scripts/sp/spawner.gsc" }, + { 0x430A633BAE3FC6A9, "scripts/sp/stairtrain.gsc" }, + { 0x456556E2BFEC9461, "scripts/sp/starts.gsc" }, + { 0x74398FB8AB8E9EDA, "scripts/sp/statemachine.gsc" }, + { 0x21E827F136E28A04, "scripts/sp/stayahead.gsc" }, + { 0x4B47D1A240B4C54D, "scripts/sp/stealth/idle_sitting.gsc" }, + { 0x04FD7AE7467577B5, "scripts/sp/stealth/manager.gsc" }, + { 0x4ECE1947BC018ED1, "scripts/sp/stealth/player.gsc" }, + { 0x42FBC16A2A3CDB0D, "scripts/sp/stealth/tagging.gsc" }, + { 0x03E816B921D0B226, "scripts/sp/stealth/utility.gsc" }, + { 0x59525EDBC77F3C84, "scripts/sp/stinger.gsc" }, + { 0x5E58E8E8D674E067, "scripts/sp/traffic_system.gsc" }, + { 0x1974079C607A332C, "scripts/sp/treadfx.gsc" }, + { 0x73438D963E182E4E, "scripts/sp/trigger.gsc" }, + { 0x24DB68BD2DAEE08A, "scripts/sp/utility.gsc" }, + { 0x4748BF91627A1C3A, "scripts/sp/vehicle.gsc" }, + { 0x635B93BA2B90F882, "scripts/sp/vehicle_aianim.gsc" }, + { 0x1F4F2DB8287A420D, "scripts/sp/vehicle_build.gsc" }, + { 0x351975F16D321880, "scripts/sp/vehicle_code.gsc" }, + { 0x6D8AAD7D0495CD99, "scripts/sp/vehicle_heavy_destruction.gsc" }, + { 0x52DA195F1171EFEB, "scripts/sp/vehicle_interact.gsc" }, + { 0x2D0432F65B1FD9B0, "scripts/sp/vehicle_lights.gsc" }, + { 0x653022EEAAC72479, "scripts/sp/vehicle_paths.gsc" }, + { 0x07EE8BAD86C952E4, "scripts/sp/vehicle_treads.gsc" }, + { 0x4B1E5F62D78F9304, "scripts/sp/vision.gsc" }, + { 0x0645528CB1B1EF14, "scripts/stealth/callbacks.gsc" }, + { 0x21FB20A3C1CA8CCF, "scripts/stealth/clear_regions.gsc" }, + { 0x146A17616F44667A, "scripts/stealth/corpse.gsc" }, + { 0x191339F5C1A6195B, "scripts/stealth/debug.gsc" }, + { 0x1CA4F62D92DD5210, "scripts/stealth/enemy.gsc" }, + { 0x20B2DF6CB9AFF8F0, "scripts/stealth/event.gsc" }, + { 0x3175B03723124101, "scripts/stealth/friendly.gsc" }, + { 0x331896EDB4223103, "scripts/stealth/group.gsc" }, + { 0x0CEA8F165A816A0C, "scripts/stealth/init.gsc" }, + { 0x70530A265A9F5903, "scripts/stealth/manager.gsc" }, + { 0x2D4E31A32FB4EADB, "scripts/stealth/neutral.gsc" }, + { 0x211D04EFBA6BDD8B, "scripts/stealth/player.gsc" }, + { 0x163386F8246EA03C, "scripts/stealth/threat_sight.gsc" }, + { 0x7EB69E8C5218D5D0, "scripts/stealth/utility.gsc" }, + { 0x09D0561FF8DED2FB, "scripts/unittest/call.gsc" }, + { 0x33374ABA53CCEFA3, "scripts/unittest/cond.gsc" }, + { 0x60C3BF3F97AAD8A1, "scripts/unittest/error.gsc" }, + { 0x7D417D07A4E5621D, "scripts/unittest/loop.gsc" }, + { 0x7A3248CECDABBB87, "scripts/unittest/ops.gsc" }, + { 0x4484932699BA0155, "scripts/unittest/patch.gsc" }, + { 0x46E026730332CC63, "scripts/unittest/patch_far.gsc" }, + { 0x3FB3888869A3BBAC, "scripts/unittest/patch_new.gsc" }, + { 0x1C177F8B59EA24BF, "scripts/unittest/switch.gsc" }, + { 0x2ACE7209907A93EA, "scripts/unittest/threads.gsc" }, + { 0x508F2C4AFE4464DD, "scripts/unittest/unittest.gsc" }, + { 0x78A054D0158094FB, "scripts/unittest/util.gsc" }, + { 0x6E8449CF88F1EADA, "scripts/unittest/variables.gsc" }, + { 0x2001A12EABCEA3F5, "scripts/vehicle/apache.gsc" }, + { 0x39C5ABE7337EC7C2, "scripts/vehicle/asierra.gsc" }, + { 0x6043CCF093C23E56, "scripts/vehicle/attack_heli.gsc" }, + { 0x199A1F4363AFB888, "scripts/vehicle/blima.gsc" }, + { 0x481D6433B953BE14, "scripts/vehicle/blima_ground.gsc" }, + { 0x42ADD57A1535B9C3, "scripts/vehicle/bromeo.gsc" }, + { 0x1AA8D9019B401C0E, "scripts/vehicle/decho.gsc" }, + { 0x1FA661E0EC7A2E34, "scripts/vehicle/drone_improvised.gsc" }, + { 0x203A417B3F26B482, "scripts/vehicle/empty.gsc" }, + { 0x15A70AD2B561D11D, "scripts/vehicle/empty_heli.gsc" }, + { 0x304FB8A7A53594F4, "scripts/vehicle/empty_nocollision.gsc" }, + { 0x4ECFC469719C5667, "scripts/vehicle/empty_turret.gsc" }, + { 0x639687EEE6B8EDBF, "scripts/vehicle/lbravo.gsc" }, + { 0x5B6F151AAEED75B4, "scripts/vehicle/london_cab.gsc" }, + { 0x4E826AB3BA315311, "scripts/vehicle/mindia8.gsc" }, + { 0x711704083FA820D7, "scripts/vehicle/mindia8_jugg.gsc" }, + { 0x497045F94EA799B2, "scripts/vehicle/mkilo23.gsc" }, + { 0x623A55B1697311EA, "scripts/vehicle/mkilo23_ai_infil.gsc" }, + { 0x707BAFC0054976B7, "scripts/vehicle/palfa.gsc" }, + { 0x05F006A1931E24DC, "scripts/vehicle/pindia.gsc" }, + { 0x0E4A4BCD834BD23D, "scripts/vehicle/ralfa.gsc" }, + { 0x08BC8E8C7995D6CF, "scripts/vehicle/secho.gsc" }, + { 0x7D931927C317D34B, "scripts/vehicle/skilo.gsc" }, + { 0x242DE32B27BC25C1, "scripts/vehicle/stango.gsc" }, + { 0x583BF3991C6D6325, "scripts/vehicle/suniform25.gsc" }, + { 0x5E6D5DE83F5DAE1E, "scripts/vehicle/techo.gsc" }, + { 0x39329602384C75ED, "scripts/vehicle/tromeo.gsc" }, + { 0x073D801F600ADD92, "scripts/vehicle/umike.gsc" }, + { 0x1E0A39FECFB8CD77, "scripts/vehicle/vehicle_common.gsc" }, + { 0x6A9EA1E319F74B9C, "scripts/vehicle/victor40.gsc" }, + { 0x7B40C4E7C4800A3A, "scripts/vehicle/vindia.gsc" }, + { 0x4D6149376990F3A2, "scripts/vehicle/walfa.gsc" }, + { 0x09D2D9B2FB9B5D8D, "scripts/vehicle/zuniform.gsc" }, + { 0x1968DF0F374CD0BC, "xmodelalias/alias_hero_stpetersburg_nikilai_body.gsc" }, + { 0x63CFE7F1AAFAD8CA, "xmodelalias/bodies_al_qatala_desert_01.gsc" }, + { 0x09DDA7E56E370B77, "xmodelalias/bodies_al_qatala_desert_02.gsc" }, + { 0x74F32EEFEA1A3620, "xmodelalias/bodies_al_qatala_desert_03.gsc" }, + { 0x7D24E7ED8D69F254, "xmodelalias/bodies_al_qatala_desert_07.gsc" }, + { 0x20557FB431C0D152, "xmodelalias/bodies_al_qatala_desert_09.gsc" }, + { 0x4792B9C474781B03, "xmodelalias/bodies_al_qatala_urban_a6_variant.gsc" }, + { 0x7C2D12F859DD5799, "xmodelalias/bodies_al_qatala_urban_ar.gsc" }, + { 0x2A6CEE3395C1645F, "xmodelalias/bodies_al_qatala_urban_ar_variant.gsc" }, + { 0x500291E60F31CCD5, "xmodelalias/bodies_al_qatala_urban_bomber.gsc" }, + { 0x351EAF226C7BE860, "xmodelalias/bodies_al_qatala_urban_cqb_variant.gsc" }, + { 0x6B7FA02503D72E1A, "xmodelalias/bodies_al_qatala_urban_lmg_variant.gsc" }, + { 0x750BAC0C2857D581, "xmodelalias/bodies_civ_al_qatala_urban_female.gsc" }, + { 0x3638CC05A9A86A8C, "xmodelalias/bodies_civ_russian_police_officer.gsc" }, + { 0x46F20AF39225ADD9, "xmodelalias/bodies_civ_western_cold_boy.gsc" }, + { 0x27C72E88CD6F7171, "xmodelalias/bodies_civ_western_cold_girl.gsc" }, + { 0x7AA00C4824C2C01E, "xmodelalias/bodies_sas_urban_ar.gsc" }, + { 0x0EBC709082B1546C, "xmodelalias/bodies_sas_urban_cqc.gsc" }, + { 0x32C415EC9D5EDD7E, "xmodelalias/bodies_sas_urban_dmr.gsc" }, + { 0x7E19D609E22641A4, "xmodelalias/bodies_sas_woodland_ar.gsc" }, + { 0x6CF15480414136F6, "xmodelalias/bodies_spetsnaz_ar.gsc" }, + { 0x2D88ACD05A29DB4E, "xmodelalias/civ_russian_male_body_1.gsc" }, + { 0x7406BAE08EB204D0, "xmodelalias/civ_russian_male_head_1.gsc" }, + { 0x15EF279651DCFDCF, "xmodelalias/civilian_london_female_body_02_skintone_dark.gsc" }, + { 0x60394823A2363E1F, "xmodelalias/civilian_london_female_body_02_skintone_light.gsc" }, + { 0x3C8C0E8AD64EEBB5, "xmodelalias/civilian_london_female_body_02_skintone_med.gsc" }, + { 0x18C1E36AE92D394F, "xmodelalias/civilian_london_female_body_skintone_01.gsc" }, + { 0x223DAC67D524C31B, "xmodelalias/civilian_london_female_body_skintone_01_anim_safe.gsc" }, + { 0x2FBE796151B2A1B4, "xmodelalias/civilian_london_female_body_skintone_med.gsc" }, + { 0x0F679FD605A69D24, "xmodelalias/civilian_london_female_body_skintone_med_anim_safe.gsc" }, + { 0x115281D4522A1404, "xmodelalias/civilian_london_female_head_skintone_light.gsc" }, + { 0x31C04A026E139B02, "xmodelalias/civilian_london_female_head_skintone_med.gsc" }, + { 0x1673C08D3BE4AE9F, "xmodelalias/civilian_london_female_heads_skintone_dark.gsc" }, + { 0x1E066541EEB7D69D, "xmodelalias/civilian_london_female_heads_skintone_dark_nohair.gsc" }, + { 0x5B8E6FDFE0E1B94F, "xmodelalias/civilian_london_female_heads_skintone_light.gsc" }, + { 0x01ABEE48E066BEAD, "xmodelalias/civilian_london_female_heads_skintone_light_nohair.gsc" }, + { 0x5F3139A12D66CEC5, "xmodelalias/civilian_london_female_heads_skintone_med.gsc" }, + { 0x3FAE036CBDCF1B37, "xmodelalias/civilian_london_female_heads_skintone_med_nohair.gsc" }, + { 0x52C13E4168F72DB3, "xmodelalias/civilian_london_male_body_skintone_light.gsc" }, + { 0x016E06A0BBAAA959, "xmodelalias/civilian_london_male_body_skintone_med.gsc" }, + { 0x34726B0BFF780D69, "xmodelalias/civilian_me_female_bodies.gsc" }, + { 0x04B40D1EA1126B1C, "xmodelalias/civilian_me_female_embassy_bodies.gsc" }, + { 0x2B41AE39A79A7022, "xmodelalias/civilian_me_female_heads.gsc" }, + { 0x67F0EF4494C59910, "xmodelalias/civilian_me_female_veil_bodies.gsc" }, + { 0x123898B3EB05C744, "xmodelalias/civilian_me_female_wrap_bodies.gsc" }, + { 0x21A9A4608C8EC98D, "xmodelalias/civilian_me_female_wrap_heads.gsc" }, + { 0x2B46F5F29E39E461, "xmodelalias/civilian_me_male_veil_bodies.gsc" }, + { 0x5E41D667569898DA, "xmodelalias/civilian_me_male_veil_heads.gsc" }, + { 0x3FCB0B609850C8AA, "xmodelalias/civilian_russian_female_body.gsc" }, + { 0x269E9459BF0FB3C8, "xmodelalias/civilian_russian_female_head.gsc" }, + { 0x431A591A41AF76DB, "xmodelalias/civilian_syrkistan_female_head.gsc" }, + { 0x0CB6FAE1D89AB8AC, "xmodelalias/civilian_syrkistan_female_head_no_hair.gsc" }, + { 0x756CBE2A2DEFE576, "xmodelalias/civilian_syrkistan_male_body.gsc" }, + { 0x3A97C88651C9ADB9, "xmodelalias/civilian_syrkistan_male_body_dist.gsc" }, + { 0x655BAFD7450B7EBD, "xmodelalias/civilian_syrkistan_male_body_embassy.gsc" }, + { 0x5C1F2FF15EF59F24, "xmodelalias/civilian_syrkistan_male_head.gsc" }, + { 0x291A99C3C1D2520E, "xmodelalias/civilian_uk_male_heads_skintone_light.gsc" }, + { 0x53BE65E259C850F8, "xmodelalias/civilian_uk_male_heads_skintone_med.gsc" }, + { 0x1A770865F3E0213E, "xmodelalias/hats_civ_russian_police_officer.gsc" }, + { 0x29FC815BDE49F867, "xmodelalias/heads_al_qatala_desert.gsc" }, + { 0x2420665E75332A77, "xmodelalias/heads_al_qatala_desert_03.gsc" }, + { 0x3A983E2D38BCF052, "xmodelalias/heads_al_qatala_desert_08.gsc" }, + { 0x0AB8D3A2D44320F1, "xmodelalias/heads_al_qatala_desert_bomber.gsc" }, + { 0x0EA4FAD5C0FB4A2C, "xmodelalias/heads_al_qatala_tmtyl.gsc" }, + { 0x1B561F178FEF18E3, "xmodelalias/heads_al_qatala_urban_04.gsc" }, + { 0x7B333728D55146FC, "xmodelalias/heads_al_qatala_urban_05.gsc" }, + { 0x5F8AA70D4F49E165, "xmodelalias/heads_al_qatala_urban_06.gsc" }, + { 0x30B2046800230E0E, "xmodelalias/heads_al_qatala_urban_ar_variant.gsc" }, + { 0x42ED7DFB5FA7E710, "xmodelalias/heads_civ_al_qatala_urban_female.gsc" }, + { 0x7F3538979A978A6D, "xmodelalias/heads_civ_russian_police_officer.gsc" }, + { 0x5CD359CBCE951B70, "xmodelalias/heads_civ_western_cold_boy.gsc" }, + { 0x76B841822EB4767E, "xmodelalias/heads_civ_western_cold_girl.gsc" }, + { 0x6AA2552F6B9D4DBE, "xmodelalias/heads_london_police.gsc" }, + { 0x348FD0E2DD0D7729, "xmodelalias/heads_sas_urban.gsc" }, + { 0x248084AD2A220B0F, "xmodelalias/heads_sas_urban_nvg.gsc" }, + { 0x0997082582A6C9BF, "xmodelalias/heads_sas_woodland_nvg.gsc" }, + { 0x2635EC9C3FB164AF, "xmodelalias/heads_usmc_male.gsc" }, + { 0x7BEA7A236E989767, "xmodelalias/russian_army_ar_1_hats_gasmask.gsc" }, + { 0x2E3CDC890B1F4BA8, "xmodelalias/russian_army_ar_2_hats_gasmask.gsc" }, + { 0x47FB9EDA20E0AF12, "xmodelalias/russian_army_ar_4_hats_gasmask.gsc" }, + { 0x453DF43B64B4A9F3, "xmodelalias/russian_army_ar_5_hats_gasmask.gsc" }, + { 0x5951E4088AA9334B, "xmodelalias/russian_army_bodies_1.gsc" }, + { 0x4A830263D4CAED70, "xmodelalias/russian_army_bodies_1_light.gsc" }, + { 0x24FAF734CBA3EACE, "xmodelalias/russian_army_bodies_2.gsc" }, + { 0x0424D7DEDA010305, "xmodelalias/russian_army_bodies_2_light.gsc" }, + { 0x50AE8A53F7025665, "xmodelalias/russian_army_hats.gsc" }, + { 0x4B829CC774F72F19, "xmodelalias/russian_army_hats_safehouse.gsc" }, + { 0x08DD7BF5DE21FB78, "xmodelalias/russian_army_heads.gsc" }, + { 0x1F37ACCFC04F4186, "xmodelalias/russian_army_heads_gasmask.gsc" }, + { 0x5F5F33C65239A5E8, "xmodelalias/russian_army_heads_safehouse.gsc" }, + { 0x63487AB57AA2A5CB, "xmodelalias/test_alias_civ_london_male_1_body.gsc" }, + { 0x60B785787652FD92, "xmodelalias/test_enemy_picc_heads.gsc" }, + }}; + +} // namespace xsk::gsc::iw9 diff --git a/src/iw9/stdafx.cpp b/src/iw9/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/iw9/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/iw9/stdafx.hpp b/src/iw9/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/iw9/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/iw9/xsk/context.cpp b/src/iw9/xsk/context.cpp deleted file mode 100644 index 4240c773..00000000 --- a/src/iw9/xsk/context.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// 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 "iw9.hpp" - -namespace xsk::gsc::iw9 -{ - -void context::init(build, read_cb_type callback) -{ - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::iw9 diff --git a/src/iw9/xsk/context.hpp b/src/iw9/xsk/context.hpp deleted file mode 100644 index 337c25fb..00000000 --- a/src/iw9/xsk/context.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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::gsc::iw9 -{ - -class context : public gsc::context -{ - iw9::disassembler disassembler_; - iw9::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { throw std::runtime_error("not impl"); } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { throw std::runtime_error("not impl"); } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::iw9 diff --git a/src/iw9/xsk/decompiler.cpp b/src/iw9/xsk/decompiler.cpp deleted file mode 100644 index b900b200..00000000 --- a/src/iw9/xsk/decompiler.cpp +++ /dev/null @@ -1,3159 +0,0 @@ -// 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 "iw9.hpp" - -namespace xsk::gsc::iw9 -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// IW9 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - 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); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_waitframe: - { - auto stmt = ast::stmt(std::make_unique(loc)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_waittill: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto args = std::make_unique(loc); - auto node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - /*case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - }*/ - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_FormalParams: - { - auto count = std::stoi(inst->data[0]); - - for (auto i = 1; i <= count; i++) - { - func_->params->list.push_back(std::make_unique(loc, inst->data[i])); - } - break; - } - case opcode::OP_IsDefined: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto node = std::make_unique(expr.loc(), std::move(expr)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_IsTrue: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto node = std::make_unique(expr.loc(), std::move(expr)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNotAfterAnd: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto node = std::make_unique(expr.loc(), std::move(expr)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - case opcode::OP_unk_134: // eval something - case opcode::OP_unk_133: // eval something - case opcode::OP_unk_135: // eval something - case opcode::OP_unk_136: // OP_GetDvar - case opcode::OP_unk_137: // eval something - case opcode::OP_unk_138: // eval something - { - auto node = std::make_unique(loc, utils::string::va("data_%s", inst->data[0].data())); - stack_.push(std::move(node)); - break; - } - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // continue is at jumpback, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - auto use_index = false; - - if (stmt->list[begin-1] == ast::kind::stmt_assign && stmt->list[begin-1].as_assign->expr.as_assign_equal->rvalue == ast::kind::expr_undefined) - { - use_index = true; - } - - auto loc = use_index ? stmt->list.at(begin - 3).loc() : stmt->list.at(begin - 2).loc(); - - auto init = ast::stmt(std::make_unique()); - - if (use_index) - { - init.as_list->list.push_back(std::move(stmt->list[begin-3])); - } - - 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 -= use_index ? 3 : 2; // move begin from 'test' to 'array' - stmt->list.erase(stmt->list.begin() + begin); // remove 'array' - stmt->list.erase(stmt->list.begin() + begin); // remove 'key' - - if (use_index) - { - stmt->list.erase(stmt->list.begin() + begin); // remove 'index' - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - stmt->list.erase(stmt->list.begin() + begin); // remove 'setelem' - - if (use_index) - { - stmt->list.erase(stmt->list.begin() + begin); // remove 'setindex' - } - - end -= use_index ? 7 : 5; // move end to 'iter' ( minus 'array', 'key', 'index?', 'test' & 'setelem', 'setindex?' ) - stmt->list.erase(stmt->list.begin() + end); // remove 'iter' - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - } - - 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)), use_index)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(blk->local_vars_create_count), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - blk->local_vars.push_back({ index, static_cast(blk->local_vars_create_count), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - blk->local_vars.push_back({ index, static_cast(blk->local_vars_create_count), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - - if (stmt->use_key) - { - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[2].as_assign->expr.as_assign->lvalue); - } - else - { - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); - } -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_isdefined: - process_expr(expr.as_isdefined->expr, blk); - break; - case ast::kind::expr_istrue: - process_expr(expr.as_istrue->expr, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = expr.as_asm_create->index; - blk->local_vars.push_back({ var, static_cast(blk->local_vars_create_count), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ entry, static_cast(blk->local_vars_create_count), true }); - blk->local_vars_create_count++; - } - - auto var = expr.as_asm_create->index; - blk->local_vars.push_back({ var, static_cast(blk->local_vars_create_count), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::iw9 diff --git a/src/iw9/xsk/decompiler.hpp b/src/iw9/xsk/decompiler.hpp deleted file mode 100644 index 09886c7e..00000000 --- a/src/iw9/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::iw9 -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::iw9 diff --git a/src/iw9/xsk/disassembler.cpp b/src/iw9/xsk/disassembler.cpp deleted file mode 100644 index c6c73e4f..00000000 --- a/src/iw9/xsk/disassembler.cpp +++ /dev/null @@ -1,621 +0,0 @@ -// 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 "iw9.hpp" - -namespace xsk::gsc::iw9 -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// IW9 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read(); - func->name = resolver::hash_name(stack_->read()); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = static_cast(func->size); - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - - if (inst->index + inst->size != script_->pos()) - { - throw error("wrong inst size"); - } - - if (size < 0) - { - throw error("wrong func size"); - } - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_CastFieldObject: - case opcode::OP_plus: - case opcode::OP_GetGameRef: - case opcode::OP_GetThisthread: - case opcode::OP_greater: - case opcode::OP_shift_right: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_equality: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_notify: - case opcode::OP_PreScriptCall: - case opcode::OP_GetUndefined: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_size: - case opcode::OP_AddArray: - case opcode::OP_endon: - case opcode::OP_shift_left: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_Return: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetSelfObject: - case opcode::OP_GetGame: - case opcode::OP_EvalArray: - case opcode::OP_GetSelf: - case opcode::OP_End: - case opcode::OP_less_equal: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_checkclearparams: - case opcode::OP_waittillmatch2: - case opcode::OP_minus: - case opcode::OP_greater_equal: - case opcode::OP_vector: - case opcode::OP_ClearArray: - case opcode::OP_DecTop: - case opcode::OP_CastBool: - case opcode::OP_EvalArrayRef: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_waittill: - case opcode::OP_GetAnimObject: - case opcode::OP_mod: - case opcode::OP_clearparams: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_EmptyArray: - case opcode::OP_BoolComplement: - case opcode::OP_less: - case opcode::OP_BoolNot: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitframe: - case opcode::OP_GetLevelObject: - case opcode::OP_inc: - case opcode::OP_GetAnim: - case opcode::OP_SetVariableField: - case opcode::OP_divide: - case opcode::OP_multiply: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_bit_and: - case opcode::OP_voidCodepos: - case opcode::OP_inequality: - case opcode::OP_bit_ex_or: - case opcode::OP_BoolNotAfterAnd: - case opcode::OP_IsDefined: - case opcode::OP_IsTrue: - 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->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetVector: - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(4); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimation: - script_->seek(8); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_EvalAnimFieldVariableRef: - inst->data.push_back(resolver::hash_name(script_->read())); - break; - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_SetNewLocalVariableFieldCached0: - inst->data.push_back(resolver::hash_name(script_->read())); - break; - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_EvalLocalArrayRefCached: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_CallBuiltinPointer: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; -/* case opcode::OP_prof_begin: - script_->seek(5); // TODO: skipped data - break; - case opcode::OP_prof_end: - script_->seek(1); // TODO: skipped data - break; - case opcode::OP_EvalNewLocalArrayRefCached0_Precompiled: - case opcode::OP_SetNewLocalVariableFieldCached0_Precompiled: - case opcode::OP_CreateLocalVariable_Precompiled: - case opcode::OP_SafeCreateVariableFieldCached_Precompiled: - inst->data.push_back(resolver::hash_name(script_->read())); - break;*/ - case opcode::OP_NativeGetFarFunction: - case opcode::OP_NativeFarFunctionCall: - case opcode::OP_NativeFarMethodCall: - disassemble_native_call(inst, false); - break; - case opcode::OP_NativeFarFunctionThreadCall: - case opcode::OP_NativeFarMethodThreadCall: - case opcode::OP_NativeFarFunctionChildThreadCall: - case opcode::OP_NativeFarMethodChildThreadCall: - disassemble_native_call(inst, true); - break; - case opcode::OP_FormalParams: - case opcode::OP_FormalParams_Precompiled: - disassemble_formal_params(inst); - break; - case opcode::OP_unk_134: // eval xhash - case opcode::OP_unk_137: // eval something - inst->data.push_back(utils::string::va("%08X", script_->read())); - break; - case opcode::OP_unk_133: // eval xhash - case opcode::OP_unk_135: // eval xhash - case opcode::OP_unk_136: // eval xhash OP_GetDvar? - case opcode::OP_unk_138: // eval something - inst->data.push_back(utils::string::va("%016llX", script_->read())); - break; - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - if (method) // TODO - { - auto str = stack_->read_c_string(); - - if (str.starts_with("#xS")) - { - str = resolver::hash_name(std::stoull(str.substr(3), 0 ,16)); - - if (str.starts_with("id_")) - { - str = "builtin_" + str; - } - } - - script_->seek(2); - inst->data.emplace(inst->data.begin(), str); - } - else - { - auto str = stack_->read_c_string(); - - if (str.starts_with("#xS")) - { - str = resolver::hash_name(std::stoull(str.substr(3), 0 ,16)); - } - - script_->seek(2); - inst->data.emplace(inst->data.begin(), str); - } -} - -void disassembler::disassemble_native_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(4); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - inst->data.emplace(inst->data.begin(), utils::string::va("%08X", stack_->read())); -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - auto offs = script_->read(); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - auto file = stack_->read(); - auto name = stack_->read(); - - if (file == 0) - { - inst->data.emplace(inst->data.begin(), utils::string::va("%X", inst->index + 1 + offs)); - inst->data.emplace(inst->data.begin(), ""); - } - else - { - auto path = resolver::path_name(file); - - if (!path.starts_with("id_")) - { - path.resize(path.size() - 4); - } - - inst->data.emplace(inst->data.begin(), resolver::hash_name(name)); - inst->data.emplace(inst->data.begin(), path); - } -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read(); - 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) -{ - const auto count = script_->read(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read(); - const auto offs = script_->read(); - script_->seek(1); - const auto byte = script_->read(); - - if (byte == 2) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - } - else if (byte == 1) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", value)); - } - else // byte == 0 - { - //default = value 0 and byte 0 and i = 1 - inst->data.push_back("default"); - } - - const auto addr = index + 4 + offs; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 8; - inst->size += 8; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - inst->data.push_back(resolver::hash_name(script_->read())); -} - -void disassembler::disassemble_formal_params(const instruction::ptr& inst) -{ - const auto count = script_->read(); - - inst->size += count * 8; - inst->data.push_back(utils::string::va("%i", count)); - - for (auto i = 0u; i < count; i++) - { - inst->data.push_back(resolver::hash_name(script_->read())); - } -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read(); - } - else if (back) - { - addr = inst->index + 3 - script_->read(); - } - else - { - addr = inst->index + 5 + script_->read(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - if (inst->data[0].empty()) - inst->data[1] = resolve_function(inst->data[1]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s %i\n", func->name.data(), func->size)); - - 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())); - } - - 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("%i\t%i\t%s", inst->index, inst->size, resolver::opcode_name(inst->opcode).data())); - - /*switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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; - } - if (casenum != totalcase - 1) - { - output_->write_string("\n"); - } - } - } - break; - default:*/ - for (auto& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - // break; - //} - - output_->write_string("\n"); -} - -} // namespace xsk::gsc::iw9 diff --git a/src/iw9/xsk/disassembler.hpp b/src/iw9/xsk/disassembler.hpp deleted file mode 100644 index e7eff349..00000000 --- a/src/iw9/xsk/disassembler.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc::iw9 -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_native_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_formal_params(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::iw9 diff --git a/src/iw9/xsk/iw9.cpp b/src/iw9/xsk/iw9.cpp deleted file mode 100644 index afbb0c77..00000000 --- a/src/iw9/xsk/iw9.cpp +++ /dev/null @@ -1,196 +0,0 @@ -// 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 "iw9.hpp" - -namespace xsk::gsc::iw9 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_CastFieldObject: - case opcode::OP_plus: - case opcode::OP_GetGameRef: - case opcode::OP_GetThisthread: - case opcode::OP_greater: - case opcode::OP_shift_right: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_equality: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_notify: - case opcode::OP_PreScriptCall: - case opcode::OP_GetUndefined: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_size: - case opcode::OP_AddArray: - case opcode::OP_endon: - case opcode::OP_shift_left: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_Return: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetSelfObject: - case opcode::OP_GetGame: - case opcode::OP_EvalArray: - case opcode::OP_GetSelf: - case opcode::OP_End: - case opcode::OP_less_equal: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_checkclearparams: - case opcode::OP_waittillmatch2: - case opcode::OP_minus: - case opcode::OP_greater_equal: - case opcode::OP_vector: - case opcode::OP_ClearArray: - case opcode::OP_DecTop: - case opcode::OP_CastBool: - case opcode::OP_EvalArrayRef: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_waittill: - case opcode::OP_GetAnimObject: - case opcode::OP_mod: - case opcode::OP_clearparams: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_EmptyArray: - case opcode::OP_BoolComplement: - case opcode::OP_less: - case opcode::OP_BoolNot: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitframe: - case opcode::OP_GetLevelObject: - case opcode::OP_inc: - case opcode::OP_GetAnim: - case opcode::OP_SetVariableField: - case opcode::OP_divide: - case opcode::OP_multiply: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_bit_and: - case opcode::OP_voidCodepos: - case opcode::OP_inequality: - case opcode::OP_bit_ex_or: - case opcode::OP_BoolNotAfterAnd: - case opcode::OP_IsDefined: - case opcode::OP_IsTrue: - return 1; - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_waittillmatch: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_GetByte: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_GetNegByte: - case opcode::OP_GetAnimTree: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_prof_end: - case opcode::OP_FormalParams: - case opcode::OP_FormalParams_Precompiled: - return 2; - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_jumpback: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_endswitch: - case opcode::OP_GetUnsignedShort: - case opcode::OP_JumpOnFalse: - return 3; - case opcode::OP_CallBuiltin: - case opcode::OP_CallBuiltinMethod: - return 4; - case opcode::OP_GetInteger: - case opcode::OP_GetIString: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_GetFloat: - case opcode::OP_GetString: - case opcode::OP_switch: - case opcode::OP_GetFarFunction: - case opcode::OP_jump: - case opcode::OP_ScriptFarMethodCall: - case opcode::OP_unk_134: - case opcode::OP_unk_137: - case opcode::OP_NativeGetFarFunction: - case opcode::OP_NativeFarFunctionCall: - case opcode::OP_NativeFarMethodCall: - return 5; - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_prof_begin: - case opcode::OP_NativeFarFunctionThreadCall: - case opcode::OP_NativeFarMethodThreadCall: - case opcode::OP_NativeFarFunctionChildThreadCall: - case opcode::OP_NativeFarMethodChildThreadCall: - return 6; - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_CreateLocalVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_GetAnimation: - case opcode::OP_unk_133: - case opcode::OP_unk_135: - case opcode::OP_unk_136: - case opcode::OP_unk_138: - case opcode::OP_EvalNewLocalArrayRefCached0_Precompiled: - case opcode::OP_SetNewLocalVariableFieldCached0_Precompiled: - case opcode::OP_CreateLocalVariable_Precompiled: - case opcode::OP_SafeCreateVariableFieldCached_Precompiled: - case opcode::OP_unk_166: - return 9; - case opcode::OP_GetVector: - return 13; - case opcode::OP_ClearVariableField: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_unk_139: - case opcode::OP_unk_140: - case opcode::OP_unk_141: - case opcode::OP_unk_142: - case opcode::OP_unk_143: - case opcode::OP_unk_144: - case opcode::OP_breakpoint: - case opcode::OP_assignmentBreakpoint: - case opcode::OP_manualAndAssignmentBreakpoint: - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::iw9 diff --git a/src/iw9/xsk/iw9.hpp b/src/iw9/xsk/iw9.hpp deleted file mode 100644 index ad6ff8b0..00000000 --- a/src/iw9/xsk/iw9.hpp +++ /dev/null @@ -1,194 +0,0 @@ -// 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 "disassembler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::iw9 -{ - -constexpr std::uint32_t max_string_id = 0; - -enum class opcode : std::uint8_t -{ - OP_CastFieldObject = 0x00, - OP_SetLocalVariableFieldCached = 0x01, - OP_plus = 0x02, - OP_RemoveLocalVariables = 0x03, - OP_EvalSelfFieldVariableRef = 0x04, - OP_ScriptFarMethodChildThreadCall = 0x05, - OP_GetGameRef = 0x06, - OP_EvalAnimFieldVariable = 0x07, - OP_EvalLevelFieldVariableRef = 0x08, - OP_GetThisthread = 0x09, - OP_greater = 0x0A, - OP_waittillmatch = 0x0B, - OP_shift_right = 0x0C, - OP_dec = 0x0D, - OP_JumpOnTrue = 0x0E, - OP_bit_or = 0x0F, - OP_equality = 0x10, - OP_ClearLocalVariableFieldCached0 = 0x11, - OP_notify = 0x12, - OP_GetVector = 0x13, - OP_ScriptMethodChildThreadCallPointer = 0x14, - OP_PreScriptCall = 0x15, - OP_GetByte = 0x16, - OP_ScriptFarThreadCall = 0x17, - OP_SetSelfFieldVariableField = 0x18, - OP_JumpOnFalseExpr = 0x19, - OP_GetUndefined = 0x1A, - OP_jumpback = 0x1B, - OP_JumpOnTrueExpr = 0x1C, - OP_CallBuiltin = 0x1D, - OP_SetLocalVariableFieldCached0 = 0x1E, - OP_ClearFieldVariable = 0x1F, - OP_GetLevel = 0x20, - OP_size = 0x21, - OP_SafeSetWaittillVariableFieldCached = 0x22, - OP_AddArray = 0x23, - OP_endon = 0x24, - OP_EvalFieldVariable = 0x25, - OP_shift_left = 0x26, - OP_EvalLocalArrayRefCached0 = 0x27, - OP_Return = 0x28, - OP_CreateLocalVariable = 0x29, - OP_SafeSetVariableFieldCached0 = 0x2A, - OP_GetBuiltinFunction = 0x2B, - OP_CallBuiltinMethodPointer = 0x2C, - OP_GetSelfObject = 0x2D, - OP_GetGame = 0x2E, - OP_SetLevelFieldVariableField = 0x2F, - OP_EvalArray = 0x30, - OP_GetSelf = 0x31, - OP_End = 0x32, - OP_EvalSelfFieldVariable = 0x33, - OP_less_equal = 0x34, - OP_EvalLocalVariableCached0 = 0x35, - OP_EvalLocalVariableCached1 = 0x36, - OP_EvalLocalVariableCached2 = 0x37, - OP_EvalLocalVariableCached3 = 0x38, - OP_EvalLocalVariableCached4 = 0x39, - OP_EvalLocalVariableCached5 = 0x3A, - OP_EvalLocalVariableCached = 0x3B, - OP_EvalNewLocalArrayRefCached0 = 0x3C, - OP_ScriptChildThreadCallPointer = 0x3D, - OP_EvalLocalVariableObjectCached = 0x3E, - OP_GetInteger = 0x3F, - OP_ScriptMethodCallPointer = 0x40, - OP_checkclearparams = 0x41, - OP_SetAnimFieldVariableField = 0x42, - OP_waittillmatch2 = 0x43, - OP_minus = 0x44, - OP_GetNegUnsignedShort = 0x45, - OP_GetNegByte = 0x46, - OP_SafeCreateVariableFieldCached = 0x47, - OP_greater_equal = 0x48, - OP_vector = 0x49, - OP_GetBuiltinMethod = 0x4A, - OP_endswitch = 0x4B, - OP_ClearArray = 0x4C, - OP_DecTop = 0x4D, - OP_CastBool = 0x4E, - OP_EvalArrayRef = 0x4F, - OP_SetNewLocalVariableFieldCached0 = 0x50, - OP_GetZero = 0x51, - OP_wait = 0x52, - OP_waittill = 0x53, - OP_GetIString = 0x54, - OP_ScriptFarFunctionCall = 0x55, - OP_GetAnimObject = 0x56, - OP_GetAnimTree = 0x57, - OP_EvalLocalArrayCached = 0x58, - OP_mod = 0x59, - OP_ScriptFarMethodThreadCall = 0x5A, - OP_GetUnsignedShort = 0x5B, - OP_clearparams = 0x5C, - OP_ScriptMethodThreadCallPointer = 0x5D, - OP_ScriptFunctionCallPointer = 0x5E, - OP_EmptyArray = 0x5F, - OP_SafeSetVariableFieldCached = 0x60, - OP_ClearVariableField = 0x61, - OP_EvalFieldVariableRef = 0x62, - OP_EvalNewLocalVariableRefCached0 = 0x63, - OP_GetFloat = 0x64, - OP_EvalLocalVariableRefCached = 0x65, - OP_JumpOnFalse = 0x66, - OP_BoolComplement = 0x67, - OP_ScriptThreadCallPointer = 0x68, - OP_less = 0x69, - OP_BoolNot = 0x6A, - OP_waittillFrameEnd = 0x6B, - OP_waitframe = 0x6C, - OP_GetString = 0x6D, - OP_EvalLevelFieldVariable = 0x6E, - OP_GetLevelObject = 0x6F, - OP_inc = 0x70, - OP_CallBuiltinMethod = 0x71, - OP_GetAnim = 0x72, - OP_switch = 0x73, - OP_SetVariableField = 0x74, - OP_divide = 0x75, - OP_ScriptFarChildThreadCall = 0x76, - OP_multiply = 0x77, - OP_ClearLocalVariableFieldCached = 0x78, - OP_EvalAnimFieldVariableRef = 0x79, - OP_EvalLocalArrayRefCached = 0x7A, - OP_EvalLocalVariableRefCached0 = 0x7B, - OP_bit_and = 0x7C, - OP_GetAnimation = 0x7D, - OP_GetFarFunction = 0x7E, - OP_CallBuiltinPointer = 0x7F, - OP_jump = 0x80, - OP_voidCodepos = 0x81, - OP_ScriptFarMethodCall = 0x82, - OP_inequality = 0x83, - OP_bit_ex_or = 0x84, - OP_unk_133 = 0x85, // size 9 - OP_unk_134 = 0x86, // size 5 - OP_unk_135 = 0x87, // size 9 - OP_unk_136 = 0x88, // size 9 - OP_unk_137 = 0x89, // size 5 - OP_unk_138 = 0x8A, // size 9 - OP_unk_139 = 0x8B, - OP_unk_140 = 0x8C, - OP_unk_141 = 0x8D, - OP_unk_142 = 0x8E, - OP_unk_143 = 0x8F, - OP_unk_144 = 0x90, - OP_prof_begin = 0x91, - OP_prof_end = 0x92, - OP_breakpoint = 0x93, - OP_assignmentBreakpoint = 0x94, - OP_manualAndAssignmentBreakpoint = 0x95, - OP_BoolNotAfterAnd = 0x96, - OP_FormalParams = 0x97, - OP_IsDefined = 0x98, - OP_IsTrue = 0x99, - OP_NativeGetFarFunction = 0x9A, - OP_NativeFarFunctionCall = 0x9B, - OP_NativeFarMethodCall = 0x9C, - OP_NativeFarFunctionThreadCall = 0x9D, - OP_NativeFarMethodThreadCall = 0x9E, - OP_NativeFarFunctionChildThreadCall = 0x9F, - OP_NativeFarMethodChildThreadCall = 0xA0, - OP_EvalNewLocalArrayRefCached0_Precompiled = 0xA1, - OP_SetNewLocalVariableFieldCached0_Precompiled = 0xA2, - OP_CreateLocalVariable_Precompiled = 0xA3, - OP_SafeCreateVariableFieldCached_Precompiled = 0xA4, - OP_FormalParams_Precompiled = 0xA5, - OP_unk_166 = 0xA6, // size 9, stack 8 - OP_count = 0xA7, -}; - -auto opcode_size(std::uint8_t op) -> std::uint32_t; - -} // namespace xsk::gsc::iw9 diff --git a/src/iw9/xsk/resolver.hpp b/src/iw9/xsk/resolver.hpp deleted file mode 100644 index eb8cb9b2..00000000 --- a/src/iw9/xsk/resolver.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// 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::gsc::iw9 -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint32_t; - static auto token_name(std::uint32_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; - - static auto path_id(const std::string& name) -> std::uint64_t; - static auto path_name(std::uint64_t id) -> std::string; - - static auto hash_id(const std::string& name) -> std::uint64_t; - static auto hash_name(std::uint64_t id) -> std::string; -}; - -} // namespace xsk::gsc::iw9 diff --git a/src/s1/s1_pc.cpp b/src/s1/s1_pc.cpp new file mode 100644 index 00000000..66efc8c2 --- /dev/null +++ b/src/s1/s1_pc.cpp @@ -0,0 +1,52 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_pc.hpp" + +namespace xsk::gsc::s1_pc +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::str4 | props::waitframe, engine::s1, endian::little, system::pc, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::s1_pc diff --git a/src/s1/s1_pc.hpp b/src/s1/s1_pc.hpp new file mode 100644 index 00000000..15f82a56 --- /dev/null +++ b/src/s1/s1_pc.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::s1_pc +{ + +constexpr usize code_count = 154; +constexpr usize func_count = 735; +constexpr usize meth_count = 1389; +constexpr usize token_count = 4585; +constexpr u32 max_string_id = 0xA7DC; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::s1_pc diff --git a/src/s1/s1_pc_code.cpp b/src/s1/s1_pc_code.cpp new file mode 100644 index 00000000..820ce62a --- /dev/null +++ b/src/s1/s1_pc_code.cpp @@ -0,0 +1,169 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_pc.hpp" + +namespace xsk::gsc::s1_pc +{ + +extern std::array, code_count> const code_list +{{ + { 0x17, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x18, opcode::OP_EvalSelfFieldVariable }, + { 0x19, opcode::OP_Return }, + { 0x1A, opcode::OP_CallBuiltin0 }, + { 0x1B, opcode::OP_CallBuiltin1 }, + { 0x1C, opcode::OP_CallBuiltin2 }, + { 0x1D, opcode::OP_CallBuiltin3 }, + { 0x1E, opcode::OP_CallBuiltin4 }, + { 0x1F, opcode::OP_CallBuiltin5 }, + { 0x20, opcode::OP_CallBuiltin }, + { 0x21, opcode::OP_BoolNot }, + { 0x22, opcode::OP_ScriptFarMethodThreadCall }, + { 0x23, opcode::OP_JumpOnTrueExpr }, + { 0x24, opcode::OP_SetLevelFieldVariableField }, + { 0x25, opcode::OP_CastBool }, + { 0x26, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x27, opcode::OP_CallBuiltinPointer }, + { 0x28, opcode::OP_inequality }, + { 0x29, opcode::OP_GetThisthread }, + { 0x2A, opcode::OP_ClearFieldVariable }, + { 0x2B, opcode::OP_GetFloat }, + { 0x2C, opcode::OP_SafeCreateVariableFieldCached }, + { 0x2D, opcode::OP_ScriptFarFunctionCall2 }, + { 0x2E, opcode::OP_ScriptFarFunctionCall }, + { 0x2F, opcode::OP_ScriptFarChildThreadCall }, + { 0x30, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x31, opcode::OP_ClearLocalVariableFieldCached }, + { 0x32, opcode::OP_checkclearparams }, + { 0x33, opcode::OP_CastFieldObject }, + { 0x34, opcode::OP_End }, + { 0x35, opcode::OP_size }, + { 0x36, opcode::OP_EmptyArray }, + { 0x37, opcode::OP_bit_and }, + { 0x38, opcode::OP_less_equal }, + { 0x39, opcode::OP_voidCodepos }, + { 0x3A, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3B, opcode::OP_endswitch }, + { 0x3C, opcode::OP_ClearVariableField }, + { 0x3D, opcode::OP_divide }, + { 0x3E, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x3F, opcode::OP_GetUnsignedShort }, + { 0x40, opcode::OP_JumpOnTrue }, + { 0x41, opcode::OP_GetSelf }, + { 0x42, opcode::OP_ScriptFarThreadCall }, + { 0x43, opcode::OP_ScriptLocalThreadCall }, + { 0x44, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x45, opcode::OP_SetLocalVariableFieldCached }, + { 0x46, opcode::OP_plus }, + { 0x47, opcode::OP_BoolComplement }, + { 0x48, opcode::OP_ScriptMethodCallPointer }, + { 0x49, opcode::OP_inc }, + { 0x4A, opcode::OP_RemoveLocalVariables }, + { 0x4B, opcode::OP_JumpOnFalseExpr }, + { 0x4C, opcode::OP_switch }, + { 0x4D, opcode::OP_clearparams }, + { 0x4E, opcode::OP_EvalLocalVariableRefCached0 }, + { 0x4F, opcode::OP_EvalLocalVariableRefCached }, + { 0x50, opcode::OP_ScriptLocalMethodCall }, + { 0x51, opcode::OP_EvalFieldVariable }, + { 0x52, opcode::OP_EvalFieldVariableRef }, + { 0x53, opcode::OP_GetString }, + { 0x54, opcode::OP_ScriptFunctionCallPointer }, + { 0x55, opcode::OP_EvalLevelFieldVariable }, + { 0x56, opcode::OP_GetVector }, + { 0x57, opcode::OP_endon }, + { 0x58, opcode::OP_greater_equal }, + { 0x59, opcode::OP_GetSelfObject }, + { 0x5A, opcode::OP_SetAnimFieldVariableField }, + { 0x5B, opcode::OP_SetVariableField }, + { 0x5C, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x5D, opcode::OP_ScriptLocalFunctionCall }, + { 0x5E, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x5F, opcode::OP_EvalLocalArrayRefCached }, + { 0x60, opcode::OP_GetFarFunction }, + { 0x61, opcode::OP_less }, + { 0x62, opcode::OP_GetGameRef }, + { 0x63, opcode::OP_waittillFrameEnd }, + { 0x64, opcode::OP_waitframe }, + { 0x65, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x66, opcode::OP_SafeSetVariableFieldCached }, + { 0x67, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x68, opcode::OP_GetLevel }, + { 0x69, opcode::OP_notify }, + { 0x6A, opcode::OP_DecTop }, + { 0x6B, opcode::OP_shift_left }, + { 0x6C, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x6D, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x6E, opcode::OP_greater }, + { 0x6F, opcode::OP_EvalLocalVariableCached0 }, + { 0x70, opcode::OP_EvalLocalVariableCached1 }, + { 0x71, opcode::OP_EvalLocalVariableCached2 }, + { 0x72, opcode::OP_EvalLocalVariableCached3 }, + { 0x73, opcode::OP_EvalLocalVariableCached4 }, + { 0x74, opcode::OP_EvalLocalVariableCached5 }, + { 0x75, opcode::OP_EvalLocalVariableCached }, + { 0x76, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x77, opcode::OP_jump }, + { 0x78, opcode::OP_ScriptThreadCallPointer }, + { 0x79, opcode::OP_GetZero }, + { 0x7A, opcode::OP_wait }, + { 0x7B, opcode::OP_minus }, + { 0x7C, opcode::OP_SetSelfFieldVariableField }, + { 0x7D, opcode::OP_EvalNewLocalVariableRefCached0 }, + { 0x7E, opcode::OP_multiply }, + { 0x7F, opcode::OP_CreateLocalVariable }, + { 0x80, opcode::OP_ScriptLocalChildThreadCall }, + { 0x81, opcode::OP_GetInteger }, + { 0x82, opcode::OP_mod }, + { 0x83, opcode::OP_EvalAnimFieldVariableRef }, + { 0x84, opcode::OP_GetBuiltinFunction }, + { 0x85, opcode::OP_GetGame }, + { 0x86, opcode::OP_waittill }, + { 0x87, opcode::OP_dec }, + { 0x88, opcode::OP_EvalLocalVariableObjectCached }, + { 0x89, opcode::OP_PreScriptCall }, + { 0x8A, opcode::OP_GetAnim }, + { 0x8B, opcode::OP_GetUndefined }, + { 0x8C, opcode::OP_EvalLevelFieldVariableRef }, + { 0x8D, opcode::OP_GetAnimObject }, + { 0x8E, opcode::OP_GetLevelObject }, + { 0x8F, opcode::OP_bit_ex_or }, + { 0x90, opcode::OP_equality }, + { 0x91, opcode::OP_ClearArray }, + { 0x92, opcode::OP_jumpback }, + { 0x93, opcode::OP_GetAnimation }, + { 0x94, opcode::OP_EvalAnimFieldVariable }, + { 0x95, opcode::OP_GetAnimTree }, + { 0x96, opcode::OP_GetIString }, + { 0x97, opcode::OP_EvalArrayRef }, + { 0x98, opcode::OP_EvalSelfFieldVariableRef }, + { 0x99, opcode::OP_GetNegByte }, + { 0x9A, opcode::OP_GetBuiltinMethod }, + { 0x9B, opcode::OP_CallBuiltinMethodPointer }, + { 0x9C, opcode::OP_EvalArray }, + { 0x9D, opcode::OP_vector }, + { 0x9E, opcode::OP_ScriptFarMethodCall }, + { 0x9F, opcode::OP_EvalLocalArrayCached }, + { 0xA0, opcode::OP_GetByte }, + { 0xA1, opcode::OP_ScriptChildThreadCallPointer }, + { 0xA2, opcode::OP_bit_or }, + { 0xA3, opcode::OP_AddArray }, + { 0xA4, opcode::OP_waittillmatch2 }, + { 0xA5, opcode::OP_waittillmatch }, + { 0xA6, opcode::OP_GetLocalFunction }, + { 0xA7, opcode::OP_GetNegUnsignedShort }, + { 0xA8, opcode::OP_shift_right }, + { 0xA9, opcode::OP_CallBuiltinMethod0 }, + { 0xAA, opcode::OP_CallBuiltinMethod1 }, + { 0xAB, opcode::OP_CallBuiltinMethod2 }, + { 0xAC, opcode::OP_CallBuiltinMethod3 }, + { 0xAD, opcode::OP_CallBuiltinMethod4 }, + { 0xAE, opcode::OP_CallBuiltinMethod5 }, + { 0xAF, opcode::OP_CallBuiltinMethod }, + { 0xB0, opcode::OP_JumpOnFalse }, +}}; + +} // namespace xsk::gsc::s1_pc diff --git a/src/s1/s1_pc_func.cpp b/src/s1/s1_pc_func.cpp new file mode 100644 index 00000000..2ff0e261 --- /dev/null +++ b/src/s1/s1_pc_func.cpp @@ -0,0 +1,750 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_pc.hpp" + +namespace xsk::gsc::s1_pc +{ + +extern std::array, func_count> const func_list +{{ + { 0x001, "precacheturret" }, + { 0x002, "getweaponarray" }, + { 0x003, "createprintchannel" }, + { 0x004, "updategamerprofileall" }, + { 0x005, "clearlocalizedstrings" }, + { 0x006, "setphysicsgravitydir" }, + { 0x007, "gettimescale" }, + { 0x008, "settimescale" }, + { 0x009, "setslowmotionview" }, + { 0x00A, "teleportscene" }, + { 0x00B, "forcesharedammo" }, + { 0x00C, "refreshhudcompass" }, + { 0x00D, "refreshhudammocounter" }, + { 0x00E, "notifyoncommand" }, + { 0x00F, "setprintchannel" }, + { 0x010, "print" }, + { 0x011, "println" }, + { 0x012, "print3d" }, + { 0x013, "line" }, + { 0x014, "box" }, + { 0x015, "orientedbox" }, + { 0x016, "sphere" }, + { 0x017, "cylinder" }, + { 0x018, "spawnturret" }, + { 0x019, "canspawnturret" }, + { 0x01A, "assert" }, + { 0x01B, "pausecinematicingame" }, + { 0x01C, "drawcompassfriendlies" }, + { 0x01D, "bulletspread" }, + { 0x01E, "bullettracer" }, + { 0x01F, "badplace_delete" }, + { 0x020, "badplace_cylinder" }, + { 0x021, "badplace_arc" }, + { 0x022, "badplace_brush" }, + { 0x023, "clearallcorpses" }, // SP 0x140261020 + { 0x024, "setturretnode" }, // SP 0x14027EA80 + { 0x025, "unsetturretnode" }, // SP 0x14027EB20 + { 0x026, "setnodepriority" }, // SP 0x14027E9B0 + { 0x027, "_func_027" }, // SP 0x14027E870 + { 0x028, "_func_028" }, // empty + { 0x029, "_func_029" }, // empty + { 0x02A, "_func_02A" }, // empty + { 0x02B, "_func_02B" }, // empty + { 0x02C, "updategamerprofile" }, + { 0x02D, "assertex" }, + { 0x02E, "assertmsg" }, + { 0x02F, "isdefined" }, + { 0x030, "isvalidmissile" }, + { 0x031, "isstring" }, + { 0x032, "setomnvar" }, + { 0x033, "getomnvar" }, + { 0x034, "setdvar" }, + { 0x035, "setdynamicdvar" }, + { 0x036, "setdvarifuninitialized" }, + { 0x037, "setdevdvar" }, + { 0x038, "setdevdvarifuninitialized" }, + { 0x039, "getdvar" }, + { 0x03A, "getdvarint" }, + { 0x03B, "getdvarfloat" }, + { 0x03C, "getdvarvector" }, + { 0x03D, "gettime" }, + { 0x03E, "gettimeutc" }, + { 0x03F, "getradiometricunit" }, + { 0x040, "getentbynum" }, + { 0x041, "getweaponmodel" }, + { 0x042, "getculldist" }, + { 0x043, "sethalfresparticles" }, + { 0x044, "getmapsunlight" }, + { 0x045, "setsunlight" }, + { 0x046, "resetsunlight" }, + { 0x047, "getmapsundirection" }, + { 0x048, "getmapsunangles" }, + { 0x049, "setsundirection" }, + { 0x04A, "lerpsundirection" }, + { 0x04B, "lerpsunangles" }, + { 0x04C, "resetsundirection" }, + { 0x04D, "enableforcedsunshadows" }, + { 0x04E, "enableforcednosunshadows" }, + { 0x04F, "disableforcedsunshadows" }, + { 0x050, "enableouterspacemodellighting" }, + { 0x051, "disableouterspacemodellighting" }, + { 0x052, "remapstage" }, + { 0x053, "_func_053" }, // SP 0x14025F6B0 + { 0x054, "_func_054" }, // SP 0x14025F800 + { 0x055, "_func_055" }, // SP 0x14025F830 + { 0x056, "_func_056" }, // SP 0x14025F850 + { 0x057, "_func_057" }, // SP 0x14025F920 + { 0x058, "_func_058" }, // SP 0x14025FA20 + { 0x059, "_func_059" }, // SP 0x14025FB80 + { 0x05A, "_func_05A" }, // SP 0x14025FC00 + { 0x05B, "_func_05B" }, // SP 0x14025FC80 + { 0x05C, "_func_05C" }, // SP 0x14025FE00 + { 0x05D, "getweapondisplayname" }, + { 0x05E, "getweaponbasename" }, + { 0x05F, "getweaponattachments" }, + { 0x060, "getweaponattachmentdisplaynames" }, + { 0x061, "getweaponcamoname" }, + { 0x062, "getweaponreticlename" }, + { 0x063, "getanimlength" }, + { 0x064, "animhasnotetrack" }, + { 0x065, "getnotetracktimes" }, + { 0x066, "spawn" }, + { 0x067, "spawnloopsound" }, + { 0x068, "spawnloopingsound" }, + { 0x069, "bullettrace" }, + { 0x06A, "target_setmaxsize" }, + { 0x06B, "target_setcolor" }, + { 0x06C, "target_setdelay" }, + { 0x06D, "getstartorigin" }, + { 0x06E, "getstartangles" }, + { 0x06F, "_func_06F" }, // SP 0x14020DCB0 + { 0x070, "_func_070" }, // SP 0x14025FCB0 + { 0x071, "_func_071" }, // SP 0x140243B90, MP 0x1403104D0 + { 0x072, "_func_072" }, // SP 0x14025BCC0 + { 0x073, "_func_073" }, // SP 0x14025BD60 + { 0x074, "_func_074" }, // SP 0x14025BFA0 + { 0x075, "_func_075" }, // SP 0x14025C150 + { 0x076, "_func_076" }, // SP 0x140246C90, MP 0x140311AD0 + { 0x077, "_func_077" }, // SP 0x140246D70, MP 0x140311D80 + { 0x078, "_func_078" }, // SP 0x140246DA0, MP 0x140311D90 + { 0x079, "_func_079" }, // SP 0x140246F10, MP 0x140311DF0 + { 0x07A, "_func_07A" }, // SP 0x140247010, MP 0x140311EF0 + { 0x07B, "_func_07B" }, // SP 0x140247060, MP 0x140311F50 + { 0x07C, "_func_07C" }, // SP 0x14025C320 + { 0x07D, "_func_07D" }, // SP 0x14025D3E0 + { 0x07E, "_func_07E" }, // SP 0x14025C220 + { 0x07F, "_func_07F" }, // SP 0x14025F620 + { 0x080, "_func_080" }, // SP 0x140241480, MP 0x14031FB60 + { 0x081, "_func_081" }, // SP 0x14025F640 + { 0x082, "_func_082" }, // SP 0x14025F690 + { 0x083, "_func_083" }, // SP 0x14025D480 + { 0x084, "_func_084" }, // SP 0x14025E160 + { 0x085, "_func_085" }, // SP 0x14025E180 + { 0x086, "_func_086" }, // SP 0x14025D8D0 + { 0x087, "_func_087" }, // SP 0x14025E1A0 + { 0x088, "_func_088" }, // SP 0x14025E270 + { 0x089, "_func_089" }, // SP 0x14025FE70 + { 0x08A, "_func_08A" }, // SP 0x140260370 + { 0x08B, "bullettracepassed" }, + { 0x08C, "sighttracepassed" }, + { 0x08D, "physicstrace" }, + { 0x08E, "playerphysicstrace" }, + { 0x08F, "getgroundposition" }, + { 0x090, "getmovedelta" }, + { 0x091, "getangledelta" }, + { 0x092, "getnorthyaw" }, + { 0x093, "_func_093" }, // SP 0x14025C1F0 + { 0x094, "_func_094" }, // SP 0x14025C2F0 + { 0x095, "_func_095" }, // SP 0x14025E330 + { 0x096, "_func_096" }, // SP 0x14025E380 + { 0x097, "_func_097" }, // SP 0x14025E2F0 + { 0x098, "_func_098" }, // SP 0x14026C770 + { 0x099, "_func_099" }, // SP 0x14026CB40 + { 0x09A, "_func_09A" }, // SP 0x14026CE30 + { 0x09B, "_func_09B" }, // SP 0x14026CDF0 + { 0x09C, "_func_09C" }, // SP 0x14026D9F0 + { 0x09D, "_func_09D" }, // SP 0x14026D670 + { 0x09E, "_func_09E" }, // SP 0x14026CCC0 + { 0x09F, "_func_09F" }, // SP 0x14026CC50 + { 0x0A0, "_func_0A0" }, // SP 0x14026DB20 + { 0x0A1, "_func_0A1" }, // SP 0x14026C790 + { 0x0A2, "_func_0A2" }, // SP 0x14026CBD0 + { 0x0A3, "_func_0A3" }, // SP 0x14026CD60 + { 0x0A4, "_func_0A4" }, // SP 0x14026CE50 + { 0x0A5, "_func_0A5" }, // SP 0x14026D2E0 + { 0x0A6, "_func_0A6" }, // SP 0x14026CC40 + { 0x0A7, "_func_0A7" }, // SP 0x14026DB10 + { 0x0A8, "_func_0A8" }, // SP 0x14026D8C0 + { 0x0A9, "_func_0A9" }, // SP 0x14026C7C0 + { 0x0AA, "_func_0AA" }, // SP 0x14026C9F0 + { 0x0AB, "_func_0AB" }, // SP 0x14026C8F0 + { 0x0AC, "_func_0AC" }, // SP 0x14026D520 + { 0x0AD, "setnorthyaw" }, + { 0x0AE, "setslowmotion" }, + { 0x0AF, "randomint" }, + { 0x0B0, "randomfloat" }, + { 0x0B1, "randomintrange" }, + { 0x0B2, "randomfloatrange" }, + { 0x0B3, "sin" }, + { 0x0B4, "cos" }, + { 0x0B5, "tan" }, + { 0x0B6, "asin" }, + { 0x0B7, "acos" }, + { 0x0B8, "atan" }, + { 0x0B9, "int" }, + { 0x0BA, "float" }, + { 0x0BB, "abs" }, + { 0x0BC, "min" }, + { 0x0BD, "objective_additionalcurrent" }, + { 0x0BE, "objective_ring" }, + { 0x0BF, "objective_setpointertextoverride" }, + { 0x0C0, "getnode" }, + { 0x0C1, "getnodearray" }, + { 0x0C2, "getallnodes" }, + { 0x0C3, "getnodesinradius" }, + { 0x0C4, "getnodesinradiussorted" }, + { 0x0C5, "getclosestnodeinsight" }, + { 0x0C6, "getreflectionlocs" }, + { 0x0C7, "getreflectionreferencelocs" }, + { 0x0C8, "getvehicletracksegment" }, + { 0x0C9, "getvehicletracksegmentarray" }, + { 0x0CA, "getallvehicletracksegments" }, + { 0x0CB, "isarray" }, + { 0x0CC, "isai" }, + { 0x0CD, "getindexforluincstring" }, + { 0x0CE, "issentient" }, + { 0x0CF, "_func_0CF" }, // SP 0x140259F30 + { 0x0D0, "_func_0D0" }, // SP 0x14025A0E0 + { 0x0D1, "_func_0D1" }, // SP 0x14025A170 + { 0x0D2, "_func_0D2" }, // SP 0x14025A1F0 + { 0x0D3, "_func_0D3" }, // SP 0x14025A220 + { 0x0D4, "_func_0D4" }, // SP 0x14025A620 + { 0x0D5, "_func_0D5" }, // SP 0x14025B700 + { 0x0D6, "_func_0D6" }, // SP 0x14025B8F0 + { 0x0D7, "_func_0D7" }, // SP 0x14025BA10 + { 0x0D8, "_func_0D8" }, // SP 0x14025BC40 + { 0x0D9, "_func_0D9" }, // SP 0x14025BB90 + { 0x0DA, "_func_0DA" }, // SP 0x14025BE80 + { 0x0DB, "_func_0DB" }, // SP 0x14025BF20 + { 0x0DC, "_func_0DC" }, // empty + { 0x0DD, "_func_0DD" }, // SP 0x14025C0E0 + { 0x0DE, "max" }, + { 0x0DF, "floor" }, + { 0x0E0, "ceil" }, + { 0x0E1, "exp" }, + { 0x0E2, "log" }, + { 0x0E3, "sqrt" }, + { 0x0E4, "squared" }, + { 0x0E5, "clamp" }, + { 0x0E6, "angleclamp" }, + { 0x0E7, "angleclamp180" }, + { 0x0E8, "vectorfromlinetopoint" }, + { 0x0E9, "pointonsegmentnearesttopoint" }, + { 0x0EA, "distance" }, + { 0x0EB, "distance2d" }, + { 0x0EC, "distancesquared" }, + { 0x0ED, "length" }, + { 0x0EE, "length2d" }, + { 0x0EF, "lengthsquared" }, + { 0x0F0, "length2dsquared" }, + { 0x0F1, "closer" }, + { 0x0F2, "vectordot" }, + { 0x0F3, "vectorcross" }, + { 0x0F4, "axistoangles" }, + { 0x0F5, "visionsetthermal" }, + { 0x0F6, "visionsetpain" }, + { 0x0F7, "endlobby" }, + { 0x0F8, "setac130ambience" }, + { 0x0F9, "getmapcustom" }, + { 0x0FA, "spawnsighttrace" }, + { 0x0FB, "incrementcounter" }, + { 0x0FC, "getcountertotal" }, + { 0x0FD, "getlevelticks" }, + { 0x0FE, "perlinnoise2d" }, + { 0x0FF, "calcrockingangles" }, + { 0x100, "reconevent" }, + { 0x101, "reconspatialevent" }, + { 0x102, "setsunflareposition" }, + { 0x103, "createthreatbiasgroup" }, + { 0x104, "threatbiasgroupexists" }, + { 0x105, "getthreatbias" }, + { 0x106, "setthreatbias" }, + { 0x107, "setthreatbiasagainstall" }, + { 0x108, "setignoremegroup" }, + { 0x109, "isenemyteam" }, + { 0x10A, "objective_additionalentity" }, + { 0x10B, "objective_state_nomessage" }, + { 0x10C, "objective_string" }, + { 0x10D, "objective_string_nomessage" }, + { 0x10E, "objective_additionalposition" }, + { 0x10F, "objective_current_nomessage" }, + { 0x110, "vectornormalize" }, + { 0x111, "vectortoangles" }, + { 0x112, "vectortoyaw" }, + { 0x113, "vectorlerp" }, + { 0x114, "anglestoup" }, + { 0x115, "anglestoright" }, + { 0x116, "anglestoforward" }, + { 0x117, "anglesdelta" }, + { 0x118, "combineangles" }, + { 0x119, "transformmove" }, + { 0x11A, "rotatevector" }, + { 0x11B, "rotatepointaroundvector" }, + { 0x11C, "issubstr" }, + { 0x11D, "isendstr" }, + { 0x11E, "getsubstr" }, + { 0x11F, "tolower" }, + { 0x120, "strtok" }, + { 0x121, "stricmp" }, + { 0x122, "ambientplay" }, + { 0x123, "getuavstrengthmax" }, + { 0x124, "getuavstrengthlevelneutral" }, + { 0x125, "getuavstrengthlevelshowenemyfastsweep" }, + { 0x126, "getuavstrengthlevelshowenemydirectional" }, + { 0x127, "blockteamradar" }, + { 0x128, "unblockteamradar" }, + { 0x129, "isteamradarblocked" }, + { 0x12A, "getassignedteam" }, + { 0x12B, "setmatchdata" }, + { 0x12C, "getmatchdata" }, + { 0x12D, "sendmatchdata" }, + { 0x12E, "clearmatchdata" }, + { 0x12F, "setmatchdatadef" }, + { 0x130, "setmatchclientip" }, + { 0x131, "setmatchdataid" }, + { 0x132, "setclientmatchdata" }, + { 0x133, "getclientmatchdata" }, + { 0x134, "setclientmatchdatadef" }, + { 0x135, "sendclientmatchdata" }, + { 0x136, "getbuildversion" }, + { 0x137, "getbuildnumber" }, + { 0x138, "getsystemtime" }, + { 0x139, "getmatchrulesdata" }, + { 0x13A, "isusingmatchrulesdata" }, + { 0x13B, "kick" }, + { 0x13C, "issplitscreen" }, + { 0x13D, "setmapcenter" }, + { 0x13E, "setgameendtime" }, + { 0x13F, "visionsetnaked" }, + { 0x140, "visionsetnight" }, + { 0x141, "visionsetmissilecam" }, + { 0x142, "ambientstop" }, + { 0x143, "precachemodel" }, + { 0x144, "precacheshellshock" }, + { 0x145, "precacheitem" }, + { 0x146, "precacheshader" }, + { 0x147, "precachestring" }, + { 0x148, "precachemenu" }, + { 0x149, "precacherumble" }, + { 0x14A, "precachelocationselector" }, + { 0x14B, "precacheleaderboards" }, + { 0x14C, "loadfx" }, + { 0x14D, "playfx" }, + { 0x14E, "playfxontag" }, + { 0x14F, "stopfxontag" }, + { 0x150, "killfxontag" }, + { 0x151, "playloopedfx" }, + { 0x152, "spawnfx" }, + { 0x153, "triggerfx" }, + { 0x154, "playfxontagforclients" }, + { 0x155, "setwinningteam" }, + { 0x156, "announcement" }, + { 0x157, "clientannouncement" }, + { 0x158, "setteammode" }, + { 0x159, "getteamscore" }, + { 0x15A, "setteamscore" }, + { 0x15B, "setclientnamemode" }, + { 0x15C, "updateclientnames" }, + { 0x15D, "getteamplayersalive" }, + { 0x15E, "logprint" }, + { 0x15F, "worldentnumber" }, + { 0x160, "obituary" }, + { 0x161, "positionwouldtelefrag" }, + { 0x162, "canspawn" }, + { 0x163, "getstarttime" }, + { 0x164, "precachestatusicon" }, + { 0x165, "precacheheadicon" }, + { 0x166, "precacheminimapicon" }, + { 0x167, "precachempanim" }, + { 0x168, "map_restart" }, + { 0x169, "_func_169" }, // MP 0x14032E320 + { 0x16A, "exitlevel" }, + { 0x16B, "_func_16B" }, // MP 0x14032E4E0 + { 0x16C, "_func_16C" }, // MP 0x14032EA90 + { 0x16D, "_func_16D" }, // MP 0x140328560 + { 0x16E, "_func_16E" }, // MP 0x14032EB80 + { 0x16F, "_func_16F" }, // MP 0x14032EEF0 + { 0x170, "_func_170" }, // MP 0x14032EBC0 + { 0x171, "_func_171" }, // MP 0x14032EC00 + { 0x172, "_func_172" }, // MP 0x140328580 + { 0x173, "_func_173" }, // MP 0x140328590 + { 0x174, "_func_174" }, // MP 0x140328700 + { 0x175, "_func_175" }, // MP 0x14032CBB0 + { 0x176, "_func_176" }, // MP 0x14032CC20 + { 0x177, "_func_177" }, // MP 0x14032CCE0 + { 0x178, "_func_178" }, // MP 0x14032CDC0 + { 0x179, "_func_179" }, // MP 0x14032CE20 + { 0x17A, "physicsexplosionsphere" }, + { 0x17B, "physicsexplosioncylinder" }, + { 0x17C, "physicsjolt" }, + { 0x17D, "physicsjitter" }, + { 0x17E, "setexpfog" }, + { 0x17F, "setexpfogext" }, + { 0x180, "setexpfogdvarsonly" }, + { 0x181, "setexpfogextdvarsonly" }, + { 0x182, "setatmosfog" }, + { 0x183, "setatmosfogdvarsonly" }, + { 0x184, "isexplosivedamagemod" }, + { 0x185, "radiusdamage" }, + { 0x186, "setplayerignoreradiusdamage" }, + { 0x187, "glassradiusdamage" }, + { 0x188, "earthquake" }, + { 0x189, "getnumparts" }, + { 0x18A, "objective_onentity" }, + { 0x18B, "objective_onentitywithrotation" }, + { 0x18C, "objective_team" }, + { 0x18D, "objective_player" }, + { 0x18E, "objective_playerteam" }, + { 0x18F, "objective_playerenemyteam" }, + { 0x190, "objective_playermask_hidefromall" }, + { 0x191, "objective_playermask_hidefrom" }, + { 0x192, "objective_playermask_showtoall" }, + { 0x193, "objective_playermask_showto" }, + { 0x194, "iprintln" }, + { 0x195, "iprintlnbold" }, + { 0x196, "logstring" }, + { 0x197, "getent" }, + { 0x198, "getentarray" }, + { 0x199, "getspawnarray" }, + { 0x19A, "spawnplane" }, + { 0x19B, "spawnstruct" }, + { 0x19C, "spawnhelicopter" }, + { 0x19D, "isalive" }, + { 0x19E, "isspawner" }, + { 0x19F, "missile_createattractorent" }, + { 0x1A0, "missile_createattractororigin" }, + { 0x1A1, "missile_createrepulsorent" }, + { 0x1A2, "missile_createrepulsororigin" }, + { 0x1A3, "missile_deleteattractor" }, + { 0x1A4, "playsoundatpos" }, + { 0x1A5, "newhudelem" }, + { 0x1A6, "newclienthudelem" }, + { 0x1A7, "newteamhudelem" }, + { 0x1A8, "resettimeout" }, + { 0x1A9, "isplayer" }, + { 0x1AA, "isplayernumber" }, + { 0x1AB, "getpartname" }, + { 0x1AC, "weaponfiretime" }, + { 0x1AD, "weaponclipsize" }, + { 0x1AE, "weaponisauto" }, + { 0x1AF, "weaponissemiauto" }, + { 0x1B0, "weaponisboltaction" }, + { 0x1B1, "weaponinheritsperks" }, + { 0x1B2, "weaponburstcount" }, + { 0x1B3, "weapontype" }, + { 0x1B4, "weaponclass" }, + { 0x1B5, "getnextarraykey" }, + { 0x1B6, "sortbydistance" }, + { 0x1B7, "tablelookup" }, + { 0x1B8, "tablelookupbyrow" }, + { 0x1B9, "tablelookupistring" }, + { 0x1BA, "tablelookupistringbyrow" }, + { 0x1BB, "tablelookuprownum" }, + { 0x1BC, "tableexists" }, + { 0x1BD, "getmissileowner" }, + { 0x1BE, "magicbullet" }, + { 0x1BF, "getweaponflashtagname" }, + { 0x1C0, "averagepoint" }, + { 0x1C1, "averagenormal" }, + { 0x1C2, "vehicle_getspawnerarray" }, + { 0x1C3, "playrumbleonposition" }, + { 0x1C4, "playrumblelooponposition" }, + { 0x1C5, "stopallrumbles" }, + { 0x1C6, "soundexists" }, + { 0x1C7, "openfile" }, + { 0x1C8, "closefile" }, + { 0x1C9, "fprintln" }, + { 0x1CA, "fprintfields" }, + { 0x1CB, "freadln" }, + { 0x1CC, "fgetarg" }, + { 0x1CD, "setminimap" }, + { 0x1CE, "setthermalbodymaterial" }, + { 0x1CF, "getarraykeys" }, + { 0x1D0, "getfirstarraykey" }, + { 0x1D1, "getglass" }, + { 0x1D2, "getglassarray" }, + { 0x1D3, "getglassorigin" }, + { 0x1D4, "isglassdestroyed" }, + { 0x1D5, "destroyglass" }, + { 0x1D6, "deleteglass" }, + { 0x1D7, "getentchannelscount" }, + { 0x1D8, "getentchannelname" }, + { 0x1D9, "objective_add" }, + { 0x1DA, "objective_delete" }, + { 0x1DB, "objective_state" }, + { 0x1DC, "objective_icon" }, + { 0x1DD, "objective_position" }, + { 0x1DE, "objective_current" }, + { 0x1DF, "_func_1DF" }, // SP 0x140245580, MP 0x14030C5F0 // weap + { 0x1E0, "_func_1E0" }, // SP 0x140245870, MP 0x14030C960 + { 0x1E1, "_func_1E1" }, // SP 0x140245A90, MP 0x14030CAD0 + { 0x1E2, "_func_1E2" }, // SP 0x140245D00, MP 0x14030D110 + { 0x1E3, "_func_1E3" }, // SP 0x140246230, MP 0x14030D980 + { 0x1E4, "_func_1E4" }, // SP 0x1402464C0, MP 0x14030DFC0 + { 0x1E5, "_func_1E5" }, // SP 0x1402468A0, MP 0x14030E400 + { 0x1E6, "_func_1E6" }, // SP 0x140246E40, MP 0x14030E970 + { 0x1E7, "getvehiclenode" }, + { 0x1E8, "getvehiclenodearray" }, + { 0x1E9, "getallvehiclenodes" }, + { 0x1EA, "getnumvehicles" }, + { 0x1EB, "precachevehicle" }, + { 0x1EC, "spawnvehicle" }, + { 0x1ED, "vehicle_getarray" }, + { 0x1EE, "pow" }, + { 0x1EF, "angleclamp360" }, + { 0x1F0, "botgetmemoryevents" }, + { 0x1F1, "botautoconnectenabled" }, + { 0x1F2, "botzonegetcount" }, + { 0x1F3, "botzonesetteam" }, + { 0x1F4, "botzonenearestcount" }, + { 0x1F5, "botmemoryflags" }, + { 0x1F6, "botflagmemoryevents" }, + { 0x1F7, "botzonegetindoorpercent" }, + { 0x1F8, "botsentientswap" }, + { 0x1F9, "isbot" }, + { 0x1FA, "isagent" }, + { 0x1FB, "_func_1FB" }, // MP 0x140406E40 + { 0x1FC, "_func_1FC" }, // MP 0x140432CD0 + { 0x1FD, "_func_1FD" }, // MP 0x140432EE0 + { 0x1FE, "_func_1FE" }, // MP 0x1402D2430 + { 0x1FF, "_func_1FF" }, // SP 0x14027E8E0, MP 0x1402D3710 + { 0x200, "_func_200" }, // SP 0x14027E550, MP 0x1402D2530 + { 0x201, "_func_201" }, // MP 0x1402D28C0 + { 0x202, "_func_202" }, // MP 0x1402D28D0 + { 0x203, "_func_203" }, // MP 0x1402D2A40 + { 0x204, "_func_204" }, // MP 0x1402D30E0 + { 0x205, "_func_205" }, // MP 0x1402D3060 + { 0x206, "_func_206" }, // MP 0x1402D2370 + { 0x207, "_func_207" }, // MP 0x1402D2D20 + { 0x208, "_func_208" }, // MP 0x1402D29D0 + { 0x209, "_func_209" }, // SP 0x14025C070, MP 0x14032AF60 + { 0x20A, "_func_20A" }, // empty + { 0x20B, "_func_20B" }, // empty + { 0x20C, "_func_20C" }, // MP 0x1402D3310 + { 0x20D, "_func_20D" }, // MP 0x1402D1E20 + { 0x20E, "badplace_global" }, + { 0x20F, "getpathdist" }, + { 0x210, "getlinkednodes" }, + { 0x211, "disconnectnodepair" }, + { 0x212, "connectnodepair" }, + { 0x213, "_func_213" }, // SP 0x140259F80 + { 0x214, "_func_214" }, // empty + { 0x215, "_func_215" }, // empty + { 0x216, "_func_216" }, // MP 0x140330030 + { 0x217, "_func_217" }, // MP 0x14032E430 + { 0x218, "_func_218" }, // SP 0x140321E90 + { 0x219, "_func_219" }, // SP 0x1403220D0 + { 0x21A, "_func_21A" }, // SP 0x140322010 + { 0x21B, "_func_21B" }, // SP 0x140321FB0 + { 0x21C, "_func_21C" }, // SP 0x140321B90 + { 0x21D, "_func_21D" }, // SP 0x140321C10 + { 0x21E, "_func_21E" }, // SP 0x140321BC0 + { 0x21F, "_func_21F" }, // SP 0x140321C50 + { 0x220, "_func_220" }, // SP 0x1402509E0, MP 0x1403176D0 + { 0x221, "_func_221" }, // SP 0x14024FD80, MP 0x1403175D0 + { 0x222, "_func_222" }, // SP 0x140253430, MP 0x14031FB30 + { 0x223, "_func_223" }, // SP 0x1402538E0, MP 0x140320C40 + { 0x224, "_func_224" }, // SP 0x140253AE0, MP 0x140320E00 + { 0x225, "_func_225" }, // SP 0x140254010, MP 0x1403210C0 + { 0x226, "_func_226" }, // SP 0x140254670, MP 0x140321250 + { 0x227, "_func_227" }, // SP 0x14023DF60, MP 0x140321520 + { 0x228, "_func_228" }, // SP 0x14023E450, MP 0x1403217F0 + { 0x229, "_func_229" }, // MP 0x14030FA10 + { 0x22A, "_func_22A" }, // SP 0x140250490, MP 0x1403172F0 + { 0x22B, "_func_22B" }, // SP 0x14025FDE0 + { 0x22C, "_func_22C" }, // SP 0x14025FDC0 + { 0x22D, "_func_22D" }, // SP 0x14025FDA0 + { 0x22E, "_func_22E" }, // empty + { 0x22F, "_func_22F" }, // MP 0x14030B9E0 + { 0x230, "_func_230" }, // empty + { 0x231, "_func_231" }, // SP 0x1402403A0, MP 0x14030BB90 + { 0x232, "_func_232" }, // SP 0x140240810, MP 0x140320F60 + { 0x233, "_func_233" }, // SP 0x14025CF00, MP 0x14032BE10 + { 0x234, "_func_234" }, // SP 0x14025EA90 + { 0x235, "_func_235" }, // SP 0x14024CB60, MP 0x140321C30 + { 0x236, "_func_236" }, // MP 0x140321C40 + { 0x237, "_func_237" }, // empty + { 0x238, "_func_238" }, // SP 0x14024A020, MP 0x140311A40 + { 0x239, "_func_239" }, // SP 0x140247090, MP 0x14030EC50 + { 0x23A, "_func_23A" }, // SP 0x140247300, MP 0x14030F050 + { 0x23B, "_func_23B" }, // SP 0x1402474E0, MP 0x14030F340 + { 0x23C, "_func_23C" }, // SP 0x1402477E0, MP 0x14030F550 + { 0x23D, "_func_23D" }, // SP 0x140247A40, MP 0x14030F710 + { 0x23E, "_func_23E" }, // MP 0x1403295E0 + { 0x23F, "_func_23F" }, // SP 0x14023FCB0, MP 0x140322690 + { 0x240, "_func_240" }, // MP 0x140329600 + { 0x241, "_func_241" }, // MP 0x140329950 + { 0x242, "_func_242" }, // MP 0x1403299C0 + { 0x243, "_func_243" }, // MP 0x1403299D0 + { 0x244, "_func_244" }, // SP 0x14025D7C0 + { 0x245, "_func_245" }, // SP 0x140253C30, MP 0x14031A690 + { 0x246, "_func_246" }, // SP 0x14024F1E0, MP 0x1403163C0 + { 0x247, "_func_247" }, // SP 0x140252280, MP 0x140319020 + { 0x248, "_func_248" }, // SP 0x140260360 + { 0x249, "_func_249" }, // MP 0x14030B680 + { 0x24A, "_func_24A" }, // MP 0x14030B870 + { 0x24B, "_func_24B" }, // MP 0x14030B9D0 + { 0x24C, "_func_24C" }, // SP 0x1402531C0, MP 0x140319F60 + { 0x24D, "_func_24D" }, // SP 0x140253500, MP 0x140319FC0 + { 0x24E, "_func_24E" }, // SP 0x1402539F0, MP 0x14031A250 + { 0x24F, "_func_24F" }, // MP 0x140338900 + { 0x250, "_func_250" }, // SP 0x140259FA0 + { 0x251, "_func_251" }, // SP 0x140249700, MP 0x140310B20 + { 0x252, "_func_252" }, // SP 0x140240DE0, MP 0x14030CBF0 + { 0x253, "_func_253" }, // SP 0x140240E00, MP 0x14030CE90 + { 0x254, "_func_254" }, // SP 0x140241180, MP 0x14030D000 + { 0x255, "_func_255" }, // SP 0x140241330, MP 0x14030D2A0 + { 0x256, "_func_256" }, // SP 0x140241560, MP 0x14030D650 + { 0x257, "_func_257" }, // SP 0x140241970, MP 0x14030D8E0 + { 0x258, "_func_258" }, // SP 0x140241A70, MP 0x14030E070 + { 0x259, "_func_259" }, // SP 0x140241E30, MP 0x14030E4C0 + { 0x25A, "_func_25A" }, // SP 0x140241F40, MP 0x14030E7B0 + { 0x25B, "_func_25B" }, // SP 0x140242270, MP 0x14030EAC0 + { 0x25C, "_func_25C" }, // SP 0x1402425F0, MP 0x14030EED0 + { 0x25D, "_func_25D" }, // SP 0x140242960, MP 0x14030F280 + { 0x25E, "_func_25E" }, // SP 0x140242C80, MP 0x14030F640 + { 0x25F, "_func_25F" }, // SP 0x1402430E0, MP 0x14030F990 + { 0x260, "_func_260" }, // MP 0x14030FA20 + { 0x261, "_func_261" }, // MP 0x14032BC00 + { 0x262, "_func_262" }, // MP 0x14030FD60 + { 0x263, "_func_263" }, // MP 0x14030FDB0 + { 0x264, "_func_264" }, // MP 0x14030FF50 + { 0x265, "_func_265" }, // MP 0x140310030 + { 0x266, "_func_266" }, // MP 0x140310040 + { 0x267, "_func_267" }, // MP 0x1403101C0 + { 0x268, "_func_268" }, // MP 0x140328750 + { 0x269, "_func_269" }, // empty + { 0x26A, "_func_26A" }, // empty + { 0x26B, "_func_26B" }, // MP 0x140310250 + { 0x26C, "_func_26C" }, // MP 0x140310260 + { 0x26D, "_func_26D" }, // MP 0x140310360 + { 0x26E, "_func_26E" }, // MP 0x140310480 + { 0x26F, "_func_26F" }, // MP 0x14032C3B0 + { 0x270, "_func_270" }, // empty + { 0x271, "_func_271" }, // MP 0x140433260 + { 0x272, "_func_272" }, // MP 0x1403328E0 + { 0x273, "_func_273" }, // MP 0x140433220 + { 0x274, "_func_274" }, // MP 0x14030F630 + { 0x275, "_func_275" }, // MP 0x1402F05B0 + { 0x276, "_func_276" }, // MP 0x14030C470 + { 0x277, "_func_277" }, // MP 0x14030C480 + { 0x278, "_func_278" }, // MP 0x14030BA90 + { 0x279, "_func_279" }, // SP 0x1402476E0, MP 0x140310920 + { 0x27A, "_func_27A" }, // MP 0x14032C4A0 + { 0x27B, "_func_27B" }, // MP 0x14032C4B0 + { 0x27C, "_func_27C" }, // MP 0x14032C4D0 + { 0x27D, "_func_27D" }, // MP 0x14032C840 + { 0x27E, "_func_27E" }, // MP 0x14032CAB0 + { 0x27F, "_func_27F" }, // MP 0x14030BB00 + { 0x280, "_func_280" }, // MP 0x14032F7E0 + { 0x281, "_func_281" }, // MP 0x14032E600 + { 0x282, "_func_282" }, // MP 0x140310EC0 + { 0x283, "_func_283" }, // SP 0x14023EC00, MP 0x14031BAE0 + { 0x284, "_func_284" }, // SP 0x14023F300, MP 0x14031C2B0 + { 0x285, "_func_285" }, // MP 0x140043610 + { 0x286, "istestclient" }, + { 0x287, "_func_287" }, // MP 0x1402D2850 + { 0x288, "_func_288" }, // MP 0x14032F0C0 + { 0x289, "_func_289" }, // SP 0x1402471A0, MP 0x140311FF0 + { 0x28A, "_func_28A" }, // SP 0x1402471E0, MP 0x140312040 + { 0x28B, "_func_28B" }, // SP 0x140259CC0 + { 0x28C, "_func_28C" }, // SP 0x140244780, MP 0x140311100 + { 0x28D, "_func_28D" }, // SP 0x140247F80, MP 0x140314C70 + { 0x28E, "_func_28E" }, // SP 0x140244530, MP 0x14030D340 + { 0x28F, "_func_28F" }, // SP 0x1402453C0, MP 0x14030DA60 + { 0x290, "_func_290" }, // SP 0x140245780, MP 0x14030E5C0 + { 0x291, "_func_291" }, // SP 0x1402601E0 + { 0x292, "_func_292" }, // MP 0x14031FDA0 + { 0x293, "_func_293" }, // SP 0x1402503F0, MP 0x140317140 + { 0x294, "_func_294" }, // SP 0x140246AD0, MP 0x14030FD70 + { 0x295, "_func_295" }, // SP 0x140246F20, MP 0x140310210 + { 0x296, "_func_296" }, // SP 0x140247200, MP 0x140310370 + { 0x297, "_func_297" }, // MP 0x14032FBA0 + { 0x298, "_func_298" }, // MP 0x14032FCA0 + { 0x299, "_func_299" }, // SP 0x140246B10, MP 0x14030E700 + { 0x29A, "_func_29A" }, // SP 0x1402603C0 + { 0x29B, "_func_29B" }, // SP 0x14024CE40, MP 0x140316070 + { 0x29C, "_func_29C" }, // MP 0x14031FC20 + { 0x29D, "_func_29D" }, // SP 0x14024A520, MP 0x140318030 + { 0x29E, "_func_29E" }, // MP 0x140318A90 + { 0x29F, "_func_29F" }, // MP 0x140318560 + { 0x2A0, "_func_2A0" }, // MP 0x140328F10 + { 0x2A1, "_func_2A1" }, // SP 0x14025A630 + { 0x2A2, "_func_2A2" }, // SP 0x140243B50, MP 0x14030CA90 + { 0x2A3, "_func_2A3" }, // SP 0x14024B760, MP 0x1403199C0 + { 0x2A4, "_func_2A4" }, // SP 0x14024AB20, MP 0x140319680 + { 0x2A5, "_func_2A5" }, // SP 0x14024B670, MP 0x1403199A0 + { 0x2A6, "_func_2A6" }, // SP 0x14024B710, MP 0x1403199B0 + { 0x2A7, "_func_2A7" }, // SP 0x14024B850, MP 0x140319A20 + { 0x2A8, "_func_2A8" }, // MP 0x14032D2A0 + { 0x2A9, "_func_2A9" }, // MP 0x14032D300 + { 0x2AA, "_func_2AA" }, // MP 0x14032D340 + { 0x2AB, "_func_2AB" }, // MP 0x14032D780 + { 0x2AC, "_func_2AC" }, // MP 0x14031CA40 + { 0x2AD, "_func_2AD" }, // MP 0x14031E1F0 + { 0x2AE, "_func_2AE" }, // SP 0x14023E7F0, MP 0x140321880 + { 0x2AF, "_func_2AF" }, // SP 0x14025CCA0 + { 0x2B0, "_func_2B0" }, // MP 0x140329610 + { 0x2B1, "_func_2B1" }, // MP 0x1403297B0 + { 0x2B2, "_func_2B2" }, // MP 0x1403298D0 + { 0x2B3, "_func_2B3" }, // MP 0x14032ACF0 + { 0x2B4, "_func_2B4" }, // SP 0x14024EAD0, MP 0x140317DF0 + { 0x2B5, "_func_2B5" }, // SP 0x14025CCF0 + { 0x2B6, "_func_2B6" }, // SP 0x140245730, MP 0x14030E570 + { 0x2B7, "_func_2B7" }, // MP 0x140337920 + { 0x2B8, "_func_2B8" }, // SP 0x14024BB40, MP 0x140319B40 + { 0x2B9, "_func_2B9" }, // SP 0x14024BC90, MP 0x140319B50 + { 0x2BA, "_func_2BA" }, // SP 0x14023ED90, MP 0x140321AE0 + { 0x2BB, "_func_2BB" }, // SP 0x14024B7C0, MP 0x140314A40 + { 0x2BC, "_func_2BC" }, // MP 0x140314C30 + { 0x2BD, "_func_2BD" }, // SP 0x14025CF50 + { 0x2BE, "_func_2BE" }, // MP 0x14032AEA0 + { 0x2BF, "_func_2BF" }, // MP 0x1402D3540 + { 0x2C0, "_func_2C0" }, // MP 0x1402D35B0 + { 0x2C1, "_func_2C1" }, // MP 0x140332A70 + { 0x2C2, "_func_2C2" }, // MP 0x140332AE0 + { 0x2C3, "_func_2C3" }, // MP 0x14032C580 + { 0x2C4, "_func_2C4" }, // MP 0x14032C650 + { 0x2C5, "_func_2C5" }, // MP 0x14032C820 + { 0x2C6, "_func_2C6" }, // SP 0x14025C2C0 + { 0x2C7, "_func_2C7" }, // MP 0x14032C2A0 + { 0x2C8, "_func_2C8" }, // MP 0x1402D34D0 + { 0x2C9, "_func_2C9" }, // MP 0x1402D33F0 + { 0x2CA, "_func_2CA" }, // MP 0x14032DAD0 + { 0x2CB, "_func_2CB" }, // MP 0x14032DC40 + { 0x2CC, "_func_2CC" }, // SP 0x14025C4B0 + { 0x2CD, "_func_2CD" }, // SP 0x14024A6B0, MP 0x140318270 + { 0x2CE, "_func_2CE" }, // MP 0x14032C6B0 + { 0x2CF, "_func_2CF" }, // MP 0x140318AD0 + { 0x2D0, "_func_2D0" }, // SP 0x140260350 + { 0x2D1, "_func_2D1" }, // MP 0x1402D3460 + { 0x2D2, "_func_2D2" }, // SP 0x14025CFA0 + { 0x2D3, "_func_2D3" }, // MP 0x14032C2D0 + { 0x2D4, "_func_2D4" }, // MP 0x140332620 + { 0x2D5, "_func_2D5" }, // MP 0x140332610 + { 0x2D6, "_func_2D6" }, // MP 0x1402D3630 + { 0x2D7, "_func_2D7" }, // MP 0x14031AA80 + { 0x2D8, "_func_2D8" }, // SP 0x140240AD0, MP 0x14031EAD0 + { 0x2D9, "_func_2D9" }, // MP 0x140328010 + { 0x2DA, "_func_2DA" }, // MP 0x14031B670 + { 0x2DB, "_func_2DB" }, // MP 0x14031D3F0 + { 0x2DC, "_func_2DC" }, // MP 0x14031E670 + { 0x2DD, "_func_2DD" }, // MP 0x140339100 + { 0x2DE, "_func_2DE" }, // MP 0x140319200 + { 0x2DF, "_func_2DF" }, // MP 0x140331E00 +}}; + +} // namespace xsk::gsc::s1_pc diff --git a/src/s1/s1_pc_meth.cpp b/src/s1/s1_pc_meth.cpp new file mode 100644 index 00000000..ab272588 --- /dev/null +++ b/src/s1/s1_pc_meth.cpp @@ -0,0 +1,1404 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_pc.hpp" + +namespace xsk::gsc::s1_pc +{ + +extern std::array, meth_count> const meth_list +{{ + { 0x8000, "thermaldrawdisable" }, // SP 0x140243FC0, MP 0x140321BF0 + { 0x8001, "_meth_8001" }, // SP 0x14025D290 + { 0x8002, "heli_setdamagestage" }, // MP 0x140522DA0 + { 0x8003, "playsoundtoteam" }, // MP 0x140327D90 + { 0x8004, "playsoundtoplayer" }, // MP 0x140328150 + { 0x8005, "playerhide" }, // MP 0x14032AC70 + { 0x8006, "playershow" }, // MP 0x14032ACB0 + { 0x8007, "showtoplayer" }, // MP 0x14032ADA0 + { 0x8008, "threatdetectedtoplayer" }, // MP 0x14032AE00 + { 0x8009, "clearthreatdetected" }, // MP 0x14032AE60 + { 0x800A, "enableplayeruse" }, // MP 0x14032CAF0 + { 0x800B, "disableplayeruse" }, // MP 0x14032CB50 + { 0x800C, "enableammogeneration" }, // MP 0x14032CD60 + { 0x800D, "disableammogeneration" }, // MP 0x14032CC80 + { 0x800E, "makescrambler" }, // MP 0x14032C2F0 + { 0x800F, "makeportableradar" }, // MP 0x14032C370 + { 0x8010, "clearscrambler" }, // MP 0x14032C350 + { 0x8011, "clearportableradar" }, // MP 0x14032C390 + { 0x8012, "placespawnpoint" }, // MP 0x14032E080 + { 0x8013, "setteamfortrigger" }, // MP 0x14032C7A0 + { 0x8014, "clientclaimtrigger" }, // MP 0x14032C870 + { 0x8015, "clientreleasetrigger" }, // MP 0x14032C960 + { 0x8016, "releaseclaimedtrigger" }, // MP 0x14032CA40 + { 0x8017, "isusingonlinedataoffline" }, // MP 0x14032C310 + { 0x8018, "getrestedtime" }, // MP 0x14032C460 + { 0x8019, "sendleaderboards" }, // MP 0x140328CD0 + { 0x801A, "isonladder" }, // SP 0x14024E140, MP 0x1403167C0 + { 0x801B, "getcorpseanim" }, // MP 0x14032D4E0 + { 0x801C, "playerforcedeathanim" }, // MP 0x14032DA10 + { 0x801D, "attach" }, // SP 0x140247610, MP 0x140311030 + { 0x801E, "_meth_801E" }, // SP 0x1402617C0 + { 0x801F, "_meth_801F" }, // SP 0x1402617F0 + { 0x8020, "_meth_8020" }, // SP 0x140261910 + { 0x8021, "_meth_8021" }, // SP 0x140259710 + { 0x8022, "_meth_8022" }, // SP 0x140259730 + { 0x8023, "_meth_8023" }, // SP 0x1402598B0, MP 0x14032D110 + { 0x8024, "_meth_8024" }, // SP 0x1402598D0 + { 0x8025, "_meth_8025" }, // SP 0x140243780, MP 0x14031D9D0 + { 0x8026, "_meth_8026" }, // MP 0x14032F8A0 + { 0x8027, "_meth_8027" }, // empty + { 0x8028, "_meth_8028" }, // SP 0x140259D50 + { 0x8029, "_meth_8029" }, // SP 0x140243D30, MP 0x140321AA0 + { 0x802A, "detach" }, // SP 0x140248580, MP 0x140311FB0 + { 0x802B, "detachall" }, // SP 0x140248980, MP 0x140312130 + { 0x802C, "_meth_802C" }, // SP 0x14024A5E0, MP 0x1403144E0 + { 0x802D, "_meth_802D" }, // SP 0x14024A7F0, MP 0x1403146A0 + { 0x802E, "_meth_802E" }, // SP 0x14024AAB0, MP 0x140314840 + { 0x802F, "_meth_802F" }, // SP 0x14025A350 + { 0x8030, "_meth_8030" }, // SP 0x14025A3E0 + { 0x8031, "_meth_8031" }, // SP 0x14025A560 + { 0x8032, "_meth_8032" }, // SP 0x14025B7E0 + { 0x8033, "_meth_8033" }, // SP 0x14027DFE0 + { 0x8034, "_meth_8034" }, // SP 0x14027DF70, MP 0x1402D1D80 + { 0x8035, "_meth_8035" }, // SP 0x14027DED0, MP 0x1402D1CE0 + { 0x8036, "_meth_8036" }, // SP 0x14025F9C0 + { 0x8037, "_meth_8037" }, // SP 0x14025FA80 + { 0x8038, "_meth_8038" }, // SP 0x14025FEB0 + { 0x8039, "_meth_8039" }, // SP 0x140261030 + { 0x803A, "_meth_803A" }, // SP 0x140261050 + { 0x803B, "_meth_803B" }, // SP 0x140261170 + { 0x803C, "_meth_803C" }, // SP 0x14025B970 + { 0x803D, "_meth_803D" }, // SP 0x14025B9B0 + { 0x803E, "_meth_803E" }, // SP 0x14025BB00 + { 0x803F, "_meth_803F" }, // SP 0x14025BB40 + { 0x8040, "_meth_8040" }, // SP 0x14025BC00 + { 0x8041, "_meth_8041" }, // SP 0x14025D150 + { 0x8042, "_meth_8042" }, // SP 0x14025D240 + { 0x8043, "_meth_8043" }, // SP 0x14024D860, MP 0x140316310 + { 0x8044, "_meth_8044" }, // SP 0x14024DAA0, MP 0x140316590 + { 0x8045, "_meth_8045" }, // SP 0x140261430 + { 0x8046, "_meth_8046" }, // SP 0x140261450 + { 0x8047, "_meth_8047" }, // SP 0x14024ACA0, MP 0x140314A80 + { 0x8048, "_meth_8048" }, // SP 0x14024B060, MP 0x140315570 + { 0x8049, "_meth_8049" }, // SP 0x14024B570, MP 0x1403159E0 + { 0x804A, "_meth_804A" }, // SP 0x14024BAB0, MP 0x140315BE0 + { 0x804B, "_meth_804B" }, // SP 0x14024BE00, MP 0x140315F10 + { 0x804C, "_meth_804C" }, // SP 0x14024C3A0, MP 0x140316280 + { 0x804D, "_meth_804D" }, // SP 0x14024D310, MP 0x140317A90 + { 0x804E, "_meth_804E" }, // SP 0x14024D720, MP 0x140318250 + { 0x804F, "_meth_804F" }, // SP 0x14024D790, MP 0x140318390 + { 0x8050, "_meth_8050" }, // SP 0x140261820, MP 0x140329690 + { 0x8051, "_meth_8051" }, // SP 0x14024C410, MP 0x140313E60 + { 0x8052, "_meth_8052" }, // SP 0x1402594E0 + { 0x8053, "show" }, // SP 0x140259840, MP 0x14032ABA0 + { 0x8054, "hide" }, // SP 0x140259860, MP 0x14032ABF0 + { 0x8055, "_meth_8055" }, // SP 0x140259880 + { 0x8056, "_meth_8056" }, // SP 0x140259960 + { 0x8057, "_meth_8057" }, // SP 0x140250700, MP 0x14031AD40 + { 0x8058, "_meth_8058" }, // SP 0x140250960, MP 0x14031B050 + { 0x8059, "_meth_8059" }, // SP 0x140250BD0, MP 0x14031B2C0 + { 0x805A, "_meth_805A" }, // SP 0x140250CD0, MP 0x14031B350 + { 0x805B, "_meth_805B" }, // SP 0x14025CC40 + { 0x805C, "_meth_805C" }, // SP 0x14025CC60 + { 0x805D, "_meth_805D" }, // SP 0x14025CC80 + { 0x805E, "_meth_805E" }, // SP 0x14025CCD0 + { 0x805F, "_meth_805F" }, // SP 0x14025DA20 + { 0x8060, "_meth_8060" }, // SP 0x14025DAA0 + { 0x8061, "_meth_8061" }, // SP 0x14025E3D0 + { 0x8062, "_meth_8062" }, // SP 0x14025F390 + { 0x8063, "_meth_8063" }, // SP 0x14025F400 + { 0x8064, "_meth_8064" }, // SP 0x140241600, MP 0x14031FC50 + { 0x8065, "_meth_8065" }, // SP 0x140259B30, MP 0x14032CE60 + { 0x8066, "_meth_8066" }, // SP 0x140259E80, MP 0x14032D070 + { 0x8067, "_meth_8067" }, // SP 0x14025A120 + { 0x8068, "_meth_8068" }, // SP 0x14024D9F0, MP 0x1403183D0 + { 0x8069, "_meth_8069" }, // SP 0x14024ED20, MP 0x1403198B0 + { 0x806A, "_meth_806A" }, // SP 0x140261290 + { 0x806B, "_meth_806B" }, // empty + { 0x806C, "_meth_806C" }, // SP 0x14024F1B0, MP 0x14031DEE0 + { 0x806D, "_meth_806D" }, // SP 0x14024F180, MP 0x14031D9A0 + { 0x806E, "_meth_806E" }, // SP 0x14024F580, MP 0x14031E390 + { 0x806F, "_meth_806F" }, // SP 0x14024F550, MP 0x14031E1C0 + { 0x8070, "_meth_8070" }, // SP 0x14023EE50 + { 0x8071, "_meth_8071" }, // empty + { 0x8072, "_meth_8072" }, // empty + { 0x8073, "_meth_8073" }, // empty + { 0x8074, "_meth_8074" }, // SP 0x140261310, MP 0x140329200 + { 0x8075, "_meth_8075" }, // SP 0x140261390, MP 0x1403292F0 + { 0x8076, "_meth_8076" }, // SP 0x140261400 + { 0x8077, "_meth_8077" }, // SP 0x140261500 + { 0x8078, "_meth_8078" }, // SP 0x140261530 + { 0x8079, "_meth_8079" }, // SP 0x1402615C0 + { 0x807A, "_meth_807A" }, // SP 0x1402615E0 + { 0x807B, "_meth_807B" }, // SP 0x140261740, MP 0x140329410 + { 0x807C, "_meth_807C" }, // SP 0x14024F8B0, MP 0x14031AA90 + { 0x807D, "_meth_807D" }, // SP 0x14024FA90, MP 0x14031AD20 + { 0x807E, "_meth_807E" }, // SP 0x14024FB10, MP 0x14031AED0 + { 0x807F, "_meth_807F" }, // SP 0x14024FC00, MP 0x14031AF00 + { 0x8080, "_meth_8080" }, // SP 0x1402535F0, MP 0x14031D010 + { 0x8081, "_meth_8081" }, // SP 0x140250380, MP 0x14031B520 + { 0x8082, "_meth_8082" }, // SP 0x14021EA10, MP 0x1402EF1F0 + { 0x8083, "_meth_8083" }, // SP 0x14021EA60, MP 0x1402EF240 + { 0x8084, "fadeovertime" }, // SP 0x14021EE30, MP 0x1402EF5E0 + { 0x8085, "scaleovertime" }, // SP 0x14021EF70, MP 0x1402EF720 + { 0x8086, "moveovertime" }, // SP 0x14021F050, MP 0x1402EF800 + { 0x8087, "reset" }, // SP 0x14021F190, MP 0x1402EF8B0 + { 0x8088, "destroy" }, // SP 0x14021F1D0, MP 0x1402EF980 + { 0x8089, "setpulsefx" }, // SP 0x14021F300, MP 0x1402EFA60 + { 0x808A, "setplayernamestring" }, // SP 0x14021F240, MP 0x1402EF9D0 + { 0x808B, "_meth_808B" }, // SP 0x14021EED0, MP 0x1402EF680 + { 0x808C, "_meth_808C" }, // SP 0x14025CC00 + { 0x808D, "_meth_808D" }, // SP 0x14025CC20 + { 0x808E, "_meth_808E" }, // SP 0x14025D300 + { 0x808F, "_meth_808F" }, // SP 0x14025D340 + { 0x8090, "_meth_8090" }, // SP 0x1402599B0 + { 0x8091, "_meth_8091" }, // SP 0x14025D840, MP 0x14032E720 + { 0x8092, "_meth_8092" }, // SP 0x14024CFF0, MP 0x14031B370 + { 0x8093, "_meth_8093" }, // SP 0x14025F470 + { 0x8094, "_meth_8094" }, // SP 0x14025F510 + { 0x8095, "getorigin" }, // SP 0x14025F5B0, MP 0x14032F8B0 + { 0x8096, "_meth_8096" }, // SP 0x14025F660 + { 0x8097, "_meth_8097" }, // SP 0x14025F750 + { 0x8098, "_meth_8098" }, // SP 0x1402608B0 + { 0x8099, "_meth_8099" }, // SP 0x1402608F0, MP 0x14032FA40 + { 0x809A, "playsound" }, // SP 0x140261150, MP 0x14032FDA0 + { 0x809B, "_meth_809B" }, // empty + { 0x809C, "_meth_809C" }, // empty + { 0x809D, "_meth_809D" }, // empty + { 0x809E, "_meth_809E" }, // empty + { 0x809F, "_meth_809F" }, // SP 0x140250780, MP 0x14031BA70 + { 0x80A0, "_meth_80A0" }, // SP 0x140250BF0, MP 0x14031C050 + { 0x80A1, "_meth_80A1" }, // SP 0x140251060, MP 0x14031C510 + { 0x80A2, "_meth_80A2" }, // SP 0x14023E070, MP 0x14031DF10 + { 0x80A3, "_meth_80A3" }, // SP 0x14023E810, MP 0x14031E4E0 + { 0x80A4, "_meth_80A4" }, // SP 0x14023EEC0 + { 0x80A5, "_meth_80A5" }, // SP 0x14023F740 + { 0x80A6, "_meth_80A6" }, // SP 0x1402404F0 + { 0x80A7, "_meth_80A7" }, // SP 0x140240D80 + { 0x80A8, "_meth_80A8" }, // SP 0x140247240, MP 0x14030ED30 + { 0x80A9, "_meth_80A9" }, // SP 0x1402505C0, MP 0x1403199D0 + { 0x80AA, "_meth_80AA" }, // SP 0x140250830, MP 0x140319CB0 + { 0x80AB, "_meth_80AB" }, // SP 0x140241D60, MP 0x1403209F0 + { 0x80AC, "_meth_80AC" }, // SP 0x140251210, MP 0x14031AA20 + { 0x80AD, "_meth_80AD" }, // SP 0x1402421E0, MP 0x140320FB0 + { 0x80AE, "_meth_80AE" }, // SP 0x140242250, MP 0x1403210A0 + { 0x80AF, "_meth_80AF" }, // SP 0x140242AE0, MP 0x1403216E0 + { 0x80B0, "delete" }, + { 0x80B1, "_meth_80B1" }, // SP 0x140245F70, MP 0x14030F8D0 + { 0x80B2, "_meth_80B2" }, // SP 0x140242F40, MP 0x140320CF0 + { 0x80B3, "_meth_80B3" }, // SP 0x140243250, MP 0x1403211B0 + { 0x80B4, "_meth_80B4" }, // empty + { 0x80B5, "_meth_80B5" }, // empty + { 0x80B6, "thermalvisionon" }, // SP 0x1402434E0, MP 0x1403213B0 + { 0x80B7, "thermalvisionoff" }, // SP 0x140243990, MP 0x1403218A0 + { 0x80B8, "thermalvisionfofoverlayon" }, // SP 0x140245650, MP 0x14030C6E0 + { 0x80B9, "thermalvisionfofoverlayoff" }, // SP 0x140245A30, MP 0x14030CA30 + { 0x80BA, "autospotoverlayon" }, // MP 0x14030CE40 + { 0x80BB, "autospotoverlayoff" }, // MP 0x14030CFB0 + { 0x80BC, "seteyesonuplinkenabled" }, // MP 0x14030D220 + { 0x80BD, "_meth_80BD" }, // empty + { 0x80BE, "setcontents" }, // SP 0x140240E60, MP 0x14031E770 + { 0x80BF, "makeusable" }, // SP 0x140240F70, MP 0x14031E9D0 + { 0x80C0, "makeunusable" }, // SP 0x140241270, MP 0x14031EBA0 + { 0x80C1, "_meth_80C1" }, // SP 0x14024E190, MP 0x14031C420 + { 0x80C2, "_meth_80C2" }, // SP 0x14024E8E0, MP 0x14031C9C0 + { 0x80C3, "_meth_80C3" }, // SP 0x140213270 + { 0x80C4, "_meth_80C4" }, // SP 0x140218180 + { 0x80C5, "_meth_80C5" }, // SP 0x140415BF0 + { 0x80C6, "_meth_80C6" }, // SP 0x140413E10 + { 0x80C7, "_meth_80C7" }, // SP 0x140415A50 + { 0x80C8, "_meth_80C8" }, // SP 0x140415AE0 + { 0x80C9, "_meth_80C9" }, // SP 0x140415390 + { 0x80CA, "settext" }, // SP 0x14021DE70, MP 0x1402EE7C0 + { 0x80CB, "_meth_80CB" }, // MP 0x1402EE880 + { 0x80CC, "_meth_80CC" }, // SP 0x14021DF30, MP 0x1402EE890 + { 0x80CD, "_meth_80CD" }, // SP 0x14021E050, MP 0x1402EE990 + { 0x80CE, "_meth_80CE" }, // SP 0x14021E1D0, MP 0x1402EEB10 + { 0x80CF, "_meth_80CF" }, // SP 0x14021E2B0, MP 0x1402EEBE0 + { 0x80D0, "_meth_80D0" }, // SP 0x14021E380, MP 0x1402EEC90 + { 0x80D1, "_meth_80D1" }, // SP 0x14021E450, MP 0x1402EED30 + { 0x80D2, "_meth_80D2" }, // SP 0x14021E510, MP 0x1402EEDE0 + { 0x80D3, "_meth_80D3" }, // SP 0x14021E5E0, MP 0x1402EEE90 + { 0x80D4, "_meth_80D4" }, // SP 0x14021E6B0, MP 0x1402EEF30 + { 0x80D5, "_meth_80D5" }, // SP 0x14021E770, MP 0x1402EEFE0 + { 0x80D6, "_meth_80D6" }, // SP 0x14021E790, MP 0x1402EF000 + { 0x80D7, "_meth_80D7" }, // SP 0x14021E7B0, MP 0x1402EF020 + { 0x80D8, "_meth_80D8" }, // SP 0x14021E850, MP 0x1402EF0A0 + { 0x80D9, "_meth_80D9" }, // SP 0x14021E9C0, MP 0x1402EF1A0 + { 0x80DA, "_meth_80DA" }, // SP 0x140241840, MP 0x14031F3A0 + { 0x80DB, "_meth_80DB" }, // SP 0x140241FF0, MP 0x140320400 + { 0x80DC, "_meth_80DC" }, // MP 0x140328620 + { 0x80DD, "_meth_80DD" }, // SP 0x140242550, MP 0x140320750 + { 0x80DE, "_meth_80DE" }, // SP 0x1402428C0, MP 0x1403208F0 + { 0x80DF, "_meth_80DF" }, // SP 0x1402413D0, MP 0x14031ED80 + { 0x80E0, "_meth_80E0" }, // SP 0x1402414A0, MP 0x14031EE50 + { 0x80E1, "_meth_80E1" }, // MP 0x14031EFA0 + { 0x80E2, "_meth_80E2" }, // SP 0x140251410, MP 0x14031B620 + { 0x80E3, "_meth_80E3" }, // SP 0x1402514F0, MP 0x14031B800 + { 0x80E4, "_meth_80E4" }, // SP 0x1402517C0, MP 0x14031B980 + { 0x80E5, "_meth_80E5" }, // SP 0x140251950, MP 0x14031BC70 + { 0x80E6, "_meth_80E6" }, // SP 0x140251A60, MP 0x14031BDC0 + { 0x80E7, "_meth_80E7" }, // SP 0x140251C20, MP 0x14031C0E0 + { 0x80E8, "_meth_80E8" }, // MP 0x14031AAA0 + { 0x80E9, "_meth_80E9" }, // MP 0x14031B2E0 + { 0x80EA, "_meth_80EA" }, // SP 0x140253FC0, MP 0x14031D3A0 + { 0x80EB, "_meth_80EB" }, // SP 0x1402540B0, MP 0x14031D4F0 + { 0x80EC, "_meth_80EC" }, // SP 0x140219C40 + { 0x80ED, "_meth_80ED" }, // SP 0x140219CA0 + { 0x80EE, "_meth_80EE" }, // SP 0x140219CF0 + { 0x80EF, "_meth_80EF" }, // SP 0x140219D40 + { 0x80F0, "_meth_80F0" }, // SP 0x140219DA0 + { 0x80F1, "_meth_80F1" }, // SP 0x140219E00 + { 0x80F2, "_meth_80F2" }, // SP 0x140219E50 + { 0x80F3, "_meth_80F3" }, // SP 0x14021A1A0 + { 0x80F4, "_meth_80F4" }, // SP 0x14021A370 + { 0x80F5, "_meth_80F5" }, // SP 0x14021A3D0 + { 0x80F6, "_meth_80F6" }, // SP 0x14021A430 + { 0x80F7, "_meth_80F7" }, // SP 0x14021A4C0 + { 0x80F8, "_meth_80F8" }, // SP 0x14021A570 + { 0x80F9, "_meth_80F9" }, // SP 0x140217650, MP 0x1402DF4D0 + { 0x80FA, "_meth_80FA" }, // SP 0x140219F40 + { 0x80FB, "_meth_80FB" }, // SP 0x140219F90 + { 0x80FC, "_meth_80FC" }, // SP 0x14021A060 + { 0x80FD, "_meth_80FD" }, // SP 0x14021A0F0 + { 0x80FE, "_meth_80FE" }, // SP 0x140215C90, MP 0x1402DDB00 + { 0x80FF, "_meth_80FF" }, // SP 0x140215F00, MP 0x1402DDCC0 + { 0x8100, "_meth_8100" }, // SP 0x140219FE0 + { 0x8101, "_meth_8101" }, // SP 0x140215910 + { 0x8102, "_meth_8102" }, // SP 0x140212F60 + { 0x8103, "_meth_8103" }, // SP 0x140254700, MP 0x14031D800 + { 0x8104, "_meth_8104" }, // SP 0x14023DFE0, MP 0x14031DAD0 + { 0x8105, "_meth_8105" }, // SP 0x14023E530, MP 0x14031E310 + { 0x8106, "_meth_8106" }, // SP 0x14023E6A0, MP 0x14031E440 + { 0x8107, "_meth_8107" }, // SP 0x14023EAF0, MP 0x14031E4F0 + { 0x8108, "_meth_8108" }, // SP 0x14023EDF0, MP 0x14031EA50 + { 0x8109, "_meth_8109" }, // SP 0x14023F010, MP 0x14031EB10 + { 0x810A, "_meth_810A" }, // SP 0x14023FD90, MP 0x1403202F0 + { 0x810B, "_meth_810B" }, // SP 0x14023FF60, MP 0x140320350 + { 0x810C, "_meth_810C" }, // SP 0x14023FFC0, MP 0x1403204D0 + { 0x810D, "_meth_810D" }, // SP 0x14023B180 + { 0x810E, "_meth_810E" }, // SP 0x14023B1A0 + { 0x810F, "_meth_810F" }, // SP 0x14023B1C0 + { 0x8110, "_meth_8110" }, // SP 0x14023B1E0 + { 0x8111, "_meth_8111" }, // SP 0x14023B200 + { 0x8112, "_meth_8112" }, // SP 0x14023B220 + { 0x8113, "_meth_8113" }, // SP 0x14023B230 + { 0x8114, "_meth_8114" }, // SP 0x14023B250 + { 0x8115, "_meth_8115" }, // SP 0x14023B270 + { 0x8116, "_meth_8116" }, // SP 0x14023B340 + { 0x8117, "_meth_8117" }, // SP 0x14023B3C0 + { 0x8118, "_meth_8118" }, // SP 0x1402160E0, MP 0x1402DD450 + { 0x8119, "_meth_8119" }, // SP 0x1402161D0, MP 0x1402DD5C0 + { 0x811A, "_meth_811A" }, // SP 0x140216340, MP 0x1402DD8C0 + { 0x811B, "_meth_811B" }, // SP 0x1402163A0, MP 0x1402DD9E0 + { 0x811C, "_meth_811C" }, // SP 0x140219080 + { 0x811D, "_meth_811D" }, // SP 0x140219500 + { 0x811E, "_meth_811E" }, // empty + { 0x811F, "_meth_811F" }, // SP 0x1402192C0 + { 0x8120, "_meth_8120" }, // SP 0x140219340 + { 0x8121, "_meth_8121" }, // SP 0x140219670 + { 0x8122, "_meth_8122" }, // empty + { 0x8123, "_meth_8123" }, // empty + { 0x8124, "_meth_8124" }, // empty + { 0x8125, "_meth_8125" }, // empty + { 0x8126, "_meth_8126" }, // empty + { 0x8127, "_meth_8127" }, // SP 0x140219360 + { 0x8128, "_meth_8128" }, // SP 0x1402196C0 + { 0x8129, "_meth_8129" }, // SP 0x1402197F0 + { 0x812A, "_meth_812A" }, // SP 0x1402191E0 + { 0x812B, "_meth_812B" }, // SP 0x1402198A0 + { 0x812C, "_meth_812C" }, // SP 0x140213E10, MP 0x1402E3B60 + { 0x812D, "_meth_812D" }, // SP 0x1402140A0, MP 0x1402E3EE0 + { 0x812E, "_meth_812E" }, // SP 0x140217B90, MP 0x1402DFB80 + { 0x812F, "_meth_812F" }, // SP 0x140219B70 + { 0x8130, "_meth_8130" }, // SP 0x140215F20, MP 0x1402DD080 + { 0x8131, "_meth_8131" }, // SP 0x140216000, MP 0x1402DD240 + { 0x8132, "_meth_8132" }, // SP 0x140219BE0 + { 0x8133, "_meth_8133" }, // SP 0x140240030, MP 0x1403205E0 + { 0x8134, "_meth_8134" }, // SP 0x140240460, MP 0x140320960 + { 0x8135, "_meth_8135" }, // SP 0x1402406F0, MP 0x140320BB0 + { 0x8136, "_meth_8136" }, // SP 0x140240B10, MP 0x140320DB0 + { 0x8137, "_meth_8137" }, // SP 0x140240BE0, MP 0x140321050 + { 0x8138, "_meth_8138" }, // SP 0x140240C90, MP 0x140321160 + { 0x8139, "_meth_8139" }, // SP 0x14028A2E0, MP 0x140043790 + { 0x813A, "_meth_813A" }, // SP 0x14028A3F0, MP 0x1400438C0 + { 0x813B, "_meth_813B" }, // SP 0x14028A4F0 + { 0x813C, "_meth_813C" }, // SP 0x14028A550 + { 0x813D, "_meth_813D" }, // SP 0x14028A5F0 + { 0x813E, "_meth_813E" }, // SP 0x14023AE00 + { 0x813F, "_meth_813F" }, // empty + { 0x8140, "_meth_8140" }, // SP 0x14023AE40 + { 0x8141, "_meth_8141" }, // SP 0x14023ADE0 + { 0x8142, "_meth_8142" }, // SP 0x14023AE80 + { 0x8143, "_meth_8143" }, // SP 0x14023AF00 + { 0x8144, "_meth_8144" }, // SP 0x14023AF20 + { 0x8145, "_meth_8145" }, // SP 0x14023AF30 + { 0x8146, "_meth_8146" }, // SP 0x14023AF50 + { 0x8147, "_meth_8147" }, // SP 0x14023AF70 + { 0x8148, "_meth_8148" }, // SP 0x14023AF90 + { 0x8149, "_meth_8149" }, // SP 0x14023AFA0 + { 0x814A, "_meth_814A" }, // SP 0x14023AFC0 + { 0x814B, "_meth_814B" }, // SP 0x14023AFE0 + { 0x814C, "_meth_814C" }, // SP 0x14023B000 + { 0x814D, "_meth_814D" }, // SP 0x14023B010 + { 0x814E, "_meth_814E" }, // SP 0x14023B030 + { 0x814F, "_meth_814F" }, // SP 0x14023B050 + { 0x8150, "_meth_8150" }, // SP 0x14023B0C0 + { 0x8151, "_meth_8151" }, // SP 0x14023B100 + { 0x8152, "_meth_8152" }, // SP 0x14023B150 + { 0x8153, "_meth_8153" }, // SP 0x14023B170 + { 0x8154, "_meth_8154" }, // MP 0x140321240 + { 0x8155, "_meth_8155" }, // SP 0x140240EC0, MP 0x140321340 + { 0x8156, "_meth_8156" }, // SP 0x140241210, MP 0x1403214C0 + { 0x8157, "_meth_8157" }, // SP 0x1402414F0, MP 0x140321810 + { 0x8158, "_meth_8158" }, // SP 0x140241A10, MP 0x140321B90 + { 0x8159, "_meth_8159" }, // SP 0x140241B20, MP 0x140321D30 + { 0x815A, "_meth_815A" }, // SP 0x140241DB0, MP 0x140321F10 + { 0x815B, "_meth_815B" }, // SP 0x140241EE0, MP 0x140322220 + { 0x815C, "_meth_815C" }, // SP 0x140242100, MP 0x140322280 + { 0x815D, "_meth_815D" }, // SP 0x1401FA0E0 + { 0x815E, "_meth_815E" }, // SP 0x1401FA140 + { 0x815F, "_meth_815F" }, // SP 0x1401FA1D0 + { 0x8160, "_meth_8160" }, // SP 0x1401FA2C0 + { 0x8161, "_meth_8161" }, // SP 0x1401FA410 + { 0x8162, "_meth_8162" }, // SP 0x1401FA4E0 + { 0x8163, "_meth_8163" }, // SP 0x1401FA520 + { 0x8164, "_meth_8164" }, // SP 0x1401FA5E0 + { 0x8165, "_meth_8165" }, // SP 0x140216A60, MP 0x1402DE3C0 + { 0x8166, "_meth_8166" }, // SP 0x1401FA6B0 + { 0x8167, "_meth_8167" }, // SP 0x1401FA800 + { 0x8168, "_meth_8168" }, // SP 0x1401FAA20 + { 0x8169, "_meth_8169" }, // SP 0x1401FAB60 + { 0x816A, "_meth_816A" }, // SP 0x1401FAC30 + { 0x816B, "_meth_816B" }, // SP 0x1401FACF0 + { 0x816C, "_meth_816C" }, // SP 0x1401FADB0 + { 0x816D, "_meth_816D" }, // SP 0x1401FAE90 + { 0x816E, "_meth_816E" }, // SP 0x1401FAF60 + { 0x816F, "_meth_816F" }, // SP 0x1401FB040 + { 0x8170, "_meth_8170" }, // SP 0x1401FB1C0 + { 0x8171, "_meth_8171" }, // SP 0x1401FB3F0 + { 0x8172, "_meth_8172" }, // SP 0x1401FB450 + { 0x8173, "_meth_8173" }, // SP 0x1401FB4B0 + { 0x8174, "_meth_8174" }, // SP 0x1401FB6A0 + { 0x8175, "_meth_8175" }, // SP 0x140289C60, MP 0x140043A30 + { 0x8176, "_meth_8176" }, // SP 0x140289CA0, MP 0x140043A70 + { 0x8177, "_meth_8177" }, // SP 0x14028A070, MP 0x140043530 + { 0x8178, "_meth_8178" }, // SP 0x14028A0E0, MP 0x1400435A0 + { 0x8179, "_meth_8179" }, // SP 0x140242200, MP 0x1403223F0 + { 0x817A, "_meth_817A" }, // SP 0x140242770, MP 0x14030B350 + { 0x817B, "_meth_817B" }, // SP 0x140240C30, MP 0x14031ED20 + { 0x817C, "_meth_817C" }, // SP 0x1402463F0, MP 0x14030D7B0 + { 0x817D, "_meth_817D" }, // SP 0x140246590, MP 0x14030DBC0 + { 0x817E, "_meth_817E" }, // SP 0x140243390, MP 0x140321DC0 + { 0x817F, "getammocount" }, // SP 0x140243890, MP 0x1403222E0 + { 0x8180, "gettagorigin" }, // SP 0x140247970, MP 0x140310980 + { 0x8181, "gettagangles" }, // SP 0x140247B80, MP 0x140310DF0 + { 0x8182, "shellshock" }, // SP 0x14024E6A0, MP 0x140315CD0 + { 0x8183, "stunplayer" }, // SP 0x14024EC90, MP 0x1403166C0 + { 0x8184, "stopshellshock" }, // SP 0x1402456B0, MP 0x14030EA40 + { 0x8185, "_meth_8185" }, // SP 0x140245940, MP 0x14030EDE0 + { 0x8186, "_meth_8186" }, // SP 0x1402485C0, MP 0x140311860 + { 0x8187, "_meth_8187" }, // SP 0x140249170, MP 0x140312070 + { 0x8188, "_meth_8188" }, // SP 0x14024A6A0, MP 0x140313930 + { 0x8189, "_meth_8189" }, // SP 0x1401F88F0 + { 0x818A, "_meth_818A" }, // SP 0x1401F8940 + { 0x818B, "_meth_818B" }, // SP 0x1401F89B0 + { 0x818C, "_meth_818C" }, // SP 0x1401F89F0 + { 0x818D, "_meth_818D" }, // SP 0x1401F8A60 + { 0x818E, "_meth_818E" }, // SP 0x1401F8AF0 + { 0x818F, "_meth_818F" }, // SP 0x1401F8CC0 + { 0x8190, "_meth_8190" }, // SP 0x1401F9000 + { 0x8191, "_meth_8191" }, // SP 0x1401F90F0 + { 0x8192, "_meth_8192" }, // SP 0x1401F9140 + { 0x8193, "_meth_8193" }, // SP 0x1401F9190 + { 0x8194, "_meth_8194" }, // SP 0x1401F91F0 + { 0x8195, "_meth_8195" }, // SP 0x1401F9240 + { 0x8196, "_meth_8196" }, // empty + { 0x8197, "_meth_8197" }, // empty + { 0x8198, "_meth_8198" }, // empty + { 0x8199, "_meth_8199" }, // empty + { 0x819A, "_meth_819A" }, // SP 0x1401F93F0 + { 0x819B, "_meth_819B" }, // SP 0x1401F94A0 + { 0x819C, "_meth_819C" }, // SP 0x1401F94F0 + { 0x819D, "_meth_819D" }, // SP 0x1401F95A0, MP 0x140405900 + { 0x819E, "_meth_819E" }, // SP 0x1401F9610, MP 0x1404057C0 + { 0x819F, "_meth_819F" }, // SP 0x1401F9680, MP 0x140405860 + { 0x81A0, "_meth_81A0" }, // SP 0x1401F9700 + { 0x81A1, "_meth_81A1" }, // SP 0x1401F97A0 + { 0x81A2, "_meth_81A2" }, // SP 0x1401F9890 + { 0x81A3, "_meth_81A3" }, // SP 0x1401F99A0 + { 0x81A4, "_meth_81A4" }, // SP 0x1401F8320 + { 0x81A5, "_meth_81A5" }, // SP 0x1401F9A60 + { 0x81A6, "_meth_81A6" }, // SP 0x1401F9AD0 + { 0x81A7, "_meth_81A7" }, // SP 0x1401F9B30 + { 0x81A8, "_meth_81A8" }, // SP 0x1401F9BD0 + { 0x81A9, "_meth_81A9" }, // SP 0x1401F9CE0 + { 0x81AA, "_meth_81AA" }, // SP 0x1401F9E40 + { 0x81AB, "_meth_81AB" }, // SP 0x1401F9EF0 + { 0x81AC, "_meth_81AC" }, // SP 0x1401FA030 + { 0x81AD, "_meth_81AD" }, // MP 0x1403139F0 + { 0x81AE, "_meth_81AE" }, // MP 0x140313A00 + { 0x81AF, "_meth_81AF" }, // SP 0x14024A700, MP 0x140313A40 + { 0x81B0, "_meth_81B0" }, // SP 0x140245090, MP 0x14030DE80 + { 0x81B1, "_meth_81B1" }, // SP 0x140243090, MP 0x14030BDA0 + { 0x81B2, "_meth_81B2" }, // SP 0x1402431F0, MP 0x14030C0D0 + { 0x81B3, "_meth_81B3" }, // SP 0x140243540, MP 0x14030C490 + { 0x81B4, "_meth_81B4" }, // SP 0x140243630, MP 0x14030C690 + { 0x81B5, "enableaimassist" }, // SP 0x140244720, MP 0x14030D830 + { 0x81B6, "_meth_81B6" }, // SP 0x1401FBB30 + { 0x81B7, "_meth_81B7" }, // SP 0x1401FBC20 + { 0x81B8, "_meth_81B8" }, // SP 0x1401FBDD0 + { 0x81B9, "_meth_81B9" }, // SP 0x1401FBE40 + { 0x81BA, "_meth_81BA" }, // SP 0x1401FBFA0 + { 0x81BB, "_meth_81BB" }, // SP 0x1401FC260 + { 0x81BC, "_meth_81BC" }, // SP 0x1401FC390 + { 0x81BD, "_meth_81BD" }, // SP 0x1401FC470 + { 0x81BE, "_meth_81BE" }, // SP 0x1401FC4E0 + { 0x81BF, "_meth_81BF" }, // SP 0x1401FC590 + { 0x81C0, "_meth_81C0" }, // SP 0x14028A440, MP 0x140043920 + { 0x81C1, "_meth_81C1" }, // SP 0x14028A4A0, MP 0x140043980 + { 0x81C2, "_meth_81C2" }, // SP 0x1401FC6E0 + { 0x81C3, "_meth_81C3" }, // SP 0x1401FC960 + { 0x81C4, "_meth_81C4" }, // SP 0x1401FCA70 + { 0x81C5, "_meth_81C5" }, // SP 0x1401F7D80 + { 0x81C6, "_meth_81C6" }, // SP 0x1401F7D90 + { 0x81C7, "_meth_81C7" }, // SP 0x1401F7DB0 + { 0x81C8, "_meth_81C8" }, // SP 0x1401F7DD0 + { 0x81C9, "_meth_81C9" }, // SP 0x1401F7E30 + { 0x81CA, "_meth_81CA" }, // SP 0x1401F7EA0 + { 0x81CB, "_meth_81CB" }, // SP 0x1401F7F70 + { 0x81CC, "_meth_81CC" }, // SP 0x1401F8060 + { 0x81CD, "_meth_81CD" }, // SP 0x1401F80A0 + { 0x81CE, "_meth_81CE" }, // SP 0x1401F80E0 + { 0x81CF, "_meth_81CF" }, // SP 0x1401F8120 + { 0x81D0, "_meth_81D0" }, // SP 0x1401F81B0 + { 0x81D1, "_meth_81D1" }, // SP 0x1401F8760 + { 0x81D2, "_meth_81D2" }, // SP 0x1401F8840 + { 0x81D3, "_meth_81D3" }, // SP 0x1401F84A0 + { 0x81D4, "disableaimassist" }, // SP 0x140244FB0, MP 0x14030D9F0 + { 0x81D5, "entityradiusdamage" }, // SP 0x14024D100, MP 0x140314A00 + { 0x81D6, "detonate" }, // SP 0x14024D910, MP 0x140315900 + { 0x81D7, "_meth_81D7" }, // SP 0x14024E310, MP 0x140315C70 + { 0x81D8, "_meth_81D8" }, // SP 0x14024E5F0, MP 0x140315CB0 + { 0x81D9, "_meth_81D9" }, // SP 0x140243A40, MP 0x14030CC10 + { 0x81DA, "_meth_81DA" }, // SP 0x140243D70, MP 0x14030CEF0 + { 0x81DB, "_meth_81DB" }, // SP 0x140244000, MP 0x14030D060 + { 0x81DC, "_meth_81DC" }, // SP 0x1402441D0, MP 0x14030D460 + { 0x81DD, "_meth_81DD" }, // SP 0x1402443E0, MP 0x14030D4E0 + { 0x81DE, "_meth_81DE" }, // SP 0x14024D440, MP 0x140316020 + { 0x81DF, "_meth_81DF" }, // SP 0x14024D640, MP 0x140316100 + { 0x81E0, "_meth_81E0" }, // SP 0x14024DFF0, MP 0x140316750 + { 0x81E1, "_meth_81E1" }, // SP 0x14024CA40, MP 0x140316610 + { 0x81E2, "_meth_81E2" }, // SP 0x14024EA40, MP 0x140317330 + { 0x81E3, "_meth_81E3" }, // SP 0x14024ED90, MP 0x140317710 + { 0x81E4, "_meth_81E4" }, // SP 0x1401F9DC0 + { 0x81E5, "_meth_81E5" }, // SP 0x1401F9E00 + { 0x81E6, "_meth_81E6" }, // SP 0x1401F9E90 + { 0x81E7, "_meth_81E7" }, // SP 0x1401F9F40 + { 0x81E8, "_meth_81E8" }, // SP 0x1401FA250 + { 0x81E9, "_meth_81E9" }, // SP 0x1401FA390 + { 0x81EA, "_meth_81EA" }, // SP 0x1401FA560 + { 0x81EB, "_meth_81EB" }, // SP 0x1401FA660 + { 0x81EC, "_meth_81EC" }, // SP 0x1401FA7A0 + { 0x81ED, "_meth_81ED" }, // SP 0x1401FA940 + { 0x81EE, "_meth_81EE" }, // SP 0x1401FA980 + { 0x81EF, "_meth_81EF" }, // SP 0x1401FA9D0 + { 0x81F0, "_meth_81F0" }, // SP 0x1401FAAD0 + { 0x81F1, "_meth_81F1" }, // SP 0x1401FABC0 + { 0x81F2, "_meth_81F2" }, // SP 0x1401FAC90 + { 0x81F3, "_meth_81F3" }, // SP 0x1401FAD40 + { 0x81F4, "_meth_81F4" }, // SP 0x1401FAF00 + { 0x81F5, "_meth_81F5" }, // SP 0x1401FAFE0 + { 0x81F6, "_meth_81F6" }, // SP 0x1401FAE20 + { 0x81F7, "_meth_81F7" }, // SP 0x1401FB0B0 + { 0x81F8, "_meth_81F8" }, // SP 0x1401FB0F0 + { 0x81F9, "_meth_81F9" }, // SP 0x1401FB290 + { 0x81FA, "_meth_81FA" }, // SP 0x1401FB2F0 + { 0x81FB, "_meth_81FB" }, // SP 0x1401FB520 + { 0x81FC, "_meth_81FC" }, // SP 0x1401FB800 + { 0x81FD, "_meth_81FD" }, // SP 0x1401FBA00 + { 0x81FE, "_meth_81FE" }, // SP 0x1401FBAA0 + { 0x81FF, "_meth_81FF" }, // SP 0x1401FBC90 + { 0x8200, "_meth_8200" }, // SP 0x14024F360, MP 0x140317BF0 + { 0x8201, "_meth_8201" }, // SP 0x14024F730, MP 0x1403180F0 + { 0x8202, "_meth_8202" }, // MP 0x140319E80 + { 0x8203, "_meth_8203" }, // SP 0x14025EDF0 + { 0x8204, "_meth_8204" }, // MP 0x14031A0D0 + { 0x8205, "_meth_8205" }, // empty + { 0x8206, "_meth_8206" }, // MP 0x14031A490 + { 0x8207, "_meth_8207" }, // MP 0x14031AB60 + { 0x8208, "_meth_8208" }, // MP 0x14031BCC0 + { 0x8209, "_meth_8209" }, // MP 0x14031B170 + { 0x820A, "_meth_820A" }, // MP 0x14031B590 + { 0x820B, "_meth_820B" }, // SP 0x140250DB0, MP 0x14031CEA0 + { 0x820C, "_meth_820C" }, // SP 0x140251290, MP 0x14031D310 + { 0x820D, "_meth_820D" }, // SP 0x1402516C0, MP 0x14031D770 + { 0x820E, "_meth_820E" }, // SP 0x140252870, MP 0x14031DD50 + { 0x820F, "_meth_820F" }, // SP 0x140253220, MP 0x14031E830 + { 0x8210, "_meth_8210" }, // SP 0x14023F0A0, MP 0x1403208A0 + { 0x8211, "_meth_8211" }, // SP 0x14023F1E0, MP 0x140320A40 + { 0x8212, "_meth_8212" }, // SP 0x14023F6D0, MP 0x140320CE0 + { 0x8213, "_meth_8213" }, // SP 0x14023F800, MP 0x140320DA0 + { 0x8214, "_meth_8214" }, // SP 0x1402416F0, MP 0x14030B690 + { 0x8215, "_meth_8215" }, // SP 0x140241BB0, MP 0x14030BDF0 + { 0x8216, "_meth_8216" }, // SP 0x140242150, MP 0x14030C520 + { 0x8217, "_meth_8217" }, // SP 0x140242810, MP 0x14030CD20 + { 0x8218, "_meth_8218" }, // SP 0x14024EDE0, MP 0x140317890 + { 0x8219, "_meth_8219" }, // SP 0x14024B390 + { 0x821A, "_meth_821A" }, // SP 0x14024B900 + { 0x821B, "_meth_821B" }, // SP 0x14023FA90, MP 0x140320E80 + { 0x821C, "_meth_821C" }, // SP 0x140240100, MP 0x1403215A0 + { 0x821D, "setempjammed" }, // SP 0x140240590, MP 0x140321B00 + { 0x821E, "_meth_821E" }, // SP 0x140242D40, MP 0x14030BB10 + { 0x821F, "_meth_821F" }, // SP 0x140242B70, MP 0x14030B880 + { 0x8220, "_meth_8220" }, // SP 0x1402432C0, MP 0x14030C370 + { 0x8221, "_meth_8221" }, // SP 0x140247E60, MP 0x14030FA70 + { 0x8222, "_meth_8222" }, // SP 0x14024B550, MP 0x140315C90 + { 0x8223, "_meth_8223" }, // SP 0x14024B740, MP 0x140316000 + { 0x8224, "_meth_8224" }, // SP 0x14024BDE0, MP 0x1403166A0 + { 0x8225, "_meth_8225" }, // SP 0x14024C1B0, MP 0x140316920 + { 0x8226, "_meth_8226" }, // SP 0x14024CCD0, MP 0x140317120 + { 0x8227, "_meth_8227" }, // SP 0x1404146A0, MP 0x140528A90 + { 0x8228, "_meth_8228" }, // SP 0x140414780, MP 0x140528B10 + { 0x8229, "_meth_8229" }, // SP 0x1404149B0, MP 0x140528D80 + { 0x822A, "_meth_822A" }, // SP 0x140414B10, MP 0x140528EA0 + { 0x822B, "_meth_822B" }, // SP 0x140414BE0, MP 0x140528F90 + { 0x822C, "crash" }, // SP 0x140414C80, MP 0x140529090 + { 0x822D, "launch" }, // SP 0x140414DC0, MP 0x1405291B0 + { 0x822E, "_meth_822E" }, // SP 0x140414F60, MP 0x1405292C0 + { 0x822F, "_meth_822F" }, // SP 0x140414FF0, MP 0x1405293B0 + { 0x8230, "_meth_8230" }, // SP 0x1404150D0, MP 0x140529470 + { 0x8231, "_meth_8231" }, // SP 0x140415290, MP 0x1405296E0 + { 0x8232, "_meth_8232" }, // MP 0x14052B310 + { 0x8233, "_meth_8233" }, // SP 0x1402513B0 + { 0x8234, "_meth_8234" }, // SP 0x140251610 + { 0x8235, "_meth_8235" }, // SP 0x140252020 + { 0x8236, "_meth_8236" }, // SP 0x1402523C0 + { 0x8237, "_meth_8237" }, // SP 0x140252B10 + { 0x8238, "_meth_8238" }, // SP 0x140252DA0 + { 0x8239, "_meth_8239" }, // SP 0x140245BB0 + { 0x823A, "_meth_823A" }, // SP 0x140245CB0 + { 0x823B, "_meth_823B" }, // SP 0x140245F20 + { 0x823C, "_meth_823C" }, // SP 0x1402461E0 + { 0x823D, "_meth_823D" }, // SP 0x140252090 + { 0x823E, "_meth_823E" }, // SP 0x140252500 + { 0x823F, "_meth_823F" }, // empty + { 0x8240, "_meth_8240" }, // SP 0x14024F7E0 + { 0x8241, "_meth_8241" }, // SP 0x1401F9A00 + { 0x8242, "_meth_8242" }, // SP 0x1401F9C50 + { 0x8243, "_meth_8243" }, // SP 0x14024B6A0, MP 0x140315EF0 + { 0x8244, "_meth_8244" }, // SP 0x14024B980, MP 0x140316260 + { 0x8245, "_meth_8245" }, // SP 0x14024BFF0, MP 0x1403167A0 + { 0x8246, "_meth_8246" }, // SP 0x14024C710, MP 0x140316CC0 + { 0x8247, "_meth_8247" }, // SP 0x14024CE90, MP 0x140317520 + { 0x8248, "_meth_8248" }, // SP 0x14024DE10, MP 0x140318420 + { 0x8249, "_meth_8249" }, // SP 0x14024E3A0, MP 0x140318D50 + { 0x824A, "_meth_824A" }, // SP 0x1402501D0, MP 0x14031A3F0 + { 0x824B, "_meth_824B" }, // MP 0x1402E6DB0 + { 0x824C, "_meth_824C" }, // SP 0x140218FD0, MP 0x1402E6DA0 + { 0x824D, "_meth_824D" }, // MP 0x1402E84D0 + { 0x824E, "_meth_824E" }, // MP 0x1402E8560 + { 0x824F, "_meth_824F" }, // MP 0x1402E6E20 + { 0x8250, "_meth_8250" }, // SP 0x140211A10, MP 0x1402E1160 + { 0x8251, "_meth_8251" }, // MP 0x1402E7190 + { 0x8252, "_meth_8252" }, // SP 0x140416B50, MP 0x14052AFB0 + { 0x8253, "_meth_8253" }, // SP 0x140416C20, MP 0x14052B080 + { 0x8254, "_meth_8254" }, // SP 0x140416D40, MP 0x14052B120 + { 0x8255, "_meth_8255" }, // SP 0x140416F20 + { 0x8256, "_meth_8256" }, // SP 0x140416FD0, MP 0x14052B380 + { 0x8257, "_meth_8257" }, // SP 0x140417220, MP 0x14052B5D0 + { 0x8258, "_meth_8258" }, // SP 0x1404172A0, MP 0x14052B650 + { 0x8259, "_meth_8259" }, // SP 0x140417330, MP 0x14052B6E0 + { 0x825A, "_meth_825A" }, // SP 0x1404173B0, MP 0x14052B850 + { 0x825B, "_meth_825B" }, // SP 0x140417420, MP 0x14052B8C0 + { 0x825C, "_meth_825C" }, // SP 0x140417510, MP 0x14052B9C0 + { 0x825D, "_meth_825D" }, // SP 0x1404175A0, MP 0x14052BA50 + { 0x825E, "_meth_825E" }, // SP 0x140417620, MP 0x14052BAD0 + { 0x825F, "_meth_825F" }, // SP 0x1404176B0, MP 0x14052BB60 + { 0x8260, "_meth_8260" }, // SP 0x140417730, MP 0x14052BBE0 + { 0x8261, "_meth_8261" }, // SP 0x140413720, MP 0x140527C80 + { 0x8262, "_meth_8262" }, // SP 0x140413810, MP 0x140527D70 + { 0x8263, "_meth_8263" }, // SP 0x140413910, MP 0x140527E70 + { 0x8264, "_meth_8264" }, // SP 0x1404139A0, MP 0x140527F00 + { 0x8265, "_meth_8265" }, // SP 0x140413C80, MP 0x1405281E0 + { 0x8266, "_meth_8266" }, // SP 0x140413D30, MP 0x140528290 + { 0x8267, "_meth_8267" }, // SP 0x140413E90, MP 0x140528370 + { 0x8268, "_meth_8268" }, // SP 0x140413F00, MP 0x1405283E0 + { 0x8269, "_meth_8269" }, // SP 0x140414610, MP 0x140528A20 + { 0x826A, "_meth_826A" }, // MP 0x1402E7660 + { 0x826B, "_meth_826B" }, // MP 0x1402E7CC0 + { 0x826C, "_meth_826C" }, // MP 0x1402E7EB0 + { 0x826D, "iclientprintln" }, // MP 0x1402E7F20 + { 0x826E, "iclientprintlnbold" }, // MP 0x1402E7F90 + { 0x826F, "_meth_826F" }, // MP 0x1402E8000 + { 0x8270, "_meth_8270" }, // MP 0x1402E8070 + { 0x8271, "_meth_8271" }, // MP 0x1402E80D0 + { 0x8272, "_meth_8272" }, // MP 0x1402E8450 + { 0x8273, "_meth_8273" }, // MP 0x1402E85F0 + { 0x8274, "_meth_8274" }, // MP 0x1402E86C0 + { 0x8275, "_meth_8275" }, // MP 0x1402E8860 + { 0x8276, "_meth_8276" }, // SP 0x140265280, MP 0x140333DC0 + { 0x8277, "_meth_8277" }, // SP 0x1402654A0, MP 0x140334000 + { 0x8278, "_meth_8278" }, // SP 0x140265AE0, MP 0x140334660 + { 0x8279, "_meth_8279" }, // MP 0x140334730 + { 0x827A, "_meth_827A" }, // MP 0x140334B20 + { 0x827B, "_meth_827B" }, // MP 0x140334960 + { 0x827C, "_meth_827C" }, // SP 0x1404154A0, MP 0x1405298C0 + { 0x827D, "_meth_827D" }, // SP 0x140415620, MP 0x140529A40 + { 0x827E, "_meth_827E" }, // SP 0x140415720, MP 0x140529B40 + { 0x827F, "_meth_827F" }, // SP 0x1404158C0, MP 0x140529CE0 + { 0x8280, "_meth_8280" }, // SP 0x140415B60, MP 0x140529E70 + { 0x8281, "_meth_8281" }, // SP 0x140415C60, MP 0x140529F00 + { 0x8282, "vehicle_finishdamage" }, + { 0x8283, "_meth_8283" }, // SP 0x140415CE0, MP 0x14052A1D0 + { 0x8284, "_meth_8284" }, // SP 0x140415D50, MP 0x14052A240 + { 0x8285, "_meth_8285" }, // SP 0x140415EE0, MP 0x14052A3D0 + { 0x8286, "_meth_8286" }, // SP 0x140416000, MP 0x14052A4F0 + { 0x8287, "_meth_8287" }, // SP 0x1404160F0, MP 0x14052A5E0 + { 0x8288, "_meth_8288" }, // SP 0x140416160, MP 0x14052A650 + { 0x8289, "_meth_8289" }, // SP 0x1404161D0, MP 0x14052A6C0 + { 0x828A, "_meth_828A" }, // SP 0x140416250, MP 0x14052A750 + { 0x828B, "_meth_828B" }, // SP 0x1404162C0, MP 0x14052A7C0 + { 0x828C, "_meth_828C" }, // SP 0x140416320, MP 0x14052A830 + { 0x828D, "_meth_828D" }, // SP 0x140416380 + { 0x828E, "_meth_828E" }, // SP 0x140416440, MP 0x14052A8A0 + { 0x828F, "_meth_828F" }, // SP 0x1404164B0, MP 0x14052A910 + { 0x8290, "_meth_8290" }, // SP 0x140416520, MP 0x14052A980 + { 0x8291, "_meth_8291" }, // SP 0x140416590, MP 0x14052A9F0 + { 0x8292, "_meth_8292" }, // SP 0x140416620, MP 0x14052AA80 + { 0x8293, "_meth_8293" }, // SP 0x140416780, MP 0x14052ABE0 + { 0x8294, "_meth_8294" }, // SP 0x140416990, MP 0x14052ADF0 + { 0x8295, "_meth_8295" }, // SP 0x140416A50, MP 0x14052AEB0 + { 0x8296, "_meth_8296" }, // SP 0x140416AE0, MP 0x14052AF40 + { 0x8297, "_meth_8297" }, // SP 0x140215990, MP 0x1402E88D0 + { 0x8298, "_meth_8298" }, // MP 0x1402E8AB0 + { 0x8299, "_meth_8299" }, // MP 0x1402E8B10 + { 0x829A, "_meth_829A" }, // MP 0x1402E8B70 + { 0x829B, "_meth_829B" }, // MP 0x1402E8BD0 + { 0x829C, "_meth_829C" }, // MP 0x1402E8C30 + { 0x829D, "_meth_829D" }, // MP 0x1402E8CC0 + { 0x829E, "_meth_829E" }, // MP 0x1402E8D40 + { 0x829F, "_meth_829F" }, // MP 0x1402E8E10 + { 0x82A0, "_meth_82A0" }, // MP 0x1402E8E20 + { 0x82A1, "_meth_82A1" }, // MP 0x1402E8E30 + { 0x82A2, "_meth_82A2" }, // MP 0x1402E8EC0 + { 0x82A3, "_meth_82A3" }, // SP 0x140215250, MP 0x1402DD010 + { 0x82A4, "_meth_82A4" }, // MP 0x1402DF3E0 + { 0x82A5, "_meth_82A5" }, // SP 0x140217F10, MP 0x1402DFF00 + { 0x82A6, "_meth_82A6" }, // SP 0x1402128A0, MP 0x1402E2220 + { 0x82A7, "_meth_82A7" }, // SP 0x140212E30, MP 0x1402E28A0 + { 0x82A8, "_meth_82A8" }, // SP 0x140213680, MP 0x1402E3160 + { 0x82A9, "_meth_82A9" }, // SP 0x140213140, MP 0x1402E2B50 + { 0x82AA, "_meth_82AA" }, // MP 0x1402E63D0 + { 0x82AB, "_meth_82AB" }, // MP 0x1402E64E0 + { 0x82AC, "_meth_82AC" }, // MP 0x1402E3540 + { 0x82AD, "_meth_82AD" }, // MP 0x1402E3550 + { 0x82AE, "_meth_82AE" }, // SP 0x140265FB0, MP 0x1403350C0 + { 0x82AF, "_meth_82AF" }, // SP 0x1402645A0, MP 0x140333110 + { 0x82B0, "_meth_82B0" }, // SP 0x1402645B0, MP 0x140333120 + { 0x82B1, "_meth_82B1" }, // SP 0x1402645D0, MP 0x140333140 + { 0x82B2, "_meth_82B2" }, // SP 0x1402661A0, MP 0x140332DA0 + { 0x82B3, "_meth_82B3" }, // SP 0x1402643B0, MP 0x140332F00 + { 0x82B4, "_meth_82B4" }, // SP 0x140264520, MP 0x140333080 + { 0x82B5, "_meth_82B5" }, // SP 0x1402645F0, MP 0x140333160 + { 0x82B6, "_meth_82B6" }, // SP 0x140264A20, MP 0x1403332B0 + { 0x82B7, "_meth_82B7" }, // SP 0x140264A30, MP 0x1403332C0 + { 0x82B8, "_meth_82B8" }, // SP 0x140264A50, MP 0x1403332E0 + { 0x82B9, "_meth_82B9" }, // SP 0x1402649D0, MP 0x140333260 + { 0x82BA, "_meth_82BA" }, // SP 0x1402649F0, MP 0x140333280 + { 0x82BB, "_meth_82BB" }, // SP 0x140264A10, MP 0x1403332A0 + { 0x82BC, "_meth_82BC" }, // SP 0x140264A70, MP 0x140333300 + { 0x82BD, "_meth_82BD" }, // SP 0x140264CC0, MP 0x1403337B0 + { 0x82BE, "_meth_82BE" }, // SP 0x140265BC0, MP 0x140334CD0 + { 0x82BF, "_meth_82BF" }, // SP 0x140265C70, MP 0x140334D80 + { 0x82C0, "_meth_82C0" }, // SP 0x140264E40, MP 0x140333970 + { 0x82C1, "_meth_82C1" }, // SP 0x140264EA0, MP 0x1403339D0 + { 0x82C2, "_meth_82C2" }, // SP 0x140264F20, MP 0x140333A50 + { 0x82C3, "_meth_82C3" }, // MP 0x1402E5980 + { 0x82C4, "_meth_82C4" }, // MP 0x1402E5990 + { 0x82C5, "_meth_82C5" }, // MP 0x1402E59A0 + { 0x82C6, "_meth_82C6" }, // MP 0x1402E5A60 + { 0x82C7, "_meth_82C7" }, // MP 0x1402E5AC0 + { 0x82C8, "_meth_82C8" }, // MP 0x1402E5B30 + { 0x82C9, "_meth_82C9" }, // MP 0x1402E5BA0 + { 0x82CA, "_meth_82CA" }, // MP 0x1402E5EF0 + { 0x82CB, "_meth_82CB" }, // SP 0x140217770, MP 0x1402DF6A0 + { 0x82CC, "_meth_82CC" }, // SP 0x1402177D0, MP 0x1402DF7C0 + { 0x82CD, "issplitscreenplayer" }, // MP 0x1402E5F60 + { 0x82CE, "_meth_82CE" }, // SP 0x140216D40, MP 0x1402DEC00 + { 0x82CF, "_meth_82CF" }, // SP 0x140216E90, MP 0x1402DED60 + { 0x82D0, "_meth_82D0" }, // SP 0x140216FE0, MP 0x1402DEEC0 + { 0x82D1, "_meth_82D1" }, // SP 0x140217130, MP 0x1402DF020 + { 0x82D2, "_meth_82D2" }, // SP 0x140212160, MP 0x1402E1A30 + { 0x82D3, "_meth_82D3" }, // SP 0x140212490, MP 0x1402E1DF0 + { 0x82D4, "_meth_82D4" }, // SP 0x140218160, MP 0x1402E0170 + { 0x82D5, "_meth_82D5" }, // SP 0x140210920, MP 0x1402E0180 + { 0x82D6, "_meth_82D6" }, // SP 0x1402109A0, MP 0x1402E0210 + { 0x82D7, "_meth_82D7" }, // SP 0x1402109C0, MP 0x1402E02B0 + { 0x82D8, "_meth_82D8" }, // SP 0x1402109E0, MP 0x1402E02D0 + { 0x82D9, "setblurforplayer" }, // SP 0x140211B40, MP 0x1402E12B0 + { 0x82DA, "_meth_82DA" }, // SP 0x14025D320, MP 0x1402E18D0 + { 0x82DB, "_meth_82DB" }, // MP 0x1402E18F0 + { 0x82DC, "_meth_82DC" }, // SP 0x1402605B0 + { 0x82DD, "_meth_82DD" }, // SP 0x1402138F0, MP 0x1402E3560 + { 0x82DE, "_meth_82DE" }, // SP 0x140213C10, MP 0x1402E3B30 + { 0x82DF, "forcemantle" }, // SP 0x140213EA0, MP 0x1402E3CD0 + { 0x82E0, "ismantling" }, // SP 0x140213FD0, MP 0x1402E3E60 + { 0x82E1, "playfx" }, // SP 0x140214610, MP 0x1402E4770 + { 0x82E2, "playerrecoilscaleon" }, // SP 0x140214830, MP 0x1402E49D0 + { 0x82E3, "playerrecoilscaleoff" }, // SP 0x1402149C0, MP 0x1402E4B20 + { 0x82E4, "weaponlockstart" }, // SP 0x140214B20, MP 0x1402E4D50 + { 0x82E5, "weaponlockfinalize" }, // SP 0x140214C80, MP 0x1402DC9C0 + { 0x82E6, "weaponlockfree" }, // SP 0x140214F70, MP 0x1402DCD00 + { 0x82E7, "weaponlocktargettooclose" }, // SP 0x1402150D0, MP 0x1402DCE80 + { 0x82E8, "issplitscreenplayerprimary" }, // MP 0x1402E5FA0 + { 0x82E9, "_meth_82E9" }, // MP 0x1402E6020 + { 0x82EA, "_meth_82EA" }, // MP 0x1402E60A0 + { 0x82EB, "_meth_82EB" }, // MP 0x1402E6270 + { 0x82EC, "_meth_82EC" }, // MP 0x1402E6170 + { 0x82ED, "_meth_82ED" }, // SP 0x1402168F0, MP 0x1402DE5A0 + { 0x82EE, "_meth_82EE" }, // SP 0x140215E00, MP 0x1402DD3B0 + { 0x82EF, "_meth_82EF" }, // SP 0x140215E80, MP 0x1402DD4C0 + { 0x82F0, "_meth_82F0" }, // SP 0x140217FF0, MP 0x1402DFCA0 + { 0x82F1, "_meth_82F1" }, // SP 0x1402144C0, MP 0x1402E4330 + { 0x82F2, "_meth_82F2" }, // SP 0x140214C30, MP 0x1402E4AC0 + { 0x82F3, "_meth_82F3" }, // SP 0x140214FC0, MP 0x1402E4C80 + { 0x82F4, "playlocalsound" }, // SP 0x140214080, MP 0x1402E3E40 + { 0x82F5, "stoplocalsound" }, // SP 0x140214150, MP 0x1402E3FD0 + { 0x82F6, "_meth_82F6" }, // SP 0x1402113C0, MP 0x1402E0FA0 + { 0x82F7, "_meth_82F7" }, // SP 0x1402117B0, MP 0x1402E1530 + { 0x82F8, "_meth_82F8" }, // SP 0x140211D60, MP 0x1402E1910 + { 0x82F9, "_meth_82F9" }, // SP 0x140211F00, MP 0x1402E1C10 + { 0x82FA, "_meth_82FA" }, // SP 0x1402122B0, MP 0x1402E2070 + { 0x82FB, "_meth_82FB" }, // SP 0x140212540, MP 0x1402E24C0 + { 0x82FC, "_meth_82FC" }, // SP 0x1402129E0, MP 0x1402E2CE0 + { 0x82FD, "_meth_82FD" }, // SP 0x140212BC0, MP 0x1402E3320 + { 0x82FE, "_meth_82FE" }, // MP 0x1402E30F0 + { 0x82FF, "_meth_82FF" }, // MP 0x1402E3230 + { 0x8300, "_meth_8300" }, // SP 0x1402151D0, MP 0x1402E48E0 + { 0x8301, "_meth_8301" }, // SP 0x140215440, MP 0x1402E4A50 + { 0x8302, "_meth_8302" }, // SP 0x140216460, MP 0x1402DDC20 + { 0x8303, "_meth_8303" }, // SP 0x140216530, MP 0x1402DDE30 + { 0x8304, "_meth_8304" }, // SP 0x140216600, MP 0x1402DE000 + { 0x8305, "_meth_8305" }, // SP 0x140216CB0, MP 0x1402DF1A0 + { 0x8306, "_meth_8306" }, // SP 0x1402172B0, MP 0x1402DF230 + { 0x8307, "_meth_8307" }, // SP 0x140217330, MP 0x1402DF2B0 + { 0x8308, "_meth_8308" }, // SP 0x140216710, MP 0x1402DE210 + { 0x8309, "_meth_8309" }, // SP 0x1402153C0, MP 0x1402DD1B0 + { 0x830A, "_meth_830A" }, // SP 0x140215500, MP 0x1402DD350 + { 0x830B, "_meth_830B" }, // SP 0x140216AE0, MP 0x1402DE9E0 + { 0x830C, "_meth_830C" }, // SP 0x140216B60, MP 0x1402DEA00 + { 0x830D, "_meth_830D" }, // SP 0x140215130, MP 0x1402DC8B0 + { 0x830E, "_meth_830E" }, // SP 0x1402173C0, MP 0x1402DE6A0 + { 0x830F, "_meth_830F" }, // SP 0x1402178D0, MP 0x1402DF340 + { 0x8310, "_meth_8310" }, // SP 0x140217A70, MP 0x1402DF610 + { 0x8311, "_meth_8311" }, // SP 0x140217BE0, MP 0x1402DF820 + { 0x8312, "_meth_8312" }, // SP 0x140217E30, MP 0x1402DF9B0 + { 0x8313, "_meth_8313" }, // SP 0x140218260, MP 0x1402DFE50 + { 0x8314, "_meth_8314" }, // SP 0x140210F70, MP 0x1402E07C0 + { 0x8315, "_meth_8315" }, // SP 0x1402116F0, MP 0x1402E0E00 + { 0x8316, "_meth_8316" }, // SP 0x140211750, MP 0x1402E0F30 + { 0x8317, "_meth_8317" }, // SP 0x140212410, MP 0x1402E1D60 + { 0x8318, "_meth_8318" }, // SP 0x1402125C0, MP 0x1402E1F60 + { 0x8319, "_meth_8319" }, // SP 0x140210C20, MP 0x1402E0450 + { 0x831A, "_meth_831A" }, // SP 0x140210DD0, MP 0x1402E0610 + { 0x831B, "_meth_831B" }, // SP 0x140214DA0, MP 0x1402E4470 + { 0x831C, "_meth_831C" }, // SP 0x140215060, MP 0x1402E4700 + { 0x831D, "_meth_831D" }, // SP 0x140210940, MP 0x1402E0520 + { 0x831E, "_meth_831E" }, // SP 0x140210A00, MP 0x1402E0680 + { 0x831F, "_meth_831F" }, // SP 0x140210BC0, MP 0x1402E08C0 + { 0x8320, "_meth_8320" }, // SP 0x140210CE0, MP 0x1402E0920 + { 0x8321, "_meth_8321" }, // SP 0x1402110C0, MP 0x1402E0C90 + { 0x8322, "_meth_8322" }, // SP 0x1402111D0, MP 0x1402E0DA0 + { 0x8323, "_meth_8323" }, // SP 0x1402176D0, MP 0x1402DF550 + { 0x8324, "_meth_8324" }, // SP 0x140217830, MP 0x1402DF700 + { 0x8325, "_meth_8325" }, // SP 0x1402179C0, MP 0x1402DF940 + { 0x8326, "_meth_8326" }, // SP 0x140217AF0, MP 0x1402DFAC0 + { 0x8327, "_meth_8327" }, // SP 0x140217D90, MP 0x1402DFBE0 + { 0x8328, "_meth_8328" }, // empty + { 0x8329, "freezecontrols" }, // SP 0x1402180F0, MP 0x1402E00C0 + { 0x832A, "_meth_832A" }, // SP 0x1402182E0, MP 0x1402E0230 + { 0x832B, "_meth_832B" }, // SP 0x140210810, MP 0x1402E0310 + { 0x832C, "_meth_832C" }, // SP 0x140213350, MP 0x1402E37B0 + { 0x832D, "_meth_832D" }, // SP 0x1402136E0, MP 0x1402E38A0 + { 0x832E, "_meth_832E" }, // SP 0x1402137B0, MP 0x1402E3A10 + { 0x832F, "_meth_832F" }, // SP 0x140213A50, MP 0x1402E3A20 + { 0x8330, "_meth_8330" }, // SP 0x140213C40, MP 0x1402E3A30 + { 0x8331, "_meth_8331" }, // SP 0x140212AD0, MP 0x1402E23C0 + { 0x8332, "_meth_8332" }, // SP 0x140212CA0, MP 0x1402E2570 + { 0x8333, "_meth_8333" }, // SP 0x140212FE0, MP 0x1402E29E0 + { 0x8334, "_meth_8334" }, // SP 0x140213440, MP 0x1402E2EA0 + { 0x8335, "_meth_8335" }, // SP 0x1402139C0, MP 0x1402E35E0 + { 0x8336, "_meth_8336" }, // SP 0x140213B20, MP 0x1402E36D0 + { 0x8337, "_meth_8337" }, // SP 0x140213B90, MP 0x1402E3980 + { 0x8338, "setorigin" }, // SP 0x140214250, MP 0x1402E4100 + { 0x8339, "getvelocity" }, // SP 0x1402145A0, MP 0x1402E45C0 + { 0x833A, "setangles" }, // SP 0x140214A20, MP 0x1402E4850 + { 0x833B, "getangles" }, // SP 0x140214BE0, MP 0x1402E4970 + { 0x833C, "usebuttonpressed" }, // SP 0x140215610, MP 0x1402DCDE0 + { 0x833D, "attackbuttonpressed" }, // SP 0x140215770, MP 0x1402DCF70 + { 0x833E, "adsbuttonpressed" }, // SP 0x140215B00, MP 0x1402DD0F0 + { 0x833F, "meleebuttonpressed" }, // SP 0x140215C10, MP 0x1402DD2B0 + { 0x8340, "_meth_8340" }, // SP 0x140216410, MP 0x1402DDD10 + { 0x8341, "_meth_8341" }, // SP 0x1402164C0, MP 0x1402DDED0 + { 0x8342, "_meth_8342" }, // SP 0x140216660, MP 0x1402DE1A0 + { 0x8343, "_meth_8343" }, // SP 0x140216870, MP 0x1402DE440 + { 0x8344, "_meth_8344" }, // SP 0x140210860, MP 0x1402DFFF0 + { 0x8345, "_meth_8345" }, // SP 0x140210A80, MP 0x1402E01A0 + { 0x8346, "_meth_8346" }, // SP 0x140214330 + { 0x8347, "_meth_8347" }, // SP 0x140214740 + { 0x8348, "_meth_8348" }, // SP 0x1402148A0 + { 0x8349, "_meth_8349" }, // SP 0x140214A80 + { 0x834A, "_meth_834A" }, // MP 0x14032DFF0 + { 0x834B, "_meth_834B" }, // MP 0x14032E040 + { 0x834C, "_meth_834C" }, // SP 0x140214EF0, MP 0x1402E4C70 + { 0x834D, "_meth_834D" }, // MP 0x14032BEB0 + { 0x834E, "_meth_834E" }, // SP 0x140216150, MP 0x1402DD960 + { 0x834F, "_meth_834F" }, // MP 0x14032DD30 + { 0x8350, "_meth_8350" }, // MP 0x14032DE40 + { 0x8351, "_meth_8351" }, // MP 0x140432330 + { 0x8352, "_meth_8352" }, // MP 0x140432AB0 + { 0x8353, "_meth_8353" }, // MP 0x140432930 + { 0x8354, "_meth_8354" }, // MP 0x140432610 + { 0x8355, "_meth_8355" }, // MP 0x1404327B0 + { 0x8356, "_meth_8356" }, // MP 0x1404308A0 + { 0x8357, "_meth_8357" }, // MP 0x140432550 + { 0x8358, "_meth_8358" }, // MP 0x140430820 + { 0x8359, "_meth_8359" }, // MP 0x1404320F0 + { 0x835A, "_meth_835A" }, // MP 0x140431010 + { 0x835B, "_meth_835B" }, // MP 0x140431140 + { 0x835C, "_meth_835C" }, // MP 0x140431240 + { 0x835D, "_meth_835D" }, // MP 0x1404311C0 + { 0x835E, "_meth_835E" }, // empty + { 0x835F, "_meth_835F" }, // MP 0x140431380 + { 0x8360, "_meth_8360" }, // MP 0x1404318D0 + { 0x8361, "_meth_8361" }, // MP 0x140430920 + { 0x8362, "_meth_8362" }, // MP 0x140431670 + { 0x8363, "_meth_8363" }, // empty + { 0x8364, "_meth_8364" }, // MP 0x140431970 + { 0x8365, "_meth_8365" }, // MP 0x1404313A0 + { 0x8366, "_meth_8366" }, // MP 0x140430F90 + { 0x8367, "_meth_8367" }, // MP 0x140432B80 + { 0x8368, "_meth_8368" }, // empty + { 0x8369, "_meth_8369" }, // MP 0x1404324C0 + { 0x836A, "_meth_836A" }, // MP 0x140432200 + { 0x836B, "_meth_836B" }, // MP 0x140430AB0 + { 0x836C, "_meth_836C" }, // MP 0x1404312C0 + { 0x836D, "_meth_836D" }, // MP 0x1404314A0 + { 0x836E, "_meth_836E" }, // MP 0x140431EA0 + { 0x836F, "_meth_836F" }, // MP 0x1404306B0 + { 0x8370, "_meth_8370" }, // MP 0x140430DA0 + { 0x8371, "_meth_8371" }, // MP 0x140431AC0 + { 0x8372, "_meth_8372" }, // empty + { 0x8373, "_meth_8373" }, // MP 0x140430BF0 + { 0x8374, "_meth_8374" }, // MP 0x140432170 + { 0x8375, "_meth_8375" }, // MP 0x140432060 + { 0x8376, "_meth_8376" }, // MP 0x1404310B0 + { 0x8377, "_meth_8377" }, // MP 0x140430C70 + { 0x8378, "_meth_8378" }, // empty + { 0x8379, "_meth_8379" }, // MP 0x1404323F0 + { 0x837A, "_meth_837A" }, // MP 0x140432290 + { 0x837B, "_meth_837B" }, // MP 0x140430B40 + { 0x837C, "_meth_837C" }, // MP 0x140430E60 + { 0x837D, "_meth_837D" }, // MP 0x140431420 + { 0x837E, "_meth_837E" }, // MP 0x140431F60 + { 0x837F, "_meth_837F" }, // MP 0x140430790 + { 0x8380, "_meth_8380" }, // MP 0x140431C70 + { 0x8381, "_meth_8381" }, // MP 0x1402DE550 + { 0x8382, "_meth_8382" }, // MP 0x14032AEF0 + { 0x8383, "_meth_8383" }, // MP 0x1403299E0 + { 0x8384, "_meth_8384" }, // MP 0x14031BD40 + { 0x8385, "_meth_8385" }, // MP 0x14032AB40 + { 0x8386, "_meth_8386" }, // MP 0x1402DE580 + { 0x8387, "_meth_8387" }, // SP 0x140216B00, MP 0x1402DE4F0 + { 0x8388, "_meth_8388" }, // MP 0x14032BDF0 + { 0x8389, "_meth_8389" }, // empty + { 0x838A, "_meth_838A" }, // MP 0x140404FA0 + { 0x838B, "_meth_838B" }, // MP 0x140404640 + { 0x838C, "_meth_838C" }, // MP 0x140404E80 + { 0x838D, "_meth_838D" }, // MP 0x140404040 + { 0x838E, "_meth_838E" }, // MP 0x140403E60 + { 0x838F, "_meth_838F" }, // MP 0x140406A80 + { 0x8390, "_meth_8390" }, // MP 0x140406090 + { 0x8391, "_meth_8391" }, // MP 0x140405610 + { 0x8392, "_meth_8392" }, // MP 0x140406000 + { 0x8393, "_meth_8393" }, // MP 0x140405F70 + { 0x8394, "_meth_8394" }, // MP 0x1404061B0 + { 0x8395, "_meth_8395" }, // MP 0x140405E10 + { 0x8396, "_meth_8396" }, // MP 0x140406490 + { 0x8397, "_meth_8397" }, // MP 0x140405CF0 + { 0x8398, "_meth_8398" }, // MP 0x1404066E0 + { 0x8399, "_meth_8399" }, // MP 0x140405ED0 + { 0x839A, "_meth_839A" }, // MP 0x1404062C0 + { 0x839B, "_meth_839B" }, // MP 0x140405730 + { 0x839C, "_meth_839C" }, // MP 0x140405290 + { 0x839D, "_meth_839D" }, // MP 0x1404067A0 + { 0x839E, "_meth_839E" }, // MP 0x140405580 + { 0x839F, "_meth_839F" }, // MP 0x140405470 + { 0x83A0, "_meth_83A0" }, // MP 0x140406A00 + { 0x83A1, "_meth_83A1" }, // MP 0x140405360 + { 0x83A2, "_meth_83A2" }, // MP 0x140405BE0 + { 0x83A3, "_meth_83A3" }, // SP 0x14021EB90, MP 0x1402EF370 + { 0x83A4, "_meth_83A4" }, // SP 0x14021EC40, MP 0x1402EF420 + { 0x83A5, "_meth_83A5" }, // SP 0x14021ECB0, MP 0x1402EF480 + { 0x83A6, "_meth_83A6" }, // SP 0x14021ED20, MP 0x1402EF4E0 + { 0x83A7, "_meth_83A7" }, // SP 0x14025CD90 + { 0x83A8, "_meth_83A8" }, // SP 0x1402156E0, MP 0x1402DD560 + { 0x83A9, "_meth_83A9" }, // SP 0x140215860, MP 0x1402DD590 + { 0x83AA, "_meth_83AA" }, // SP 0x140219A90 + { 0x83AB, "_meth_83AB" }, // SP 0x14025D090 + { 0x83AC, "_meth_83AC" }, // SP 0x14025D100 + { 0x83AD, "_meth_83AD" }, // SP 0x140219940 + { 0x83AE, "_meth_83AE" }, // SP 0x140219A20 + { 0x83AF, "_meth_83AF" }, // SP 0x1402199B0 + { 0x83B0, "_meth_83B0" }, // empty + { 0x83B1, "_meth_83B1" }, // empty + { 0x83B2, "_meth_83B2" }, // SP 0x140215550, MP 0x1402E4B80 + { 0x83B3, "_meth_83B3" }, // SP 0x140214020, MP 0x1402E4090 + { 0x83B4, "_meth_83B4" }, // SP 0x1402141E0, MP 0x1402E42B0 + { 0x83B5, "_meth_83B5" }, // SP 0x1404155F0, MP 0x140529A10 + { 0x83B6, "_meth_83B6" }, // SP 0x140415600, MP 0x140529A20 + { 0x83B7, "_meth_83B7" }, // MP 0x14032D4B0 + { 0x83B8, "_meth_83B8" }, // SP 0x140245EC0, MP 0x14030F7E0 + { 0x83B9, "_meth_83B9" }, // SP 0x140242A20, MP 0x14030B590 + { 0x83BA, "_meth_83BA" }, // SP 0x140242DC0, MP 0x14030BAA0 + { 0x83BB, "_meth_83BB" }, // SP 0x140216060, MP 0x1402DD820 + { 0x83BC, "_meth_83BC" }, // SP 0x140417980, MP 0x14052BE00 + { 0x83BD, "_meth_83BD" }, // SP 0x140417A30, MP 0x14052BEB0 + { 0x83BE, "_meth_83BE" }, // SP 0x140417AB0, MP 0x14052BF30 + { 0x83BF, "_meth_83BF" }, // SP 0x14023B560 + { 0x83C0, "_meth_83C0" }, // SP 0x140210D40, MP 0x1402E0580 + { 0x83C1, "_meth_83C1" }, // SP 0x140210E90, MP 0x1402E06E0 + { 0x83C2, "_meth_83C2" }, // SP 0x140211120, MP 0x1402E0980 + { 0x83C3, "_meth_83C3" }, // SP 0x1402650D0, MP 0x140333C10 + { 0x83C4, "_meth_83C4" }, // SP 0x14028A260, MP 0x140043710 + { 0x83C5, "_meth_83C5" }, // SP 0x140417070, MP 0x14052B420 + { 0x83C6, "_meth_83C6" }, // MP 0x1402DDD70 + { 0x83C7, "_meth_83C7" }, // SP 0x14023B4F0 + { 0x83C8, "_meth_83C8" }, // SP 0x1401FB770 + { 0x83C9, "_meth_83C9" }, // SP 0x1401FB8A0 + { 0x83CA, "_meth_83CA" }, // SP 0x1401FBBB0 + { 0x83CB, "_meth_83CB" }, // SP 0x1401FBD00 + { 0x83CC, "_meth_83CC" }, // SP 0x1401FBF30 + { 0x83CD, "_meth_83CD" }, // SP 0x1401FBEC0 + { 0x83CE, "_meth_83CE" }, // SP 0x1401FC090 + { 0x83CF, "_meth_83CF" }, // SP 0x1401FC0F0 + { 0x83D0, "_meth_83D0" }, // MP 0x140044400 + { 0x83D1, "_meth_83D1" }, // MP 0x140043EE0 + { 0x83D2, "_meth_83D2" }, // MP 0x140044470 + { 0x83D3, "_meth_83D3" }, // MP 0x140044010 + { 0x83D4, "_meth_83D4" }, // MP 0x1400441C0 + { 0x83D5, "_meth_83D5" }, // MP 0x1400440A0 + { 0x83D6, "_meth_83D6" }, // MP 0x140044100 + { 0x83D7, "_meth_83D7" }, // SP 0x14025A000 + { 0x83D8, "_meth_83D8" }, // SP 0x1402154A0, MP 0x1402DCC90 + { 0x83D9, "_meth_83D9" }, // SP 0x1402519A0 + { 0x83DA, "_meth_83DA" }, // SP 0x1401FA190 + { 0x83DB, "_meth_83DB" }, // MP 0x14031AEF0 + { 0x83DC, "_meth_83DC" }, // empty + { 0x83DD, "_meth_83DD" }, // empty + { 0x83DE, "_meth_83DE" }, // SP 0x140215F80, MP 0x1402DD780 + { 0x83DF, "_meth_83DF" }, // SP 0x1402647C0, MP 0x1403331E0 + { 0x83E0, "_meth_83E0" }, // MP 0x1404056A0 + { 0x83E1, "_meth_83E1" }, // MP 0x140405A50 + { 0x83E2, "_meth_83E2" }, // MP 0x140316940 + { 0x83E3, "_meth_83E3" }, // MP 0x14032D710 + { 0x83E4, "_meth_83E4" }, // SP 0x14024CD60, MP 0x14031B0D0 + { 0x83E5, "_meth_83E5" }, // SP 0x14024A200, MP 0x140311B20 + { 0x83E6, "_meth_83E6" }, // SP 0x14024AB80, MP 0x140312A70 + { 0x83E7, "_meth_83E7" }, // MP 0x1402EE870 + { 0x83E8, "_meth_83E8" }, // SP 0x14025C3C0 + { 0x83E9, "_meth_83E9" }, // SP 0x14025CBE0 + { 0x83EA, "_meth_83EA" }, // SP 0x140217CE0, MP 0x1402DFDA0 + { 0x83EB, "_meth_83EB" }, // SP 0x14021E100, MP 0x1402EEA40 + { 0x83EC, "_meth_83EC" }, // SP 0x14024DB10, MP 0x1403185B0 + { 0x83ED, "_meth_83ED" }, // SP 0x14024E830, MP 0x140319350 + { 0x83EE, "_meth_83EE" }, // MP 0x1402DD660 + { 0x83EF, "_meth_83EF" }, // SP 0x140259E40 + { 0x83F0, "_meth_83F0" }, // empty + { 0x83F1, "_meth_83F1" }, // SP 0x140249730, MP 0x140313D20 + { 0x83F2, "_meth_83F2" }, // SP 0x140247DC0, MP 0x1403131D0 + { 0x83F3, "_meth_83F3" }, // SP 0x1402504D0, MP 0x14031C1F0 + { 0x83F4, "_meth_83F4" }, // SP 0x140219120 + { 0x83F5, "_meth_83F5" }, // SP 0x140219180 + { 0x83F6, "_meth_83F6" }, // SP 0x14024D350, MP 0x14031B8D0 + { 0x83F7, "_meth_83F7" }, // SP 0x14024DA40, MP 0x14031BE10 + { 0x83F8, "_meth_83F8" }, // MP 0x140316A60 + { 0x83F9, "_meth_83F9" }, // SP 0x140415460, MP 0x14052B750 + { 0x83FA, "_meth_83FA" }, // SP 0x1402443F0, MP 0x14030B9F0 + { 0x83FB, "_meth_83FB" }, // SP 0x140244F00, MP 0x14030BD20 + { 0x83FC, "_meth_83FC" }, // SP 0x140245540, MP 0x14030C510 + { 0x83FD, "_meth_83FD" }, // SP 0x140245610, MP 0x14030C680 + { 0x83FE, "_meth_83FE" }, // SP 0x14025F060 + { 0x83FF, "_meth_83FF" }, // SP 0x1401FB850 + { 0x8400, "_meth_8400" }, // SP 0x1402408E0, MP 0x140321F90 + { 0x8401, "_meth_8401" }, // SP 0x140240620 + { 0x8402, "_meth_8402" }, // SP 0x1401FA470 + { 0x8403, "_meth_8403" }, // MP 0x1404309B0 + { 0x8404, "_meth_8404" }, // SP 0x140210AE0 + { 0x8405, "_meth_8405" }, // SP 0x14021A5C0 + { 0x8406, "_meth_8406" }, // SP 0x140240860 + { 0x8407, "_meth_8407" }, // SP 0x140240B60 + { 0x8408, "_meth_8408" }, // SP 0x140243680 + { 0x8409, "_meth_8409" }, // MP 0x140328200 + { 0x840A, "_meth_840A" }, // SP 0x140219EA0 + { 0x840B, "_meth_840B" }, // SP 0x140219EF0 + { 0x840C, "_meth_840C" }, // MP 0x1402E66D0 + { 0x840D, "_meth_840D" }, // MP 0x1402E66E0 + { 0x840E, "_meth_840E" }, // MP 0x1402E66F0 + { 0x840F, "_meth_840F" }, // SP 0x14025B8A0 + { 0x8410, "_meth_8410" }, // SP 0x14025A4D0 + { 0x8411, "_meth_8411" }, // SP 0x14025A510 + { 0x8412, "_meth_8412" }, // SP 0x1402655E0, MP 0x140334160 + { 0x8413, "_meth_8413" }, // SP 0x140265690, MP 0x140334210 + { 0x8414, "_meth_8414" }, // SP 0x140265740, MP 0x1403342C0 + { 0x8415, "_meth_8415" }, // SP 0x1402657D0, MP 0x140334350 + { 0x8416, "_meth_8416" }, // SP 0x140265890, MP 0x140334410 + { 0x8417, "_meth_8417" }, // SP 0x140265920, MP 0x1403344A0 + { 0x8418, "_meth_8418" }, // MP 0x140319270 + { 0x8419, "_meth_8419" }, // MP 0x1403193D0 + { 0x841A, "_meth_841A" }, // MP 0x14032E6E0 + { 0x841B, "_meth_841B" }, // MP 0x14032E700 + { 0x841C, "_meth_841C" }, // MP 0x1402E6700 + { 0x841D, "_meth_841D" }, // MP 0x140316950 + { 0x841E, "_meth_841E" }, // MP 0x140316D50 + { 0x841F, "_meth_841F" }, // MP 0x14032E7B0 + { 0x8420, "_meth_8420" }, // MP 0x140321C50 + { 0x8421, "_meth_8421" }, // MP 0x140322190 + { 0x8422, "_meth_8422" }, // MP 0x14030B3C0 + { 0x8423, "_meth_8423" }, // MP 0x14030B800 + { 0x8424, "_meth_8424" }, // SP 0x1402424C0, MP 0x140322600 + { 0x8425, "_meth_8425" }, // MP 0x1402E6900 + { 0x8426, "_meth_8426" }, // SP 0x140248A10, MP 0x140313420 + { 0x8427, "_meth_8427" }, // SP 0x140248EF0, MP 0x1403136F0 + { 0x8428, "_meth_8428" }, // MP 0x1404054F0 + { 0x8429, "_meth_8429" }, // SP 0x140264670 + { 0x842A, "_meth_842A" }, // SP 0x140264840 + { 0x842B, "_meth_842B" }, // SP 0x1402648E0 + { 0x842C, "_meth_842C" }, // MP 0x14032D980 + { 0x842D, "_meth_842D" }, // SP 0x140260510 + { 0x842E, "_meth_842E" }, // MP 0x14032A3B0 + { 0x842F, "_meth_842F" }, // MP 0x14032AFD0 + { 0x8430, "_meth_8430" }, // MP 0x1403283A0 + { 0x8431, "_meth_8431" }, // MP 0x1402E5E50 + { 0x8432, "_meth_8432" }, // MP 0x1402E87A0 + { 0x8433, "_meth_8433" }, // SP 0x140217960, MP 0x1402DF8E0 + { 0x8434, "_meth_8434" }, // SP 0x140217A10, MP 0x1402DFA60 + { 0x8435, "_meth_8435" }, // SP 0x140219B00 + { 0x8436, "_meth_8436" }, // SP 0x14024E610, MP 0x1403190C0 + { 0x8437, "_meth_8437" }, // MP 0x140431DA0 + { 0x8438, "_meth_8438" }, // MP 0x14032FE50 + { 0x8439, "_meth_8439" }, // SP 0x140213F30, MP 0x1402E3D80 + { 0x843A, "_meth_843A" }, // MP 0x1402E6BC0 + { 0x843B, "_meth_843B" }, // MP 0x1402E6BB0 + { 0x843C, "_meth_843C" }, // SP 0x14024D160, MP 0x14031B6F0 + { 0x843D, "_meth_843D" }, // MP 0x1403291E0 + { 0x843E, "_meth_843E" }, // SP 0x1401FC160 + { 0x843F, "_meth_843F" }, // SP 0x1401FC200 + { 0x8440, "_meth_8440" }, // SP 0x140212390, MP 0x1402E1B80 + { 0x8441, "_meth_8441" }, // SP 0x1401FC630 + { 0x8442, "_meth_8442" }, // SP 0x140247D40, MP 0x140310FB0 + { 0x8443, "_meth_8443" }, // MP 0x1402DDF40 + { 0x8444, "_meth_8444" }, // SP 0x140413DA0, MP 0x140528300 + { 0x8445, "_meth_8445" }, // SP 0x140417B70, MP 0x14052BFF0 + { 0x8446, "_meth_8446" }, // SP 0x14024D420, MP 0x140317AF0 + { 0x8447, "_meth_8447" }, // SP 0x1402126D0, MP 0x1402E2710 + { 0x8448, "_meth_8448" }, // SP 0x14025D360 + { 0x8449, "_meth_8449" }, // SP 0x14025D3A0 + { 0x844A, "_meth_844A" }, // SP 0x14024EF50, MP 0x140319B60 + { 0x844B, "_meth_844B" }, // MP 0x14030C040 + { 0x844C, "_meth_844C" }, // MP 0x14030C190 + { 0x844D, "_meth_844D" }, // SP 0x1402152B0, MP 0x1402DC8F0 + { 0x844E, "_meth_844E" }, // SP 0x14023F230, MP 0x14031EDF0 + { 0x844F, "_meth_844F" }, // SP 0x14023FC50, MP 0x14031FD30 + { 0x8450, "_meth_8450" }, // SP 0x140413420, MP 0x14052C170 + { 0x8451, "_meth_8451" }, // SP 0x140413440, MP 0x14052C190 + { 0x8452, "_meth_8452" }, // SP 0x140413460, MP 0x14052C1B0 + { 0x8453, "_meth_8453" }, // SP 0x140413480, MP 0x14052C1D0 + { 0x8454, "_meth_8454" }, // SP 0x140261210 + { 0x8455, "_meth_8455" }, // SP 0x140261250 + { 0x8456, "_meth_8456" }, // SP 0x140417C30, MP 0x14052C0B0 + { 0x8457, "_meth_8457" }, // SP 0x1402166C0, MP 0x1402DE140 + { 0x8458, "_meth_8458" }, // SP 0x1402152F0 + { 0x8459, "_meth_8459" }, // SP 0x1402616F0 + { 0x845A, "_meth_845A" }, // empty + { 0x845B, "_meth_845B" }, // empty + { 0x845C, "_meth_845C" }, // SP 0x140247440, MP 0x14030F1E0 + { 0x845D, "_meth_845D" }, // SP 0x1402127F0, MP 0x1402E2160 + { 0x845E, "_meth_845E" }, // MP 0x140318810 + { 0x845F, "_meth_845F" }, // MP 0x140318F70 + { 0x8460, "_meth_8460" }, // empty + { 0x8461, "_meth_8461" }, // SP 0x14024E9D0, MP 0x140319600 + { 0x8462, "_meth_8462" }, // MP 0x140328E70 + { 0x8463, "_meth_8463" }, // MP 0x140328EC0 + { 0x8464, "_meth_8464" }, // MP 0x1402FB470 + { 0x8465, "_meth_8465" }, // SP 0x140213F70, MP 0x1402E3DD0 + { 0x8466, "_meth_8466" }, // empty + { 0x8467, "_meth_8467" }, // SP 0x140250AC0, MP 0x14031C920 + { 0x8468, "_meth_8468" }, // SP 0x140216230 + { 0x8469, "_meth_8469" }, // MP 0x1402E02F0 + { 0x846A, "_meth_846A" }, // SP 0x140265D80, MP 0x140334E90 + { 0x846B, "_meth_846B" }, // SP 0x140265F30, MP 0x140335040 + { 0x846C, "_meth_846C" }, // SP 0x14024F690 + { 0x846D, "_meth_846D" }, // SP 0x14024FAB0 + { 0x846E, "_meth_846E" }, // SP 0x140250060 + { 0x846F, "_meth_846F" }, // SP 0x140250270 + { 0x8470, "_meth_8470" }, // SP 0x140250A20 + { 0x8471, "_meth_8471" }, // SP 0x1402155C0 + { 0x8472, "_meth_8472" }, // SP 0x14025CE20 + { 0x8473, "_meth_8473" }, // SP 0x140413500, MP 0x14052C250 + { 0x8474, "_meth_8474" }, // SP 0x140413540, MP 0x14052C290 + { 0x8475, "_meth_8475" }, // SP 0x1404135A0, MP 0x14052C2F0 + { 0x8476, "_meth_8476" }, // SP 0x1404135F0, MP 0x14052C340 + { 0x8477, "_meth_8477" }, // SP 0x140413610, MP 0x14052C360 + { 0x8478, "_meth_8478" }, // SP 0x140252200, MP 0x14031C170 + { 0x8479, "_meth_8479" }, // SP 0x140252430, MP 0x14031C590 + { 0x847A, "_meth_847A" }, // SP 0x140210B00, MP 0x1402E0390 + { 0x847B, "_meth_847B" }, // SP 0x14025CEA0 + { 0x847C, "_meth_847C" }, // SP 0x14025D040 + { 0x847D, "_meth_847D" }, // MP 0x1402E41C0 + { 0x847E, "_meth_847E" }, // MP 0x1402E43B0 + { 0x847F, "_meth_847F" }, // SP 0x140417120, MP 0x14052B4D0 + { 0x8480, "_meth_8480" }, // SP 0x1404171A0, MP 0x14052B550 + { 0x8481, "_meth_8481" }, // SP 0x140216950, MP 0x1402DE630 + { 0x8482, "_meth_8482" }, // SP 0x1402169A0, MP 0x1402DEB60 + { 0x8483, "_meth_8483" }, // SP 0x1402462A0, MP 0x14030FBD0 + { 0x8484, "_meth_8484" }, // SP 0x140252730 + { 0x8485, "_meth_8485" }, // SP 0x140215D90, MP 0x1402DCEF0 + { 0x8486, "_meth_8486" }, // SP 0x140215BA0, MP 0x1402DCD60 + { 0x8487, "_meth_8487" }, // MP 0x1404045E0 + { 0x8488, "_meth_8488" }, // SP 0x1404153F0, MP 0x1405297E0 + { 0x8489, "_meth_8489" }, // SP 0x1404134B0, MP 0x14052C200 + { 0x848A, "_meth_848A" }, // MP 0x140403EF0 + { 0x848B, "_meth_848B" }, // MP 0x140334A40 + { 0x848C, "_meth_848C" }, // SP 0x140264710 + { 0x848D, "_meth_848D" }, // SP 0x140215A90, MP 0x1402DCC10 + { 0x848E, "_meth_848E" }, // SP 0x140415470, MP 0x140529860 + { 0x848F, "_meth_848F" }, // MP 0x1405297F0 + { 0x8490, "_meth_8490" }, // SP 0x140211290, MP 0x1402E0A90 + { 0x8491, "_meth_8491" }, // SP 0x140211570, MP 0x1402E0BC0 + { 0x8492, "_meth_8492" }, // SP 0x140211640, MP 0x1402E0CF0 + { 0x8493, "_meth_8493" }, // SP 0x140219490 + { 0x8494, "_meth_8494" }, // SP 0x140252620, MP 0x14031C840 + { 0x8495, "_meth_8495" }, // MP 0x140329C80 + { 0x8496, "finishentitydamage" }, + { 0x8497, "_meth_8497" }, // SP 0x140261570 + { 0x8498, "_meth_8498" }, // SP 0x140261690 + { 0x8499, "_meth_8499" }, // SP 0x14021A310 + { 0x849A, "_meth_849A" }, // MP 0x14032E850 + { 0x849B, "_meth_849B" }, // MP 0x140328DD0 + { 0x849C, "_meth_849C" }, // SP 0x140213960, MP 0x1402E3680 + { 0x849D, "_meth_849D" }, // SP 0x140213D30, MP 0x1402E3BF0 + { 0x849E, "_meth_849E" }, // SP 0x1402157F0, MP 0x1402DCB40 + { 0x849F, "_meth_849F" }, // MP 0x14032E8C0 + { 0x84A0, "_meth_84A0" }, // MP 0x14032EAB0 + { 0x84A1, "_meth_84A1" }, // MP 0x14032EC40 + { 0x84A2, "_meth_84A2" }, // MP 0x14032EF70 + { 0x84A3, "_meth_84A3" }, // MP 0x14032F290 + { 0x84A4, "_meth_84A4" }, // MP 0x14032F960 + { 0x84A5, "_meth_84A5" }, // MP 0x14032F4C0 + { 0x84A6, "_meth_84A6" }, // MP 0x140327B20 + { 0x84A7, "_meth_84A7" }, // MP 0x140327F80 + { 0x84A8, "_meth_84A8" }, // MP 0x14032FEF0 + { 0x84A9, "_meth_84A9" }, // SP 0x140249520, MP 0x140312340 + { 0x84AA, "_meth_84AA" }, // SP 0x140249910, MP 0x140312C40 + { 0x84AB, "_meth_84AB" }, // SP 0x140249CE0, MP 0x140312E80 + { 0x84AC, "_meth_84AC" }, // SP 0x14024A4A0, MP 0x140313860 + { 0x84AD, "_meth_84AD" }, // SP 0x140416070, MP 0x14052A560 + { 0x84AE, "_meth_84AE" }, // SP 0x140241420, MP 0x140321790 + { 0x84AF, "_meth_84AF" }, // SP 0x140241920, MP 0x140321A50 + { 0x84B0, "_meth_84B0" }, // SP 0x1402162A0, MP 0x1402DDA50 + { 0x84B1, "_meth_84B1" }, // SP 0x1404167F0, MP 0x14052AC50 + { 0x84B2, "_meth_84B2" }, // SP 0x1404168F0, MP 0x14052AD50 + { 0x84B3, "setdemigod" }, // MP 0x1402E6C20 + { 0x84B4, "_meth_84B4" }, // MP 0x140310840 + { 0x84B5, "_meth_84B5" }, // SP 0x140252CA0, MP 0x14031CBF0 + { 0x84B6, "_meth_84B6" }, // SP 0x140252F80, MP 0x14031CF20 + { 0x84B7, "_meth_84B7" }, // SP 0x140253980, MP 0x14031D2F0 + { 0x84B8, "_meth_84B8" }, // SP 0x140253B60, MP 0x14031D300 + { 0x84B9, "_meth_84B9" }, // MP 0x1403104C0 + { 0x84BA, "_meth_84BA" }, // MP 0x140317430 + { 0x84BB, "_meth_84BB" }, // SP 0x1404159E0, MP 0x140529E00 + { 0x84BC, "_meth_84BC" }, // SP 0x14024A130, MP 0x140313510 + { 0x84BD, "_meth_84BD" }, // MP 0x140334BE0 + { 0x84BE, "_meth_84BE" }, // MP 0x1403204E0 + { 0x84BF, "_meth_84BF" }, // SP 0x140210E30, MP 0x1402E0A30 + { 0x84C0, "_meth_84C0" }, // SP 0x140211060, MP 0x1402E0B60 + { 0x84C1, "_meth_84C1" }, // MP 0x1402E6CA0 + { 0x84C2, "_meth_84C2" }, // MP 0x1402E7060 + { 0x84C3, "_meth_84C3" }, // SP 0x140211C20, MP 0x1402E13F0 + { 0x84C4, "_meth_84C4" }, // SP 0x140212040, MP 0x1402E17A0 + { 0x84C5, "_meth_84C5" }, // MP 0x1403290C0 + { 0x84C6, "_meth_84C6" }, // SP 0x140248BE0, MP 0x140312710 + { 0x84C7, "_meth_84C7" }, // SP 0x140413650, MP 0x14052C3A0 + { 0x84C8, "_meth_84C8" }, // MP 0x140406E30 + { 0x84C9, "_meth_84C9" }, // MP 0x140406A70 + { 0x84CA, "getgravity" }, // SP 0x140214970, MP 0x1402E46B0 + { 0x84CB, "_meth_84CB" }, // SP 0x1402146F0 + { 0x84CC, "_meth_84CC" }, // SP 0x1402147E0 + { 0x84CD, "_meth_84CD" }, // SP 0x140415170, MP 0x140529560 + { 0x84CE, "_meth_84CE" }, // SP 0x140415200, MP 0x140529650 + { 0x84CF, "_meth_84CF" }, // SP 0x14024D040, MP 0x140317580 + { 0x84D0, "_meth_84D0" }, // SP 0x14024B7E0, MP 0x1403160C0 + { 0x84D1, "_meth_84D1" }, // SP 0x14024B9E0, MP 0x140316540 + { 0x84D2, "_meth_84D2" }, // SP 0x14024CE00, MP 0x1403172B0 + { 0x84D3, "_meth_84D3" }, // MP 0x1402E8A20 + { 0x84D4, "_meth_84D4" }, // SP 0x140413670, MP 0x14052C3C0 + { 0x84D5, "_meth_84D5" }, // SP 0x140249F30, MP 0x1403143D0 + { 0x84D6, "_meth_84D6" }, // SP 0x140249FC0, MP 0x1403145C0 + { 0x84D7, "_meth_84D7" }, // SP 0x140247490, MP 0x1403122F0 + { 0x84D8, "_meth_84D8" }, // SP 0x1402475C0, MP 0x1403123D0 + { 0x84D9, "_meth_84D9" }, // SP 0x140247740, MP 0x140312520 + { 0x84DA, "_meth_84DA" }, // SP 0x1402478B0, MP 0x140312BA0 + { 0x84DB, "_meth_84DB" }, // SP 0x140247900, MP 0x140312BF0 + { 0x84DC, "_meth_84DC" }, // SP 0x140247B10, MP 0x140312CB0 + { 0x84DD, "_meth_84DD" }, // SP 0x140247C60, MP 0x140312DF0 + { 0x84DE, "_meth_84DE" }, // SP 0x140247CE0, MP 0x140312FF0 + { 0x84DF, "_meth_84DF" }, // SP 0x14028A150 + { 0x84E0, "_meth_84E0" }, // SP 0x140213EE0, MP 0x1402E3D20 + { 0x84E1, "_meth_84E1" }, // SP 0x1402659E0, MP 0x140334560 + { 0x84E2, "_meth_84E2" }, // MP 0x14031B9E0 + { 0x84E3, "_meth_84E3" }, // SP 0x1401F92C0 + { 0x84E4, "_meth_84E4" }, // SP 0x140416CC0 + { 0x84E5, "_meth_84E5" }, // SP 0x1401F9310 + { 0x84E6, "_meth_84E6" }, // SP 0x1401F9380 + { 0x84E7, "_meth_84E7" }, // SP 0x140250FA0, MP 0x14031E3C0 + { 0x84E8, "_meth_84E8" }, // SP 0x14021F100, MP 0x1402EF8A0 + { 0x84E9, "_meth_84E9" }, // SP 0x1404136B0, MP 0x14052C400 + { 0x84EA, "_meth_84EA" }, // MP 0x14031A1A0 + { 0x84EB, "_meth_84EB" }, // SP 0x140211E70, MP 0x1402E1700 + { 0x84EC, "_meth_84EC" }, // SP 0x14023F470, MP 0x14031F000 + { 0x84ED, "_meth_84ED" }, // SP 0x14025D190 + { 0x84EE, "_meth_84EE" }, // MP 0x1400439D0 + { 0x84EF, "_meth_84EF" }, // MP 0x140317940 + { 0x84F0, "_meth_84F0" }, // empty + { 0x84F1, "_meth_84F1" }, // SP 0x140211230, MP 0x1402E0E70 + { 0x84F2, "_meth_84F2" }, // SP 0x140211360, MP 0x1402E0F20 + { 0x84F3, "_meth_84F3" }, // SP 0x14023B610 + { 0x84F4, "_meth_84F4" }, // SP 0x140243E30, MP 0x14030CD90 + { 0x84F5, "_meth_84F5" }, // SP 0x14024DF20, MP 0x14031C2A0 + { 0x84F6, "_meth_84F6" }, // SP 0x14023FDF0, MP 0x14030B1C0 + { 0x84F7, "_meth_84F7" }, // SP 0x140240FD0, MP 0x140322450 + { 0x84F8, "_meth_84F8" }, // SP 0x1402453B0, MP 0x14030C2F0 + { 0x84F9, "_meth_84F9" }, // SP 0x140414810, MP 0x140528BC0 + { 0x84FA, "_meth_84FA" }, // SP 0x140414920, MP 0x140528CF0 + { 0x84FB, "_meth_84FB" }, // SP 0x140251B50, MP 0x14031FB80 + { 0x84FC, "_meth_84FC" }, // SP 0x140252320, MP 0x140320180 + { 0x84FD, "_meth_84FD" }, // SP 0x140251270, MP 0x14031E7D0 + { 0x84FE, "_meth_84FE" }, // MP 0x14031EAB0 + { 0x84FF, "_meth_84FF" }, // MP 0x14031EBF0 + { 0x8500, "_meth_8500" }, // SP 0x1402516B0, MP 0x14031EDE0 + { 0x8501, "_meth_8501" }, // MP 0x14031EEB0 + { 0x8502, "_meth_8502" }, // MP 0x14031F190 + { 0x8503, "_meth_8503" }, // MP 0x14031F830 + { 0x8504, "_meth_8504" }, // SP 0x14024BF00, MP 0x140319DE0 + { 0x8505, "_meth_8505" }, // SP 0x14024FB30, MP 0x140319580 + { 0x8506, "_meth_8506" }, // MP 0x1402E8800 + { 0x8507, "_meth_8507" }, // MP 0x140329180 + { 0x8508, "_meth_8508" }, // MP 0x140329240 + { 0x8509, "_meth_8509" }, // SP 0x14024F410, MP 0x140318610 + { 0x850A, "_meth_850A" }, // SP 0x14024E920, MP 0x140317760 + { 0x850B, "_meth_850B" }, // MP 0x14032E9A0 + { 0x850C, "_meth_850C" }, // SP 0x140252E00, MP 0x140320830 + { 0x850D, "_meth_850D" }, // MP 0x140329BC0 + { 0x850E, "_meth_850E" }, // MP 0x14032E370 + { 0x850F, "_meth_850F" }, // MP 0x14032C510 + { 0x8510, "_meth_8510" }, // MP 0x14032AC40 + { 0x8511, "_meth_8511" }, // MP 0x1402E6A80 + { 0x8512, "_meth_8512" }, // SP 0x140261130 + { 0x8513, "_meth_8513" }, // SP 0x140211970, MP 0x1402E0E80 + { 0x8514, "_meth_8514" }, // SP 0x14021EAB0, MP 0x1402EF290 + { 0x8515, "_meth_8515" }, // MP 0x140328D20 + { 0x8516, "_meth_8516" }, // MP 0x14032DBF0 + { 0x8517, "_meth_8517" }, // MP 0x14032DCE0 + { 0x8518, "_meth_8518" }, // SP 0x1402472A0, MP 0x140312210 + { 0x8519, "_meth_8519" }, // SP 0x1402473E0, MP 0x140312280 + { 0x851A, "_meth_851A" }, // SP 0x140243700, MP 0x140321660 + { 0x851B, "_meth_851B" }, // SP 0x140214130, MP 0x1402E3EC0 + { 0x851C, "_meth_851C" }, // SP 0x140250160, MP 0x140319690 + { 0x851D, "_meth_851D" }, // SP 0x1404136E0, MP 0x140527C40 + { 0x851E, "_meth_851E" }, // SP 0x140413700, MP 0x140527C60 + { 0x851F, "_meth_851F" }, // SP 0x1402142D0, MP 0x1402E4400 + { 0x8520, "_meth_8520" }, // SP 0x140214540, MP 0x1402E4640 + { 0x8521, "_meth_8521" }, // SP 0x140242BF0, MP 0x140320AB0 + { 0x8522, "_meth_8522" }, // MP 0x14032C720 + { 0x8523, "_meth_8523" }, // SP 0x14021E220, MP 0x1402EEB60 + { 0x8524, "_meth_8524" }, // MP 0x140329390 + { 0x8525, "_meth_8525" }, // SP 0x14024CC20, MP 0x140317000 + { 0x8526, "_meth_8526" }, // SP 0x14024CC40, MP 0x140317020 + { 0x8527, "_meth_8527" }, // SP 0x140215370, MP 0x1402DCBC0 + { 0x8528, "_meth_8528" }, // SP 0x14024C260, MP 0x14031A0B0 + { 0x8529, "_meth_8529" }, // SP 0x14024AD20, MP 0x1403198A0 + { 0x852A, "_meth_852A" }, // SP 0x140265A60, MP 0x1403345E0 + { 0x852B, "_meth_852B" }, // SP 0x14023B310 + { 0x852C, "_meth_852C" }, // MP 0x1402E7D80 + { 0x852D, "_meth_852D" }, // MP 0x140404F00 + { 0x852E, "_meth_852E" }, // SP 0x140210A60 + { 0x852F, "_meth_852F" }, // MP 0x1402E5FE0 + { 0x8530, "_meth_8530" }, // MP 0x140317B50 + { 0x8531, "_meth_8531" }, // SP 0x14024E060, MP 0x140318C60 + { 0x8532, "_meth_8532" }, // MP 0x14032DE80 + { 0x8533, "_meth_8533" }, // MP 0x14032DFB0 + { 0x8534, "_meth_8534" }, // SP 0x14021EB20, MP 0x1402EF300 + { 0x8535, "_meth_8535" }, // MP 0x1402E6B00 + { 0x8536, "_meth_8536" }, // SP 0x140253150, MP 0x140320AA0 + { 0x8537, "_meth_8537" }, // SP 0x140240CE0, MP 0x14031EF00 + { 0x8538, "_meth_8538" }, // MP 0x1402E6A10 + { 0x8539, "_meth_8539" }, // MP 0x1402E5C10 + { 0x853A, "_meth_853A" }, // MP 0x14031F870 + { 0x853B, "_meth_853B" }, // MP 0x140329750 + { 0x853C, "_meth_853C" }, // MP 0x140406810 + { 0x853D, "_meth_853D" }, // MP 0x1404051D0 + { 0x853E, "_meth_853E" }, // MP 0x140406340 + { 0x853F, "_meth_853F" }, // MP 0x1402E72A0 + { 0x8540, "_meth_8540" }, // MP 0x140404C70 + { 0x8541, "_meth_8541" }, // MP 0x1404065C0 + { 0x8542, "_meth_8542" }, // MP 0x140405C60 + { 0x8543, "_meth_8543" }, // MP 0x140406400 + { 0x8544, "_meth_8544" }, // MP 0x140406230 + { 0x8545, "_meth_8545" }, // MP 0x140406650 + { 0x8546, "_meth_8546" }, // MP 0x1402E7DE0 + { 0x8547, "_meth_8547" }, // MP 0x140333550 + { 0x8548, "_meth_8548" }, // MP 0x140403FE0 + { 0x8549, "_meth_8549" }, // SP 0x1402527A0, MP 0x140320360 + { 0x854A, "_meth_854A" }, // SP 0x140215690, MP 0x1402DC850 + { 0x854B, "_meth_854B" }, // MP 0x140329830 + { 0x854C, "_meth_854C" }, // MP 0x140403F50 + { 0x854D, "_meth_854D" }, // SP 0x140242310, MP 0x14030C7B0 + { 0x854E, "_meth_854E" }, // SP 0x140252B90, MP 0x1403206B0 + { 0x854F, "_meth_854F" }, // MP 0x140329960 + { 0x8550, "_meth_8550" }, // MP 0x140328100 + { 0x8551, "_meth_8551" }, // MP 0x140405990 + { 0x8552, "_meth_8552" }, // MP 0x1402E70C0 + { 0x8553, "_meth_8553" }, // MP 0x1403335F0 + { 0x8554, "_meth_8554" }, // SP 0x14024C220, MP 0x140316A20 + { 0x8555, "_meth_8555" }, // SP 0x14024C9C0, MP 0x140316DB0 + { 0x8556, "_meth_8556" }, // MP 0x140406B50 + { 0x8557, "_meth_8557" }, // SP 0x140216590, MP 0x1402DE070 + { 0x8558, "_meth_8558" }, // MP 0x1402E7E40 + { 0x8559, "_meth_8559" }, // MP 0x140329BA0 + { 0x855A, "_meth_855A" }, // MP 0x140405AF0 + { 0x855B, "_meth_855B" }, // MP 0x1402E7240 + { 0x855C, "_meth_855C" }, // MP 0x14031A370 + { 0x855D, "_meth_855D" }, // MP 0x140406970 + { 0x855E, "_meth_855E" }, // MP 0x140405B60 + { 0x855F, "_meth_855F" }, // SP 0x140265D00, MP 0x140334E10 + { 0x8560, "_meth_8560" }, // MP 0x140320A90 + { 0x8561, "_meth_8561" }, // MP 0x140406C00 + { 0x8562, "_meth_8562" }, // MP 0x140328BF0 + { 0x8563, "_meth_8563" }, // MP 0x1404053E0 + { 0x8564, "_meth_8564" }, // MP 0x140406D20 + { 0x8565, "_meth_8565" }, // MP 0x14032C900 + { 0x8566, "_meth_8566" }, // MP 0x14032C9E0 + { 0x8567, "_meth_8567" }, // MP 0x140044360 + { 0x8568, "_meth_8568" }, // MP 0x140333680 + { 0x8569, "_meth_8569" }, // MP 0x1402E7130 + { 0x856A, "_meth_856A" }, // MP 0x1403294B0 + { 0x856B, "_meth_856B" }, // SP 0x14023F290, MP 0x140320B40 + { 0x856C, "_meth_856C" }, // MP 0x140333710 +}}; + +} // namespace xsk::gsc::s1_pc diff --git a/src/s1/xsk/resolver.cpp b/src/s1/s1_pc_token.cpp similarity index 92% rename from src/s1/xsk/resolver.cpp rename to src/s1/s1_pc_token.cpp index d0ccfe83..545193f7 100644 --- a/src/s1/xsk/resolver.cpp +++ b/src/s1/s1_pc_token.cpp @@ -1,2591 +1,14 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" -#include "s1.hpp" +#include "s1_pc.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - -namespace xsk::gsc::s1 +namespace xsk::gsc::s1_pc { -std::unordered_map opcode_map; -std::unordered_map function_map; -std::unordered_map method_map; -std::unordered_map token_map; -std::unordered_map opcode_map_rev; -std::unordered_map function_map_rev; -std::unordered_map method_map_rev; -std::unordered_map token_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_func_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - const auto itr = function_map.find(id); - - if (itr != function_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_meth_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - const auto itr = method_map.find(id); - - if (itr != method_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_id_")) - { - return static_cast(std::stoul(name.substr(4), nullptr, 16)); - } - - const auto itr = token_map_rev.find(name); - - if (itr != token_map_rev.end()) - { - return itr->second; - } - - return 0; -} - -auto resolver::token_name(std::uint16_t id) -> std::string -{ - const auto itr = token_map.find(id); - - if (itr != token_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - } - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - } - - return false; -} - -void resolver::add_function(const std::string& name, std::uint16_t id) -{ - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - throw error(utils::string::va("builtin function '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - function_map.insert({ id, *str }); - function_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - function_map.insert({ id, *ins.first }); - function_map_rev.insert({ *ins.first, id }); - } - } -} - -void resolver::add_method(const std::string& name, std::uint16_t id) -{ - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - throw error(utils::string::va("builtin method '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - method_map.insert({ id, *str }); - method_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - method_map.insert({ id, *ins.first }); - method_map_rev.insert({ *ins.first, 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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -const std::array, 154> opcode_list -{{ - { 0x17, "OP_SetNewLocalVariableFieldCached0" }, - { 0x18, "OP_EvalSelfFieldVariable" }, - { 0x19, "OP_Return" }, - { 0x1A, "OP_CallBuiltin0" }, - { 0x1B, "OP_CallBuiltin1" }, - { 0x1C, "OP_CallBuiltin2" }, - { 0x1D, "OP_CallBuiltin3" }, - { 0x1E, "OP_CallBuiltin4" }, - { 0x1F, "OP_CallBuiltin5" }, - { 0x20, "OP_CallBuiltin" }, - { 0x21, "OP_BoolNot" }, - { 0x22, "OP_ScriptFarMethodThreadCall" }, - { 0x23, "OP_JumpOnTrueExpr" }, - { 0x24, "OP_SetLevelFieldVariableField" }, - { 0x25, "OP_CastBool" }, - { 0x26, "OP_EvalNewLocalArrayRefCached0" }, - { 0x27, "OP_CallBuiltinPointer" }, - { 0x28, "OP_inequality" }, - { 0x29, "OP_GetThisthread" }, - { 0x2A, "OP_ClearFieldVariable" }, - { 0x2B, "OP_GetFloat" }, - { 0x2C, "OP_SafeCreateVariableFieldCached" }, - { 0x2D, "OP_ScriptFarFunctionCall2" }, - { 0x2E, "OP_ScriptFarFunctionCall" }, - { 0x2F, "OP_ScriptFarChildThreadCall" }, - { 0x30, "OP_ClearLocalVariableFieldCached0" }, - { 0x31, "OP_ClearLocalVariableFieldCached" }, - { 0x32, "OP_checkclearparams" }, - { 0x33, "OP_CastFieldObject" }, - { 0x34, "OP_End" }, - { 0x35, "OP_size" }, - { 0x36, "OP_EmptyArray" }, - { 0x37, "OP_bit_and" }, - { 0x38, "OP_less_equal" }, - { 0x39, "OP_voidCodepos" }, - { 0x3A, "OP_ScriptMethodThreadCallPointer" }, - { 0x3B, "OP_endswitch" }, - { 0x3C, "OP_ClearVariableField" }, - { 0x3D, "OP_divide" }, - { 0x3E, "OP_ScriptFarMethodChildThreadCall" }, - { 0x3F, "OP_GetUnsignedShort" }, - { 0x40, "OP_JumpOnTrue" }, - { 0x41, "OP_GetSelf" }, - { 0x42, "OP_ScriptFarThreadCall" }, - { 0x43, "OP_ScriptLocalThreadCall" }, - { 0x44, "OP_SetLocalVariableFieldCached0" }, - { 0x45, "OP_SetLocalVariableFieldCached" }, - { 0x46, "OP_plus" }, - { 0x47, "OP_BoolComplement" }, - { 0x48, "OP_ScriptMethodCallPointer" }, - { 0x49, "OP_inc" }, - { 0x4A, "OP_RemoveLocalVariables" }, - { 0x4B, "OP_JumpOnFalseExpr" }, - { 0x4C, "OP_switch" }, - { 0x4D, "OP_clearparams" }, - { 0x4E, "OP_EvalLocalVariableRefCached0" }, - { 0x4F, "OP_EvalLocalVariableRefCached" }, - { 0x50, "OP_ScriptLocalMethodCall" }, - { 0x51, "OP_EvalFieldVariable" }, - { 0x52, "OP_EvalFieldVariableRef" }, - { 0x53, "OP_GetString" }, - { 0x54, "OP_ScriptFunctionCallPointer" }, - { 0x55, "OP_EvalLevelFieldVariable" }, - { 0x56, "OP_GetVector" }, - { 0x57, "OP_endon" }, - { 0x58, "OP_greater_equal" }, - { 0x59, "OP_GetSelfObject" }, - { 0x5A, "OP_SetAnimFieldVariableField" }, - { 0x5B, "OP_SetVariableField" }, - { 0x5C, "OP_ScriptLocalFunctionCall2" }, - { 0x5D, "OP_ScriptLocalFunctionCall" }, - { 0x5E, "OP_EvalLocalArrayRefCached0" }, - { 0x5F, "OP_EvalLocalArrayRefCached" }, - { 0x60, "OP_GetFarFunction" }, - { 0x61, "OP_less" }, - { 0x62, "OP_GetGameRef" }, - { 0x63, "OP_waittillFrameEnd" }, - { 0x64, "OP_waitFrame" }, - { 0x65, "OP_SafeSetVariableFieldCached0" }, - { 0x66, "OP_SafeSetVariableFieldCached" }, - { 0x67, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x68, "OP_GetLevel" }, - { 0x69, "OP_notify" }, - { 0x6A, "OP_DecTop" }, - { 0x6B, "OP_shift_left" }, - { 0x6C, "OP_ScriptLocalMethodThreadCall" }, - { 0x6D, "OP_ScriptLocalMethodChildThreadCall" }, - { 0x6E, "OP_greater" }, - { 0x6F, "OP_EvalLocalVariableCached0" }, - { 0x70, "OP_EvalLocalVariableCached1" }, - { 0x71, "OP_EvalLocalVariableCached2" }, - { 0x72, "OP_EvalLocalVariableCached3" }, - { 0x73, "OP_EvalLocalVariableCached4" }, - { 0x74, "OP_EvalLocalVariableCached5" }, - { 0x75, "OP_EvalLocalVariableCached" }, - { 0x76, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x77, "OP_jump" }, - { 0x78, "OP_ScriptThreadCallPointer" }, - { 0x79, "OP_GetZero" }, - { 0x7A, "OP_wait" }, - { 0x7B, "OP_minus" }, - { 0x7C, "OP_SetSelfFieldVariableField" }, - { 0x7D, "OP_EvalNewLocalVariableRefCached0" }, - { 0x7E, "OP_multiply" }, - { 0x7F, "OP_CreateLocalVariable" }, - { 0x80, "OP_ScriptLocalChildThreadCall" }, - { 0x81, "OP_GetInteger" }, - { 0x82, "OP_mod" }, - { 0x83, "OP_EvalAnimFieldVariableRef" }, - { 0x84, "OP_GetBuiltinFunction" }, - { 0x85, "OP_GetGame" }, - { 0x86, "OP_waittill" }, - { 0x87, "OP_dec" }, - { 0x88, "OP_EvalLocalVariableObjectCached" }, - { 0x89, "OP_PreScriptCall" }, - { 0x8A, "OP_GetAnim" }, - { 0x8B, "OP_GetUndefined" }, - { 0x8C, "OP_EvalLevelFieldVariableRef" }, - { 0x8D, "OP_GetAnimObject" }, - { 0x8E, "OP_GetLevelObject" }, - { 0x8F, "OP_bit_ex_or" }, - { 0x90, "OP_equality" }, - { 0x91, "OP_ClearArray" }, - { 0x92, "OP_jumpback" }, - { 0x93, "OP_GetAnimation" }, - { 0x94, "OP_EvalAnimFieldVariable" }, - { 0x95, "OP_GetAnimTree" }, - { 0x96, "OP_GetIString" }, - { 0x97, "OP_EvalArrayRef" }, - { 0x98, "OP_EvalSelfFieldVariableRef" }, - { 0x99, "OP_GetNegByte" }, - { 0x9A, "OP_GetBuiltinMethod" }, - { 0x9B, "OP_CallBuiltinMethodPointer" }, - { 0x9C, "OP_EvalArray" }, - { 0x9D, "OP_vector" }, - { 0x9E, "OP_ScriptFarMethodCall" }, - { 0x9F, "OP_EvalLocalArrayCached" }, - { 0xA0, "OP_GetByte" }, - { 0xA1, "OP_ScriptChildThreadCallPointer" }, - { 0xA2, "OP_bit_or" }, - { 0xA3, "OP_AddArray" }, - { 0xA4, "OP_waittillmatch2" }, - { 0xA5, "OP_waittillmatch" }, - { 0xA6, "OP_GetLocalFunction" }, - { 0xA7, "OP_GetNegUnsignedShort" }, - { 0xA8, "OP_shift_right" }, - { 0xA9, "OP_CallBuiltinMethod0" }, - { 0xAA, "OP_CallBuiltinMethod1" }, - { 0xAB, "OP_CallBuiltinMethod2" }, - { 0xAC, "OP_CallBuiltinMethod3" }, - { 0xAD, "OP_CallBuiltinMethod4" }, - { 0xAE, "OP_CallBuiltinMethod5" }, - { 0xAF, "OP_CallBuiltinMethod" }, - { 0xB0, "OP_JumpOnFalse" }, -}}; - -const std::array, 735> function_list -{{ - { 0x001, "precacheturret" }, - { 0x002, "getweaponarray" }, - { 0x003, "createprintchannel" }, - { 0x004, "updategamerprofileall" }, - { 0x005, "clearlocalizedstrings" }, - { 0x006, "setphysicsgravitydir" }, - { 0x007, "gettimescale" }, - { 0x008, "settimescale" }, - { 0x009, "setslowmotionview" }, - { 0x00A, "teleportscene" }, - { 0x00B, "forcesharedammo" }, - { 0x00C, "refreshhudcompass" }, - { 0x00D, "refreshhudammocounter" }, - { 0x00E, "notifyoncommand" }, - { 0x00F, "setprintchannel" }, - { 0x010, "print" }, - { 0x011, "println" }, - { 0x012, "print3d" }, - { 0x013, "line" }, - { 0x014, "box" }, - { 0x015, "orientedbox" }, - { 0x016, "sphere" }, - { 0x017, "cylinder" }, - { 0x018, "spawnturret" }, - { 0x019, "canspawnturret" }, - { 0x01A, "assert" }, - { 0x01B, "pausecinematicingame" }, - { 0x01C, "drawcompassfriendlies" }, - { 0x01D, "bulletspread" }, - { 0x01E, "bullettracer" }, - { 0x01F, "badplace_delete" }, - { 0x020, "badplace_cylinder" }, - { 0x021, "badplace_arc" }, - { 0x022, "badplace_brush" }, - { 0x023, "clearallcorpses" }, - { 0x024, "setturretnode" }, - { 0x025, "unsetturretnode" }, - { 0x026, "setnodepriority" }, - { 0x027, "_func_027" }, - { 0x028, "_func_028" }, - { 0x029, "_func_029" }, - { 0x02A, "_func_02A" }, - { 0x02B, "_func_02B" }, - { 0x02C, "updategamerprofile" }, - { 0x02D, "assertex" }, - { 0x02E, "assertmsg" }, - { 0x02F, "isdefined" }, - { 0x030, "isvalidmissile" }, - { 0x031, "isstring" }, - { 0x032, "setomnvar" }, - { 0x033, "getomnvar" }, - { 0x034, "setdvar" }, - { 0x035, "setdynamicdvar" }, - { 0x036, "setdvarifuninitialized" }, - { 0x037, "setdevdvar" }, - { 0x038, "setdevdvarifuninitialized" }, - { 0x039, "getdvar" }, - { 0x03A, "getdvarint" }, - { 0x03B, "getdvarfloat" }, - { 0x03C, "getdvarvector" }, - { 0x03D, "gettime" }, - { 0x03E, "gettimeutc" }, - { 0x03F, "getradiometricunit" }, - { 0x040, "getentbynum" }, - { 0x041, "getweaponmodel" }, - { 0x042, "getculldist" }, - { 0x043, "sethalfresparticles" }, - { 0x044, "getmapsunlight" }, - { 0x045, "setsunlight" }, - { 0x046, "resetsunlight" }, - { 0x047, "getmapsundirection" }, - { 0x048, "getmapsunangles" }, - { 0x049, "setsundirection" }, - { 0x04A, "lerpsundirection" }, - { 0x04B, "lerpsunangles" }, - { 0x04C, "resetsundirection" }, - { 0x04D, "enableforcedsunshadows" }, - { 0x04E, "enableforcednosunshadows" }, - { 0x04F, "disableforcedsunshadows" }, - { 0x050, "enableouterspacemodellighting" }, - { 0x051, "disableouterspacemodellighting" }, - { 0x052, "remapstage" }, - { 0x053, "remapstage" }, - { 0x054, "_func_054" }, - { 0x055, "_func_055" }, - { 0x056, "_func_056" }, - { 0x057, "_func_057" }, - { 0x058, "_func_058" }, - { 0x059, "_func_059" }, - { 0x05A, "_func_05A" }, - { 0x05B, "_func_05B" }, - { 0x05C, "_func_05C" }, - { 0x05D, "getweapondisplayname" }, - { 0x05E, "getweaponbasename" }, - { 0x05F, "getweaponattachments" }, - { 0x060, "getweaponattachmentdisplaynames" }, - { 0x061, "getweaponcamoname" }, - { 0x062, "getweaponreticlename" }, - { 0x063, "getanimlength" }, - { 0x064, "animhasnotetrack" }, - { 0x065, "getnotetracktimes" }, - { 0x066, "spawn" }, - { 0x067, "spawnloopsound" }, - { 0x068, "spawnloopingsound" }, - { 0x069, "bullettrace" }, - { 0x06A, "target_setmaxsize" }, - { 0x06B, "target_setcolor" }, - { 0x06C, "target_setdelay" }, - { 0x06D, "getstartorigin" }, - { 0x06E, "getstartangles" }, - { 0x06F, "getstartangles" }, - { 0x070, "_func_070" }, - { 0x071, "_func_071" }, - { 0x072, "magicgrenademanual" }, - { 0x073, "_func_073" }, - { 0x074, "_func_074" }, - { 0x075, "_func_075" }, - { 0x076, "_func_076" }, - { 0x077, "_func_077" }, - { 0x078, "_func_078" }, - { 0x079, "_func_079" }, - { 0x07A, "_func_07A" }, - { 0x07B, "_func_07B" }, - { 0x07C, "_func_07C" }, - { 0x07D, "_func_07D" }, - { 0x07E, "_func_07E" }, - { 0x07F, "_func_07F" }, - { 0x080, "_func_080" }, - { 0x081, "_func_081" }, - { 0x082, "_func_082" }, - { 0x083, "_func_083" }, - { 0x084, "_func_084" }, - { 0x085, "_func_085" }, - { 0x086, "_func_086" }, - { 0x087, "_func_087" }, - { 0x088, "_func_088" }, - { 0x089, "_func_089" }, - { 0x08A, "_func_08A" }, - { 0x08B, "bullettracepassed" }, - { 0x08C, "sighttracepassed" }, - { 0x08D, "physicstrace" }, - { 0x08E, "playerphysicstrace" }, - { 0x08F, "getgroundposition" }, - { 0x090, "getmovedelta" }, - { 0x091, "getangledelta" }, - { 0x092, "getnorthyaw" }, - { 0x093, "getnorthyaw" }, - { 0x094, "_func_094" }, - { 0x095, "_func_095" }, - { 0x096, "_func_096" }, - { 0x097, "_func_097" }, - { 0x098, "_func_098" }, - { 0x099, "_func_099" }, - { 0x09A, "_func_09A" }, - { 0x09B, "_func_09B" }, - { 0x09C, "_func_09C" }, - { 0x09D, "_func_09D" }, - { 0x09E, "_func_09E" }, - { 0x09F, "_func_09F" }, - { 0x0A0, "_func_0A0" }, - { 0x0A1, "_func_0A1" }, - { 0x0A2, "_func_0A2" }, - { 0x0A3, "_func_0A3" }, - { 0x0A4, "_func_0A4" }, - { 0x0A5, "_func_0A5" }, - { 0x0A6, "_func_0A6" }, - { 0x0A7, "_func_0A7" }, - { 0x0A8, "_func_0A8" }, - { 0x0A9, "_func_0A9" }, - { 0x0AA, "_func_0AA" }, - { 0x0AB, "_func_0AB" }, - { 0x0AC, "_func_0AC" }, - { 0x0AD, "setnorthyaw" }, - { 0x0AE, "setslowmotion" }, - { 0x0AF, "randomint" }, - { 0x0B0, "randomfloat" }, - { 0x0B1, "randomintrange" }, - { 0x0B2, "randomfloatrange" }, - { 0x0B3, "sin" }, - { 0x0B4, "cos" }, - { 0x0B5, "tan" }, - { 0x0B6, "asin" }, - { 0x0B7, "acos" }, - { 0x0B8, "atan" }, - { 0x0B9, "int" }, - { 0x0BA, "float" }, - { 0x0BB, "abs" }, - { 0x0BC, "min" }, - { 0x0BD, "objective_additionalcurrent" }, - { 0x0BE, "objective_ring" }, - { 0x0BF, "objective_setpointertextoverride" }, - { 0x0C0, "getnode" }, - { 0x0C1, "getnodearray" }, - { 0x0C2, "getallnodes" }, - { 0x0C3, "getnodesinradius" }, - { 0x0C4, "getnodesinradiussorted" }, - { 0x0C5, "getclosestnodeinsight" }, - { 0x0C6, "getreflectionlocs" }, - { 0x0C7, "getreflectionreferencelocs" }, - { 0x0C8, "getvehicletracksegment" }, - { 0x0C9, "getvehicletracksegmentarray" }, - { 0x0CA, "getallvehicletracksegments" }, - { 0x0CB, "isarray" }, - { 0x0CC, "isai" }, - { 0x0CD, "getindexforluincstring" }, - { 0x0CE, "issentient" }, - { 0x0CF, "issentient" }, - { 0x0D0, "_func_0D0" }, - { 0x0D1, "_func_0D1" }, - { 0x0D2, "_func_0D2" }, - { 0x0D3, "_func_0D3" }, - { 0x0D4, "_func_0D4" }, - { 0x0D5, "_func_0D5" }, - { 0x0D6, "_func_0D6" }, - { 0x0D7, "_func_0D7" }, - { 0x0D8, "_func_0D8" }, - { 0x0D9, "_func_0D9" }, - { 0x0DA, "_func_0DA" }, - { 0x0DB, "_func_0DB" }, - { 0x0DC, "_func_0DC" }, - { 0x0DD, "_func_0DD" }, - { 0x0DE, "max" }, - { 0x0DF, "floor" }, - { 0x0E0, "ceil" }, - { 0x0E1, "exp" }, - { 0x0E2, "log" }, - { 0x0E3, "sqrt" }, - { 0x0E4, "squared" }, - { 0x0E5, "clamp" }, - { 0x0E6, "angleclamp" }, - { 0x0E7, "angleclamp180" }, - { 0x0E8, "vectorfromlinetopoint" }, - { 0x0E9, "pointonsegmentnearesttopoint" }, - { 0x0EA, "distance" }, - { 0x0EB, "distance2d" }, - { 0x0EC, "distancesquared" }, - { 0x0ED, "length" }, - { 0x0EE, "length2d" }, - { 0x0EF, "lengthsquared" }, - { 0x0F0, "length2dsquared" }, - { 0x0F1, "closer" }, - { 0x0F2, "vectordot" }, - { 0x0F3, "vectorcross" }, - { 0x0F4, "axistoangles" }, - { 0x0F5, "visionsetthermal" }, - { 0x0F6, "visionsetpain" }, - { 0x0F7, "endlobby" }, - { 0x0F8, "setac130ambience" }, - { 0x0F9, "getmapcustom" }, - { 0x0FA, "spawnsighttrace" }, - { 0x0FB, "incrementcounter" }, - { 0x0FC, "getcountertotal" }, - { 0x0FD, "getlevelticks" }, - { 0x0FE, "perlinnoise2d" }, - { 0x0FF, "calcrockingangles" }, - { 0x100, "reconevent" }, - { 0x101, "reconspatialevent" }, - { 0x102, "setsunflareposition" }, - { 0x103, "createthreatbiasgroup" }, - { 0x104, "threatbiasgroupexists" }, - { 0x105, "getthreatbias" }, - { 0x106, "setthreatbias" }, - { 0x107, "setthreatbiasagainstall" }, - { 0x108, "setignoremegroup" }, - { 0x109, "isenemyteam" }, - { 0x10A, "objective_additionalentity" }, - { 0x10B, "objective_state_nomessage" }, - { 0x10C, "objective_string" }, - { 0x10D, "objective_string_nomessage" }, - { 0x10E, "objective_additionalposition" }, - { 0x10F, "objective_current_nomessage" }, - { 0x110, "vectornormalize" }, - { 0x111, "vectortoangles" }, - { 0x112, "vectortoyaw" }, - { 0x113, "vectorlerp" }, - { 0x114, "anglestoup" }, - { 0x115, "anglestoright" }, - { 0x116, "anglestoforward" }, - { 0x117, "anglesdelta" }, - { 0x118, "combineangles" }, - { 0x119, "transformmove" }, - { 0x11A, "rotatevector" }, - { 0x11B, "rotatepointaroundvector" }, - { 0x11C, "issubstr" }, - { 0x11D, "isendstr" }, - { 0x11E, "getsubstr" }, - { 0x11F, "tolower" }, - { 0x120, "strtok" }, - { 0x121, "stricmp" }, - { 0x122, "ambientplay" }, - { 0x123, "getuavstrengthmax" }, - { 0x124, "getuavstrengthlevelneutral" }, - { 0x125, "getuavstrengthlevelshowenemyfastsweep" }, - { 0x126, "getuavstrengthlevelshowenemydirectional" }, - { 0x127, "blockteamradar" }, - { 0x128, "unblockteamradar" }, - { 0x129, "isteamradarblocked" }, - { 0x12A, "getassignedteam" }, - { 0x12B, "setmatchdata" }, - { 0x12C, "getmatchdata" }, - { 0x12D, "sendmatchdata" }, - { 0x12E, "clearmatchdata" }, - { 0x12F, "setmatchdatadef" }, - { 0x130, "setmatchclientip" }, - { 0x131, "setmatchdataid" }, - { 0x132, "setclientmatchdata" }, - { 0x133, "getclientmatchdata" }, - { 0x134, "setclientmatchdatadef" }, - { 0x135, "sendclientmatchdata" }, - { 0x136, "getbuildversion" }, - { 0x137, "getbuildnumber" }, - { 0x138, "getsystemtime" }, - { 0x139, "getmatchrulesdata" }, - { 0x13A, "isusingmatchrulesdata" }, - { 0x13B, "kick" }, - { 0x13C, "issplitscreen" }, - { 0x13D, "setmapcenter" }, - { 0x13E, "setgameendtime" }, - { 0x13F, "visionsetnaked" }, - { 0x140, "visionsetnight" }, - { 0x141, "visionsetmissilecam" }, - { 0x142, "ambientstop" }, - { 0x143, "precachemodel" }, - { 0x144, "precacheshellshock" }, - { 0x145, "precacheitem" }, - { 0x146, "precacheshader" }, - { 0x147, "precachestring" }, - { 0x148, "precachemenu" }, - { 0x149, "precacherumble" }, - { 0x14A, "precachelocationselector" }, - { 0x14B, "precacheleaderboards" }, - { 0x14C, "loadfx" }, - { 0x14D, "playfx" }, - { 0x14E, "playfxontag" }, - { 0x14F, "stopfxontag" }, - { 0x150, "killfxontag" }, - { 0x151, "playloopedfx" }, - { 0x152, "spawnfx" }, - { 0x153, "triggerfx" }, - { 0x154, "playfxontagforclients" }, - { 0x155, "setwinningteam" }, - { 0x156, "announcement" }, - { 0x157, "clientannouncement" }, - { 0x158, "setteammode" }, - { 0x159, "getteamscore" }, - { 0x15A, "setteamscore" }, - { 0x15B, "setclientnamemode" }, - { 0x15C, "updateclientnames" }, - { 0x15D, "getteamplayersalive" }, - { 0x15E, "logprint" }, - { 0x15F, "worldentnumber" }, - { 0x160, "obituary" }, - { 0x161, "positionwouldtelefrag" }, - { 0x162, "canspawn" }, - { 0x163, "getstarttime" }, - { 0x164, "precachestatusicon" }, - { 0x165, "precacheheadicon" }, - { 0x166, "precacheminimapicon" }, - { 0x167, "precachempanim" }, - { 0x168, "map_restart" }, - { 0x169, "map_restart" }, - { 0x16A, "exitlevel" }, - { 0x16B, "exitlevel" }, - { 0x16C, "_func_16C" }, - { 0x16D, "_func_16D" }, - { 0x16E, "_func_16E" }, - { 0x16F, "_func_16F" }, - { 0x170, "_func_170" }, - { 0x171, "_func_171" }, - { 0x172, "_func_172" }, - { 0x173, "_func_173" }, - { 0x174, "setplayerteamrank" }, - { 0x175, "endparty" }, - { 0x176, "setteamradar" }, - { 0x177, "getteamradar" }, - { 0x178, "setteamradarstrength" }, - { 0x179, "_func_179" }, - { 0x17A, "physicsexplosionsphere" }, - { 0x17B, "physicsexplosioncylinder" }, - { 0x17C, "physicsjolt" }, - { 0x17D, "physicsjitter" }, - { 0x17E, "setexpfog" }, - { 0x17F, "setexpfogext" }, - { 0x180, "setexpfogdvarsonly" }, - { 0x181, "setexpfogextdvarsonly" }, - { 0x182, "setatmosfog" }, - { 0x183, "setatmosfogdvarsonly" }, - { 0x184, "isexplosivedamagemod" }, - { 0x185, "radiusdamage" }, - { 0x186, "setplayerignoreradiusdamage" }, - { 0x187, "glassradiusdamage" }, - { 0x188, "earthquake" }, - { 0x189, "getnumparts" }, - { 0x18A, "objective_onentity" }, - { 0x18B, "objective_onentitywithrotation" }, - { 0x18C, "objective_team" }, - { 0x18D, "objective_player" }, - { 0x18E, "objective_playerteam" }, - { 0x18F, "objective_playerenemyteam" }, - { 0x190, "objective_playermask_hidefromall" }, - { 0x191, "objective_playermask_hidefrom" }, - { 0x192, "objective_playermask_showtoall" }, - { 0x193, "objective_playermask_showto" }, - { 0x194, "iprintln" }, - { 0x195, "iprintlnbold" }, - { 0x196, "logstring" }, - { 0x197, "getent" }, - { 0x198, "getentarray" }, - { 0x199, "getspawnarray" }, - { 0x19A, "spawnplane" }, - { 0x19B, "spawnstruct" }, - { 0x19C, "spawnhelicopter" }, - { 0x19D, "isalive" }, - { 0x19E, "isspawner" }, - { 0x19F, "missile_createattractorent" }, - { 0x1A0, "missile_createattractororigin" }, - { 0x1A1, "missile_createrepulsorent" }, - { 0x1A2, "missile_createrepulsororigin" }, - { 0x1A3, "missile_deleteattractor" }, - { 0x1A4, "playsoundatpos" }, - { 0x1A5, "newhudelem" }, - { 0x1A6, "newclienthudelem" }, - { 0x1A7, "newteamhudelem" }, - { 0x1A8, "resettimeout" }, - { 0x1A9, "isplayer" }, - { 0x1AA, "isplayernumber" }, - { 0x1AB, "getpartname" }, - { 0x1AC, "weaponfiretime" }, - { 0x1AD, "weaponclipsize" }, - { 0x1AE, "weaponisauto" }, - { 0x1AF, "weaponissemiauto" }, - { 0x1B0, "weaponisboltaction" }, - { 0x1B1, "weaponinheritsperks" }, - { 0x1B2, "weaponburstcount" }, - { 0x1B3, "weapontype" }, - { 0x1B4, "weaponclass" }, - { 0x1B5, "getnextarraykey" }, - { 0x1B6, "sortbydistance" }, - { 0x1B7, "tablelookup" }, - { 0x1B8, "tablelookupbyrow" }, - { 0x1B9, "tablelookupistring" }, - { 0x1BA, "tablelookupistringbyrow" }, - { 0x1BB, "tablelookuprownum" }, - { 0x1BC, "tableexists" }, - { 0x1BD, "getmissileowner" }, - { 0x1BE, "magicbullet" }, - { 0x1BF, "getweaponflashtagname" }, - { 0x1C0, "averagepoint" }, - { 0x1C1, "averagenormal" }, - { 0x1C2, "vehicle_getspawnerarray" }, - { 0x1C3, "playrumbleonposition" }, - { 0x1C4, "playrumblelooponposition" }, - { 0x1C5, "stopallrumbles" }, - { 0x1C6, "soundexists" }, - { 0x1C7, "openfile" }, - { 0x1C8, "closefile" }, - { 0x1C9, "fprintln" }, - { 0x1CA, "fprintfields" }, - { 0x1CB, "freadln" }, - { 0x1CC, "fgetarg" }, - { 0x1CD, "setminimap" }, - { 0x1CE, "setthermalbodymaterial" }, - { 0x1CF, "getarraykeys" }, - { 0x1D0, "getfirstarraykey" }, - { 0x1D1, "getglass" }, - { 0x1D2, "getglassarray" }, - { 0x1D3, "getglassorigin" }, - { 0x1D4, "isglassdestroyed" }, - { 0x1D5, "destroyglass" }, - { 0x1D6, "deleteglass" }, - { 0x1D7, "getentchannelscount" }, - { 0x1D8, "getentchannelname" }, - { 0x1D9, "objective_add" }, - { 0x1DA, "objective_delete" }, - { 0x1DB, "objective_state" }, - { 0x1DC, "objective_icon" }, - { 0x1DD, "objective_position" }, - { 0x1DE, "objective_current" }, - { 0x1DF, "objective_current" }, - { 0x1E0, "weaponinventorytype" }, - { 0x1E1, "_func_1E1" }, - { 0x1E2, "weaponmaxammo" }, - { 0x1E3, "weaponaltweaponname" }, - { 0x1E4, "_func_1E4" }, - { 0x1E5, "_func_1E5" }, - { 0x1E6, "isweaponmanuallydetonatedbyemptythrow" }, - { 0x1E7, "getvehiclenode" }, - { 0x1E8, "getvehiclenodearray" }, - { 0x1E9, "getallvehiclenodes" }, - { 0x1EA, "getnumvehicles" }, - { 0x1EB, "precachevehicle" }, - { 0x1EC, "spawnvehicle" }, - { 0x1ED, "vehicle_getarray" }, - { 0x1EE, "pow" }, - { 0x1EF, "angleclamp360" }, - { 0x1F0, "botgetmemoryevents" }, - { 0x1F1, "botautoconnectenabled" }, - { 0x1F2, "botzonegetcount" }, - { 0x1F3, "botzonesetteam" }, - { 0x1F4, "botzonenearestcount" }, - { 0x1F5, "botmemoryflags" }, - { 0x1F6, "botflagmemoryevents" }, - { 0x1F7, "botzonegetindoorpercent" }, - { 0x1F8, "botsentientswap" }, - { 0x1F9, "isbot" }, - { 0x1FA, "isagent" }, - { 0x1FB, "isagent" }, - { 0x1FC, "_func_1FC" }, - { 0x1FD, "_func_1FD" }, - { 0x1FE, "_func_1FE" }, - { 0x1FF, "getnodesintrigger" }, - { 0x200, "_func_200" }, - { 0x201, "_func_201" }, - { 0x202, "_func_202" }, - { 0x203, "_func_203" }, - { 0x204, "_func_204" }, - { 0x205, "_func_205" }, - { 0x206, "_func_206" }, - { 0x207, "_func_207" }, - { 0x208, "_func_208" }, - { 0x209, "_func_209" }, - { 0x20A, "_func_20A" }, - { 0x20B, "_func_20B" }, - { 0x20C, "_func_20C" }, - { 0x20D, "nodeexposedtosky" }, - { 0x20E, "badplace_global" }, - { 0x20F, "getpathdist" }, - { 0x210, "getlinkednodes" }, - { 0x211, "disconnectnodepair" }, - { 0x212, "connectnodepair" }, - { 0x213, "connectnodepair" }, - { 0x214, "_func_214" }, - { 0x215, "_func_215" }, - { 0x216, "_func_216" }, - { 0x217, "_func_217" }, - { 0x218, "_func_218" }, - { 0x219, "_func_219" }, - { 0x21A, "_func_21A" }, - { 0x21B, "_func_21B" }, - { 0x21C, "_func_21C" }, - { 0x21D, "_func_21D" }, - { 0x21E, "_func_21E" }, - { 0x21F, "_func_21F" }, - { 0x220, "_func_220" }, - { 0x221, "distance2dsquared" }, - { 0x222, "_func_222" }, - { 0x223, "_func_223" }, - { 0x224, "_func_224" }, - { 0x225, "_func_225" }, - { 0x226, "_func_226" }, - { 0x227, "_func_227" }, - { 0x228, "_func_228" }, - { 0x229, "_func_229" }, - { 0x22A, "_func_22A" }, - { 0x22B, "_func_22B" }, - { 0x22C, "_func_22C" }, - { 0x22D, "_func_22D" }, - { 0x22E, "_func_22E" }, - { 0x22F, "_func_22F" }, - { 0x230, "_func_230" }, - { 0x231, "_func_231" }, - { 0x232, "_func_232" }, - { 0x233, "_func_233" }, - { 0x234, "_func_234" }, - { 0x235, "_func_235" }, - { 0x236, "isusinghdr" }, - { 0x237, "_func_237" }, - { 0x238, "_func_238" }, - { 0x239, "playerphysicstraceinfo" }, - { 0x23A, "_func_23A" }, - { 0x23B, "_func_23B" }, - { 0x23C, "_func_23C" }, - { 0x23D, "_func_23D" }, - { 0x23E, "_func_23E" }, - { 0x23F, "lootserviceonendgame" }, - { 0x240, "_func_240" }, - { 0x241, "lootserviceonstartgame" }, - { 0x242, "_func_242" }, - { 0x243, "tournamentreportwinningteam" }, - { 0x244, "tournamentreportendofgame" }, - { 0x245, "_func_245" }, - { 0x246, "_func_246" }, - { 0x247, "_func_247" }, - { 0x248, "_func_248" }, - { 0x249, "_func_249" }, - { 0x24A, "_func_24A" }, - { 0x24B, "_func_24B" }, - { 0x24C, "_func_24C" }, - { 0x24D, "_func_24D" }, - { 0x24E, "_func_24E" }, - { 0x24F, "_func_24F" }, - { 0x250, "droptoground" }, - { 0x251, "_func_251" }, - { 0x252, "precachelaser" }, - { 0x253, "_func_253" }, - { 0x254, "_func_254" }, - { 0x255, "_func_255" }, - { 0x256, "_func_256" }, - { 0x257, "_func_257" }, - { 0x258, "_func_258" }, - { 0x259, "_func_259" }, - { 0x25A, "_func_25A" }, - { 0x25B, "_func_25B" }, - { 0x25C, "_func_25C" }, - { 0x25D, "_func_25D" }, - { 0x25E, "_func_25E" }, - { 0x25F, "_func_25F" }, - { 0x260, "setnojipscore" }, - { 0x261, "setnojiptime" }, - { 0x262, "_func_262" }, - { 0x263, "_func_263" }, - { 0x264, "_func_264" }, - { 0x265, "_func_265" }, - { 0x266, "_func_266" }, - { 0x267, "_func_267" }, - { 0x268, "_func_268" }, - { 0x269, "_func_269" }, - { 0x26A, "_func_26A" }, - { 0x26B, "_func_26B" }, - { 0x26C, "_func_26C" }, - { 0x26D, "_func_26D" }, - { 0x26E, "_func_26E" }, - { 0x26F, "_func_26F" }, - { 0x270, "_func_270" }, - { 0x271, "_func_271" }, - { 0x272, "_func_272" }, - { 0x273, "spawnfxforclient" }, - { 0x274, "_func_274" }, - { 0x275, "_func_275" }, - { 0x276, "_func_276" }, - { 0x277, "_func_277" }, - { 0x278, "_func_278" }, - { 0x279, "_func_279" }, - { 0x27A, "_func_27A" }, - { 0x27B, "isdedicatedserver" }, - { 0x27C, "getplaylistversion" }, - { 0x27D, "getplaylistid" }, - { 0x27E, "getactiveclientcount" }, - { 0x27F, "_func_27F" }, - { 0x280, "_func_280" }, - { 0x281, "_func_281" }, - { 0x282, "_func_282" }, - { 0x283, "_func_283" }, - { 0x284, "_func_284" }, - { 0x285, "_func_285" }, - { 0x286, "istestclient" }, - { 0x287, "istestclient" }, - { 0x288, "_func_288" }, - { 0x289, "_func_289" }, - { 0x28A, "_func_28A" }, - { 0x28B, "_func_28B" }, - { 0x28C, "_func_28C" }, - { 0x28D, "_func_28D" }, - { 0x28E, "_func_28E" }, - { 0x28F, "_func_28F" }, - { 0x290, "_func_290" }, - { 0x291, "_func_291" }, - { 0x292, "_func_292" }, - { 0x293, "_func_293" }, - { 0x294, "_func_294" }, - { 0x295, "isremovedentity" }, - { 0x296, "tablegetrowcount" }, - { 0x297, "tablegetcolumncount" }, - { 0x298, "batteryusepershot" }, - { 0x299, "batteryreqtouse" }, - { 0x29A, "isweaponmanuallydetonatedbydoubletap" }, - { 0x29B, "_func_29B" }, - { 0x29C, "_func_29C" }, - { 0x29D, "_func_29D" }, - { 0x29E, "_func_29E" }, - { 0x29F, "validatecostume" }, - { 0x2A0, "randomcostume" }, - { 0x2A1, "_func_2A1" }, - { 0x2A2, "_func_2A2" }, - { 0x2A3, "_func_2A3" }, - { 0x2A4, "_func_2A4" }, - { 0x2A5, "_func_2A5" }, - { 0x2A6, "_func_2A6" }, - { 0x2A7, "_func_2A7" }, - { 0x2A8, "_func_2A8" }, - { 0x2A9, "_func_2A9" }, - { 0x2AA, "_func_2AA" }, - { 0x2AB, "_func_2AB" }, - { 0x2AC, "_func_2AC" }, - { 0x2AD, "_func_2AD" }, - { 0x2AE, "_func_2AE" }, - { 0x2AF, "_func_2AF" }, - { 0x2B0, "_func_2B0" }, - { 0x2B1, "lootservicestarttrackingplaytime" }, - { 0x2B2, "_func_2B2" }, - { 0x2B3, "lootservicevalidateplaytime" }, - { 0x2B4, "_func_2B4" }, - { 0x2B5, "_func_2B5" }, - { 0x2B6, "_func_2B6" }, - { 0x2B7, "_func_2B7" }, - { 0x2B8, "objective_mlgspectator" }, - { 0x2B9, "_func_2B9" }, - { 0x2BA, "_func_2BA" }, - { 0x2BB, "_func_2BB" }, - { 0x2BC, "isonlinegame" }, - { 0x2BD, "issystemlink" }, - { 0x2BE, "_func_2BE" }, - { 0x2BF, "_func_2BF" }, - { 0x2C0, "_func_2C0" }, - { 0x2C1, "_func_2C1" }, - { 0x2C2, "spawnlinkedfx" }, - { 0x2C3, "_func_2C3" }, - { 0x2C4, "_func_2C4" }, - { 0x2C5, "_func_2C5" }, - { 0x2C6, "_func_2C6" }, - { 0x2C7, "_func_2C7" }, - { 0x2C8, "getchallengeid" }, - { 0x2C9, "_func_2C9" }, - { 0x2CA, "_func_2CA" }, - { 0x2CB, "_func_2CB" }, - { 0x2CC, "_func_2CC" }, - { 0x2CD, "_func_2CD" }, - { 0x2CE, "_func_2CE" }, - { 0x2CF, "getcodanywherecurrentplatform" }, - { 0x2D0, "getcostumefromtable" }, - { 0x2D1, "_func_2D1" }, - { 0x2D2, "_func_2D2" }, - { 0x2D3, "_func_2D3" }, - { 0x2D4, "getchallengerewarditem" }, - { 0x2D5, "_func_2D5" }, - { 0x2D6, "_func_2D6" }, - { 0x2D7, "nodesetremotemissilename" }, - { 0x2D8, "isshipbuild" }, - { 0x2D9, "_func_2D9" }, - { 0x2DA, "_func_2DA" }, - { 0x2DB, "_func_2DB" }, - { 0x2DC, "_func_2DC" }, - { 0x2DD, "_func_2DD" }, - { 0x2DE, "_func_2DE" }, - { 0x2DF, "_func_2DF" }, -}}; - -const std::array, 1389> method_list -{{ - { 0x8000, "thermaldrawdisable" }, - { 0x8001, "_meth_8001" }, - { 0x8002, "heli_setdamagestage" }, - { 0x8003, "playsoundtoteam" }, - { 0x8004, "playsoundtoplayer" }, - { 0x8005, "playerhide" }, - { 0x8006, "playershow" }, - { 0x8007, "showtoplayer" }, - { 0x8008, "threatdetectedtoplayer" }, - { 0x8009, "clearthreatdetected" }, - { 0x800A, "enableplayeruse" }, - { 0x800B, "disableplayeruse" }, - { 0x800C, "enableammogeneration" }, - { 0x800D, "disableammogeneration" }, - { 0x800E, "makescrambler" }, - { 0x800F, "makeportableradar" }, - { 0x8010, "clearscrambler" }, - { 0x8011, "clearportableradar" }, - { 0x8012, "placespawnpoint" }, - { 0x8013, "setteamfortrigger" }, - { 0x8014, "clientclaimtrigger" }, - { 0x8015, "clientreleasetrigger" }, - { 0x8016, "releaseclaimedtrigger" }, - { 0x8017, "isusingonlinedataoffline" }, - { 0x8018, "getrestedtime" }, - { 0x8019, "sendleaderboards" }, - { 0x801A, "isonladder" }, - { 0x801B, "getcorpseanim" }, - { 0x801C, "playerforcedeathanim" }, - { 0x801D, "attach" }, - { 0x801E, "_meth_801E" }, - { 0x801F, "_meth_801F" }, - { 0x8020, "_meth_8020" }, - { 0x8021, "_meth_8021" }, - { 0x8022, "_meth_8022" }, - { 0x8023, "startragdoll" }, - { 0x8024, "_meth_8024" }, - { 0x8025, "_meth_8025" }, - { 0x8026, "logstring" }, - { 0x8027, "_meth_8027" }, - { 0x8028, "_meth_8028" }, - { 0x8029, "_meth_8029" }, - { 0x802A, "detach" }, - { 0x802B, "detachall" }, - { 0x802C, "getattachsize" }, - { 0x802D, "getattachmodelname" }, - { 0x802E, "getattachtagname" }, - { 0x802F, "_meth_802F" }, - { 0x8030, "_meth_8030" }, - { 0x8031, "_meth_8031" }, - { 0x8032, "_meth_8032" }, - { 0x8033, "_meth_8033" }, - { 0x8034, "_meth_8034" }, - { 0x8035, "_meth_8035" }, - { 0x8036, "_meth_8036" }, - { 0x8037, "_meth_8037" }, - { 0x8038, "_meth_8038" }, - { 0x8039, "_meth_8039" }, - { 0x803A, "_meth_803A" }, - { 0x803B, "_meth_803B" }, - { 0x803C, "_meth_803C" }, - { 0x803D, "_meth_803D" }, - { 0x803E, "_meth_803E" }, - { 0x803F, "_meth_803F" }, - { 0x8040, "_meth_8040" }, - { 0x8041, "_meth_8041" }, - { 0x8042, "_meth_8042" }, - { 0x8043, "_meth_8043" }, - { 0x8044, "_meth_8044" }, - { 0x8045, "_meth_8045" }, - { 0x8046, "_meth_8046" }, - { 0x8047, "_meth_8047" }, - { 0x8048, "_meth_8048" }, - { 0x8049, "_meth_8049" }, - { 0x804A, "_meth_804A" }, - { 0x804B, "_meth_804B" }, - { 0x804C, "_meth_804C" }, - { 0x804D, "linkto" }, - { 0x804E, "_meth_804E" }, - { 0x804F, "unlink" }, - { 0x8050, "_meth_8050" }, - { 0x8051, "dodamage" }, - { 0x8052, "_meth_8052" }, - { 0x8053, "show" }, - { 0x8054, "hide" }, - { 0x8055, "_meth_8055" }, - { 0x8056, "_meth_8056" }, - { 0x8057, "disconnectpaths" }, - { 0x8058, "connectpaths" }, - { 0x8059, "_meth_8059" }, - { 0x805A, "_meth_805A" }, - { 0x805B, "_meth_805B" }, - { 0x805C, "_meth_805C" }, - { 0x805D, "_meth_805D" }, - { 0x805E, "_meth_805E" }, - { 0x805F, "_meth_805F" }, - { 0x8060, "_meth_8060" }, - { 0x8061, "_meth_8061" }, - { 0x8062, "_meth_8062" }, - { 0x8063, "_meth_8063" }, - { 0x8064, "_meth_8064" }, - { 0x8065, "_meth_8065" }, - { 0x8066, "_meth_8066" }, - { 0x8067, "_meth_8067" }, - { 0x8068, "islinked" }, - { 0x8069, "enablelinkto" }, - { 0x806A, "_meth_806A" }, - { 0x806B, "_meth_806B" }, - { 0x806C, "_meth_806C" }, - { 0x806D, "_meth_806D" }, - { 0x806E, "_meth_806E" }, - { 0x806F, "scalevolume" }, - { 0x8070, "_meth_8070" }, - { 0x8071, "_meth_8071" }, - { 0x8072, "_meth_8072" }, - { 0x8073, "_meth_8073" }, - { 0x8074, "playsoundasmaster" }, - { 0x8075, "playloopsound" }, - { 0x8076, "_meth_8076" }, - { 0x8077, "_meth_8077" }, - { 0x8078, "_meth_8078" }, - { 0x8079, "_meth_8079" }, - { 0x807A, "_meth_807A" }, - { 0x807B, "_meth_807B" }, - { 0x807C, "playerlinkto" }, - { 0x807D, "_meth_807D" }, - { 0x807E, "_meth_807E" }, - { 0x807F, "_meth_807F" }, - { 0x8080, "_meth_8080" }, - { 0x8081, "playerlinkedoffsetenable" }, - { 0x8082, "_meth_8082" }, - { 0x8083, "_meth_8083" }, - { 0x8084, "fadeovertime" }, - { 0x8085, "scaleovertime" }, - { 0x8086, "moveovertime" }, - { 0x8087, "reset" }, - { 0x8088, "destroy" }, - { 0x8089, "setpulsefx" }, - { 0x808A, "setplayernamestring" }, - { 0x808B, "changefontscaleovertime" }, - { 0x808C, "_meth_808C" }, - { 0x808D, "_meth_808D" }, - { 0x808E, "_meth_808E" }, - { 0x808F, "_meth_808F" }, - { 0x8090, "_meth_8090" }, - { 0x8091, "_meth_8091" }, - { 0x8092, "dontinterpolate" }, - { 0x8093, "_meth_8093" }, - { 0x8094, "_meth_8094" }, - { 0x8095, "getorigin" }, - { 0x8096, "_meth_8096" }, - { 0x8097, "_meth_8097" }, - { 0x8098, "_meth_8098" }, - { 0x8099, "_meth_8099" }, - { 0x809A, "playsound" }, - { 0x809B, "_meth_809B" }, - { 0x809C, "_meth_809C" }, - { 0x809D, "_meth_809D" }, - { 0x809E, "_meth_809E" }, - { 0x809F, "_meth_809F" }, - { 0x80A0, "_meth_80A0" }, - { 0x80A1, "_meth_80A1" }, - { 0x80A2, "_meth_80A2" }, - { 0x80A3, "_meth_80A3" }, - { 0x80A4, "_meth_80A4" }, - { 0x80A5, "_meth_80A5" }, - { 0x80A6, "_meth_80A6" }, - { 0x80A7, "_meth_80A7" }, - { 0x80A8, "geteye" }, - { 0x80A9, "istouching" }, - { 0x80AA, "getistouchingentities" }, - { 0x80AB, "stoploopsound" }, - { 0x80AC, "stopsounds" }, - { 0x80AD, "playrumbleonentity" }, - { 0x80AE, "_meth_80AE" }, - { 0x80AF, "stoprumble" }, - { 0x80B0, "delete" }, - { 0x80B1, "setmodel" }, - { 0x80B2, "laseron" }, - { 0x80B3, "laseroff" }, - { 0x80B4, "_meth_80B4" }, - { 0x80B5, "_meth_80B5" }, - { 0x80B6, "thermalvisionon" }, - { 0x80B7, "thermalvisionoff" }, - { 0x80B8, "thermalvisionfofoverlayon" }, - { 0x80B9, "thermalvisionfofoverlayoff" }, - { 0x80BA, "autospotoverlayon" }, - { 0x80BB, "autospotoverlayoff" }, - { 0x80BC, "seteyesonuplinkenabled" }, - { 0x80BD, "_meth_80BD" }, - { 0x80BE, "setcontents" }, - { 0x80BF, "makeusable" }, - { 0x80C0, "makeunusable" }, - { 0x80C1, "makeglobalusable" }, - { 0x80C2, "makeglobalunusable" }, - { 0x80C3, "_meth_80C3" }, - { 0x80C4, "_meth_80C4" }, - { 0x80C5, "_meth_80C5" }, - { 0x80C6, "_meth_80C6" }, - { 0x80C7, "_meth_80C7" }, - { 0x80C8, "_meth_80C8" }, - { 0x80C9, "_meth_80C9" }, - { 0x80CA, "settext" }, - { 0x80CB, "clearalltextafterhudelem" }, - { 0x80CC, "setshader" }, - { 0x80CD, "settargetent" }, - { 0x80CE, "cleartargetent" }, - { 0x80CF, "settimer" }, - { 0x80D0, "_meth_80D0" }, - { 0x80D1, "_meth_80D1" }, - { 0x80D2, "_meth_80D2" }, - { 0x80D3, "_meth_80D3" }, - { 0x80D4, "_meth_80D4" }, - { 0x80D5, "_meth_80D5" }, - { 0x80D6, "_meth_80D6" }, - { 0x80D7, "setvalue" }, - { 0x80D8, "setwaypoint" }, - { 0x80D9, "_meth_80D9" }, - { 0x80DA, "setcursorhint" }, - { 0x80DB, "sethintstring" }, - { 0x80DC, "_meth_80DC" }, - { 0x80DD, "_meth_80DD" }, - { 0x80DE, "_meth_80DE" }, - { 0x80DF, "_meth_80DF" }, - { 0x80E0, "_meth_80E0" }, - { 0x80E1, "willneverchange" }, - { 0x80E2, "_meth_80E2" }, - { 0x80E3, "_meth_80E3" }, - { 0x80E4, "_meth_80E4" }, - { 0x80E5, "_meth_80E5" }, - { 0x80E6, "_meth_80E6" }, - { 0x80E7, "_meth_80E7" }, - { 0x80E8, "_meth_80E8" }, - { 0x80E9, "_meth_80E9" }, - { 0x80EA, "_meth_80EA" }, - { 0x80EB, "_meth_80EB" }, - { 0x80EC, "_meth_80EC" }, - { 0x80ED, "_meth_80ED" }, - { 0x80EE, "_meth_80EE" }, - { 0x80EF, "_meth_80EF" }, - { 0x80F0, "_meth_80F0" }, - { 0x80F1, "_meth_80F1" }, - { 0x80F2, "_meth_80F2" }, - { 0x80F3, "_meth_80F3" }, - { 0x80F4, "_meth_80F4" }, - { 0x80F5, "_meth_80F5" }, - { 0x80F6, "_meth_80F6" }, - { 0x80F7, "_meth_80F7" }, - { 0x80F8, "_meth_80F8" }, - { 0x80F9, "_meth_80F9" }, - { 0x80FA, "_meth_80FA" }, - { 0x80FB, "_meth_80FB" }, - { 0x80FC, "_meth_80FC" }, - { 0x80FD, "_meth_80FD" }, - { 0x80FE, "_meth_80FE" }, - { 0x80FF, "_meth_80FF" }, - { 0x8100, "_meth_8100" }, - { 0x8101, "_meth_8101" }, - { 0x8102, "_meth_8102" }, - { 0x8103, "_meth_8103" }, - { 0x8104, "_meth_8104" }, - { 0x8105, "_meth_8105" }, - { 0x8106, "_meth_8106" }, - { 0x8107, "_meth_8107" }, - { 0x8108, "_meth_8108" }, - { 0x8109, "_meth_8109" }, - { 0x810A, "_meth_810A" }, - { 0x810B, "_meth_810B" }, - { 0x810C, "_meth_810C" }, - { 0x810D, "_meth_810D" }, - { 0x810E, "_meth_810E" }, - { 0x810F, "_meth_810F" }, - { 0x8110, "_meth_8110" }, - { 0x8111, "_meth_8111" }, - { 0x8112, "_meth_8112" }, - { 0x8113, "_meth_8113" }, - { 0x8114, "_meth_8114" }, - { 0x8115, "_meth_8115" }, - { 0x8116, "_meth_8116" }, - { 0x8117, "_meth_8117" }, - { 0x8118, "_meth_8118" }, - { 0x8119, "_meth_8119" }, - { 0x811A, "_meth_811A" }, - { 0x811B, "_meth_811B" }, - { 0x811C, "_meth_811C" }, - { 0x811D, "_meth_811D" }, - { 0x811E, "_meth_811E" }, - { 0x811F, "_meth_811F" }, - { 0x8120, "_meth_8120" }, - { 0x8121, "_meth_8121" }, - { 0x8122, "_meth_8122" }, - { 0x8123, "_meth_8123" }, - { 0x8124, "_meth_8124" }, - { 0x8125, "_meth_8125" }, - { 0x8126, "_meth_8126" }, - { 0x8127, "_meth_8127" }, - { 0x8128, "_meth_8128" }, - { 0x8129, "_meth_8129" }, - { 0x812A, "_meth_812A" }, - { 0x812B, "_meth_812B" }, - { 0x812C, "_meth_812C" }, - { 0x812D, "_meth_812D" }, - { 0x812E, "ismeleeing" }, - { 0x812F, "_meth_812F" }, - { 0x8130, "allowmelee" }, - { 0x8131, "_meth_8131" }, - { 0x8132, "_meth_8132" }, - { 0x8133, "_meth_8133" }, - { 0x8134, "_meth_8134" }, - { 0x8135, "_meth_8135" }, - { 0x8136, "_meth_8136" }, - { 0x8137, "_meth_8137" }, - { 0x8138, "_meth_8138" }, - { 0x8139, "_meth_8139" }, - { 0x813A, "freeentitysentient" }, - { 0x813B, "_meth_813B" }, - { 0x813C, "_meth_813C" }, - { 0x813D, "_meth_813D" }, - { 0x813E, "_meth_813E" }, - { 0x813F, "_meth_813F" }, - { 0x8140, "_meth_8140" }, - { 0x8141, "_meth_8141" }, - { 0x8142, "_meth_8142" }, - { 0x8143, "_meth_8143" }, - { 0x8144, "_meth_8144" }, - { 0x8145, "_meth_8145" }, - { 0x8146, "_meth_8146" }, - { 0x8147, "_meth_8147" }, - { 0x8148, "_meth_8148" }, - { 0x8149, "_meth_8149" }, - { 0x814A, "_meth_814A" }, - { 0x814B, "_meth_814B" }, - { 0x814C, "_meth_814C" }, - { 0x814D, "_meth_814D" }, - { 0x814E, "_meth_814E" }, - { 0x814F, "_meth_814F" }, - { 0x8150, "_meth_8150" }, - { 0x8151, "_meth_8151" }, - { 0x8152, "_meth_8152" }, - { 0x8153, "_meth_8153" }, - { 0x8154, "_meth_8154" }, - { 0x8155, "_meth_8155" }, - { 0x8156, "_meth_8156" }, - { 0x8157, "_meth_8157" }, - { 0x8158, "_meth_8158" }, - { 0x8159, "_meth_8159" }, - { 0x815A, "_meth_815A" }, - { 0x815B, "_meth_815B" }, - { 0x815C, "_meth_815C" }, - { 0x815D, "_meth_815D" }, - { 0x815E, "_meth_815E" }, - { 0x815F, "_meth_815F" }, - { 0x8160, "_meth_8160" }, - { 0x8161, "_meth_8161" }, - { 0x8162, "_meth_8162" }, - { 0x8163, "_meth_8163" }, - { 0x8164, "_meth_8164" }, - { 0x8165, "_meth_8165" }, - { 0x8166, "_meth_8166" }, - { 0x8167, "_meth_8167" }, - { 0x8168, "_meth_8168" }, - { 0x8169, "_meth_8169" }, - { 0x816A, "_meth_816A" }, - { 0x816B, "_meth_816B" }, - { 0x816C, "_meth_816C" }, - { 0x816D, "_meth_816D" }, - { 0x816E, "_meth_816E" }, - { 0x816F, "_meth_816F" }, - { 0x8170, "_meth_8170" }, - { 0x8171, "_meth_8171" }, - { 0x8172, "_meth_8172" }, - { 0x8173, "_meth_8173" }, - { 0x8174, "_meth_8174" }, - { 0x8175, "_meth_8175" }, - { 0x8176, "_meth_8176" }, - { 0x8177, "setthreatbiasgroup" }, - { 0x8178, "_meth_8178" }, - { 0x8179, "_meth_8179" }, - { 0x817A, "_meth_817A" }, - { 0x817B, "_meth_817B" }, - { 0x817C, "getstance" }, - { 0x817D, "setstance" }, - { 0x817E, "itemweaponsetammo" }, - { 0x817F, "getammocount" }, - { 0x8180, "gettagorigin" }, - { 0x8181, "gettagangles" }, - { 0x8182, "shellshock" }, - { 0x8183, "stunplayer" }, - { 0x8184, "stopshellshock" }, - { 0x8185, "_meth_8185" }, - { 0x8186, "setdepthoffield" }, - { 0x8187, "_meth_8187" }, - { 0x8188, "_meth_8188" }, - { 0x8189, "_meth_8189" }, - { 0x818A, "_meth_818A" }, - { 0x818B, "_meth_818B" }, - { 0x818C, "_meth_818C" }, - { 0x818D, "_meth_818D" }, - { 0x818E, "_meth_818E" }, - { 0x818F, "_meth_818F" }, - { 0x8190, "_meth_8190" }, - { 0x8191, "_meth_8191" }, - { 0x8192, "_meth_8192" }, - { 0x8193, "_meth_8193" }, - { 0x8194, "_meth_8194" }, - { 0x8195, "_meth_8195" }, - { 0x8196, "_meth_8196" }, - { 0x8197, "_meth_8197" }, - { 0x8198, "_meth_8198" }, - { 0x8199, "_meth_8199" }, - { 0x819A, "_meth_819A" }, - { 0x819B, "_meth_819B" }, - { 0x819C, "_meth_819C" }, - { 0x819D, "_meth_819D" }, - { 0x819E, "_meth_819E" }, - { 0x819F, "_meth_819F" }, - { 0x81A0, "_meth_81A0" }, - { 0x81A1, "_meth_81A1" }, - { 0x81A2, "_meth_81A2" }, - { 0x81A3, "_meth_81A3" }, - { 0x81A4, "_meth_81A4" }, - { 0x81A5, "_meth_81A5" }, - { 0x81A6, "_meth_81A6" }, - { 0x81A7, "_meth_81A7" }, - { 0x81A8, "_meth_81A8" }, - { 0x81A9, "_meth_81A9" }, - { 0x81AA, "_meth_81AA" }, - { 0x81AB, "_meth_81AB" }, - { 0x81AC, "_meth_81AC" }, - { 0x81AD, "_meth_81AD" }, - { 0x81AE, "_meth_81AE" }, - { 0x81AF, "_meth_81AF" }, - { 0x81B0, "_meth_81B0" }, - { 0x81B1, "getentitynumber" }, - { 0x81B2, "getentityvelocity" }, - { 0x81B3, "_meth_81B3" }, - { 0x81B4, "_meth_81B4" }, - { 0x81B5, "enableaimassist" }, - { 0x81B6, "_meth_81B6" }, - { 0x81B7, "_meth_81B7" }, - { 0x81B8, "_meth_81B8" }, - { 0x81B9, "_meth_81B9" }, - { 0x81BA, "_meth_81BA" }, - { 0x81BB, "_meth_81BB" }, - { 0x81BC, "_meth_81BC" }, - { 0x81BD, "_meth_81BD" }, - { 0x81BE, "_meth_81BE" }, - { 0x81BF, "_meth_81BF" }, - { 0x81C0, "_meth_81C0" }, - { 0x81C1, "_meth_81C1" }, - { 0x81C2, "_meth_81C2" }, - { 0x81C3, "_meth_81C3" }, - { 0x81C4, "_meth_81C4" }, - { 0x81C5, "_meth_81C5" }, - { 0x81C6, "_meth_81C6" }, - { 0x81C7, "_meth_81C7" }, - { 0x81C8, "_meth_81C8" }, - { 0x81C9, "_meth_81C9" }, - { 0x81CA, "_meth_81CA" }, - { 0x81CB, "_meth_81CB" }, - { 0x81CC, "_meth_81CC" }, - { 0x81CD, "_meth_81CD" }, - { 0x81CE, "_meth_81CE" }, - { 0x81CF, "_meth_81CF" }, - { 0x81D0, "_meth_81D0" }, - { 0x81D1, "_meth_81D1" }, - { 0x81D2, "_meth_81D2" }, - { 0x81D3, "_meth_81D3" }, - { 0x81D4, "disableaimassist" }, - { 0x81D5, "entityradiusdamage" }, - { 0x81D6, "detonate" }, - { 0x81D7, "damageconetrace" }, - { 0x81D8, "sightconetrace" }, - { 0x81D9, "missile_settargetent" }, - { 0x81DA, "_meth_81DA" }, - { 0x81DB, "_meth_81DB" }, - { 0x81DC, "missile_setflightmodedirect" }, - { 0x81DD, "missile_setflightmodetop" }, - { 0x81DE, "_meth_81DE" }, - { 0x81DF, "_meth_81DF" }, - { 0x81E0, "isragdoll" }, - { 0x81E1, "setmovespeedscale" }, - { 0x81E2, "cameralinkto" }, - { 0x81E3, "cameraunlink" }, - { 0x81E4, "_meth_81E4" }, - { 0x81E5, "_meth_81E5" }, - { 0x81E6, "_meth_81E6" }, - { 0x81E7, "_meth_81E7" }, - { 0x81E8, "_meth_81E8" }, - { 0x81E9, "_meth_81E9" }, - { 0x81EA, "_meth_81EA" }, - { 0x81EB, "_meth_81EB" }, - { 0x81EC, "_meth_81EC" }, - { 0x81ED, "_meth_81ED" }, - { 0x81EE, "_meth_81EE" }, - { 0x81EF, "_meth_81EF" }, - { 0x81F0, "_meth_81F0" }, - { 0x81F1, "_meth_81F1" }, - { 0x81F2, "_meth_81F2" }, - { 0x81F3, "_meth_81F3" }, - { 0x81F4, "_meth_81F4" }, - { 0x81F5, "_meth_81F5" }, - { 0x81F6, "_meth_81F6" }, - { 0x81F7, "_meth_81F7" }, - { 0x81F8, "_meth_81F8" }, - { 0x81F9, "_meth_81F9" }, - { 0x81FA, "_meth_81FA" }, - { 0x81FB, "_meth_81FB" }, - { 0x81FC, "_meth_81FC" }, - { 0x81FD, "_meth_81FD" }, - { 0x81FE, "_meth_81FE" }, - { 0x81FF, "_meth_81FF" }, - { 0x8200, "controlslinkto" }, - { 0x8201, "controlsunlink" }, - { 0x8202, "_meth_8202" }, - { 0x8203, "_meth_8203" }, - { 0x8204, "_meth_8204" }, - { 0x8205, "_meth_8205" }, - { 0x8206, "_meth_8206" }, - { 0x8207, "_meth_8207" }, - { 0x8208, "_meth_8208" }, - { 0x8209, "_meth_8209" }, - { 0x820A, "_meth_820A" }, - { 0x820B, "_meth_820B" }, - { 0x820C, "_meth_820C" }, - { 0x820D, "_meth_820D" }, - { 0x820E, "_meth_820E" }, - { 0x820F, "_meth_820F" }, - { 0x8210, "_meth_8210" }, - { 0x8211, "_meth_8211" }, - { 0x8212, "setmotiontrackervisible" }, - { 0x8213, "_meth_8213" }, - { 0x8214, "_meth_8214" }, - { 0x8215, "_meth_8215" }, - { 0x8216, "getpointinbounds" }, - { 0x8217, "_meth_8217" }, - { 0x8218, "_meth_8218" }, - { 0x8219, "_meth_8219" }, - { 0x821A, "_meth_821A" }, - { 0x821B, "setweaponhudiconoverride" }, - { 0x821C, "_meth_821C" }, - { 0x821D, "setempjammed" }, - { 0x821E, "playersetexpfogext" }, - { 0x821F, "_meth_821F" }, - { 0x8220, "playersetatmosfog" }, - { 0x8221, "isitemunlocked" }, - { 0x8222, "getplayerdata" }, - { 0x8223, "getrankedplayerdata" }, - { 0x8224, "_meth_8224" }, - { 0x8225, "_meth_8225" }, - { 0x8226, "getcommonplayerdata" }, - { 0x8227, "_meth_8227" }, - { 0x8228, "_meth_8228" }, - { 0x8229, "_meth_8229" }, - { 0x822A, "_meth_822A" }, - { 0x822B, "_meth_822B" }, - { 0x822C, "crash" }, - { 0x822D, "launch" }, - { 0x822E, "_meth_822E" }, - { 0x822F, "_meth_822F" }, - { 0x8230, "_meth_8230" }, - { 0x8231, "_meth_8231" }, - { 0x8232, "_meth_8232" }, - { 0x8233, "_meth_8233" }, - { 0x8234, "_meth_8234" }, - { 0x8235, "_meth_8235" }, - { 0x8236, "_meth_8236" }, - { 0x8237, "_meth_8237" }, - { 0x8238, "_meth_8238" }, - { 0x8239, "_meth_8239" }, - { 0x823A, "_meth_823A" }, - { 0x823B, "_meth_823B" }, - { 0x823C, "_meth_823C" }, - { 0x823D, "_meth_823D" }, - { 0x823E, "_meth_823E" }, - { 0x823F, "_meth_823F" }, - { 0x8240, "_meth_8240" }, - { 0x8241, "_meth_8241" }, - { 0x8242, "_meth_8242" }, - { 0x8243, "setplayerdata" }, - { 0x8244, "setrankedplayerdata" }, - { 0x8245, "_meth_8245" }, - { 0x8246, "_meth_8246" }, - { 0x8247, "setcommonplayerdata" }, - { 0x8248, "getcacplayerdata" }, - { 0x8249, "_meth_8249" }, - { 0x824A, "_meth_824A" }, - { 0x824B, "pingplayer" }, - { 0x824C, "buttonpressed" }, - { 0x824D, "sayall" }, - { 0x824E, "sayteam" }, - { 0x824F, "setspawnweapon" }, - { 0x8250, "dropitem" }, - { 0x8251, "dropscavengerbag" }, - { 0x8252, "_meth_8252" }, - { 0x8253, "_meth_8253" }, - { 0x8254, "_meth_8254" }, - { 0x8255, "_meth_8255" }, - { 0x8256, "_meth_8256" }, - { 0x8257, "_meth_8257" }, - { 0x8258, "_meth_8258" }, - { 0x8259, "_meth_8259" }, - { 0x825A, "_meth_825A" }, - { 0x825B, "_meth_825B" }, - { 0x825C, "_meth_825C" }, - { 0x825D, "_meth_825D" }, - { 0x825E, "_meth_825E" }, - { 0x825F, "_meth_825F" }, - { 0x8260, "_meth_8260" }, - { 0x8261, "_meth_8261" }, - { 0x8262, "_meth_8262" }, - { 0x8263, "_meth_8263" }, - { 0x8264, "_meth_8264" }, - { 0x8265, "_meth_8265" }, - { 0x8266, "_meth_8266" }, - { 0x8267, "_meth_8267" }, - { 0x8268, "_meth_8268" }, - { 0x8269, "_meth_8269" }, - { 0x826A, "finishplayerdamage" }, - { 0x826B, "suicide" }, - { 0x826C, "closeingamemenu" }, - { 0x826D, "iclientprintln" }, - { 0x826E, "iclientprintlnbold" }, - { 0x826F, "spawn" }, - { 0x8270, "_meth_8270" }, - { 0x8271, "cloneplayer" }, - { 0x8272, "_meth_8272" }, - { 0x8273, "allowspectateteam" }, - { 0x8274, "forcespectatepov" }, - { 0x8275, "getguid" }, - { 0x8276, "physicslaunchserver" }, - { 0x8277, "_meth_8277" }, - { 0x8278, "clonebrushmodeltoscriptmodel" }, - { 0x8279, "scriptmodelplayanim" }, - { 0x827A, "_meth_827A" }, - { 0x827B, "scriptmodelplayanimdeltamotion" }, - { 0x827C, "_meth_827C" }, - { 0x827D, "_meth_827D" }, - { 0x827E, "_meth_827E" }, - { 0x827F, "_meth_827F" }, - { 0x8280, "_meth_8280" }, - { 0x8281, "_meth_8281" }, - { 0x8282, "vehicle_finishdamage" }, - { 0x8283, "_meth_8283" }, - { 0x8284, "_meth_8284" }, - { 0x8285, "_meth_8285" }, - { 0x8286, "_meth_8286" }, - { 0x8287, "_meth_8287" }, - { 0x8288, "_meth_8288" }, - { 0x8289, "_meth_8289" }, - { 0x828A, "_meth_828A" }, - { 0x828B, "_meth_828B" }, - { 0x828C, "_meth_828C" }, - { 0x828D, "_meth_828D" }, - { 0x828E, "_meth_828E" }, - { 0x828F, "_meth_828F" }, - { 0x8290, "_meth_8290" }, - { 0x8291, "_meth_8291" }, - { 0x8292, "_meth_8292" }, - { 0x8293, "_meth_8293" }, - { 0x8294, "_meth_8294" }, - { 0x8295, "_meth_8295" }, - { 0x8296, "_meth_8296" }, - { 0x8297, "getxuid" }, - { 0x8298, "getucdidhigh" }, - { 0x8299, "getucdidlow" }, - { 0x829A, "getclanidhigh" }, - { 0x829B, "getclanidlow" }, - { 0x829C, "ishost" }, - { 0x829D, "getspectatingplayer" }, - { 0x829E, "_meth_829E" }, - { 0x829F, "updatescores" }, - { 0x82A0, "updatedmscores" }, - { 0x82A1, "setrank" }, - { 0x82A2, "_meth_82A2" }, - { 0x82A3, "_meth_82A3" }, - { 0x82A4, "visionsyncwithplayer" }, - { 0x82A5, "_meth_82A5" }, - { 0x82A6, "setperk" }, - { 0x82A7, "hasperk" }, - { 0x82A8, "clearperks" }, - { 0x82A9, "unsetperk" }, - { 0x82AA, "registerparty" }, - { 0x82AB, "getfireteammembers" }, - { 0x82AC, "_meth_82AC" }, - { 0x82AD, "_meth_82AD" }, - { 0x82AE, "moveto" }, - { 0x82AF, "_meth_82AF" }, - { 0x82B0, "_meth_82B0" }, - { 0x82B1, "movez" }, - { 0x82B2, "_meth_82B2" }, - { 0x82B3, "_meth_82B3" }, - { 0x82B4, "_meth_82B4" }, - { 0x82B5, "_meth_82B5" }, - { 0x82B6, "_meth_82B6" }, - { 0x82B7, "rotateyaw" }, - { 0x82B8, "_meth_82B8" }, - { 0x82B9, "_meth_82B9" }, - { 0x82BA, "_meth_82BA" }, - { 0x82BB, "_meth_82BB" }, - { 0x82BC, "_meth_82BC" }, - { 0x82BD, "rotatevelocity" }, - { 0x82BE, "solid" }, - { 0x82BF, "notsolid" }, - { 0x82C0, "setcandamage" }, - { 0x82C1, "setcanradiusdamage" }, - { 0x82C2, "_meth_82C2" }, - { 0x82C3, "_meth_82C3" }, - { 0x82C4, "_meth_82C4" }, - { 0x82C5, "setcarddisplayslot" }, - { 0x82C6, "kc_regweaponforfxremoval" }, - { 0x82C7, "laststandrevive" }, - { 0x82C8, "startlaststand" }, - { 0x82C9, "setspectatedefaults" }, - { 0x82CA, "_meth_82CA" }, - { 0x82CB, "disableweaponpickup" }, - { 0x82CC, "enableweaponpickup" }, - { 0x82CD, "issplitscreenplayer" }, - { 0x82CE, "getweaponslistoffhands" }, - { 0x82CF, "getweaponslistitems" }, - { 0x82D0, "getweaponslistexclusives" }, - { 0x82D1, "getweaponslist" }, - { 0x82D2, "_meth_82D2" }, - { 0x82D3, "_meth_82D3" }, - { 0x82D4, "visionsetnakedforplayer" }, - { 0x82D5, "_meth_82D5" }, - { 0x82D6, "visionsetmissilecamforplayer" }, - { 0x82D7, "visionsetthermalforplayer" }, - { 0x82D8, "_meth_82D8" }, - { 0x82D9, "setblurforplayer" }, - { 0x82DA, "_meth_82DA" }, - { 0x82DB, "_meth_82DB" }, - { 0x82DC, "_meth_82DC" }, - { 0x82DD, "notifyonplayercommand" }, - { 0x82DE, "_meth_82DE" }, - { 0x82DF, "forcemantle" }, - { 0x82E0, "ismantling" }, - { 0x82E1, "playfx" }, - { 0x82E2, "playerrecoilscaleon" }, - { 0x82E3, "playerrecoilscaleoff" }, - { 0x82E4, "weaponlockstart" }, - { 0x82E5, "weaponlockfinalize" }, - { 0x82E6, "weaponlockfree" }, - { 0x82E7, "weaponlocktargettooclose" }, - { 0x82E8, "issplitscreenplayerprimary" }, - { 0x82E9, "_meth_82E9" }, - { 0x82EA, "issighted" }, - { 0x82EB, "getsightedplayers" }, - { 0x82EC, "_meth_82EC" }, - { 0x82ED, "getviewmodel" }, - { 0x82EE, "fragbuttonpressed" }, - { 0x82EF, "secondaryoffhandbuttonpressed" }, - { 0x82F0, "_meth_82F0" }, - { 0x82F1, "_meth_82F1" }, - { 0x82F2, "_meth_82F2" }, - { 0x82F3, "_meth_82F3" }, - { 0x82F4, "playlocalsound" }, - { 0x82F5, "stoplocalsound" }, - { 0x82F6, "setweaponammoclip" }, - { 0x82F7, "setweaponammostock" }, - { 0x82F8, "getweaponammoclip" }, - { 0x82F9, "getweaponammostock" }, - { 0x82FA, "anyammoforweaponmodes" }, - { 0x82FB, "setclientomnvar" }, - { 0x82FC, "setclientdvar" }, - { 0x82FD, "setclientdvars" }, - { 0x82FE, "setclientspawnsighttraces" }, - { 0x82FF, "clientspawnsighttracepassed" }, - { 0x8300, "_meth_8300" }, - { 0x8301, "allowjump" }, - { 0x8302, "_meth_8302" }, - { 0x8303, "_meth_8303" }, - { 0x8304, "_meth_8304" }, - { 0x8305, "_meth_8305" }, - { 0x8306, "resetspreadoverride" }, - { 0x8307, "setaimspreadmovementscale" }, - { 0x8308, "setactionslot" }, - { 0x8309, "setviewkickscale" }, - { 0x830A, "_meth_830A" }, - { 0x830B, "getweaponslistall" }, - { 0x830C, "getweaponslistprimaries" }, - { 0x830D, "_meth_830D" }, - { 0x830E, "giveweapon" }, - { 0x830F, "takeweapon" }, - { 0x8310, "takeallweapons" }, - { 0x8311, "getcurrentweapon" }, - { 0x8312, "getcurrentprimaryweapon" }, - { 0x8313, "_meth_8313" }, - { 0x8314, "hasweapon" }, - { 0x8315, "switchtoweapon" }, - { 0x8316, "switchtoweaponimmediate" }, - { 0x8317, "gethybridsightenabled" }, - { 0x8318, "_meth_8318" }, - { 0x8319, "settacticalweapon" }, - { 0x831A, "gettacticalweapon" }, - { 0x831B, "beginlocationselection" }, - { 0x831C, "endlocationselection" }, - { 0x831D, "disableweapons" }, - { 0x831E, "enableweapons" }, - { 0x831F, "disableoffhandweapons" }, - { 0x8320, "enableoffhandweapons" }, - { 0x8321, "disableweaponswitch" }, - { 0x8322, "enableweaponswitch" }, - { 0x8323, "openpopupmenu" }, - { 0x8324, "_meth_8324" }, - { 0x8325, "closepopupmenu" }, - { 0x8326, "_meth_8326" }, - { 0x8327, "_meth_8327" }, - { 0x8328, "_meth_8328" }, - { 0x8329, "freezecontrols" }, - { 0x832A, "disableusability" }, - { 0x832B, "enableusability" }, - { 0x832C, "_meth_832C" }, - { 0x832D, "_meth_832D" }, - { 0x832E, "_meth_832E" }, - { 0x832F, "_meth_832F" }, - { 0x8330, "_meth_8330" }, - { 0x8331, "givestartammo" }, - { 0x8332, "givemaxammo" }, - { 0x8333, "_meth_8333" }, - { 0x8334, "_meth_8334" }, - { 0x8335, "_meth_8335" }, - { 0x8336, "_meth_8336" }, - { 0x8337, "isswitchingweapon" }, - { 0x8338, "setorigin" }, - { 0x8339, "getvelocity" }, - { 0x833A, "setangles" }, - { 0x833B, "getangles" }, - { 0x833C, "usebuttonpressed" }, - { 0x833D, "attackbuttonpressed" }, - { 0x833E, "adsbuttonpressed" }, - { 0x833F, "meleebuttonpressed" }, - { 0x8340, "playerads" }, - { 0x8341, "isonground" }, - { 0x8342, "isusingturret" }, - { 0x8343, "setviewmodel" }, - { 0x8344, "setlethalweapon" }, - { 0x8345, "getlethalweapon" }, - { 0x8346, "_meth_8346" }, - { 0x8347, "_meth_8347" }, - { 0x8348, "_meth_8348" }, - { 0x8349, "_meth_8349" }, - { 0x834A, "_meth_834A" }, - { 0x834B, "_meth_834B" }, - { 0x834C, "_meth_834C" }, - { 0x834D, "setscriptmoverkillcam" }, - { 0x834E, "usinggamepad" }, - { 0x834F, "forcethirdpersonwhenfollowing" }, - { 0x8350, "disableforcethirdpersonwhenfollowing" }, - { 0x8351, "_meth_8351" }, - { 0x8352, "_meth_8352" }, - { 0x8353, "_meth_8353" }, - { 0x8354, "botsetscriptgoal" }, - { 0x8355, "_meth_8355" }, - { 0x8356, "_meth_8356" }, - { 0x8357, "_meth_8357" }, - { 0x8358, "_meth_8358" }, - { 0x8359, "_meth_8359" }, - { 0x835A, "_meth_835A" }, - { 0x835B, "_meth_835B" }, - { 0x835C, "_meth_835C" }, - { 0x835D, "_meth_835D" }, - { 0x835E, "_meth_835E" }, - { 0x835F, "_meth_835F" }, - { 0x8360, "_meth_8360" }, - { 0x8361, "_meth_8361" }, - { 0x8362, "botmemoryevent" }, - { 0x8363, "_meth_8363" }, - { 0x8364, "_meth_8364" }, - { 0x8365, "_meth_8365" }, - { 0x8366, "_meth_8366" }, - { 0x8367, "_meth_8367" }, - { 0x8368, "_meth_8368" }, - { 0x8369, "_meth_8369" }, - { 0x836A, "_meth_836A" }, - { 0x836B, "_meth_836B" }, - { 0x836C, "_meth_836C" }, - { 0x836D, "_meth_836D" }, - { 0x836E, "_meth_836E" }, - { 0x836F, "_meth_836F" }, - { 0x8370, "_meth_8370" }, - { 0x8371, "_meth_8371" }, - { 0x8372, "_meth_8372" }, - { 0x8373, "_meth_8373" }, - { 0x8374, "_meth_8374" }, - { 0x8375, "_meth_8375" }, - { 0x8376, "_meth_8376" }, - { 0x8377, "_meth_8377" }, - { 0x8378, "_meth_8378" }, - { 0x8379, "_meth_8379" }, - { 0x837A, "_meth_837A" }, - { 0x837B, "_meth_837B" }, - { 0x837C, "_meth_837C" }, - { 0x837D, "_meth_837D" }, - { 0x837E, "_meth_837E" }, - { 0x837F, "_meth_837F" }, - { 0x8380, "_meth_8380" }, - { 0x8381, "_meth_8381" }, - { 0x8382, "setclientowner" }, - { 0x8383, "setotherent" }, - { 0x8384, "_meth_8384" }, - { 0x8385, "setentityowner" }, - { 0x8386, "_meth_8386" }, - { 0x8387, "_meth_8387" }, - { 0x8388, "makeentitynomeleetarget" }, - { 0x8389, "_meth_8389" }, - { 0x838A, "_meth_838A" }, - { 0x838B, "_meth_838B" }, - { 0x838C, "_meth_838C" }, - { 0x838D, "_meth_838D" }, - { 0x838E, "_meth_838E" }, - { 0x838F, "_meth_838F" }, - { 0x8390, "_meth_8390" }, - { 0x8391, "_meth_8391" }, - { 0x8392, "_meth_8392" }, - { 0x8393, "_meth_8393" }, - { 0x8394, "_meth_8394" }, - { 0x8395, "_meth_8395" }, - { 0x8396, "_meth_8396" }, - { 0x8397, "_meth_8397" }, - { 0x8398, "_meth_8398" }, - { 0x8399, "_meth_8399" }, - { 0x839A, "_meth_839A" }, - { 0x839B, "_meth_839B" }, - { 0x839C, "_meth_839C" }, - { 0x839D, "_meth_839D" }, - { 0x839E, "_meth_839E" }, - { 0x839F, "_meth_839F" }, - { 0x83A0, "_meth_83A0" }, - { 0x83A1, "_meth_83A1" }, - { 0x83A2, "_meth_83A2" }, - { 0x83A3, "_meth_83A3" }, - { 0x83A4, "_meth_83A4" }, - { 0x83A5, "_meth_83A5" }, - { 0x83A6, "_meth_83A6" }, - { 0x83A7, "_meth_83A7" }, - { 0x83A8, "_meth_83A8" }, - { 0x83A9, "_meth_83A9" }, - { 0x83AA, "_meth_83AA" }, - { 0x83AB, "_meth_83AB" }, - { 0x83AC, "_meth_83AC" }, - { 0x83AD, "_meth_83AD" }, - { 0x83AE, "_meth_83AE" }, - { 0x83AF, "_meth_83AF" }, - { 0x83B0, "_meth_83B0" }, - { 0x83B1, "_meth_83B1" }, - { 0x83B2, "allowhighjump" }, - { 0x83B3, "isjumping" }, - { 0x83B4, "ishighjumping" }, - { 0x83B5, "_meth_83B5" }, - { 0x83B6, "_meth_83B6" }, - { 0x83B7, "_meth_83B7" }, - { 0x83B8, "getmodelfromentity" }, - { 0x83B9, "getweaponheatlevel" }, - { 0x83BA, "_meth_83BA" }, - { 0x83BB, "_meth_83BB" }, - { 0x83BC, "_meth_83BC" }, - { 0x83BD, "_meth_83BD" }, - { 0x83BE, "_meth_83BE" }, - { 0x83BF, "_meth_83BF" }, - { 0x83C0, "lightsetforplayer" }, - { 0x83C1, "lightsetoverrideenableforplayer" }, - { 0x83C2, "lightsetoverridedisableforplayer" }, - { 0x83C3, "_meth_83C3" }, - { 0x83C4, "_meth_83C4" }, - { 0x83C5, "_meth_83C5" }, - { 0x83C6, "killnotification" }, - { 0x83C7, "_meth_83C7" }, - { 0x83C8, "_meth_83C8" }, - { 0x83C9, "_meth_83C9" }, - { 0x83CA, "_meth_83CA" }, - { 0x83CB, "_meth_83CB" }, - { 0x83CC, "_meth_83CC" }, - { 0x83CD, "_meth_83CD" }, - { 0x83CE, "_meth_83CE" }, - { 0x83CF, "_meth_83CF" }, - { 0x83D0, "_meth_83D0" }, - { 0x83D1, "_meth_83D1" }, - { 0x83D2, "_meth_83D2" }, - { 0x83D3, "_meth_83D3" }, - { 0x83D4, "_meth_83D4" }, - { 0x83D5, "_meth_83D5" }, - { 0x83D6, "_meth_83D6" }, - { 0x83D7, "_meth_83D7" }, - { 0x83D8, "_meth_83D8" }, - { 0x83D9, "_meth_83D9" }, - { 0x83DA, "_meth_83DA" }, - { 0x83DB, "setclothtype" }, - { 0x83DC, "_meth_83DC" }, - { 0x83DD, "_meth_83DD" }, - { 0x83DE, "_meth_83DE" }, - { 0x83DF, "_meth_83DF" }, - { 0x83E0, "_meth_83E0" }, - { 0x83E1, "_meth_83E1" }, - { 0x83E2, "setrocketcorpse" }, - { 0x83E3, "setcorpsefalling" }, - { 0x83E4, "_meth_83E4" }, - { 0x83E5, "_meth_83E5" }, - { 0x83E6, "_meth_83E6" }, - { 0x83E7, "_meth_83E7" }, - { 0x83E8, "_meth_83E8" }, - { 0x83E9, "_meth_83E9" }, - { 0x83EA, "_meth_83EA" }, - { 0x83EB, "_meth_83EB" }, - { 0x83EC, "getlinkedparent" }, - { 0x83ED, "_meth_83ED" }, - { 0x83EE, "setnameplatematerial" }, - { 0x83EF, "_meth_83EF" }, - { 0x83F0, "_meth_83F0" }, - { 0x83F1, "_meth_83F1" }, - { 0x83F2, "_meth_83F2" }, - { 0x83F3, "_meth_83F3" }, - { 0x83F4, "_meth_83F4" }, - { 0x83F5, "_meth_83F5" }, - { 0x83F6, "_meth_83F6" }, - { 0x83F7, "_meth_83F7" }, - { 0x83F8, "cancelrocketcorpse" }, - { 0x83F9, "_meth_83F9" }, - { 0x83FA, "_meth_83FA" }, - { 0x83FB, "_meth_83FB" }, - { 0x83FC, "_meth_83FC" }, - { 0x83FD, "_meth_83FD" }, - { 0x83FE, "_meth_83FE" }, - { 0x83FF, "_meth_83FF" }, - { 0x8400, "_meth_8400" }, - { 0x8401, "_meth_8401" }, - { 0x8402, "_meth_8402" }, - { 0x8403, "_meth_8403" }, - { 0x8404, "_meth_8404" }, - { 0x8405, "_meth_8405" }, - { 0x8406, "_meth_8406" }, - { 0x8407, "_meth_8407" }, - { 0x8408, "_meth_8408" }, - { 0x8409, "_meth_8409" }, - { 0x840A, "_meth_840A" }, - { 0x840B, "_meth_840B" }, - { 0x840C, "_meth_840C" }, - { 0x840D, "_meth_840D" }, - { 0x840E, "_meth_840E" }, - { 0x840F, "_meth_840F" }, - { 0x8410, "_meth_8410" }, - { 0x8411, "_meth_8411" }, - { 0x8412, "_meth_8412" }, - { 0x8413, "_meth_8413" }, - { 0x8414, "physicsgetlinvel" }, - { 0x8415, "_meth_8415" }, - { 0x8416, "_meth_8416" }, - { 0x8417, "_meth_8417" }, - { 0x8418, "_meth_8418" }, - { 0x8419, "_meth_8419" }, - { 0x841A, "_meth_841A" }, - { 0x841B, "_meth_841B" }, - { 0x841C, "loadcustomizationplayerview" }, - { 0x841D, "_meth_841D" }, - { 0x841E, "_meth_841E" }, - { 0x841F, "_meth_841F" }, - { 0x8420, "hudoutlineenableforclient" }, - { 0x8421, "hudoutlinedisableforclient" }, - { 0x8422, "hudoutlineenableforclients" }, - { 0x8423, "hudoutlinedisableforclients" }, - { 0x8424, "_meth_8424" }, - { 0x8425, "hasloadedcustomizationplayerview" }, - { 0x8426, "_meth_8426" }, - { 0x8427, "_meth_8427" }, - { 0x8428, "_meth_8428" }, - { 0x8429, "_meth_8429" }, - { 0x842A, "_meth_842A" }, - { 0x842B, "_meth_842B" }, - { 0x842C, "_meth_842C" }, - { 0x842D, "_meth_842D" }, - { 0x842E, "_meth_842E" }, - { 0x842F, "_meth_842F" }, - { 0x8430, "_meth_8430" }, - { 0x8431, "_meth_8431" }, - { 0x8432, "ismlgspectator" }, - { 0x8433, "_meth_8433" }, - { 0x8434, "_meth_8434" }, - { 0x8435, "_meth_8435" }, - { 0x8436, "_meth_8436" }, - { 0x8437, "_meth_8437" }, - { 0x8438, "_meth_8438" }, - { 0x8439, "_meth_8439" }, - { 0x843A, "hasfemalecustomizationmodel" }, - { 0x843B, "_meth_843B" }, - { 0x843C, "_meth_843C" }, - { 0x843D, "_meth_843D" }, - { 0x843E, "_meth_843E" }, - { 0x843F, "_meth_843F" }, - { 0x8440, "_meth_8440" }, - { 0x8441, "_meth_8441" }, - { 0x8442, "_meth_8442" }, - { 0x8443, "challengenotification" }, - { 0x8444, "_meth_8444" }, - { 0x8445, "_meth_8445" }, - { 0x8446, "linktosynchronizedparent" }, - { 0x8447, "getclientomnvar" }, - { 0x8448, "_meth_8448" }, - { 0x8449, "_meth_8449" }, - { 0x844A, "getcacplayerdataforgroup" }, - { 0x844B, "cloakingenable" }, - { 0x844C, "cloakingdisable" }, - { 0x844D, "_meth_844D" }, - { 0x844E, "_meth_844E" }, - { 0x844F, "_meth_844F" }, - { 0x8450, "_meth_8450" }, - { 0x8451, "_meth_8451" }, - { 0x8452, "_meth_8452" }, - { 0x8453, "_meth_8453" }, - { 0x8454, "_meth_8454" }, - { 0x8455, "_meth_8455" }, - { 0x8456, "_meth_8456" }, - { 0x8457, "_meth_8457" }, - { 0x8458, "_meth_8458" }, - { 0x8459, "_meth_8459" }, - { 0x845A, "_meth_845A" }, - { 0x845B, "_meth_845B" }, - { 0x845C, "_meth_845C" }, - { 0x845D, "_meth_845D" }, - { 0x845E, "_meth_845E" }, - { 0x845F, "_meth_845F" }, - { 0x8460, "_meth_8460" }, - { 0x8461, "_meth_8461" }, - { 0x8462, "_meth_8462" }, - { 0x8463, "_meth_8463" }, - { 0x8464, "_meth_8464" }, - { 0x8465, "_meth_8465" }, - { 0x8466, "_meth_8466" }, - { 0x8467, "_meth_8467" }, - { 0x8468, "_meth_8468" }, - { 0x8469, "visionsetpostapplyforplayer" }, - { 0x846A, "_meth_846A" }, - { 0x846B, "_meth_846B" }, - { 0x846C, "_meth_846C" }, - { 0x846D, "_meth_846D" }, - { 0x846E, "_meth_846E" }, - { 0x846F, "_meth_846F" }, - { 0x8470, "_meth_8470" }, - { 0x8471, "_meth_8471" }, - { 0x8472, "_meth_8472" }, - { 0x8473, "_meth_8473" }, - { 0x8474, "_meth_8474" }, - { 0x8475, "_meth_8475" }, - { 0x8476, "_meth_8476" }, - { 0x8477, "_meth_8477" }, - { 0x8478, "_meth_8478" }, - { 0x8479, "_meth_8479" }, - { 0x847A, "setclienttriggervisionset" }, - { 0x847B, "_meth_847B" }, - { 0x847C, "_meth_847C" }, - { 0x847D, "_meth_847D" }, - { 0x847E, "_meth_847E" }, - { 0x847F, "_meth_847F" }, - { 0x8480, "_meth_8480" }, - { 0x8481, "showviewmodel" }, - { 0x8482, "hideviewmodel" }, - { 0x8483, "_meth_8483" }, - { 0x8484, "_meth_8484" }, - { 0x8485, "allowpowerslide" }, - { 0x8486, "allowhighjumpdrop" }, - { 0x8487, "_meth_8487" }, - { 0x8488, "_meth_8488" }, - { 0x8489, "_meth_8489" }, - { 0x848A, "_meth_848A" }, - { 0x848B, "_meth_848B" }, - { 0x848C, "_meth_848C" }, - { 0x848D, "allowdodge" }, - { 0x848E, "_meth_848E" }, - { 0x848F, "_meth_848F" }, - { 0x8490, "_meth_8490" }, - { 0x8491, "_meth_8491" }, - { 0x8492, "_meth_8492" }, - { 0x8493, "_meth_8493" }, - { 0x8494, "_meth_8494" }, - { 0x8495, "setdamagecallbackon" }, - { 0x8496, "finishentitydamage" }, - { 0x8497, "_meth_8497" }, - { 0x8498, "_meth_8498" }, - { 0x8499, "_meth_8499" }, - { 0x849A, "_meth_849A" }, - { 0x849B, "_meth_849B" }, - { 0x849C, "notifyonplayercommandremove" }, - { 0x849D, "_meth_849D" }, - { 0x849E, "allowboostjump" }, - { 0x849F, "batterydischargebegin" }, - { 0x84A0, "batterydischargeend" }, - { 0x84A1, "batterydischargeonce" }, - { 0x84A2, "batterygetcharge" }, - { 0x84A3, "_meth_84A3" }, - { 0x84A4, "batteryfullrecharge" }, - { 0x84A5, "batterygetsize" }, - { 0x84A6, "batterysetdischargescale" }, - { 0x84A7, "batterygetdischargerate" }, - { 0x84A8, "batteryisinuse" }, - { 0x84A9, "_meth_84A9" }, - { 0x84AA, "_meth_84AA" }, - { 0x84AB, "_meth_84AB" }, - { 0x84AC, "_meth_84AC" }, - { 0x84AD, "_meth_84AD" }, - { 0x84AE, "_meth_84AE" }, - { 0x84AF, "_meth_84AF" }, - { 0x84B0, "_meth_84B0" }, - { 0x84B1, "_meth_84B1" }, - { 0x84B2, "_meth_84B2" }, - { 0x84B3, "setdemigod" }, - { 0x84B4, "_meth_84B4" }, - { 0x84B5, "_meth_84B5" }, - { 0x84B6, "_meth_84B6" }, - { 0x84B7, "_meth_84B7" }, - { 0x84B8, "_meth_84B8" }, - { 0x84B9, "_meth_84B9" }, - { 0x84BA, "setcostumemodels" }, - { 0x84BB, "_meth_84BB" }, - { 0x84BC, "_meth_84BC" }, - { 0x84BD, "_meth_84BD" }, - { 0x84BE, "_meth_84BE" }, - { 0x84BF, "_meth_84BF" }, - { 0x84C0, "_meth_84C0" }, - { 0x84C1, "_meth_84C1" }, - { 0x84C2, "_meth_84C2" }, - { 0x84C3, "enabledetonate" }, - { 0x84C4, "getdetonateenabled" }, - { 0x84C5, "_meth_84C5" }, - { 0x84C6, "refreshshieldmodels" }, - { 0x84C7, "_meth_84C7" }, - { 0x84C8, "_meth_84C8" }, - { 0x84C9, "_meth_84C9" }, - { 0x84CA, "getgravity" }, - { 0x84CB, "_meth_84CB" }, - { 0x84CC, "_meth_84CC" }, - { 0x84CD, "_meth_84CD" }, - { 0x84CE, "_meth_84CE" }, - { 0x84CF, "_meth_84CF" }, - { 0x84D0, "_meth_84D0" }, - { 0x84D1, "setrankedplayerdatareservedint" }, - { 0x84D2, "_meth_84D2" }, - { 0x84D3, "getjointype" }, - { 0x84D4, "_meth_84D4" }, - { 0x84D5, "_meth_84D5" }, - { 0x84D6, "_meth_84D6" }, - { 0x84D7, "_meth_84D7" }, - { 0x84D8, "_meth_84D8" }, - { 0x84D9, "_meth_84D9" }, - { 0x84DA, "_meth_84DA" }, - { 0x84DB, "_meth_84DB" }, - { 0x84DC, "_meth_84DC" }, - { 0x84DD, "_meth_84DD" }, - { 0x84DE, "_meth_84DE" }, - { 0x84DF, "_meth_84DF" }, - { 0x84E0, "_meth_84E0" }, - { 0x84E1, "physicsstop" }, - { 0x84E2, "_meth_84E2" }, - { 0x84E3, "_meth_84E3" }, - { 0x84E4, "_meth_84E4" }, - { 0x84E5, "_meth_84E5" }, - { 0x84E6, "_meth_84E6" }, - { 0x84E7, "_meth_84E7" }, - { 0x84E8, "_meth_84E8" }, - { 0x84E9, "_meth_84E9" }, - { 0x84EA, "_meth_84EA" }, - { 0x84EB, "_meth_84EB" }, - { 0x84EC, "_meth_84EC" }, - { 0x84ED, "_meth_84ED" }, - { 0x84EE, "_meth_84EE" }, - { 0x84EF, "_meth_84EF" }, - { 0x84F0, "_meth_84F0" }, - { 0x84F1, "_meth_84F1" }, - { 0x84F2, "_meth_84F2" }, - { 0x84F3, "_meth_84F3" }, - { 0x84F4, "_meth_84F4" }, - { 0x84F5, "_meth_84F5" }, - { 0x84F6, "_meth_84F6" }, - { 0x84F7, "_meth_84F7" }, - { 0x84F8, "iscloaked" }, - { 0x84F9, "_meth_84F9" }, - { 0x84FA, "_meth_84FA" }, - { 0x84FB, "_meth_84FB" }, - { 0x84FC, "_meth_84FC" }, - { 0x84FD, "_meth_84FD" }, - { 0x84FE, "_meth_84FE" }, - { 0x84FF, "_meth_84FF" }, - { 0x8500, "_meth_8500" }, - { 0x8501, "_meth_8501" }, - { 0x8502, "_meth_8502" }, - { 0x8503, "_meth_8503" }, - { 0x8504, "_meth_8504" }, - { 0x8505, "_meth_8505" }, - { 0x8506, "setmlgspectator" }, - { 0x8507, "gettotalmpxp" }, - { 0x8508, "_meth_8508" }, - { 0x8509, "_meth_8509" }, - { 0x850A, "_meth_850A" }, - { 0x850B, "_meth_850B" }, - { 0x850C, "_meth_850C" }, - { 0x850D, "_meth_850D" }, - { 0x850E, "setballpassallowed" }, - { 0x850F, "_meth_850F" }, - { 0x8510, "ghost" }, - { 0x8511, "loadweapons" }, - { 0x8512, "_meth_8512" }, - { 0x8513, "_meth_8513" }, - { 0x8514, "_meth_8514" }, - { 0x8515, "_meth_8515" }, - { 0x8516, "_meth_8516" }, - { 0x8517, "_meth_8517" }, - { 0x8518, "_meth_8518" }, - { 0x8519, "_meth_8519" }, - { 0x851A, "_meth_851A" }, - { 0x851B, "playlocalannouncersound" }, - { 0x851C, "_meth_851C" }, - { 0x851D, "_meth_851D" }, - { 0x851E, "_meth_851E" }, - { 0x851F, "isdodging" }, - { 0x8520, "_meth_8520" }, - { 0x8521, "_meth_8521" }, - { 0x8522, "_meth_8522" }, - { 0x8523, "_meth_8523" }, - { 0x8524, "detonatebydoubletap" }, - { 0x8525, "_meth_8525" }, - { 0x8526, "_meth_8526" }, - { 0x8527, "_meth_8527" }, - { 0x8528, "_meth_8528" }, - { 0x8529, "_meth_8529" }, - { 0x852A, "physicsisactive" }, - { 0x852B, "_meth_852B" }, - { 0x852C, "isgod" }, - { 0x852D, "_meth_852D" }, - { 0x852E, "_meth_852E" }, - { 0x852F, "_meth_852F" }, - { 0x8530, "_meth_8530" }, - { 0x8531, "_meth_8531" }, - { 0x8532, "_meth_8532" }, - { 0x8533, "disableforcefirstpersonwhenfollowed" }, - { 0x8534, "_meth_8534" }, - { 0x8535, "_meth_8535" }, - { 0x8536, "_meth_8536" }, - { 0x8537, "usetriggertouchcheckstance" }, - { 0x8538, "onlystreamactiveweapon" }, - { 0x8539, "precachekillcamiconforweapon" }, - { 0x853A, "_meth_853A" }, - { 0x853B, "getclanwarsbonus" }, - { 0x853C, "_meth_853C" }, - { 0x853D, "_meth_853D" }, - { 0x853E, "_meth_853E" }, - { 0x853F, "finishplayerdamage_impactfx" }, - { 0x8540, "_meth_8540" }, - { 0x8541, "_meth_8541" }, - { 0x8542, "_meth_8542" }, - { 0x8543, "_meth_8543" }, - { 0x8544, "_meth_8544" }, - { 0x8545, "_meth_8545" }, - { 0x8546, "_meth_8546" }, - { 0x8547, "_meth_8547" }, - { 0x8548, "_meth_8548" }, - { 0x8549, "_meth_8549" }, - { 0x854A, "_meth_854A" }, - { 0x854B, "setprestigemastery" }, - { 0x854C, "_meth_854C" }, - { 0x854D, "_meth_854D" }, - { 0x854E, "_meth_854E" }, - { 0x854F, "setdivision" }, - { 0x8550, "_meth_8550" }, - { 0x8551, "_meth_8551" }, - { 0x8552, "_meth_8552" }, - { 0x8553, "_meth_8553" }, - { 0x8554, "_meth_8554" }, - { 0x8555, "_meth_8555" }, - { 0x8556, "_meth_8556" }, - { 0x8557, "_meth_8557" }, - { 0x8558, "_meth_8558" }, - { 0x8559, "_meth_8559" }, - { 0x855A, "_meth_855A" }, - { 0x855B, "_meth_855B" }, - { 0x855C, "_meth_855C" }, - { 0x855D, "_meth_855D" }, - { 0x855E, "_meth_855E" }, - { 0x855F, "allowriotshieldplant" }, - { 0x8560, "_meth_8560" }, - { 0x8561, "_meth_8561" }, - { 0x8562, "_meth_8562" }, - { 0x8563, "_meth_8563" }, - { 0x8564, "_meth_8564" }, - { 0x8565, "_meth_8565" }, - { 0x8566, "_meth_8566" }, - { 0x8567, "_meth_8567" }, - { 0x8568, "_meth_8568" }, - { 0x8569, "_meth_8569" }, - { 0x856A, "_meth_856A" }, - { 0x856B, "_meth_856B" }, - { 0x856C, "_meth_856C" }, -}}; - -const std::array, 4585> token_list +extern std::array, token_count> const token_list {{ { 0x0000, "" }, { 0x0001, "pl#" }, @@ -45562,53 +42985,4 @@ const std::array, 4585> token_list { 0xA7DC, "maps/mp/perks/_perks" }, }}; -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()); - function_map.reserve(function_list.size()); - function_map_rev.reserve(function_list.size()); - method_map.reserve(method_list.size()); - method_map_rev.reserve(method_list.size()); - token_map.reserve(token_list.size()); - token_map_rev.reserve(token_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 : function_list) - { - function_map.insert({ entry.first, entry.second }); - function_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : method_list) - { - method_map.insert({ entry.first, entry.second }); - method_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : token_list) - { - token_map.insert({ entry.first, entry.second }); - token_map_rev.insert({ entry.second, entry.first }); - } - } -}; - -__init__ _; - -} // namespace xsk::gsc::s1 - -#ifdef _MSC_VER -#pragma warning(pop) -#endif +} // namespace xsk::gsc::s1_pc diff --git a/src/s1/s1_ps.cpp b/src/s1/s1_ps.cpp new file mode 100644 index 00000000..e3b4fc46 --- /dev/null +++ b/src/s1/s1_ps.cpp @@ -0,0 +1,52 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_ps.hpp" + +namespace xsk::gsc::s1_ps +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::waitframe, engine::s1, endian::big, system::ps3, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::s1_ps diff --git a/src/s1/s1_ps.hpp b/src/s1/s1_ps.hpp new file mode 100644 index 00000000..2310fd55 --- /dev/null +++ b/src/s1/s1_ps.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::s1_ps +{ + +constexpr usize code_count = 154; +constexpr usize func_count = 3; +constexpr usize meth_count = 0; +constexpr usize token_count = 0; +constexpr u32 max_string_id = 0xA51D; // TODO + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::s1_ps diff --git a/src/s1/s1_ps_code.cpp b/src/s1/s1_ps_code.cpp new file mode 100644 index 00000000..857e3498 --- /dev/null +++ b/src/s1/s1_ps_code.cpp @@ -0,0 +1,169 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_ps.hpp" + +namespace xsk::gsc::s1_ps +{ + +extern std::array, code_count> const code_list +{{ + { 0x1D, opcode::OP_CastFieldObject }, + { 0x1E, opcode::OP_SetLocalVariableFieldCached }, + { 0x1F, opcode::OP_plus }, + { 0x20, opcode::OP_RemoveLocalVariables }, + { 0x21, opcode::OP_EvalSelfFieldVariableRef }, + { 0x22, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x23, opcode::OP_GetGameRef }, + { 0x24, opcode::OP_EvalAnimFieldVariable }, + { 0x25, opcode::OP_EvalLevelFieldVariableRef }, + { 0x26, opcode::OP_GetThisthread }, + { 0x27, opcode::OP_greater }, + { 0x28, opcode::OP_waittillmatch }, + { 0x29, opcode::OP_shift_right }, + { 0x2A, opcode::OP_dec }, + { 0x2B, opcode::OP_JumpOnTrue }, + { 0x2C, opcode::OP_bit_or }, + { 0x2D, opcode::OP_equality }, + { 0x2E, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x2F, opcode::OP_notify }, + { 0x30, opcode::OP_GetVector }, + { 0x31, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x32, opcode::OP_PreScriptCall }, + { 0x33, opcode::OP_GetByte }, + { 0x34, opcode::OP_ScriptFarThreadCall }, + { 0x35, opcode::OP_SetSelfFieldVariableField }, + { 0x36, opcode::OP_JumpOnFalseExpr }, + { 0x37, opcode::OP_GetUndefined }, + { 0x38, opcode::OP_jumpback }, + { 0x39, opcode::OP_JumpOnTrueExpr }, + { 0x3A, opcode::OP_CallBuiltin0 }, + { 0x3B, opcode::OP_CallBuiltin1 }, + { 0x3C, opcode::OP_CallBuiltin2 }, + { 0x3D, opcode::OP_CallBuiltin3 }, + { 0x3E, opcode::OP_CallBuiltin4 }, + { 0x3F, opcode::OP_CallBuiltin5 }, + { 0x40, opcode::OP_CallBuiltin }, + { 0x41, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x42, opcode::OP_ClearFieldVariable }, + { 0x43, opcode::OP_GetLevel }, + { 0x44, opcode::OP_size }, + { 0x45, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x46, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x47, opcode::OP_AddArray }, + { 0x48, opcode::OP_endon }, + { 0x49, opcode::OP_EvalFieldVariable }, + { 0x4A, opcode::OP_shift_left }, + { 0x4B, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x4C, opcode::OP_Return }, + { 0x4D, opcode::OP_CreateLocalVariable }, + { 0x4E, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x4F, opcode::OP_GetBuiltinMethod }, + { 0x50, opcode::OP_ScriptLocalMethodCall }, + { 0x51, opcode::OP_CallBuiltinMethodPointer }, + { 0x52, opcode::OP_ScriptLocalChildThreadCall }, + { 0x53, opcode::OP_GetSelfObject }, + { 0x54, opcode::OP_GetGame }, + { 0x55, opcode::OP_SetLevelFieldVariableField }, + { 0x56, opcode::OP_EvalArray }, + { 0x57, opcode::OP_GetSelf }, + { 0x58, opcode::OP_End }, + { 0x59, opcode::OP_EvalSelfFieldVariable }, + { 0x5A, opcode::OP_less_equal }, + { 0x5B, opcode::OP_EvalLocalVariableCached0 }, + { 0x5C, opcode::OP_EvalLocalVariableCached1 }, + { 0x5D, opcode::OP_EvalLocalVariableCached2 }, + { 0x5E, opcode::OP_EvalLocalVariableCached3 }, + { 0x5F, opcode::OP_EvalLocalVariableCached4 }, + { 0x60, opcode::OP_EvalLocalVariableCached5 }, + { 0x61, opcode::OP_EvalLocalVariableCached }, + { 0x62, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x63, opcode::OP_ScriptChildThreadCallPointer }, + { 0x64, opcode::OP_EvalLocalVariableObjectCached }, + { 0x65, opcode::OP_ScriptLocalThreadCall }, + { 0x66, opcode::OP_GetInteger }, + { 0x67, opcode::OP_ScriptMethodCallPointer }, + { 0x68, opcode::OP_checkclearparams }, + { 0x69, opcode::OP_SetAnimFieldVariableField }, + { 0x6A, opcode::OP_waittillmatch2 }, + { 0x6B, opcode::OP_minus }, + { 0x6C, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x6D, opcode::OP_GetNegUnsignedShort }, + { 0x6E, opcode::OP_GetNegByte }, + { 0x6F, opcode::OP_SafeCreateVariableFieldCached }, + { 0x70, opcode::OP_greater_equal }, + { 0x71, opcode::OP_vector }, + { 0x72, opcode::OP_GetBuiltinFunction }, + { 0x73, opcode::OP_endswitch }, + { 0x74, opcode::OP_ClearArray }, + { 0x75, opcode::OP_DecTop }, + { 0x76, opcode::OP_CastBool }, + { 0x77, opcode::OP_EvalArrayRef }, + { 0x78, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x79, opcode::OP_GetZero }, + { 0x7A, opcode::OP_wait }, + { 0x7B, opcode::OP_waittill }, + { 0x7C, opcode::OP_GetIString }, + { 0x7D, opcode::OP_ScriptFarFunctionCall }, + { 0x7E, opcode::OP_GetAnimObject }, + { 0x7F, opcode::OP_GetAnimTree }, + { 0x80, opcode::OP_EvalLocalArrayCached }, + { 0x81, opcode::OP_mod }, + { 0x82, opcode::OP_ScriptFarMethodThreadCall }, + { 0x83, opcode::OP_GetUnsignedShort }, + { 0x84, opcode::OP_clearparams }, + { 0x85, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x86, opcode::OP_ScriptFunctionCallPointer }, + { 0x87, opcode::OP_EmptyArray }, + { 0x88, opcode::OP_SafeSetVariableFieldCached }, + { 0x89, opcode::OP_ClearVariableField }, // MAYBE + { 0x8A, opcode::OP_EvalFieldVariableRef }, + { 0x8B, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x8C, opcode::OP_EvalNewLocalVariableRefCached0 }, // MAYBE + { 0x8D, opcode::OP_GetFloat }, + { 0x8E, opcode::OP_EvalLocalVariableRefCached }, + { 0x8F, opcode::OP_JumpOnFalse }, + { 0x90, opcode::OP_BoolComplement }, + { 0x91, opcode::OP_ScriptThreadCallPointer }, + { 0x92, opcode::OP_ScriptFarFunctionCall2 }, + { 0x93, opcode::OP_less }, + { 0x94, opcode::OP_BoolNot }, + { 0x95, opcode::OP_waittillFrameEnd }, + { 0x96, opcode::OP_waitframe }, + { 0x97, opcode::OP_GetString }, + { 0x98, opcode::OP_EvalLevelFieldVariable }, + { 0x99, opcode::OP_GetLevelObject }, + { 0x9A, opcode::OP_inc }, + { 0x9B, opcode::OP_CallBuiltinMethod0 }, + { 0x9C, opcode::OP_CallBuiltinMethod1 }, + { 0x9D, opcode::OP_CallBuiltinMethod2 }, + { 0x9E, opcode::OP_CallBuiltinMethod3 }, + { 0x9F, opcode::OP_CallBuiltinMethod4 }, + { 0xA0, opcode::OP_CallBuiltinMethod5 }, + { 0xA1, opcode::OP_CallBuiltinMethod }, + { 0xA2, opcode::OP_GetAnim }, + { 0xA3, opcode::OP_switch }, + { 0xA4, opcode::OP_SetVariableField }, + { 0xA5, opcode::OP_divide }, + { 0xA6, opcode::OP_GetLocalFunction }, + { 0xA7, opcode::OP_ScriptFarChildThreadCall }, + { 0xA8, opcode::OP_multiply }, + { 0xA9, opcode::OP_ClearLocalVariableFieldCached }, + { 0xAA, opcode::OP_EvalAnimFieldVariableRef }, + { 0xAB, opcode::OP_EvalLocalArrayRefCached }, + { 0xAC, opcode::OP_EvalLocalVariableRefCached0 }, + { 0xAD, opcode::OP_bit_and }, + { 0xAE, opcode::OP_GetAnimation }, + { 0xAF, opcode::OP_GetFarFunction }, + { 0xB0, opcode::OP_CallBuiltinPointer }, + { 0xB1, opcode::OP_jump }, + { 0xB2, opcode::OP_voidCodepos }, + { 0xB3, opcode::OP_ScriptFarMethodCall }, + { 0xB4, opcode::OP_inequality }, + { 0xB5, opcode::OP_ScriptLocalFunctionCall }, + { 0xB6, opcode::OP_bit_ex_or }, +}}; + +} // namespace xsk::gsc::s1_ps diff --git a/src/s1/s1_ps_func.cpp b/src/s1/s1_ps_func.cpp new file mode 100644 index 00000000..c821cab6 --- /dev/null +++ b/src/s1/s1_ps_func.cpp @@ -0,0 +1,18 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_ps.hpp" + +namespace xsk::gsc::s1_ps +{ + +extern std::array, func_count> const func_list +{{ + { 0x12, "isdefined" }, + { 0xC0, "getfirstarraykey" }, + { 0xC1, "getnextarraykey" }, +}}; + +} // namespace xsk::gsc::s1_ps diff --git a/src/s1/s1_ps_meth.cpp b/src/s1/s1_ps_meth.cpp new file mode 100644 index 00000000..9aba0fdf --- /dev/null +++ b/src/s1/s1_ps_meth.cpp @@ -0,0 +1,15 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_ps.hpp" + +namespace xsk::gsc::s1_ps +{ + +extern std::array, meth_count> const meth_list +{{ +}}; + +} // namespace xsk::gsc::s1_ps diff --git a/src/s1/s1_ps_token.cpp b/src/s1/s1_ps_token.cpp new file mode 100644 index 00000000..e5dc1e0e --- /dev/null +++ b/src/s1/s1_ps_token.cpp @@ -0,0 +1,15 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_ps.hpp" + +namespace xsk::gsc::s1_ps +{ + +extern std::array, token_count> const token_list +{{ +}}; + +} // namespace xsk::gsc::s1_ps diff --git a/src/s1/s1_xb.cpp b/src/s1/s1_xb.cpp new file mode 100644 index 00000000..06ead7c0 --- /dev/null +++ b/src/s1/s1_xb.cpp @@ -0,0 +1,52 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_xb.hpp" + +namespace xsk::gsc::s1_xb +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::waitframe, engine::s1, endian::big, system::xb2, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::s1_xb diff --git a/src/s1/s1_xb.hpp b/src/s1/s1_xb.hpp new file mode 100644 index 00000000..a386b815 --- /dev/null +++ b/src/s1/s1_xb.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::s1_xb +{ + +constexpr usize code_count = 154; +constexpr usize func_count = 3; +constexpr usize meth_count = 0; +constexpr usize token_count = 0; +constexpr u32 max_string_id = 0xA51D; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::s1_xb diff --git a/src/s1/s1_xb_code.cpp b/src/s1/s1_xb_code.cpp new file mode 100644 index 00000000..b762c70d --- /dev/null +++ b/src/s1/s1_xb_code.cpp @@ -0,0 +1,169 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_xb.hpp" + +namespace xsk::gsc::s1_xb +{ + +extern std::array, code_count> const code_list +{{ + { 0x1D, opcode::OP_CastFieldObject }, + { 0x1E, opcode::OP_SetLocalVariableFieldCached }, + { 0x1F, opcode::OP_plus }, + { 0x20, opcode::OP_RemoveLocalVariables }, + { 0x21, opcode::OP_EvalSelfFieldVariableRef }, + { 0x22, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x23, opcode::OP_GetGameRef }, + { 0x24, opcode::OP_EvalAnimFieldVariable }, + { 0x25, opcode::OP_EvalLevelFieldVariableRef }, + { 0x26, opcode::OP_GetThisthread }, + { 0x27, opcode::OP_greater }, + { 0x28, opcode::OP_waittillmatch }, + { 0x29, opcode::OP_shift_right }, + { 0x2A, opcode::OP_dec }, + { 0x2B, opcode::OP_JumpOnTrue }, + { 0x2C, opcode::OP_bit_or }, + { 0x2D, opcode::OP_equality }, + { 0x2E, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x2F, opcode::OP_notify }, + { 0x30, opcode::OP_GetVector }, + { 0x31, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x32, opcode::OP_PreScriptCall }, + { 0x33, opcode::OP_GetByte }, + { 0x34, opcode::OP_ScriptFarThreadCall }, + { 0x35, opcode::OP_SetSelfFieldVariableField }, + { 0x36, opcode::OP_JumpOnFalseExpr }, + { 0x37, opcode::OP_GetUndefined }, + { 0x38, opcode::OP_jumpback }, + { 0x39, opcode::OP_JumpOnTrueExpr }, + { 0x3A, opcode::OP_CallBuiltin0 }, + { 0x3B, opcode::OP_CallBuiltin1 }, + { 0x3C, opcode::OP_CallBuiltin2 }, + { 0x3D, opcode::OP_CallBuiltin3 }, + { 0x3E, opcode::OP_CallBuiltin4 }, + { 0x3F, opcode::OP_CallBuiltin5 }, + { 0x40, opcode::OP_CallBuiltin }, + { 0x41, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x42, opcode::OP_ClearFieldVariable }, + { 0x43, opcode::OP_GetLevel }, + { 0x44, opcode::OP_size }, + { 0x45, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x46, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x47, opcode::OP_AddArray }, + { 0x48, opcode::OP_endon }, + { 0x49, opcode::OP_EvalFieldVariable }, + { 0x4A, opcode::OP_shift_left }, + { 0x4B, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x4C, opcode::OP_Return }, + { 0x4D, opcode::OP_CreateLocalVariable }, + { 0x4E, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x4F, opcode::OP_GetBuiltinMethod }, + { 0x50, opcode::OP_ScriptLocalMethodCall }, + { 0x51, opcode::OP_CallBuiltinMethodPointer }, + { 0x52, opcode::OP_ScriptLocalChildThreadCall }, + { 0x53, opcode::OP_GetSelfObject }, + { 0x54, opcode::OP_GetGame }, + { 0x55, opcode::OP_SetLevelFieldVariableField }, + { 0x56, opcode::OP_EvalArray }, + { 0x57, opcode::OP_GetSelf }, + { 0x58, opcode::OP_End }, + { 0x59, opcode::OP_EvalSelfFieldVariable }, + { 0x5A, opcode::OP_less_equal }, + { 0x5B, opcode::OP_EvalLocalVariableCached0 }, + { 0x5C, opcode::OP_EvalLocalVariableCached1 }, + { 0x5D, opcode::OP_EvalLocalVariableCached2 }, + { 0x5E, opcode::OP_EvalLocalVariableCached3 }, + { 0x5F, opcode::OP_EvalLocalVariableCached4 }, + { 0x60, opcode::OP_EvalLocalVariableCached5 }, + { 0x61, opcode::OP_EvalLocalVariableCached }, + { 0x62, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x63, opcode::OP_ScriptChildThreadCallPointer }, + { 0x64, opcode::OP_EvalLocalVariableObjectCached }, + { 0x65, opcode::OP_ScriptLocalThreadCall }, + { 0x66, opcode::OP_GetInteger }, + { 0x67, opcode::OP_ScriptMethodCallPointer }, + { 0x68, opcode::OP_checkclearparams }, + { 0x69, opcode::OP_SetAnimFieldVariableField }, + { 0x6A, opcode::OP_waittillmatch2 }, + { 0x6B, opcode::OP_minus }, + { 0x6C, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x6D, opcode::OP_GetNegUnsignedShort }, + { 0x6E, opcode::OP_GetNegByte }, + { 0x6F, opcode::OP_SafeCreateVariableFieldCached }, + { 0x70, opcode::OP_greater_equal }, + { 0x71, opcode::OP_vector }, + { 0x72, opcode::OP_GetBuiltinFunction }, + { 0x73, opcode::OP_endswitch }, + { 0x74, opcode::OP_ClearArray }, + { 0x75, opcode::OP_DecTop }, + { 0x76, opcode::OP_CastBool }, + { 0x77, opcode::OP_EvalArrayRef }, + { 0x78, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x79, opcode::OP_GetZero }, + { 0x7A, opcode::OP_wait }, + { 0x7B, opcode::OP_waittill }, + { 0x7C, opcode::OP_GetIString }, + { 0x7D, opcode::OP_ScriptFarFunctionCall }, + { 0x7E, opcode::OP_GetAnimObject }, + { 0x7F, opcode::OP_GetAnimTree }, + { 0x80, opcode::OP_EvalLocalArrayCached }, + { 0x81, opcode::OP_mod }, + { 0x82, opcode::OP_ScriptFarMethodThreadCall }, + { 0x83, opcode::OP_GetUnsignedShort }, + { 0x84, opcode::OP_clearparams }, + { 0x85, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x86, opcode::OP_ScriptFunctionCallPointer }, + { 0x87, opcode::OP_EmptyArray }, + { 0x88, opcode::OP_SafeSetVariableFieldCached }, + { 0x89, opcode::OP_ClearVariableField }, // MAYBE + { 0x8A, opcode::OP_EvalFieldVariableRef }, + { 0x8B, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x8C, opcode::OP_EvalNewLocalVariableRefCached0 }, // MAYBE + { 0x8D, opcode::OP_GetFloat }, + { 0x8E, opcode::OP_EvalLocalVariableRefCached }, + { 0x8F, opcode::OP_JumpOnFalse }, + { 0x90, opcode::OP_BoolComplement }, + { 0x91, opcode::OP_ScriptThreadCallPointer }, + { 0x92, opcode::OP_ScriptFarFunctionCall2 }, + { 0x93, opcode::OP_less }, + { 0x94, opcode::OP_BoolNot }, + { 0x95, opcode::OP_waittillFrameEnd }, + { 0x96, opcode::OP_waitframe }, + { 0x97, opcode::OP_GetString }, + { 0x98, opcode::OP_EvalLevelFieldVariable }, + { 0x99, opcode::OP_GetLevelObject }, + { 0x9A, opcode::OP_inc }, + { 0x9B, opcode::OP_CallBuiltinMethod0 }, + { 0x9C, opcode::OP_CallBuiltinMethod1 }, + { 0x9D, opcode::OP_CallBuiltinMethod2 }, + { 0x9E, opcode::OP_CallBuiltinMethod3 }, + { 0x9F, opcode::OP_CallBuiltinMethod4 }, + { 0xA0, opcode::OP_CallBuiltinMethod5 }, + { 0xA1, opcode::OP_CallBuiltinMethod }, + { 0xA2, opcode::OP_GetAnim }, + { 0xA3, opcode::OP_switch }, + { 0xA4, opcode::OP_SetVariableField }, + { 0xA5, opcode::OP_divide }, + { 0xA6, opcode::OP_GetLocalFunction }, + { 0xA7, opcode::OP_ScriptFarChildThreadCall }, + { 0xA8, opcode::OP_multiply }, + { 0xA9, opcode::OP_ClearLocalVariableFieldCached }, + { 0xAA, opcode::OP_EvalAnimFieldVariableRef }, + { 0xAB, opcode::OP_EvalLocalArrayRefCached }, + { 0xAC, opcode::OP_EvalLocalVariableRefCached0 }, + { 0xAD, opcode::OP_bit_and }, + { 0xAE, opcode::OP_GetAnimation }, + { 0xAF, opcode::OP_GetFarFunction }, + { 0xB0, opcode::OP_CallBuiltinPointer }, + { 0xB1, opcode::OP_jump }, + { 0xB2, opcode::OP_voidCodepos }, + { 0xB3, opcode::OP_ScriptFarMethodCall }, + { 0xB4, opcode::OP_inequality }, + { 0xB5, opcode::OP_ScriptLocalFunctionCall }, + { 0xB6, opcode::OP_bit_ex_or }, +}}; + +} // namespace xsk::gsc::s1_xb diff --git a/src/s1/s1_xb_func.cpp b/src/s1/s1_xb_func.cpp new file mode 100644 index 00000000..bb6c7ee3 --- /dev/null +++ b/src/s1/s1_xb_func.cpp @@ -0,0 +1,18 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_xb.hpp" + +namespace xsk::gsc::s1_xb +{ + +extern std::array, func_count> const func_list +{{ + { 0x12, "isdefined" }, + { 0xC0, "getfirstarraykey" }, + { 0xC1, "getnextarraykey" }, +}}; + +} // namespace xsk::gsc::s1_xb diff --git a/src/s1/s1_xb_meth.cpp b/src/s1/s1_xb_meth.cpp new file mode 100644 index 00000000..e9d755b4 --- /dev/null +++ b/src/s1/s1_xb_meth.cpp @@ -0,0 +1,15 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_xb.hpp" + +namespace xsk::gsc::s1_xb +{ + +extern std::array, meth_count> const meth_list +{{ +}}; + +} // namespace xsk::gsc::s1_xb diff --git a/src/s1/s1_xb_token.cpp b/src/s1/s1_xb_token.cpp new file mode 100644 index 00000000..886a136e --- /dev/null +++ b/src/s1/s1_xb_token.cpp @@ -0,0 +1,15 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s1_xb.hpp" + +namespace xsk::gsc::s1_xb +{ + +extern std::array, token_count> const token_list +{{ +}}; + +} // namespace xsk::gsc::s1_xb diff --git a/src/s1/stdafx.cpp b/src/s1/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/s1/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/s1/stdafx.hpp b/src/s1/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/s1/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/s1/xsk/assembler.cpp b/src/s1/xsk/assembler.cpp deleted file mode 100644 index e343fd0c..00000000 --- a/src/s1/xsk/assembler.cpp +++ /dev/null @@ -1,555 +0,0 @@ -// 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 "s1.hpp" - -namespace xsk::gsc::s1 -{ - -auto assembler::output_script() -> std::vector -{ - std::vector script; - - if (script_ == nullptr) return script; - - script.resize(script_->pos()); - std::memcpy(script.data(), script_->buffer().data(), script.size()); - - return script; -} - -auto assembler::output_stack() -> std::vector -{ - std::vector stack; - - if (stack_ == nullptr) return stack; - - stack.resize(stack_->pos()); - std::memcpy(stack.data(), stack_->buffer().data(), stack.size()); - - return stack; -} - -void assembler::assemble(const std::string& file, std::vector& data) -{ - std::vector assembly = utils::string::clean_buffer_lines(data); - std::vector functions; - function::ptr func = nullptr; - std::uint32_t index = 1; - std::uint16_t switchnum = 0; - - for (auto& line : assembly) - { - if (line == "" || line.substr(0, 2) == "//") - { - continue; - } - else if (line.substr(0, 4) == "sub_") - { - func = std::make_unique(); - func->index = index; - func->name = line.substr(4); - } - else if (line.substr(0, 4) == "end_") - { - if (func != nullptr) - { - func->size = index - func->index; - functions.push_back(std::move(func)); - } - } - else if (line.substr(0, 4) == "loc_") - { - func->labels[index] = line; - } - else - { - auto opdata = utils::string::parse_code(line); - - if (switchnum) - { - if (opdata[0] == "case" || opdata[0] == "default") - { - for (auto& entry : opdata) - { - func->instructions.back()->data.push_back(entry); - } - switchnum--; - continue; - } - - throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); - } - else - { - auto inst = std::make_unique(); - inst->index = index; - inst->opcode = resolver::opcode_id(opdata[0]); - inst->size = opcode_size(inst->opcode); - opdata.erase(opdata.begin()); - inst->data = std::move(opdata); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = inst->data[0].substr(4); - break; - case opcode::OP_endswitch: - switchnum = static_cast(std::stoi(inst->data[0])); - inst->size += 7 * switchnum; - break; - default: - break; - } - - index += inst->size; - func->instructions.push_back(std::move(inst)); - } - } - } - - assemble(file, functions); -} - -void assembler::assemble(const std::string& file, std::vector& funcs) -{ - script_ = std::make_unique(0x100000); - stack_ = std::make_unique(0x100000); - filename_ = file; - functions_ = std::move(funcs); - - script_->write(static_cast(opcode::OP_End)); - - for (const auto& func : functions_) - { - assemble_function(func); - } -} - -void assembler::assemble_function(const function::ptr& func) -{ - labels_ = func->labels; - - func->id = resolver::token_id(func->name); - - stack_->write(func->size); - stack_->write(static_cast(func->id)); - - if (func->id == 0) - { - stack_->write_c_string(func->name); - } - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->write(std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->write(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - 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(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_GetAnimation: - script_->write(0); - script_->write(0); - stack_->write_c_string(inst->data[0]); - stack_->write_c_string(inst->data[1]); - break; - case opcode::OP_GetAnimTree: - script_->write(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_waittillmatch: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - assemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - assemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - assemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - assemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - assemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - assemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - assemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - assemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - assemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - assemble_jump(inst, false, true); - break; - case opcode::OP_jump: - assemble_jump(inst, false, false); - break; - case opcode::OP_switch: - assemble_switch(inst); - break; - case opcode::OP_endswitch: - assemble_end_switch(inst); - break; - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } - - const auto id = method ? resolver::method_id(inst->data[0]) : resolver::function_id(inst->data[0]); - - script_->write(id); -} - -void assembler::assemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto addr = resolve_function(inst->data[0]); - const auto offset = static_cast(addr - inst->index - 1); - - assemble_offset(offset); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } -} - -void assembler::assemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->write(0); - script_->write(0); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[2]))); - } - - const auto file_id = resolver::token_id(inst->data[0]); - const auto func_id = resolver::token_id(inst->data[1]); - - stack_->write(file_id); - if (file_id == 0) stack_->write_c_string(inst->data[0]); - stack_->write(func_id); - if (func_id == 0) stack_->write_c_string(inst->data[1]); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const auto addr = resolve_label(inst->data[0]); - - script_->write(addr - inst->index - 4); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - - script_->write(static_cast(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); - stack_->write_c_string(inst->data[1 + (3 * i) + 1]); - } - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 2]); - - assemble_offset(addr - index); - - index += 3; - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write(0); - stack_->write_c_string("\x01"); - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 1]); - - assemble_offset(addr - index); - - index += 3; - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::assemble_field_variable(const instruction::ptr& inst) -{ - auto id = resolver::token_id(inst->data[0]); - - if (id == 0) id = 0xFFFF; - - script_->write(id); - - if (id > max_string_id) - { - stack_->write(0); - stack_->write_c_string(inst->data[0]); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - const auto addr = resolve_label(inst->data[0]); - - if (expr) - { - script_->write(static_cast(addr - inst->index - 3)); - } - else if (back) - { - script_->write(static_cast((inst->index + 3) - addr)); - } - else - { - script_->write(static_cast(addr - inst->index - 5)); - } -} - -void assembler::assemble_offset(std::int32_t offset) -{ - std::array bytes = {}; - - offset = (offset << 10) >> 8; - - *reinterpret_cast(bytes.data()) = offset; - - script_->write(bytes[0]); - script_->write(bytes[1]); - script_->write(bytes[2]); -} - -auto assembler::resolve_function(const std::string& name) -> std::int32_t -{ - for (const auto& entry : functions_) - { - if (entry->name == name) - { - return entry->index; - } - } - - throw asm_error("couldn't resolve local function address of '" + name + "'!"); -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/assembler.hpp b/src/s1/xsk/assembler.hpp deleted file mode 100644 index 2e702292..00000000 --- a/src/s1/xsk/assembler.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::s1 -{ - -class assembler : public gsc::assembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output_script() -> std::vector; - auto output_stack() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, std::vector& funcs); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void assemble_local_call(const instruction::ptr& inst, bool thread); - void assemble_far_call(const instruction::ptr& inst, bool thread); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void assemble_field_variable(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst, bool expr, bool back); - void assemble_offset(std::int32_t offset); - auto resolve_function(const std::string& name) -> std::int32_t; - auto resolve_label(const std::string& name) -> std::int32_t; -}; - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/compiler.cpp b/src/s1/xsk/compiler.cpp deleted file mode 100644 index ed7a07fc..00000000 --- a/src/s1/xsk/compiler.cpp +++ /dev/null @@ -1,2970 +0,0 @@ -// 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 "s1.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -namespace xsk::gsc::s1 -{ - -auto compiler::output() -> std::vector -{ - return std::move(assembly_); -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "an unknown error ocurred while parsing gsc file"); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_.clear(); - includes_.clear(); - animtrees_.clear(); - constants_.clear(); - local_functions_.clear(); - index_ = 1; - 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& inc : includes_) - { - if (inc.name == path) - { - throw comp_error(include->loc(), "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(), "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 developer block comment"); - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) -{ - const auto itr = constants_.find(constant->name->value); - - if (itr != constants_.end()) - throw comp_error(constant->loc(), "duplicated constant '" + constant->name->value + "'"); - - 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; - - auto blk = std::make_unique(); - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - break_blks_.clear(); - continue_blks_.clear(); - - process_thread(thread, blk); - - emit_expr_parameters(thread->params, blk); - emit_stmt_list(thread->stmt, blk, true); - emit_opcode(opcode::OP_End); - - function_->size = index_ - function_->index; - assembly_.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list, blk, last); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev, blk, last); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend, blk); - break; - case ast::kind::stmt_waitframe: - emit_stmt_waitframe(stmt.as_waitframe, blk); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if, blk, last); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse, blk, last); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case, blk); - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default, blk); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return, blk); - break; - case ast::kind::stmt_breakpoint: - emit_stmt_breakpoint(stmt.as_breakpoint, blk); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin, blk); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end, blk); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last) -{ - for (const auto& entry : stmt->list) - { - bool last_ = (&entry == &stmt->list.back() && last) ? true : false; - emit_stmt(entry, blk, last_); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last) -{ - emit_stmt_list(stmt->list, blk, last); -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - 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, const block::ptr& blk) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, blk, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, blk, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_endon); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } - - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->time, blk); - emit_opcode(opcode::OP_wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittill); - - for (const auto& entry : stmt->args->list) - { - variable_create(entry.as_identifier, blk); - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(entry.as_identifier, blk)); - } - - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - emit_expr_arguments(stmt->args, blk); - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_waittillmatch2); - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waittillFrameEnd); -} - -void compiler::emit_stmt_waitframe(const ast::stmt_waitframe::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waitFrame); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - blk->transfer(stmt->blk); - - emit_stmt(stmt->stmt, stmt->blk, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last) -{ - std::vector childs; - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - blk->transfer(stmt->blk_if); - - emit_stmt(stmt->stmt_if, stmt->blk_if, last); - - emit_remove_local_vars(stmt->blk_if); - - if (stmt->blk_if->abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - - last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - - blk->transfer(stmt->blk_else); - - emit_stmt(stmt->stmt_else, stmt->blk_else, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk_else); - - if (stmt->blk_else->abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - - insert_label(end_loc); - - blk->init_from_child(childs); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_stmt(stmt->init, blk, false); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->blk_iter); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - can_break_ = true; - can_continue_ = true; - - emit_stmt(stmt->stmt, stmt->blk, false); - - if (stmt->blk->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->blk.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->blk_iter->init_from_child(continue_blks_); - - emit_stmt(stmt->iter, stmt->blk_iter, false); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_expr(stmt->array_expr, blk); - emit_expr_variable_ref(stmt->array, blk, true); - emit_expr_variable(stmt->array, blk); - emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); - emit_expr_variable_ref(stmt->key_expr, blk, true); - - blk->transfer(stmt->ctx); - stmt->ctx->loc_break = break_loc; - stmt->ctx->loc_continue = continue_loc; - - emit_create_local_vars(stmt->ctx); - - blk->local_vars_create_count = stmt->ctx->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->ctx_post); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr, blk); - emit_opcode(opcode::OP_CallBuiltin1, "isdefined"); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr, stmt->ctx); - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->array.as_identifier, stmt->ctx)); - emit_expr_variable_ref(stmt->value_expr, stmt->ctx, true); - emit_stmt(stmt->stmt, stmt->ctx, false); - - if (stmt->ctx->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->ctx.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->ctx_post->init_from_child(continue_blks_); - - emit_expr_variable(stmt->key_expr, stmt->ctx_post); - emit_expr_variable(stmt->array, stmt->ctx_post); - emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); - emit_expr_variable_ref(stmt->key_expr, stmt->ctx_post, true); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - emit_expr_clear_local(stmt->array.as_identifier, blk); - if (!stmt->use_key) emit_expr_clear_local(stmt->key_expr.as_identifier, blk); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_break = can_break_; - break_blks_.clear(); - can_break_ = false; - - auto jmptable_loc = create_label(); - auto break_loc = create_label(); - - emit_expr(stmt->test, blk); - 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; - block* default_ctx = nullptr; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - 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"); - } - - blk->transfer(case_->blk); - case_->blk->loc_break = break_loc; - emit_stmt_list(case_->stmt, case_->blk, false); - if (case_->stmt->list.size() > 0) - emit_remove_local_vars(case_->blk); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - - has_default = true; - default_ctx = entry.as_default->blk.get(); - - blk->transfer(entry.as_default->blk); - entry.as_default->blk->loc_break = break_loc; - emit_stmt_list(entry.as_default->stmt, entry.as_default->blk, false); - if (entry.as_default->stmt->list.size() > 0) - emit_remove_local_vars(entry.as_default->blk); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - } - blk->init_from_child(break_blks_); - } - - insert_label(jmptable_loc); - - emit_opcode(opcode::OP_endswitch, data); - - auto offset = static_cast(7 * stmt->stmt->list.size()); - function_->instructions.back()->size += offset; - index_ += offset; - - insert_label(break_loc); - - can_break_ = old_break; - break_blks_ = old_breaks; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) -{ - if (!can_break_ || blk->abort != abort_t::abort_none || blk->loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - break_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_break; - emit_opcode(opcode::OP_jump, blk->loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) -{ - if (!can_continue_ || blk->abort != abort_t::abort_none || blk->loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - continue_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_continue; - emit_opcode(opcode::OP_jump, blk->loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - blk->abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr, blk); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child, blk); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate, blk); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference, blk); - break; - case ast::kind::expr_add_array: - emit_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_thisthread: - emit_opcode(opcode::OP_GetThisthread); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - 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, blk); - 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, const block::ptr& blk) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue, blk); - } - else if (expr->lvalue == ast::kind::expr_tuple) - { - emit_expr(expr->rvalue, blk); - emit_expr_tuple(expr->lvalue.as_tuple, blk); - } - else - { - emit_expr(expr->rvalue, blk); - emit_expr_variable_ref(expr->lvalue, blk, true); - } - - return; - } - - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - 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_mod); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_ex_or); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, blk, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key, blk); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, blk, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj, blk); - 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, blk, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk) -{ - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); - else - emit_opcode(opcode::OP_ClearLocalVariableFieldCached, variable_access_index(expr, blk)); -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_inc); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_dec); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr, blk); - emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr, blk); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_equality); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_inequality); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_less); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_greater); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_less_equal); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_greater_equal); - 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_ex_or); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_mod); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt && mode_ == gsc::build::prod) - { - const auto& name = expr->name->value; - if (name == "assert" || name == "assertex" || name == "assertmsg") return; - } - - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal && expr->args->list.size() > 0) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptLocalFunctionCall, expr->name->value); - else - emit_opcode(opcode::OP_ScriptLocalFunctionCall2, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptFarFunctionCall, { expr->path->value, expr->name->value }); - else - emit_opcode(opcode::OP_ScriptFarFunctionCall2, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltin0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltin1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltin2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltin3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltin4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltin5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltin, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptLocalMethodCall, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFarMethodCall, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltinMethod0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltinMethod1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltinMethod2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltinMethod3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltinMethod4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltinMethod5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltinMethod, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_EmptyArray); - - for (const auto& arg : expr->args->list) - { - emit_expr(arg, blk); - emit_opcode(opcode::OP_AddArray); - } -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) -{ - for (const auto& entry : expr->list) - { - variable_initialize(entry, blk); - emit_opcode(opcode::OP_SafeCreateVariableFieldCached, variable_create_index(entry, blk)); - } - - emit_opcode(opcode::OP_checkclearparams); -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry, blk); - } -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) -{ - bool method = false; - auto type = resolve_reference_type(expr, method); - - switch (type) - { - case ast::call::type::local: - emit_opcode(opcode::OP_GetLocalFunction, expr->name->value); - break; - case ast::call::type::far: - emit_opcode(opcode::OP_GetFarFunction, { expr->path->value, expr->name->value }); - break; - case ast::call::type::builtin: - if (method) - emit_opcode(opcode::OP_GetBuiltinMethod, expr->name->value); - else - emit_opcode(opcode::OP_GetBuiltinFunction, expr->name->value); - break; - } -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_size); -} - -void compiler::emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - emit_expr_variable_ref(expr->temp, blk, true); - - auto index = 0; - - for (const auto& entry : expr->list) - { - if (index == 0) - emit_opcode(opcode::OP_GetZero); - else - emit_opcode(opcode::OP_GetByte, utils::string::va("%d", index)); - - index++; - - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->temp.as_identifier, blk)); - - emit_expr_variable_ref(entry, blk, true); - } - - emit_expr_clear_local(expr->temp.as_identifier, blk); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, blk, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, blk, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, blk, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set) -{ - emit_expr(expr->key, blk); - - 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, blk, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - { - if (!variable_initialized(expr->obj.as_identifier, blk)) - { - variable_initialize(expr->obj.as_identifier, blk); - emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(expr->obj.as_identifier, blk)); - - if (!set) throw comp_error(expr->loc(), "INTERNAL: VAR CREATED BUT NOT SET!"); - } - else if (variable_stack_index(expr->obj.as_identifier, blk) == 0) - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached0); - } - else - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access_index(expr->obj.as_identifier, blk)); - } - - 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, const block::ptr& blk, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); - break; - case ast::kind::expr_anim: - set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); - break; - case ast::kind::expr_self: - set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - 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, blk); - 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_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, 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 + "'"); - } - - if (set) - { - if (!variable_initialized(expr, blk)) - { - variable_initialize(expr, blk); - emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(expr, blk)); - } - else if (variable_stack_index(expr, blk) == 0) - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached0); - } - else - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached, variable_access_index(expr, blk)); - } - } - else - { - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_EvalLocalVariableRefCached0); - else - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access_index(expr, blk)); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->key, blk); - - if (expr->obj == ast::kind::expr_identifier) - { - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->obj.as_identifier, blk)); - } - else - { - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_EvalArray); - } -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_EvalLevelFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_EvalAnimFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_EvalSelfFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, const block::ptr& blk) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - emit_expr(itr->second, blk); - return; - } - - // is local var - auto index = variable_stack_index(expr, blk); - - switch (index) - { - case 0: - emit_opcode(opcode::OP_EvalLocalVariableCached0); - break; - case 1: - emit_opcode(opcode::OP_EvalLocalVariableCached1); - break; - case 2: - emit_opcode(opcode::OP_EvalLocalVariableCached2); - break; - case 3: - emit_opcode(opcode::OP_EvalLocalVariableCached3); - break; - case 4: - emit_opcode(opcode::OP_EvalLocalVariableCached4); - break; - case 5: - emit_opcode(opcode::OP_EvalLocalVariableCached5); - break; - default: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access_index(expr, blk)); - break; - } -} - -void compiler::emit_expr_object(const ast::expr& expr, const block::ptr& blk) -{ - 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, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr.as_identifier, blk)); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk) -{ - std::vector data; - - bool isexpr = false; - - 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, blk); - emit_expr(expr->y, blk); - emit_expr(expr->x, blk); - 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(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimation, { "", expr->value }); - } - else - { - emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); - tree.loaded = true; - } -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error(expr->loc(), "trying to use animtree without specified using animtree"); - } - - auto& tree = animtrees_.back(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimTree, ""); - } - else - { - emit_opcode(opcode::OP_GetAnimTree, tree.name); - tree.loaded = true; - } -} - -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_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_create_local_vars(const block::ptr& blk) -{ - if (blk->local_vars_create_count != blk->local_vars_public_count) - { - for (auto i = blk->local_vars_create_count; i < blk->local_vars_public_count; i++) - { - auto data = utils::string::va("%d", blk->local_vars.at(i).create); - emit_opcode(opcode::OP_CreateLocalVariable, data); - blk->local_vars.at(i).init = true; - } - blk->local_vars_create_count = blk->local_vars_public_count; - } -} - -void compiler::emit_remove_local_vars(const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - auto count = blk->local_vars_create_count - blk->local_vars_public_count; - - if (count > 0) - { - auto data = utils::string::va("%d", count); - emit_opcode(opcode::OP_RemoveLocalVariables, data); - } - } -} - -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, const block::ptr& blk) -{ - process_expr_parameters(decl->params, blk); - process_stmt_list(decl->stmt, blk); -} - -void compiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - 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_waitframe: - case ast::kind::stmt_case: - case ast::kind::stmt_default: - 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, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk) -{ - process_stmt_list(stmt->list, blk); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - 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, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - blk->merge(childs); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - stmt->blk_if = std::make_unique(); - stmt->blk_else = std::make_unique(); - - blk->copy(stmt->blk_if); - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - blk->copy(stmt->blk_else); - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - blk->merge(childs); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - stmt->blk = std::make_unique(); - stmt->blk_iter = std::make_unique(); - - process_stmt(stmt->init, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->blk); - blk->copy(stmt->blk_iter); - - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_stmt(stmt->iter, stmt->blk_iter); - - blk->append({ stmt->blk_iter.get() }); - blk->merge({ stmt->blk_iter.get() }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto array_name = utils::string::va("_temp_%d", ++label_idx_); - auto key_name = utils::string::va("_temp_%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; - - // calculate variables - - stmt->ctx = std::make_unique(); - stmt->ctx_post = std::make_unique(); - - // calculate pre_expr variables - process_expr(stmt->array, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->ctx); - blk->copy(stmt->ctx_post); - - // calculate stmt variables & add missing array access as first stmt - process_expr(stmt->value_expr, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - continue_blks_.push_back(stmt->ctx.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_expr(stmt->key_expr, stmt->ctx_post); - - blk->append({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - // calculate variables - stmt->ctx = std::make_unique(); - std::vector childs; - auto abort = abort_t::abort_return; - bool has_default = false; - block* default_ctx = nullptr; - auto old_breaks = break_blks_; - break_blks_.clear(); - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->copy(entry.as_case->blk); - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort != abort_t::abort_none) - { - if (entry.as_case->blk->abort == abort_t::abort_break ) - { - entry.as_case->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_case->blk.get()); - } - else if (entry.as_case->blk->abort <= abort ) - { - abort = entry.as_case->blk->abort; - } - } - } - else if (entry == ast::kind::stmt_default) - { - entry.as_default->blk = std::make_unique(); - blk->copy(entry.as_default->blk); - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - has_default = true; - default_ctx = entry.as_default->blk.get(); - - if (entry.as_default->blk->abort != abort_t::abort_none) - { - if (entry.as_default->blk->abort == abort_t::abort_break ) - { - entry.as_default->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_default->blk.get()); - } - else if (entry.as_default->blk->abort <= abort ) - { - abort = entry.as_default->blk->abort; - } - } - } - } - - stmt->stmt =std::move(stmt_list); - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - } - - blk->append(break_blks_); - blk->merge(childs); - } - - break_blks_ = old_breaks; -} - -void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - break_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_break; - } -} - -void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - continue_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_continue; - } -} - -void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } -} - -void compiler::process_expr(const ast::expr& expr, const block::ptr& blk) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value, blk); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj, blk); - } - else if (expr == ast::kind::expr_tuple) - { - process_expr_tuple(expr.as_tuple, blk); - } -} - -void compiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - auto array = utils::string::va("_temp_%d", ++label_idx_); - expr->temp = ast::expr(std::make_unique(expr->loc(), array)); - - process_expr(expr->temp, blk); - - for (const auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk) -{ - for (const auto& entry : decl->list) - { - variable_register(entry->value, blk); - } -} - -void compiler::variable_register(const std::string& name, const block::ptr& blk) -{ - auto it = std::find_if (blk->local_vars.begin(), blk->local_vars.end(), - [&](const gsc::local_var& v) { return v.name == name; }); - - if (it == blk->local_vars.end()) - { - auto found = false; - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - blk->local_vars.push_back({ name, static_cast(i), false }); - found = true; - break; - } - } - - if (!found) - { - blk->local_vars.push_back({ name, stack_idx_, false }); - local_stack_.push_back(name); - stack_idx_++; - } - } -} - -void compiler::variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::uint32_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (!blk->local_vars[i].init) - { - for (std::uint32_t j = 0; j < i; j++) - { - if (!blk->local_vars[j].init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", blk->local_vars[j].create)); - blk->local_vars[j].init = true; - } - } - blk->local_vars[i].init = true; - blk->local_vars_create_count = i + 1; - return; - } - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -void compiler::variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - auto& var = blk->local_vars.at(i); - if (var.name == name->value) - { - if (!var.init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); - var.init = true; - blk->local_vars_create_count++; - } - return; - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return static_cast(blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - return utils::string::va("%d", blk->local_vars[i].create); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return utils::string::va("%d", blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - return blk->local_vars.at(i).init; - } - } - - 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_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jump: - case opcode::OP_jumpback: - case opcode::OP_switch: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_endswitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - -auto compiler::map_known_includes(const std::string&) -> bool -{ - return false; -} - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/compiler.hpp b/src/s1/xsk/compiler.hpp deleted file mode 100644 index f444da84..00000000 --- a/src/s1/xsk/compiler.hpp +++ /dev/null @@ -1,160 +0,0 @@ -// 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::gsc::s1 -{ - -enum class opcode : std::uint8_t; - -class compiler : public gsc::compiler -{ - build mode_; - std::string filename_; - std::vector assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector break_blks_; - std::vector continue_blks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - -public: - auto output() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_constant(const ast::decl_constant::ptr& constant); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last); - void emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void emit_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt, const block::ptr& blk); - void emit_stmt_waitframe(const ast::stmt_waitframe::ptr& stmt, const block::ptr& blk); - void emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk); - void emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk); - void emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk); - void emit_expr(const ast::expr& expr, const block::ptr& blk); - void emit_expr_assign(const ast::expr_assign::ptr& expr, const block::ptr& blk); - void emit_expr_clear(const ast::expr& expr, const block::ptr& blk); - void emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk); - void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk); - void emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_variable(const ast::expr& expr, const block::ptr& blk); - void emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void emit_expr_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_object(const ast::expr& expr, const block::ptr& blk); - void emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_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_create_local_vars(const block::ptr& blk); - void emit_remove_local_vars(const block::ptr& blk); - 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, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(const ast::expr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk); - void variable_register(const std::string& name, const block::ptr& blk); - void variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk); - void variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk); - auto variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t; - auto variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool; - 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; -}; - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/context.cpp b/src/s1/xsk/context.cpp deleted file mode 100644 index e64c2345..00000000 --- a/src/s1/xsk/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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 "s1.hpp" - -namespace xsk::gsc::s1 -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/context.hpp b/src/s1/xsk/context.hpp deleted file mode 100644 index 99db73cd..00000000 --- a/src/s1/xsk/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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::gsc::s1 -{ - -class context : public gsc::context -{ - s1::assembler assembler_; - s1::disassembler disassembler_; - s1::compiler compiler_; - s1::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { return assembler_; } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { return compiler_; } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/decompiler.cpp b/src/s1/xsk/decompiler.cpp deleted file mode 100644 index fd7e6719..00000000 --- a/src/s1/xsk/decompiler.cpp +++ /dev/null @@ -1,3442 +0,0 @@ -// 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 "s1.hpp" - -namespace xsk::gsc::s1 -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// S1 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetLocalFunction: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalFunctionCall2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - 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_ScriptLocalFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalMethodCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodChildThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall2: - { - 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 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_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin1: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin3: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin4: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin5: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod1: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod2: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod3: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod4: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod5: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_waitFrame: - { - auto stmt = ast::stmt(std::make_unique(loc)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_waittill: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto args = std::make_unique(loc); - auto node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // continue is at jumpback, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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 - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - auto use_key = true; - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - use_key = false; - } - - 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)), use_key)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(std::stoi(entry->value.substr(4))), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - auto var = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - auto var1 = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); - blk->local_vars_create_count++; - } - - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/decompiler.hpp b/src/s1/xsk/decompiler.hpp deleted file mode 100644 index cbe3cee6..00000000 --- a/src/s1/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::s1 -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/disassembler.cpp b/src/s1/xsk/disassembler.cpp deleted file mode 100644 index 8eaf1cb4..00000000 --- a/src/s1/xsk/disassembler.cpp +++ /dev/null @@ -1,575 +0,0 @@ -// 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 "s1.hpp" - -namespace xsk::gsc::s1 -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// S1 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read(); - func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - 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->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetVector: - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(4); - inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); - break; - case opcode::OP_GetAnimation: - script_->seek(8); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - disassemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto id = script_->read(); - const auto name = method ? resolver::method_name(id) : resolver::function_name(id); - inst->data.emplace(inst->data.begin(), name); -} - -void disassembler::disassemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto offset = disassemble_offset(); - - inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(3); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto file_id = stack_->read(); - const auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::token_name(file_id); - const auto func_id = stack_->read(); - const auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); - - inst->data.emplace(inst->data.begin(), func_name); - inst->data.emplace(inst->data.begin(), file_name); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read(); - 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) -{ - const auto count = script_->read(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read(); - - if (value < 0x40000) - { - const auto data = stack_->read_c_string(); - - if (data.data()[0] != 0x01) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(data, false)); - } - else - inst->data.push_back("default"); - } - else - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - index += 4; - - const auto addr = disassemble_offset() + index; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 3; - inst->size += 7; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - const auto id = script_->read(); - std::string name; - - if (id > max_string_id) - { - auto temp = stack_->read(); - name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); - } - else - { - name = resolver::token_name(id); - } - - inst->data.push_back(name); -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read(); - } - else if (back) - { - addr = inst->index + 3 - script_->read(); - } - else - { - addr = inst->index + 5 + script_->read(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -auto disassembler::disassemble_offset() -> std::int32_t -{ - std::array bytes = {}; - - for (auto i = 0; i < 3; i++) - { - bytes[i] = script_->read(); - } - - auto offset = *reinterpret_cast(bytes.data()); - - offset = (offset << 8) >> 10; - - return offset; -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = resolve_function(inst->data[0]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s\n", func->name.data())); - - 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())); - } - - print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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; - } - if (casenum != totalcase - 1) - { - output_->write_string("\n"); - } - } - } - break; - default: - for (auto& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - break; - } - - output_->write_string("\n"); -} - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/disassembler.hpp b/src/s1/xsk/disassembler.hpp deleted file mode 100644 index 38546617..00000000 --- a/src/s1/xsk/disassembler.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc::s1 -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_local_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - auto disassemble_offset() -> std::int32_t; - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/lexer.cpp b/src/s1/xsk/lexer.cpp deleted file mode 100644 index 76adf52b..00000000 --- a/src/s1/xsk/lexer.cpp +++ /dev/null @@ -1,849 +0,0 @@ -// 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 "s1.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -xsk::gsc::s1::parser::symbol_type S1lex(xsk::gsc::s1::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::gsc::s1 -{ - -const std::unordered_map keyword_map -{{ - { "#define", parser::token::SH_DEFINE }, - { "#undef", parser::token::SH_UNDEF }, - { "#ifdef", parser::token::SH_IFDEF }, - { "#ifndef", parser::token::SH_IFNDEF }, - { "#if", parser::token::SH_IF }, - { "#elif", parser::token::SH_ELIF }, - { "#else", parser::token::SH_ELSE }, - { "#endif", parser::token::SH_ENDIF }, - { "#inline", parser::token::INLINE }, - { "#include", parser::token::INCLUDE }, - { "#using_animtree", parser::token::USINGTREE }, - { "#animtree", parser::token::ANIMTREE }, - { "endon", parser::token::ENDON }, - { "notify", parser::token::NOTIFY }, - { "wait", parser::token::WAIT }, - { "waittill", parser::token::WAITTILL }, - { "waittillmatch", parser::token::WAITTILLMATCH }, - { "waittillframeend", parser::token::WAITTILLFRAMEEND }, - { "waitframe", parser::token::WAITFRAME }, - { "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 }, - { "childthread", parser::token::CHILDTHREAD }, - { "thisthread", parser::token::THISTHREAD }, - { "call", parser::token::CALL }, - { "true", parser::token::TRUE }, - { "false", parser::token::FALSE }, - { "undefined", parser::token::UNDEFINED }, - { "size", parser::token::SIZE }, - { "game", parser::token::GAME }, - { "self", parser::token::SELF }, - { "anim", parser::token::ANIM }, - { "level", parser::token::LEVEL }, -}}; - -buffer::buffer() : length(0) -{ - data = static_cast(std::malloc(max_buf_size)); -} - -buffer::~buffer() -{ - if (data) std::free(data); -} - -bool buffer::push(char c) -{ - if (length >= max_buf_size) - return false; - - data[length++] = c; - return true; -} - -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) -{ - -} - -void reader::init(const char* data, size_t size) -{ - if (data && size) - { - state = reader::ok; - buffer_pos = data; - bytes_remaining = static_cast(size); - last_byte = 0; - current_byte = *data; - } - else - { - state = reader::end; - buffer_pos = 0; - bytes_remaining = 0; - last_byte = 0; - current_byte = 0; - } -} - -void reader::advance() -{ - ++buffer_pos; - - if (bytes_remaining-- == 1) - { - state = reader::end; - bytes_remaining = 0; - last_byte = current_byte; - current_byte = 0; - } - else - { - last_byte = current_byte; - current_byte = *buffer_pos; - } -} - -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) -{ - reader_.init(data, size); -} - -void lexer::push_header(const std::string& file) -{ - try - { - if (header_top_++ >= 10) - throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - - auto data = resolver::file_data(file + ".gsh"); - - readers_.push(reader_); - locs_.push(loc_); - loc_.initialize(std::get<0>(data)); - reader_.init(std::get<1>(data), std::get<2>(data)); - clean_ = true; - } - catch (const std::exception& e) - { - throw error("parsing header file '" + file + "': " + e.what()); - } -} - -void lexer::pop_header() -{ - header_top_--; - loc_ = locs_.top(); - locs_.pop(); - reader_ = readers_.top(); - readers_.pop(); -} - -void lexer::ban_header(const location& loc) -{ - if (header_top_ > 0) - { - throw comp_error(loc, "not allowed inside a gsh file"); - } -} - -auto lexer::lex() -> parser::symbol_type -{ - buffer_.length = 0; - state_ = state::start; - - while (true) - { - const auto& state = reader_.state; - auto& last = reader_.last_byte; - auto& curr = reader_.current_byte; - auto path = false; - loc_.step(); - - if (state == reader::end) - { - if (indev_) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (header_top_ > 0) - pop_header(); - else - return parser::make_S1EOF(loc_); - } - - if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') - clean_ = false; - - advance(); - - switch (last) - { - case ' ': - case '\t': - case '\r': - loc_.step(); - continue; - case '\n': - loc_.lines(); - loc_.step(); - clean_ = true; - continue; - case '\\': - throw comp_error(loc_, "invalid token ('\\')"); - case '/': - if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') - return parser::make_DIV(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_DIV(loc_); - - if (last == '#') - { - if (indev_) - throw comp_error(loc_, "cannot recurse devblock ('/#')"); - - if (mode_ == build::dev) - { - indev_ = true; - return parser::make_DEVBEGIN(loc_); - } - else - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '#' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - } - else if (last == '@') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched script doc comment start ('/@')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '@' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '*') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched multiline comment start ('/*')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '*' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '/') - { - while (true) - { - if (state == reader::end) - break; - - if (curr == '\n') - break; - - advance(); - } - } - continue; - case '#': - if (curr == '/') - { - if (!indev_) - throw comp_error(loc_, "unmatched devblock end ('#/')"); - - advance(); - indev_ = false; - return parser::make_DEVEND(loc_); - } - - buffer_.push(last); - advance(); - - while (state == reader::ok) - { - if (last != ' ' || last != '\t') - break; - - advance(); - } - - if (state == reader::end || !((last > 64 && last < 91) || (last > 96 && last < 123))) - throw comp_error(loc_, "invalid preprocessor directive ('#')"); - - state_ = state::preprocessor; - goto lex_name; - case '*': - if (curr != '=' && curr != '/') - return parser::make_MUL(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_MUL(loc_); - - throw comp_error(loc_, "unmatched multiline comment end ('*/')"); - case '"': - state_ = state::string; - goto lex_string; - case '.': - if (curr < '0' || curr > '9') - return parser::make_DOT(loc_); - goto lex_number; - case '(': - return parser::make_LPAREN(loc_); - case ')': - return parser::make_RPAREN(loc_); - case '{': - return parser::make_LBRACE(loc_); - case '}': - return parser::make_RBRACE(loc_); - case '[': - return parser::make_LBRACKET(loc_); - case ']': - return parser::make_RBRACKET(loc_); - case ',': - return parser::make_COMMA(loc_); - case ';': - return parser::make_SEMICOLON(loc_); - case ':': - if (curr != ':') - return parser::make_COLON(loc_); - - advance(); - return parser::make_DOUBLECOLON(loc_); - case '?': - return parser::make_QMARK(loc_); - case '=': - if (curr != '=') - return parser::make_ASSIGN(loc_); - - advance(); - return parser::make_EQUALITY(loc_); - case '+': - if (curr != '+' && curr != '=') - return parser::make_ADD(loc_); - - advance(); - - if (last == '+') - return parser::make_INCREMENT(loc_); - - return parser::make_ASSIGN_ADD(loc_); - case '-': - if (curr != '-' && curr != '=') - return parser::make_SUB(loc_); - - advance(); - - if (last == '-') - return parser::make_DECREMENT(loc_); - - return parser::make_ASSIGN_SUB(loc_); - case '%': - if (curr != '=') - return parser::make_MOD(loc_); - - advance(); - - return parser::make_ASSIGN_MOD(loc_); - case '|': - if (curr != '|' && curr != '=') - return parser::make_BITWISE_OR(loc_); - - advance(); - - if (last == '|') - return parser::make_OR(loc_); - - return parser::make_ASSIGN_BW_OR(loc_); - case '&': - if (curr != '&' && curr != '=' && curr != '"') - return parser::make_BITWISE_AND(loc_); - - advance(); - - if (last == '&') - return parser::make_AND(loc_); - - if (last == '=') - return parser::make_ASSIGN_BW_AND(loc_); - - state_ = state::localize; - goto lex_string; - case '^': - if (curr != '=') - return parser::make_BITWISE_EXOR(loc_); - - advance(); - return parser::make_ASSIGN_BW_EXOR(loc_); - case '!': - if (curr != '=') - return parser::make_NOT(loc_); - - advance(); - return parser::make_INEQUALITY(loc_); - case '~': - return parser::make_COMPLEMENT(loc_); - case '<': - if (curr != '<' && curr != '=') - return parser::make_LESS(loc_); - - advance(); - if (last == '=') - return parser::make_LESS_EQUAL(loc_); - - if (curr != '=') - return parser::make_LSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_LSHIFT(loc_); - case '>': - if (curr != '>' && curr != '=') - return parser::make_GREATER(loc_); - - advance(); - - if (last == '=') - return parser::make_GREATER_EQUAL(loc_); - - if (curr != '=') - return parser::make_RSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_RSHIFT(loc_); - default: - if (last >= '0' && last <= '9') - goto lex_number; - else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) - goto lex_name; - - throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); - } - -lex_string: - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched string start ('\"')"); - - if (curr == '"') - { - advance(); - break; - } - - if (curr == '\n') - throw comp_error(loc_, "unterminated string literal"); - - if (curr == '\\') - { - advance(); - - if (state == reader::end) - throw comp_error(loc_, "invalid token ('\')"); - - char c = curr; - switch (curr) - { - case 't': c = '\t'; break; - case 'r': c = '\r'; break; - case 'n': c = '\n'; break; - case '"': c = '\"'; break; - case '\\': c = '\\'; break; - default: break; - } - - if (!buffer_.push(c)) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); - -lex_name: - buffer_.push(last); - - while (true) - { - if (state == reader::end) - break; - - if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) - break; - - if (curr == '\\') - { - if (last == '\\') - throw comp_error(loc_, "invalid path '\\\\'"); - - path = true; - if (!buffer_.push('/')) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::preprocessor) - { - auto token = parser::token::S1UNDEF; - - if (buffer_.length < 16) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - { - if (itr->second > parser::token::SH_ENDIF) - return parser::symbol_type(itr->second, loc_); - - token = itr->second; - } - } - - preprocessor_run(token); - - state_ = state::start; - continue; - } - else - { - 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_); - } - - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - -lex_number: - if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) - { - buffer_.push(last); - - auto dot = last == '.' ? 1 : 0; - auto flt = 0; - - while (true) - { - if (state == reader::end) - break; - - if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) - throw comp_error(loc_, "invalid number literal"); - - if ((curr == '.' || curr == 'f') && last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr == 'f') - flt++; - else if (curr == '.') - dot++; - else if (!(curr > 47 && curr < 58)) - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f')) - throw comp_error(loc_, "invalid number literal"); - - if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); - } - else if (curr == 'o') - { - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) - throw comp_error(loc_, "invalid octal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!(curr > 47 && curr < 56)) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length <= 0) - throw comp_error(loc_, "invalid octal literal"); - - return parser::make_INTEGER(utils::string::oct_to_dec(buffer_.data), loc_); - } - else if (curr == 'b') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) - throw comp_error(loc_, "invalid binary literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr != '0' && curr != '1') - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid binary literal"); - - return parser::make_INTEGER(utils::string::bin_to_dec(buffer_.data), loc_); - } - else if (curr == 'x') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) - throw comp_error(loc_, "invalid hexadecimal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid hexadecimal literal"); - - return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); - } - - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); - } -} - -void lexer::advance() -{ - reader_.advance(); - loc_.end.column++; - - if (reader_.current_byte == '\\') [[unlikely]] - preprocessor_wrap(); -} - -void lexer::preprocessor_wrap() -{ - while (reader_.current_byte == '\\') - { - if (reader_.bytes_remaining == 1) - throw comp_error(loc_, "invalid token ('\\')"); - - if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') - break; - - if (reader_.buffer_pos[1] == '\r') - { - if (reader_.bytes_remaining <= 3 || reader_.buffer_pos[2] != '\n') - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 3; - reader_.bytes_remaining -= 3; - } - - if ((reader_.buffer_pos[1] == '\n')) - { - if (reader_.bytes_remaining == 2) - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 2; - reader_.bytes_remaining -= 2; - } - - if (reader_.bytes_remaining == 0) - { - reader_.state = reader::end; - reader_.current_byte = 0; - } - else - { - reader_.current_byte = *reader_.buffer_pos; - } - - loc_.lines(); - loc_.step(); - } -} - -void lexer::preprocessor_run(parser::token::token_kind_type token) -{ - if (!clean_) - throw comp_error(loc_, "invalid token ('#')"); - - switch (token) - { - case parser::token::SH_DEFINE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_UNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELSE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ENDIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - default: - throw comp_error(loc_, "unknown preprocessor directive"); - } -} - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/lexer.hpp b/src/s1/xsk/lexer.hpp deleted file mode 100644 index 89025421..00000000 --- a/src/s1/xsk/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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::gsc::s1 -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/parser.cpp b/src/s1/xsk/parser.cpp deleted file mode 100644 index cf0eb6ea..00000000 --- a/src/s1/xsk/parser.cpp +++ /dev/null @@ -1,4733 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::s1::parser::symbol_type S1lex(xsk::gsc::s1::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex S1lex - - - -#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 S1DEBUG - -// 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 // !S1DEBUG - -# 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 // !S1DEBUG - -#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 gsc { namespace s1 { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::gsc::s1::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg) -#if S1DEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - 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_add_array: // expr_add_array - value.YY_MOVE_OR_COPY< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.YY_MOVE_OR_COPY< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.YY_MOVE_OR_COPY< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.YY_MOVE_OR_COPY< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.YY_MOVE_OR_COPY< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.YY_MOVE_OR_COPY< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.YY_MOVE_OR_COPY< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.YY_MOVE_OR_COPY< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.copy< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.copy< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.copy< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.copy< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 S1DEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if S1DEBUG - 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 // S1DEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - yylhs.value.emplace< ast::expr_add_array::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - yylhs.value.emplace< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - yylhs.value.emplace< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - yylhs.value.emplace< ast::stmt_waitframe::ptr > (); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - yylhs.value.emplace< ast::stmt_waittill::ptr > (); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - yylhs.value.emplace< ast::stmt_waittillframeend::ptr > (); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - yylhs.value.emplace< ast::stmt_waittillmatch::ptr > (); - break; - - case symbol_kind::S_stmt_while: // stmt_while - yylhs.value.emplace< ast::stmt_while::ptr > (); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 263 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2040 "parser.cpp" - break; - - case 3: // root: %empty -#line 264 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2046 "parser.cpp" - break; - - case 4: // program: program inline -#line 269 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2052 "parser.cpp" - break; - - case 5: // program: program include -#line 271 "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 2058 "parser.cpp" - break; - - case 6: // program: program declaration -#line 273 "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 2064 "parser.cpp" - break; - - case 7: // program: inline -#line 275 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2070 "parser.cpp" - break; - - case 8: // program: include -#line 277 "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 2076 "parser.cpp" - break; - - case 9: // program: declaration -#line 279 "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 2082 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 283 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2088 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 288 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2094 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 292 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2100 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 293 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2106 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 294 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2112 "parser.cpp" - break; - - case 15: // declaration: decl_constant -#line 295 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } -#line 2118 "parser.cpp" - break; - - case 16: // declaration: decl_thread -#line 296 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2124 "parser.cpp" - break; - - case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 301 "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 2130 "parser.cpp" - break; - - case 18: // decl_constant: expr_identifier "=" expr ";" -#line 306 "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 2136 "parser.cpp" - break; - - case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 311 "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 2142 "parser.cpp" - break; - - case 20: // stmt: stmt_block -#line 315 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2148 "parser.cpp" - break; - - case 21: // stmt: stmt_call -#line 316 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2154 "parser.cpp" - break; - - case 22: // stmt: stmt_assign -#line 317 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2160 "parser.cpp" - break; - - case 23: // stmt: stmt_endon -#line 318 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2166 "parser.cpp" - break; - - case 24: // stmt: stmt_notify -#line 319 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2172 "parser.cpp" - break; - - case 25: // stmt: stmt_wait -#line 320 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2178 "parser.cpp" - break; - - case 26: // stmt: stmt_waittill -#line 321 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2184 "parser.cpp" - break; - - case 27: // stmt: stmt_waittillmatch -#line 322 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2190 "parser.cpp" - break; - - case 28: // stmt: stmt_waittillframeend -#line 323 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2196 "parser.cpp" - break; - - case 29: // stmt: stmt_waitframe -#line 324 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } -#line 2202 "parser.cpp" - break; - - case 30: // stmt: stmt_if -#line 325 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2208 "parser.cpp" - break; - - case 31: // stmt: stmt_ifelse -#line 326 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2214 "parser.cpp" - break; - - case 32: // stmt: stmt_while -#line 327 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2220 "parser.cpp" - break; - - case 33: // stmt: stmt_dowhile -#line 328 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2226 "parser.cpp" - break; - - case 34: // stmt: stmt_for -#line 329 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2232 "parser.cpp" - break; - - case 35: // stmt: stmt_foreach -#line 330 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2238 "parser.cpp" - break; - - case 36: // stmt: stmt_switch -#line 331 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2244 "parser.cpp" - break; - - case 37: // stmt: stmt_case -#line 332 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2250 "parser.cpp" - break; - - case 38: // stmt: stmt_default -#line 333 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2256 "parser.cpp" - break; - - case 39: // stmt: stmt_break -#line 334 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2262 "parser.cpp" - break; - - case 40: // stmt: stmt_continue -#line 335 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2268 "parser.cpp" - break; - - case 41: // stmt: stmt_return -#line 336 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2274 "parser.cpp" - break; - - case 42: // stmt: stmt_breakpoint -#line 337 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } -#line 2280 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_begin -#line 338 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2286 "parser.cpp" - break; - - case 44: // stmt: stmt_prof_end -#line 339 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2292 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt -#line 343 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2298 "parser.cpp" - break; - - case 46: // stmt_or_dev: stmt_dev -#line 344 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2304 "parser.cpp" - break; - - case 47: // stmt_list: stmt_list stmt -#line 349 "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 2310 "parser.cpp" - break; - - case 48: // stmt_list: stmt -#line 351 "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 2316 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 356 "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 2322 "parser.cpp" - break; - - case 50: // stmt_or_dev_list: stmt_or_dev -#line 358 "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 2328 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" stmt_list "#/" -#line 362 "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 2334 "parser.cpp" - break; - - case 52: // stmt_dev: "/#" "#/" -#line 363 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2340 "parser.cpp" - break; - - case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 367 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2346 "parser.cpp" - break; - - case 54: // stmt_block: "{" "}" -#line 368 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2352 "parser.cpp" - break; - - case 55: // stmt_expr: expr_assign -#line 373 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2358 "parser.cpp" - break; - - case 56: // stmt_expr: expr_increment -#line 375 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2364 "parser.cpp" - break; - - case 57: // stmt_expr: expr_decrement -#line 377 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2370 "parser.cpp" - break; - - case 58: // stmt_expr: %empty -#line 379 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2376 "parser.cpp" - break; - - case 59: // stmt_call: expr_call ";" -#line 384 "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 2382 "parser.cpp" - break; - - case 60: // stmt_call: expr_method ";" -#line 386 "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 2388 "parser.cpp" - break; - - case 61: // stmt_assign: expr_assign ";" -#line 391 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2394 "parser.cpp" - break; - - case 62: // stmt_assign: expr_increment ";" -#line 393 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2400 "parser.cpp" - break; - - case 63: // stmt_assign: expr_decrement ";" -#line 395 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2406 "parser.cpp" - break; - - case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 400 "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 2412 "parser.cpp" - break; - - case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 405 "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 2418 "parser.cpp" - break; - - case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 407 "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 2424 "parser.cpp" - break; - - case 67: // stmt_wait: "wait" expr ";" -#line 412 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2430 "parser.cpp" - break; - - case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 417 "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 2436 "parser.cpp" - break; - - case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 419 "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 2442 "parser.cpp" - break; - - case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 424 "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 2448 "parser.cpp" - break; - - case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 426 "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 2454 "parser.cpp" - break; - - case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 431 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2460 "parser.cpp" - break; - - case 73: // stmt_waitframe: "waitframe" ";" -#line 436 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2466 "parser.cpp" - break; - - case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 438 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2472 "parser.cpp" - break; - - case 75: // stmt_if: "if" "(" expr ")" stmt -#line 443 "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 2478 "parser.cpp" - break; - - case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 448 "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 2484 "parser.cpp" - break; - - case 77: // stmt_while: "while" "(" expr ")" stmt -#line 453 "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 2490 "parser.cpp" - break; - - case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 458 "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 2496 "parser.cpp" - break; - - case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 463 "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 2502 "parser.cpp" - break; - - case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 468 "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 2508 "parser.cpp" - break; - - case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 470 "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 2514 "parser.cpp" - break; - - case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 475 "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 2520 "parser.cpp" - break; - - case 83: // stmt_case: "case" expr_integer ":" -#line 480 "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 2526 "parser.cpp" - break; - - case 84: // stmt_case: "case" expr_string ":" -#line 482 "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 2532 "parser.cpp" - break; - - case 85: // stmt_default: "default" ":" -#line 487 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2538 "parser.cpp" - break; - - case 86: // stmt_break: "break" ";" -#line 492 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2544 "parser.cpp" - break; - - case 87: // stmt_continue: "continue" ";" -#line 497 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2550 "parser.cpp" - break; - - case 88: // stmt_return: "return" expr ";" -#line 502 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2556 "parser.cpp" - break; - - case 89: // stmt_return: "return" ";" -#line 504 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2562 "parser.cpp" - break; - - case 90: // stmt_breakpoint: "breakpoint" ";" -#line 509 "parser.ypp" - { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } -#line 2568 "parser.cpp" - break; - - case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 514 "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 2574 "parser.cpp" - break; - - case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 519 "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 2580 "parser.cpp" - break; - - case 93: // expr: expr_ternary -#line 523 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2586 "parser.cpp" - break; - - case 94: // expr: expr_binary -#line 524 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2592 "parser.cpp" - break; - - case 95: // expr: expr_primitive -#line 525 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2598 "parser.cpp" - break; - - case 96: // expr_or_empty: expr -#line 529 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2604 "parser.cpp" - break; - - case 97: // expr_or_empty: %empty -#line 530 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2610 "parser.cpp" - break; - - case 98: // expr_assign: expr_tuple "=" expr -#line 535 "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 2616 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "=" expr -#line 537 "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 2622 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "|=" expr -#line 539 "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 2628 "parser.cpp" - break; - - case 101: // expr_assign: expr_object "&=" expr -#line 541 "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 2634 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "^=" expr -#line 543 "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 2640 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "<<=" expr -#line 545 "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 2646 "parser.cpp" - break; - - case 104: // expr_assign: expr_object ">>=" expr -#line 547 "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 2652 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "+=" expr -#line 549 "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 2658 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "-=" expr -#line 551 "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 2664 "parser.cpp" - break; - - case 107: // expr_assign: expr_object "*=" expr -#line 553 "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 2670 "parser.cpp" - break; - - case 108: // expr_assign: expr_object "/=" expr -#line 555 "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 2676 "parser.cpp" - break; - - case 109: // expr_assign: expr_object "%=" expr -#line 557 "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 2682 "parser.cpp" - break; - - case 110: // expr_increment: "++" expr_object -#line 562 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2688 "parser.cpp" - break; - - case 111: // expr_increment: expr_object "++" -#line 564 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2694 "parser.cpp" - break; - - case 112: // expr_decrement: "--" expr_object -#line 569 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2700 "parser.cpp" - break; - - case 113: // expr_decrement: expr_object "--" -#line 571 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2706 "parser.cpp" - break; - - case 114: // expr_ternary: expr "?" expr ":" expr -#line 576 "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 2712 "parser.cpp" - break; - - case 115: // expr_binary: expr "||" expr -#line 581 "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 2718 "parser.cpp" - break; - - case 116: // expr_binary: expr "&&" expr -#line 583 "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 2724 "parser.cpp" - break; - - case 117: // expr_binary: expr "==" expr -#line 585 "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 2730 "parser.cpp" - break; - - case 118: // expr_binary: expr "!=" expr -#line 587 "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 2736 "parser.cpp" - break; - - case 119: // expr_binary: expr "<=" expr -#line 589 "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 2742 "parser.cpp" - break; - - case 120: // expr_binary: expr ">=" expr -#line 591 "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 2748 "parser.cpp" - break; - - case 121: // expr_binary: expr "<" expr -#line 593 "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 2754 "parser.cpp" - break; - - case 122: // expr_binary: expr ">" expr -#line 595 "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 2760 "parser.cpp" - break; - - case 123: // expr_binary: expr "|" expr -#line 597 "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 2766 "parser.cpp" - break; - - case 124: // expr_binary: expr "&" expr -#line 599 "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 2772 "parser.cpp" - break; - - case 125: // expr_binary: expr "^" expr -#line 601 "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 2778 "parser.cpp" - break; - - case 126: // expr_binary: expr "<<" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2784 "parser.cpp" - break; - - case 127: // expr_binary: expr ">>" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2790 "parser.cpp" - break; - - case 128: // expr_binary: expr "+" expr -#line 607 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2796 "parser.cpp" - break; - - case 129: // expr_binary: expr "-" expr -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2802 "parser.cpp" - break; - - case 130: // expr_binary: expr "*" expr -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2808 "parser.cpp" - break; - - case 131: // expr_binary: expr "/" expr -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2814 "parser.cpp" - break; - - case 132: // expr_binary: expr "%" expr -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2820 "parser.cpp" - break; - - case 133: // expr_primitive: expr_complement -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 2826 "parser.cpp" - break; - - case 134: // expr_primitive: expr_negate -#line 620 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 2832 "parser.cpp" - break; - - case 135: // expr_primitive: expr_not -#line 621 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 2838 "parser.cpp" - break; - - case 136: // expr_primitive: expr_call -#line 622 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 2844 "parser.cpp" - break; - - case 137: // expr_primitive: expr_method -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 2850 "parser.cpp" - break; - - case 138: // expr_primitive: expr_add_array -#line 624 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } -#line 2856 "parser.cpp" - break; - - case 139: // expr_primitive: expr_reference -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 2862 "parser.cpp" - break; - - case 140: // expr_primitive: expr_array -#line 626 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 2868 "parser.cpp" - break; - - case 141: // expr_primitive: expr_field -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 2874 "parser.cpp" - break; - - case 142: // expr_primitive: expr_size -#line 628 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 2880 "parser.cpp" - break; - - case 143: // expr_primitive: expr_paren -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 2886 "parser.cpp" - break; - - case 144: // expr_primitive: expr_thisthread -#line 630 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } -#line 2892 "parser.cpp" - break; - - case 145: // expr_primitive: expr_empty_array -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 2898 "parser.cpp" - break; - - case 146: // expr_primitive: expr_undefined -#line 632 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 2904 "parser.cpp" - break; - - case 147: // expr_primitive: expr_game -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 2910 "parser.cpp" - break; - - case 148: // expr_primitive: expr_self -#line 634 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 2916 "parser.cpp" - break; - - case 149: // expr_primitive: expr_anim -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 2922 "parser.cpp" - break; - - case 150: // expr_primitive: expr_level -#line 636 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 2928 "parser.cpp" - break; - - case 151: // expr_primitive: expr_animation -#line 637 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 2934 "parser.cpp" - break; - - case 152: // expr_primitive: expr_animtree -#line 638 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 2940 "parser.cpp" - break; - - case 153: // expr_primitive: expr_identifier -#line 639 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 2946 "parser.cpp" - break; - - case 154: // expr_primitive: expr_istring -#line 640 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 2952 "parser.cpp" - break; - - case 155: // expr_primitive: expr_string -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 2958 "parser.cpp" - break; - - case 156: // expr_primitive: expr_vector -#line 642 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 2964 "parser.cpp" - break; - - case 157: // expr_primitive: expr_float -#line 643 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 2970 "parser.cpp" - break; - - case 158: // expr_primitive: expr_integer -#line 644 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 2976 "parser.cpp" - break; - - case 159: // expr_primitive: expr_false -#line 645 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 2982 "parser.cpp" - break; - - case 160: // expr_primitive: expr_true -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 2988 "parser.cpp" - break; - - case 161: // expr_complement: "~" expr -#line 651 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2994 "parser.cpp" - break; - - case 162: // expr_negate: "-" expr_identifier -#line 656 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 3000 "parser.cpp" - break; - - case 163: // expr_negate: "-" expr_paren -#line 658 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 3006 "parser.cpp" - break; - - case 164: // expr_negate: "-" expr_array -#line 660 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 3012 "parser.cpp" - break; - - case 165: // expr_negate: "-" expr_field -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 3018 "parser.cpp" - break; - - case 166: // expr_not: "!" expr -#line 667 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3024 "parser.cpp" - break; - - case 167: // expr_call: expr_function -#line 671 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3030 "parser.cpp" - break; - - case 168: // expr_call: expr_pointer -#line 672 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3036 "parser.cpp" - break; - - case 169: // expr_method: expr_object expr_function -#line 675 "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 3042 "parser.cpp" - break; - - case 170: // expr_method: expr_object expr_pointer -#line 676 "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 3048 "parser.cpp" - break; - - case 171: // expr_function: expr_identifier "(" expr_arguments ")" -#line 681 "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 3054 "parser.cpp" - break; - - case 172: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 683 "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 3060 "parser.cpp" - break; - - case 173: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 685 "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 3066 "parser.cpp" - break; - - case 174: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 687 "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 3072 "parser.cpp" - break; - - case 175: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 689 "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::childthread); } -#line 3078 "parser.cpp" - break; - - case 176: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 691 "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::childthread); } -#line 3084 "parser.cpp" - break; - - case 177: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 696 "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 3090 "parser.cpp" - break; - - case 178: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 698 "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 3096 "parser.cpp" - break; - - case 179: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 700 "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::childthread); } -#line 3102 "parser.cpp" - break; - - case 180: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 702 "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::builtin); } -#line 3108 "parser.cpp" - break; - - case 181: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 707 "parser.ypp" - { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } -#line 3114 "parser.cpp" - break; - - case 182: // expr_parameters: expr_parameters "," expr_identifier -#line 712 "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 3120 "parser.cpp" - break; - - case 183: // expr_parameters: expr_identifier -#line 714 "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 3126 "parser.cpp" - break; - - case 184: // expr_parameters: %empty -#line 716 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3132 "parser.cpp" - break; - - case 185: // expr_arguments: expr_arguments_no_empty -#line 721 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3138 "parser.cpp" - break; - - case 186: // expr_arguments: %empty -#line 723 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3144 "parser.cpp" - break; - - case 187: // expr_arguments_no_empty: expr_arguments "," expr -#line 728 "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 3150 "parser.cpp" - break; - - case 188: // expr_arguments_no_empty: expr -#line 730 "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 3156 "parser.cpp" - break; - - case 189: // expr_reference: "::" expr_identifier -#line 735 "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 3162 "parser.cpp" - break; - - case 190: // expr_reference: expr_path "::" expr_identifier -#line 737 "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 3168 "parser.cpp" - break; - - case 191: // expr_tuple: "[" expr_tuple_arguments "]" -#line 742 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[1].value.as < ast::expr_tuple::ptr > ()); } -#line 3174 "parser.cpp" - break; - - case 192: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types -#line 747 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::move(yystack_[2].value.as < ast::expr_tuple::ptr > ()); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3180 "parser.cpp" - break; - - case 193: // expr_tuple_arguments: expr_tuple_types -#line 749 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3186 "parser.cpp" - break; - - case 194: // expr_tuple_types: expr_array -#line 753 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3192 "parser.cpp" - break; - - case 195: // expr_tuple_types: expr_field -#line 754 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3198 "parser.cpp" - break; - - case 196: // expr_tuple_types: expr_identifier -#line 755 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3204 "parser.cpp" - break; - - case 197: // expr_array: expr_object "[" expr "]" -#line 760 "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 3210 "parser.cpp" - break; - - case 198: // expr_field: expr_object "." expr_identifier_nosize -#line 765 "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 3216 "parser.cpp" - break; - - case 199: // expr_size: expr_object "." "size" -#line 770 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3222 "parser.cpp" - break; - - case 200: // expr_paren: "(" expr ")" -#line 775 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3228 "parser.cpp" - break; - - case 201: // expr_object: expr_call -#line 779 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3234 "parser.cpp" - break; - - case 202: // expr_object: expr_method -#line 780 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3240 "parser.cpp" - break; - - case 203: // expr_object: expr_array -#line 781 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3246 "parser.cpp" - break; - - case 204: // expr_object: expr_field -#line 782 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3252 "parser.cpp" - break; - - case 205: // expr_object: expr_game -#line 783 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3258 "parser.cpp" - break; - - case 206: // expr_object: expr_self -#line 784 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3264 "parser.cpp" - break; - - case 207: // expr_object: expr_anim -#line 785 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3270 "parser.cpp" - break; - - case 208: // expr_object: expr_level -#line 786 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3276 "parser.cpp" - break; - - case 209: // expr_object: expr_identifier -#line 787 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3282 "parser.cpp" - break; - - case 210: // expr_thisthread: "thisthread" -#line 792 "parser.ypp" - { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } -#line 3288 "parser.cpp" - break; - - case 211: // expr_empty_array: "[" "]" -#line 797 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3294 "parser.cpp" - break; - - case 212: // expr_undefined: "undefined" -#line 802 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3300 "parser.cpp" - break; - - case 213: // expr_game: "game" -#line 807 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3306 "parser.cpp" - break; - - case 214: // expr_self: "self" -#line 812 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3312 "parser.cpp" - break; - - case 215: // expr_anim: "anim" -#line 817 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3318 "parser.cpp" - break; - - case 216: // expr_level: "level" -#line 822 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3324 "parser.cpp" - break; - - case 217: // expr_animation: "%" "identifier" -#line 827 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3330 "parser.cpp" - break; - - case 218: // expr_animtree: "#animtree" -#line 832 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3336 "parser.cpp" - break; - - case 219: // expr_identifier_nosize: "identifier" -#line 837 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3342 "parser.cpp" - break; - - case 220: // expr_identifier: "identifier" -#line 842 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3348 "parser.cpp" - break; - - case 221: // expr_identifier: "size" -#line 844 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3354 "parser.cpp" - break; - - case 222: // expr_path: "identifier" -#line 849 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3360 "parser.cpp" - break; - - case 223: // expr_path: "path" -#line 851 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3366 "parser.cpp" - break; - - case 224: // expr_istring: "localized string" -#line 856 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3372 "parser.cpp" - break; - - case 225: // expr_string: "string literal" -#line 861 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3378 "parser.cpp" - break; - - case 226: // expr_vector: "(" expr "," expr "," expr ")" -#line 866 "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 3384 "parser.cpp" - break; - - case 227: // expr_float: "-" "float" -#line 871 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3390 "parser.cpp" - break; - - case 228: // expr_float: "float" -#line 873 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3396 "parser.cpp" - break; - - case 229: // expr_integer: "-" "integer" -#line 878 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3402 "parser.cpp" - break; - - case 230: // expr_integer: "integer" -#line 880 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3408 "parser.cpp" - break; - - case 231: // expr_false: "false" -#line 885 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3414 "parser.cpp" - break; - - case 232: // expr_true: "true" -#line 890 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3420 "parser.cpp" - break; - - -#line 3424 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "endon", "notify", "wait", - "waittill", "waittillmatch", "waittillframeend", "waitframe", "if", - "else", "do", "while", "for", "foreach", "in", "switch", "case", - "default", "break", "continue", "return", "breakpoint", "prof_begin", - "prof_end", "thread", "childthread", "thisthread", "call", "true", - "false", "undefined", "size", "game", "self", "anim", "level", "(", ")", - "{", "}", "[", "]", ",", ".", "::", ":", ";", "?", "++", "--", "<<", - ">>", "||", "&&", "==", "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", - "-=", "*=", "/=", "%=", "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", - "+", "-", "*", "/", "%", "path", "identifier", "string literal", - "localized string", "float", "integer", "SIZEOF", "ADD_ARRAY", "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_waitframe", "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_negate", - "expr_not", "expr_call", "expr_method", "expr_function", "expr_pointer", - "expr_add_array", "expr_parameters", "expr_arguments", - "expr_arguments_no_empty", "expr_reference", "expr_tuple", - "expr_tuple_arguments", "expr_tuple_types", "expr_array", "expr_field", - "expr_size", "expr_paren", "expr_object", "expr_thisthread", - "expr_empty_array", "expr_undefined", "expr_game", "expr_self", - "expr_anim", "expr_level", "expr_animation", "expr_animtree", - "expr_identifier_nosize", "expr_identifier", "expr_path", "expr_istring", - "expr_string", "expr_vector", "expr_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 S1DEBUG - // 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 S1DEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if S1DEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -287; - - const short parser::yytable_ninf_ = -223; - - const short - parser::yypact_[] = - { - 6, -287, -287, 5, 5, -24, -287, -287, 37, 6, - -287, -287, -287, -287, -287, -287, -8, -287, -287, -13, - -10, -54, -287, -287, -287, -287, -23, 1223, -287, -287, - -287, 11, -12, -287, -287, -42, 3, -287, 17, -287, - -287, -287, -287, -287, -287, -287, 1223, 821, -23, 1223, - 1223, -18, -36, 26, -287, -287, -287, 2187, -287, -287, - -287, -287, -287, -287, 413, 667, -287, -287, -287, -287, - 699, 729, -287, -287, 1012, -287, -287, -287, 1089, 1187, - 1247, 1317, -287, -287, 574, 39, -287, -287, -287, -287, - -287, -287, -287, 15, 96, -23, 49, 75, 81, 114, - 100, 124, 129, 1439, 821, -287, 2270, 134, 136, -287, - -287, -287, 1223, 142, -287, -287, -287, -287, 699, 729, - -287, 1406, -287, -287, -287, -287, 574, 140, -287, -287, - 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, - 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1286, - -20, -287, -287, 152, 1223, -23, -287, 928, -287, -287, - 1223, 1223, -23, 1223, 1223, -23, 1223, -287, 1223, 1917, - 1223, -287, 1605, 1223, 107, -23, 2152, 179, 179, 2301, - 2311, 2383, 2383, 30, 30, 30, 30, 2342, 728, 2352, - 73, 73, -287, -287, -287, 1957, -287, -287, -287, 35, - -287, 154, 1057, 1223, 146, -5, 161, 1370, 165, 166, - 167, 168, -17, 163, 169, 172, 1160, 183, 173, 175, - -287, 139, 548, 548, -287, -287, 980, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, 184, 185, 188, 191, 192, 177, -287, - -287, 51, 152, 1997, 53, 205, 2037, 56, 206, 2077, - 2116, 203, 2270, 1917, 154, 1223, -287, -287, 1223, -287, - -287, 1134, 2222, -287, 209, -287, 1223, 236, 1223, 639, - -23, 1223, 164, 208, 215, -287, -287, -287, -287, 2257, - -287, 1223, 1223, 1286, 32, -287, 62, 86, 8, 1406, - 1406, -287, -287, -287, -287, -287, -287, -287, 1223, 225, - 227, 228, 230, -287, -287, 1223, 1223, 1223, 1223, 1223, - 1223, 1223, 1223, 1223, 1223, 1223, 210, -287, 1223, 226, - -287, 1223, 229, 1223, 232, 2270, 59, -287, -287, -287, - 223, 1639, 235, 1673, 233, -287, -287, -287, 1396, 9, - 1707, -287, -287, -287, 60, 87, -287, 548, 2270, 1223, - 1223, 1223, 1223, 2270, 2270, 2270, 2270, 2270, 2270, 2270, - 2270, 2270, 2270, 2270, 240, 89, 242, 101, 245, 1741, - 1223, -287, -287, 1370, 1223, 1370, 1223, 1223, -23, 96, - 237, 241, -287, 1775, 1483, 1527, 1571, 1223, -287, 1223, - -287, 1223, -287, 103, 273, 1809, -287, 2270, 243, 1843, - 272, -287, -287, -287, 246, 249, 1223, 250, 1223, 251, - 1223, 113, 123, 125, -287, 1370, 252, 639, 1370, 1223, - -287, -287, 254, -287, 262, -287, 286, -287, -287, -287, - -287, -287, 287, -287, 1877, 279, 280, 281, 1370, 1370, - -287, -287, -287, -287, -287 - }; - - const unsigned char - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 221, 220, 0, 2, - 7, 8, 9, 14, 15, 16, 0, 223, 222, 0, - 0, 0, 1, 4, 5, 6, 184, 0, 10, 11, - 225, 0, 0, 183, 218, 0, 0, 210, 0, 232, - 231, 212, 213, 214, 215, 216, 0, 186, 0, 0, - 0, 0, 0, 220, 224, 228, 230, 0, 93, 94, - 95, 133, 134, 135, 136, 137, 167, 168, 138, 139, - 140, 141, 142, 143, 0, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 0, 154, 155, 156, 157, - 158, 159, 160, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 186, 211, 188, 0, 185, 189, - 166, 161, 0, 0, 227, 229, 201, 202, 164, 165, - 163, 0, 205, 206, 207, 208, 162, 0, 217, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 169, 170, 0, 186, 0, 17, 0, 19, 182, - 0, 186, 0, 0, 186, 0, 0, 200, 0, 188, - 0, 181, 0, 0, 0, 0, 0, 126, 127, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 128, 129, 130, 131, 132, 0, 199, 219, 198, 0, - 185, 190, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 54, 0, 0, 0, 45, 50, 0, 46, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 0, 0, 0, 201, 202, 0, 203, - 204, 0, 209, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 187, 0, 0, 0, 197, 171, 186, 52, - 48, 0, 0, 72, 0, 73, 0, 0, 0, 58, - 0, 0, 0, 0, 0, 85, 86, 87, 89, 0, - 90, 186, 186, 0, 0, 193, 203, 204, 209, 110, - 112, 53, 49, 61, 62, 63, 59, 60, 0, 0, - 0, 0, 0, 111, 113, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 173, 186, 0, - 175, 186, 0, 0, 0, 114, 0, 51, 47, 67, - 0, 0, 0, 0, 0, 55, 56, 57, 0, 0, - 0, 84, 83, 88, 0, 0, 191, 0, 98, 0, - 0, 0, 0, 99, 105, 106, 107, 108, 109, 100, - 101, 102, 104, 103, 0, 0, 0, 0, 0, 0, - 186, 172, 74, 0, 0, 0, 97, 0, 0, 0, - 0, 0, 192, 0, 0, 0, 0, 186, 174, 186, - 176, 186, 226, 0, 75, 0, 77, 96, 0, 0, - 0, 82, 91, 92, 0, 0, 186, 0, 186, 0, - 186, 0, 0, 0, 177, 0, 0, 58, 0, 0, - 64, 66, 185, 69, 185, 71, 185, 178, 179, 180, - 76, 78, 0, 80, 0, 0, 0, 0, 0, 0, - 65, 68, 70, 79, 81 - }; - - const short - parser::yypgoto_[] = - { - -287, -287, -287, 295, 336, 338, -287, -287, -287, -194, - 122, -287, -287, -287, -93, -87, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - 189, -287, -286, -277, -274, -287, -287, -287, -287, -287, - -287, -49, -11, -67, -58, -287, -287, 95, -43, -287, - -287, -287, -16, 197, 324, -287, 302, 355, -287, -287, - -287, 380, 417, 452, 490, -287, -287, -287, 0, 7, - -287, -15, -287, -287, 148, -287, -287 - }; - - const short - parser::yydefgoto_[] = - { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 224, - 225, 281, 226, 227, 228, 354, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 106, 418, 253, 254, 255, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 32, 107, 200, 69, - 258, 304, 305, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 198, 84, 85, - 86, 87, 88, 89, 90, 91, 92 - }; - - const short - parser::yytable_[] = - { - 16, 158, 116, 355, 108, 6, 31, 151, 280, 16, - 19, 20, 356, 287, 96, 357, 152, 1, 2, 3, - 4, 5, 35, 36, 6, 38, 33, 196, 21, 6, - 42, 43, 44, 45, 112, 97, 100, 22, 113, 397, - 117, 94, 98, 101, 26, 30, 95, 284, 109, 28, - 6, 126, 29, 6, 151, 17, 53, 285, 127, 99, - 154, 108, 128, 152, 93, -196, -196, 398, 319, 320, - 27, 321, 322, 102, 153, 7, 292, 156, 197, 17, - 53, 127, 30, 114, 115, 56, -222, 348, 277, 366, - 367, 35, 36, 170, 38, 159, 131, 132, 6, 155, - 17, 53, 17, 18, 7, 160, 337, 149, 256, 340, - 174, 170, 391, 400, 170, 323, 324, 170, 170, -194, - -194, 153, 144, 145, 146, 147, 148, 161, 127, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 401, 162, 408, -195, -195, 170, 257, 170, 17, 53, - 157, 355, 164, 256, 410, 201, 434, 262, 256, 170, - 356, 170, 265, 357, 127, 268, 447, 146, 147, 148, - 163, 170, 116, 116, 116, 274, 448, 256, 449, 35, - 36, 170, 38, 170, 165, 166, 6, 42, 43, 44, - 45, 257, 170, 171, 151, 303, 257, 293, 173, 414, - 175, 416, 262, 152, 154, 197, 278, 262, 283, 127, - 117, 117, 117, 286, 127, 257, 57, 288, 289, 290, - 291, 308, 262, 262, 295, 301, 262, 302, 127, 127, - 127, 296, 256, 127, 297, 103, 17, 53, 110, 111, - 116, 450, 151, 151, 453, 300, 313, 314, 118, 199, - 315, 152, 152, 316, 317, 318, 264, 338, 341, 267, - 344, 153, 350, 352, 463, 464, 115, 384, 127, 361, - 257, 144, 145, 146, 147, 148, 362, 369, 117, 370, - 371, 262, 372, 386, 390, 392, 388, 394, 127, 262, - 359, 151, 407, 169, 409, 396, 127, 411, 435, 422, - 152, 172, 439, 423, 23, 437, 421, 455, 440, 153, - 153, 441, 443, 445, 451, 456, 127, 127, 116, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 457, - 458, 460, 461, 462, 256, 24, 256, 25, 312, 263, - 452, 402, 266, 120, 259, 269, 117, 270, 153, 272, - 294, 0, 273, 0, 0, 127, 0, 308, 0, 0, - 0, 0, 0, 346, 127, 119, 0, 0, 0, 0, - 0, 0, 257, 442, 257, 444, 256, 446, 116, 256, - 0, 0, 282, 262, 0, 262, 364, 365, 420, 259, - 127, 0, 127, 0, 259, 299, 121, 0, 0, 256, - 256, 0, 0, 0, 0, 0, 0, 0, 306, 259, - 259, 0, 0, 259, 257, 0, 117, 257, 0, 0, - 0, 122, 0, 385, 0, 262, 387, 262, 262, 0, - 0, 0, 127, 0, 127, 127, 0, 257, 257, 0, - 0, 0, 0, -201, -201, 0, -201, 0, 262, 262, - -201, 0, 0, 0, 345, 127, 127, 0, 123, -201, - 0, 0, -201, 0, 0, 351, 0, 353, 259, 0, - 360, 260, 0, 0, 0, 413, 259, 0, 0, 0, - 0, 0, 273, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 431, 124, 432, 0, 433, 368, 0, 0, - -201, -201, 261, 0, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 260, 0, 0, 0, - 0, 260, 389, 0, 0, 0, 0, 122, 0, 0, - 0, 125, 0, 0, 0, 307, 260, 260, 0, 0, - 260, 0, 0, 0, 0, 0, 0, 261, 403, 404, - 405, 406, 261, 0, 306, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 123, 0, 121, 309, 310, 0, - 0, 261, 122, 415, 0, 417, 419, 122, 35, 36, - 259, 38, 259, 0, 0, 6, 42, 43, 44, 45, - 0, 122, 122, 122, 113, 260, 122, 0, 0, 124, - 0, 0, 0, 260, -209, -209, 0, -209, 0, 123, - 0, -209, 0, 0, 123, 0, 154, 0, 454, 0, - -209, 0, 259, -209, 259, 259, 261, 0, 123, 123, - 123, 0, 0, 123, 358, 17, 53, 125, 0, 0, - 0, 0, 0, 0, 124, 259, 259, 0, 0, 124, - 0, 122, 0, 0, 0, 0, 0, 0, 0, 122, - 0, -209, -209, 124, 124, 124, 0, 0, 124, 35, - 36, 0, 38, 0, 0, 0, 6, 42, 43, 44, - 45, 307, 125, 0, 0, 221, 0, 125, 123, 0, - 0, 0, 0, 222, 223, 0, 123, -202, -202, 0, - -202, 125, 125, 125, -202, 0, 125, 260, 0, 260, - 0, 0, 121, -202, 0, 0, -202, 0, 0, 0, - 0, 0, 0, 124, 0, 0, 17, 53, 0, -203, - -203, 124, -203, 0, 0, 0, -203, 122, 261, 0, - 261, 0, 0, 0, 0, -203, 0, 0, -203, 260, - 0, 260, 260, 0, -202, -202, 0, 0, 0, -204, - -204, 125, -204, 122, 0, 122, -204, 0, 0, 125, - 0, 0, 260, 260, 123, -204, 0, 0, -204, 0, - 261, 0, 358, 261, 131, 132, -203, -203, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 123, 0, 123, 261, 261, 122, 0, 122, 122, 124, - 144, 145, 146, 147, 148, 0, -204, -204, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 34, 122, 122, - 0, 0, 0, 0, 0, 124, 0, 124, 0, 0, - 0, 0, 123, 0, 123, 123, 0, 125, 0, 0, - 0, 35, 36, 37, 38, 39, 40, 41, 6, 42, - 43, 44, 45, 46, 0, 123, 123, 104, 105, 0, - 0, 48, 0, 125, 0, 125, 0, 124, 0, 124, - 124, 0, 0, 0, 0, 0, 0, 49, 50, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 124, 124, 0, 0, 51, 0, 0, 52, 17, 53, - 30, 54, 55, 56, 0, 125, 0, 125, 125, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, - 0, 0, 0, 0, 0, 0, 0, 203, 125, 125, - 204, 205, 206, 0, 207, 208, 209, 210, 0, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 35, 36, - 0, 38, 0, 0, 0, 6, 42, 43, 44, 45, - 0, 0, 157, 220, 221, 0, 0, 0, 0, 0, - 0, 202, 222, 223, 0, 0, 0, 0, 0, 203, - 0, 0, 204, 205, 206, 0, 207, 208, 209, 210, - 0, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 35, 36, 0, 38, 0, 17, 53, 6, 42, 43, - 44, 45, 0, 0, 157, 311, 221, 0, 0, 0, - 0, 0, 0, 0, 222, 223, 0, 0, 0, 0, - 0, 0, 35, 36, 0, 38, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 149, 279, - 0, 150, 0, 0, 0, 0, 203, 17, 53, 204, - 205, 206, 0, 207, 208, 209, 210, 0, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 35, 36, 0, - 38, 0, 0, 0, 6, 42, 43, 44, 45, 17, - 53, 157, 0, 221, 0, 0, 0, 0, 0, 0, - 0, 222, 223, 0, 0, 0, 0, 0, 0, -205, - -205, 0, -205, 0, 0, 0, -205, 0, 0, 0, - 0, 0, 0, 0, 0, -205, 347, 0, -205, 0, - 0, 0, 0, 203, 17, 53, 204, 205, 206, 0, - 207, 208, 209, 210, 0, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 35, 36, 34, 38, 0, 0, - 0, 6, 42, 43, 44, 45, -205, -205, 157, 0, - 221, 0, 0, 0, 0, 0, 0, 0, 222, 223, - 35, 36, 37, 38, 39, 40, 41, 6, 42, 43, - 44, 45, 46, 0, 0, 0, 47, 0, 0, 0, - 48, 0, 298, 0, 0, 0, 0, -206, -206, 0, - -206, 17, 53, 0, -206, 0, 49, 50, 0, 34, - 0, 0, 0, -206, 0, 0, -206, 0, 0, 0, - 0, 0, 0, 51, 0, 0, 52, 17, 53, 30, - 54, 55, 56, 35, 36, 37, 38, 39, 40, 41, - 6, 42, 43, 44, 45, 46, 0, 0, 0, 47, - 0, 0, 0, 48, -206, -206, 0, -207, -207, 0, - -207, 0, 0, 0, -207, 0, 0, 0, 0, 49, - 50, 0, 34, -207, 0, 0, -207, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 51, 0, 0, 52, - 17, 53, 30, 54, 55, 56, 35, 36, 37, 38, - 39, 40, 41, 6, 42, 43, 44, 45, 46, 0, - 0, 0, 104, 0, -207, -207, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -208, -208, 0, - -208, 0, 49, 50, -208, 0, 0, 0, 0, 0, - 0, 0, 0, -208, 0, 0, -208, 0, 0, 51, - 0, 0, 52, 17, 53, 30, 54, 55, 56, 203, - 0, 0, 204, 205, 206, 0, 207, 208, 209, 210, - 0, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 35, 36, 0, 38, -208, -208, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 0, 221, 0, 0, 0, - 0, 0, 0, 0, 222, 223, 35, 36, 0, 38, - 0, 0, 0, 6, 0, 0, 35, 36, 0, 38, - 0, 0, 149, 6, 0, 174, 0, 0, 0, 0, - 323, 324, 149, 0, 0, 174, 0, 17, 53, 0, - 0, 0, 0, 0, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 0, 0, 0, 0, 0, - 0, 0, 167, 17, 53, 0, 0, 168, 0, 0, - 0, 0, 130, 17, 53, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 425, 0, 0, 0, - 0, 426, 0, 0, 0, 0, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 427, 0, 0, 0, 0, 428, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 429, 0, 0, 0, 0, 430, - 0, 0, 0, 0, 130, 0, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 167, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 393, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 395, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 399, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 412, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 130, 0, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 424, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 436, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 438, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 459, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 271, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 276, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 336, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 339, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 342, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 343, 0, 0, 0, 0, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 275, 0, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 129, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 349, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 363, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 131, 132, 0, - 134, 135, 136, 137, 138, 139, 140, 131, 132, 0, - 0, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 0, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 131, 132, - 0, 0, 135, 136, 137, 138, 139, 140, 131, 132, - 0, 0, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 142, 143, 144, 145, 146, 147, 148, 0, - 0, 0, 142, 0, 144, 145, 146, 147, 148, 131, - 132, 0, 0, 0, 0, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 144, 145, 146, 147, 148 - }; - - const short - parser::yycheck_[] = - { - 0, 94, 51, 289, 47, 47, 21, 74, 202, 9, - 3, 4, 289, 207, 56, 289, 74, 11, 12, 13, - 14, 15, 40, 41, 47, 43, 26, 47, 52, 47, - 48, 49, 50, 51, 52, 35, 36, 0, 56, 30, - 51, 53, 35, 36, 52, 99, 58, 52, 48, 62, - 47, 51, 62, 47, 121, 97, 98, 62, 51, 56, - 52, 104, 98, 121, 53, 57, 58, 58, 17, 18, - 78, 20, 21, 56, 74, 98, 93, 62, 98, 97, - 98, 74, 99, 101, 102, 102, 60, 281, 53, 57, - 58, 40, 41, 58, 43, 95, 66, 67, 47, 60, - 97, 98, 97, 98, 98, 56, 53, 56, 157, 53, - 59, 58, 53, 53, 58, 64, 65, 58, 58, 57, - 58, 121, 92, 93, 94, 95, 96, 52, 121, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 53, 60, 53, 57, 58, 58, 157, 58, 97, 98, - 54, 437, 52, 202, 53, 155, 53, 157, 207, 58, - 437, 58, 162, 437, 157, 165, 53, 94, 95, 96, - 56, 58, 221, 222, 223, 175, 53, 226, 53, 40, - 41, 58, 43, 58, 60, 56, 47, 48, 49, 50, - 51, 202, 58, 57, 261, 56, 207, 212, 56, 393, - 60, 395, 202, 261, 52, 98, 52, 207, 62, 202, - 221, 222, 223, 52, 207, 226, 27, 52, 52, 52, - 52, 221, 222, 223, 61, 52, 226, 52, 221, 222, - 223, 62, 281, 226, 62, 46, 97, 98, 49, 50, - 289, 435, 309, 310, 438, 62, 62, 62, 51, 154, - 62, 309, 310, 62, 62, 78, 161, 52, 52, 164, - 57, 261, 53, 27, 458, 459, 102, 57, 261, 61, - 281, 92, 93, 94, 95, 96, 61, 52, 289, 52, - 52, 281, 52, 57, 52, 62, 57, 52, 281, 289, - 290, 358, 52, 104, 52, 62, 289, 52, 25, 62, - 358, 112, 30, 62, 9, 62, 399, 53, 62, 309, - 310, 62, 62, 62, 62, 53, 309, 310, 367, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 53, - 53, 62, 62, 62, 393, 9, 395, 9, 226, 160, - 437, 367, 163, 51, 157, 166, 367, 168, 358, 170, - 212, -1, 173, -1, -1, 358, -1, 367, -1, -1, - -1, -1, -1, 278, 367, 51, -1, -1, -1, -1, - -1, -1, 393, 426, 395, 428, 435, 430, 437, 438, - -1, -1, 203, 393, -1, 395, 301, 302, 398, 202, - 393, -1, 395, -1, 207, 216, 51, -1, -1, 458, - 459, -1, -1, -1, -1, -1, -1, -1, 221, 222, - 223, -1, -1, 226, 435, -1, 437, 438, -1, -1, - -1, 51, -1, 338, -1, 435, 341, 437, 438, -1, - -1, -1, 435, -1, 437, 438, -1, 458, 459, -1, - -1, -1, -1, 40, 41, -1, 43, -1, 458, 459, - 47, -1, -1, -1, 275, 458, 459, -1, 51, 56, - -1, -1, 59, -1, -1, 286, -1, 288, 281, -1, - 291, 157, -1, -1, -1, 390, 289, -1, -1, -1, - -1, -1, 303, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 407, 51, 409, -1, 411, 318, -1, -1, - 97, 98, 157, -1, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, -1, 202, -1, -1, -1, - -1, 207, 343, -1, -1, -1, -1, 157, -1, -1, - -1, 51, -1, -1, -1, 221, 222, 223, -1, -1, - 226, -1, -1, -1, -1, -1, -1, 202, 369, 370, - 371, 372, 207, -1, 367, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 157, -1, 221, 222, 223, -1, - -1, 226, 202, 394, -1, 396, 397, 207, 40, 41, - 393, 43, 395, -1, -1, 47, 48, 49, 50, 51, - -1, 221, 222, 223, 56, 281, 226, -1, -1, 157, - -1, -1, -1, 289, 40, 41, -1, 43, -1, 202, - -1, 47, -1, -1, 207, -1, 52, -1, 439, -1, - 56, -1, 435, 59, 437, 438, 281, -1, 221, 222, - 223, -1, -1, 226, 289, 97, 98, 157, -1, -1, - -1, -1, -1, -1, 202, 458, 459, -1, -1, 207, - -1, 281, -1, -1, -1, -1, -1, -1, -1, 289, - -1, 97, 98, 221, 222, 223, -1, -1, 226, 40, - 41, -1, 43, -1, -1, -1, 47, 48, 49, 50, - 51, 367, 202, -1, -1, 56, -1, 207, 281, -1, - -1, -1, -1, 64, 65, -1, 289, 40, 41, -1, - 43, 221, 222, 223, 47, -1, 226, 393, -1, 395, - -1, -1, 367, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, 281, -1, -1, 97, 98, -1, 40, - 41, 289, 43, -1, -1, -1, 47, 367, 393, -1, - 395, -1, -1, -1, -1, 56, -1, -1, 59, 435, - -1, 437, 438, -1, 97, 98, -1, -1, -1, 40, - 41, 281, 43, 393, -1, 395, 47, -1, -1, 289, - -1, -1, 458, 459, 367, 56, -1, -1, 59, -1, - 435, -1, 437, 438, 66, 67, 97, 98, 70, 71, - 72, 73, 74, 75, -1, -1, -1, -1, -1, -1, - 393, -1, 395, 458, 459, 435, -1, 437, 438, 367, - 92, 93, 94, 95, 96, -1, 97, 98, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 16, 458, 459, - -1, -1, -1, -1, -1, 393, -1, 395, -1, -1, - -1, -1, 435, -1, 437, 438, -1, 367, -1, -1, - -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, -1, 458, 459, 56, 57, -1, - -1, 60, -1, 393, -1, 395, -1, 435, -1, 437, - 438, -1, -1, -1, -1, -1, -1, 76, 77, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 458, 459, -1, -1, 93, -1, -1, 96, 97, 98, - 99, 100, 101, 102, -1, 435, -1, 437, 438, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, - -1, -1, -1, -1, -1, -1, -1, 19, 458, 459, - 22, 23, 24, -1, 26, 27, 28, 29, -1, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - -1, 43, -1, -1, -1, 47, 48, 49, 50, 51, - -1, -1, 54, 55, 56, -1, -1, -1, -1, -1, - -1, 11, 64, 65, -1, -1, -1, -1, -1, 19, - -1, -1, 22, 23, 24, -1, 26, 27, 28, 29, - -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, -1, 43, -1, 97, 98, 47, 48, 49, - 50, 51, -1, -1, 54, 55, 56, -1, -1, -1, - -1, -1, -1, -1, 64, 65, -1, -1, -1, -1, - -1, -1, 40, 41, -1, 43, -1, -1, -1, 47, - -1, -1, -1, -1, -1, -1, -1, -1, 56, 12, - -1, 59, -1, -1, -1, -1, 19, 97, 98, 22, - 23, 24, -1, 26, 27, 28, 29, -1, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, -1, - 43, -1, -1, -1, 47, 48, 49, 50, 51, 97, - 98, 54, -1, 56, -1, -1, -1, -1, -1, -1, - -1, 64, 65, -1, -1, -1, -1, -1, -1, 40, - 41, -1, 43, -1, -1, -1, 47, -1, -1, -1, - -1, -1, -1, -1, -1, 56, 12, -1, 59, -1, - -1, -1, -1, 19, 97, 98, 22, 23, 24, -1, - 26, 27, 28, 29, -1, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 16, 43, -1, -1, - -1, 47, 48, 49, 50, 51, 97, 98, 54, -1, - 56, -1, -1, -1, -1, -1, -1, -1, 64, 65, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, -1, -1, -1, 56, -1, -1, -1, - 60, -1, 62, -1, -1, -1, -1, 40, 41, -1, - 43, 97, 98, -1, 47, -1, 76, 77, -1, 16, - -1, -1, -1, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, 93, -1, -1, 96, 97, 98, 99, - 100, 101, 102, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, -1, -1, -1, 56, - -1, -1, -1, 60, 97, 98, -1, 40, 41, -1, - 43, -1, -1, -1, 47, -1, -1, -1, -1, 76, - 77, -1, 16, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 93, -1, -1, 96, - 97, 98, 99, 100, 101, 102, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, - -1, -1, 56, -1, 97, 98, 60, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, - 43, -1, 76, 77, 47, -1, -1, -1, -1, -1, - -1, -1, -1, 56, -1, -1, 59, -1, -1, 93, - -1, -1, 96, 97, 98, 99, 100, 101, 102, 19, - -1, -1, 22, 23, 24, -1, 26, 27, 28, 29, - -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, -1, 43, 97, 98, -1, 47, 48, 49, - 50, 51, -1, -1, 54, -1, 56, -1, -1, -1, - -1, -1, -1, -1, 64, 65, 40, 41, -1, 43, - -1, -1, -1, 47, -1, -1, 40, 41, -1, 43, - -1, -1, 56, 47, -1, 59, -1, -1, -1, -1, - 64, 65, 56, -1, -1, 59, -1, 97, 98, -1, - -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, -1, -1, -1, -1, -1, - -1, -1, 53, 97, 98, -1, -1, 58, -1, -1, - -1, -1, 63, 97, 98, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 53, -1, -1, -1, - -1, 58, -1, -1, -1, -1, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 53, -1, -1, -1, -1, 58, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 53, -1, -1, -1, -1, 58, - -1, -1, -1, -1, 63, -1, -1, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 63, -1, - -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 53, -1, 89, 90, 91, 92, 93, 94, - 95, 96, 63, -1, -1, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 53, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 53, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 53, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 63, -1, -1, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 63, -1, - -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 53, -1, 89, 90, 91, 92, 93, 94, - 95, 96, 63, -1, -1, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 53, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 53, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 58, -1, -1, -1, -1, 63, - -1, -1, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 89, 90, 91, 92, 93, - 94, 95, 96, 61, -1, 63, -1, -1, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 89, 90, 91, 92, 93, 94, 95, 96, 62, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 62, 63, -1, -1, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 89, 90, 91, 92, 93, 94, 95, 96, 62, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 63, -1, -1, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 89, 90, 91, 92, - 93, 94, 95, 96, -1, -1, -1, -1, -1, 89, - 90, 91, 92, 93, 94, 95, 96, 66, 67, -1, - 69, 70, 71, 72, 73, 74, 75, 66, 67, -1, - -1, 70, 71, 72, 73, 74, 75, -1, -1, -1, - 89, 90, 91, 92, 93, 94, 95, 96, -1, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 66, 67, - -1, -1, 70, 71, 72, 73, 74, 75, 66, 67, - -1, -1, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, 90, 91, 92, 93, 94, 95, 96, -1, - -1, -1, 90, -1, 92, 93, 94, 95, 96, 66, - 67, -1, -1, -1, -1, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 92, 93, 94, 95, 96 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 47, 98, 114, 115, - 116, 117, 118, 119, 120, 121, 191, 97, 98, 192, - 192, 52, 0, 116, 117, 118, 52, 78, 62, 62, - 99, 194, 169, 191, 16, 40, 41, 42, 43, 44, - 45, 46, 48, 49, 50, 51, 52, 56, 60, 76, - 77, 93, 96, 98, 100, 101, 102, 153, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 172, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 53, 53, 58, 56, 191, 192, 56, - 191, 192, 56, 153, 56, 57, 153, 170, 171, 191, - 153, 153, 52, 56, 101, 102, 164, 165, 176, 177, - 179, 180, 184, 185, 186, 187, 191, 192, 98, 62, - 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 89, 90, 91, 92, 93, 94, 95, 96, 56, - 59, 166, 167, 191, 52, 60, 62, 54, 127, 191, - 56, 52, 60, 56, 52, 60, 56, 53, 58, 153, - 58, 57, 153, 56, 59, 60, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 47, 98, 190, 170, - 171, 191, 11, 19, 22, 23, 24, 26, 27, 28, - 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 55, 56, 64, 65, 122, 123, 125, 126, 127, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 155, 156, 157, 164, 165, 173, 176, - 177, 180, 191, 153, 170, 191, 153, 170, 191, 153, - 153, 57, 153, 153, 191, 61, 57, 53, 52, 12, - 122, 124, 153, 62, 52, 62, 52, 122, 52, 52, - 52, 52, 93, 194, 197, 61, 62, 62, 62, 153, - 62, 52, 52, 56, 174, 175, 176, 177, 191, 180, - 180, 55, 123, 62, 62, 62, 62, 62, 78, 17, - 18, 20, 21, 64, 65, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 57, 53, 52, 57, - 53, 52, 57, 58, 57, 153, 170, 12, 122, 62, - 53, 153, 27, 153, 128, 155, 156, 157, 180, 191, - 153, 61, 61, 62, 170, 170, 57, 58, 153, 52, - 52, 52, 52, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 57, 170, 57, 170, 57, 153, - 52, 53, 62, 53, 52, 53, 62, 30, 58, 53, - 53, 53, 175, 153, 153, 153, 153, 52, 53, 52, - 53, 52, 53, 170, 122, 153, 122, 153, 154, 153, - 191, 127, 62, 62, 53, 53, 58, 53, 58, 53, - 58, 170, 170, 170, 53, 25, 53, 62, 53, 30, - 62, 62, 171, 62, 171, 62, 171, 53, 53, 53, - 122, 62, 128, 122, 153, 53, 53, 53, 53, 53, - 62, 62, 62, 122, 122 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 113, 114, 114, 115, 115, 115, 115, 115, 115, - 116, 117, 118, 118, 118, 118, 118, 119, 120, 121, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 123, 123, 124, 124, 125, - 125, 126, 126, 127, 127, 128, 128, 128, 128, 129, - 129, 130, 130, 130, 131, 132, 132, 133, 134, 134, - 135, 135, 136, 137, 137, 138, 139, 140, 141, 142, - 143, 143, 144, 145, 145, 146, 147, 148, 149, 149, - 150, 151, 152, 153, 153, 153, 154, 154, 155, 155, - 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, - 156, 156, 157, 157, 158, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 161, 162, 162, 162, 162, 163, 164, 164, 165, - 165, 166, 166, 166, 166, 166, 166, 167, 167, 167, - 167, 168, 169, 169, 169, 170, 170, 171, 171, 172, - 172, 173, 174, 174, 175, 175, 175, 176, 177, 178, - 179, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 191, 192, 192, 193, 194, 195, 196, 196, 197, - 197, 198, 199 - }; - - 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, 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, 2, 4, 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, 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, 2, 2, 2, 2, 2, 2, 1, 1, 2, - 2, 4, 6, 5, 7, 5, 7, 8, 9, 9, - 9, 3, 3, 1, 0, 1, 0, 3, 1, 2, - 3, 3, 3, 1, 1, 1, 1, 4, 3, 3, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 2, 1, 2, - 1, 1, 1 - }; - - - - -#if S1DEBUG - const short - parser::yyrline_[] = - { - 0, 263, 263, 264, 268, 270, 272, 274, 276, 278, - 283, 287, 292, 293, 294, 295, 296, 300, 305, 310, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 343, 344, 348, 350, 355, - 357, 362, 363, 367, 368, 372, 374, 376, 379, 383, - 385, 390, 392, 394, 399, 404, 406, 411, 416, 418, - 423, 425, 430, 435, 437, 442, 447, 452, 457, 462, - 467, 469, 474, 479, 481, 486, 491, 496, 501, 503, - 508, 513, 518, 523, 524, 525, 529, 530, 534, 536, - 538, 540, 542, 544, 546, 548, 550, 552, 554, 556, - 561, 563, 568, 570, 575, 580, 582, 584, 586, 588, - 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, - 610, 612, 614, 619, 620, 621, 622, 623, 624, 625, - 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, - 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, - 646, 650, 655, 657, 659, 661, 666, 671, 672, 675, - 676, 680, 682, 684, 686, 688, 690, 695, 697, 699, - 701, 706, 711, 713, 716, 720, 723, 727, 729, 734, - 736, 741, 746, 748, 753, 754, 755, 759, 764, 769, - 774, 779, 780, 781, 782, 783, 784, 785, 786, 787, - 791, 796, 801, 806, 811, 816, 821, 826, 831, 836, - 841, 843, 848, 850, 855, 860, 865, 870, 872, 877, - 879, 884, 889 - }; - - 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 // S1DEBUG - - -#line 13 "parser.ypp" -} } } // xsk::gsc::s1 -#line 4726 "parser.cpp" - -#line 893 "parser.ypp" - - -void xsk::gsc::s1::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/src/s1/xsk/parser.hpp b/src/s1/xsk/parser.hpp deleted file mode 100644 index a3cf6057..00000000 --- a/src/s1/xsk/parser.hpp +++ /dev/null @@ -1,5601 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// 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::gsc::s1::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_S1_PARSER_HPP_INCLUDED -# define YY_S1_PARSER_HPP_INCLUDED -// "%code requires" blocks. -#line 28 "parser.ypp" - -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "s1.hpp" -namespace xsk::gsc::s1 { class lexer; } - -#line 58 "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 S1_ASSERT -# include -# define S1_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 - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# 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 S1DEBUG -# if defined YYDEBUG -#if YYDEBUG -# define S1DEBUG 1 -# else -# define S1DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define S1DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined S1DEBUG */ - -#line 13 "parser.ypp" -namespace xsk { namespace gsc { namespace s1 { -#line 207 "parser.hpp" - - - - - /// A Bison parser. - class parser - { - public: -#ifdef S1STYPE -# ifdef __GNUC__ -# pragma GCC message "bison: do not #define S1STYPE in C++, use %define api.value.type" -# endif - typedef S1STYPE value_type; -#else - /// 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 value_type - { - public: - /// Type of *this. - typedef value_type self_type; - - /// Empty construction. - value_type () YY_NOEXCEPT - : yyraw_ () - , yytypeid_ (YY_NULLPTR) - {} - - /// Construct and fill. - template - value_type (YY_RVREF (T) t) - : yytypeid_ (&typeid (T)) - { - S1_ASSERT (sizeof (T) <= size); - new (yyas_ ()) T (YY_MOVE (t)); - } - -#if 201103L <= YY_CPLUSPLUS - /// Non copyable. - value_type (const self_type&) = delete; - /// Non copyable. - self_type& operator= (const self_type&) = delete; -#endif - - /// Destruction, allowed only if empty. - ~value_type () YY_NOEXCEPT - { - S1_ASSERT (!yytypeid_); - } - -# if 201103L <= YY_CPLUSPLUS - /// Instantiate a \a T in here from \a t. - template - T& - emplace (U&&... u) - { - S1_ASSERT (!yytypeid_); - S1_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 () - { - S1_ASSERT (!yytypeid_); - S1_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) - { - S1_ASSERT (!yytypeid_); - S1_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 - { - S1_ASSERT (yytypeid_); - S1_ASSERT (*yytypeid_ == typeid (T)); - S1_ASSERT (sizeof (T) <= size); - return *yyas_ (); - } - - /// Const accessor to a built \a T (for %printer). - template - const T& - as () const YY_NOEXCEPT - { - S1_ASSERT (yytypeid_); - S1_ASSERT (*yytypeid_ == typeid (T)); - S1_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 - { - S1_ASSERT (yytypeid_); - S1_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. - value_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 = yyraw_; - return static_cast (yyp); - } - - /// Const accessor to raw memory as \a T. - template - const T* - yyas_ () const YY_NOEXCEPT - { - const void *yyp = 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_tuple - // expr_tuple_types - // expr_object - char dummy6[sizeof (ast::expr)]; - - // expr_add_array - char dummy7[sizeof (ast::expr_add_array::ptr)]; - - // expr_anim - char dummy8[sizeof (ast::expr_anim::ptr)]; - - // expr_animation - char dummy9[sizeof (ast::expr_animation::ptr)]; - - // expr_animtree - char dummy10[sizeof (ast::expr_animtree::ptr)]; - - // expr_arguments - // expr_arguments_no_empty - char dummy11[sizeof (ast::expr_arguments::ptr)]; - - // expr_array - char dummy12[sizeof (ast::expr_array::ptr)]; - - // expr_call - char dummy13[sizeof (ast::expr_call::ptr)]; - - // expr_complement - char dummy14[sizeof (ast::expr_complement::ptr)]; - - // expr_empty_array - char dummy15[sizeof (ast::expr_empty_array::ptr)]; - - // expr_false - char dummy16[sizeof (ast::expr_false::ptr)]; - - // expr_field - char dummy17[sizeof (ast::expr_field::ptr)]; - - // expr_float - char dummy18[sizeof (ast::expr_float::ptr)]; - - // expr_game - char dummy19[sizeof (ast::expr_game::ptr)]; - - // expr_identifier_nosize - // expr_identifier - char dummy20[sizeof (ast::expr_identifier::ptr)]; - - // expr_integer - char dummy21[sizeof (ast::expr_integer::ptr)]; - - // expr_istring - char dummy22[sizeof (ast::expr_istring::ptr)]; - - // expr_level - char dummy23[sizeof (ast::expr_level::ptr)]; - - // expr_method - char dummy24[sizeof (ast::expr_method::ptr)]; - - // expr_negate - char dummy25[sizeof (ast::expr_negate::ptr)]; - - // expr_not - char dummy26[sizeof (ast::expr_not::ptr)]; - - // expr_parameters - char dummy27[sizeof (ast::expr_parameters::ptr)]; - - // expr_paren - char dummy28[sizeof (ast::expr_paren::ptr)]; - - // expr_path - char dummy29[sizeof (ast::expr_path::ptr)]; - - // expr_reference - char dummy30[sizeof (ast::expr_reference::ptr)]; - - // expr_self - char dummy31[sizeof (ast::expr_self::ptr)]; - - // expr_size - char dummy32[sizeof (ast::expr_size::ptr)]; - - // expr_string - char dummy33[sizeof (ast::expr_string::ptr)]; - - // expr_thisthread - char dummy34[sizeof (ast::expr_thisthread::ptr)]; - - // expr_true - char dummy35[sizeof (ast::expr_true::ptr)]; - - // expr_tuple_arguments - char dummy36[sizeof (ast::expr_tuple::ptr)]; - - // expr_undefined - char dummy37[sizeof (ast::expr_undefined::ptr)]; - - // expr_vector - char dummy38[sizeof (ast::expr_vector::ptr)]; - - // include - char dummy39[sizeof (ast::include::ptr)]; - - // program - char dummy40[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy41[sizeof (ast::stmt)]; - - // stmt_assign - char dummy42[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy43[sizeof (ast::stmt_break::ptr)]; - - // stmt_breakpoint - char dummy44[sizeof (ast::stmt_breakpoint::ptr)]; - - // stmt_call - char dummy45[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy46[sizeof (ast::stmt_case::ptr)]; - - // stmt_continue - char dummy47[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy48[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy49[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy50[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy51[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy52[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy53[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy54[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy55[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy56[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy57[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy58[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy59[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy60[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy61[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy62[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy63[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waitframe - char dummy64[sizeof (ast::stmt_waitframe::ptr)]; - - // stmt_waittill - char dummy65[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy66[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy67[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy68[sizeof (ast::stmt_while::ptr)]; - - // "path" - // "identifier" - // "string literal" - // "localized string" - // "float" - // "integer" - char dummy69[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]; - }; - - /// Whether the content is built: if defined, the name of the stored type. - const std::type_info *yytypeid_; - }; - -#endif - /// Backward compatibility (Bison 3.8). - typedef value_type semantic_type; - - /// Symbol locations. - typedef xsk::gsc::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 - { - S1EMPTY = -2, - S1EOF = 0, // "end of file" - S1error = 1, // error - S1UNDEF = 2, // "invalid token" - SH_DEFINE = 3, // "#define" - SH_UNDEF = 4, // "#undef" - SH_IFDEF = 5, // "#ifdef" - SH_IFNDEF = 6, // "#ifndef" - SH_IF = 7, // "#if" - SH_ELIF = 8, // "#elif" - SH_ELSE = 9, // "#else" - SH_ENDIF = 10, // "#endif" - DEVBEGIN = 11, // "/#" - DEVEND = 12, // "#/" - INLINE = 13, // "#inline" - INCLUDE = 14, // "#include" - USINGTREE = 15, // "#using_animtree" - ANIMTREE = 16, // "#animtree" - ENDON = 17, // "endon" - NOTIFY = 18, // "notify" - WAIT = 19, // "wait" - WAITTILL = 20, // "waittill" - WAITTILLMATCH = 21, // "waittillmatch" - WAITTILLFRAMEEND = 22, // "waittillframeend" - WAITFRAME = 23, // "waitframe" - IF = 24, // "if" - ELSE = 25, // "else" - DO = 26, // "do" - WHILE = 27, // "while" - FOR = 28, // "for" - FOREACH = 29, // "foreach" - IN = 30, // "in" - SWITCH = 31, // "switch" - CASE = 32, // "case" - DEFAULT = 33, // "default" - BREAK = 34, // "break" - CONTINUE = 35, // "continue" - RETURN = 36, // "return" - BREAKPOINT = 37, // "breakpoint" - PROFBEGIN = 38, // "prof_begin" - PROFEND = 39, // "prof_end" - THREAD = 40, // "thread" - CHILDTHREAD = 41, // "childthread" - THISTHREAD = 42, // "thisthread" - CALL = 43, // "call" - TRUE = 44, // "true" - FALSE = 45, // "false" - UNDEFINED = 46, // "undefined" - SIZE = 47, // "size" - GAME = 48, // "game" - SELF = 49, // "self" - ANIM = 50, // "anim" - LEVEL = 51, // "level" - LPAREN = 52, // "(" - RPAREN = 53, // ")" - LBRACE = 54, // "{" - RBRACE = 55, // "}" - LBRACKET = 56, // "[" - RBRACKET = 57, // "]" - COMMA = 58, // "," - DOT = 59, // "." - DOUBLECOLON = 60, // "::" - COLON = 61, // ":" - SEMICOLON = 62, // ";" - QMARK = 63, // "?" - INCREMENT = 64, // "++" - DECREMENT = 65, // "--" - LSHIFT = 66, // "<<" - RSHIFT = 67, // ">>" - OR = 68, // "||" - AND = 69, // "&&" - EQUALITY = 70, // "==" - INEQUALITY = 71, // "!=" - LESS_EQUAL = 72, // "<=" - GREATER_EQUAL = 73, // ">=" - LESS = 74, // "<" - GREATER = 75, // ">" - NOT = 76, // "!" - COMPLEMENT = 77, // "~" - ASSIGN = 78, // "=" - ASSIGN_ADD = 79, // "+=" - ASSIGN_SUB = 80, // "-=" - ASSIGN_MUL = 81, // "*=" - ASSIGN_DIV = 82, // "/=" - ASSIGN_MOD = 83, // "%=" - ASSIGN_BW_OR = 84, // "|=" - ASSIGN_BW_AND = 85, // "&=" - ASSIGN_BW_EXOR = 86, // "^=" - ASSIGN_RSHIFT = 87, // ">>=" - ASSIGN_LSHIFT = 88, // "<<=" - BITWISE_OR = 89, // "|" - BITWISE_AND = 90, // "&" - BITWISE_EXOR = 91, // "^" - ADD = 92, // "+" - SUB = 93, // "-" - MUL = 94, // "*" - DIV = 95, // "/" - MOD = 96, // "%" - PATH = 97, // "path" - IDENTIFIER = 98, // "identifier" - STRING = 99, // "string literal" - ISTRING = 100, // "localized string" - FLOAT = 101, // "float" - INTEGER = 102, // "integer" - SIZEOF = 103, // SIZEOF - ADD_ARRAY = 104, // ADD_ARRAY - THEN = 105, // THEN - TERN = 106, // TERN - NEG = 107, // NEG - ANIMREF = 108, // ANIMREF - PREINC = 109, // PREINC - PREDEC = 110, // PREDEC - POSTINC = 111, // POSTINC - POSTDEC = 112 // POSTDEC - }; - /// Backward compatibility alias (Bison 3.6). - typedef token_kind_type yytokentype; - }; - - /// Token kind, as returned by yylex. - typedef token::token_kind_type 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 = 113, ///< Number of tokens. - S_YYEMPTY = -2, - S_YYEOF = 0, // "end of file" - S_YYerror = 1, // error - S_YYUNDEF = 2, // "invalid token" - S_SH_DEFINE = 3, // "#define" - S_SH_UNDEF = 4, // "#undef" - S_SH_IFDEF = 5, // "#ifdef" - S_SH_IFNDEF = 6, // "#ifndef" - S_SH_IF = 7, // "#if" - S_SH_ELIF = 8, // "#elif" - S_SH_ELSE = 9, // "#else" - S_SH_ENDIF = 10, // "#endif" - S_DEVBEGIN = 11, // "/#" - S_DEVEND = 12, // "#/" - S_INLINE = 13, // "#inline" - S_INCLUDE = 14, // "#include" - S_USINGTREE = 15, // "#using_animtree" - S_ANIMTREE = 16, // "#animtree" - S_ENDON = 17, // "endon" - S_NOTIFY = 18, // "notify" - S_WAIT = 19, // "wait" - S_WAITTILL = 20, // "waittill" - S_WAITTILLMATCH = 21, // "waittillmatch" - S_WAITTILLFRAMEEND = 22, // "waittillframeend" - S_WAITFRAME = 23, // "waitframe" - S_IF = 24, // "if" - S_ELSE = 25, // "else" - S_DO = 26, // "do" - S_WHILE = 27, // "while" - S_FOR = 28, // "for" - S_FOREACH = 29, // "foreach" - S_IN = 30, // "in" - S_SWITCH = 31, // "switch" - S_CASE = 32, // "case" - S_DEFAULT = 33, // "default" - S_BREAK = 34, // "break" - S_CONTINUE = 35, // "continue" - S_RETURN = 36, // "return" - S_BREAKPOINT = 37, // "breakpoint" - S_PROFBEGIN = 38, // "prof_begin" - S_PROFEND = 39, // "prof_end" - S_THREAD = 40, // "thread" - S_CHILDTHREAD = 41, // "childthread" - S_THISTHREAD = 42, // "thisthread" - S_CALL = 43, // "call" - S_TRUE = 44, // "true" - S_FALSE = 45, // "false" - S_UNDEFINED = 46, // "undefined" - S_SIZE = 47, // "size" - S_GAME = 48, // "game" - S_SELF = 49, // "self" - S_ANIM = 50, // "anim" - S_LEVEL = 51, // "level" - S_LPAREN = 52, // "(" - S_RPAREN = 53, // ")" - S_LBRACE = 54, // "{" - S_RBRACE = 55, // "}" - S_LBRACKET = 56, // "[" - S_RBRACKET = 57, // "]" - S_COMMA = 58, // "," - S_DOT = 59, // "." - S_DOUBLECOLON = 60, // "::" - S_COLON = 61, // ":" - S_SEMICOLON = 62, // ";" - S_QMARK = 63, // "?" - S_INCREMENT = 64, // "++" - S_DECREMENT = 65, // "--" - S_LSHIFT = 66, // "<<" - S_RSHIFT = 67, // ">>" - S_OR = 68, // "||" - S_AND = 69, // "&&" - S_EQUALITY = 70, // "==" - S_INEQUALITY = 71, // "!=" - S_LESS_EQUAL = 72, // "<=" - S_GREATER_EQUAL = 73, // ">=" - S_LESS = 74, // "<" - S_GREATER = 75, // ">" - S_NOT = 76, // "!" - S_COMPLEMENT = 77, // "~" - S_ASSIGN = 78, // "=" - S_ASSIGN_ADD = 79, // "+=" - S_ASSIGN_SUB = 80, // "-=" - S_ASSIGN_MUL = 81, // "*=" - S_ASSIGN_DIV = 82, // "/=" - S_ASSIGN_MOD = 83, // "%=" - S_ASSIGN_BW_OR = 84, // "|=" - S_ASSIGN_BW_AND = 85, // "&=" - S_ASSIGN_BW_EXOR = 86, // "^=" - S_ASSIGN_RSHIFT = 87, // ">>=" - S_ASSIGN_LSHIFT = 88, // "<<=" - S_BITWISE_OR = 89, // "|" - S_BITWISE_AND = 90, // "&" - S_BITWISE_EXOR = 91, // "^" - S_ADD = 92, // "+" - S_SUB = 93, // "-" - S_MUL = 94, // "*" - S_DIV = 95, // "/" - S_MOD = 96, // "%" - S_PATH = 97, // "path" - S_IDENTIFIER = 98, // "identifier" - S_STRING = 99, // "string literal" - S_ISTRING = 100, // "localized string" - S_FLOAT = 101, // "float" - S_INTEGER = 102, // "integer" - S_SIZEOF = 103, // SIZEOF - S_ADD_ARRAY = 104, // ADD_ARRAY - S_THEN = 105, // THEN - S_TERN = 106, // TERN - S_NEG = 107, // NEG - S_ANIMREF = 108, // ANIMREF - S_PREINC = 109, // PREINC - S_PREDEC = 110, // PREDEC - S_POSTINC = 111, // POSTINC - S_POSTDEC = 112, // POSTDEC - S_YYACCEPT = 113, // $accept - S_root = 114, // root - S_program = 115, // program - S_inline = 116, // inline - S_include = 117, // include - S_declaration = 118, // declaration - S_decl_usingtree = 119, // decl_usingtree - S_decl_constant = 120, // decl_constant - S_decl_thread = 121, // decl_thread - S_stmt = 122, // stmt - S_stmt_or_dev = 123, // stmt_or_dev - S_stmt_list = 124, // stmt_list - S_stmt_or_dev_list = 125, // stmt_or_dev_list - S_stmt_dev = 126, // stmt_dev - S_stmt_block = 127, // stmt_block - S_stmt_expr = 128, // stmt_expr - S_stmt_call = 129, // stmt_call - S_stmt_assign = 130, // stmt_assign - S_stmt_endon = 131, // stmt_endon - S_stmt_notify = 132, // stmt_notify - S_stmt_wait = 133, // stmt_wait - S_stmt_waittill = 134, // stmt_waittill - S_stmt_waittillmatch = 135, // stmt_waittillmatch - S_stmt_waittillframeend = 136, // stmt_waittillframeend - S_stmt_waitframe = 137, // stmt_waitframe - S_stmt_if = 138, // stmt_if - S_stmt_ifelse = 139, // stmt_ifelse - S_stmt_while = 140, // stmt_while - S_stmt_dowhile = 141, // stmt_dowhile - S_stmt_for = 142, // stmt_for - S_stmt_foreach = 143, // stmt_foreach - S_stmt_switch = 144, // stmt_switch - S_stmt_case = 145, // stmt_case - S_stmt_default = 146, // stmt_default - S_stmt_break = 147, // stmt_break - S_stmt_continue = 148, // stmt_continue - S_stmt_return = 149, // stmt_return - S_stmt_breakpoint = 150, // stmt_breakpoint - S_stmt_prof_begin = 151, // stmt_prof_begin - S_stmt_prof_end = 152, // stmt_prof_end - S_expr = 153, // expr - S_expr_or_empty = 154, // expr_or_empty - S_expr_assign = 155, // expr_assign - S_expr_increment = 156, // expr_increment - S_expr_decrement = 157, // expr_decrement - S_expr_ternary = 158, // expr_ternary - S_expr_binary = 159, // expr_binary - S_expr_primitive = 160, // expr_primitive - S_expr_complement = 161, // expr_complement - S_expr_negate = 162, // expr_negate - S_expr_not = 163, // expr_not - S_expr_call = 164, // expr_call - S_expr_method = 165, // expr_method - S_expr_function = 166, // expr_function - S_expr_pointer = 167, // expr_pointer - S_expr_add_array = 168, // expr_add_array - S_expr_parameters = 169, // expr_parameters - S_expr_arguments = 170, // expr_arguments - S_expr_arguments_no_empty = 171, // expr_arguments_no_empty - S_expr_reference = 172, // expr_reference - S_expr_tuple = 173, // expr_tuple - S_expr_tuple_arguments = 174, // expr_tuple_arguments - S_expr_tuple_types = 175, // expr_tuple_types - S_expr_array = 176, // expr_array - S_expr_field = 177, // expr_field - S_expr_size = 178, // expr_size - S_expr_paren = 179, // expr_paren - S_expr_object = 180, // expr_object - S_expr_thisthread = 181, // expr_thisthread - S_expr_empty_array = 182, // expr_empty_array - S_expr_undefined = 183, // expr_undefined - S_expr_game = 184, // expr_game - S_expr_self = 185, // expr_self - S_expr_anim = 186, // expr_anim - S_expr_level = 187, // expr_level - S_expr_animation = 188, // expr_animation - S_expr_animtree = 189, // expr_animtree - S_expr_identifier_nosize = 190, // expr_identifier_nosize - S_expr_identifier = 191, // expr_identifier - S_expr_path = 192, // expr_path - S_expr_istring = 193, // expr_istring - S_expr_string = 194, // expr_string - S_expr_vector = 195, // expr_vector - S_expr_float = 196, // expr_float - S_expr_integer = 197, // expr_integer - S_expr_false = 198, // expr_false - S_expr_true = 199 // 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 () YY_NOEXCEPT - : 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::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_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_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_add_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_add_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_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_animtree::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_animtree::ptr& v, const location_type& l) - : 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_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_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_negate::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l) - : 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_thisthread::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_thisthread::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_tuple::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_tuple::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::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_waitframe::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_waitframe::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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.template destroy< ast::expr_add_array::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_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.template destroy< ast::expr_negate::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_thisthread: // expr_thisthread - value.template destroy< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.template destroy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.template destroy< ast::stmt_waitframe::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_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_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. - value_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 - { - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; - - /// Default constructor. - by_kind () YY_NOEXCEPT; - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that) YY_NOEXCEPT; -#endif - - /// Copy constructor. - by_kind (const by_kind& that) YY_NOEXCEPT; - - /// Constructor from (external) token numbers. - by_kind (kind_type t) YY_NOEXCEPT; - - - - /// 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 () YY_NOEXCEPT {} - - /// Constructor for valueless symbols, and symbols from each type. -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, location_type l) - : super_type (token_kind_type (tok), std::move (l)) -#else - symbol_type (int tok, const location_type& l) - : super_type (token_kind_type (tok), l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - S1_ASSERT (tok == token::S1EOF - || (token::S1error <= tok && tok <= token::MOD) - || (token::SIZEOF <= tok && tok <= token::POSTDEC)); -#endif - } -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, std::string v, location_type l) - : super_type (token_kind_type (tok), std::move (v), std::move (l)) -#else - symbol_type (int tok, const std::string& v, const location_type& l) - : super_type (token_kind_type (tok), v, l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - S1_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); -#endif - } - }; - - /// Build a parser object. - parser (xsk::gsc::s1::lexer& lexer_yyarg, xsk::gsc::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 S1DEBUG - /// 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 token kind. -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_S1EOF (location_type l) - { - return symbol_type (token::S1EOF, std::move (l)); - } -#else - static - symbol_type - make_S1EOF (const location_type& l) - { - return symbol_type (token::S1EOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_S1error (location_type l) - { - return symbol_type (token::S1error, std::move (l)); - } -#else - static - symbol_type - make_S1error (const location_type& l) - { - return symbol_type (token::S1error, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_S1UNDEF (location_type l) - { - return symbol_type (token::S1UNDEF, std::move (l)); - } -#else - static - symbol_type - make_S1UNDEF (const location_type& l) - { - return symbol_type (token::S1UNDEF, 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_ANIMTREE (location_type l) - { - return symbol_type (token::ANIMTREE, std::move (l)); - } -#else - static - symbol_type - make_ANIMTREE (const location_type& l) - { - return symbol_type (token::ANIMTREE, 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_WAITFRAME (location_type l) - { - return symbol_type (token::WAITFRAME, std::move (l)); - } -#else - static - symbol_type - make_WAITFRAME (const location_type& l) - { - return symbol_type (token::WAITFRAME, 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_CHILDTHREAD (location_type l) - { - return symbol_type (token::CHILDTHREAD, std::move (l)); - } -#else - static - symbol_type - make_CHILDTHREAD (const location_type& l) - { - return symbol_type (token::CHILDTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_THISTHREAD (location_type l) - { - return symbol_type (token::THISTHREAD, std::move (l)); - } -#else - static - symbol_type - make_THISTHREAD (const location_type& l) - { - return symbol_type (token::THISTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_CALL (location_type l) - { - return symbol_type (token::CALL, std::move (l)); - } -#else - static - symbol_type - make_CALL (const location_type& l) - { - return symbol_type (token::CALL, 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_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_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_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_SIZEOF (location_type l) - { - return symbol_type (token::SIZEOF, std::move (l)); - } -#else - static - symbol_type - make_SIZEOF (const location_type& l) - { - return symbol_type (token::SIZEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_ADD_ARRAY (location_type l) - { - return symbol_type (token::ADD_ARRAY, std::move (l)); - } -#else - static - symbol_type - make_ADD_ARRAY (const location_type& l) - { - return symbol_type (token::ADD_ARRAY, 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) YY_NOEXCEPT; - - /// 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) YY_NOEXCEPT; - - 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_kind_type enum. - static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; - - - - // 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 symbol kind of the accessing symbol of - // state STATE-NUM. - static const unsigned char yystos_[]; - - // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. - static const unsigned char yyr1_[]; - - // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. - static const signed char yyr2_[]; - - -#if S1DEBUG - // 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT; - - /// Constants. - enum - { - yylast_ = 2479, ///< Last index in yytable_. - yynnts_ = 87, ///< Number of nonterminal symbols. - yyfinal_ = 22 ///< Termination state number. - }; - - - // User arguments. - xsk::gsc::s1::lexer& lexer; - xsk::gsc::ast::program::ptr& ast; - - }; - - inline - parser::symbol_kind_type - parser::yytranslate_ (int t) YY_NOEXCEPT - { - 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::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_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); - 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_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::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_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_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 () YY_NOEXCEPT - : kind_ (symbol_kind::S_YYEMPTY) - {} - -#if 201103L <= YY_CPLUSPLUS - inline - parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT - : kind_ (that.kind_) - { - that.clear (); - } -#endif - - inline - parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT - : kind_ (that.kind_) - {} - - inline - parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT - : 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::gsc::s1 -#line 5597 "parser.hpp" - - - - -#endif // !YY_S1_PARSER_HPP_INCLUDED diff --git a/src/s1/xsk/resolver.hpp b/src/s1/xsk/resolver.hpp deleted file mode 100644 index 8bf65c5b..00000000 --- a/src/s1/xsk/resolver.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::s1 -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint16_t; - static auto token_name(std::uint16_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/s1.cpp b/src/s1/xsk/s1.cpp deleted file mode 100644 index d6b82a32..00000000 --- a/src/s1/xsk/s1.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// 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 "s1.hpp" - -namespace xsk::gsc::s1 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - return 1; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_GetAnimTree: - case opcode::OP_GetNegByte: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_GetByte: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_waittillmatch: - return 2; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_GetUnsignedShort: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_jumpback: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - case opcode::OP_JumpOnFalse: - case opcode::OP_endswitch: - return 3; - case opcode::OP_CallBuiltin: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_GetLocalFunction: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarMethodCall: - return 4; - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_GetFloat: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_switch: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - case opcode::OP_jump: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_GetInteger: - case opcode::OP_GetString: - case opcode::OP_GetIString: - return 5; - case opcode::OP_GetAnimation: - return 9; - case opcode::OP_GetVector: - return 13; - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/s1.hpp b/src/s1/xsk/s1.hpp deleted file mode 100644 index e72a10be..00000000 --- a/src/s1/xsk/s1.hpp +++ /dev/null @@ -1,183 +0,0 @@ -// 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 "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::s1 -{ - -constexpr std::uint16_t max_string_id = 0xA7DC; - -enum class opcode : std::uint8_t -{ - OP_SetNewLocalVariableFieldCached0 = 0x17, - OP_EvalSelfFieldVariable = 0x18, - OP_Return = 0x19, - OP_CallBuiltin0 = 0x1A, - OP_CallBuiltin1 = 0x1B, - OP_CallBuiltin2 = 0x1C, - OP_CallBuiltin3 = 0x1D, - OP_CallBuiltin4 = 0x1E, - OP_CallBuiltin5 = 0x1F, - OP_CallBuiltin = 0x20, - OP_BoolNot = 0x21, - OP_ScriptFarMethodThreadCall = 0x22, - OP_JumpOnTrueExpr = 0x23, - OP_SetLevelFieldVariableField = 0x24, - OP_CastBool = 0x25, - OP_EvalNewLocalArrayRefCached0 = 0x26, - OP_CallBuiltinPointer = 0x27, - OP_inequality = 0x28, - OP_GetThisthread = 0x29, - OP_ClearFieldVariable = 0x2A, - OP_GetFloat = 0x2B, - OP_SafeCreateVariableFieldCached = 0x2C, - OP_ScriptFarFunctionCall2 = 0x2D, - OP_ScriptFarFunctionCall = 0x2E, - OP_ScriptFarChildThreadCall = 0x2F, - OP_ClearLocalVariableFieldCached0 = 0x30, - OP_ClearLocalVariableFieldCached = 0x31, - OP_checkclearparams = 0x32, - OP_CastFieldObject = 0x33, - OP_End = 0x34, - OP_size = 0x35, - OP_EmptyArray = 0x36, - OP_bit_and = 0x37, - OP_less_equal = 0x38, - OP_voidCodepos = 0x39, - OP_ScriptMethodThreadCallPointer = 0x3A, - OP_endswitch = 0x3B, - OP_ClearVariableField = 0x3C, - OP_divide = 0x3D, - OP_ScriptFarMethodChildThreadCall = 0x3E, - OP_GetUnsignedShort = 0x3F, - OP_JumpOnTrue = 0x40, - OP_GetSelf = 0x41, - OP_ScriptFarThreadCall = 0x42, - OP_ScriptLocalThreadCall = 0x43, - OP_SetLocalVariableFieldCached0 = 0x44, - OP_SetLocalVariableFieldCached = 0x45, - OP_plus = 0x46, - OP_BoolComplement = 0x47, - OP_ScriptMethodCallPointer = 0x48, - OP_inc = 0x49, - OP_RemoveLocalVariables = 0x4A, - OP_JumpOnFalseExpr = 0x4B, - OP_switch = 0x4C, - OP_clearparams = 0x4D, - OP_EvalLocalVariableRefCached0 = 0x4E, - OP_EvalLocalVariableRefCached = 0x4F, - OP_ScriptLocalMethodCall = 0x50, - OP_EvalFieldVariable = 0x51, - OP_EvalFieldVariableRef = 0x52, - OP_GetString = 0x53, - OP_ScriptFunctionCallPointer = 0x54, - OP_EvalLevelFieldVariable = 0x55, - OP_GetVector = 0x56, - OP_endon = 0x57, - OP_greater_equal = 0x58, - OP_GetSelfObject = 0x59, - OP_SetAnimFieldVariableField = 0x5A, - OP_SetVariableField = 0x5B, - OP_ScriptLocalFunctionCall2 = 0x5C, - OP_ScriptLocalFunctionCall = 0x5D, - OP_EvalLocalArrayRefCached0 = 0x5E, - OP_EvalLocalArrayRefCached = 0x5F, - OP_GetFarFunction = 0x60, - OP_less = 0x61, - OP_GetGameRef = 0x62, - OP_waittillFrameEnd = 0x63, - OP_waitFrame = 0x64, - OP_SafeSetVariableFieldCached0 = 0x65, - OP_SafeSetVariableFieldCached = 0x66, - OP_ScriptMethodChildThreadCallPointer = 0x67, - OP_GetLevel = 0x68, - OP_notify = 0x69, - OP_DecTop = 0x6A, - OP_shift_left = 0x6B, - OP_ScriptLocalMethodThreadCall = 0x6C, - OP_ScriptLocalMethodChildThreadCall = 0x6D, - OP_greater = 0x6E, - OP_EvalLocalVariableCached0 = 0x6F, - OP_EvalLocalVariableCached1 = 0x70, - OP_EvalLocalVariableCached2 = 0x71, - OP_EvalLocalVariableCached3 = 0x72, - OP_EvalLocalVariableCached4 = 0x73, - OP_EvalLocalVariableCached5 = 0x74, - OP_EvalLocalVariableCached = 0x75, - OP_SafeSetWaittillVariableFieldCached = 0x76, - OP_jump = 0x77, - OP_ScriptThreadCallPointer = 0x78, - OP_GetZero = 0x79, - OP_wait = 0x7A, - OP_minus = 0x7B, - OP_SetSelfFieldVariableField = 0x7C, - OP_EvalNewLocalVariableRefCached0 = 0x7D, - OP_multiply = 0x7E, - OP_CreateLocalVariable = 0x7F, - OP_ScriptLocalChildThreadCall = 0x80, - OP_GetInteger = 0x81, - OP_mod = 0x82, - OP_EvalAnimFieldVariableRef = 0x83, - OP_GetBuiltinFunction = 0x84, - OP_GetGame = 0x85, - OP_waittill = 0x86, - OP_dec = 0x87, - OP_EvalLocalVariableObjectCached = 0x88, - OP_PreScriptCall = 0x89, - OP_GetAnim = 0x8A, - OP_GetUndefined = 0x8B, - OP_EvalLevelFieldVariableRef = 0x8C, - OP_GetAnimObject = 0x8D, - OP_GetLevelObject = 0x8E, - OP_bit_ex_or = 0x8F, - OP_equality = 0x90, - OP_ClearArray = 0x91, - OP_jumpback = 0x92, - OP_GetAnimation = 0x93, - OP_EvalAnimFieldVariable = 0x94, - OP_GetAnimTree = 0x95, - OP_GetIString = 0x96, - OP_EvalArrayRef = 0x97, - OP_EvalSelfFieldVariableRef = 0x98, - OP_GetNegByte = 0x99, - OP_GetBuiltinMethod = 0x9A, - OP_CallBuiltinMethodPointer = 0x9B, - OP_EvalArray = 0x9C, - OP_vector = 0x9D, - OP_ScriptFarMethodCall = 0x9E, - OP_EvalLocalArrayCached = 0x9F, - OP_GetByte = 0xA0, - OP_ScriptChildThreadCallPointer = 0xA1, - OP_bit_or = 0xA2, - OP_AddArray = 0xA3, - OP_waittillmatch2 = 0xA4, - OP_waittillmatch = 0xA5, - OP_GetLocalFunction = 0xA6, - OP_GetNegUnsignedShort = 0xA7, - OP_shift_right = 0xA8, - OP_CallBuiltinMethod0 = 0xA9, - OP_CallBuiltinMethod1 = 0xAA, - OP_CallBuiltinMethod2 = 0xAB, - OP_CallBuiltinMethod3 = 0xAC, - OP_CallBuiltinMethod4 = 0xAD, - OP_CallBuiltinMethod5 = 0xAE, - OP_CallBuiltinMethod = 0xAF, - OP_JumpOnFalse = 0xB0, - OP_Count = 0xB1, -}; - -auto opcode_size(std::uint8_t op) -> std::uint32_t; - -} // namespace xsk::gsc::s1 diff --git a/src/s2/s2.cpp b/src/s2/s2.cpp new file mode 100644 index 00000000..834fc4a1 --- /dev/null +++ b/src/s2/s2.cpp @@ -0,0 +1,53 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s2.hpp" + +namespace xsk::gsc::s2 +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::str4 | props::tok4 | props::waitframe | props::boolnotand | props::offs8, + engine::s2, endian::little, system::pc, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::s2 diff --git a/src/s2/s2.hpp b/src/s2/s2.hpp new file mode 100644 index 00000000..c2edb113 --- /dev/null +++ b/src/s2/s2.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::s2 +{ + +constexpr usize code_count = 155; +constexpr usize func_count = 1000; +constexpr usize meth_count = 1700; +constexpr usize token_count = 5; +constexpr u32 max_string_id = 0xACEE; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::s2 diff --git a/src/s2/s2_code.cpp b/src/s2/s2_code.cpp new file mode 100644 index 00000000..a44f878a --- /dev/null +++ b/src/s2/s2_code.cpp @@ -0,0 +1,170 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s2.hpp" + +namespace xsk::gsc::s2 +{ + +extern std::array, code_count> const code_list +{{ + { 0x17, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x18, opcode::OP_EvalSelfFieldVariable }, + { 0x19, opcode::OP_Return }, + { 0x1A, opcode::OP_CallBuiltin0 }, + { 0x1B, opcode::OP_CallBuiltin1 }, + { 0x1C, opcode::OP_CallBuiltin2 }, + { 0x1D, opcode::OP_CallBuiltin3 }, + { 0x1E, opcode::OP_CallBuiltin4 }, + { 0x1F, opcode::OP_CallBuiltin5 }, + { 0x20, opcode::OP_CallBuiltin }, + { 0x21, opcode::OP_BoolNot }, + { 0x22, opcode::OP_ScriptFarMethodThreadCall }, + { 0x23, opcode::OP_JumpOnTrueExpr }, + { 0x24, opcode::OP_SetLevelFieldVariableField }, + { 0x25, opcode::OP_CastBool }, + { 0x26, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x27, opcode::OP_CallBuiltinPointer }, + { 0x28, opcode::OP_inequality }, + { 0x29, opcode::OP_GetThisthread }, + { 0x2A, opcode::OP_ClearFieldVariable }, + { 0x2B, opcode::OP_GetFloat }, + { 0x2C, opcode::OP_SafeCreateVariableFieldCached }, + { 0x2D, opcode::OP_ScriptFarFunctionCall2 }, + { 0x2E, opcode::OP_ScriptFarFunctionCall }, + { 0x2F, opcode::OP_ScriptFarChildThreadCall }, + { 0x30, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x31, opcode::OP_ClearLocalVariableFieldCached }, + { 0x32, opcode::OP_checkclearparams }, + { 0x33, opcode::OP_CastFieldObject }, + { 0x34, opcode::OP_End }, + { 0x35, opcode::OP_size }, + { 0x36, opcode::OP_EmptyArray }, + { 0x37, opcode::OP_bit_and }, + { 0x38, opcode::OP_less_equal }, + { 0x39, opcode::OP_voidCodepos }, + { 0x3A, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3B, opcode::OP_endswitch }, + { 0x3C, opcode::OP_ClearVariableField }, + { 0x3D, opcode::OP_divide }, + { 0x3E, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x3F, opcode::OP_GetUnsignedShort }, + { 0x40, opcode::OP_JumpOnTrue }, + { 0x41, opcode::OP_GetSelf }, + { 0x42, opcode::OP_ScriptFarThreadCall }, + { 0x43, opcode::OP_ScriptLocalThreadCall }, + { 0x44, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x45, opcode::OP_SetLocalVariableFieldCached }, + { 0x46, opcode::OP_plus }, + { 0x47, opcode::OP_BoolComplement }, + { 0x48, opcode::OP_ScriptMethodCallPointer }, + { 0x49, opcode::OP_inc }, + { 0x4A, opcode::OP_RemoveLocalVariables }, + { 0x4B, opcode::OP_JumpOnFalseExpr }, + { 0x4C, opcode::OP_switch }, + { 0x4D, opcode::OP_clearparams }, + { 0x4E, opcode::OP_EvalLocalVariableRefCached0 }, + { 0x4F, opcode::OP_EvalLocalVariableRefCached }, + { 0x50, opcode::OP_ScriptLocalMethodCall }, + { 0x51, opcode::OP_EvalFieldVariable }, + { 0x52, opcode::OP_EvalFieldVariableRef }, + { 0x53, opcode::OP_GetString }, + { 0x54, opcode::OP_ScriptFunctionCallPointer }, + { 0x55, opcode::OP_EvalLevelFieldVariable }, + { 0x56, opcode::OP_GetVector }, + { 0x57, opcode::OP_endon }, + { 0x58, opcode::OP_greater_equal }, + { 0x59, opcode::OP_GetSelfObject }, + { 0x5A, opcode::OP_SetAnimFieldVariableField }, + { 0x5B, opcode::OP_SetVariableField }, + { 0x5C, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x5D, opcode::OP_ScriptLocalFunctionCall }, + { 0x5E, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x5F, opcode::OP_EvalLocalArrayRefCached }, + { 0x60, opcode::OP_GetFarFunction }, + { 0x61, opcode::OP_less }, + { 0x62, opcode::OP_GetGameRef }, + { 0x63, opcode::OP_waittillFrameEnd }, + { 0x64, opcode::OP_waitframe }, + { 0x65, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x66, opcode::OP_SafeSetVariableFieldCached }, + { 0x67, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x68, opcode::OP_GetLevel }, + { 0x69, opcode::OP_notify }, + { 0x6A, opcode::OP_DecTop }, + { 0x6B, opcode::OP_shift_left }, + { 0x6C, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x6D, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x6E, opcode::OP_greater }, + { 0x6F, opcode::OP_EvalLocalVariableCached0 }, + { 0x70, opcode::OP_EvalLocalVariableCached1 }, + { 0x71, opcode::OP_EvalLocalVariableCached2 }, + { 0x72, opcode::OP_EvalLocalVariableCached3 }, + { 0x73, opcode::OP_EvalLocalVariableCached4 }, + { 0x74, opcode::OP_EvalLocalVariableCached5 }, + { 0x75, opcode::OP_EvalLocalVariableCached }, + { 0x76, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x77, opcode::OP_jump }, + { 0x78, opcode::OP_ScriptThreadCallPointer }, + { 0x79, opcode::OP_GetZero }, + { 0x7A, opcode::OP_wait }, + { 0x7B, opcode::OP_minus }, + { 0x7C, opcode::OP_SetSelfFieldVariableField }, + { 0x7D, opcode::OP_EvalNewLocalVariableRefCached0 }, + { 0x7E, opcode::OP_multiply }, + { 0x7F, opcode::OP_CreateLocalVariable }, + { 0x80, opcode::OP_ScriptLocalChildThreadCall }, + { 0x81, opcode::OP_GetInteger }, + { 0x82, opcode::OP_mod }, + { 0x83, opcode::OP_EvalAnimFieldVariableRef }, + { 0x84, opcode::OP_GetBuiltinFunction }, + { 0x85, opcode::OP_GetGame }, + { 0x86, opcode::OP_waittill }, + { 0x87, opcode::OP_dec }, + { 0x88, opcode::OP_EvalLocalVariableObjectCached }, + { 0x89, opcode::OP_PreScriptCall }, + { 0x8A, opcode::OP_GetAnim }, + { 0x8B, opcode::OP_GetUndefined }, + { 0x8C, opcode::OP_EvalLevelFieldVariableRef }, + { 0x8D, opcode::OP_GetAnimObject }, + { 0x8E, opcode::OP_GetLevelObject }, + { 0x8F, opcode::OP_bit_ex_or }, + { 0x90, opcode::OP_equality }, + { 0x91, opcode::OP_ClearArray }, + { 0x92, opcode::OP_jumpback }, + { 0x93, opcode::OP_GetAnimation }, + { 0x94, opcode::OP_EvalAnimFieldVariable }, + { 0x95, opcode::OP_GetAnimTree }, + { 0x96, opcode::OP_GetIString }, + { 0x97, opcode::OP_EvalArrayRef }, + { 0x98, opcode::OP_EvalSelfFieldVariableRef }, + { 0x99, opcode::OP_GetNegByte }, + { 0x9A, opcode::OP_GetBuiltinMethod }, + { 0x9B, opcode::OP_CallBuiltinMethodPointer }, + { 0x9C, opcode::OP_EvalArray }, + { 0x9D, opcode::OP_vector }, + { 0x9E, opcode::OP_ScriptFarMethodCall }, + { 0x9F, opcode::OP_EvalLocalArrayCached }, + { 0xA0, opcode::OP_GetByte }, + { 0xA1, opcode::OP_ScriptChildThreadCallPointer }, + { 0xA2, opcode::OP_bit_or }, + { 0xA3, opcode::OP_AddArray }, + { 0xA4, opcode::OP_waittillmatch2 }, + { 0xA5, opcode::OP_waittillmatch }, + { 0xA6, opcode::OP_GetLocalFunction }, + { 0xA7, opcode::OP_GetNegUnsignedShort }, + { 0xA8, opcode::OP_shift_right }, + { 0xA9, opcode::OP_CallBuiltinMethod0 }, + { 0xAA, opcode::OP_CallBuiltinMethod1 }, + { 0xAB, opcode::OP_CallBuiltinMethod2 }, + { 0xAC, opcode::OP_CallBuiltinMethod3 }, + { 0xAD, opcode::OP_CallBuiltinMethod4 }, + { 0xAE, opcode::OP_CallBuiltinMethod5 }, + { 0xAF, opcode::OP_CallBuiltinMethod }, + { 0xB0, opcode::OP_JumpOnFalse }, + { 0xB1, opcode::OP_BoolNotAfterAnd }, +}}; + +} // namespace xsk::gsc::s2 diff --git a/src/s2/s2_func.cpp b/src/s2/s2_func.cpp new file mode 100644 index 00000000..8cc6b6e0 --- /dev/null +++ b/src/s2/s2_func.cpp @@ -0,0 +1,1015 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s2.hpp" + +namespace xsk::gsc::s2 +{ + +extern std::array, func_count> const func_list +{{ + { 0x001, "_func_001" }, + { 0x002, "_func_002" }, + { 0x003, "_func_003" }, + { 0x004, "_func_004" }, + { 0x005, "_func_005" }, + { 0x006, "_func_006" }, + { 0x007, "_func_007" }, + { 0x008, "_func_008" }, + { 0x009, "_func_009" }, + { 0x00A, "_func_00A" }, + { 0x00B, "_func_00B" }, + { 0x00C, "_func_00C" }, + { 0x00D, "_func_00D" }, + { 0x00E, "_func_00E" }, + { 0x00F, "_func_00F" }, + { 0x010, "_func_010" }, + { 0x011, "_func_011" }, + { 0x012, "_func_012" }, + { 0x013, "_func_013" }, + { 0x014, "_func_014" }, + { 0x015, "_func_015" }, + { 0x016, "_func_016" }, + { 0x017, "_func_017" }, + { 0x018, "_func_018" }, + { 0x019, "_func_019" }, + { 0x01A, "_func_01A" }, + { 0x01B, "_func_01B" }, + { 0x01C, "_func_01C" }, + { 0x01D, "_func_01D" }, + { 0x01E, "_func_01E" }, + { 0x01F, "_func_01F" }, + { 0x020, "_func_020" }, + { 0x021, "_func_021" }, + { 0x022, "_func_022" }, + { 0x023, "_func_023" }, + { 0x024, "_func_024" }, + { 0x025, "_func_025" }, + { 0x026, "_func_026" }, + { 0x027, "_func_027" }, + { 0x028, "_func_028" }, + { 0x029, "_func_029" }, + { 0x02A, "_func_02A" }, + { 0x02B, "_func_02B" }, + { 0x02C, "_func_02C" }, + { 0x02D, "_func_02D" }, + { 0x02E, "isdefined" }, + { 0x02F, "_func_02F" }, + { 0x030, "_func_030" }, + { 0x031, "_func_031" }, + { 0x032, "_func_032" }, + { 0x033, "_func_033" }, + { 0x034, "_func_034" }, + { 0x035, "_func_035" }, + { 0x036, "_func_036" }, + { 0x037, "_func_037" }, + { 0x038, "_func_038" }, + { 0x039, "_func_039" }, + { 0x03A, "_func_03A" }, + { 0x03B, "_func_03B" }, + { 0x03C, "_func_03C" }, + { 0x03D, "_func_03D" }, + { 0x03E, "_func_03E" }, + { 0x03F, "_func_03F" }, + { 0x040, "_func_040" }, + { 0x041, "_func_041" }, + { 0x042, "_func_042" }, + { 0x043, "_func_043" }, + { 0x044, "_func_044" }, + { 0x045, "_func_045" }, + { 0x046, "_func_046" }, + { 0x047, "_func_047" }, + { 0x048, "_func_048" }, + { 0x049, "_func_049" }, + { 0x04A, "_func_04A" }, + { 0x04B, "_func_04B" }, + { 0x04C, "_func_04C" }, + { 0x04D, "_func_04D" }, + { 0x04E, "_func_04E" }, + { 0x04F, "_func_04F" }, + { 0x050, "_func_050" }, + { 0x051, "_func_051" }, + { 0x052, "_func_052" }, + { 0x053, "_func_053" }, + { 0x054, "_func_054" }, + { 0x055, "_func_055" }, + { 0x056, "_func_056" }, + { 0x057, "_func_057" }, + { 0x058, "_func_058" }, + { 0x059, "_func_059" }, + { 0x05A, "_func_05A" }, + { 0x05B, "_func_05B" }, + { 0x05C, "_func_05C" }, + { 0x05D, "_func_05D" }, + { 0x05E, "_func_05E" }, + { 0x05F, "_func_05F" }, + { 0x060, "_func_060" }, + { 0x061, "_func_061" }, + { 0x062, "_func_062" }, + { 0x063, "_func_063" }, + { 0x064, "_func_064" }, + { 0x065, "_func_065" }, + { 0x066, "_func_066" }, + { 0x067, "_func_067" }, + { 0x068, "_func_068" }, + { 0x069, "_func_069" }, + { 0x06A, "_func_06A" }, + { 0x06B, "_func_06B" }, + { 0x06C, "_func_06C" }, + { 0x06D, "_func_06D" }, + { 0x06E, "_func_06E" }, + { 0x06F, "_func_06F" }, + { 0x070, "_func_070" }, + { 0x071, "_func_071" }, + { 0x072, "_func_072" }, + { 0x073, "_func_073" }, + { 0x074, "_func_074" }, + { 0x075, "_func_075" }, + { 0x076, "_func_076" }, + { 0x077, "_func_077" }, + { 0x078, "_func_078" }, + { 0x079, "_func_079" }, + { 0x07A, "_func_07A" }, + { 0x07B, "_func_07B" }, + { 0x07C, "_func_07C" }, + { 0x07D, "_func_07D" }, + { 0x07E, "_func_07E" }, + { 0x07F, "_func_07F" }, + { 0x080, "_func_080" }, + { 0x081, "_func_081" }, + { 0x082, "_func_082" }, + { 0x083, "_func_083" }, + { 0x084, "_func_084" }, + { 0x085, "_func_085" }, + { 0x086, "_func_086" }, + { 0x087, "_func_087" }, + { 0x088, "_func_088" }, + { 0x089, "_func_089" }, + { 0x08A, "_func_08A" }, + { 0x08B, "_func_08B" }, + { 0x08C, "_func_08C" }, + { 0x08D, "_func_08D" }, + { 0x08E, "_func_08E" }, + { 0x08F, "_func_08F" }, + { 0x090, "_func_090" }, + { 0x091, "_func_091" }, + { 0x092, "_func_092" }, + { 0x093, "_func_093" }, + { 0x094, "_func_094" }, + { 0x095, "_func_095" }, + { 0x096, "_func_096" }, + { 0x097, "_func_097" }, + { 0x098, "_func_098" }, + { 0x099, "_func_099" }, + { 0x09A, "_func_09A" }, + { 0x09B, "_func_09B" }, + { 0x09C, "_func_09C" }, + { 0x09D, "_func_09D" }, + { 0x09E, "_func_09E" }, + { 0x09F, "_func_09F" }, + { 0x0A0, "_func_0A0" }, + { 0x0A1, "_func_0A1" }, + { 0x0A2, "_func_0A2" }, + { 0x0A3, "_func_0A3" }, + { 0x0A4, "_func_0A4" }, + { 0x0A5, "_func_0A5" }, + { 0x0A6, "_func_0A6" }, + { 0x0A7, "_func_0A7" }, + { 0x0A8, "_func_0A8" }, + { 0x0A9, "_func_0A9" }, + { 0x0AA, "_func_0AA" }, + { 0x0AB, "_func_0AB" }, + { 0x0AC, "_func_0AC" }, + { 0x0AD, "_func_0AD" }, + { 0x0AE, "_func_0AE" }, + { 0x0AF, "_func_0AF" }, + { 0x0B0, "_func_0B0" }, + { 0x0B1, "_func_0B1" }, + { 0x0B2, "_func_0B2" }, + { 0x0B3, "_func_0B3" }, + { 0x0B4, "_func_0B4" }, + { 0x0B5, "_func_0B5" }, + { 0x0B6, "_func_0B6" }, + { 0x0B7, "_func_0B7" }, + { 0x0B8, "_func_0B8" }, + { 0x0B9, "_func_0B9" }, + { 0x0BA, "_func_0BA" }, + { 0x0BB, "_func_0BB" }, + { 0x0BC, "_func_0BC" }, + { 0x0BD, "_func_0BD" }, + { 0x0BE, "_func_0BE" }, + { 0x0BF, "_func_0BF" }, + { 0x0C0, "_func_0C0" }, + { 0x0C1, "_func_0C1" }, + { 0x0C2, "_func_0C2" }, + { 0x0C3, "_func_0C3" }, + { 0x0C4, "_func_0C4" }, + { 0x0C5, "_func_0C5" }, + { 0x0C6, "_func_0C6" }, + { 0x0C7, "_func_0C7" }, + { 0x0C8, "_func_0C8" }, + { 0x0C9, "_func_0C9" }, + { 0x0CA, "_func_0CA" }, + { 0x0CB, "_func_0CB" }, + { 0x0CC, "_func_0CC" }, + { 0x0CD, "_func_0CD" }, + { 0x0CE, "_func_0CE" }, + { 0x0CF, "_func_0CF" }, + { 0x0D0, "_func_0D0" }, + { 0x0D1, "_func_0D1" }, + { 0x0D2, "_func_0D2" }, + { 0x0D3, "_func_0D3" }, + { 0x0D4, "_func_0D4" }, + { 0x0D5, "_func_0D5" }, + { 0x0D6, "_func_0D6" }, + { 0x0D7, "_func_0D7" }, + { 0x0D8, "_func_0D8" }, + { 0x0D9, "_func_0D9" }, + { 0x0DA, "_func_0DA" }, + { 0x0DB, "_func_0DB" }, + { 0x0DC, "_func_0DC" }, + { 0x0DD, "_func_0DD" }, + { 0x0DE, "_func_0DE" }, + { 0x0DF, "_func_0DF" }, + { 0x0E0, "_func_0E0" }, + { 0x0E1, "_func_0E1" }, + { 0x0E2, "_func_0E2" }, + { 0x0E3, "_func_0E3" }, + { 0x0E4, "_func_0E4" }, + { 0x0E5, "_func_0E5" }, + { 0x0E6, "_func_0E6" }, + { 0x0E7, "_func_0E7" }, + { 0x0E8, "_func_0E8" }, + { 0x0E9, "_func_0E9" }, + { 0x0EA, "_func_0EA" }, + { 0x0EB, "_func_0EB" }, + { 0x0EC, "_func_0EC" }, + { 0x0ED, "_func_0ED" }, + { 0x0EE, "_func_0EE" }, + { 0x0EF, "_func_0EF" }, + { 0x0F0, "_func_0F0" }, + { 0x0F1, "_func_0F1" }, + { 0x0F2, "_func_0F2" }, + { 0x0F3, "_func_0F3" }, + { 0x0F4, "_func_0F4" }, + { 0x0F5, "_func_0F5" }, + { 0x0F6, "_func_0F6" }, + { 0x0F7, "_func_0F7" }, + { 0x0F8, "_func_0F8" }, + { 0x0F9, "_func_0F9" }, + { 0x0FA, "_func_0FA" }, + { 0x0FB, "_func_0FB" }, + { 0x0FC, "_func_0FC" }, + { 0x0FD, "_func_0FD" }, + { 0x0FE, "_func_0FE" }, + { 0x0FF, "_func_0FF" }, + { 0x100, "_func_100" }, + { 0x101, "_func_101" }, + { 0x102, "_func_102" }, + { 0x103, "_func_103" }, + { 0x104, "_func_104" }, + { 0x105, "_func_105" }, + { 0x106, "_func_106" }, + { 0x107, "_func_107" }, + { 0x108, "_func_108" }, + { 0x109, "_func_109" }, + { 0x10A, "_func_10A" }, + { 0x10B, "_func_10B" }, + { 0x10C, "_func_10C" }, + { 0x10D, "_func_10D" }, + { 0x10E, "_func_10E" }, + { 0x10F, "_func_10F" }, + { 0x110, "_func_110" }, + { 0x111, "_func_111" }, + { 0x112, "_func_112" }, + { 0x113, "_func_113" }, + { 0x114, "_func_114" }, + { 0x115, "_func_115" }, + { 0x116, "_func_116" }, + { 0x117, "_func_117" }, + { 0x118, "_func_118" }, + { 0x119, "_func_119" }, + { 0x11A, "_func_11A" }, + { 0x11B, "_func_11B" }, + { 0x11C, "_func_11C" }, + { 0x11D, "_func_11D" }, + { 0x11E, "_func_11E" }, + { 0x11F, "_func_11F" }, + { 0x120, "_func_120" }, + { 0x121, "_func_121" }, + { 0x122, "_func_122" }, + { 0x123, "_func_123" }, + { 0x124, "_func_124" }, + { 0x125, "_func_125" }, + { 0x126, "_func_126" }, + { 0x127, "_func_127" }, + { 0x128, "_func_128" }, + { 0x129, "_func_129" }, + { 0x12A, "_func_12A" }, + { 0x12B, "_func_12B" }, + { 0x12C, "_func_12C" }, + { 0x12D, "_func_12D" }, + { 0x12E, "_func_12E" }, + { 0x12F, "_func_12F" }, + { 0x130, "_func_130" }, + { 0x131, "_func_131" }, + { 0x132, "_func_132" }, + { 0x133, "_func_133" }, + { 0x134, "_func_134" }, + { 0x135, "_func_135" }, + { 0x136, "_func_136" }, + { 0x137, "_func_137" }, + { 0x138, "_func_138" }, + { 0x139, "_func_139" }, + { 0x13A, "_func_13A" }, + { 0x13B, "_func_13B" }, + { 0x13C, "_func_13C" }, + { 0x13D, "_func_13D" }, + { 0x13E, "_func_13E" }, + { 0x13F, "_func_13F" }, + { 0x140, "_func_140" }, + { 0x141, "_func_141" }, + { 0x142, "_func_142" }, + { 0x143, "_func_143" }, + { 0x144, "_func_144" }, + { 0x145, "_func_145" }, + { 0x146, "_func_146" }, + { 0x147, "_func_147" }, + { 0x148, "_func_148" }, + { 0x149, "_func_149" }, + { 0x14A, "_func_14A" }, + { 0x14B, "_func_14B" }, + { 0x14C, "_func_14C" }, + { 0x14D, "_func_14D" }, + { 0x14E, "_func_14E" }, + { 0x14F, "_func_14F" }, + { 0x150, "_func_150" }, + { 0x151, "_func_151" }, + { 0x152, "_func_152" }, + { 0x153, "_func_153" }, + { 0x154, "_func_154" }, + { 0x155, "_func_155" }, + { 0x156, "_func_156" }, + { 0x157, "_func_157" }, + { 0x158, "_func_158" }, + { 0x159, "_func_159" }, + { 0x15A, "_func_15A" }, + { 0x15B, "_func_15B" }, + { 0x15C, "_func_15C" }, + { 0x15D, "_func_15D" }, + { 0x15E, "_func_15E" }, + { 0x15F, "_func_15F" }, + { 0x160, "_func_160" }, + { 0x161, "_func_161" }, + { 0x162, "_func_162" }, + { 0x163, "_func_163" }, + { 0x164, "_func_164" }, + { 0x165, "_func_165" }, + { 0x166, "_func_166" }, + { 0x167, "_func_167" }, + { 0x168, "_func_168" }, + { 0x169, "_func_169" }, + { 0x16A, "_func_16A" }, + { 0x16B, "_func_16B" }, + { 0x16C, "_func_16C" }, + { 0x16D, "_func_16D" }, + { 0x16E, "_func_16E" }, + { 0x16F, "_func_16F" }, + { 0x170, "_func_170" }, + { 0x171, "_func_171" }, + { 0x172, "_func_172" }, + { 0x173, "_func_173" }, + { 0x174, "_func_174" }, + { 0x175, "_func_175" }, + { 0x176, "_func_176" }, + { 0x177, "_func_177" }, + { 0x178, "_func_178" }, + { 0x179, "_func_179" }, + { 0x17A, "_func_17A" }, + { 0x17B, "_func_17B" }, + { 0x17C, "_func_17C" }, + { 0x17D, "_func_17D" }, + { 0x17E, "_func_17E" }, + { 0x17F, "_func_17F" }, + { 0x180, "_func_180" }, + { 0x181, "_func_181" }, + { 0x182, "_func_182" }, + { 0x183, "_func_183" }, + { 0x184, "_func_184" }, + { 0x185, "_func_185" }, + { 0x186, "_func_186" }, + { 0x187, "_func_187" }, + { 0x188, "_func_188" }, + { 0x189, "_func_189" }, + { 0x18A, "_func_18A" }, + { 0x18B, "_func_18B" }, + { 0x18C, "_func_18C" }, + { 0x18D, "_func_18D" }, + { 0x18E, "_func_18E" }, + { 0x18F, "_func_18F" }, + { 0x190, "_func_190" }, + { 0x191, "_func_191" }, + { 0x192, "_func_192" }, + { 0x193, "_func_193" }, + { 0x194, "_func_194" }, + { 0x195, "_func_195" }, + { 0x196, "_func_196" }, + { 0x197, "_func_197" }, + { 0x198, "_func_198" }, + { 0x199, "_func_199" }, + { 0x19A, "_func_19A" }, + { 0x19B, "_func_19B" }, + { 0x19C, "_func_19C" }, + { 0x19D, "_func_19D" }, + { 0x19E, "_func_19E" }, + { 0x19F, "_func_19F" }, + { 0x1A0, "_func_1A0" }, + { 0x1A1, "_func_1A1" }, + { 0x1A2, "_func_1A2" }, + { 0x1A3, "_func_1A3" }, + { 0x1A4, "_func_1A4" }, + { 0x1A5, "_func_1A5" }, + { 0x1A6, "_func_1A6" }, + { 0x1A7, "_func_1A7" }, + { 0x1A8, "_func_1A8" }, + { 0x1A9, "_func_1A9" }, + { 0x1AA, "_func_1AA" }, + { 0x1AB, "getnextarraykey" }, + { 0x1AC, "_func_1AC" }, + { 0x1AD, "_func_1AD" }, + { 0x1AE, "_func_1AE" }, + { 0x1AF, "_func_1AF" }, + { 0x1B0, "_func_1B0" }, + { 0x1B1, "_func_1B1" }, + { 0x1B2, "_func_1B2" }, + { 0x1B3, "_func_1B3" }, + { 0x1B4, "_func_1B4" }, + { 0x1B5, "_func_1B5" }, + { 0x1B6, "_func_1B6" }, + { 0x1B7, "_func_1B7" }, + { 0x1B8, "_func_1B8" }, + { 0x1B9, "_func_1B9" }, + { 0x1BA, "_func_1BA" }, + { 0x1BB, "_func_1BB" }, + { 0x1BC, "_func_1BC" }, + { 0x1BD, "_func_1BD" }, + { 0x1BE, "_func_1BE" }, + { 0x1BF, "_func_1BF" }, + { 0x1C0, "_func_1C0" }, + { 0x1C1, "_func_1C1" }, + { 0x1C2, "_func_1C2" }, + { 0x1C3, "_func_1C3" }, + { 0x1C4, "_func_1C4" }, + { 0x1C5, "_func_1C5" }, + { 0x1C6, "_func_1C6" }, + { 0x1C7, "getfirstarraykey" }, + { 0x1C8, "_func_1C8" }, + { 0x1C9, "_func_1C9" }, + { 0x1CA, "_func_1CA" }, + { 0x1CB, "_func_1CB" }, + { 0x1CC, "_func_1CC" }, + { 0x1CD, "_func_1CD" }, + { 0x1CE, "_func_1CE" }, + { 0x1CF, "_func_1CF" }, + { 0x1D0, "_func_1D0" }, + { 0x1D1, "_func_1D1" }, + { 0x1D2, "_func_1D2" }, + { 0x1D3, "_func_1D3" }, + { 0x1D4, "_func_1D4" }, + { 0x1D5, "_func_1D5" }, + { 0x1D6, "_func_1D6" }, + { 0x1D7, "_func_1D7" }, + { 0x1D8, "_func_1D8" }, + { 0x1D9, "_func_1D9" }, + { 0x1DA, "_func_1DA" }, + { 0x1DB, "_func_1DB" }, + { 0x1DC, "_func_1DC" }, + { 0x1DD, "_func_1DD" }, + { 0x1DE, "_func_1DE" }, + { 0x1DF, "_func_1DF" }, + { 0x1E0, "_func_1E0" }, + { 0x1E1, "_func_1E1" }, + { 0x1E2, "_func_1E2" }, + { 0x1E3, "_func_1E3" }, + { 0x1E4, "_func_1E4" }, + { 0x1E5, "_func_1E5" }, + { 0x1E6, "_func_1E6" }, + { 0x1E7, "_func_1E7" }, + { 0x1E8, "_func_1E8" }, + { 0x1E9, "_func_1E9" }, + { 0x1EA, "_func_1EA" }, + { 0x1EB, "_func_1EB" }, + { 0x1EC, "_func_1EC" }, + { 0x1ED, "_func_1ED" }, + { 0x1EE, "_func_1EE" }, + { 0x1EF, "_func_1EF" }, + { 0x1F0, "_func_1F0" }, + { 0x1F1, "_func_1F1" }, + { 0x1F2, "_func_1F2" }, + { 0x1F3, "_func_1F3" }, + { 0x1F4, "_func_1F4" }, + { 0x1F5, "_func_1F5" }, + { 0x1F6, "_func_1F6" }, + { 0x1F7, "_func_1F7" }, + { 0x1F8, "_func_1F8" }, + { 0x1F9, "_func_1F9" }, + { 0x1FA, "_func_1FA" }, + { 0x1FB, "_func_1FB" }, + { 0x1FC, "_func_1FC" }, + { 0x1FD, "_func_1FD" }, + { 0x1FE, "_func_1FE" }, + { 0x1FF, "_func_1FF" }, + { 0x200, "_func_200" }, + { 0x201, "_func_201" }, + { 0x202, "_func_202" }, + { 0x203, "_func_203" }, + { 0x204, "_func_204" }, + { 0x205, "_func_205" }, + { 0x206, "_func_206" }, + { 0x207, "_func_207" }, + { 0x208, "_func_208" }, + { 0x209, "_func_209" }, + { 0x20A, "_func_20A" }, + { 0x20B, "_func_20B" }, + { 0x20C, "_func_20C" }, + { 0x20D, "_func_20D" }, + { 0x20E, "_func_20E" }, + { 0x20F, "_func_20F" }, + { 0x210, "_func_210" }, + { 0x211, "_func_211" }, + { 0x212, "_func_212" }, + { 0x213, "_func_213" }, + { 0x214, "_func_214" }, + { 0x215, "_func_215" }, + { 0x216, "_func_216" }, + { 0x217, "_func_217" }, + { 0x218, "_func_218" }, + { 0x219, "_func_219" }, + { 0x21A, "_func_21A" }, + { 0x21B, "_func_21B" }, + { 0x21C, "_func_21C" }, + { 0x21D, "_func_21D" }, + { 0x21E, "_func_21E" }, + { 0x21F, "_func_21F" }, + { 0x220, "_func_220" }, + { 0x221, "_func_221" }, + { 0x222, "_func_222" }, + { 0x223, "_func_223" }, + { 0x224, "_func_224" }, + { 0x225, "_func_225" }, + { 0x226, "_func_226" }, + { 0x227, "_func_227" }, + { 0x228, "_func_228" }, + { 0x229, "_func_229" }, + { 0x22A, "_func_22A" }, + { 0x22B, "_func_22B" }, + { 0x22C, "_func_22C" }, + { 0x22D, "_func_22D" }, + { 0x22E, "_func_22E" }, + { 0x22F, "_func_22F" }, + { 0x230, "_func_230" }, + { 0x231, "_func_231" }, + { 0x232, "_func_232" }, + { 0x233, "_func_233" }, + { 0x234, "_func_234" }, + { 0x235, "_func_235" }, + { 0x236, "_func_236" }, + { 0x237, "_func_237" }, + { 0x238, "_func_238" }, + { 0x239, "_func_239" }, + { 0x23A, "_func_23A" }, + { 0x23B, "_func_23B" }, + { 0x23C, "_func_23C" }, + { 0x23D, "_func_23D" }, + { 0x23E, "_func_23E" }, + { 0x23F, "_func_23F" }, + { 0x240, "_func_240" }, + { 0x241, "_func_241" }, + { 0x242, "_func_242" }, + { 0x243, "_func_243" }, + { 0x244, "_func_244" }, + { 0x245, "_func_245" }, + { 0x246, "_func_246" }, + { 0x247, "_func_247" }, + { 0x248, "_func_248" }, + { 0x249, "_func_249" }, + { 0x24A, "_func_24A" }, + { 0x24B, "_func_24B" }, + { 0x24C, "_func_24C" }, + { 0x24D, "_func_24D" }, + { 0x24E, "_func_24E" }, + { 0x24F, "_func_24F" }, + { 0x250, "_func_250" }, + { 0x251, "_func_251" }, + { 0x252, "_func_252" }, + { 0x253, "_func_253" }, + { 0x254, "_func_254" }, + { 0x255, "_func_255" }, + { 0x256, "_func_256" }, + { 0x257, "_func_257" }, + { 0x258, "_func_258" }, + { 0x259, "_func_259" }, + { 0x25A, "_func_25A" }, + { 0x25B, "_func_25B" }, + { 0x25C, "_func_25C" }, + { 0x25D, "_func_25D" }, + { 0x25E, "_func_25E" }, + { 0x25F, "_func_25F" }, + { 0x260, "_func_260" }, + { 0x261, "_func_261" }, + { 0x262, "_func_262" }, + { 0x263, "_func_263" }, + { 0x264, "_func_264" }, + { 0x265, "_func_265" }, + { 0x266, "_func_266" }, + { 0x267, "_func_267" }, + { 0x268, "_func_268" }, + { 0x269, "_func_269" }, + { 0x26A, "_func_26A" }, + { 0x26B, "_func_26B" }, + { 0x26C, "_func_26C" }, + { 0x26D, "_func_26D" }, + { 0x26E, "_func_26E" }, + { 0x26F, "_func_26F" }, + { 0x270, "_func_270" }, + { 0x271, "_func_271" }, + { 0x272, "_func_272" }, + { 0x273, "_func_273" }, + { 0x274, "_func_274" }, + { 0x275, "_func_275" }, + { 0x276, "_func_276" }, + { 0x277, "_func_277" }, + { 0x278, "_func_278" }, + { 0x279, "_func_279" }, + { 0x27A, "_func_27A" }, + { 0x27B, "_func_27B" }, + { 0x27C, "_func_27C" }, + { 0x27D, "_func_27D" }, + { 0x27E, "_func_27E" }, + { 0x27F, "_func_27F" }, + { 0x280, "_func_280" }, + { 0x281, "_func_281" }, + { 0x282, "_func_282" }, + { 0x283, "_func_283" }, + { 0x284, "_func_284" }, + { 0x285, "_func_285" }, + { 0x286, "_func_286" }, + { 0x287, "_func_287" }, + { 0x288, "_func_288" }, + { 0x289, "_func_289" }, + { 0x28A, "_func_28A" }, + { 0x28B, "_func_28B" }, + { 0x28C, "_func_28C" }, + { 0x28D, "_func_28D" }, + { 0x28E, "_func_28E" }, + { 0x28F, "_func_28F" }, + { 0x290, "_func_290" }, + { 0x291, "_func_291" }, + { 0x292, "_func_292" }, + { 0x293, "_func_293" }, + { 0x294, "_func_294" }, + { 0x295, "_func_295" }, + { 0x296, "_func_296" }, + { 0x297, "_func_297" }, + { 0x298, "_func_298" }, + { 0x299, "_func_299" }, + { 0x29A, "_func_29A" }, + { 0x29B, "_func_29B" }, + { 0x29C, "_func_29C" }, + { 0x29D, "_func_29D" }, + { 0x29E, "_func_29E" }, + { 0x29F, "_func_29F" }, + { 0x2A0, "_func_2A0" }, + { 0x2A1, "_func_2A1" }, + { 0x2A2, "_func_2A2" }, + { 0x2A3, "_func_2A3" }, + { 0x2A4, "_func_2A4" }, + { 0x2A5, "_func_2A5" }, + { 0x2A6, "_func_2A6" }, + { 0x2A7, "_func_2A7" }, + { 0x2A8, "_func_2A8" }, + { 0x2A9, "_func_2A9" }, + { 0x2AA, "_func_2AA" }, + { 0x2AB, "_func_2AB" }, + { 0x2AC, "_func_2AC" }, + { 0x2AD, "_func_2AD" }, + { 0x2AE, "_func_2AE" }, + { 0x2AF, "_func_2AF" }, + { 0x2B0, "_func_2B0" }, + { 0x2B1, "_func_2B1" }, + { 0x2B2, "_func_2B2" }, + { 0x2B3, "_func_2B3" }, + { 0x2B4, "_func_2B4" }, + { 0x2B5, "_func_2B5" }, + { 0x2B6, "_func_2B6" }, + { 0x2B7, "_func_2B7" }, + { 0x2B8, "_func_2B8" }, + { 0x2B9, "_func_2B9" }, + { 0x2BA, "_func_2BA" }, + { 0x2BB, "_func_2BB" }, + { 0x2BC, "_func_2BC" }, + { 0x2BD, "_func_2BD" }, + { 0x2BE, "_func_2BE" }, + { 0x2BF, "_func_2BF" }, + { 0x2C0, "_func_2C0" }, + { 0x2C1, "_func_2C1" }, + { 0x2C2, "_func_2C2" }, + { 0x2C3, "_func_2C3" }, + { 0x2C4, "_func_2C4" }, + { 0x2C5, "_func_2C5" }, + { 0x2C6, "_func_2C6" }, + { 0x2C7, "_func_2C7" }, + { 0x2C8, "_func_2C8" }, + { 0x2C9, "_func_2C9" }, + { 0x2CA, "_func_2CA" }, + { 0x2CB, "_func_2CB" }, + { 0x2CC, "_func_2CC" }, + { 0x2CD, "_func_2CD" }, + { 0x2CE, "_func_2CE" }, + { 0x2CF, "_func_2CF" }, + { 0x2D0, "_func_2D0" }, + { 0x2D1, "_func_2D1" }, + { 0x2D2, "_func_2D2" }, + { 0x2D3, "_func_2D3" }, + { 0x2D4, "_func_2D4" }, + { 0x2D5, "_func_2D5" }, + { 0x2D6, "_func_2D6" }, + { 0x2D7, "_func_2D7" }, + { 0x2D8, "_func_2D8" }, + { 0x2D9, "_func_2D9" }, + { 0x2DA, "_func_2DA" }, + { 0x2DB, "_func_2DB" }, + { 0x2DC, "_func_2DC" }, + { 0x2DD, "_func_2DD" }, + { 0x2DE, "_func_2DE" }, + { 0x2DF, "_func_2DF" }, + { 0x2E0, "_func_2E0" }, + { 0x2E1, "_func_2E1" }, + { 0x2E2, "_func_2E2" }, + { 0x2E3, "_func_2E3" }, + { 0x2E4, "_func_2E4" }, + { 0x2E5, "_func_2E5" }, + { 0x2E6, "_func_2E6" }, + { 0x2E7, "_func_2E7" }, + { 0x2E8, "_func_2E8" }, + { 0x2E9, "_func_2E9" }, + { 0x2EA, "_func_2EA" }, + { 0x2EB, "_func_2EB" }, + { 0x2EC, "_func_2EC" }, + { 0x2ED, "_func_2ED" }, + { 0x2EE, "_func_2EE" }, + { 0x2EF, "_func_2EF" }, + { 0x2F0, "_func_2F0" }, + { 0x2F1, "_func_2F1" }, + { 0x2F2, "_func_2F2" }, + { 0x2F3, "_func_2F3" }, + { 0x2F4, "_func_2F4" }, + { 0x2F5, "_func_2F5" }, + { 0x2F6, "_func_2F6" }, + { 0x2F7, "_func_2F7" }, + { 0x2F8, "_func_2F8" }, + { 0x2F9, "_func_2F9" }, + { 0x2FA, "_func_2FA" }, + { 0x2FB, "_func_2FB" }, + { 0x2FC, "_func_2FC" }, + { 0x2FD, "_func_2FD" }, + { 0x2FE, "_func_2FE" }, + { 0x2FF, "_func_2FF" }, + { 0x300, "_func_300" }, + { 0x301, "_func_301" }, + { 0x302, "_func_302" }, + { 0x303, "_func_303" }, + { 0x304, "_func_304" }, + { 0x305, "_func_305" }, + { 0x306, "_func_306" }, + { 0x307, "_func_307" }, + { 0x308, "_func_308" }, + { 0x309, "_func_309" }, + { 0x30A, "_func_30A" }, + { 0x30B, "_func_30B" }, + { 0x30C, "_func_30C" }, + { 0x30D, "_func_30D" }, + { 0x30E, "_func_30E" }, + { 0x30F, "_func_30F" }, + { 0x310, "_func_310" }, + { 0x311, "_func_311" }, + { 0x312, "_func_312" }, + { 0x313, "_func_313" }, + { 0x314, "_func_314" }, + { 0x315, "_func_315" }, + { 0x316, "_func_316" }, + { 0x317, "_func_317" }, + { 0x318, "_func_318" }, + { 0x319, "_func_319" }, + { 0x31A, "_func_31A" }, + { 0x31B, "_func_31B" }, + { 0x31C, "_func_31C" }, + { 0x31D, "_func_31D" }, + { 0x31E, "_func_31E" }, + { 0x31F, "_func_31F" }, + { 0x320, "_func_320" }, + { 0x321, "_func_321" }, + { 0x322, "_func_322" }, + { 0x323, "_func_323" }, + { 0x324, "_func_324" }, + { 0x325, "_func_325" }, + { 0x326, "_func_326" }, + { 0x327, "_func_327" }, + { 0x328, "_func_328" }, + { 0x329, "_func_329" }, + { 0x32A, "_func_32A" }, + { 0x32B, "_func_32B" }, + { 0x32C, "_func_32C" }, + { 0x32D, "_func_32D" }, + { 0x32E, "_func_32E" }, + { 0x32F, "_func_32F" }, + { 0x330, "_func_330" }, + { 0x331, "_func_331" }, + { 0x332, "_func_332" }, + { 0x333, "_func_333" }, + { 0x334, "_func_334" }, + { 0x335, "_func_335" }, + { 0x336, "_func_336" }, + { 0x337, "_func_337" }, + { 0x338, "_func_338" }, + { 0x339, "_func_339" }, + { 0x33A, "_func_33A" }, + { 0x33B, "_func_33B" }, + { 0x33C, "_func_33C" }, + { 0x33D, "_func_33D" }, + { 0x33E, "_func_33E" }, + { 0x33F, "_func_33F" }, + { 0x340, "_func_340" }, + { 0x341, "_func_341" }, + { 0x342, "_func_342" }, + { 0x343, "_func_343" }, + { 0x344, "_func_344" }, + { 0x345, "_func_345" }, + { 0x346, "_func_346" }, + { 0x347, "_func_347" }, + { 0x348, "_func_348" }, + { 0x349, "_func_349" }, + { 0x34A, "_func_34A" }, + { 0x34B, "_func_34B" }, + { 0x34C, "_func_34C" }, + { 0x34D, "_func_34D" }, + { 0x34E, "_func_34E" }, + { 0x34F, "_func_34F" }, + { 0x350, "_func_350" }, + { 0x351, "_func_351" }, + { 0x352, "_func_352" }, + { 0x353, "_func_353" }, + { 0x354, "_func_354" }, + { 0x355, "_func_355" }, + { 0x356, "_func_356" }, + { 0x357, "_func_357" }, + { 0x358, "_func_358" }, + { 0x359, "_func_359" }, + { 0x35A, "_func_35A" }, + { 0x35B, "_func_35B" }, + { 0x35C, "_func_35C" }, + { 0x35D, "_func_35D" }, + { 0x35E, "_func_35E" }, + { 0x35F, "_func_35F" }, + { 0x360, "_func_360" }, + { 0x361, "_func_361" }, + { 0x362, "_func_362" }, + { 0x363, "_func_363" }, + { 0x364, "_func_364" }, + { 0x365, "_func_365" }, + { 0x366, "_func_366" }, + { 0x367, "_func_367" }, + { 0x368, "_func_368" }, + { 0x369, "_func_369" }, + { 0x36A, "_func_36A" }, + { 0x36B, "_func_36B" }, + { 0x36C, "_func_36C" }, + { 0x36D, "_func_36D" }, + { 0x36E, "_func_36E" }, + { 0x36F, "_func_36F" }, + { 0x370, "_func_370" }, + { 0x371, "_func_371" }, + { 0x372, "_func_372" }, + { 0x373, "_func_373" }, + { 0x374, "_func_374" }, + { 0x375, "_func_375" }, + { 0x376, "_func_376" }, + { 0x377, "_func_377" }, + { 0x378, "_func_378" }, + { 0x379, "_func_379" }, + { 0x37A, "_func_37A" }, + { 0x37B, "_func_37B" }, + { 0x37C, "_func_37C" }, + { 0x37D, "_func_37D" }, + { 0x37E, "_func_37E" }, + { 0x37F, "_func_37F" }, + { 0x380, "_func_380" }, + { 0x381, "_func_381" }, + { 0x382, "_func_382" }, + { 0x383, "_func_383" }, + { 0x384, "_func_384" }, + { 0x385, "_func_385" }, + { 0x386, "_func_386" }, + { 0x387, "_func_387" }, + { 0x388, "_func_388" }, + { 0x389, "_func_389" }, + { 0x38A, "_func_38A" }, + { 0x38B, "_func_38B" }, + { 0x38C, "_func_38C" }, + { 0x38D, "_func_38D" }, + { 0x38E, "_func_38E" }, + { 0x38F, "_func_38F" }, + { 0x390, "_func_390" }, + { 0x391, "_func_391" }, + { 0x392, "_func_392" }, + { 0x393, "_func_393" }, + { 0x394, "_func_394" }, + { 0x395, "_func_395" }, + { 0x396, "_func_396" }, + { 0x397, "_func_397" }, + { 0x398, "_func_398" }, + { 0x399, "_func_399" }, + { 0x39A, "_func_39A" }, + { 0x39B, "_func_39B" }, + { 0x39C, "_func_39C" }, + { 0x39D, "_func_39D" }, + { 0x39E, "_func_39E" }, + { 0x39F, "_func_39F" }, + { 0x3A0, "_func_3A0" }, + { 0x3A1, "_func_3A1" }, + { 0x3A2, "_func_3A2" }, + { 0x3A3, "_func_3A3" }, + { 0x3A4, "_func_3A4" }, + { 0x3A5, "_func_3A5" }, + { 0x3A6, "_func_3A6" }, + { 0x3A7, "_func_3A7" }, + { 0x3A8, "_func_3A8" }, + { 0x3A9, "_func_3A9" }, + { 0x3AA, "_func_3AA" }, + { 0x3AB, "_func_3AB" }, + { 0x3AC, "_func_3AC" }, + { 0x3AD, "_func_3AD" }, + { 0x3AE, "_func_3AE" }, + { 0x3AF, "_func_3AF" }, + { 0x3B0, "_func_3B0" }, + { 0x3B1, "_func_3B1" }, + { 0x3B2, "_func_3B2" }, + { 0x3B3, "_func_3B3" }, + { 0x3B4, "_func_3B4" }, + { 0x3B5, "_func_3B5" }, + { 0x3B6, "_func_3B6" }, + { 0x3B7, "_func_3B7" }, + { 0x3B8, "_func_3B8" }, + { 0x3B9, "_func_3B9" }, + { 0x3BA, "_func_3BA" }, + { 0x3BB, "_func_3BB" }, + { 0x3BC, "_func_3BC" }, + { 0x3BD, "_func_3BD" }, + { 0x3BE, "_func_3BE" }, + { 0x3BF, "_func_3BF" }, + { 0x3C0, "_func_3C0" }, + { 0x3C1, "_func_3C1" }, + { 0x3C2, "_func_3C2" }, + { 0x3C3, "_func_3C3" }, + { 0x3C4, "_func_3C4" }, + { 0x3C5, "_func_3C5" }, + { 0x3C6, "_func_3C6" }, + { 0x3C7, "_func_3C7" }, + { 0x3C8, "_func_3C8" }, + { 0x3C9, "_func_3C9" }, + { 0x3CA, "_func_3CA" }, + { 0x3CB, "_func_3CB" }, + { 0x3CC, "_func_3CC" }, + { 0x3CD, "_func_3CD" }, + { 0x3CE, "_func_3CE" }, + { 0x3CF, "_func_3CF" }, + { 0x3D0, "_func_3D0" }, + { 0x3D1, "_func_3D1" }, + { 0x3D2, "_func_3D2" }, + { 0x3D3, "_func_3D3" }, + { 0x3D4, "_func_3D4" }, + { 0x3D5, "_func_3D5" }, + { 0x3D6, "_func_3D6" }, + { 0x3D7, "_func_3D7" }, + { 0x3D8, "_func_3D8" }, + { 0x3D9, "_func_3D9" }, + { 0x3DA, "_func_3DA" }, + { 0x3DB, "_func_3DB" }, + { 0x3DC, "_func_3DC" }, + { 0x3DD, "_func_3DD" }, + { 0x3DE, "_func_3DE" }, + { 0x3DF, "_func_3DF" }, + { 0x3E0, "_func_3E0" }, + { 0x3E1, "_func_3E1" }, + { 0x3E2, "_func_3E2" }, + { 0x3E3, "_func_3E3" }, + { 0x3E4, "_func_3E4" }, + { 0x3E5, "_func_3E5" }, + { 0x3E6, "_func_3E6" }, + { 0x3E7, "_func_3E7" }, + { 0x3E8, "_func_3E8" }, +}}; + +} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/resolver.cpp b/src/s2/s2_meth.cpp similarity index 54% rename from src/s2/xsk/resolver.cpp rename to src/s2/s2_meth.cpp index 653560b4..f0bc4e99 100644 --- a/src/s2/xsk/resolver.cpp +++ b/src/s2/s2_meth.cpp @@ -1,1464 +1,14 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" #include "s2.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - namespace xsk::gsc::s2 { -std::unordered_map opcode_map; -std::unordered_map function_map; -std::unordered_map method_map; -std::unordered_map token_map; -std::unordered_map opcode_map_rev; -std::unordered_map function_map_rev; -std::unordered_map method_map_rev; -std::unordered_map token_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_func_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - const auto itr = function_map.find(id); - - if (itr != function_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_meth_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - const auto itr = method_map.find(id); - - if (itr != method_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_id_")) - { - return static_cast(std::stoul(name.substr(4), nullptr, 16)); - } - - const auto itr = token_map_rev.find(name); - - if (itr != token_map_rev.end()) - { - return itr->second; - } - - return 0; -} - -auto resolver::token_name(std::uint16_t id) -> std::string -{ - const auto itr = token_map.find(id); - - if (itr != token_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - } - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - } - - return false; -} - -void resolver::add_function(const std::string& name, std::uint16_t id) -{ - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - throw error(utils::string::va("builtin function '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - function_map.insert({ id, *str }); - function_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - function_map.insert({ id, *ins.first }); - function_map_rev.insert({ *ins.first, id }); - } - } -} - -void resolver::add_method(const std::string& name, std::uint16_t id) -{ - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - throw error(utils::string::va("builtin method '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - method_map.insert({ id, *str }); - method_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - method_map.insert({ id, *ins.first }); - method_map_rev.insert({ *ins.first, 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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -const std::array, 155> opcode_list -{{ - { 0x17, "OP_SetNewLocalVariableFieldCached0" }, - { 0x18, "OP_EvalSelfFieldVariable" }, - { 0x19, "OP_Return" }, - { 0x1A, "OP_CallBuiltin0" }, - { 0x1B, "OP_CallBuiltin1" }, - { 0x1C, "OP_CallBuiltin2" }, - { 0x1D, "OP_CallBuiltin3" }, - { 0x1E, "OP_CallBuiltin4" }, - { 0x1F, "OP_CallBuiltin5" }, - { 0x20, "OP_CallBuiltin" }, - { 0x21, "OP_BoolNot" }, - { 0x22, "OP_ScriptFarMethodThreadCall" }, - { 0x23, "OP_JumpOnTrueExpr" }, - { 0x24, "OP_SetLevelFieldVariableField" }, - { 0x25, "OP_CastBool" }, - { 0x26, "OP_EvalNewLocalArrayRefCached0" }, - { 0x27, "OP_CallBuiltinPointer" }, - { 0x28, "OP_inequality" }, - { 0x29, "OP_GetThisthread" }, - { 0x2A, "OP_ClearFieldVariable" }, - { 0x2B, "OP_GetFloat" }, - { 0x2C, "OP_SafeCreateVariableFieldCached" }, - { 0x2D, "OP_ScriptFarFunctionCall2" }, - { 0x2E, "OP_ScriptFarFunctionCall" }, - { 0x2F, "OP_ScriptFarChildThreadCall" }, - { 0x30, "OP_ClearLocalVariableFieldCached0" }, - { 0x31, "OP_ClearLocalVariableFieldCached" }, - { 0x32, "OP_checkclearparams" }, - { 0x33, "OP_CastFieldObject" }, - { 0x34, "OP_End" }, - { 0x35, "OP_size" }, - { 0x36, "OP_EmptyArray" }, - { 0x37, "OP_bit_and" }, - { 0x38, "OP_less_equal" }, - { 0x39, "OP_voidCodepos" }, - { 0x3A, "OP_ScriptMethodThreadCallPointer" }, - { 0x3B, "OP_endswitch" }, - { 0x3C, "OP_ClearVariableField" }, - { 0x3D, "OP_divide" }, - { 0x3E, "OP_ScriptFarMethodChildThreadCall" }, - { 0x3F, "OP_GetUnsignedShort" }, - { 0x40, "OP_JumpOnTrue" }, - { 0x41, "OP_GetSelf" }, - { 0x42, "OP_ScriptFarThreadCall" }, - { 0x43, "OP_ScriptLocalThreadCall" }, - { 0x44, "OP_SetLocalVariableFieldCached0" }, - { 0x45, "OP_SetLocalVariableFieldCached" }, - { 0x46, "OP_plus" }, - { 0x47, "OP_BoolComplement" }, - { 0x48, "OP_ScriptMethodCallPointer" }, - { 0x49, "OP_inc" }, - { 0x4A, "OP_RemoveLocalVariables" }, - { 0x4B, "OP_JumpOnFalseExpr" }, - { 0x4C, "OP_switch" }, - { 0x4D, "OP_clearparams" }, - { 0x4E, "OP_EvalLocalVariableRefCached0" }, - { 0x4F, "OP_EvalLocalVariableRefCached" }, - { 0x50, "OP_ScriptLocalMethodCall" }, - { 0x51, "OP_EvalFieldVariable" }, - { 0x52, "OP_EvalFieldVariableRef" }, - { 0x53, "OP_GetString" }, - { 0x54, "OP_ScriptFunctionCallPointer" }, - { 0x55, "OP_EvalLevelFieldVariable" }, - { 0x56, "OP_GetVector" }, - { 0x57, "OP_endon" }, - { 0x58, "OP_greater_equal" }, - { 0x59, "OP_GetSelfObject" }, - { 0x5A, "OP_SetAnimFieldVariableField" }, - { 0x5B, "OP_SetVariableField" }, - { 0x5C, "OP_ScriptLocalFunctionCall2" }, - { 0x5D, "OP_ScriptLocalFunctionCall" }, - { 0x5E, "OP_EvalLocalArrayRefCached0" }, - { 0x5F, "OP_EvalLocalArrayRefCached" }, - { 0x60, "OP_GetFarFunction" }, - { 0x61, "OP_less" }, - { 0x62, "OP_GetGameRef" }, - { 0x63, "OP_waittillFrameEnd" }, - { 0x64, "OP_waitFrame" }, - { 0x65, "OP_SafeSetVariableFieldCached0" }, - { 0x66, "OP_SafeSetVariableFieldCached" }, - { 0x67, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x68, "OP_GetLevel" }, - { 0x69, "OP_notify" }, - { 0x6A, "OP_DecTop" }, - { 0x6B, "OP_shift_left" }, - { 0x6C, "OP_ScriptLocalMethodThreadCall" }, - { 0x6D, "OP_ScriptLocalMethodChildThreadCall" }, - { 0x6E, "OP_greater" }, - { 0x6F, "OP_EvalLocalVariableCached0" }, - { 0x70, "OP_EvalLocalVariableCached1" }, - { 0x71, "OP_EvalLocalVariableCached2" }, - { 0x72, "OP_EvalLocalVariableCached3" }, - { 0x73, "OP_EvalLocalVariableCached4" }, - { 0x74, "OP_EvalLocalVariableCached5" }, - { 0x75, "OP_EvalLocalVariableCached" }, - { 0x76, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x77, "OP_jump" }, - { 0x78, "OP_ScriptThreadCallPointer" }, - { 0x79, "OP_GetZero" }, - { 0x7A, "OP_wait" }, - { 0x7B, "OP_minus" }, - { 0x7C, "OP_SetSelfFieldVariableField" }, - { 0x7D, "OP_EvalNewLocalVariableRefCached0" }, - { 0x7E, "OP_multiply" }, - { 0x7F, "OP_CreateLocalVariable" }, - { 0x80, "OP_ScriptLocalChildThreadCall" }, - { 0x81, "OP_GetInteger" }, - { 0x82, "OP_mod" }, - { 0x83, "OP_EvalAnimFieldVariableRef" }, - { 0x84, "OP_GetBuiltinFunction" }, - { 0x85, "OP_GetGame" }, - { 0x86, "OP_waittill" }, - { 0x87, "OP_dec" }, - { 0x88, "OP_EvalLocalVariableObjectCached" }, - { 0x89, "OP_PreScriptCall" }, - { 0x8A, "OP_GetAnim" }, - { 0x8B, "OP_GetUndefined" }, - { 0x8C, "OP_EvalLevelFieldVariableRef" }, - { 0x8D, "OP_GetAnimObject" }, - { 0x8E, "OP_GetLevelObject" }, - { 0x8F, "OP_bit_ex_or" }, - { 0x90, "OP_equality" }, - { 0x91, "OP_ClearArray" }, - { 0x92, "OP_jumpback" }, - { 0x93, "OP_GetAnimation" }, - { 0x94, "OP_EvalAnimFieldVariable" }, - { 0x95, "OP_GetAnimTree" }, - { 0x96, "OP_GetIString" }, - { 0x97, "OP_EvalArrayRef" }, - { 0x98, "OP_EvalSelfFieldVariableRef" }, - { 0x99, "OP_GetNegByte" }, - { 0x9A, "OP_GetBuiltinMethod" }, - { 0x9B, "OP_CallBuiltinMethodPointer" }, - { 0x9C, "OP_EvalArray" }, - { 0x9D, "OP_vector" }, - { 0x9E, "OP_ScriptFarMethodCall" }, - { 0x9F, "OP_EvalLocalArrayCached" }, - { 0xA0, "OP_GetByte" }, - { 0xA1, "OP_ScriptChildThreadCallPointer" }, - { 0xA2, "OP_bit_or" }, - { 0xA3, "OP_AddArray" }, - { 0xA4, "OP_waittillmatch2" }, - { 0xA5, "OP_waittillmatch" }, - { 0xA6, "OP_GetLocalFunction" }, - { 0xA7, "OP_GetNegUnsignedShort" }, - { 0xA8, "OP_shift_right" }, - { 0xA9, "OP_CallBuiltinMethod0" }, - { 0xAA, "OP_CallBuiltinMethod1" }, - { 0xAB, "OP_CallBuiltinMethod2" }, - { 0xAC, "OP_CallBuiltinMethod3" }, - { 0xAD, "OP_CallBuiltinMethod4" }, - { 0xAE, "OP_CallBuiltinMethod5" }, - { 0xAF, "OP_CallBuiltinMethod" }, - { 0xB0, "OP_JumpOnFalse" }, - { 0xB1, "OP_BoolNotAfterAnd" }, -}}; - -const std::array, 1000> function_list -{{ - { 0x001, "_func_001" }, - { 0x002, "_func_002" }, - { 0x003, "_func_003" }, - { 0x004, "_func_004" }, - { 0x005, "_func_005" }, - { 0x006, "_func_006" }, - { 0x007, "_func_007" }, - { 0x008, "_func_008" }, - { 0x009, "_func_009" }, - { 0x00A, "_func_00A" }, - { 0x00B, "_func_00B" }, - { 0x00C, "_func_00C" }, - { 0x00D, "_func_00D" }, - { 0x00E, "_func_00E" }, - { 0x00F, "_func_00F" }, - { 0x010, "_func_010" }, - { 0x011, "_func_011" }, - { 0x012, "_func_012" }, - { 0x013, "_func_013" }, - { 0x014, "_func_014" }, - { 0x015, "_func_015" }, - { 0x016, "_func_016" }, - { 0x017, "_func_017" }, - { 0x018, "_func_018" }, - { 0x019, "_func_019" }, - { 0x01A, "_func_01A" }, - { 0x01B, "_func_01B" }, - { 0x01C, "_func_01C" }, - { 0x01D, "_func_01D" }, - { 0x01E, "_func_01E" }, - { 0x01F, "_func_01F" }, - { 0x020, "_func_020" }, - { 0x021, "_func_021" }, - { 0x022, "_func_022" }, - { 0x023, "_func_023" }, - { 0x024, "_func_024" }, - { 0x025, "_func_025" }, - { 0x026, "_func_026" }, - { 0x027, "_func_027" }, - { 0x028, "_func_028" }, - { 0x029, "_func_029" }, - { 0x02A, "_func_02A" }, - { 0x02B, "_func_02B" }, - { 0x02C, "_func_02C" }, - { 0x02D, "_func_02D" }, - { 0x02E, "isdefined" }, - { 0x02F, "_func_02F" }, - { 0x030, "_func_030" }, - { 0x031, "_func_031" }, - { 0x032, "_func_032" }, - { 0x033, "_func_033" }, - { 0x034, "_func_034" }, - { 0x035, "_func_035" }, - { 0x036, "_func_036" }, - { 0x037, "_func_037" }, - { 0x038, "_func_038" }, - { 0x039, "_func_039" }, - { 0x03A, "_func_03A" }, - { 0x03B, "_func_03B" }, - { 0x03C, "_func_03C" }, - { 0x03D, "_func_03D" }, - { 0x03E, "_func_03E" }, - { 0x03F, "_func_03F" }, - { 0x040, "_func_040" }, - { 0x041, "_func_041" }, - { 0x042, "_func_042" }, - { 0x043, "_func_043" }, - { 0x044, "_func_044" }, - { 0x045, "_func_045" }, - { 0x046, "_func_046" }, - { 0x047, "_func_047" }, - { 0x048, "_func_048" }, - { 0x049, "_func_049" }, - { 0x04A, "_func_04A" }, - { 0x04B, "_func_04B" }, - { 0x04C, "_func_04C" }, - { 0x04D, "_func_04D" }, - { 0x04E, "_func_04E" }, - { 0x04F, "_func_04F" }, - { 0x050, "_func_050" }, - { 0x051, "_func_051" }, - { 0x052, "_func_052" }, - { 0x053, "_func_053" }, - { 0x054, "_func_054" }, - { 0x055, "_func_055" }, - { 0x056, "_func_056" }, - { 0x057, "_func_057" }, - { 0x058, "_func_058" }, - { 0x059, "_func_059" }, - { 0x05A, "_func_05A" }, - { 0x05B, "_func_05B" }, - { 0x05C, "_func_05C" }, - { 0x05D, "_func_05D" }, - { 0x05E, "_func_05E" }, - { 0x05F, "_func_05F" }, - { 0x060, "_func_060" }, - { 0x061, "_func_061" }, - { 0x062, "_func_062" }, - { 0x063, "_func_063" }, - { 0x064, "_func_064" }, - { 0x065, "_func_065" }, - { 0x066, "_func_066" }, - { 0x067, "_func_067" }, - { 0x068, "_func_068" }, - { 0x069, "_func_069" }, - { 0x06A, "_func_06A" }, - { 0x06B, "_func_06B" }, - { 0x06C, "_func_06C" }, - { 0x06D, "_func_06D" }, - { 0x06E, "_func_06E" }, - { 0x06F, "_func_06F" }, - { 0x070, "_func_070" }, - { 0x071, "_func_071" }, - { 0x072, "_func_072" }, - { 0x073, "_func_073" }, - { 0x074, "_func_074" }, - { 0x075, "_func_075" }, - { 0x076, "_func_076" }, - { 0x077, "_func_077" }, - { 0x078, "_func_078" }, - { 0x079, "_func_079" }, - { 0x07A, "_func_07A" }, - { 0x07B, "_func_07B" }, - { 0x07C, "_func_07C" }, - { 0x07D, "_func_07D" }, - { 0x07E, "_func_07E" }, - { 0x07F, "_func_07F" }, - { 0x080, "_func_080" }, - { 0x081, "_func_081" }, - { 0x082, "_func_082" }, - { 0x083, "_func_083" }, - { 0x084, "_func_084" }, - { 0x085, "_func_085" }, - { 0x086, "_func_086" }, - { 0x087, "_func_087" }, - { 0x088, "_func_088" }, - { 0x089, "_func_089" }, - { 0x08A, "_func_08A" }, - { 0x08B, "_func_08B" }, - { 0x08C, "_func_08C" }, - { 0x08D, "_func_08D" }, - { 0x08E, "_func_08E" }, - { 0x08F, "_func_08F" }, - { 0x090, "_func_090" }, - { 0x091, "_func_091" }, - { 0x092, "_func_092" }, - { 0x093, "_func_093" }, - { 0x094, "_func_094" }, - { 0x095, "_func_095" }, - { 0x096, "_func_096" }, - { 0x097, "_func_097" }, - { 0x098, "_func_098" }, - { 0x099, "_func_099" }, - { 0x09A, "_func_09A" }, - { 0x09B, "_func_09B" }, - { 0x09C, "_func_09C" }, - { 0x09D, "_func_09D" }, - { 0x09E, "_func_09E" }, - { 0x09F, "_func_09F" }, - { 0x0A0, "_func_0A0" }, - { 0x0A1, "_func_0A1" }, - { 0x0A2, "_func_0A2" }, - { 0x0A3, "_func_0A3" }, - { 0x0A4, "_func_0A4" }, - { 0x0A5, "_func_0A5" }, - { 0x0A6, "_func_0A6" }, - { 0x0A7, "_func_0A7" }, - { 0x0A8, "_func_0A8" }, - { 0x0A9, "_func_0A9" }, - { 0x0AA, "_func_0AA" }, - { 0x0AB, "_func_0AB" }, - { 0x0AC, "_func_0AC" }, - { 0x0AD, "_func_0AD" }, - { 0x0AE, "_func_0AE" }, - { 0x0AF, "_func_0AF" }, - { 0x0B0, "_func_0B0" }, - { 0x0B1, "_func_0B1" }, - { 0x0B2, "_func_0B2" }, - { 0x0B3, "_func_0B3" }, - { 0x0B4, "_func_0B4" }, - { 0x0B5, "_func_0B5" }, - { 0x0B6, "_func_0B6" }, - { 0x0B7, "_func_0B7" }, - { 0x0B8, "_func_0B8" }, - { 0x0B9, "_func_0B9" }, - { 0x0BA, "_func_0BA" }, - { 0x0BB, "_func_0BB" }, - { 0x0BC, "_func_0BC" }, - { 0x0BD, "_func_0BD" }, - { 0x0BE, "_func_0BE" }, - { 0x0BF, "_func_0BF" }, - { 0x0C0, "_func_0C0" }, - { 0x0C1, "_func_0C1" }, - { 0x0C2, "_func_0C2" }, - { 0x0C3, "_func_0C3" }, - { 0x0C4, "_func_0C4" }, - { 0x0C5, "_func_0C5" }, - { 0x0C6, "_func_0C6" }, - { 0x0C7, "_func_0C7" }, - { 0x0C8, "_func_0C8" }, - { 0x0C9, "_func_0C9" }, - { 0x0CA, "_func_0CA" }, - { 0x0CB, "_func_0CB" }, - { 0x0CC, "_func_0CC" }, - { 0x0CD, "_func_0CD" }, - { 0x0CE, "_func_0CE" }, - { 0x0CF, "_func_0CF" }, - { 0x0D0, "_func_0D0" }, - { 0x0D1, "_func_0D1" }, - { 0x0D2, "_func_0D2" }, - { 0x0D3, "_func_0D3" }, - { 0x0D4, "_func_0D4" }, - { 0x0D5, "_func_0D5" }, - { 0x0D6, "_func_0D6" }, - { 0x0D7, "_func_0D7" }, - { 0x0D8, "_func_0D8" }, - { 0x0D9, "_func_0D9" }, - { 0x0DA, "_func_0DA" }, - { 0x0DB, "_func_0DB" }, - { 0x0DC, "_func_0DC" }, - { 0x0DD, "_func_0DD" }, - { 0x0DE, "_func_0DE" }, - { 0x0DF, "_func_0DF" }, - { 0x0E0, "_func_0E0" }, - { 0x0E1, "_func_0E1" }, - { 0x0E2, "_func_0E2" }, - { 0x0E3, "_func_0E3" }, - { 0x0E4, "_func_0E4" }, - { 0x0E5, "_func_0E5" }, - { 0x0E6, "_func_0E6" }, - { 0x0E7, "_func_0E7" }, - { 0x0E8, "_func_0E8" }, - { 0x0E9, "_func_0E9" }, - { 0x0EA, "_func_0EA" }, - { 0x0EB, "_func_0EB" }, - { 0x0EC, "_func_0EC" }, - { 0x0ED, "_func_0ED" }, - { 0x0EE, "_func_0EE" }, - { 0x0EF, "_func_0EF" }, - { 0x0F0, "_func_0F0" }, - { 0x0F1, "_func_0F1" }, - { 0x0F2, "_func_0F2" }, - { 0x0F3, "_func_0F3" }, - { 0x0F4, "_func_0F4" }, - { 0x0F5, "_func_0F5" }, - { 0x0F6, "_func_0F6" }, - { 0x0F7, "_func_0F7" }, - { 0x0F8, "_func_0F8" }, - { 0x0F9, "_func_0F9" }, - { 0x0FA, "_func_0FA" }, - { 0x0FB, "_func_0FB" }, - { 0x0FC, "_func_0FC" }, - { 0x0FD, "_func_0FD" }, - { 0x0FE, "_func_0FE" }, - { 0x0FF, "_func_0FF" }, - { 0x100, "_func_100" }, - { 0x101, "_func_101" }, - { 0x102, "_func_102" }, - { 0x103, "_func_103" }, - { 0x104, "_func_104" }, - { 0x105, "_func_105" }, - { 0x106, "_func_106" }, - { 0x107, "_func_107" }, - { 0x108, "_func_108" }, - { 0x109, "_func_109" }, - { 0x10A, "_func_10A" }, - { 0x10B, "_func_10B" }, - { 0x10C, "_func_10C" }, - { 0x10D, "_func_10D" }, - { 0x10E, "_func_10E" }, - { 0x10F, "_func_10F" }, - { 0x110, "_func_110" }, - { 0x111, "_func_111" }, - { 0x112, "_func_112" }, - { 0x113, "_func_113" }, - { 0x114, "_func_114" }, - { 0x115, "_func_115" }, - { 0x116, "_func_116" }, - { 0x117, "_func_117" }, - { 0x118, "_func_118" }, - { 0x119, "_func_119" }, - { 0x11A, "_func_11A" }, - { 0x11B, "_func_11B" }, - { 0x11C, "_func_11C" }, - { 0x11D, "_func_11D" }, - { 0x11E, "_func_11E" }, - { 0x11F, "_func_11F" }, - { 0x120, "_func_120" }, - { 0x121, "_func_121" }, - { 0x122, "_func_122" }, - { 0x123, "_func_123" }, - { 0x124, "_func_124" }, - { 0x125, "_func_125" }, - { 0x126, "_func_126" }, - { 0x127, "_func_127" }, - { 0x128, "_func_128" }, - { 0x129, "_func_129" }, - { 0x12A, "_func_12A" }, - { 0x12B, "_func_12B" }, - { 0x12C, "_func_12C" }, - { 0x12D, "_func_12D" }, - { 0x12E, "_func_12E" }, - { 0x12F, "_func_12F" }, - { 0x130, "_func_130" }, - { 0x131, "_func_131" }, - { 0x132, "_func_132" }, - { 0x133, "_func_133" }, - { 0x134, "_func_134" }, - { 0x135, "_func_135" }, - { 0x136, "_func_136" }, - { 0x137, "_func_137" }, - { 0x138, "_func_138" }, - { 0x139, "_func_139" }, - { 0x13A, "_func_13A" }, - { 0x13B, "_func_13B" }, - { 0x13C, "_func_13C" }, - { 0x13D, "_func_13D" }, - { 0x13E, "_func_13E" }, - { 0x13F, "_func_13F" }, - { 0x140, "_func_140" }, - { 0x141, "_func_141" }, - { 0x142, "_func_142" }, - { 0x143, "_func_143" }, - { 0x144, "_func_144" }, - { 0x145, "_func_145" }, - { 0x146, "_func_146" }, - { 0x147, "_func_147" }, - { 0x148, "_func_148" }, - { 0x149, "_func_149" }, - { 0x14A, "_func_14A" }, - { 0x14B, "_func_14B" }, - { 0x14C, "_func_14C" }, - { 0x14D, "_func_14D" }, - { 0x14E, "_func_14E" }, - { 0x14F, "_func_14F" }, - { 0x150, "_func_150" }, - { 0x151, "_func_151" }, - { 0x152, "_func_152" }, - { 0x153, "_func_153" }, - { 0x154, "_func_154" }, - { 0x155, "_func_155" }, - { 0x156, "_func_156" }, - { 0x157, "_func_157" }, - { 0x158, "_func_158" }, - { 0x159, "_func_159" }, - { 0x15A, "_func_15A" }, - { 0x15B, "_func_15B" }, - { 0x15C, "_func_15C" }, - { 0x15D, "_func_15D" }, - { 0x15E, "_func_15E" }, - { 0x15F, "_func_15F" }, - { 0x160, "_func_160" }, - { 0x161, "_func_161" }, - { 0x162, "_func_162" }, - { 0x163, "_func_163" }, - { 0x164, "_func_164" }, - { 0x165, "_func_165" }, - { 0x166, "_func_166" }, - { 0x167, "_func_167" }, - { 0x168, "_func_168" }, - { 0x169, "_func_169" }, - { 0x16A, "_func_16A" }, - { 0x16B, "_func_16B" }, - { 0x16C, "_func_16C" }, - { 0x16D, "_func_16D" }, - { 0x16E, "_func_16E" }, - { 0x16F, "_func_16F" }, - { 0x170, "_func_170" }, - { 0x171, "_func_171" }, - { 0x172, "_func_172" }, - { 0x173, "_func_173" }, - { 0x174, "_func_174" }, - { 0x175, "_func_175" }, - { 0x176, "_func_176" }, - { 0x177, "_func_177" }, - { 0x178, "_func_178" }, - { 0x179, "_func_179" }, - { 0x17A, "_func_17A" }, - { 0x17B, "_func_17B" }, - { 0x17C, "_func_17C" }, - { 0x17D, "_func_17D" }, - { 0x17E, "_func_17E" }, - { 0x17F, "_func_17F" }, - { 0x180, "_func_180" }, - { 0x181, "_func_181" }, - { 0x182, "_func_182" }, - { 0x183, "_func_183" }, - { 0x184, "_func_184" }, - { 0x185, "_func_185" }, - { 0x186, "_func_186" }, - { 0x187, "_func_187" }, - { 0x188, "_func_188" }, - { 0x189, "_func_189" }, - { 0x18A, "_func_18A" }, - { 0x18B, "_func_18B" }, - { 0x18C, "_func_18C" }, - { 0x18D, "_func_18D" }, - { 0x18E, "_func_18E" }, - { 0x18F, "_func_18F" }, - { 0x190, "_func_190" }, - { 0x191, "_func_191" }, - { 0x192, "_func_192" }, - { 0x193, "_func_193" }, - { 0x194, "_func_194" }, - { 0x195, "_func_195" }, - { 0x196, "_func_196" }, - { 0x197, "_func_197" }, - { 0x198, "_func_198" }, - { 0x199, "_func_199" }, - { 0x19A, "_func_19A" }, - { 0x19B, "_func_19B" }, - { 0x19C, "_func_19C" }, - { 0x19D, "_func_19D" }, - { 0x19E, "_func_19E" }, - { 0x19F, "_func_19F" }, - { 0x1A0, "_func_1A0" }, - { 0x1A1, "_func_1A1" }, - { 0x1A2, "_func_1A2" }, - { 0x1A3, "_func_1A3" }, - { 0x1A4, "_func_1A4" }, - { 0x1A5, "_func_1A5" }, - { 0x1A6, "_func_1A6" }, - { 0x1A7, "_func_1A7" }, - { 0x1A8, "_func_1A8" }, - { 0x1A9, "_func_1A9" }, - { 0x1AA, "_func_1AA" }, - { 0x1AB, "getnextarraykey" }, - { 0x1AC, "_func_1AC" }, - { 0x1AD, "_func_1AD" }, - { 0x1AE, "_func_1AE" }, - { 0x1AF, "_func_1AF" }, - { 0x1B0, "_func_1B0" }, - { 0x1B1, "_func_1B1" }, - { 0x1B2, "_func_1B2" }, - { 0x1B3, "_func_1B3" }, - { 0x1B4, "_func_1B4" }, - { 0x1B5, "_func_1B5" }, - { 0x1B6, "_func_1B6" }, - { 0x1B7, "_func_1B7" }, - { 0x1B8, "_func_1B8" }, - { 0x1B9, "_func_1B9" }, - { 0x1BA, "_func_1BA" }, - { 0x1BB, "_func_1BB" }, - { 0x1BC, "_func_1BC" }, - { 0x1BD, "_func_1BD" }, - { 0x1BE, "_func_1BE" }, - { 0x1BF, "_func_1BF" }, - { 0x1C0, "_func_1C0" }, - { 0x1C1, "_func_1C1" }, - { 0x1C2, "_func_1C2" }, - { 0x1C3, "_func_1C3" }, - { 0x1C4, "_func_1C4" }, - { 0x1C5, "_func_1C5" }, - { 0x1C6, "_func_1C6" }, - { 0x1C7, "getfirstarraykey" }, - { 0x1C8, "_func_1C8" }, - { 0x1C9, "_func_1C9" }, - { 0x1CA, "_func_1CA" }, - { 0x1CB, "_func_1CB" }, - { 0x1CC, "_func_1CC" }, - { 0x1CD, "_func_1CD" }, - { 0x1CE, "_func_1CE" }, - { 0x1CF, "_func_1CF" }, - { 0x1D0, "_func_1D0" }, - { 0x1D1, "_func_1D1" }, - { 0x1D2, "_func_1D2" }, - { 0x1D3, "_func_1D3" }, - { 0x1D4, "_func_1D4" }, - { 0x1D5, "_func_1D5" }, - { 0x1D6, "_func_1D6" }, - { 0x1D7, "_func_1D7" }, - { 0x1D8, "_func_1D8" }, - { 0x1D9, "_func_1D9" }, - { 0x1DA, "_func_1DA" }, - { 0x1DB, "_func_1DB" }, - { 0x1DC, "_func_1DC" }, - { 0x1DD, "_func_1DD" }, - { 0x1DE, "_func_1DE" }, - { 0x1DF, "_func_1DF" }, - { 0x1E0, "_func_1E0" }, - { 0x1E1, "_func_1E1" }, - { 0x1E2, "_func_1E2" }, - { 0x1E3, "_func_1E3" }, - { 0x1E4, "_func_1E4" }, - { 0x1E5, "_func_1E5" }, - { 0x1E6, "_func_1E6" }, - { 0x1E7, "_func_1E7" }, - { 0x1E8, "_func_1E8" }, - { 0x1E9, "_func_1E9" }, - { 0x1EA, "_func_1EA" }, - { 0x1EB, "_func_1EB" }, - { 0x1EC, "_func_1EC" }, - { 0x1ED, "_func_1ED" }, - { 0x1EE, "_func_1EE" }, - { 0x1EF, "_func_1EF" }, - { 0x1F0, "_func_1F0" }, - { 0x1F1, "_func_1F1" }, - { 0x1F2, "_func_1F2" }, - { 0x1F3, "_func_1F3" }, - { 0x1F4, "_func_1F4" }, - { 0x1F5, "_func_1F5" }, - { 0x1F6, "_func_1F6" }, - { 0x1F7, "_func_1F7" }, - { 0x1F8, "_func_1F8" }, - { 0x1F9, "_func_1F9" }, - { 0x1FA, "_func_1FA" }, - { 0x1FB, "_func_1FB" }, - { 0x1FC, "_func_1FC" }, - { 0x1FD, "_func_1FD" }, - { 0x1FE, "_func_1FE" }, - { 0x1FF, "_func_1FF" }, - { 0x200, "_func_200" }, - { 0x201, "_func_201" }, - { 0x202, "_func_202" }, - { 0x203, "_func_203" }, - { 0x204, "_func_204" }, - { 0x205, "_func_205" }, - { 0x206, "_func_206" }, - { 0x207, "_func_207" }, - { 0x208, "_func_208" }, - { 0x209, "_func_209" }, - { 0x20A, "_func_20A" }, - { 0x20B, "_func_20B" }, - { 0x20C, "_func_20C" }, - { 0x20D, "_func_20D" }, - { 0x20E, "_func_20E" }, - { 0x20F, "_func_20F" }, - { 0x210, "_func_210" }, - { 0x211, "_func_211" }, - { 0x212, "_func_212" }, - { 0x213, "_func_213" }, - { 0x214, "_func_214" }, - { 0x215, "_func_215" }, - { 0x216, "_func_216" }, - { 0x217, "_func_217" }, - { 0x218, "_func_218" }, - { 0x219, "_func_219" }, - { 0x21A, "_func_21A" }, - { 0x21B, "_func_21B" }, - { 0x21C, "_func_21C" }, - { 0x21D, "_func_21D" }, - { 0x21E, "_func_21E" }, - { 0x21F, "_func_21F" }, - { 0x220, "_func_220" }, - { 0x221, "_func_221" }, - { 0x222, "_func_222" }, - { 0x223, "_func_223" }, - { 0x224, "_func_224" }, - { 0x225, "_func_225" }, - { 0x226, "_func_226" }, - { 0x227, "_func_227" }, - { 0x228, "_func_228" }, - { 0x229, "_func_229" }, - { 0x22A, "_func_22A" }, - { 0x22B, "_func_22B" }, - { 0x22C, "_func_22C" }, - { 0x22D, "_func_22D" }, - { 0x22E, "_func_22E" }, - { 0x22F, "_func_22F" }, - { 0x230, "_func_230" }, - { 0x231, "_func_231" }, - { 0x232, "_func_232" }, - { 0x233, "_func_233" }, - { 0x234, "_func_234" }, - { 0x235, "_func_235" }, - { 0x236, "_func_236" }, - { 0x237, "_func_237" }, - { 0x238, "_func_238" }, - { 0x239, "_func_239" }, - { 0x23A, "_func_23A" }, - { 0x23B, "_func_23B" }, - { 0x23C, "_func_23C" }, - { 0x23D, "_func_23D" }, - { 0x23E, "_func_23E" }, - { 0x23F, "_func_23F" }, - { 0x240, "_func_240" }, - { 0x241, "_func_241" }, - { 0x242, "_func_242" }, - { 0x243, "_func_243" }, - { 0x244, "_func_244" }, - { 0x245, "_func_245" }, - { 0x246, "_func_246" }, - { 0x247, "_func_247" }, - { 0x248, "_func_248" }, - { 0x249, "_func_249" }, - { 0x24A, "_func_24A" }, - { 0x24B, "_func_24B" }, - { 0x24C, "_func_24C" }, - { 0x24D, "_func_24D" }, - { 0x24E, "_func_24E" }, - { 0x24F, "_func_24F" }, - { 0x250, "_func_250" }, - { 0x251, "_func_251" }, - { 0x252, "_func_252" }, - { 0x253, "_func_253" }, - { 0x254, "_func_254" }, - { 0x255, "_func_255" }, - { 0x256, "_func_256" }, - { 0x257, "_func_257" }, - { 0x258, "_func_258" }, - { 0x259, "_func_259" }, - { 0x25A, "_func_25A" }, - { 0x25B, "_func_25B" }, - { 0x25C, "_func_25C" }, - { 0x25D, "_func_25D" }, - { 0x25E, "_func_25E" }, - { 0x25F, "_func_25F" }, - { 0x260, "_func_260" }, - { 0x261, "_func_261" }, - { 0x262, "_func_262" }, - { 0x263, "_func_263" }, - { 0x264, "_func_264" }, - { 0x265, "_func_265" }, - { 0x266, "_func_266" }, - { 0x267, "_func_267" }, - { 0x268, "_func_268" }, - { 0x269, "_func_269" }, - { 0x26A, "_func_26A" }, - { 0x26B, "_func_26B" }, - { 0x26C, "_func_26C" }, - { 0x26D, "_func_26D" }, - { 0x26E, "_func_26E" }, - { 0x26F, "_func_26F" }, - { 0x270, "_func_270" }, - { 0x271, "_func_271" }, - { 0x272, "_func_272" }, - { 0x273, "_func_273" }, - { 0x274, "_func_274" }, - { 0x275, "_func_275" }, - { 0x276, "_func_276" }, - { 0x277, "_func_277" }, - { 0x278, "_func_278" }, - { 0x279, "_func_279" }, - { 0x27A, "_func_27A" }, - { 0x27B, "_func_27B" }, - { 0x27C, "_func_27C" }, - { 0x27D, "_func_27D" }, - { 0x27E, "_func_27E" }, - { 0x27F, "_func_27F" }, - { 0x280, "_func_280" }, - { 0x281, "_func_281" }, - { 0x282, "_func_282" }, - { 0x283, "_func_283" }, - { 0x284, "_func_284" }, - { 0x285, "_func_285" }, - { 0x286, "_func_286" }, - { 0x287, "_func_287" }, - { 0x288, "_func_288" }, - { 0x289, "_func_289" }, - { 0x28A, "_func_28A" }, - { 0x28B, "_func_28B" }, - { 0x28C, "_func_28C" }, - { 0x28D, "_func_28D" }, - { 0x28E, "_func_28E" }, - { 0x28F, "_func_28F" }, - { 0x290, "_func_290" }, - { 0x291, "_func_291" }, - { 0x292, "_func_292" }, - { 0x293, "_func_293" }, - { 0x294, "_func_294" }, - { 0x295, "_func_295" }, - { 0x296, "_func_296" }, - { 0x297, "_func_297" }, - { 0x298, "_func_298" }, - { 0x299, "_func_299" }, - { 0x29A, "_func_29A" }, - { 0x29B, "_func_29B" }, - { 0x29C, "_func_29C" }, - { 0x29D, "_func_29D" }, - { 0x29E, "_func_29E" }, - { 0x29F, "_func_29F" }, - { 0x2A0, "_func_2A0" }, - { 0x2A1, "_func_2A1" }, - { 0x2A2, "_func_2A2" }, - { 0x2A3, "_func_2A3" }, - { 0x2A4, "_func_2A4" }, - { 0x2A5, "_func_2A5" }, - { 0x2A6, "_func_2A6" }, - { 0x2A7, "_func_2A7" }, - { 0x2A8, "_func_2A8" }, - { 0x2A9, "_func_2A9" }, - { 0x2AA, "_func_2AA" }, - { 0x2AB, "_func_2AB" }, - { 0x2AC, "_func_2AC" }, - { 0x2AD, "_func_2AD" }, - { 0x2AE, "_func_2AE" }, - { 0x2AF, "_func_2AF" }, - { 0x2B0, "_func_2B0" }, - { 0x2B1, "_func_2B1" }, - { 0x2B2, "_func_2B2" }, - { 0x2B3, "_func_2B3" }, - { 0x2B4, "_func_2B4" }, - { 0x2B5, "_func_2B5" }, - { 0x2B6, "_func_2B6" }, - { 0x2B7, "_func_2B7" }, - { 0x2B8, "_func_2B8" }, - { 0x2B9, "_func_2B9" }, - { 0x2BA, "_func_2BA" }, - { 0x2BB, "_func_2BB" }, - { 0x2BC, "_func_2BC" }, - { 0x2BD, "_func_2BD" }, - { 0x2BE, "_func_2BE" }, - { 0x2BF, "_func_2BF" }, - { 0x2C0, "_func_2C0" }, - { 0x2C1, "_func_2C1" }, - { 0x2C2, "_func_2C2" }, - { 0x2C3, "_func_2C3" }, - { 0x2C4, "_func_2C4" }, - { 0x2C5, "_func_2C5" }, - { 0x2C6, "_func_2C6" }, - { 0x2C7, "_func_2C7" }, - { 0x2C8, "_func_2C8" }, - { 0x2C9, "_func_2C9" }, - { 0x2CA, "_func_2CA" }, - { 0x2CB, "_func_2CB" }, - { 0x2CC, "_func_2CC" }, - { 0x2CD, "_func_2CD" }, - { 0x2CE, "_func_2CE" }, - { 0x2CF, "_func_2CF" }, - { 0x2D0, "_func_2D0" }, - { 0x2D1, "_func_2D1" }, - { 0x2D2, "_func_2D2" }, - { 0x2D3, "_func_2D3" }, - { 0x2D4, "_func_2D4" }, - { 0x2D5, "_func_2D5" }, - { 0x2D6, "_func_2D6" }, - { 0x2D7, "_func_2D7" }, - { 0x2D8, "_func_2D8" }, - { 0x2D9, "_func_2D9" }, - { 0x2DA, "_func_2DA" }, - { 0x2DB, "_func_2DB" }, - { 0x2DC, "_func_2DC" }, - { 0x2DD, "_func_2DD" }, - { 0x2DE, "_func_2DE" }, - { 0x2DF, "_func_2DF" }, - { 0x2E0, "_func_2E0" }, - { 0x2E1, "_func_2E1" }, - { 0x2E2, "_func_2E2" }, - { 0x2E3, "_func_2E3" }, - { 0x2E4, "_func_2E4" }, - { 0x2E5, "_func_2E5" }, - { 0x2E6, "_func_2E6" }, - { 0x2E7, "_func_2E7" }, - { 0x2E8, "_func_2E8" }, - { 0x2E9, "_func_2E9" }, - { 0x2EA, "_func_2EA" }, - { 0x2EB, "_func_2EB" }, - { 0x2EC, "_func_2EC" }, - { 0x2ED, "_func_2ED" }, - { 0x2EE, "_func_2EE" }, - { 0x2EF, "_func_2EF" }, - { 0x2F0, "_func_2F0" }, - { 0x2F1, "_func_2F1" }, - { 0x2F2, "_func_2F2" }, - { 0x2F3, "_func_2F3" }, - { 0x2F4, "_func_2F4" }, - { 0x2F5, "_func_2F5" }, - { 0x2F6, "_func_2F6" }, - { 0x2F7, "_func_2F7" }, - { 0x2F8, "_func_2F8" }, - { 0x2F9, "_func_2F9" }, - { 0x2FA, "_func_2FA" }, - { 0x2FB, "_func_2FB" }, - { 0x2FC, "_func_2FC" }, - { 0x2FD, "_func_2FD" }, - { 0x2FE, "_func_2FE" }, - { 0x2FF, "_func_2FF" }, - { 0x300, "_func_300" }, - { 0x301, "_func_301" }, - { 0x302, "_func_302" }, - { 0x303, "_func_303" }, - { 0x304, "_func_304" }, - { 0x305, "_func_305" }, - { 0x306, "_func_306" }, - { 0x307, "_func_307" }, - { 0x308, "_func_308" }, - { 0x309, "_func_309" }, - { 0x30A, "_func_30A" }, - { 0x30B, "_func_30B" }, - { 0x30C, "_func_30C" }, - { 0x30D, "_func_30D" }, - { 0x30E, "_func_30E" }, - { 0x30F, "_func_30F" }, - { 0x310, "_func_310" }, - { 0x311, "_func_311" }, - { 0x312, "_func_312" }, - { 0x313, "_func_313" }, - { 0x314, "_func_314" }, - { 0x315, "_func_315" }, - { 0x316, "_func_316" }, - { 0x317, "_func_317" }, - { 0x318, "_func_318" }, - { 0x319, "_func_319" }, - { 0x31A, "_func_31A" }, - { 0x31B, "_func_31B" }, - { 0x31C, "_func_31C" }, - { 0x31D, "_func_31D" }, - { 0x31E, "_func_31E" }, - { 0x31F, "_func_31F" }, - { 0x320, "_func_320" }, - { 0x321, "_func_321" }, - { 0x322, "_func_322" }, - { 0x323, "_func_323" }, - { 0x324, "_func_324" }, - { 0x325, "_func_325" }, - { 0x326, "_func_326" }, - { 0x327, "_func_327" }, - { 0x328, "_func_328" }, - { 0x329, "_func_329" }, - { 0x32A, "_func_32A" }, - { 0x32B, "_func_32B" }, - { 0x32C, "_func_32C" }, - { 0x32D, "_func_32D" }, - { 0x32E, "_func_32E" }, - { 0x32F, "_func_32F" }, - { 0x330, "_func_330" }, - { 0x331, "_func_331" }, - { 0x332, "_func_332" }, - { 0x333, "_func_333" }, - { 0x334, "_func_334" }, - { 0x335, "_func_335" }, - { 0x336, "_func_336" }, - { 0x337, "_func_337" }, - { 0x338, "_func_338" }, - { 0x339, "_func_339" }, - { 0x33A, "_func_33A" }, - { 0x33B, "_func_33B" }, - { 0x33C, "_func_33C" }, - { 0x33D, "_func_33D" }, - { 0x33E, "_func_33E" }, - { 0x33F, "_func_33F" }, - { 0x340, "_func_340" }, - { 0x341, "_func_341" }, - { 0x342, "_func_342" }, - { 0x343, "_func_343" }, - { 0x344, "_func_344" }, - { 0x345, "_func_345" }, - { 0x346, "_func_346" }, - { 0x347, "_func_347" }, - { 0x348, "_func_348" }, - { 0x349, "_func_349" }, - { 0x34A, "_func_34A" }, - { 0x34B, "_func_34B" }, - { 0x34C, "_func_34C" }, - { 0x34D, "_func_34D" }, - { 0x34E, "_func_34E" }, - { 0x34F, "_func_34F" }, - { 0x350, "_func_350" }, - { 0x351, "_func_351" }, - { 0x352, "_func_352" }, - { 0x353, "_func_353" }, - { 0x354, "_func_354" }, - { 0x355, "_func_355" }, - { 0x356, "_func_356" }, - { 0x357, "_func_357" }, - { 0x358, "_func_358" }, - { 0x359, "_func_359" }, - { 0x35A, "_func_35A" }, - { 0x35B, "_func_35B" }, - { 0x35C, "_func_35C" }, - { 0x35D, "_func_35D" }, - { 0x35E, "_func_35E" }, - { 0x35F, "_func_35F" }, - { 0x360, "_func_360" }, - { 0x361, "_func_361" }, - { 0x362, "_func_362" }, - { 0x363, "_func_363" }, - { 0x364, "_func_364" }, - { 0x365, "_func_365" }, - { 0x366, "_func_366" }, - { 0x367, "_func_367" }, - { 0x368, "_func_368" }, - { 0x369, "_func_369" }, - { 0x36A, "_func_36A" }, - { 0x36B, "_func_36B" }, - { 0x36C, "_func_36C" }, - { 0x36D, "_func_36D" }, - { 0x36E, "_func_36E" }, - { 0x36F, "_func_36F" }, - { 0x370, "_func_370" }, - { 0x371, "_func_371" }, - { 0x372, "_func_372" }, - { 0x373, "_func_373" }, - { 0x374, "_func_374" }, - { 0x375, "_func_375" }, - { 0x376, "_func_376" }, - { 0x377, "_func_377" }, - { 0x378, "_func_378" }, - { 0x379, "_func_379" }, - { 0x37A, "_func_37A" }, - { 0x37B, "_func_37B" }, - { 0x37C, "_func_37C" }, - { 0x37D, "_func_37D" }, - { 0x37E, "_func_37E" }, - { 0x37F, "_func_37F" }, - { 0x380, "_func_380" }, - { 0x381, "_func_381" }, - { 0x382, "_func_382" }, - { 0x383, "_func_383" }, - { 0x384, "_func_384" }, - { 0x385, "_func_385" }, - { 0x386, "_func_386" }, - { 0x387, "_func_387" }, - { 0x388, "_func_388" }, - { 0x389, "_func_389" }, - { 0x38A, "_func_38A" }, - { 0x38B, "_func_38B" }, - { 0x38C, "_func_38C" }, - { 0x38D, "_func_38D" }, - { 0x38E, "_func_38E" }, - { 0x38F, "_func_38F" }, - { 0x390, "_func_390" }, - { 0x391, "_func_391" }, - { 0x392, "_func_392" }, - { 0x393, "_func_393" }, - { 0x394, "_func_394" }, - { 0x395, "_func_395" }, - { 0x396, "_func_396" }, - { 0x397, "_func_397" }, - { 0x398, "_func_398" }, - { 0x399, "_func_399" }, - { 0x39A, "_func_39A" }, - { 0x39B, "_func_39B" }, - { 0x39C, "_func_39C" }, - { 0x39D, "_func_39D" }, - { 0x39E, "_func_39E" }, - { 0x39F, "_func_39F" }, - { 0x3A0, "_func_3A0" }, - { 0x3A1, "_func_3A1" }, - { 0x3A2, "_func_3A2" }, - { 0x3A3, "_func_3A3" }, - { 0x3A4, "_func_3A4" }, - { 0x3A5, "_func_3A5" }, - { 0x3A6, "_func_3A6" }, - { 0x3A7, "_func_3A7" }, - { 0x3A8, "_func_3A8" }, - { 0x3A9, "_func_3A9" }, - { 0x3AA, "_func_3AA" }, - { 0x3AB, "_func_3AB" }, - { 0x3AC, "_func_3AC" }, - { 0x3AD, "_func_3AD" }, - { 0x3AE, "_func_3AE" }, - { 0x3AF, "_func_3AF" }, - { 0x3B0, "_func_3B0" }, - { 0x3B1, "_func_3B1" }, - { 0x3B2, "_func_3B2" }, - { 0x3B3, "_func_3B3" }, - { 0x3B4, "_func_3B4" }, - { 0x3B5, "_func_3B5" }, - { 0x3B6, "_func_3B6" }, - { 0x3B7, "_func_3B7" }, - { 0x3B8, "_func_3B8" }, - { 0x3B9, "_func_3B9" }, - { 0x3BA, "_func_3BA" }, - { 0x3BB, "_func_3BB" }, - { 0x3BC, "_func_3BC" }, - { 0x3BD, "_func_3BD" }, - { 0x3BE, "_func_3BE" }, - { 0x3BF, "_func_3BF" }, - { 0x3C0, "_func_3C0" }, - { 0x3C1, "_func_3C1" }, - { 0x3C2, "_func_3C2" }, - { 0x3C3, "_func_3C3" }, - { 0x3C4, "_func_3C4" }, - { 0x3C5, "_func_3C5" }, - { 0x3C6, "_func_3C6" }, - { 0x3C7, "_func_3C7" }, - { 0x3C8, "_func_3C8" }, - { 0x3C9, "_func_3C9" }, - { 0x3CA, "_func_3CA" }, - { 0x3CB, "_func_3CB" }, - { 0x3CC, "_func_3CC" }, - { 0x3CD, "_func_3CD" }, - { 0x3CE, "_func_3CE" }, - { 0x3CF, "_func_3CF" }, - { 0x3D0, "_func_3D0" }, - { 0x3D1, "_func_3D1" }, - { 0x3D2, "_func_3D2" }, - { 0x3D3, "_func_3D3" }, - { 0x3D4, "_func_3D4" }, - { 0x3D5, "_func_3D5" }, - { 0x3D6, "_func_3D6" }, - { 0x3D7, "_func_3D7" }, - { 0x3D8, "_func_3D8" }, - { 0x3D9, "_func_3D9" }, - { 0x3DA, "_func_3DA" }, - { 0x3DB, "_func_3DB" }, - { 0x3DC, "_func_3DC" }, - { 0x3DD, "_func_3DD" }, - { 0x3DE, "_func_3DE" }, - { 0x3DF, "_func_3DF" }, - { 0x3E0, "_func_3E0" }, - { 0x3E1, "_func_3E1" }, - { 0x3E2, "_func_3E2" }, - { 0x3E3, "_func_3E3" }, - { 0x3E4, "_func_3E4" }, - { 0x3E5, "_func_3E5" }, - { 0x3E6, "_func_3E6" }, - { 0x3E7, "_func_3E7" }, - { 0x3E8, "_func_3E8" }, -}}; - -const std::array, 1700> method_list +extern std::array, meth_count> const meth_list {{ { 0x8000, "_meth_8000" }, { 0x8001, "_meth_8001" }, @@ -3162,62 +1712,4 @@ const std::array, 1700> method_list { 0x86A3, "_meth_86A3" }, }}; -const std::array, 5> token_list -{{ - { 0x00, "" }, - { 0x01, "pl#" }, - { 0x02, "-" }, - { 0x03, "radius`" }, - { 0x04, "note:" }, -}}; - -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()); - function_map.reserve(function_list.size()); - function_map_rev.reserve(function_list.size()); - method_map.reserve(method_list.size()); - method_map_rev.reserve(method_list.size()); - token_map.reserve(token_list.size()); - token_map_rev.reserve(token_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 : function_list) - { - function_map.insert({ entry.first, entry.second }); - function_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : method_list) - { - method_map.insert({ entry.first, entry.second }); - method_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : token_list) - { - token_map.insert({ entry.first, entry.second }); - token_map_rev.insert({ entry.second, entry.first }); - } - } -}; - -__init__ _; - } // namespace xsk::gsc::s2 - -#ifdef _MSC_VER -#pragma warning(pop) -#endif diff --git a/src/s2/s2_token.cpp b/src/s2/s2_token.cpp new file mode 100644 index 00000000..9a7ca14b --- /dev/null +++ b/src/s2/s2_token.cpp @@ -0,0 +1,20 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s2.hpp" + +namespace xsk::gsc::s2 +{ + +extern std::array, token_count> const token_list +{{ + { 0x00, "" }, + { 0x01, "pl#" }, + { 0x02, "-" }, + { 0x03, "radius`" }, + { 0x04, "note:" }, +}}; + +} // namespace xsk::gsc::s2 diff --git a/src/s2/stdafx.cpp b/src/s2/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/s2/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/s2/stdafx.hpp b/src/s2/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/s2/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/s2/xsk/assembler.cpp b/src/s2/xsk/assembler.cpp deleted file mode 100644 index a3569e28..00000000 --- a/src/s2/xsk/assembler.cpp +++ /dev/null @@ -1,556 +0,0 @@ -// 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 "s2.hpp" - -namespace xsk::gsc::s2 -{ - -auto assembler::output_script() -> std::vector -{ - std::vector script; - - if (script_ == nullptr) return script; - - script.resize(script_->pos()); - std::memcpy(script.data(), script_->buffer().data(), script.size()); - - return script; -} - -auto assembler::output_stack() -> std::vector -{ - std::vector stack; - - if (stack_ == nullptr) return stack; - - stack.resize(stack_->pos()); - std::memcpy(stack.data(), stack_->buffer().data(), stack.size()); - - return stack; -} - -void assembler::assemble(const std::string& file, std::vector& data) -{ - std::vector assembly = utils::string::clean_buffer_lines(data); - std::vector functions; - function::ptr func = nullptr; - std::uint32_t index = 1; - std::uint16_t switchnum = 0; - - for (auto& line : assembly) - { - if (line == "" || line.substr(0, 2) == "//") - { - continue; - } - else if (line.substr(0, 4) == "sub_") - { - func = std::make_unique(); - func->index = index; - func->name = line.substr(4); - } - else if (line.substr(0, 4) == "end_") - { - if (func != nullptr) - { - func->size = index - func->index; - functions.push_back(std::move(func)); - } - } - else if (line.substr(0, 4) == "loc_") - { - func->labels[index] = line; - } - else - { - auto opdata = utils::string::parse_code(line); - - if (switchnum) - { - if (opdata[0] == "case" || opdata[0] == "default") - { - for (auto& entry : opdata) - { - func->instructions.back()->data.push_back(entry); - } - switchnum--; - continue; - } - - throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); - } - else - { - auto inst = std::make_unique(); - inst->index = index; - inst->opcode = resolver::opcode_id(opdata[0]); - inst->size = opcode_size(inst->opcode); - opdata.erase(opdata.begin()); - inst->data = std::move(opdata); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = inst->data[0].substr(4); - break; - case opcode::OP_endswitch: - switchnum = static_cast(std::stoi(inst->data[0])); - inst->size += 7 * switchnum; - break; - default: - break; - } - - index += inst->size; - func->instructions.push_back(std::move(inst)); - } - } - } - - assemble(file, functions); -} - -void assembler::assemble(const std::string& file, std::vector& funcs) -{ - script_ = std::make_unique(0x100000); - stack_ = std::make_unique(0x100000); - filename_ = file; - functions_ = std::move(funcs); - - script_->write(static_cast(opcode::OP_End)); - - for (const auto& func : functions_) - { - assemble_function(func); - } -} - -void assembler::assemble_function(const function::ptr& func) -{ - labels_ = func->labels; - - func->id = resolver::token_id(func->name); - - stack_->write(func->size); - stack_->write(static_cast(func->id)); - - if (func->id == 0) - { - stack_->write_c_string(func->name); - } - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - case opcode::OP_BoolNotAfterAnd: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->write(std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->write(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - 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(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_GetAnimation: - script_->write(0); - script_->write(0); - stack_->write_c_string(inst->data[0]); - stack_->write_c_string(inst->data[1]); - break; - case opcode::OP_GetAnimTree: - script_->write(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_waittillmatch: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - assemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - assemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - assemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - assemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - assemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - assemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - assemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - assemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - assemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - assemble_jump(inst, false, true); - break; - case opcode::OP_jump: - assemble_jump(inst, false, false); - break; - case opcode::OP_switch: - assemble_switch(inst); - break; - case opcode::OP_endswitch: - assemble_end_switch(inst); - break; - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } - - const auto id = method ? resolver::method_id(inst->data[0]) : resolver::function_id(inst->data[0]); - - script_->write(id); -} - -void assembler::assemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto addr = resolve_function(inst->data[0]); - const auto offset = static_cast(addr - inst->index - 1); - - assemble_offset(offset); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } -} - -void assembler::assemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->write(0); - script_->write(0); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[2]))); - } - - const auto file_id = resolver::token_id(inst->data[0]); - const auto func_id = resolver::token_id(inst->data[1]); - - stack_->write(file_id); - if (file_id == 0) stack_->write_c_string(inst->data[0]); - stack_->write(func_id); - if (func_id == 0) stack_->write_c_string(inst->data[1]); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const auto addr = resolve_label(inst->data[0]); - - script_->write(addr - inst->index - 4); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - - script_->write(static_cast(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); - stack_->write_c_string(inst->data[1 + (3 * i) + 1]); - } - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 2]); - - assemble_offset(addr - index); - - index += 3; - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write(0); - stack_->write_c_string("\x01"); - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 1]); - - assemble_offset(addr - index); - - index += 3; - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::assemble_field_variable(const instruction::ptr& inst) -{ - auto id = resolver::token_id(inst->data[0]); - - if (id == 0) id = 0xFFFF; - - script_->write(id); - - if (id > max_string_id) - { - stack_->write(0); - stack_->write_c_string(inst->data[0]); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - const auto addr = resolve_label(inst->data[0]); - - if (expr) - { - script_->write(static_cast(addr - inst->index - 3)); - } - else if (back) - { - script_->write(static_cast((inst->index + 3) - addr)); - } - else - { - script_->write(static_cast(addr - inst->index - 5)); - } -} - -void assembler::assemble_offset(std::int32_t offset) -{ - std::array bytes = {}; - - offset = (offset << 8) >> 8; - - *reinterpret_cast(bytes.data()) = offset; - - script_->write(bytes[0]); - script_->write(bytes[1]); - script_->write(bytes[2]); -} - -auto assembler::resolve_function(const std::string& name) -> std::int32_t -{ - for (const auto& entry : functions_) - { - if (entry->name == name) - { - return entry->index; - } - } - - throw asm_error("couldn't resolve local function address of '" + name + "'!"); -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/assembler.hpp b/src/s2/xsk/assembler.hpp deleted file mode 100644 index c8f59c7d..00000000 --- a/src/s2/xsk/assembler.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::s2 -{ - -class assembler : public gsc::assembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output_script() -> std::vector; - auto output_stack() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, std::vector& funcs); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void assemble_local_call(const instruction::ptr& inst, bool thread); - void assemble_far_call(const instruction::ptr& inst, bool thread); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void assemble_field_variable(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst, bool expr, bool back); - void assemble_offset(std::int32_t offset); - auto resolve_function(const std::string& name) -> std::int32_t; - auto resolve_label(const std::string& name) -> std::int32_t; -}; - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/compiler.cpp b/src/s2/xsk/compiler.cpp deleted file mode 100644 index 9490592e..00000000 --- a/src/s2/xsk/compiler.cpp +++ /dev/null @@ -1,2970 +0,0 @@ -// 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 "s2.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -namespace xsk::gsc::s2 -{ - -auto compiler::output() -> std::vector -{ - return std::move(assembly_); -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "an unknown error ocurred while parsing gsc file"); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_.clear(); - includes_.clear(); - animtrees_.clear(); - constants_.clear(); - local_functions_.clear(); - index_ = 1; - 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& inc : includes_) - { - if (inc.name == path) - { - throw comp_error(include->loc(), "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(), "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 developer block comment"); - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) -{ - const auto itr = constants_.find(constant->name->value); - - if (itr != constants_.end()) - throw comp_error(constant->loc(), "duplicated constant '" + constant->name->value + "'"); - - 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; - - auto blk = std::make_unique(); - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - break_blks_.clear(); - continue_blks_.clear(); - - process_thread(thread, blk); - - emit_expr_parameters(thread->params, blk); - emit_stmt_list(thread->stmt, blk, true); - emit_opcode(opcode::OP_End); - - function_->size = index_ - function_->index; - assembly_.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list, blk, last); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev, blk, last); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend, blk); - break; - case ast::kind::stmt_waitframe: - emit_stmt_waitframe(stmt.as_waitframe, blk); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if, blk, last); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse, blk, last); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case, blk); - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default, blk); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return, blk); - break; - case ast::kind::stmt_breakpoint: - emit_stmt_breakpoint(stmt.as_breakpoint, blk); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin, blk); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end, blk); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last) -{ - for (const auto& entry : stmt->list) - { - bool last_ = (&entry == &stmt->list.back() && last) ? true : false; - emit_stmt(entry, blk, last_); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last) -{ - emit_stmt_list(stmt->list, blk, last); -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - 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, const block::ptr& blk) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, blk, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, blk, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_endon); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } - - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->time, blk); - emit_opcode(opcode::OP_wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittill); - - for (const auto& entry : stmt->args->list) - { - variable_create(entry.as_identifier, blk); - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(entry.as_identifier, blk)); - } - - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - emit_expr_arguments(stmt->args, blk); - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_waittillmatch2); - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waittillFrameEnd); -} - -void compiler::emit_stmt_waitframe(const ast::stmt_waitframe::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waitFrame); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - blk->transfer(stmt->blk); - - emit_stmt(stmt->stmt, stmt->blk, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last) -{ - std::vector childs; - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - blk->transfer(stmt->blk_if); - - emit_stmt(stmt->stmt_if, stmt->blk_if, last); - - emit_remove_local_vars(stmt->blk_if); - - if (stmt->blk_if->abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - - last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - - blk->transfer(stmt->blk_else); - - emit_stmt(stmt->stmt_else, stmt->blk_else, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk_else); - - if (stmt->blk_else->abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - - insert_label(end_loc); - - blk->init_from_child(childs); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_stmt(stmt->init, blk, false); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->blk_iter); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - can_break_ = true; - can_continue_ = true; - - emit_stmt(stmt->stmt, stmt->blk, false); - - if (stmt->blk->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->blk.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->blk_iter->init_from_child(continue_blks_); - - emit_stmt(stmt->iter, stmt->blk_iter, false); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_expr(stmt->array_expr, blk); - emit_expr_variable_ref(stmt->array, blk, true); - emit_expr_variable(stmt->array, blk); - emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); - emit_expr_variable_ref(stmt->key_expr, blk, true); - - blk->transfer(stmt->ctx); - stmt->ctx->loc_break = break_loc; - stmt->ctx->loc_continue = continue_loc; - - emit_create_local_vars(stmt->ctx); - - blk->local_vars_create_count = stmt->ctx->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->ctx_post); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr, blk); - emit_opcode(opcode::OP_CallBuiltin1, "isdefined"); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr, stmt->ctx); - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->array.as_identifier, stmt->ctx)); - emit_expr_variable_ref(stmt->value_expr, stmt->ctx, true); - emit_stmt(stmt->stmt, stmt->ctx, false); - - if (stmt->ctx->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->ctx.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->ctx_post->init_from_child(continue_blks_); - - emit_expr_variable(stmt->key_expr, stmt->ctx_post); - emit_expr_variable(stmt->array, stmt->ctx_post); - emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); - emit_expr_variable_ref(stmt->key_expr, stmt->ctx_post, true); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - emit_expr_clear_local(stmt->array.as_identifier, blk); - if (!stmt->use_key) emit_expr_clear_local(stmt->key_expr.as_identifier, blk); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_break = can_break_; - break_blks_.clear(); - can_break_ = false; - - auto jmptable_loc = create_label(); - auto break_loc = create_label(); - - emit_expr(stmt->test, blk); - 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; - block* default_ctx = nullptr; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - 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"); - } - - blk->transfer(case_->blk); - case_->blk->loc_break = break_loc; - emit_stmt_list(case_->stmt, case_->blk, false); - if (case_->stmt->list.size() > 0) - emit_remove_local_vars(case_->blk); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - - has_default = true; - default_ctx = entry.as_default->blk.get(); - - blk->transfer(entry.as_default->blk); - entry.as_default->blk->loc_break = break_loc; - emit_stmt_list(entry.as_default->stmt, entry.as_default->blk, false); - if (entry.as_default->stmt->list.size() > 0) - emit_remove_local_vars(entry.as_default->blk); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - } - blk->init_from_child(break_blks_); - } - - insert_label(jmptable_loc); - - emit_opcode(opcode::OP_endswitch, data); - - auto offset = static_cast(7 * stmt->stmt->list.size()); - function_->instructions.back()->size += offset; - index_ += offset; - - insert_label(break_loc); - - can_break_ = old_break; - break_blks_ = old_breaks; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) -{ - if (!can_break_ || blk->abort != abort_t::abort_none || blk->loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - break_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_break; - emit_opcode(opcode::OP_jump, blk->loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) -{ - if (!can_continue_ || blk->abort != abort_t::abort_none || blk->loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - continue_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_continue; - emit_opcode(opcode::OP_jump, blk->loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - blk->abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr, blk); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child, blk); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate, blk); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference, blk); - break; - case ast::kind::expr_add_array: - emit_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_thisthread: - emit_opcode(opcode::OP_GetThisthread); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - 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, blk); - 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, const block::ptr& blk) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue, blk); - } - else if (expr->lvalue == ast::kind::expr_tuple) - { - emit_expr(expr->rvalue, blk); - emit_expr_tuple(expr->lvalue.as_tuple, blk); - } - else - { - emit_expr(expr->rvalue, blk); - emit_expr_variable_ref(expr->lvalue, blk, true); - } - - return; - } - - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - 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_mod); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_ex_or); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, blk, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key, blk); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, blk, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj, blk); - 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, blk, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk) -{ - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); - else - emit_opcode(opcode::OP_ClearLocalVariableFieldCached, variable_access_index(expr, blk)); -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_inc); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_dec); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr, blk); - emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr, blk); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_equality); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_inequality); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_less); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_greater); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_less_equal); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_greater_equal); - 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_ex_or); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_mod); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt && mode_ == gsc::build::prod) - { - const auto& name = expr->name->value; - if (name == "assert" || name == "assertex" || name == "assertmsg") return; - } - - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal && expr->args->list.size() > 0) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptLocalFunctionCall, expr->name->value); - else - emit_opcode(opcode::OP_ScriptLocalFunctionCall2, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptFarFunctionCall, { expr->path->value, expr->name->value }); - else - emit_opcode(opcode::OP_ScriptFarFunctionCall2, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltin0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltin1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltin2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltin3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltin4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltin5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltin, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptLocalMethodCall, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFarMethodCall, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltinMethod0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltinMethod1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltinMethod2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltinMethod3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltinMethod4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltinMethod5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltinMethod, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_EmptyArray); - - for (const auto& arg : expr->args->list) - { - emit_expr(arg, blk); - emit_opcode(opcode::OP_AddArray); - } -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) -{ - for (const auto& entry : expr->list) - { - variable_initialize(entry, blk); - emit_opcode(opcode::OP_SafeCreateVariableFieldCached, variable_create_index(entry, blk)); - } - - emit_opcode(opcode::OP_checkclearparams); -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry, blk); - } -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) -{ - bool method = false; - auto type = resolve_reference_type(expr, method); - - switch (type) - { - case ast::call::type::local: - emit_opcode(opcode::OP_GetLocalFunction, expr->name->value); - break; - case ast::call::type::far: - emit_opcode(opcode::OP_GetFarFunction, { expr->path->value, expr->name->value }); - break; - case ast::call::type::builtin: - if (method) - emit_opcode(opcode::OP_GetBuiltinMethod, expr->name->value); - else - emit_opcode(opcode::OP_GetBuiltinFunction, expr->name->value); - break; - } -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_size); -} - -void compiler::emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - emit_expr_variable_ref(expr->temp, blk, true); - - auto index = 0; - - for (const auto& entry : expr->list) - { - if (index == 0) - emit_opcode(opcode::OP_GetZero); - else - emit_opcode(opcode::OP_GetByte, utils::string::va("%d", index)); - - index++; - - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->temp.as_identifier, blk)); - - emit_expr_variable_ref(entry, blk, true); - } - - emit_expr_clear_local(expr->temp.as_identifier, blk); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, blk, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, blk, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, blk, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set) -{ - emit_expr(expr->key, blk); - - 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, blk, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - { - if (!variable_initialized(expr->obj.as_identifier, blk)) - { - variable_initialize(expr->obj.as_identifier, blk); - emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(expr->obj.as_identifier, blk)); - - if (!set) throw comp_error(expr->loc(), "INTERNAL: VAR CREATED BUT NOT SET!"); - } - else if (variable_stack_index(expr->obj.as_identifier, blk) == 0) - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached0); - } - else - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access_index(expr->obj.as_identifier, blk)); - } - - 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, const block::ptr& blk, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); - break; - case ast::kind::expr_anim: - set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); - break; - case ast::kind::expr_self: - set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - 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, blk); - 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_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, 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 + "'"); - } - - if (set) - { - if (!variable_initialized(expr, blk)) - { - variable_initialize(expr, blk); - emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(expr, blk)); - } - else if (variable_stack_index(expr, blk) == 0) - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached0); - } - else - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached, variable_access_index(expr, blk)); - } - } - else - { - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_EvalLocalVariableRefCached0); - else - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access_index(expr, blk)); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->key, blk); - - if (expr->obj == ast::kind::expr_identifier) - { - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->obj.as_identifier, blk)); - } - else - { - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_EvalArray); - } -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_EvalLevelFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_EvalAnimFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_EvalSelfFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, const block::ptr& blk) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - emit_expr(itr->second, blk); - return; - } - - // is local var - auto index = variable_stack_index(expr, blk); - - switch (index) - { - case 0: - emit_opcode(opcode::OP_EvalLocalVariableCached0); - break; - case 1: - emit_opcode(opcode::OP_EvalLocalVariableCached1); - break; - case 2: - emit_opcode(opcode::OP_EvalLocalVariableCached2); - break; - case 3: - emit_opcode(opcode::OP_EvalLocalVariableCached3); - break; - case 4: - emit_opcode(opcode::OP_EvalLocalVariableCached4); - break; - case 5: - emit_opcode(opcode::OP_EvalLocalVariableCached5); - break; - default: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access_index(expr, blk)); - break; - } -} - -void compiler::emit_expr_object(const ast::expr& expr, const block::ptr& blk) -{ - 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, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr.as_identifier, blk)); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk) -{ - std::vector data; - - bool isexpr = false; - - 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, blk); - emit_expr(expr->y, blk); - emit_expr(expr->x, blk); - 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(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimation, { "", expr->value }); - } - else - { - emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); - tree.loaded = true; - } -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error(expr->loc(), "trying to use animtree without specified using animtree"); - } - - auto& tree = animtrees_.back(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimTree, ""); - } - else - { - emit_opcode(opcode::OP_GetAnimTree, tree.name); - tree.loaded = true; - } -} - -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_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_create_local_vars(const block::ptr& blk) -{ - if (blk->local_vars_create_count != blk->local_vars_public_count) - { - for (auto i = blk->local_vars_create_count; i < blk->local_vars_public_count; i++) - { - auto data = utils::string::va("%d", blk->local_vars.at(i).create); - emit_opcode(opcode::OP_CreateLocalVariable, data); - blk->local_vars.at(i).init = true; - } - blk->local_vars_create_count = blk->local_vars_public_count; - } -} - -void compiler::emit_remove_local_vars(const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - auto count = blk->local_vars_create_count - blk->local_vars_public_count; - - if (count > 0) - { - auto data = utils::string::va("%d", count); - emit_opcode(opcode::OP_RemoveLocalVariables, data); - } - } -} - -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, const block::ptr& blk) -{ - process_expr_parameters(decl->params, blk); - process_stmt_list(decl->stmt, blk); -} - -void compiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - 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_waitframe: - case ast::kind::stmt_case: - case ast::kind::stmt_default: - 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, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk) -{ - process_stmt_list(stmt->list, blk); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - 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, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - blk->merge(childs); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - stmt->blk_if = std::make_unique(); - stmt->blk_else = std::make_unique(); - - blk->copy(stmt->blk_if); - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - blk->copy(stmt->blk_else); - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - blk->merge(childs); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - stmt->blk = std::make_unique(); - stmt->blk_iter = std::make_unique(); - - process_stmt(stmt->init, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->blk); - blk->copy(stmt->blk_iter); - - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_stmt(stmt->iter, stmt->blk_iter); - - blk->append({ stmt->blk_iter.get() }); - blk->merge({ stmt->blk_iter.get() }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto array_name = utils::string::va("_temp_%d", ++label_idx_); - auto key_name = utils::string::va("_temp_%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; - - // calculate variables - - stmt->ctx = std::make_unique(); - stmt->ctx_post = std::make_unique(); - - // calculate pre_expr variables - process_expr(stmt->array, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->ctx); - blk->copy(stmt->ctx_post); - - // calculate stmt variables & add missing array access as first stmt - process_expr(stmt->value_expr, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - continue_blks_.push_back(stmt->ctx.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_expr(stmt->key_expr, stmt->ctx_post); - - blk->append({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - // calculate variables - stmt->ctx = std::make_unique(); - std::vector childs; - auto abort = abort_t::abort_return; - bool has_default = false; - block* default_ctx = nullptr; - auto old_breaks = break_blks_; - break_blks_.clear(); - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->copy(entry.as_case->blk); - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort != abort_t::abort_none) - { - if (entry.as_case->blk->abort == abort_t::abort_break ) - { - entry.as_case->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_case->blk.get()); - } - else if (entry.as_case->blk->abort <= abort ) - { - abort = entry.as_case->blk->abort; - } - } - } - else if (entry == ast::kind::stmt_default) - { - entry.as_default->blk = std::make_unique(); - blk->copy(entry.as_default->blk); - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - has_default = true; - default_ctx = entry.as_default->blk.get(); - - if (entry.as_default->blk->abort != abort_t::abort_none) - { - if (entry.as_default->blk->abort == abort_t::abort_break ) - { - entry.as_default->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_default->blk.get()); - } - else if (entry.as_default->blk->abort <= abort ) - { - abort = entry.as_default->blk->abort; - } - } - } - } - - stmt->stmt =std::move(stmt_list); - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - } - - blk->append(break_blks_); - blk->merge(childs); - } - - break_blks_ = old_breaks; -} - -void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - break_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_break; - } -} - -void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - continue_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_continue; - } -} - -void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } -} - -void compiler::process_expr(const ast::expr& expr, const block::ptr& blk) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value, blk); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj, blk); - } - else if (expr == ast::kind::expr_tuple) - { - process_expr_tuple(expr.as_tuple, blk); - } -} - -void compiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - auto array = utils::string::va("_temp_%d", ++label_idx_); - expr->temp = ast::expr(std::make_unique(expr->loc(), array)); - - process_expr(expr->temp, blk); - - for (const auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk) -{ - for (const auto& entry : decl->list) - { - variable_register(entry->value, blk); - } -} - -void compiler::variable_register(const std::string& name, const block::ptr& blk) -{ - auto it = std::find_if (blk->local_vars.begin(), blk->local_vars.end(), - [&](const gsc::local_var& v) { return v.name == name; }); - - if (it == blk->local_vars.end()) - { - auto found = false; - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - blk->local_vars.push_back({ name, static_cast(i), false }); - found = true; - break; - } - } - - if (!found) - { - blk->local_vars.push_back({ name, stack_idx_, false }); - local_stack_.push_back(name); - stack_idx_++; - } - } -} - -void compiler::variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::uint32_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (!blk->local_vars[i].init) - { - for (std::uint32_t j = 0; j < i; j++) - { - if (!blk->local_vars[j].init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", blk->local_vars[j].create)); - blk->local_vars[j].init = true; - } - } - blk->local_vars[i].init = true; - blk->local_vars_create_count = i + 1; - return; - } - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -void compiler::variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - auto& var = blk->local_vars.at(i); - if (var.name == name->value) - { - if (!var.init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); - var.init = true; - blk->local_vars_create_count++; - } - return; - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return static_cast(blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - return utils::string::va("%d", blk->local_vars[i].create); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return utils::string::va("%d", blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - return blk->local_vars.at(i).init; - } - } - - 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_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jump: - case opcode::OP_jumpback: - case opcode::OP_switch: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_endswitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - -auto compiler::map_known_includes(const std::string&) -> bool -{ - return false; -} - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/compiler.hpp b/src/s2/xsk/compiler.hpp deleted file mode 100644 index 4d0aab5d..00000000 --- a/src/s2/xsk/compiler.hpp +++ /dev/null @@ -1,160 +0,0 @@ -// 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::gsc::s2 -{ - -enum class opcode : std::uint8_t; - -class compiler : public gsc::compiler -{ - build mode_; - std::string filename_; - std::vector assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector break_blks_; - std::vector continue_blks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - -public: - auto output() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_constant(const ast::decl_constant::ptr& constant); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last); - void emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void emit_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt, const block::ptr& blk); - void emit_stmt_waitframe(const ast::stmt_waitframe::ptr& stmt, const block::ptr& blk); - void emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk); - void emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk); - void emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk); - void emit_expr(const ast::expr& expr, const block::ptr& blk); - void emit_expr_assign(const ast::expr_assign::ptr& expr, const block::ptr& blk); - void emit_expr_clear(const ast::expr& expr, const block::ptr& blk); - void emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk); - void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk); - void emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_variable(const ast::expr& expr, const block::ptr& blk); - void emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void emit_expr_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_object(const ast::expr& expr, const block::ptr& blk); - void emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_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_create_local_vars(const block::ptr& blk); - void emit_remove_local_vars(const block::ptr& blk); - 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, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(const ast::expr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk); - void variable_register(const std::string& name, const block::ptr& blk); - void variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk); - void variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk); - auto variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t; - auto variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool; - 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; -}; - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/context.cpp b/src/s2/xsk/context.cpp deleted file mode 100644 index 2c6546ed..00000000 --- a/src/s2/xsk/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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 "s2.hpp" - -namespace xsk::gsc::s2 -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/context.hpp b/src/s2/xsk/context.hpp deleted file mode 100644 index 1301ee7b..00000000 --- a/src/s2/xsk/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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::gsc::s2 -{ - -class context : public gsc::context -{ - s2::assembler assembler_; - s2::disassembler disassembler_; - s2::compiler compiler_; - s2::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { return assembler_; } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { return compiler_; } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/decompiler.cpp b/src/s2/xsk/decompiler.cpp deleted file mode 100644 index 6b54a5e4..00000000 --- a/src/s2/xsk/decompiler.cpp +++ /dev/null @@ -1,3449 +0,0 @@ -// 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 "s2.hpp" - -namespace xsk::gsc::s2 -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// S2 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetLocalFunction: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalFunctionCall2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - 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_ScriptLocalFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalMethodCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodChildThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall2: - { - 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 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_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin1: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin3: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin4: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin5: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod0: - { - auto args = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto path = std::make_unique(loc); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod1: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod2: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod3: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod4: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod5: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_waitFrame: - { - auto stmt = ast::stmt(std::make_unique(loc)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_waittill: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto args = std::make_unique(loc); - auto node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_BoolNotAfterAnd: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto node = std::make_unique(expr.loc(), std::move(expr)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // continue is at jumpback, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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 - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - auto use_key = true; - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - use_key = false; - } - - 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)), use_key)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(std::stoi(entry->value.substr(4))), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - auto var = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - auto var1 = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); - blk->local_vars_create_count++; - } - - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/decompiler.hpp b/src/s2/xsk/decompiler.hpp deleted file mode 100644 index 2d5ef107..00000000 --- a/src/s2/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::s2 -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/disassembler.cpp b/src/s2/xsk/disassembler.cpp deleted file mode 100644 index 032e8136..00000000 --- a/src/s2/xsk/disassembler.cpp +++ /dev/null @@ -1,576 +0,0 @@ -// 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 "s2.hpp" - -namespace xsk::gsc::s2 -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// S2 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read(); - func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - case opcode::OP_BoolNotAfterAnd: - 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->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetVector: - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(4); - inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); - break; - case opcode::OP_GetAnimation: - script_->seek(8); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - disassemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto id = script_->read(); - const auto name = method ? resolver::method_name(id) : resolver::function_name(id); - inst->data.emplace(inst->data.begin(), name); -} - -void disassembler::disassemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto offset = disassemble_offset(); - - inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(3); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto file_id = stack_->read(); - const auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::token_name(file_id); - const auto func_id = stack_->read(); - const auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); - - inst->data.emplace(inst->data.begin(), func_name); - inst->data.emplace(inst->data.begin(), file_name); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read(); - 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) -{ - const auto count = script_->read(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read(); - - if (value < 0x40000) - { - const auto data = stack_->read_c_string(); - - if (data.data()[0] != 0x01) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(data, false)); - } - else - inst->data.push_back("default"); - } - else - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - index += 4; - - const auto addr = disassemble_offset() + index; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 3; - inst->size += 7; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - const auto id = script_->read(); - std::string name; - - if (id > max_string_id) - { - auto temp = stack_->read(); - name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); - } - else - { - name = resolver::token_name(id); - } - - inst->data.push_back(name); -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read(); - } - else if (back) - { - addr = inst->index + 3 - script_->read(); - } - else - { - addr = inst->index + 5 + script_->read(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -auto disassembler::disassemble_offset() -> std::int32_t -{ - std::array bytes = {}; - - for (auto i = 0; i < 3; i++) - { - bytes[i] = script_->read(); - } - - auto offset = *reinterpret_cast(bytes.data()); - - offset = (offset << 8) >> 8; - - return offset; -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = resolve_function(inst->data[0]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s\n", func->name.data())); - - 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())); - } - - print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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; - } - if (casenum != totalcase - 1) - { - output_->write_string("\n"); - } - } - } - break; - default: - for (auto& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - break; - } - - output_->write_string("\n"); -} - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/disassembler.hpp b/src/s2/xsk/disassembler.hpp deleted file mode 100644 index d7ac3056..00000000 --- a/src/s2/xsk/disassembler.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc::s2 -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_local_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - auto disassemble_offset() -> std::int32_t; - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/lexer.cpp b/src/s2/xsk/lexer.cpp deleted file mode 100644 index 8fa03fbb..00000000 --- a/src/s2/xsk/lexer.cpp +++ /dev/null @@ -1,849 +0,0 @@ -// 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 "s2.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -xsk::gsc::s2::parser::symbol_type S2lex(xsk::gsc::s2::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::gsc::s2 -{ - -const std::unordered_map keyword_map -{{ - { "#define", parser::token::SH_DEFINE }, - { "#undef", parser::token::SH_UNDEF }, - { "#ifdef", parser::token::SH_IFDEF }, - { "#ifndef", parser::token::SH_IFNDEF }, - { "#if", parser::token::SH_IF }, - { "#elif", parser::token::SH_ELIF }, - { "#else", parser::token::SH_ELSE }, - { "#endif", parser::token::SH_ENDIF }, - { "#inline", parser::token::INLINE }, - { "#include", parser::token::INCLUDE }, - { "#using_animtree", parser::token::USINGTREE }, - { "#animtree", parser::token::ANIMTREE }, - { "endon", parser::token::ENDON }, - { "notify", parser::token::NOTIFY }, - { "wait", parser::token::WAIT }, - { "waittill", parser::token::WAITTILL }, - { "waittillmatch", parser::token::WAITTILLMATCH }, - { "waittillframeend", parser::token::WAITTILLFRAMEEND }, - { "waitframe", parser::token::WAITFRAME }, - { "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 }, - { "childthread", parser::token::CHILDTHREAD }, - { "thisthread", parser::token::THISTHREAD }, - { "call", parser::token::CALL }, - { "true", parser::token::TRUE }, - { "false", parser::token::FALSE }, - { "undefined", parser::token::UNDEFINED }, - { "size", parser::token::SIZE }, - { "game", parser::token::GAME }, - { "self", parser::token::SELF }, - { "anim", parser::token::ANIM }, - { "level", parser::token::LEVEL }, -}}; - -buffer::buffer() : length(0) -{ - data = static_cast(std::malloc(max_buf_size)); -} - -buffer::~buffer() -{ - if (data) std::free(data); -} - -bool buffer::push(char c) -{ - if (length >= max_buf_size) - return false; - - data[length++] = c; - return true; -} - -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) -{ - -} - -void reader::init(const char* data, size_t size) -{ - if (data && size) - { - state = reader::ok; - buffer_pos = data; - bytes_remaining = static_cast(size); - last_byte = 0; - current_byte = *data; - } - else - { - state = reader::end; - buffer_pos = 0; - bytes_remaining = 0; - last_byte = 0; - current_byte = 0; - } -} - -void reader::advance() -{ - ++buffer_pos; - - if (bytes_remaining-- == 1) - { - state = reader::end; - bytes_remaining = 0; - last_byte = current_byte; - current_byte = 0; - } - else - { - last_byte = current_byte; - current_byte = *buffer_pos; - } -} - -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) -{ - reader_.init(data, size); -} - -void lexer::push_header(const std::string& file) -{ - try - { - if (header_top_++ >= 10) - throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - - auto data = resolver::file_data(file + ".gsh"); - - readers_.push(reader_); - locs_.push(loc_); - loc_.initialize(std::get<0>(data)); - reader_.init(std::get<1>(data), std::get<2>(data)); - clean_ = true; - } - catch (const std::exception& e) - { - throw error("parsing header file '" + file + "': " + e.what()); - } -} - -void lexer::pop_header() -{ - header_top_--; - loc_ = locs_.top(); - locs_.pop(); - reader_ = readers_.top(); - readers_.pop(); -} - -void lexer::ban_header(const location& loc) -{ - if (header_top_ > 0) - { - throw comp_error(loc, "not allowed inside a gsh file"); - } -} - -auto lexer::lex() -> parser::symbol_type -{ - buffer_.length = 0; - state_ = state::start; - - while (true) - { - const auto& state = reader_.state; - auto& last = reader_.last_byte; - auto& curr = reader_.current_byte; - auto path = false; - loc_.step(); - - if (state == reader::end) - { - if (indev_) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (header_top_ > 0) - pop_header(); - else - return parser::make_S2EOF(loc_); - } - - if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') - clean_ = false; - - advance(); - - switch (last) - { - case ' ': - case '\t': - case '\r': - loc_.step(); - continue; - case '\n': - loc_.lines(); - loc_.step(); - clean_ = true; - continue; - case '\\': - throw comp_error(loc_, "invalid token ('\\')"); - case '/': - if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') - return parser::make_DIV(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_DIV(loc_); - - if (last == '#') - { - if (indev_) - throw comp_error(loc_, "cannot recurse devblock ('/#')"); - - if (mode_ == build::dev) - { - indev_ = true; - return parser::make_DEVBEGIN(loc_); - } - else - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '#' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - } - else if (last == '@') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched script doc comment start ('/@')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '@' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '*') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched multiline comment start ('/*')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '*' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '/') - { - while (true) - { - if (state == reader::end) - break; - - if (curr == '\n') - break; - - advance(); - } - } - continue; - case '#': - if (curr == '/') - { - if (!indev_) - throw comp_error(loc_, "unmatched devblock end ('#/')"); - - advance(); - indev_ = false; - return parser::make_DEVEND(loc_); - } - - buffer_.push(last); - advance(); - - while (state == reader::ok) - { - if (last != ' ' || last != '\t') - break; - - advance(); - } - - if (state == reader::end || !((last > 64 && last < 91) || (last > 96 && last < 123))) - throw comp_error(loc_, "invalid preprocessor directive ('#')"); - - state_ = state::preprocessor; - goto lex_name; - case '*': - if (curr != '=' && curr != '/') - return parser::make_MUL(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_MUL(loc_); - - throw comp_error(loc_, "unmatched multiline comment end ('*/')"); - case '"': - state_ = state::string; - goto lex_string; - case '.': - if (curr < '0' || curr > '9') - return parser::make_DOT(loc_); - goto lex_number; - case '(': - return parser::make_LPAREN(loc_); - case ')': - return parser::make_RPAREN(loc_); - case '{': - return parser::make_LBRACE(loc_); - case '}': - return parser::make_RBRACE(loc_); - case '[': - return parser::make_LBRACKET(loc_); - case ']': - return parser::make_RBRACKET(loc_); - case ',': - return parser::make_COMMA(loc_); - case ';': - return parser::make_SEMICOLON(loc_); - case ':': - if (curr != ':') - return parser::make_COLON(loc_); - - advance(); - return parser::make_DOUBLECOLON(loc_); - case '?': - return parser::make_QMARK(loc_); - case '=': - if (curr != '=') - return parser::make_ASSIGN(loc_); - - advance(); - return parser::make_EQUALITY(loc_); - case '+': - if (curr != '+' && curr != '=') - return parser::make_ADD(loc_); - - advance(); - - if (last == '+') - return parser::make_INCREMENT(loc_); - - return parser::make_ASSIGN_ADD(loc_); - case '-': - if (curr != '-' && curr != '=') - return parser::make_SUB(loc_); - - advance(); - - if (last == '-') - return parser::make_DECREMENT(loc_); - - return parser::make_ASSIGN_SUB(loc_); - case '%': - if (curr != '=') - return parser::make_MOD(loc_); - - advance(); - - return parser::make_ASSIGN_MOD(loc_); - case '|': - if (curr != '|' && curr != '=') - return parser::make_BITWISE_OR(loc_); - - advance(); - - if (last == '|') - return parser::make_OR(loc_); - - return parser::make_ASSIGN_BW_OR(loc_); - case '&': - if (curr != '&' && curr != '=' && curr != '"') - return parser::make_BITWISE_AND(loc_); - - advance(); - - if (last == '&') - return parser::make_AND(loc_); - - if (last == '=') - return parser::make_ASSIGN_BW_AND(loc_); - - state_ = state::localize; - goto lex_string; - case '^': - if (curr != '=') - return parser::make_BITWISE_EXOR(loc_); - - advance(); - return parser::make_ASSIGN_BW_EXOR(loc_); - case '!': - if (curr != '=') - return parser::make_NOT(loc_); - - advance(); - return parser::make_INEQUALITY(loc_); - case '~': - return parser::make_COMPLEMENT(loc_); - case '<': - if (curr != '<' && curr != '=') - return parser::make_LESS(loc_); - - advance(); - if (last == '=') - return parser::make_LESS_EQUAL(loc_); - - if (curr != '=') - return parser::make_LSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_LSHIFT(loc_); - case '>': - if (curr != '>' && curr != '=') - return parser::make_GREATER(loc_); - - advance(); - - if (last == '=') - return parser::make_GREATER_EQUAL(loc_); - - if (curr != '=') - return parser::make_RSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_RSHIFT(loc_); - default: - if (last >= '0' && last <= '9') - goto lex_number; - else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) - goto lex_name; - - throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); - } - -lex_string: - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched string start ('\"')"); - - if (curr == '"') - { - advance(); - break; - } - - if (curr == '\n') - throw comp_error(loc_, "unterminated string literal"); - - if (curr == '\\') - { - advance(); - - if (state == reader::end) - throw comp_error(loc_, "invalid token ('\')"); - - char c = curr; - switch (curr) - { - case 't': c = '\t'; break; - case 'r': c = '\r'; break; - case 'n': c = '\n'; break; - case '"': c = '\"'; break; - case '\\': c = '\\'; break; - default: break; - } - - if (!buffer_.push(c)) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); - -lex_name: - buffer_.push(last); - - while (true) - { - if (state == reader::end) - break; - - if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) - break; - - if (curr == '\\') - { - if (last == '\\') - throw comp_error(loc_, "invalid path '\\\\'"); - - path = true; - if (!buffer_.push('/')) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::preprocessor) - { - auto token = parser::token::S2UNDEF; - - if (buffer_.length < 16) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - { - if (itr->second > parser::token::SH_ENDIF) - return parser::symbol_type(itr->second, loc_); - - token = itr->second; - } - } - - preprocessor_run(token); - - state_ = state::start; - continue; - } - else - { - 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_); - } - - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - -lex_number: - if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) - { - buffer_.push(last); - - auto dot = last == '.' ? 1 : 0; - auto flt = 0; - - while (true) - { - if (state == reader::end) - break; - - if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) - throw comp_error(loc_, "invalid number literal"); - - if ((curr == '.' || curr == 'f') && last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr == 'f') - flt++; - else if (curr == '.') - dot++; - else if (!(curr > 47 && curr < 58)) - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f')) - throw comp_error(loc_, "invalid number literal"); - - if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); - } - else if (curr == 'o') - { - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) - throw comp_error(loc_, "invalid octal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!(curr > 47 && curr < 56)) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length <= 0) - throw comp_error(loc_, "invalid octal literal"); - - return parser::make_INTEGER(utils::string::oct_to_dec(buffer_.data), loc_); - } - else if (curr == 'b') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) - throw comp_error(loc_, "invalid binary literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr != '0' && curr != '1') - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid binary literal"); - - return parser::make_INTEGER(utils::string::bin_to_dec(buffer_.data), loc_); - } - else if (curr == 'x') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) - throw comp_error(loc_, "invalid hexadecimal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid hexadecimal literal"); - - return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); - } - - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); - } -} - -void lexer::advance() -{ - reader_.advance(); - loc_.end.column++; - - if (reader_.current_byte == '\\') [[unlikely]] - preprocessor_wrap(); -} - -void lexer::preprocessor_wrap() -{ - while (reader_.current_byte == '\\') - { - if (reader_.bytes_remaining == 1) - throw comp_error(loc_, "invalid token ('\\')"); - - if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') - break; - - if (reader_.buffer_pos[1] == '\r') - { - if (reader_.bytes_remaining <= 3 || reader_.buffer_pos[2] != '\n') - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 3; - reader_.bytes_remaining -= 3; - } - - if ((reader_.buffer_pos[1] == '\n')) - { - if (reader_.bytes_remaining == 2) - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 2; - reader_.bytes_remaining -= 2; - } - - if (reader_.bytes_remaining == 0) - { - reader_.state = reader::end; - reader_.current_byte = 0; - } - else - { - reader_.current_byte = *reader_.buffer_pos; - } - - loc_.lines(); - loc_.step(); - } -} - -void lexer::preprocessor_run(parser::token::token_kind_type token) -{ - if (!clean_) - throw comp_error(loc_, "invalid token ('#')"); - - switch (token) - { - case parser::token::SH_DEFINE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_UNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELSE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ENDIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - default: - throw comp_error(loc_, "unknown preprocessor directive"); - } -} - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/lexer.hpp b/src/s2/xsk/lexer.hpp deleted file mode 100644 index 20bcfcad..00000000 --- a/src/s2/xsk/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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::gsc::s2 -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/parser.cpp b/src/s2/xsk/parser.cpp deleted file mode 100644 index fcca5124..00000000 --- a/src/s2/xsk/parser.cpp +++ /dev/null @@ -1,4733 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::s2::parser::symbol_type S2lex(xsk::gsc::s2::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex S2lex - - - -#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 S2DEBUG - -// 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 // !S2DEBUG - -# 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 // !S2DEBUG - -#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 gsc { namespace s2 { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::gsc::s2::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg) -#if S2DEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - 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_add_array: // expr_add_array - value.YY_MOVE_OR_COPY< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.YY_MOVE_OR_COPY< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.YY_MOVE_OR_COPY< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.YY_MOVE_OR_COPY< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.YY_MOVE_OR_COPY< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.YY_MOVE_OR_COPY< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.YY_MOVE_OR_COPY< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.YY_MOVE_OR_COPY< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.copy< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.copy< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.copy< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.copy< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 S2DEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if S2DEBUG - 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 // S2DEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - yylhs.value.emplace< ast::expr_add_array::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - yylhs.value.emplace< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - yylhs.value.emplace< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - yylhs.value.emplace< ast::stmt_waitframe::ptr > (); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - yylhs.value.emplace< ast::stmt_waittill::ptr > (); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - yylhs.value.emplace< ast::stmt_waittillframeend::ptr > (); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - yylhs.value.emplace< ast::stmt_waittillmatch::ptr > (); - break; - - case symbol_kind::S_stmt_while: // stmt_while - yylhs.value.emplace< ast::stmt_while::ptr > (); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 263 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2040 "parser.cpp" - break; - - case 3: // root: %empty -#line 264 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2046 "parser.cpp" - break; - - case 4: // program: program inline -#line 269 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2052 "parser.cpp" - break; - - case 5: // program: program include -#line 271 "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 2058 "parser.cpp" - break; - - case 6: // program: program declaration -#line 273 "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 2064 "parser.cpp" - break; - - case 7: // program: inline -#line 275 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2070 "parser.cpp" - break; - - case 8: // program: include -#line 277 "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 2076 "parser.cpp" - break; - - case 9: // program: declaration -#line 279 "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 2082 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 283 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2088 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 288 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2094 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 292 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2100 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 293 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2106 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 294 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2112 "parser.cpp" - break; - - case 15: // declaration: decl_constant -#line 295 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } -#line 2118 "parser.cpp" - break; - - case 16: // declaration: decl_thread -#line 296 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2124 "parser.cpp" - break; - - case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 301 "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 2130 "parser.cpp" - break; - - case 18: // decl_constant: expr_identifier "=" expr ";" -#line 306 "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 2136 "parser.cpp" - break; - - case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 311 "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 2142 "parser.cpp" - break; - - case 20: // stmt: stmt_block -#line 315 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2148 "parser.cpp" - break; - - case 21: // stmt: stmt_call -#line 316 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2154 "parser.cpp" - break; - - case 22: // stmt: stmt_assign -#line 317 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2160 "parser.cpp" - break; - - case 23: // stmt: stmt_endon -#line 318 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2166 "parser.cpp" - break; - - case 24: // stmt: stmt_notify -#line 319 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2172 "parser.cpp" - break; - - case 25: // stmt: stmt_wait -#line 320 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2178 "parser.cpp" - break; - - case 26: // stmt: stmt_waittill -#line 321 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2184 "parser.cpp" - break; - - case 27: // stmt: stmt_waittillmatch -#line 322 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2190 "parser.cpp" - break; - - case 28: // stmt: stmt_waittillframeend -#line 323 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2196 "parser.cpp" - break; - - case 29: // stmt: stmt_waitframe -#line 324 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } -#line 2202 "parser.cpp" - break; - - case 30: // stmt: stmt_if -#line 325 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2208 "parser.cpp" - break; - - case 31: // stmt: stmt_ifelse -#line 326 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2214 "parser.cpp" - break; - - case 32: // stmt: stmt_while -#line 327 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2220 "parser.cpp" - break; - - case 33: // stmt: stmt_dowhile -#line 328 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2226 "parser.cpp" - break; - - case 34: // stmt: stmt_for -#line 329 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2232 "parser.cpp" - break; - - case 35: // stmt: stmt_foreach -#line 330 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2238 "parser.cpp" - break; - - case 36: // stmt: stmt_switch -#line 331 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2244 "parser.cpp" - break; - - case 37: // stmt: stmt_case -#line 332 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2250 "parser.cpp" - break; - - case 38: // stmt: stmt_default -#line 333 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2256 "parser.cpp" - break; - - case 39: // stmt: stmt_break -#line 334 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2262 "parser.cpp" - break; - - case 40: // stmt: stmt_continue -#line 335 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2268 "parser.cpp" - break; - - case 41: // stmt: stmt_return -#line 336 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2274 "parser.cpp" - break; - - case 42: // stmt: stmt_breakpoint -#line 337 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } -#line 2280 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_begin -#line 338 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2286 "parser.cpp" - break; - - case 44: // stmt: stmt_prof_end -#line 339 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2292 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt -#line 343 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2298 "parser.cpp" - break; - - case 46: // stmt_or_dev: stmt_dev -#line 344 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2304 "parser.cpp" - break; - - case 47: // stmt_list: stmt_list stmt -#line 349 "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 2310 "parser.cpp" - break; - - case 48: // stmt_list: stmt -#line 351 "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 2316 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 356 "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 2322 "parser.cpp" - break; - - case 50: // stmt_or_dev_list: stmt_or_dev -#line 358 "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 2328 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" stmt_list "#/" -#line 362 "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 2334 "parser.cpp" - break; - - case 52: // stmt_dev: "/#" "#/" -#line 363 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2340 "parser.cpp" - break; - - case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 367 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2346 "parser.cpp" - break; - - case 54: // stmt_block: "{" "}" -#line 368 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2352 "parser.cpp" - break; - - case 55: // stmt_expr: expr_assign -#line 373 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2358 "parser.cpp" - break; - - case 56: // stmt_expr: expr_increment -#line 375 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2364 "parser.cpp" - break; - - case 57: // stmt_expr: expr_decrement -#line 377 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2370 "parser.cpp" - break; - - case 58: // stmt_expr: %empty -#line 379 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2376 "parser.cpp" - break; - - case 59: // stmt_call: expr_call ";" -#line 384 "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 2382 "parser.cpp" - break; - - case 60: // stmt_call: expr_method ";" -#line 386 "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 2388 "parser.cpp" - break; - - case 61: // stmt_assign: expr_assign ";" -#line 391 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2394 "parser.cpp" - break; - - case 62: // stmt_assign: expr_increment ";" -#line 393 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2400 "parser.cpp" - break; - - case 63: // stmt_assign: expr_decrement ";" -#line 395 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2406 "parser.cpp" - break; - - case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 400 "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 2412 "parser.cpp" - break; - - case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 405 "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 2418 "parser.cpp" - break; - - case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 407 "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 2424 "parser.cpp" - break; - - case 67: // stmt_wait: "wait" expr ";" -#line 412 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2430 "parser.cpp" - break; - - case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 417 "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 2436 "parser.cpp" - break; - - case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 419 "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 2442 "parser.cpp" - break; - - case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 424 "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 2448 "parser.cpp" - break; - - case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 426 "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 2454 "parser.cpp" - break; - - case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 431 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2460 "parser.cpp" - break; - - case 73: // stmt_waitframe: "waitframe" ";" -#line 436 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2466 "parser.cpp" - break; - - case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 438 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2472 "parser.cpp" - break; - - case 75: // stmt_if: "if" "(" expr ")" stmt -#line 443 "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 2478 "parser.cpp" - break; - - case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 448 "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 2484 "parser.cpp" - break; - - case 77: // stmt_while: "while" "(" expr ")" stmt -#line 453 "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 2490 "parser.cpp" - break; - - case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 458 "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 2496 "parser.cpp" - break; - - case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 463 "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 2502 "parser.cpp" - break; - - case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 468 "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 2508 "parser.cpp" - break; - - case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 470 "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 2514 "parser.cpp" - break; - - case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 475 "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 2520 "parser.cpp" - break; - - case 83: // stmt_case: "case" expr_integer ":" -#line 480 "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 2526 "parser.cpp" - break; - - case 84: // stmt_case: "case" expr_string ":" -#line 482 "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 2532 "parser.cpp" - break; - - case 85: // stmt_default: "default" ":" -#line 487 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2538 "parser.cpp" - break; - - case 86: // stmt_break: "break" ";" -#line 492 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2544 "parser.cpp" - break; - - case 87: // stmt_continue: "continue" ";" -#line 497 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2550 "parser.cpp" - break; - - case 88: // stmt_return: "return" expr ";" -#line 502 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2556 "parser.cpp" - break; - - case 89: // stmt_return: "return" ";" -#line 504 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2562 "parser.cpp" - break; - - case 90: // stmt_breakpoint: "breakpoint" ";" -#line 509 "parser.ypp" - { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } -#line 2568 "parser.cpp" - break; - - case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 514 "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 2574 "parser.cpp" - break; - - case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 519 "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 2580 "parser.cpp" - break; - - case 93: // expr: expr_ternary -#line 523 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2586 "parser.cpp" - break; - - case 94: // expr: expr_binary -#line 524 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2592 "parser.cpp" - break; - - case 95: // expr: expr_primitive -#line 525 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2598 "parser.cpp" - break; - - case 96: // expr_or_empty: expr -#line 529 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2604 "parser.cpp" - break; - - case 97: // expr_or_empty: %empty -#line 530 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2610 "parser.cpp" - break; - - case 98: // expr_assign: expr_tuple "=" expr -#line 535 "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 2616 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "=" expr -#line 537 "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 2622 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "|=" expr -#line 539 "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 2628 "parser.cpp" - break; - - case 101: // expr_assign: expr_object "&=" expr -#line 541 "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 2634 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "^=" expr -#line 543 "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 2640 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "<<=" expr -#line 545 "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 2646 "parser.cpp" - break; - - case 104: // expr_assign: expr_object ">>=" expr -#line 547 "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 2652 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "+=" expr -#line 549 "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 2658 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "-=" expr -#line 551 "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 2664 "parser.cpp" - break; - - case 107: // expr_assign: expr_object "*=" expr -#line 553 "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 2670 "parser.cpp" - break; - - case 108: // expr_assign: expr_object "/=" expr -#line 555 "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 2676 "parser.cpp" - break; - - case 109: // expr_assign: expr_object "%=" expr -#line 557 "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 2682 "parser.cpp" - break; - - case 110: // expr_increment: "++" expr_object -#line 562 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2688 "parser.cpp" - break; - - case 111: // expr_increment: expr_object "++" -#line 564 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2694 "parser.cpp" - break; - - case 112: // expr_decrement: "--" expr_object -#line 569 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2700 "parser.cpp" - break; - - case 113: // expr_decrement: expr_object "--" -#line 571 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2706 "parser.cpp" - break; - - case 114: // expr_ternary: expr "?" expr ":" expr -#line 576 "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 2712 "parser.cpp" - break; - - case 115: // expr_binary: expr "||" expr -#line 581 "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 2718 "parser.cpp" - break; - - case 116: // expr_binary: expr "&&" expr -#line 583 "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 2724 "parser.cpp" - break; - - case 117: // expr_binary: expr "==" expr -#line 585 "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 2730 "parser.cpp" - break; - - case 118: // expr_binary: expr "!=" expr -#line 587 "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 2736 "parser.cpp" - break; - - case 119: // expr_binary: expr "<=" expr -#line 589 "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 2742 "parser.cpp" - break; - - case 120: // expr_binary: expr ">=" expr -#line 591 "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 2748 "parser.cpp" - break; - - case 121: // expr_binary: expr "<" expr -#line 593 "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 2754 "parser.cpp" - break; - - case 122: // expr_binary: expr ">" expr -#line 595 "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 2760 "parser.cpp" - break; - - case 123: // expr_binary: expr "|" expr -#line 597 "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 2766 "parser.cpp" - break; - - case 124: // expr_binary: expr "&" expr -#line 599 "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 2772 "parser.cpp" - break; - - case 125: // expr_binary: expr "^" expr -#line 601 "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 2778 "parser.cpp" - break; - - case 126: // expr_binary: expr "<<" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2784 "parser.cpp" - break; - - case 127: // expr_binary: expr ">>" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2790 "parser.cpp" - break; - - case 128: // expr_binary: expr "+" expr -#line 607 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2796 "parser.cpp" - break; - - case 129: // expr_binary: expr "-" expr -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2802 "parser.cpp" - break; - - case 130: // expr_binary: expr "*" expr -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2808 "parser.cpp" - break; - - case 131: // expr_binary: expr "/" expr -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2814 "parser.cpp" - break; - - case 132: // expr_binary: expr "%" expr -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2820 "parser.cpp" - break; - - case 133: // expr_primitive: expr_complement -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 2826 "parser.cpp" - break; - - case 134: // expr_primitive: expr_negate -#line 620 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 2832 "parser.cpp" - break; - - case 135: // expr_primitive: expr_not -#line 621 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 2838 "parser.cpp" - break; - - case 136: // expr_primitive: expr_call -#line 622 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 2844 "parser.cpp" - break; - - case 137: // expr_primitive: expr_method -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 2850 "parser.cpp" - break; - - case 138: // expr_primitive: expr_add_array -#line 624 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } -#line 2856 "parser.cpp" - break; - - case 139: // expr_primitive: expr_reference -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 2862 "parser.cpp" - break; - - case 140: // expr_primitive: expr_array -#line 626 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 2868 "parser.cpp" - break; - - case 141: // expr_primitive: expr_field -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 2874 "parser.cpp" - break; - - case 142: // expr_primitive: expr_size -#line 628 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 2880 "parser.cpp" - break; - - case 143: // expr_primitive: expr_paren -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 2886 "parser.cpp" - break; - - case 144: // expr_primitive: expr_thisthread -#line 630 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } -#line 2892 "parser.cpp" - break; - - case 145: // expr_primitive: expr_empty_array -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 2898 "parser.cpp" - break; - - case 146: // expr_primitive: expr_undefined -#line 632 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 2904 "parser.cpp" - break; - - case 147: // expr_primitive: expr_game -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 2910 "parser.cpp" - break; - - case 148: // expr_primitive: expr_self -#line 634 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 2916 "parser.cpp" - break; - - case 149: // expr_primitive: expr_anim -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 2922 "parser.cpp" - break; - - case 150: // expr_primitive: expr_level -#line 636 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 2928 "parser.cpp" - break; - - case 151: // expr_primitive: expr_animation -#line 637 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 2934 "parser.cpp" - break; - - case 152: // expr_primitive: expr_animtree -#line 638 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 2940 "parser.cpp" - break; - - case 153: // expr_primitive: expr_identifier -#line 639 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 2946 "parser.cpp" - break; - - case 154: // expr_primitive: expr_istring -#line 640 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 2952 "parser.cpp" - break; - - case 155: // expr_primitive: expr_string -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 2958 "parser.cpp" - break; - - case 156: // expr_primitive: expr_vector -#line 642 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 2964 "parser.cpp" - break; - - case 157: // expr_primitive: expr_float -#line 643 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 2970 "parser.cpp" - break; - - case 158: // expr_primitive: expr_integer -#line 644 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 2976 "parser.cpp" - break; - - case 159: // expr_primitive: expr_false -#line 645 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 2982 "parser.cpp" - break; - - case 160: // expr_primitive: expr_true -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 2988 "parser.cpp" - break; - - case 161: // expr_complement: "~" expr -#line 651 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2994 "parser.cpp" - break; - - case 162: // expr_negate: "-" expr_identifier -#line 656 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 3000 "parser.cpp" - break; - - case 163: // expr_negate: "-" expr_paren -#line 658 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 3006 "parser.cpp" - break; - - case 164: // expr_negate: "-" expr_array -#line 660 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 3012 "parser.cpp" - break; - - case 165: // expr_negate: "-" expr_field -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 3018 "parser.cpp" - break; - - case 166: // expr_not: "!" expr -#line 667 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3024 "parser.cpp" - break; - - case 167: // expr_call: expr_function -#line 671 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3030 "parser.cpp" - break; - - case 168: // expr_call: expr_pointer -#line 672 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3036 "parser.cpp" - break; - - case 169: // expr_method: expr_object expr_function -#line 675 "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 3042 "parser.cpp" - break; - - case 170: // expr_method: expr_object expr_pointer -#line 676 "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 3048 "parser.cpp" - break; - - case 171: // expr_function: expr_identifier "(" expr_arguments ")" -#line 681 "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 3054 "parser.cpp" - break; - - case 172: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 683 "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 3060 "parser.cpp" - break; - - case 173: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 685 "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 3066 "parser.cpp" - break; - - case 174: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 687 "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 3072 "parser.cpp" - break; - - case 175: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 689 "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::childthread); } -#line 3078 "parser.cpp" - break; - - case 176: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 691 "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::childthread); } -#line 3084 "parser.cpp" - break; - - case 177: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 696 "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 3090 "parser.cpp" - break; - - case 178: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 698 "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 3096 "parser.cpp" - break; - - case 179: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 700 "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::childthread); } -#line 3102 "parser.cpp" - break; - - case 180: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 702 "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::builtin); } -#line 3108 "parser.cpp" - break; - - case 181: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 707 "parser.ypp" - { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } -#line 3114 "parser.cpp" - break; - - case 182: // expr_parameters: expr_parameters "," expr_identifier -#line 712 "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 3120 "parser.cpp" - break; - - case 183: // expr_parameters: expr_identifier -#line 714 "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 3126 "parser.cpp" - break; - - case 184: // expr_parameters: %empty -#line 716 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3132 "parser.cpp" - break; - - case 185: // expr_arguments: expr_arguments_no_empty -#line 721 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3138 "parser.cpp" - break; - - case 186: // expr_arguments: %empty -#line 723 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3144 "parser.cpp" - break; - - case 187: // expr_arguments_no_empty: expr_arguments "," expr -#line 728 "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 3150 "parser.cpp" - break; - - case 188: // expr_arguments_no_empty: expr -#line 730 "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 3156 "parser.cpp" - break; - - case 189: // expr_reference: "::" expr_identifier -#line 735 "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 3162 "parser.cpp" - break; - - case 190: // expr_reference: expr_path "::" expr_identifier -#line 737 "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 3168 "parser.cpp" - break; - - case 191: // expr_tuple: "[" expr_tuple_arguments "]" -#line 742 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[1].value.as < ast::expr_tuple::ptr > ()); } -#line 3174 "parser.cpp" - break; - - case 192: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types -#line 747 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::move(yystack_[2].value.as < ast::expr_tuple::ptr > ()); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3180 "parser.cpp" - break; - - case 193: // expr_tuple_arguments: expr_tuple_types -#line 749 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3186 "parser.cpp" - break; - - case 194: // expr_tuple_types: expr_array -#line 753 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3192 "parser.cpp" - break; - - case 195: // expr_tuple_types: expr_field -#line 754 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3198 "parser.cpp" - break; - - case 196: // expr_tuple_types: expr_identifier -#line 755 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3204 "parser.cpp" - break; - - case 197: // expr_array: expr_object "[" expr "]" -#line 760 "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 3210 "parser.cpp" - break; - - case 198: // expr_field: expr_object "." expr_identifier_nosize -#line 765 "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 3216 "parser.cpp" - break; - - case 199: // expr_size: expr_object "." "size" -#line 770 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3222 "parser.cpp" - break; - - case 200: // expr_paren: "(" expr ")" -#line 775 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3228 "parser.cpp" - break; - - case 201: // expr_object: expr_call -#line 779 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3234 "parser.cpp" - break; - - case 202: // expr_object: expr_method -#line 780 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3240 "parser.cpp" - break; - - case 203: // expr_object: expr_array -#line 781 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3246 "parser.cpp" - break; - - case 204: // expr_object: expr_field -#line 782 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3252 "parser.cpp" - break; - - case 205: // expr_object: expr_game -#line 783 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3258 "parser.cpp" - break; - - case 206: // expr_object: expr_self -#line 784 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3264 "parser.cpp" - break; - - case 207: // expr_object: expr_anim -#line 785 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3270 "parser.cpp" - break; - - case 208: // expr_object: expr_level -#line 786 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3276 "parser.cpp" - break; - - case 209: // expr_object: expr_identifier -#line 787 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3282 "parser.cpp" - break; - - case 210: // expr_thisthread: "thisthread" -#line 792 "parser.ypp" - { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } -#line 3288 "parser.cpp" - break; - - case 211: // expr_empty_array: "[" "]" -#line 797 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3294 "parser.cpp" - break; - - case 212: // expr_undefined: "undefined" -#line 802 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3300 "parser.cpp" - break; - - case 213: // expr_game: "game" -#line 807 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3306 "parser.cpp" - break; - - case 214: // expr_self: "self" -#line 812 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3312 "parser.cpp" - break; - - case 215: // expr_anim: "anim" -#line 817 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3318 "parser.cpp" - break; - - case 216: // expr_level: "level" -#line 822 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3324 "parser.cpp" - break; - - case 217: // expr_animation: "%" "identifier" -#line 827 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3330 "parser.cpp" - break; - - case 218: // expr_animtree: "#animtree" -#line 832 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3336 "parser.cpp" - break; - - case 219: // expr_identifier_nosize: "identifier" -#line 837 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3342 "parser.cpp" - break; - - case 220: // expr_identifier: "identifier" -#line 842 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3348 "parser.cpp" - break; - - case 221: // expr_identifier: "size" -#line 844 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3354 "parser.cpp" - break; - - case 222: // expr_path: "identifier" -#line 849 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3360 "parser.cpp" - break; - - case 223: // expr_path: "path" -#line 851 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3366 "parser.cpp" - break; - - case 224: // expr_istring: "localized string" -#line 856 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3372 "parser.cpp" - break; - - case 225: // expr_string: "string literal" -#line 861 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3378 "parser.cpp" - break; - - case 226: // expr_vector: "(" expr "," expr "," expr ")" -#line 866 "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 3384 "parser.cpp" - break; - - case 227: // expr_float: "-" "float" -#line 871 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3390 "parser.cpp" - break; - - case 228: // expr_float: "float" -#line 873 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3396 "parser.cpp" - break; - - case 229: // expr_integer: "-" "integer" -#line 878 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3402 "parser.cpp" - break; - - case 230: // expr_integer: "integer" -#line 880 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3408 "parser.cpp" - break; - - case 231: // expr_false: "false" -#line 885 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3414 "parser.cpp" - break; - - case 232: // expr_true: "true" -#line 890 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3420 "parser.cpp" - break; - - -#line 3424 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "endon", "notify", "wait", - "waittill", "waittillmatch", "waittillframeend", "waitframe", "if", - "else", "do", "while", "for", "foreach", "in", "switch", "case", - "default", "break", "continue", "return", "breakpoint", "prof_begin", - "prof_end", "thread", "childthread", "thisthread", "call", "true", - "false", "undefined", "size", "game", "self", "anim", "level", "(", ")", - "{", "}", "[", "]", ",", ".", "::", ":", ";", "?", "++", "--", "<<", - ">>", "||", "&&", "==", "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", - "-=", "*=", "/=", "%=", "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", - "+", "-", "*", "/", "%", "path", "identifier", "string literal", - "localized string", "float", "integer", "SIZEOF", "ADD_ARRAY", "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_waitframe", "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_negate", - "expr_not", "expr_call", "expr_method", "expr_function", "expr_pointer", - "expr_add_array", "expr_parameters", "expr_arguments", - "expr_arguments_no_empty", "expr_reference", "expr_tuple", - "expr_tuple_arguments", "expr_tuple_types", "expr_array", "expr_field", - "expr_size", "expr_paren", "expr_object", "expr_thisthread", - "expr_empty_array", "expr_undefined", "expr_game", "expr_self", - "expr_anim", "expr_level", "expr_animation", "expr_animtree", - "expr_identifier_nosize", "expr_identifier", "expr_path", "expr_istring", - "expr_string", "expr_vector", "expr_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 S2DEBUG - // 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 S2DEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if S2DEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -287; - - const short parser::yytable_ninf_ = -223; - - const short - parser::yypact_[] = - { - 6, -287, -287, 5, 5, -24, -287, -287, 37, 6, - -287, -287, -287, -287, -287, -287, -8, -287, -287, -13, - -10, -54, -287, -287, -287, -287, -23, 1223, -287, -287, - -287, 11, -12, -287, -287, -42, 3, -287, 17, -287, - -287, -287, -287, -287, -287, -287, 1223, 821, -23, 1223, - 1223, -18, -36, 26, -287, -287, -287, 2187, -287, -287, - -287, -287, -287, -287, 413, 667, -287, -287, -287, -287, - 699, 729, -287, -287, 1012, -287, -287, -287, 1089, 1187, - 1247, 1317, -287, -287, 574, 39, -287, -287, -287, -287, - -287, -287, -287, 15, 96, -23, 49, 75, 81, 114, - 100, 124, 129, 1439, 821, -287, 2270, 134, 136, -287, - -287, -287, 1223, 142, -287, -287, -287, -287, 699, 729, - -287, 1406, -287, -287, -287, -287, 574, 140, -287, -287, - 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, - 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1286, - -20, -287, -287, 152, 1223, -23, -287, 928, -287, -287, - 1223, 1223, -23, 1223, 1223, -23, 1223, -287, 1223, 1917, - 1223, -287, 1605, 1223, 107, -23, 2152, 179, 179, 2301, - 2311, 2383, 2383, 30, 30, 30, 30, 2342, 728, 2352, - 73, 73, -287, -287, -287, 1957, -287, -287, -287, 35, - -287, 154, 1057, 1223, 146, -5, 161, 1370, 165, 166, - 167, 168, -17, 163, 169, 172, 1160, 183, 173, 175, - -287, 139, 548, 548, -287, -287, 980, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, 184, 185, 188, 191, 192, 177, -287, - -287, 51, 152, 1997, 53, 205, 2037, 56, 206, 2077, - 2116, 203, 2270, 1917, 154, 1223, -287, -287, 1223, -287, - -287, 1134, 2222, -287, 209, -287, 1223, 236, 1223, 639, - -23, 1223, 164, 208, 215, -287, -287, -287, -287, 2257, - -287, 1223, 1223, 1286, 32, -287, 62, 86, 8, 1406, - 1406, -287, -287, -287, -287, -287, -287, -287, 1223, 225, - 227, 228, 230, -287, -287, 1223, 1223, 1223, 1223, 1223, - 1223, 1223, 1223, 1223, 1223, 1223, 210, -287, 1223, 226, - -287, 1223, 229, 1223, 232, 2270, 59, -287, -287, -287, - 223, 1639, 235, 1673, 233, -287, -287, -287, 1396, 9, - 1707, -287, -287, -287, 60, 87, -287, 548, 2270, 1223, - 1223, 1223, 1223, 2270, 2270, 2270, 2270, 2270, 2270, 2270, - 2270, 2270, 2270, 2270, 240, 89, 242, 101, 245, 1741, - 1223, -287, -287, 1370, 1223, 1370, 1223, 1223, -23, 96, - 237, 241, -287, 1775, 1483, 1527, 1571, 1223, -287, 1223, - -287, 1223, -287, 103, 273, 1809, -287, 2270, 243, 1843, - 272, -287, -287, -287, 246, 249, 1223, 250, 1223, 251, - 1223, 113, 123, 125, -287, 1370, 252, 639, 1370, 1223, - -287, -287, 254, -287, 262, -287, 286, -287, -287, -287, - -287, -287, 287, -287, 1877, 279, 280, 281, 1370, 1370, - -287, -287, -287, -287, -287 - }; - - const unsigned char - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 221, 220, 0, 2, - 7, 8, 9, 14, 15, 16, 0, 223, 222, 0, - 0, 0, 1, 4, 5, 6, 184, 0, 10, 11, - 225, 0, 0, 183, 218, 0, 0, 210, 0, 232, - 231, 212, 213, 214, 215, 216, 0, 186, 0, 0, - 0, 0, 0, 220, 224, 228, 230, 0, 93, 94, - 95, 133, 134, 135, 136, 137, 167, 168, 138, 139, - 140, 141, 142, 143, 0, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 0, 154, 155, 156, 157, - 158, 159, 160, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 186, 211, 188, 0, 185, 189, - 166, 161, 0, 0, 227, 229, 201, 202, 164, 165, - 163, 0, 205, 206, 207, 208, 162, 0, 217, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 169, 170, 0, 186, 0, 17, 0, 19, 182, - 0, 186, 0, 0, 186, 0, 0, 200, 0, 188, - 0, 181, 0, 0, 0, 0, 0, 126, 127, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 128, 129, 130, 131, 132, 0, 199, 219, 198, 0, - 185, 190, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 54, 0, 0, 0, 45, 50, 0, 46, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 0, 0, 0, 201, 202, 0, 203, - 204, 0, 209, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 187, 0, 0, 0, 197, 171, 186, 52, - 48, 0, 0, 72, 0, 73, 0, 0, 0, 58, - 0, 0, 0, 0, 0, 85, 86, 87, 89, 0, - 90, 186, 186, 0, 0, 193, 203, 204, 209, 110, - 112, 53, 49, 61, 62, 63, 59, 60, 0, 0, - 0, 0, 0, 111, 113, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 173, 186, 0, - 175, 186, 0, 0, 0, 114, 0, 51, 47, 67, - 0, 0, 0, 0, 0, 55, 56, 57, 0, 0, - 0, 84, 83, 88, 0, 0, 191, 0, 98, 0, - 0, 0, 0, 99, 105, 106, 107, 108, 109, 100, - 101, 102, 104, 103, 0, 0, 0, 0, 0, 0, - 186, 172, 74, 0, 0, 0, 97, 0, 0, 0, - 0, 0, 192, 0, 0, 0, 0, 186, 174, 186, - 176, 186, 226, 0, 75, 0, 77, 96, 0, 0, - 0, 82, 91, 92, 0, 0, 186, 0, 186, 0, - 186, 0, 0, 0, 177, 0, 0, 58, 0, 0, - 64, 66, 185, 69, 185, 71, 185, 178, 179, 180, - 76, 78, 0, 80, 0, 0, 0, 0, 0, 0, - 65, 68, 70, 79, 81 - }; - - const short - parser::yypgoto_[] = - { - -287, -287, -287, 295, 336, 338, -287, -287, -287, -194, - 122, -287, -287, -287, -93, -87, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - 189, -287, -286, -277, -274, -287, -287, -287, -287, -287, - -287, -49, -11, -67, -58, -287, -287, 95, -43, -287, - -287, -287, -16, 197, 324, -287, 302, 355, -287, -287, - -287, 380, 417, 452, 490, -287, -287, -287, 0, 7, - -287, -15, -287, -287, 148, -287, -287 - }; - - const short - parser::yydefgoto_[] = - { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 224, - 225, 281, 226, 227, 228, 354, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 106, 418, 253, 254, 255, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 32, 107, 200, 69, - 258, 304, 305, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 198, 84, 85, - 86, 87, 88, 89, 90, 91, 92 - }; - - const short - parser::yytable_[] = - { - 16, 158, 116, 355, 108, 6, 31, 151, 280, 16, - 19, 20, 356, 287, 96, 357, 152, 1, 2, 3, - 4, 5, 35, 36, 6, 38, 33, 196, 21, 6, - 42, 43, 44, 45, 112, 97, 100, 22, 113, 397, - 117, 94, 98, 101, 26, 30, 95, 284, 109, 28, - 6, 126, 29, 6, 151, 17, 53, 285, 127, 99, - 154, 108, 128, 152, 93, -196, -196, 398, 319, 320, - 27, 321, 322, 102, 153, 7, 292, 156, 197, 17, - 53, 127, 30, 114, 115, 56, -222, 348, 277, 366, - 367, 35, 36, 170, 38, 159, 131, 132, 6, 155, - 17, 53, 17, 18, 7, 160, 337, 149, 256, 340, - 174, 170, 391, 400, 170, 323, 324, 170, 170, -194, - -194, 153, 144, 145, 146, 147, 148, 161, 127, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 401, 162, 408, -195, -195, 170, 257, 170, 17, 53, - 157, 355, 164, 256, 410, 201, 434, 262, 256, 170, - 356, 170, 265, 357, 127, 268, 447, 146, 147, 148, - 163, 170, 116, 116, 116, 274, 448, 256, 449, 35, - 36, 170, 38, 170, 165, 166, 6, 42, 43, 44, - 45, 257, 170, 171, 151, 303, 257, 293, 173, 414, - 175, 416, 262, 152, 154, 197, 278, 262, 283, 127, - 117, 117, 117, 286, 127, 257, 57, 288, 289, 290, - 291, 308, 262, 262, 295, 301, 262, 302, 127, 127, - 127, 296, 256, 127, 297, 103, 17, 53, 110, 111, - 116, 450, 151, 151, 453, 300, 313, 314, 118, 199, - 315, 152, 152, 316, 317, 318, 264, 338, 341, 267, - 344, 153, 350, 352, 463, 464, 115, 384, 127, 361, - 257, 144, 145, 146, 147, 148, 362, 369, 117, 370, - 371, 262, 372, 386, 390, 392, 388, 394, 127, 262, - 359, 151, 407, 169, 409, 396, 127, 411, 435, 422, - 152, 172, 439, 423, 23, 437, 421, 455, 440, 153, - 153, 441, 443, 445, 451, 456, 127, 127, 116, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 457, - 458, 460, 461, 462, 256, 24, 256, 25, 312, 263, - 452, 402, 266, 120, 259, 269, 117, 270, 153, 272, - 294, 0, 273, 0, 0, 127, 0, 308, 0, 0, - 0, 0, 0, 346, 127, 119, 0, 0, 0, 0, - 0, 0, 257, 442, 257, 444, 256, 446, 116, 256, - 0, 0, 282, 262, 0, 262, 364, 365, 420, 259, - 127, 0, 127, 0, 259, 299, 121, 0, 0, 256, - 256, 0, 0, 0, 0, 0, 0, 0, 306, 259, - 259, 0, 0, 259, 257, 0, 117, 257, 0, 0, - 0, 122, 0, 385, 0, 262, 387, 262, 262, 0, - 0, 0, 127, 0, 127, 127, 0, 257, 257, 0, - 0, 0, 0, -201, -201, 0, -201, 0, 262, 262, - -201, 0, 0, 0, 345, 127, 127, 0, 123, -201, - 0, 0, -201, 0, 0, 351, 0, 353, 259, 0, - 360, 260, 0, 0, 0, 413, 259, 0, 0, 0, - 0, 0, 273, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 431, 124, 432, 0, 433, 368, 0, 0, - -201, -201, 261, 0, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 260, 0, 0, 0, - 0, 260, 389, 0, 0, 0, 0, 122, 0, 0, - 0, 125, 0, 0, 0, 307, 260, 260, 0, 0, - 260, 0, 0, 0, 0, 0, 0, 261, 403, 404, - 405, 406, 261, 0, 306, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 123, 0, 121, 309, 310, 0, - 0, 261, 122, 415, 0, 417, 419, 122, 35, 36, - 259, 38, 259, 0, 0, 6, 42, 43, 44, 45, - 0, 122, 122, 122, 113, 260, 122, 0, 0, 124, - 0, 0, 0, 260, -209, -209, 0, -209, 0, 123, - 0, -209, 0, 0, 123, 0, 154, 0, 454, 0, - -209, 0, 259, -209, 259, 259, 261, 0, 123, 123, - 123, 0, 0, 123, 358, 17, 53, 125, 0, 0, - 0, 0, 0, 0, 124, 259, 259, 0, 0, 124, - 0, 122, 0, 0, 0, 0, 0, 0, 0, 122, - 0, -209, -209, 124, 124, 124, 0, 0, 124, 35, - 36, 0, 38, 0, 0, 0, 6, 42, 43, 44, - 45, 307, 125, 0, 0, 221, 0, 125, 123, 0, - 0, 0, 0, 222, 223, 0, 123, -202, -202, 0, - -202, 125, 125, 125, -202, 0, 125, 260, 0, 260, - 0, 0, 121, -202, 0, 0, -202, 0, 0, 0, - 0, 0, 0, 124, 0, 0, 17, 53, 0, -203, - -203, 124, -203, 0, 0, 0, -203, 122, 261, 0, - 261, 0, 0, 0, 0, -203, 0, 0, -203, 260, - 0, 260, 260, 0, -202, -202, 0, 0, 0, -204, - -204, 125, -204, 122, 0, 122, -204, 0, 0, 125, - 0, 0, 260, 260, 123, -204, 0, 0, -204, 0, - 261, 0, 358, 261, 131, 132, -203, -203, 135, 136, - 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, - 123, 0, 123, 261, 261, 122, 0, 122, 122, 124, - 144, 145, 146, 147, 148, 0, -204, -204, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 34, 122, 122, - 0, 0, 0, 0, 0, 124, 0, 124, 0, 0, - 0, 0, 123, 0, 123, 123, 0, 125, 0, 0, - 0, 35, 36, 37, 38, 39, 40, 41, 6, 42, - 43, 44, 45, 46, 0, 123, 123, 104, 105, 0, - 0, 48, 0, 125, 0, 125, 0, 124, 0, 124, - 124, 0, 0, 0, 0, 0, 0, 49, 50, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 124, 124, 0, 0, 51, 0, 0, 52, 17, 53, - 30, 54, 55, 56, 0, 125, 0, 125, 125, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, - 0, 0, 0, 0, 0, 0, 0, 203, 125, 125, - 204, 205, 206, 0, 207, 208, 209, 210, 0, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 35, 36, - 0, 38, 0, 0, 0, 6, 42, 43, 44, 45, - 0, 0, 157, 220, 221, 0, 0, 0, 0, 0, - 0, 202, 222, 223, 0, 0, 0, 0, 0, 203, - 0, 0, 204, 205, 206, 0, 207, 208, 209, 210, - 0, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 35, 36, 0, 38, 0, 17, 53, 6, 42, 43, - 44, 45, 0, 0, 157, 311, 221, 0, 0, 0, - 0, 0, 0, 0, 222, 223, 0, 0, 0, 0, - 0, 0, 35, 36, 0, 38, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 149, 279, - 0, 150, 0, 0, 0, 0, 203, 17, 53, 204, - 205, 206, 0, 207, 208, 209, 210, 0, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 35, 36, 0, - 38, 0, 0, 0, 6, 42, 43, 44, 45, 17, - 53, 157, 0, 221, 0, 0, 0, 0, 0, 0, - 0, 222, 223, 0, 0, 0, 0, 0, 0, -205, - -205, 0, -205, 0, 0, 0, -205, 0, 0, 0, - 0, 0, 0, 0, 0, -205, 347, 0, -205, 0, - 0, 0, 0, 203, 17, 53, 204, 205, 206, 0, - 207, 208, 209, 210, 0, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 35, 36, 34, 38, 0, 0, - 0, 6, 42, 43, 44, 45, -205, -205, 157, 0, - 221, 0, 0, 0, 0, 0, 0, 0, 222, 223, - 35, 36, 37, 38, 39, 40, 41, 6, 42, 43, - 44, 45, 46, 0, 0, 0, 47, 0, 0, 0, - 48, 0, 298, 0, 0, 0, 0, -206, -206, 0, - -206, 17, 53, 0, -206, 0, 49, 50, 0, 34, - 0, 0, 0, -206, 0, 0, -206, 0, 0, 0, - 0, 0, 0, 51, 0, 0, 52, 17, 53, 30, - 54, 55, 56, 35, 36, 37, 38, 39, 40, 41, - 6, 42, 43, 44, 45, 46, 0, 0, 0, 47, - 0, 0, 0, 48, -206, -206, 0, -207, -207, 0, - -207, 0, 0, 0, -207, 0, 0, 0, 0, 49, - 50, 0, 34, -207, 0, 0, -207, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 51, 0, 0, 52, - 17, 53, 30, 54, 55, 56, 35, 36, 37, 38, - 39, 40, 41, 6, 42, 43, 44, 45, 46, 0, - 0, 0, 104, 0, -207, -207, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -208, -208, 0, - -208, 0, 49, 50, -208, 0, 0, 0, 0, 0, - 0, 0, 0, -208, 0, 0, -208, 0, 0, 51, - 0, 0, 52, 17, 53, 30, 54, 55, 56, 203, - 0, 0, 204, 205, 206, 0, 207, 208, 209, 210, - 0, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 35, 36, 0, 38, -208, -208, 0, 6, 42, 43, - 44, 45, 0, 0, 157, 0, 221, 0, 0, 0, - 0, 0, 0, 0, 222, 223, 35, 36, 0, 38, - 0, 0, 0, 6, 0, 0, 35, 36, 0, 38, - 0, 0, 149, 6, 0, 174, 0, 0, 0, 0, - 323, 324, 149, 0, 0, 174, 0, 17, 53, 0, - 0, 0, 0, 0, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 0, 0, 0, 0, 0, - 0, 0, 167, 17, 53, 0, 0, 168, 0, 0, - 0, 0, 130, 17, 53, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 425, 0, 0, 0, - 0, 426, 0, 0, 0, 0, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 427, 0, 0, 0, 0, 428, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 429, 0, 0, 0, 0, 430, - 0, 0, 0, 0, 130, 0, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 167, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 393, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 395, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 399, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 412, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 130, 0, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 424, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 130, 0, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 436, 0, 141, 142, 143, 144, 145, 146, - 147, 148, 130, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 438, 0, 141, 142, - 143, 144, 145, 146, 147, 148, 130, 0, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 459, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 271, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 276, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 336, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 339, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 342, 0, 0, 0, 0, 0, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 343, 0, 0, 0, 0, 130, - 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 142, 143, 144, 145, - 146, 147, 148, 275, 0, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 129, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 142, 143, 144, - 145, 146, 147, 148, 349, 130, 0, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 363, - 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 130, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 0, 0, 0, 0, 0, 141, - 142, 143, 144, 145, 146, 147, 148, 131, 132, 0, - 134, 135, 136, 137, 138, 139, 140, 131, 132, 0, - 0, 135, 136, 137, 138, 139, 140, 0, 0, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 0, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 131, 132, - 0, 0, 135, 136, 137, 138, 139, 140, 131, 132, - 0, 0, 135, 136, 137, 138, 139, 140, 0, 0, - 0, 0, 142, 143, 144, 145, 146, 147, 148, 0, - 0, 0, 142, 0, 144, 145, 146, 147, 148, 131, - 132, 0, 0, 0, 0, 137, 138, 139, 140, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 144, 145, 146, 147, 148 - }; - - const short - parser::yycheck_[] = - { - 0, 94, 51, 289, 47, 47, 21, 74, 202, 9, - 3, 4, 289, 207, 56, 289, 74, 11, 12, 13, - 14, 15, 40, 41, 47, 43, 26, 47, 52, 47, - 48, 49, 50, 51, 52, 35, 36, 0, 56, 30, - 51, 53, 35, 36, 52, 99, 58, 52, 48, 62, - 47, 51, 62, 47, 121, 97, 98, 62, 51, 56, - 52, 104, 98, 121, 53, 57, 58, 58, 17, 18, - 78, 20, 21, 56, 74, 98, 93, 62, 98, 97, - 98, 74, 99, 101, 102, 102, 60, 281, 53, 57, - 58, 40, 41, 58, 43, 95, 66, 67, 47, 60, - 97, 98, 97, 98, 98, 56, 53, 56, 157, 53, - 59, 58, 53, 53, 58, 64, 65, 58, 58, 57, - 58, 121, 92, 93, 94, 95, 96, 52, 121, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 53, 60, 53, 57, 58, 58, 157, 58, 97, 98, - 54, 437, 52, 202, 53, 155, 53, 157, 207, 58, - 437, 58, 162, 437, 157, 165, 53, 94, 95, 96, - 56, 58, 221, 222, 223, 175, 53, 226, 53, 40, - 41, 58, 43, 58, 60, 56, 47, 48, 49, 50, - 51, 202, 58, 57, 261, 56, 207, 212, 56, 393, - 60, 395, 202, 261, 52, 98, 52, 207, 62, 202, - 221, 222, 223, 52, 207, 226, 27, 52, 52, 52, - 52, 221, 222, 223, 61, 52, 226, 52, 221, 222, - 223, 62, 281, 226, 62, 46, 97, 98, 49, 50, - 289, 435, 309, 310, 438, 62, 62, 62, 51, 154, - 62, 309, 310, 62, 62, 78, 161, 52, 52, 164, - 57, 261, 53, 27, 458, 459, 102, 57, 261, 61, - 281, 92, 93, 94, 95, 96, 61, 52, 289, 52, - 52, 281, 52, 57, 52, 62, 57, 52, 281, 289, - 290, 358, 52, 104, 52, 62, 289, 52, 25, 62, - 358, 112, 30, 62, 9, 62, 399, 53, 62, 309, - 310, 62, 62, 62, 62, 53, 309, 310, 367, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 53, - 53, 62, 62, 62, 393, 9, 395, 9, 226, 160, - 437, 367, 163, 51, 157, 166, 367, 168, 358, 170, - 212, -1, 173, -1, -1, 358, -1, 367, -1, -1, - -1, -1, -1, 278, 367, 51, -1, -1, -1, -1, - -1, -1, 393, 426, 395, 428, 435, 430, 437, 438, - -1, -1, 203, 393, -1, 395, 301, 302, 398, 202, - 393, -1, 395, -1, 207, 216, 51, -1, -1, 458, - 459, -1, -1, -1, -1, -1, -1, -1, 221, 222, - 223, -1, -1, 226, 435, -1, 437, 438, -1, -1, - -1, 51, -1, 338, -1, 435, 341, 437, 438, -1, - -1, -1, 435, -1, 437, 438, -1, 458, 459, -1, - -1, -1, -1, 40, 41, -1, 43, -1, 458, 459, - 47, -1, -1, -1, 275, 458, 459, -1, 51, 56, - -1, -1, 59, -1, -1, 286, -1, 288, 281, -1, - 291, 157, -1, -1, -1, 390, 289, -1, -1, -1, - -1, -1, 303, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 407, 51, 409, -1, 411, 318, -1, -1, - 97, 98, 157, -1, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, -1, 202, -1, -1, -1, - -1, 207, 343, -1, -1, -1, -1, 157, -1, -1, - -1, 51, -1, -1, -1, 221, 222, 223, -1, -1, - 226, -1, -1, -1, -1, -1, -1, 202, 369, 370, - 371, 372, 207, -1, 367, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 157, -1, 221, 222, 223, -1, - -1, 226, 202, 394, -1, 396, 397, 207, 40, 41, - 393, 43, 395, -1, -1, 47, 48, 49, 50, 51, - -1, 221, 222, 223, 56, 281, 226, -1, -1, 157, - -1, -1, -1, 289, 40, 41, -1, 43, -1, 202, - -1, 47, -1, -1, 207, -1, 52, -1, 439, -1, - 56, -1, 435, 59, 437, 438, 281, -1, 221, 222, - 223, -1, -1, 226, 289, 97, 98, 157, -1, -1, - -1, -1, -1, -1, 202, 458, 459, -1, -1, 207, - -1, 281, -1, -1, -1, -1, -1, -1, -1, 289, - -1, 97, 98, 221, 222, 223, -1, -1, 226, 40, - 41, -1, 43, -1, -1, -1, 47, 48, 49, 50, - 51, 367, 202, -1, -1, 56, -1, 207, 281, -1, - -1, -1, -1, 64, 65, -1, 289, 40, 41, -1, - 43, 221, 222, 223, 47, -1, 226, 393, -1, 395, - -1, -1, 367, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, 281, -1, -1, 97, 98, -1, 40, - 41, 289, 43, -1, -1, -1, 47, 367, 393, -1, - 395, -1, -1, -1, -1, 56, -1, -1, 59, 435, - -1, 437, 438, -1, 97, 98, -1, -1, -1, 40, - 41, 281, 43, 393, -1, 395, 47, -1, -1, 289, - -1, -1, 458, 459, 367, 56, -1, -1, 59, -1, - 435, -1, 437, 438, 66, 67, 97, 98, 70, 71, - 72, 73, 74, 75, -1, -1, -1, -1, -1, -1, - 393, -1, 395, 458, 459, 435, -1, 437, 438, 367, - 92, 93, 94, 95, 96, -1, 97, 98, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 16, 458, 459, - -1, -1, -1, -1, -1, 393, -1, 395, -1, -1, - -1, -1, 435, -1, 437, 438, -1, 367, -1, -1, - -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, -1, 458, 459, 56, 57, -1, - -1, 60, -1, 393, -1, 395, -1, 435, -1, 437, - 438, -1, -1, -1, -1, -1, -1, 76, 77, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 458, 459, -1, -1, 93, -1, -1, 96, 97, 98, - 99, 100, 101, 102, -1, 435, -1, 437, 438, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, - -1, -1, -1, -1, -1, -1, -1, 19, 458, 459, - 22, 23, 24, -1, 26, 27, 28, 29, -1, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - -1, 43, -1, -1, -1, 47, 48, 49, 50, 51, - -1, -1, 54, 55, 56, -1, -1, -1, -1, -1, - -1, 11, 64, 65, -1, -1, -1, -1, -1, 19, - -1, -1, 22, 23, 24, -1, 26, 27, 28, 29, - -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, -1, 43, -1, 97, 98, 47, 48, 49, - 50, 51, -1, -1, 54, 55, 56, -1, -1, -1, - -1, -1, -1, -1, 64, 65, -1, -1, -1, -1, - -1, -1, 40, 41, -1, 43, -1, -1, -1, 47, - -1, -1, -1, -1, -1, -1, -1, -1, 56, 12, - -1, 59, -1, -1, -1, -1, 19, 97, 98, 22, - 23, 24, -1, 26, 27, 28, 29, -1, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, -1, - 43, -1, -1, -1, 47, 48, 49, 50, 51, 97, - 98, 54, -1, 56, -1, -1, -1, -1, -1, -1, - -1, 64, 65, -1, -1, -1, -1, -1, -1, 40, - 41, -1, 43, -1, -1, -1, 47, -1, -1, -1, - -1, -1, -1, -1, -1, 56, 12, -1, 59, -1, - -1, -1, -1, 19, 97, 98, 22, 23, 24, -1, - 26, 27, 28, 29, -1, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 16, 43, -1, -1, - -1, 47, 48, 49, 50, 51, 97, 98, 54, -1, - 56, -1, -1, -1, -1, -1, -1, -1, 64, 65, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, -1, -1, -1, 56, -1, -1, -1, - 60, -1, 62, -1, -1, -1, -1, 40, 41, -1, - 43, 97, 98, -1, 47, -1, 76, 77, -1, 16, - -1, -1, -1, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, 93, -1, -1, 96, 97, 98, 99, - 100, 101, 102, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, -1, -1, -1, 56, - -1, -1, -1, 60, 97, 98, -1, 40, 41, -1, - 43, -1, -1, -1, 47, -1, -1, -1, -1, 76, - 77, -1, 16, 56, -1, -1, 59, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 93, -1, -1, 96, - 97, 98, 99, 100, 101, 102, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, - -1, -1, 56, -1, 97, 98, 60, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, - 43, -1, 76, 77, 47, -1, -1, -1, -1, -1, - -1, -1, -1, 56, -1, -1, 59, -1, -1, 93, - -1, -1, 96, 97, 98, 99, 100, 101, 102, 19, - -1, -1, 22, 23, 24, -1, 26, 27, 28, 29, - -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, -1, 43, 97, 98, -1, 47, 48, 49, - 50, 51, -1, -1, 54, -1, 56, -1, -1, -1, - -1, -1, -1, -1, 64, 65, 40, 41, -1, 43, - -1, -1, -1, 47, -1, -1, 40, 41, -1, 43, - -1, -1, 56, 47, -1, 59, -1, -1, -1, -1, - 64, 65, 56, -1, -1, 59, -1, 97, 98, -1, - -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, -1, -1, -1, -1, -1, - -1, -1, 53, 97, 98, -1, -1, 58, -1, -1, - -1, -1, 63, 97, 98, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 53, -1, -1, -1, - -1, 58, -1, -1, -1, -1, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 53, -1, -1, -1, -1, 58, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 53, -1, -1, -1, -1, 58, - -1, -1, -1, -1, 63, -1, -1, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 63, -1, - -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 53, -1, 89, 90, 91, 92, 93, 94, - 95, 96, 63, -1, -1, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 53, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 53, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 53, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 63, -1, -1, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 63, -1, - -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 53, -1, 89, 90, 91, 92, 93, 94, - 95, 96, 63, -1, -1, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 53, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 63, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 53, -1, 89, 90, 91, 92, 93, 94, 95, 96, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 57, -1, -1, -1, -1, -1, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 58, -1, -1, -1, -1, 63, - -1, -1, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 89, 90, 91, 92, 93, - 94, 95, 96, 61, -1, 63, -1, -1, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 89, 90, 91, 92, 93, 94, 95, 96, 62, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, - 93, 94, 95, 96, 62, 63, -1, -1, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 89, 90, 91, 92, 93, 94, 95, 96, 62, - 63, -1, -1, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 63, -1, -1, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 89, 90, 91, 92, - 93, 94, 95, 96, -1, -1, -1, -1, -1, 89, - 90, 91, 92, 93, 94, 95, 96, 66, 67, -1, - 69, 70, 71, 72, 73, 74, 75, 66, 67, -1, - -1, 70, 71, 72, 73, 74, 75, -1, -1, -1, - 89, 90, 91, 92, 93, 94, 95, 96, -1, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 66, 67, - -1, -1, 70, 71, 72, 73, 74, 75, 66, 67, - -1, -1, 70, 71, 72, 73, 74, 75, -1, -1, - -1, -1, 90, 91, 92, 93, 94, 95, 96, -1, - -1, -1, 90, -1, 92, 93, 94, 95, 96, 66, - 67, -1, -1, -1, -1, 72, 73, 74, 75, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 92, 93, 94, 95, 96 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 47, 98, 114, 115, - 116, 117, 118, 119, 120, 121, 191, 97, 98, 192, - 192, 52, 0, 116, 117, 118, 52, 78, 62, 62, - 99, 194, 169, 191, 16, 40, 41, 42, 43, 44, - 45, 46, 48, 49, 50, 51, 52, 56, 60, 76, - 77, 93, 96, 98, 100, 101, 102, 153, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 172, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 53, 53, 58, 56, 191, 192, 56, - 191, 192, 56, 153, 56, 57, 153, 170, 171, 191, - 153, 153, 52, 56, 101, 102, 164, 165, 176, 177, - 179, 180, 184, 185, 186, 187, 191, 192, 98, 62, - 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 89, 90, 91, 92, 93, 94, 95, 96, 56, - 59, 166, 167, 191, 52, 60, 62, 54, 127, 191, - 56, 52, 60, 56, 52, 60, 56, 53, 58, 153, - 58, 57, 153, 56, 59, 60, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 47, 98, 190, 170, - 171, 191, 11, 19, 22, 23, 24, 26, 27, 28, - 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 55, 56, 64, 65, 122, 123, 125, 126, 127, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 155, 156, 157, 164, 165, 173, 176, - 177, 180, 191, 153, 170, 191, 153, 170, 191, 153, - 153, 57, 153, 153, 191, 61, 57, 53, 52, 12, - 122, 124, 153, 62, 52, 62, 52, 122, 52, 52, - 52, 52, 93, 194, 197, 61, 62, 62, 62, 153, - 62, 52, 52, 56, 174, 175, 176, 177, 191, 180, - 180, 55, 123, 62, 62, 62, 62, 62, 78, 17, - 18, 20, 21, 64, 65, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 57, 53, 52, 57, - 53, 52, 57, 58, 57, 153, 170, 12, 122, 62, - 53, 153, 27, 153, 128, 155, 156, 157, 180, 191, - 153, 61, 61, 62, 170, 170, 57, 58, 153, 52, - 52, 52, 52, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 57, 170, 57, 170, 57, 153, - 52, 53, 62, 53, 52, 53, 62, 30, 58, 53, - 53, 53, 175, 153, 153, 153, 153, 52, 53, 52, - 53, 52, 53, 170, 122, 153, 122, 153, 154, 153, - 191, 127, 62, 62, 53, 53, 58, 53, 58, 53, - 58, 170, 170, 170, 53, 25, 53, 62, 53, 30, - 62, 62, 171, 62, 171, 62, 171, 53, 53, 53, - 122, 62, 128, 122, 153, 53, 53, 53, 53, 53, - 62, 62, 62, 122, 122 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 113, 114, 114, 115, 115, 115, 115, 115, 115, - 116, 117, 118, 118, 118, 118, 118, 119, 120, 121, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 123, 123, 124, 124, 125, - 125, 126, 126, 127, 127, 128, 128, 128, 128, 129, - 129, 130, 130, 130, 131, 132, 132, 133, 134, 134, - 135, 135, 136, 137, 137, 138, 139, 140, 141, 142, - 143, 143, 144, 145, 145, 146, 147, 148, 149, 149, - 150, 151, 152, 153, 153, 153, 154, 154, 155, 155, - 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, - 156, 156, 157, 157, 158, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 161, 162, 162, 162, 162, 163, 164, 164, 165, - 165, 166, 166, 166, 166, 166, 166, 167, 167, 167, - 167, 168, 169, 169, 169, 170, 170, 171, 171, 172, - 172, 173, 174, 174, 175, 175, 175, 176, 177, 178, - 179, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 191, 192, 192, 193, 194, 195, 196, 196, 197, - 197, 198, 199 - }; - - 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, 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, 2, 4, 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, 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, 2, 2, 2, 2, 2, 2, 1, 1, 2, - 2, 4, 6, 5, 7, 5, 7, 8, 9, 9, - 9, 3, 3, 1, 0, 1, 0, 3, 1, 2, - 3, 3, 3, 1, 1, 1, 1, 4, 3, 3, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 2, 1, 2, - 1, 1, 1 - }; - - - - -#if S2DEBUG - const short - parser::yyrline_[] = - { - 0, 263, 263, 264, 268, 270, 272, 274, 276, 278, - 283, 287, 292, 293, 294, 295, 296, 300, 305, 310, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 343, 344, 348, 350, 355, - 357, 362, 363, 367, 368, 372, 374, 376, 379, 383, - 385, 390, 392, 394, 399, 404, 406, 411, 416, 418, - 423, 425, 430, 435, 437, 442, 447, 452, 457, 462, - 467, 469, 474, 479, 481, 486, 491, 496, 501, 503, - 508, 513, 518, 523, 524, 525, 529, 530, 534, 536, - 538, 540, 542, 544, 546, 548, 550, 552, 554, 556, - 561, 563, 568, 570, 575, 580, 582, 584, 586, 588, - 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, - 610, 612, 614, 619, 620, 621, 622, 623, 624, 625, - 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, - 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, - 646, 650, 655, 657, 659, 661, 666, 671, 672, 675, - 676, 680, 682, 684, 686, 688, 690, 695, 697, 699, - 701, 706, 711, 713, 716, 720, 723, 727, 729, 734, - 736, 741, 746, 748, 753, 754, 755, 759, 764, 769, - 774, 779, 780, 781, 782, 783, 784, 785, 786, 787, - 791, 796, 801, 806, 811, 816, 821, 826, 831, 836, - 841, 843, 848, 850, 855, 860, 865, 870, 872, 877, - 879, 884, 889 - }; - - 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 // S2DEBUG - - -#line 13 "parser.ypp" -} } } // xsk::gsc::s2 -#line 4726 "parser.cpp" - -#line 893 "parser.ypp" - - -void xsk::gsc::s2::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/src/s2/xsk/parser.hpp b/src/s2/xsk/parser.hpp deleted file mode 100644 index 1fefa44b..00000000 --- a/src/s2/xsk/parser.hpp +++ /dev/null @@ -1,5601 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// 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::gsc::s2::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_S2_PARSER_HPP_INCLUDED -# define YY_S2_PARSER_HPP_INCLUDED -// "%code requires" blocks. -#line 28 "parser.ypp" - -#ifdef _MSC_VER -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#endif -#include "s2.hpp" -namespace xsk::gsc::s2 { class lexer; } - -#line 58 "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 S2_ASSERT -# include -# define S2_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 - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# 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 S2DEBUG -# if defined YYDEBUG -#if YYDEBUG -# define S2DEBUG 1 -# else -# define S2DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define S2DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined S2DEBUG */ - -#line 13 "parser.ypp" -namespace xsk { namespace gsc { namespace s2 { -#line 207 "parser.hpp" - - - - - /// A Bison parser. - class parser - { - public: -#ifdef S2STYPE -# ifdef __GNUC__ -# pragma GCC message "bison: do not #define S2STYPE in C++, use %define api.value.type" -# endif - typedef S2STYPE value_type; -#else - /// 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 value_type - { - public: - /// Type of *this. - typedef value_type self_type; - - /// Empty construction. - value_type () YY_NOEXCEPT - : yyraw_ () - , yytypeid_ (YY_NULLPTR) - {} - - /// Construct and fill. - template - value_type (YY_RVREF (T) t) - : yytypeid_ (&typeid (T)) - { - S2_ASSERT (sizeof (T) <= size); - new (yyas_ ()) T (YY_MOVE (t)); - } - -#if 201103L <= YY_CPLUSPLUS - /// Non copyable. - value_type (const self_type&) = delete; - /// Non copyable. - self_type& operator= (const self_type&) = delete; -#endif - - /// Destruction, allowed only if empty. - ~value_type () YY_NOEXCEPT - { - S2_ASSERT (!yytypeid_); - } - -# if 201103L <= YY_CPLUSPLUS - /// Instantiate a \a T in here from \a t. - template - T& - emplace (U&&... u) - { - S2_ASSERT (!yytypeid_); - S2_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 () - { - S2_ASSERT (!yytypeid_); - S2_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) - { - S2_ASSERT (!yytypeid_); - S2_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 - { - S2_ASSERT (yytypeid_); - S2_ASSERT (*yytypeid_ == typeid (T)); - S2_ASSERT (sizeof (T) <= size); - return *yyas_ (); - } - - /// Const accessor to a built \a T (for %printer). - template - const T& - as () const YY_NOEXCEPT - { - S2_ASSERT (yytypeid_); - S2_ASSERT (*yytypeid_ == typeid (T)); - S2_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 - { - S2_ASSERT (yytypeid_); - S2_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. - value_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 = yyraw_; - return static_cast (yyp); - } - - /// Const accessor to raw memory as \a T. - template - const T* - yyas_ () const YY_NOEXCEPT - { - const void *yyp = 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_tuple - // expr_tuple_types - // expr_object - char dummy6[sizeof (ast::expr)]; - - // expr_add_array - char dummy7[sizeof (ast::expr_add_array::ptr)]; - - // expr_anim - char dummy8[sizeof (ast::expr_anim::ptr)]; - - // expr_animation - char dummy9[sizeof (ast::expr_animation::ptr)]; - - // expr_animtree - char dummy10[sizeof (ast::expr_animtree::ptr)]; - - // expr_arguments - // expr_arguments_no_empty - char dummy11[sizeof (ast::expr_arguments::ptr)]; - - // expr_array - char dummy12[sizeof (ast::expr_array::ptr)]; - - // expr_call - char dummy13[sizeof (ast::expr_call::ptr)]; - - // expr_complement - char dummy14[sizeof (ast::expr_complement::ptr)]; - - // expr_empty_array - char dummy15[sizeof (ast::expr_empty_array::ptr)]; - - // expr_false - char dummy16[sizeof (ast::expr_false::ptr)]; - - // expr_field - char dummy17[sizeof (ast::expr_field::ptr)]; - - // expr_float - char dummy18[sizeof (ast::expr_float::ptr)]; - - // expr_game - char dummy19[sizeof (ast::expr_game::ptr)]; - - // expr_identifier_nosize - // expr_identifier - char dummy20[sizeof (ast::expr_identifier::ptr)]; - - // expr_integer - char dummy21[sizeof (ast::expr_integer::ptr)]; - - // expr_istring - char dummy22[sizeof (ast::expr_istring::ptr)]; - - // expr_level - char dummy23[sizeof (ast::expr_level::ptr)]; - - // expr_method - char dummy24[sizeof (ast::expr_method::ptr)]; - - // expr_negate - char dummy25[sizeof (ast::expr_negate::ptr)]; - - // expr_not - char dummy26[sizeof (ast::expr_not::ptr)]; - - // expr_parameters - char dummy27[sizeof (ast::expr_parameters::ptr)]; - - // expr_paren - char dummy28[sizeof (ast::expr_paren::ptr)]; - - // expr_path - char dummy29[sizeof (ast::expr_path::ptr)]; - - // expr_reference - char dummy30[sizeof (ast::expr_reference::ptr)]; - - // expr_self - char dummy31[sizeof (ast::expr_self::ptr)]; - - // expr_size - char dummy32[sizeof (ast::expr_size::ptr)]; - - // expr_string - char dummy33[sizeof (ast::expr_string::ptr)]; - - // expr_thisthread - char dummy34[sizeof (ast::expr_thisthread::ptr)]; - - // expr_true - char dummy35[sizeof (ast::expr_true::ptr)]; - - // expr_tuple_arguments - char dummy36[sizeof (ast::expr_tuple::ptr)]; - - // expr_undefined - char dummy37[sizeof (ast::expr_undefined::ptr)]; - - // expr_vector - char dummy38[sizeof (ast::expr_vector::ptr)]; - - // include - char dummy39[sizeof (ast::include::ptr)]; - - // program - char dummy40[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy41[sizeof (ast::stmt)]; - - // stmt_assign - char dummy42[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy43[sizeof (ast::stmt_break::ptr)]; - - // stmt_breakpoint - char dummy44[sizeof (ast::stmt_breakpoint::ptr)]; - - // stmt_call - char dummy45[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy46[sizeof (ast::stmt_case::ptr)]; - - // stmt_continue - char dummy47[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy48[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy49[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy50[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy51[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy52[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy53[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy54[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy55[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy56[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy57[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy58[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy59[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy60[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy61[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy62[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy63[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waitframe - char dummy64[sizeof (ast::stmt_waitframe::ptr)]; - - // stmt_waittill - char dummy65[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy66[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy67[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy68[sizeof (ast::stmt_while::ptr)]; - - // "path" - // "identifier" - // "string literal" - // "localized string" - // "float" - // "integer" - char dummy69[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]; - }; - - /// Whether the content is built: if defined, the name of the stored type. - const std::type_info *yytypeid_; - }; - -#endif - /// Backward compatibility (Bison 3.8). - typedef value_type semantic_type; - - /// Symbol locations. - typedef xsk::gsc::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 - { - S2EMPTY = -2, - S2EOF = 0, // "end of file" - S2error = 1, // error - S2UNDEF = 2, // "invalid token" - SH_DEFINE = 3, // "#define" - SH_UNDEF = 4, // "#undef" - SH_IFDEF = 5, // "#ifdef" - SH_IFNDEF = 6, // "#ifndef" - SH_IF = 7, // "#if" - SH_ELIF = 8, // "#elif" - SH_ELSE = 9, // "#else" - SH_ENDIF = 10, // "#endif" - DEVBEGIN = 11, // "/#" - DEVEND = 12, // "#/" - INLINE = 13, // "#inline" - INCLUDE = 14, // "#include" - USINGTREE = 15, // "#using_animtree" - ANIMTREE = 16, // "#animtree" - ENDON = 17, // "endon" - NOTIFY = 18, // "notify" - WAIT = 19, // "wait" - WAITTILL = 20, // "waittill" - WAITTILLMATCH = 21, // "waittillmatch" - WAITTILLFRAMEEND = 22, // "waittillframeend" - WAITFRAME = 23, // "waitframe" - IF = 24, // "if" - ELSE = 25, // "else" - DO = 26, // "do" - WHILE = 27, // "while" - FOR = 28, // "for" - FOREACH = 29, // "foreach" - IN = 30, // "in" - SWITCH = 31, // "switch" - CASE = 32, // "case" - DEFAULT = 33, // "default" - BREAK = 34, // "break" - CONTINUE = 35, // "continue" - RETURN = 36, // "return" - BREAKPOINT = 37, // "breakpoint" - PROFBEGIN = 38, // "prof_begin" - PROFEND = 39, // "prof_end" - THREAD = 40, // "thread" - CHILDTHREAD = 41, // "childthread" - THISTHREAD = 42, // "thisthread" - CALL = 43, // "call" - TRUE = 44, // "true" - FALSE = 45, // "false" - UNDEFINED = 46, // "undefined" - SIZE = 47, // "size" - GAME = 48, // "game" - SELF = 49, // "self" - ANIM = 50, // "anim" - LEVEL = 51, // "level" - LPAREN = 52, // "(" - RPAREN = 53, // ")" - LBRACE = 54, // "{" - RBRACE = 55, // "}" - LBRACKET = 56, // "[" - RBRACKET = 57, // "]" - COMMA = 58, // "," - DOT = 59, // "." - DOUBLECOLON = 60, // "::" - COLON = 61, // ":" - SEMICOLON = 62, // ";" - QMARK = 63, // "?" - INCREMENT = 64, // "++" - DECREMENT = 65, // "--" - LSHIFT = 66, // "<<" - RSHIFT = 67, // ">>" - OR = 68, // "||" - AND = 69, // "&&" - EQUALITY = 70, // "==" - INEQUALITY = 71, // "!=" - LESS_EQUAL = 72, // "<=" - GREATER_EQUAL = 73, // ">=" - LESS = 74, // "<" - GREATER = 75, // ">" - NOT = 76, // "!" - COMPLEMENT = 77, // "~" - ASSIGN = 78, // "=" - ASSIGN_ADD = 79, // "+=" - ASSIGN_SUB = 80, // "-=" - ASSIGN_MUL = 81, // "*=" - ASSIGN_DIV = 82, // "/=" - ASSIGN_MOD = 83, // "%=" - ASSIGN_BW_OR = 84, // "|=" - ASSIGN_BW_AND = 85, // "&=" - ASSIGN_BW_EXOR = 86, // "^=" - ASSIGN_RSHIFT = 87, // ">>=" - ASSIGN_LSHIFT = 88, // "<<=" - BITWISE_OR = 89, // "|" - BITWISE_AND = 90, // "&" - BITWISE_EXOR = 91, // "^" - ADD = 92, // "+" - SUB = 93, // "-" - MUL = 94, // "*" - DIV = 95, // "/" - MOD = 96, // "%" - PATH = 97, // "path" - IDENTIFIER = 98, // "identifier" - STRING = 99, // "string literal" - ISTRING = 100, // "localized string" - FLOAT = 101, // "float" - INTEGER = 102, // "integer" - SIZEOF = 103, // SIZEOF - ADD_ARRAY = 104, // ADD_ARRAY - THEN = 105, // THEN - TERN = 106, // TERN - NEG = 107, // NEG - ANIMREF = 108, // ANIMREF - PREINC = 109, // PREINC - PREDEC = 110, // PREDEC - POSTINC = 111, // POSTINC - POSTDEC = 112 // POSTDEC - }; - /// Backward compatibility alias (Bison 3.6). - typedef token_kind_type yytokentype; - }; - - /// Token kind, as returned by yylex. - typedef token::token_kind_type 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 = 113, ///< Number of tokens. - S_YYEMPTY = -2, - S_YYEOF = 0, // "end of file" - S_YYerror = 1, // error - S_YYUNDEF = 2, // "invalid token" - S_SH_DEFINE = 3, // "#define" - S_SH_UNDEF = 4, // "#undef" - S_SH_IFDEF = 5, // "#ifdef" - S_SH_IFNDEF = 6, // "#ifndef" - S_SH_IF = 7, // "#if" - S_SH_ELIF = 8, // "#elif" - S_SH_ELSE = 9, // "#else" - S_SH_ENDIF = 10, // "#endif" - S_DEVBEGIN = 11, // "/#" - S_DEVEND = 12, // "#/" - S_INLINE = 13, // "#inline" - S_INCLUDE = 14, // "#include" - S_USINGTREE = 15, // "#using_animtree" - S_ANIMTREE = 16, // "#animtree" - S_ENDON = 17, // "endon" - S_NOTIFY = 18, // "notify" - S_WAIT = 19, // "wait" - S_WAITTILL = 20, // "waittill" - S_WAITTILLMATCH = 21, // "waittillmatch" - S_WAITTILLFRAMEEND = 22, // "waittillframeend" - S_WAITFRAME = 23, // "waitframe" - S_IF = 24, // "if" - S_ELSE = 25, // "else" - S_DO = 26, // "do" - S_WHILE = 27, // "while" - S_FOR = 28, // "for" - S_FOREACH = 29, // "foreach" - S_IN = 30, // "in" - S_SWITCH = 31, // "switch" - S_CASE = 32, // "case" - S_DEFAULT = 33, // "default" - S_BREAK = 34, // "break" - S_CONTINUE = 35, // "continue" - S_RETURN = 36, // "return" - S_BREAKPOINT = 37, // "breakpoint" - S_PROFBEGIN = 38, // "prof_begin" - S_PROFEND = 39, // "prof_end" - S_THREAD = 40, // "thread" - S_CHILDTHREAD = 41, // "childthread" - S_THISTHREAD = 42, // "thisthread" - S_CALL = 43, // "call" - S_TRUE = 44, // "true" - S_FALSE = 45, // "false" - S_UNDEFINED = 46, // "undefined" - S_SIZE = 47, // "size" - S_GAME = 48, // "game" - S_SELF = 49, // "self" - S_ANIM = 50, // "anim" - S_LEVEL = 51, // "level" - S_LPAREN = 52, // "(" - S_RPAREN = 53, // ")" - S_LBRACE = 54, // "{" - S_RBRACE = 55, // "}" - S_LBRACKET = 56, // "[" - S_RBRACKET = 57, // "]" - S_COMMA = 58, // "," - S_DOT = 59, // "." - S_DOUBLECOLON = 60, // "::" - S_COLON = 61, // ":" - S_SEMICOLON = 62, // ";" - S_QMARK = 63, // "?" - S_INCREMENT = 64, // "++" - S_DECREMENT = 65, // "--" - S_LSHIFT = 66, // "<<" - S_RSHIFT = 67, // ">>" - S_OR = 68, // "||" - S_AND = 69, // "&&" - S_EQUALITY = 70, // "==" - S_INEQUALITY = 71, // "!=" - S_LESS_EQUAL = 72, // "<=" - S_GREATER_EQUAL = 73, // ">=" - S_LESS = 74, // "<" - S_GREATER = 75, // ">" - S_NOT = 76, // "!" - S_COMPLEMENT = 77, // "~" - S_ASSIGN = 78, // "=" - S_ASSIGN_ADD = 79, // "+=" - S_ASSIGN_SUB = 80, // "-=" - S_ASSIGN_MUL = 81, // "*=" - S_ASSIGN_DIV = 82, // "/=" - S_ASSIGN_MOD = 83, // "%=" - S_ASSIGN_BW_OR = 84, // "|=" - S_ASSIGN_BW_AND = 85, // "&=" - S_ASSIGN_BW_EXOR = 86, // "^=" - S_ASSIGN_RSHIFT = 87, // ">>=" - S_ASSIGN_LSHIFT = 88, // "<<=" - S_BITWISE_OR = 89, // "|" - S_BITWISE_AND = 90, // "&" - S_BITWISE_EXOR = 91, // "^" - S_ADD = 92, // "+" - S_SUB = 93, // "-" - S_MUL = 94, // "*" - S_DIV = 95, // "/" - S_MOD = 96, // "%" - S_PATH = 97, // "path" - S_IDENTIFIER = 98, // "identifier" - S_STRING = 99, // "string literal" - S_ISTRING = 100, // "localized string" - S_FLOAT = 101, // "float" - S_INTEGER = 102, // "integer" - S_SIZEOF = 103, // SIZEOF - S_ADD_ARRAY = 104, // ADD_ARRAY - S_THEN = 105, // THEN - S_TERN = 106, // TERN - S_NEG = 107, // NEG - S_ANIMREF = 108, // ANIMREF - S_PREINC = 109, // PREINC - S_PREDEC = 110, // PREDEC - S_POSTINC = 111, // POSTINC - S_POSTDEC = 112, // POSTDEC - S_YYACCEPT = 113, // $accept - S_root = 114, // root - S_program = 115, // program - S_inline = 116, // inline - S_include = 117, // include - S_declaration = 118, // declaration - S_decl_usingtree = 119, // decl_usingtree - S_decl_constant = 120, // decl_constant - S_decl_thread = 121, // decl_thread - S_stmt = 122, // stmt - S_stmt_or_dev = 123, // stmt_or_dev - S_stmt_list = 124, // stmt_list - S_stmt_or_dev_list = 125, // stmt_or_dev_list - S_stmt_dev = 126, // stmt_dev - S_stmt_block = 127, // stmt_block - S_stmt_expr = 128, // stmt_expr - S_stmt_call = 129, // stmt_call - S_stmt_assign = 130, // stmt_assign - S_stmt_endon = 131, // stmt_endon - S_stmt_notify = 132, // stmt_notify - S_stmt_wait = 133, // stmt_wait - S_stmt_waittill = 134, // stmt_waittill - S_stmt_waittillmatch = 135, // stmt_waittillmatch - S_stmt_waittillframeend = 136, // stmt_waittillframeend - S_stmt_waitframe = 137, // stmt_waitframe - S_stmt_if = 138, // stmt_if - S_stmt_ifelse = 139, // stmt_ifelse - S_stmt_while = 140, // stmt_while - S_stmt_dowhile = 141, // stmt_dowhile - S_stmt_for = 142, // stmt_for - S_stmt_foreach = 143, // stmt_foreach - S_stmt_switch = 144, // stmt_switch - S_stmt_case = 145, // stmt_case - S_stmt_default = 146, // stmt_default - S_stmt_break = 147, // stmt_break - S_stmt_continue = 148, // stmt_continue - S_stmt_return = 149, // stmt_return - S_stmt_breakpoint = 150, // stmt_breakpoint - S_stmt_prof_begin = 151, // stmt_prof_begin - S_stmt_prof_end = 152, // stmt_prof_end - S_expr = 153, // expr - S_expr_or_empty = 154, // expr_or_empty - S_expr_assign = 155, // expr_assign - S_expr_increment = 156, // expr_increment - S_expr_decrement = 157, // expr_decrement - S_expr_ternary = 158, // expr_ternary - S_expr_binary = 159, // expr_binary - S_expr_primitive = 160, // expr_primitive - S_expr_complement = 161, // expr_complement - S_expr_negate = 162, // expr_negate - S_expr_not = 163, // expr_not - S_expr_call = 164, // expr_call - S_expr_method = 165, // expr_method - S_expr_function = 166, // expr_function - S_expr_pointer = 167, // expr_pointer - S_expr_add_array = 168, // expr_add_array - S_expr_parameters = 169, // expr_parameters - S_expr_arguments = 170, // expr_arguments - S_expr_arguments_no_empty = 171, // expr_arguments_no_empty - S_expr_reference = 172, // expr_reference - S_expr_tuple = 173, // expr_tuple - S_expr_tuple_arguments = 174, // expr_tuple_arguments - S_expr_tuple_types = 175, // expr_tuple_types - S_expr_array = 176, // expr_array - S_expr_field = 177, // expr_field - S_expr_size = 178, // expr_size - S_expr_paren = 179, // expr_paren - S_expr_object = 180, // expr_object - S_expr_thisthread = 181, // expr_thisthread - S_expr_empty_array = 182, // expr_empty_array - S_expr_undefined = 183, // expr_undefined - S_expr_game = 184, // expr_game - S_expr_self = 185, // expr_self - S_expr_anim = 186, // expr_anim - S_expr_level = 187, // expr_level - S_expr_animation = 188, // expr_animation - S_expr_animtree = 189, // expr_animtree - S_expr_identifier_nosize = 190, // expr_identifier_nosize - S_expr_identifier = 191, // expr_identifier - S_expr_path = 192, // expr_path - S_expr_istring = 193, // expr_istring - S_expr_string = 194, // expr_string - S_expr_vector = 195, // expr_vector - S_expr_float = 196, // expr_float - S_expr_integer = 197, // expr_integer - S_expr_false = 198, // expr_false - S_expr_true = 199 // 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 () YY_NOEXCEPT - : 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::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_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_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_add_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_add_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_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_animtree::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_animtree::ptr& v, const location_type& l) - : 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_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_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_negate::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l) - : 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_thisthread::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_thisthread::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_tuple::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_tuple::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::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_waitframe::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_waitframe::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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.template destroy< ast::expr_add_array::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_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.template destroy< ast::expr_negate::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_thisthread: // expr_thisthread - value.template destroy< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - value.template destroy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.template destroy< ast::stmt_waitframe::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_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_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. - value_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 - { - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; - - /// Default constructor. - by_kind () YY_NOEXCEPT; - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that) YY_NOEXCEPT; -#endif - - /// Copy constructor. - by_kind (const by_kind& that) YY_NOEXCEPT; - - /// Constructor from (external) token numbers. - by_kind (kind_type t) YY_NOEXCEPT; - - - - /// 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 () YY_NOEXCEPT {} - - /// Constructor for valueless symbols, and symbols from each type. -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, location_type l) - : super_type (token_kind_type (tok), std::move (l)) -#else - symbol_type (int tok, const location_type& l) - : super_type (token_kind_type (tok), l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - S2_ASSERT (tok == token::S2EOF - || (token::S2error <= tok && tok <= token::MOD) - || (token::SIZEOF <= tok && tok <= token::POSTDEC)); -#endif - } -#if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, std::string v, location_type l) - : super_type (token_kind_type (tok), std::move (v), std::move (l)) -#else - symbol_type (int tok, const std::string& v, const location_type& l) - : super_type (token_kind_type (tok), v, l) -#endif - { -#if !defined _MSC_VER || defined __clang__ - S2_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); -#endif - } - }; - - /// Build a parser object. - parser (xsk::gsc::s2::lexer& lexer_yyarg, xsk::gsc::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 S2DEBUG - /// 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 token kind. -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_S2EOF (location_type l) - { - return symbol_type (token::S2EOF, std::move (l)); - } -#else - static - symbol_type - make_S2EOF (const location_type& l) - { - return symbol_type (token::S2EOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_S2error (location_type l) - { - return symbol_type (token::S2error, std::move (l)); - } -#else - static - symbol_type - make_S2error (const location_type& l) - { - return symbol_type (token::S2error, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_S2UNDEF (location_type l) - { - return symbol_type (token::S2UNDEF, std::move (l)); - } -#else - static - symbol_type - make_S2UNDEF (const location_type& l) - { - return symbol_type (token::S2UNDEF, 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_ANIMTREE (location_type l) - { - return symbol_type (token::ANIMTREE, std::move (l)); - } -#else - static - symbol_type - make_ANIMTREE (const location_type& l) - { - return symbol_type (token::ANIMTREE, 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_WAITFRAME (location_type l) - { - return symbol_type (token::WAITFRAME, std::move (l)); - } -#else - static - symbol_type - make_WAITFRAME (const location_type& l) - { - return symbol_type (token::WAITFRAME, 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_CHILDTHREAD (location_type l) - { - return symbol_type (token::CHILDTHREAD, std::move (l)); - } -#else - static - symbol_type - make_CHILDTHREAD (const location_type& l) - { - return symbol_type (token::CHILDTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_THISTHREAD (location_type l) - { - return symbol_type (token::THISTHREAD, std::move (l)); - } -#else - static - symbol_type - make_THISTHREAD (const location_type& l) - { - return symbol_type (token::THISTHREAD, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_CALL (location_type l) - { - return symbol_type (token::CALL, std::move (l)); - } -#else - static - symbol_type - make_CALL (const location_type& l) - { - return symbol_type (token::CALL, 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_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_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_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_SIZEOF (location_type l) - { - return symbol_type (token::SIZEOF, std::move (l)); - } -#else - static - symbol_type - make_SIZEOF (const location_type& l) - { - return symbol_type (token::SIZEOF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_ADD_ARRAY (location_type l) - { - return symbol_type (token::ADD_ARRAY, std::move (l)); - } -#else - static - symbol_type - make_ADD_ARRAY (const location_type& l) - { - return symbol_type (token::ADD_ARRAY, 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) YY_NOEXCEPT; - - /// 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) YY_NOEXCEPT; - - 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_kind_type enum. - static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; - - - - // 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 symbol kind of the accessing symbol of - // state STATE-NUM. - static const unsigned char yystos_[]; - - // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. - static const unsigned char yyr1_[]; - - // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. - static const signed char yyr2_[]; - - -#if S2DEBUG - // 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT - : 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) YY_NOEXCEPT; - - /// Constants. - enum - { - yylast_ = 2479, ///< Last index in yytable_. - yynnts_ = 87, ///< Number of nonterminal symbols. - yyfinal_ = 22 ///< Termination state number. - }; - - - // User arguments. - xsk::gsc::s2::lexer& lexer; - xsk::gsc::ast::program::ptr& ast; - - }; - - inline - parser::symbol_kind_type - parser::yytranslate_ (int t) YY_NOEXCEPT - { - 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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::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_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); - 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_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::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_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_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::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_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); - 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_identifier_nosize: // expr_identifier_nosize - 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_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_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); - 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_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::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_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_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 () YY_NOEXCEPT - : kind_ (symbol_kind::S_YYEMPTY) - {} - -#if 201103L <= YY_CPLUSPLUS - inline - parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT - : kind_ (that.kind_) - { - that.clear (); - } -#endif - - inline - parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT - : kind_ (that.kind_) - {} - - inline - parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT - : 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::gsc::s2 -#line 5597 "parser.hpp" - - - - -#endif // !YY_S2_PARSER_HPP_INCLUDED diff --git a/src/s2/xsk/resolver.hpp b/src/s2/xsk/resolver.hpp deleted file mode 100644 index 0edafe96..00000000 --- a/src/s2/xsk/resolver.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::s2 -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint16_t; - static auto token_name(std::uint16_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/s2.cpp b/src/s2/xsk/s2.cpp deleted file mode 100644 index 1395ba6a..00000000 --- a/src/s2/xsk/s2.cpp +++ /dev/null @@ -1,183 +0,0 @@ -// 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 "s2.hpp" - -namespace xsk::gsc::s2 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_Return: - case opcode::OP_BoolNot: - case opcode::OP_CastBool: - case opcode::OP_inequality: - case opcode::OP_GetThisthread: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_End: - case opcode::OP_size: - case opcode::OP_EmptyArray: - case opcode::OP_bit_and: - case opcode::OP_less_equal: - case opcode::OP_voidCodepos: - case opcode::OP_ClearVariableField: - case opcode::OP_divide: - case opcode::OP_GetSelf: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_plus: - case opcode::OP_BoolComplement: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_inc: - case opcode::OP_clearparams: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_endon: - case opcode::OP_greater_equal: - case opcode::OP_GetSelfObject: - case opcode::OP_SetVariableField: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_less: - case opcode::OP_GetGameRef: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitFrame: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_notify: - case opcode::OP_DecTop: - case opcode::OP_shift_left: - case opcode::OP_greater: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_minus: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_multiply: - case opcode::OP_mod: - case opcode::OP_GetGame: - case opcode::OP_waittill: - case opcode::OP_dec: - case opcode::OP_PreScriptCall: - case opcode::OP_GetAnim: - case opcode::OP_GetUndefined: - case opcode::OP_GetAnimObject: - case opcode::OP_GetLevelObject: - case opcode::OP_bit_ex_or: - case opcode::OP_equality: - case opcode::OP_ClearArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_EvalArray: - case opcode::OP_vector: - case opcode::OP_bit_or: - case opcode::OP_AddArray: - case opcode::OP_waittillmatch2: - case opcode::OP_shift_right: - case opcode::OP_BoolNotAfterAnd: - return 1; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_CallBuiltinPointer: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_GetAnimTree: - case opcode::OP_GetNegByte: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_GetByte: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_waittillmatch: - return 2; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_GetUnsignedShort: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_jumpback: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - case opcode::OP_JumpOnFalse: - case opcode::OP_endswitch: - return 3; - case opcode::OP_CallBuiltin: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_GetLocalFunction: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarMethodCall: - return 4; - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_GetFloat: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_switch: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - case opcode::OP_jump: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_GetInteger: - case opcode::OP_GetString: - case opcode::OP_GetIString: - return 5; - case opcode::OP_GetAnimation: - return 9; - case opcode::OP_GetVector: - return 13; - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/s2.hpp b/src/s2/xsk/s2.hpp deleted file mode 100644 index 4b92c6a4..00000000 --- a/src/s2/xsk/s2.hpp +++ /dev/null @@ -1,184 +0,0 @@ -// 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 "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::s2 -{ - -constexpr std::uint16_t max_string_id = 0xACEE; - -enum class opcode : std::uint8_t -{ - OP_SetNewLocalVariableFieldCached0 = 0x17, - OP_EvalSelfFieldVariable = 0x18, - OP_Return = 0x19, - OP_CallBuiltin0 = 0x1A, - OP_CallBuiltin1 = 0x1B, - OP_CallBuiltin2 = 0x1C, - OP_CallBuiltin3 = 0x1D, - OP_CallBuiltin4 = 0x1E, - OP_CallBuiltin5 = 0x1F, - OP_CallBuiltin = 0x20, - OP_BoolNot = 0x21, - OP_ScriptFarMethodThreadCall = 0x22, - OP_JumpOnTrueExpr = 0x23, - OP_SetLevelFieldVariableField = 0x24, - OP_CastBool = 0x25, - OP_EvalNewLocalArrayRefCached0 = 0x26, - OP_CallBuiltinPointer = 0x27, - OP_inequality = 0x28, - OP_GetThisthread = 0x29, - OP_ClearFieldVariable = 0x2A, - OP_GetFloat = 0x2B, - OP_SafeCreateVariableFieldCached = 0x2C, - OP_ScriptFarFunctionCall2 = 0x2D, - OP_ScriptFarFunctionCall = 0x2E, - OP_ScriptFarChildThreadCall = 0x2F, - OP_ClearLocalVariableFieldCached0 = 0x30, - OP_ClearLocalVariableFieldCached = 0x31, - OP_checkclearparams = 0x32, - OP_CastFieldObject = 0x33, - OP_End = 0x34, - OP_size = 0x35, - OP_EmptyArray = 0x36, - OP_bit_and = 0x37, - OP_less_equal = 0x38, - OP_voidCodepos = 0x39, - OP_ScriptMethodThreadCallPointer = 0x3A, - OP_endswitch = 0x3B, - OP_ClearVariableField = 0x3C, - OP_divide = 0x3D, - OP_ScriptFarMethodChildThreadCall = 0x3E, - OP_GetUnsignedShort = 0x3F, - OP_JumpOnTrue = 0x40, - OP_GetSelf = 0x41, - OP_ScriptFarThreadCall = 0x42, - OP_ScriptLocalThreadCall = 0x43, - OP_SetLocalVariableFieldCached0 = 0x44, - OP_SetLocalVariableFieldCached = 0x45, - OP_plus = 0x46, - OP_BoolComplement = 0x47, - OP_ScriptMethodCallPointer = 0x48, - OP_inc = 0x49, - OP_RemoveLocalVariables = 0x4A, - OP_JumpOnFalseExpr = 0x4B, - OP_switch = 0x4C, - OP_clearparams = 0x4D, - OP_EvalLocalVariableRefCached0 = 0x4E, - OP_EvalLocalVariableRefCached = 0x4F, - OP_ScriptLocalMethodCall = 0x50, - OP_EvalFieldVariable = 0x51, - OP_EvalFieldVariableRef = 0x52, - OP_GetString = 0x53, - OP_ScriptFunctionCallPointer = 0x54, - OP_EvalLevelFieldVariable = 0x55, - OP_GetVector = 0x56, - OP_endon = 0x57, - OP_greater_equal = 0x58, - OP_GetSelfObject = 0x59, - OP_SetAnimFieldVariableField = 0x5A, - OP_SetVariableField = 0x5B, - OP_ScriptLocalFunctionCall2 = 0x5C, - OP_ScriptLocalFunctionCall = 0x5D, - OP_EvalLocalArrayRefCached0 = 0x5E, - OP_EvalLocalArrayRefCached = 0x5F, - OP_GetFarFunction = 0x60, - OP_less = 0x61, - OP_GetGameRef = 0x62, - OP_waittillFrameEnd = 0x63, - OP_waitFrame = 0x64, - OP_SafeSetVariableFieldCached0 = 0x65, - OP_SafeSetVariableFieldCached = 0x66, - OP_ScriptMethodChildThreadCallPointer = 0x67, - OP_GetLevel = 0x68, - OP_notify = 0x69, - OP_DecTop = 0x6A, - OP_shift_left = 0x6B, - OP_ScriptLocalMethodThreadCall = 0x6C, - OP_ScriptLocalMethodChildThreadCall = 0x6D, - OP_greater = 0x6E, - OP_EvalLocalVariableCached0 = 0x6F, - OP_EvalLocalVariableCached1 = 0x70, - OP_EvalLocalVariableCached2 = 0x71, - OP_EvalLocalVariableCached3 = 0x72, - OP_EvalLocalVariableCached4 = 0x73, - OP_EvalLocalVariableCached5 = 0x74, - OP_EvalLocalVariableCached = 0x75, - OP_SafeSetWaittillVariableFieldCached = 0x76, - OP_jump = 0x77, - OP_ScriptThreadCallPointer = 0x78, - OP_GetZero = 0x79, - OP_wait = 0x7A, - OP_minus = 0x7B, - OP_SetSelfFieldVariableField = 0x7C, - OP_EvalNewLocalVariableRefCached0 = 0x7D, - OP_multiply = 0x7E, - OP_CreateLocalVariable = 0x7F, - OP_ScriptLocalChildThreadCall = 0x80, - OP_GetInteger = 0x81, - OP_mod = 0x82, - OP_EvalAnimFieldVariableRef = 0x83, - OP_GetBuiltinFunction = 0x84, - OP_GetGame = 0x85, - OP_waittill = 0x86, - OP_dec = 0x87, - OP_EvalLocalVariableObjectCached = 0x88, - OP_PreScriptCall = 0x89, - OP_GetAnim = 0x8A, - OP_GetUndefined = 0x8B, - OP_EvalLevelFieldVariableRef = 0x8C, - OP_GetAnimObject = 0x8D, - OP_GetLevelObject = 0x8E, - OP_bit_ex_or = 0x8F, - OP_equality = 0x90, - OP_ClearArray = 0x91, - OP_jumpback = 0x92, - OP_GetAnimation = 0x93, - OP_EvalAnimFieldVariable = 0x94, - OP_GetAnimTree = 0x95, - OP_GetIString = 0x96, - OP_EvalArrayRef = 0x97, - OP_EvalSelfFieldVariableRef = 0x98, - OP_GetNegByte = 0x99, - OP_GetBuiltinMethod = 0x9A, - OP_CallBuiltinMethodPointer = 0x9B, - OP_EvalArray = 0x9C, - OP_vector = 0x9D, - OP_ScriptFarMethodCall = 0x9E, - OP_EvalLocalArrayCached = 0x9F, - OP_GetByte = 0xA0, - OP_ScriptChildThreadCallPointer = 0xA1, - OP_bit_or = 0xA2, - OP_AddArray = 0xA3, - OP_waittillmatch2 = 0xA4, - OP_waittillmatch = 0xA5, - OP_GetLocalFunction = 0xA6, - OP_GetNegUnsignedShort = 0xA7, - OP_shift_right = 0xA8, - OP_CallBuiltinMethod0 = 0xA9, - OP_CallBuiltinMethod1 = 0xAA, - OP_CallBuiltinMethod2 = 0xAB, - OP_CallBuiltinMethod3 = 0xAC, - OP_CallBuiltinMethod4 = 0xAD, - OP_CallBuiltinMethod5 = 0xAE, - OP_CallBuiltinMethod = 0xAF, - OP_JumpOnFalse = 0xB0, - OP_BoolNotAfterAnd = 0xB1, - OP_Count = 0xB2, -}; - -auto opcode_size(std::uint8_t op) -> std::uint32_t; - -} // namespace xsk::gsc::s2 diff --git a/src/s4/s4.cpp b/src/s4/s4.cpp new file mode 100644 index 00000000..ca586cc1 --- /dev/null +++ b/src/s4/s4.cpp @@ -0,0 +1,53 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s4.hpp" + +namespace xsk::gsc::s4 +{ + +extern std::array, code_count> const code_list; +extern std::array, func_count> const func_list; +extern std::array, meth_count> const meth_list; +extern std::array, token_count> const token_list; + +context::context() : gsc::context(props::str4 | props::tok4 | props::waitframe | props::params | props::boolfuncs | props::boolnotand | props::offs8, + engine::s4, endian::little, system::pc, max_string_id) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + func_map_.reserve(func_list.size()); + func_map_rev_.reserve(func_list.size()); + meth_map_.reserve(meth_list.size()); + meth_map_rev_.reserve(meth_list.size()); + token_map_.reserve(token_list.size()); + token_map_rev_.reserve(token_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : func_list) + { + func_map_.insert({ entry.first, entry.second }); + func_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : meth_list) + { + meth_map_.insert({ entry.first, entry.second }); + meth_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : token_list) + { + token_map_.insert({ entry.first, entry.second }); + token_map_rev_.insert({ entry.second, entry.first }); + } +} + +} // namespace xsk::gsc::s4 diff --git a/src/s4/s4.hpp b/src/s4/s4.hpp new file mode 100644 index 00000000..4250cdfa --- /dev/null +++ b/src/s4/s4.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "stdinc.hpp" +#include "gsc/context.hpp" + +namespace xsk::gsc::s4 +{ + +constexpr usize code_count = 190; +constexpr usize func_count = 4; +constexpr usize meth_count = 0; +constexpr usize token_count = 0; +constexpr u32 max_string_id = 0x110F3; + +class context : public gsc::context +{ +public: + context(); +}; + +} // namespace xsk::gsc::s4 diff --git a/src/s4/s4_code.cpp b/src/s4/s4_code.cpp new file mode 100644 index 00000000..2f1dff8e --- /dev/null +++ b/src/s4/s4_code.cpp @@ -0,0 +1,205 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s4.hpp" + +namespace xsk::gsc::s4 +{ + +extern std::array, code_count> const code_list +{{ + { 0x00, opcode::OP_CastFieldObject }, + { 0x01, opcode::OP_SetLocalVariableFieldCached }, + { 0x02, opcode::OP_plus }, + { 0x03, opcode::OP_RemoveLocalVariables }, + { 0x04, opcode::OP_EvalSelfFieldVariableRef }, + { 0x05, opcode::OP_ScriptFarMethodChildThreadCall }, + { 0x06, opcode::OP_GetGameRef }, + { 0x07, opcode::OP_EvalAnimFieldVariable }, + { 0x08, opcode::OP_EvalLevelFieldVariableRef }, + { 0x09, opcode::OP_GetThisthread }, + { 0x0A, opcode::OP_greater }, + { 0x0B, opcode::OP_waittillmatch }, + { 0x0C, opcode::OP_shift_right }, + { 0x0D, opcode::OP_dec }, + { 0x0E, opcode::OP_JumpOnTrue }, + { 0x0F, opcode::OP_bit_or }, + { 0x10, opcode::OP_equality }, + { 0x11, opcode::OP_ClearLocalVariableFieldCached0 }, + { 0x12, opcode::OP_notify }, + { 0x13, opcode::OP_GetVector }, + { 0x14, opcode::OP_ScriptMethodChildThreadCallPointer }, + { 0x15, opcode::OP_PreScriptCall }, + { 0x16, opcode::OP_GetByte }, + { 0x17, opcode::OP_ScriptFarThreadCall }, + { 0x18, opcode::OP_SetSelfFieldVariableField }, + { 0x19, opcode::OP_JumpOnFalseExpr }, + { 0x1A, opcode::OP_GetUndefined }, + { 0x1B, opcode::OP_jumpback }, + { 0x1C, opcode::OP_JumpOnTrueExpr }, + { 0x1D, opcode::OP_CallBuiltin0 }, + { 0x1E, opcode::OP_CallBuiltin1 }, + { 0x1F, opcode::OP_CallBuiltin2 }, + { 0x20, opcode::OP_CallBuiltin3 }, + { 0x21, opcode::OP_CallBuiltin4 }, + { 0x22, opcode::OP_CallBuiltin5 }, + { 0x23, opcode::OP_CallBuiltin }, + { 0x24, opcode::OP_SetLocalVariableFieldCached0 }, + { 0x25, opcode::OP_ClearFieldVariable }, + { 0x26, opcode::OP_GetLevel }, + { 0x27, opcode::OP_size }, + { 0x28, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x29, opcode::OP_ScriptLocalMethodThreadCall }, + { 0x2A, opcode::OP_AddArray }, + { 0x2B, opcode::OP_endon }, + { 0x2C, opcode::OP_EvalFieldVariable }, + { 0x2D, opcode::OP_shift_left }, + { 0x2E, opcode::OP_EvalLocalArrayRefCached0 }, + { 0x2F, opcode::OP_Return }, + { 0x30, opcode::OP_CreateLocalVariable }, + { 0x31, opcode::OP_SafeSetVariableFieldCached0 }, + { 0x32, opcode::OP_GetBuiltinFunction }, + { 0x33, opcode::OP_ScriptLocalMethodCall }, + { 0x34, opcode::OP_CallBuiltinMethodPointer }, + { 0x35, opcode::OP_ScriptLocalChildThreadCall }, + { 0x36, opcode::OP_GetSelfObject }, + { 0x37, opcode::OP_GetGame }, + { 0x38, opcode::OP_SetLevelFieldVariableField }, + { 0x39, opcode::OP_EvalArray }, + { 0x3A, opcode::OP_GetSelf }, + { 0x3B, opcode::OP_End }, + { 0x3C, opcode::OP_EvalSelfFieldVariable }, + { 0x3D, opcode::OP_less_equal }, + { 0x3E, opcode::OP_EvalLocalVariableCached0 }, + { 0x3F, opcode::OP_EvalLocalVariableCached1 }, + { 0x40, opcode::OP_EvalLocalVariableCached2 }, + { 0x41, opcode::OP_EvalLocalVariableCached3 }, + { 0x42, opcode::OP_EvalLocalVariableCached4 }, + { 0x43, opcode::OP_EvalLocalVariableCached5 }, + { 0x44, opcode::OP_EvalLocalVariableCached }, + { 0x45, opcode::OP_EvalNewLocalArrayRefCached0 }, + { 0x46, opcode::OP_ScriptChildThreadCallPointer }, + { 0x47, opcode::OP_EvalLocalVariableObjectCached }, + { 0x48, opcode::OP_ScriptLocalThreadCall }, + { 0x49, opcode::OP_GetInteger }, + { 0x4A, opcode::OP_ScriptMethodCallPointer }, + { 0x4B, opcode::OP_checkclearparams }, + { 0x4C, opcode::OP_SetAnimFieldVariableField }, + { 0x4D, opcode::OP_waittillmatch2 }, + { 0x4E, opcode::OP_minus }, + { 0x4F, opcode::OP_ScriptLocalFunctionCall2 }, + { 0x50, opcode::OP_GetNegUnsignedShort }, + { 0x51, opcode::OP_GetNegByte }, + { 0x52, opcode::OP_SafeCreateVariableFieldCached }, + { 0x53, opcode::OP_greater_equal }, + { 0x54, opcode::OP_vector }, + { 0x55, opcode::OP_GetBuiltinMethod }, + { 0x56, opcode::OP_endswitch }, + { 0x57, opcode::OP_ClearArray }, + { 0x58, opcode::OP_DecTop }, + { 0x59, opcode::OP_CastBool }, + { 0x5A, opcode::OP_EvalArrayRef }, + { 0x5B, opcode::OP_SetNewLocalVariableFieldCached0 }, + { 0x5C, opcode::OP_GetZero }, + { 0x5D, opcode::OP_wait }, + { 0x5E, opcode::OP_waittill }, + { 0x5F, opcode::OP_GetIString }, + { 0x60, opcode::OP_ScriptFarFunctionCall }, + { 0x61, opcode::OP_GetAnimObject }, + { 0x62, opcode::OP_GetAnimTree }, + { 0x63, opcode::OP_EvalLocalArrayCached }, + { 0x64, opcode::OP_mod }, + { 0x65, opcode::OP_ScriptFarMethodThreadCall }, + { 0x66, opcode::OP_GetUnsignedShort }, + { 0x67, opcode::OP_clearparams }, + { 0x68, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x69, opcode::OP_ScriptFunctionCallPointer }, + { 0x6A, opcode::OP_EmptyArray }, + { 0x6B, opcode::OP_SafeSetVariableFieldCached }, + { 0x6C, opcode::OP_ClearVariableField }, + { 0x6D, opcode::OP_EvalFieldVariableRef }, + { 0x6E, opcode::OP_ScriptLocalMethodChildThreadCall }, + { 0x6F, opcode::OP_EvalNewLocalVariableRefCached0 }, + { 0x70, opcode::OP_GetFloat }, + { 0x71, opcode::OP_EvalLocalVariableRefCached }, + { 0x72, opcode::OP_JumpOnFalse }, + { 0x73, opcode::OP_BoolComplement }, + { 0x74, opcode::OP_ScriptThreadCallPointer }, + { 0x75, opcode::OP_ScriptFarFunctionCall2 }, + { 0x76, opcode::OP_less }, + { 0x77, opcode::OP_BoolNot }, + { 0x78, opcode::OP_waittillFrameEnd }, + { 0x79, opcode::OP_waitframe }, + { 0x7A, opcode::OP_GetString }, + { 0x7B, opcode::OP_EvalLevelFieldVariable }, + { 0x7C, opcode::OP_GetLevelObject }, + { 0x7D, opcode::OP_inc }, + { 0x7E, opcode::OP_CallBuiltinMethod0 }, + { 0x7F, opcode::OP_CallBuiltinMethod1 }, + { 0x80, opcode::OP_CallBuiltinMethod2 }, + { 0x81, opcode::OP_CallBuiltinMethod3 }, + { 0x82, opcode::OP_CallBuiltinMethod4 }, + { 0x83, opcode::OP_CallBuiltinMethod5 }, + { 0x84, opcode::OP_CallBuiltinMethod }, + { 0x85, opcode::OP_GetAnim }, + { 0x86, opcode::OP_switch }, + { 0x87, opcode::OP_SetVariableField }, + { 0x88, opcode::OP_divide }, + { 0x89, opcode::OP_GetLocalFunction }, + { 0x8A, opcode::OP_ScriptFarChildThreadCall }, + { 0x8B, opcode::OP_multiply }, + { 0x8C, opcode::OP_ClearLocalVariableFieldCached }, + { 0x8D, opcode::OP_EvalAnimFieldVariableRef }, + { 0x8E, opcode::OP_EvalLocalArrayRefCached }, + { 0x8F, opcode::OP_EvalLocalVariableRefCached0 }, + { 0x90, opcode::OP_bit_and }, + { 0x91, opcode::OP_GetAnimation }, + { 0x92, opcode::OP_GetFarFunction }, + { 0x93, opcode::OP_CallBuiltinPointer }, + { 0x94, opcode::OP_jump }, + { 0x95, opcode::OP_voidCodepos }, + { 0x96, opcode::OP_ScriptFarMethodCall }, + { 0x97, opcode::OP_inequality }, + { 0x98, opcode::OP_ScriptLocalFunctionCall }, + { 0x99, opcode::OP_bit_ex_or }, + { 0x9A, opcode::OP_NOP }, + { 0x9B, opcode::OP_abort }, + { 0x9C, opcode::OP_object }, + { 0x9D, opcode::OP_thread_object }, + { 0x9E, opcode::OP_EvalLocalVariable }, + { 0x9F, opcode::OP_EvalLocalVariableRef }, + { 0xA0, opcode::OP_prof_begin }, + { 0xA1, opcode::OP_prof_end }, + { 0xA2, opcode::OP_breakpoint }, + { 0xA3, opcode::OP_assignmentBreakpoint }, + { 0xA4, opcode::OP_manualAndAssignmentBreakpoint }, + { 0xA5, opcode::OP_BoolNotAfterAnd }, + { 0xA6, opcode::OP_FormalParams }, + { 0xA7, opcode::OP_IsDefined }, + { 0xA8, opcode::OP_IsTrue }, + { 0xA9, opcode::OP_NativeGetLocalFunction }, + { 0xAA, opcode::OP_NativeLocalFunctionCall }, + { 0xAB, opcode::OP_NativeLocalFunctionCall2 }, + { 0xAC, opcode::OP_NativeLocalMethodCall }, + { 0xAD, opcode::OP_NativeLocalFunctionThreadCall }, + { 0xAE, opcode::OP_NativeLocalMethodThreadCall }, + { 0xAF, opcode::OP_NativeLocalFunctionChildThreadCall }, + { 0xB0, opcode::OP_NativeLocalMethodChildThreadCall }, + { 0xB1, opcode::OP_NativeGetFarFunction }, + { 0xB2, opcode::OP_NativeFarFunctionCall }, + { 0xB3, opcode::OP_NativeFarFunctionCall2 }, + { 0xB4, opcode::OP_NativeFarMethodCall }, + { 0xB5, opcode::OP_NativeFarFunctionThreadCall }, + { 0xB6, opcode::OP_NativeFarMethodThreadCall }, + { 0xB7, opcode::OP_NativeFarFunctionChildThreadCall }, + { 0xB8, opcode::OP_NativeFarMethodChildThreadCall }, + { 0xB9, opcode::OP_EvalNewLocalArrayRefCached0_Precompiled }, + { 0xBA, opcode::OP_SetNewLocalVariableFieldCached0_Precompiled }, + { 0xBB, opcode::OP_CreateLocalVariable_Precompiled }, + { 0xBC, opcode::OP_SafeCreateVariableFieldCached_Precompiled }, + { 0xBD, opcode::OP_FormalParams_Precompiled }, +}}; + +} // namespace xsk::gsc::s4 diff --git a/src/s4/s4_func.cpp b/src/s4/s4_func.cpp new file mode 100644 index 00000000..275508aa --- /dev/null +++ b/src/s4/s4_func.cpp @@ -0,0 +1,19 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s4.hpp" + +namespace xsk::gsc::s4 +{ + +extern std::array, func_count> const func_list +{{ + { 0x08F, "getdvar" }, + { 0x09B, "getfirstarraykey" }, + { 0x0B1, "getnextarraykey" }, + { 0x126, "isusingmatchrulesdata" }, +}}; + +} // namespace xsk::gsc::s4 diff --git a/src/s4/s4_meth.cpp b/src/s4/s4_meth.cpp new file mode 100644 index 00000000..a84a5ba8 --- /dev/null +++ b/src/s4/s4_meth.cpp @@ -0,0 +1,15 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s4.hpp" + +namespace xsk::gsc::s4 +{ + +extern std::array, meth_count> const meth_list +{{ +}}; + +} // namespace xsk::gsc::s4 diff --git a/src/s4/s4_token.cpp b/src/s4/s4_token.cpp new file mode 100644 index 00000000..675b04e0 --- /dev/null +++ b/src/s4/s4_token.cpp @@ -0,0 +1,15 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "s4.hpp" + +namespace xsk::gsc::s4 +{ + +extern std::array, token_count> const token_list +{{ +}}; + +} // namespace xsk::gsc::s4 diff --git a/src/s4/stdafx.cpp b/src/s4/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/s4/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/s4/stdafx.hpp b/src/s4/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/s4/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/s4/xsk/assembler.cpp b/src/s4/xsk/assembler.cpp deleted file mode 100644 index 584fd61f..00000000 --- a/src/s4/xsk/assembler.cpp +++ /dev/null @@ -1,621 +0,0 @@ -// 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 "s4.hpp" - -namespace xsk::gsc::s4 -{ - -auto assembler::output_script() -> std::vector -{ - std::vector script; - - if (script_ == nullptr) return script; - - script.resize(script_->pos()); - std::memcpy(script.data(), script_->buffer().data(), script.size()); - - return script; -} - -auto assembler::output_stack() -> std::vector -{ - std::vector stack; - - if (stack_ == nullptr) return stack; - - stack.resize(stack_->pos()); - std::memcpy(stack.data(), stack_->buffer().data(), stack.size()); - - return stack; -} - -void assembler::assemble(const std::string& file, std::vector& data) -{ - std::vector assembly = utils::string::clean_buffer_lines(data); - std::vector functions; - function::ptr func = nullptr; - std::uint32_t index = 1; - std::uint16_t switchnum = 0; - - for (auto& line : assembly) - { - if (line == "" || line.substr(0, 2) == "//") - { - continue; - } - else if (line.substr(0, 4) == "sub_") - { - func = std::make_unique(); - func->index = index; - func->name = line.substr(4); - } - else if (line.substr(0, 4) == "end_") - { - if (func != nullptr) - { - func->size = index - func->index; - functions.push_back(std::move(func)); - } - } - else if (line.substr(0, 4) == "loc_") - { - func->labels[index] = line; - } - else - { - auto opdata = utils::string::parse_code(line); - - if (switchnum) - { - if (opdata[0] == "case" || opdata[0] == "default") - { - for (auto& entry : opdata) - { - func->instructions.back()->data.push_back(entry); - } - switchnum--; - continue; - } - - throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); - } - else - { - auto inst = std::make_unique(); - inst->index = index; - inst->opcode = resolver::opcode_id(opdata[0]); - inst->size = opcode_size(inst->opcode); - opdata.erase(opdata.begin()); - inst->data = std::move(opdata); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = inst->data[0].substr(4); - break; - case opcode::OP_endswitch: - switchnum = static_cast(std::stoi(inst->data[0])); - inst->size += 7 * switchnum; - break; - default: - break; - } - - index += inst->size; - func->instructions.push_back(std::move(inst)); - } - } - } - - assemble(file, functions); -} - -void assembler::assemble(const std::string& file, std::vector& funcs) -{ - script_ = std::make_unique(0x100000); - stack_ = std::make_unique(0x100000); - filename_ = file; - functions_ = std::move(funcs); - - script_->write(static_cast(opcode::OP_End)); - - for (const auto& func : functions_) - { - assemble_function(func); - } -} - -void assembler::assemble_function(const function::ptr& func) -{ - labels_ = func->labels; - - func->id = resolver::token_id(func->name); - - stack_->write(func->size); - stack_->write(func->id); - - if (func->id == 0) - { - stack_->write_c_string(func->name); - } - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_CastFieldObject: - case opcode::OP_plus: - case opcode::OP_GetGameRef: - case opcode::OP_GetThisthread: - case opcode::OP_greater: - case opcode::OP_shift_right: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_equality: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_notify: - case opcode::OP_PreScriptCall: - case opcode::OP_GetUndefined: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_size: - case opcode::OP_AddArray: - case opcode::OP_endon: - case opcode::OP_shift_left: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_Return: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetSelfObject: - case opcode::OP_GetGame: - case opcode::OP_EvalArray: - case opcode::OP_GetSelf: - case opcode::OP_End: - case opcode::OP_less_equal: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_checkclearparams: - case opcode::OP_waittillmatch2: - case opcode::OP_minus: - case opcode::OP_greater_equal: - case opcode::OP_vector: - case opcode::OP_ClearArray: - case opcode::OP_DecTop: - case opcode::OP_CastBool: - case opcode::OP_EvalArrayRef: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_waittill: - case opcode::OP_GetAnimObject: - case opcode::OP_mod: - case opcode::OP_clearparams: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_EmptyArray: - case opcode::OP_ClearVariableField: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_BoolComplement: - case opcode::OP_less: - case opcode::OP_BoolNot: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitframe: - case opcode::OP_GetLevelObject: - case opcode::OP_inc: - case opcode::OP_GetAnim: - case opcode::OP_SetVariableField: - case opcode::OP_divide: - case opcode::OP_multiply: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_bit_and: - case opcode::OP_voidCodepos: - case opcode::OP_inequality: - case opcode::OP_bit_ex_or: -/* case opcode::OP_NOP: - case opcode::OP_abort: - case opcode::OP_object: - case opcode::OP_thread_object: - case opcode::OP_EvalLocalVariable: - case opcode::OP_EvalLocalVariableRef: - case opcode::OP_breakpoint: - case opcode::OP_assignmentBreakpoint: - case opcode::OP_manualAndAssignmentBreakpoint:*/ - case opcode::OP_BoolNotAfterAnd: - case opcode::OP_IsDefined: - case opcode::OP_IsTrue: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->write(std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->write(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - 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(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_GetAnimation: - script_->write(0); - script_->write(0); - stack_->write_c_string(inst->data[0]); - stack_->write_c_string(inst->data[1]); - break; - case opcode::OP_GetAnimTree: - script_->write(0); - stack_->write_c_string(inst->data[0]); - break; - case opcode::OP_waittillmatch: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - assemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - assemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - assemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - assemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - assemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - assemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - assemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - assemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - assemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - assemble_jump(inst, false, true); - break; - case opcode::OP_jump: - assemble_jump(inst, false, false); - break; - case opcode::OP_switch: - assemble_switch(inst); - break; - case opcode::OP_endswitch: - assemble_end_switch(inst); - break; -/* case opcode::OP_prof_begin: - script_->write(0); // TODO: skipped data - script_->write(0); - break; - case opcode::OP_prof_end: - script_->write(0); // TODO: skipped data - break; - case opcode::OP_EvalNewLocalArrayRefCached0_Precompiled: - case opcode::OP_SetNewLocalVariableFieldCached0_Precompiled: - case opcode::OP_CreateLocalVariable_Precompiled: - case opcode::OP_SafeCreateVariableFieldCached_Precompiled: - script_->write(static_cast(inst->opcode)); - script_->write(static_cast(std::stoi(inst->data[0]))); - break;*/ - case opcode::OP_FormalParams: -// case opcode::OP_FormalParams_Precompiled: - assemble_formal_params(inst); - break; -/* case opcode::OP_NativeGetLocalFunction: - case opcode::OP_NativeLocalFunctionCall: - case opcode::OP_NativeLocalFunctionCall2: - case opcode::OP_NativeLocalMethodCall: - assemble_local_call(inst, false); - break; - case opcode::OP_NativeGetFarFunction: - case opcode::OP_NativeFarFunctionCall: - case opcode::OP_NativeFarFunctionCall2: - case opcode::OP_NativeFarMethodCall: - assemble_far_call(inst, false); - break; - case opcode::OP_NativeLocalFunctionThreadCall: - case opcode::OP_NativeLocalMethodThreadCall: - case opcode::OP_NativeLocalFunctionChildThreadCall: - case opcode::OP_NativeLocalMethodChildThreadCall: - assemble_local_call(inst, true); - break; - case opcode::OP_NativeFarFunctionThreadCall: - case opcode::OP_NativeFarMethodThreadCall: - case opcode::OP_NativeFarFunctionChildThreadCall: - case opcode::OP_NativeFarMethodChildThreadCall: - assemble_far_call(inst, true); - break;*/ - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } - - const auto id = method ? resolver::method_id(inst->data[0]) : resolver::function_id(inst->data[0]); - - script_->write(id); -} - -void assembler::assemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto addr = resolve_function(inst->data[0]); - const auto offset = static_cast(addr - inst->index - 1); - - assemble_offset(offset); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[1]))); - } -} - -void assembler::assemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->write(0); - script_->write(0); - - if (thread) - { - script_->write(static_cast(std::stoi(inst->data[2]))); - } - - const auto file_id = resolver::token_id(inst->data[0]); - const auto func_id = resolver::token_id(inst->data[1]); - - stack_->write(file_id); - if (file_id == 0) stack_->write_c_string(inst->data[0]); - stack_->write(func_id); - if (func_id == 0) stack_->write_c_string(inst->data[1]); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const auto addr = resolve_label(inst->data[0]); - - script_->write(addr - inst->index - 4); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - - script_->write(static_cast(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); - stack_->write_c_string(inst->data[1 + (3 * i) + 1]); - } - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 2]); - - assemble_offset(addr - index); - - index += 3; - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write(0); - stack_->write_c_string("\x01"); - - index += 4; - - const auto addr = resolve_label(inst->data[1 + (3 * i) + 1]); - - assemble_offset(addr - index); - - index += 3; - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::assemble_field_variable(const instruction::ptr& inst) -{ - auto id = resolver::token_id(inst->data[0]); - - if (id == 0) id = 0xFFFFFFFF; - - script_->write(id); - - if (id > max_string_id) - { - stack_->write(0); - stack_->write_c_string(inst->data[0]); - } -} - -void assembler::assemble_formal_params(const instruction::ptr& inst) -{ - const auto count = std::stoi(inst->data[0]); - - script_->write(static_cast(count)); - - for (auto i = 1; i <= count; i++) - { - script_->write(static_cast(std::stoi(inst->data[i]))); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - const auto addr = resolve_label(inst->data[0]); - - if (expr) - { - script_->write(static_cast(addr - inst->index - 3)); - } - else if (back) - { - script_->write(static_cast((inst->index + 3) - addr)); - } - else - { - script_->write(static_cast(addr - inst->index - 5)); - } -} - -void assembler::assemble_offset(std::int32_t offset) -{ - std::array bytes = {}; - - offset = (offset << 8) >> 8; - - *reinterpret_cast(bytes.data()) = offset; - - script_->write(bytes[0]); - script_->write(bytes[1]); - script_->write(bytes[2]); -} - -auto assembler::resolve_function(const std::string& name) -> std::int32_t -{ - for (const auto& entry : functions_) - { - if (entry->name == name) - { - return entry->index; - } - } - - throw asm_error("couldn't resolve local function address of '" + name + "'!"); -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/assembler.hpp b/src/s4/xsk/assembler.hpp deleted file mode 100644 index 37efd520..00000000 --- a/src/s4/xsk/assembler.hpp +++ /dev/null @@ -1,41 +0,0 @@ -// 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::gsc::s4 -{ - -class assembler : public gsc::assembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output_script() -> std::vector; - auto output_stack() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, std::vector& funcs); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void assemble_local_call(const instruction::ptr& inst, bool thread); - void assemble_far_call(const instruction::ptr& inst, bool thread); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void assemble_field_variable(const instruction::ptr& inst); - void assemble_formal_params(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst, bool expr, bool back); - void assemble_offset(std::int32_t offset); - auto resolve_function(const std::string& name) -> std::int32_t; - auto resolve_label(const std::string& name) -> std::int32_t; -}; - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/compiler.cpp b/src/s4/xsk/compiler.cpp deleted file mode 100644 index 305dfa41..00000000 --- a/src/s4/xsk/compiler.cpp +++ /dev/null @@ -1,3021 +0,0 @@ -// 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 "s4.hpp" -#include "parser.hpp" -#include "lexer.hpp" - -namespace xsk::gsc::s4 -{ - -auto compiler::output() -> std::vector -{ - return std::move(assembly_); -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "an unknown error ocurred while parsing gsc file"); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_.clear(); - includes_.clear(); - animtrees_.clear(); - constants_.clear(); - local_functions_.clear(); - index_ = 1; - 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& inc : includes_) - { - if (inc.name == path) - { - throw comp_error(include->loc(), "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(), "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 developer block comment"); - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) -{ - const auto itr = constants_.find(constant->name->value); - - if (itr != constants_.end()) - throw comp_error(constant->loc(), "duplicated constant '" + constant->name->value + "'"); - - 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; - - auto blk = std::make_unique(); - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - break_blks_.clear(); - continue_blks_.clear(); - - process_thread(thread, blk); - - emit_expr_parameters(thread->params, blk); - emit_stmt_list(thread->stmt, blk, true); - emit_opcode(opcode::OP_End); - - function_->size = index_ - function_->index; - assembly_.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list, blk, last); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev, blk, last); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend, blk); - break; - case ast::kind::stmt_waitframe: - emit_stmt_waitframe(stmt.as_waitframe, blk); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if, blk, last); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse, blk, last); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case, blk); - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default, blk); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return, blk); - break; - case ast::kind::stmt_breakpoint: - emit_stmt_breakpoint(stmt.as_breakpoint, blk); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin, blk); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end, blk); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last) -{ - for (const auto& entry : stmt->list) - { - bool last_ = (&entry == &stmt->list.back() && last) ? true : false; - emit_stmt(entry, blk, last_); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last) -{ - emit_stmt_list(stmt->list, blk, last); -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - 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, const block::ptr& blk) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, blk, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, blk, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, blk, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, blk, 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_endon); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } - - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->time, blk); - emit_opcode(opcode::OP_wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittill); - - for (const auto& entry : stmt->args->list) - { - variable_create(entry.as_identifier, blk); - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(entry.as_identifier, blk)); - } - - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - emit_expr_arguments(stmt->args, blk); - emit_expr(stmt->event, blk); - emit_expr(stmt->obj, blk); - emit_opcode(opcode::OP_waittillmatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_waittillmatch2); - emit_opcode(opcode::OP_clearparams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waittillFrameEnd); -} - -void compiler::emit_stmt_waitframe(const ast::stmt_waitframe::ptr&, const block::ptr&) -{ - emit_opcode(opcode::OP_waitframe); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - blk->transfer(stmt->blk); - - emit_stmt(stmt->stmt, stmt->blk, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last) -{ - std::vector childs; - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - blk->transfer(stmt->blk_if); - - emit_stmt(stmt->stmt_if, stmt->blk_if, last); - - emit_remove_local_vars(stmt->blk_if); - - if (stmt->blk_if->abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - - last ? emit_opcode(opcode::OP_End) : emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - - blk->transfer(stmt->blk_else); - - emit_stmt(stmt->stmt_else, stmt->blk_else, last); - - last ? emit_opcode(opcode::OP_End) : emit_remove_local_vars(stmt->blk_else); - - if (stmt->blk_else->abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - - insert_label(end_loc); - - blk->init_from_child(childs); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = true; - can_continue_ = true; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - auto begin_loc = insert_label(); - - emit_stmt(stmt->stmt, stmt->blk, false); - - insert_label(continue_loc); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_stmt(stmt->init, blk, false); - - blk->transfer(stmt->blk); - stmt->blk->loc_break = break_loc; - stmt->blk->loc_continue = continue_loc; - - emit_create_local_vars(stmt->blk); - - blk->local_vars_create_count = stmt->blk->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->blk_iter); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - } - - can_break_ = true; - can_continue_ = true; - - emit_stmt(stmt->stmt, stmt->blk, false); - - if (stmt->blk->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->blk.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->blk_iter->init_from_child(continue_blks_); - - emit_stmt(stmt->iter, stmt->blk_iter, false); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - - if (const_cond) - blk->init_from_child(break_blks_); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - auto old_break = can_break_; - auto old_continue = can_continue_; - break_blks_.clear(); - continue_blks_.clear(); - can_break_ = false; - can_continue_ = false; - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - emit_expr(stmt->array_expr, blk); - emit_expr_variable_ref(stmt->array, blk, true); - emit_expr_variable(stmt->array, blk); - emit_opcode(opcode::OP_CallBuiltin1, "getfirstarraykey"); - emit_expr_variable_ref(stmt->key_expr, blk, true); - - blk->transfer(stmt->ctx); - stmt->ctx->loc_break = break_loc; - stmt->ctx->loc_continue = continue_loc; - - emit_create_local_vars(stmt->ctx); - - blk->local_vars_create_count = stmt->ctx->local_vars_create_count; - - for (auto i = 0u; i < blk->local_vars_create_count; i++) - { - if (!blk->local_vars.at(i).init) - blk->local_vars.at(i).init = true; - } - - blk->transfer(stmt->ctx_post); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr, blk); - emit_opcode(opcode::OP_IsDefined); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr, stmt->ctx); - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->array.as_identifier, stmt->ctx)); - emit_expr_variable_ref(stmt->value_expr, stmt->ctx, true); - emit_stmt(stmt->stmt, stmt->ctx, false); - - if (stmt->ctx->abort == abort_t::abort_none) - continue_blks_.push_back(stmt->ctx.get()); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - stmt->ctx_post->init_from_child(continue_blks_); - - emit_expr_variable(stmt->key_expr, stmt->ctx_post); - emit_expr_variable(stmt->array, stmt->ctx_post); - emit_opcode(opcode::OP_CallBuiltin2, "getnextarraykey"); - emit_expr_variable_ref(stmt->key_expr, stmt->ctx_post, true); - emit_opcode(opcode::OP_jumpback, begin_loc); - - insert_label(break_loc); - emit_expr_clear_local(stmt->array.as_identifier, blk); - if (!stmt->use_key) emit_expr_clear_local(stmt->key_expr.as_identifier, blk); - - can_break_ = old_break; - can_continue_ = old_continue; - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto old_breaks = break_blks_; - auto old_break = can_break_; - break_blks_.clear(); - can_break_ = false; - - auto jmptable_loc = create_label(); - auto break_loc = create_label(); - - emit_expr(stmt->test, blk); - 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; - block* default_ctx = nullptr; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - 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"); - } - - blk->transfer(case_->blk); - case_->blk->loc_break = break_loc; - emit_stmt_list(case_->stmt, case_->blk, false); - if (case_->stmt->list.size() > 0) - emit_remove_local_vars(case_->blk); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - - has_default = true; - default_ctx = entry.as_default->blk.get(); - - blk->transfer(entry.as_default->blk); - entry.as_default->blk->loc_break = break_loc; - emit_stmt_list(entry.as_default->stmt, entry.as_default->blk, false); - if (entry.as_default->stmt->list.size() > 0) - emit_remove_local_vars(entry.as_default->blk); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - } - blk->init_from_child(break_blks_); - } - - insert_label(jmptable_loc); - - emit_opcode(opcode::OP_endswitch, data); - - auto offset = static_cast(7 * stmt->stmt->list.size()); - function_->instructions.back()->size += offset; - index_ += offset; - - insert_label(break_loc); - - can_break_ = old_break; - break_blks_ = old_breaks; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr&) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk) -{ - if (!can_break_ || blk->abort != abort_t::abort_none || blk->loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - break_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_break; - emit_opcode(opcode::OP_jump, blk->loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk) -{ - if (!can_continue_ || blk->abort != abort_t::abort_none || blk->loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - continue_blks_.push_back(blk.get()); - emit_remove_local_vars(blk); - blk->abort = abort_t::abort_continue; - emit_opcode(opcode::OP_jump, blk->loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - blk->abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr, blk); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&, const block::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child, blk); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate, blk); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - break; - case ast::kind::expr_isdefined: - emit_expr_isdefined(expr.as_isdefined, blk); - break; - case ast::kind::expr_istrue: - emit_expr_istrue(expr.as_istrue, blk); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference, blk); - break; - case ast::kind::expr_add_array: - emit_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_thisthread: - emit_opcode(opcode::OP_GetThisthread); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - 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, blk); - 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, const block::ptr& blk) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue, blk); - } - else if (expr->lvalue == ast::kind::expr_tuple) - { - emit_expr(expr->rvalue, blk); - emit_expr_tuple(expr->lvalue.as_tuple, blk); - } - else - { - emit_expr(expr->rvalue, blk); - emit_expr_variable_ref(expr->lvalue, blk, true); - } - - return; - } - - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - 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_mod); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_ex_or); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, blk, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key, blk); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, blk, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj, blk); - 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, blk, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk) -{ - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_ClearLocalVariableFieldCached0); - else - emit_opcode(opcode::OP_ClearLocalVariableFieldCached, variable_access_index(expr, blk)); -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_inc); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, blk, false); - emit_opcode(opcode::OP_dec); - emit_opcode(opcode::OP_SetVariableField); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue, blk); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test, blk); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr, blk); - emit_opcode(opcode::OP_jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr, blk); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->lvalue, blk); - emit_expr(expr->rvalue, blk); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_equality); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_inequality); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_less); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_greater); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_less_equal); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_greater_equal); - 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_ex_or); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_shift_left); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_shift_right); - 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_mod); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - - if (expr->rvalue == ast::kind::expr_not) - { - emit_expr(expr->rvalue.as_not->rvalue, blk); - emit_opcode(opcode::OP_BoolNotAfterAnd); - } - else - { - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - } - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk) -{ - auto label = create_label(); - - emit_expr(expr->lvalue, blk); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - - if (expr->rvalue == ast::kind::expr_not) - { - emit_expr(expr->rvalue.as_not->rvalue, blk); - emit_opcode(opcode::OP_BoolNotAfterAnd); - } - else - { - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_CastBool); - } - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->rvalue, blk); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (is_stmt && mode_ == gsc::build::prod) - { - const auto& name = expr->name->value; - if (name == "assert" || name == "assertex" || name == "assertmsg") return; - } - - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal && expr->args->list.size() > 0) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptLocalFunctionCall, expr->name->value); - else - emit_opcode(opcode::OP_ScriptLocalFunctionCall2, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - if (expr->args->list.size() > 0) - emit_opcode(opcode::OP_ScriptFarFunctionCall, { expr->path->value, expr->name->value }); - else - emit_opcode(opcode::OP_ScriptFarFunctionCall2, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltin0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltin1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltin2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltin3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltin4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltin5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltin, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, blk, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, blk, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - if (expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - emit_expr(expr->func, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptMethodChildThreadCallPointer, argcount); - break; - case ast::call::mode::builtin: - emit_opcode(opcode::OP_CallBuiltinMethodPointer, argcount); - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt) -{ - auto type = resolve_function_type(expr); - - if (type != ast::call::type::builtin && expr->mode == ast::call::mode::normal) - emit_opcode(opcode::OP_PreScriptCall); - - emit_expr_arguments(expr->args, blk); - emit_expr(obj, blk); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - if (type == ast::call::type::local) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptLocalMethodCall, expr->name->value); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptLocalMethodThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptLocalMethodChildThreadCall, { expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no local builtins - break; - } - } - else if (type == ast::call::type::far) - { - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFarMethodCall, { expr->path->value, expr->name->value }); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptFarMethodThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::childthread: - emit_opcode(opcode::OP_ScriptFarMethodChildThreadCall, { expr->path->value, expr->name->value, argcount }); - break; - case ast::call::mode::builtin: - // no far builtins - break; - } - } - else if (type == ast::call::type::builtin) - { - if (expr->mode != ast::call::mode::normal) - throw comp_error(expr->loc(), "builtin calls can't be threaded"); - - switch (expr->args->list.size()) - { - case 0: - emit_opcode(opcode::OP_CallBuiltinMethod0, expr->name->value); - break; - case 1: - emit_opcode(opcode::OP_CallBuiltinMethod1, expr->name->value); - break; - case 2: - emit_opcode(opcode::OP_CallBuiltinMethod2, expr->name->value); - break; - case 3: - emit_opcode(opcode::OP_CallBuiltinMethod3, expr->name->value); - break; - case 4: - emit_opcode(opcode::OP_CallBuiltinMethod4, expr->name->value); - break; - case 5: - emit_opcode(opcode::OP_CallBuiltinMethod5, expr->name->value); - break; - default: - emit_opcode(opcode::OP_CallBuiltinMethod, { expr->name->value, argcount }); - break; - } - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - emit_opcode(opcode::OP_EmptyArray); - - for (const auto& arg : expr->args->list) - { - emit_expr(arg, blk); - emit_opcode(opcode::OP_AddArray); - } -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) -{ - auto num = static_cast(expr->list.size()); - - if (num) - { - std::vector data; - - data.push_back(utils::string::va("%d", num)); - - for (const auto& entry : expr->list) - { - variable_initialize(entry, blk); - data.push_back(variable_create_index(entry, blk)); - } - - emit_opcode(opcode::OP_FormalParams, data); - function_->instructions.back()->size += num; - index_ += num; - } - else - { - emit_opcode( opcode::OP_checkclearparams); - } -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry, blk); - } -} - -void compiler::emit_expr_isdefined(const ast::expr_isdefined::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->expr, blk); - emit_opcode(opcode::OP_IsDefined); -} - -void compiler::emit_expr_istrue(const ast::expr_istrue::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->expr, blk); - emit_opcode(opcode::OP_IsTrue); -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr&) -{ - bool method = false; - auto type = resolve_reference_type(expr, method); - - switch (type) - { - case ast::call::type::local: - emit_opcode(opcode::OP_GetLocalFunction, expr->name->value); - break; - case ast::call::type::far: - emit_opcode(opcode::OP_GetFarFunction, { expr->path->value, expr->name->value }); - break; - case ast::call::type::builtin: - if (method) - emit_opcode(opcode::OP_GetBuiltinMethod, expr->name->value); - else - emit_opcode(opcode::OP_GetBuiltinFunction, expr->name->value); - break; - } -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_size); -} - -void compiler::emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - emit_expr_variable_ref(expr->temp, blk, true); - - auto index = 0; - - for (const auto& entry : expr->list) - { - if (index == 0) - emit_opcode(opcode::OP_GetZero); - else - emit_opcode(opcode::OP_GetByte, utils::string::va("%d", index)); - - index++; - - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->temp.as_identifier, blk)); - - emit_expr_variable_ref(entry, blk, true); - } - - emit_expr_clear_local(expr->temp.as_identifier, blk); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, blk, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, blk, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, blk, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set) -{ - emit_expr(expr->key, blk); - - 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, blk, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - { - if (!variable_initialized(expr->obj.as_identifier, blk)) - { - variable_initialize(expr->obj.as_identifier, blk); - emit_opcode(opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(expr->obj.as_identifier, blk)); - - if (!set) throw comp_error(expr->loc(), "INTERNAL: VAR CREATED BUT NOT SET!"); - } - else if (variable_stack_index(expr->obj.as_identifier, blk) == 0) - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached0); - } - else - { - emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access_index(expr->obj.as_identifier, blk)); - } - - 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, const block::ptr& blk, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - set ? emit_opcode(opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(opcode::OP_EvalLevelFieldVariableRef, field); - break; - case ast::kind::expr_anim: - set ? emit_opcode(opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(opcode::OP_EvalAnimFieldVariableRef, field); - break; - case ast::kind::expr_self: - set ? emit_opcode(opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(opcode::OP_EvalSelfFieldVariableRef, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - 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, blk); - 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_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, 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 + "'"); - } - - if (set) - { - if (!variable_initialized(expr, blk)) - { - variable_initialize(expr, blk); - emit_opcode(opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(expr, blk)); - } - else if (variable_stack_index(expr, blk) == 0) - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached0); - } - else - { - emit_opcode(opcode::OP_SetLocalVariableFieldCached, variable_access_index(expr, blk)); - } - } - else - { - auto index = variable_stack_index(expr, blk); - - if (index == 0) - emit_opcode(opcode::OP_EvalLocalVariableRefCached0); - else - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access_index(expr, blk)); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier, blk); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - emit_expr(expr->key, blk); - - if (expr->obj == ast::kind::expr_identifier) - { - emit_opcode(opcode::OP_EvalLocalArrayCached, variable_access_index(expr->obj.as_identifier, blk)); - } - else - { - emit_expr(expr->obj, blk); - emit_opcode(opcode::OP_EvalArray); - } -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_EvalLevelFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_EvalAnimFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_EvalSelfFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr->obj.as_identifier, blk)); - 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, const block::ptr& blk) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - emit_expr(itr->second, blk); - return; - } - - // is local var - auto index = variable_stack_index(expr, blk); - - switch (index) - { - case 0: - emit_opcode(opcode::OP_EvalLocalVariableCached0); - break; - case 1: - emit_opcode(opcode::OP_EvalLocalVariableCached1); - break; - case 2: - emit_opcode(opcode::OP_EvalLocalVariableCached2); - break; - case 3: - emit_opcode(opcode::OP_EvalLocalVariableCached3); - break; - case 4: - emit_opcode(opcode::OP_EvalLocalVariableCached4); - break; - case 5: - emit_opcode(opcode::OP_EvalLocalVariableCached5); - break; - default: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access_index(expr, blk)); - break; - } -} - -void compiler::emit_expr_object(const ast::expr& expr, const block::ptr& blk) -{ - 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, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field, blk); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, blk, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableObjectCached, variable_access_index(expr.as_identifier, blk)); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk) -{ - std::vector data; - - bool isexpr = false; - - 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, blk); - emit_expr(expr->y, blk); - emit_expr(expr->x, blk); - 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(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimation, { "", expr->value }); - } - else - { - emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); - tree.loaded = true; - } -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error( expr->loc(), "trying to use animtree without specified using animtree"); - } - - auto& tree = animtrees_.back(); - - if (tree.loaded) - { - emit_opcode(opcode::OP_GetAnimTree, ""); - } - else - { - emit_opcode(opcode::OP_GetAnimTree, tree.name); - tree.loaded = true; - } -} - -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_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_create_local_vars(const block::ptr& blk) -{ - if (blk->local_vars_create_count != blk->local_vars_public_count) - { - for (auto i = blk->local_vars_create_count; i < blk->local_vars_public_count; i++) - { - auto data = utils::string::va("%d", blk->local_vars.at(i).create); - emit_opcode(opcode::OP_CreateLocalVariable, data); - blk->local_vars.at(i).init = true; - } - blk->local_vars_create_count = blk->local_vars_public_count; - } -} - -void compiler::emit_remove_local_vars(const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - auto count = blk->local_vars_create_count - blk->local_vars_public_count; - - if (count > 0) - { - auto data = utils::string::va("%d", count); - emit_opcode(opcode::OP_RemoveLocalVariables, data); - } - } -} - -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, const block::ptr& blk) -{ - process_expr_parameters(decl->params, blk); - process_stmt_list(decl->stmt, blk); -} - -void compiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - 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_waitframe: - case ast::kind::stmt_case: - case ast::kind::stmt_default: - 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, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk) -{ - process_stmt_list(stmt->list, blk); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - 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, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue, blk); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue, blk); - 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, blk); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - 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, blk); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - blk->merge(childs); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - stmt->blk_if = std::make_unique(); - stmt->blk_else = std::make_unique(); - - blk->copy(stmt->blk_if); - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - blk->copy(stmt->blk_else); - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - blk->merge(childs); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - stmt->blk = std::make_unique(); - - blk->copy(stmt->blk); - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - bool const_cond = is_constant_condition(stmt->test); - - stmt->blk = std::make_unique(); - stmt->blk_iter = std::make_unique(); - - process_stmt(stmt->init, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->blk); - blk->copy(stmt->blk_iter); - - process_stmt(stmt->stmt, stmt->blk); - - continue_blks_.push_back(stmt->blk.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_stmt(stmt->iter, stmt->blk_iter); - - blk->append({ stmt->blk_iter.get() }); - blk->merge({ stmt->blk_iter.get() }); - - if (const_cond) blk->append(break_blks_); - - blk->merge({ stmt->blk.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - auto array_name = utils::string::va("_temp_%d", ++label_idx_); - auto key_name = utils::string::va("_temp_%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; - - // calculate variables - - stmt->ctx = std::make_unique(); - stmt->ctx_post = std::make_unique(); - - // calculate pre_expr variables - process_expr(stmt->array, blk); - - auto old_breaks = break_blks_; - auto old_continues = continue_blks_; - break_blks_.clear(); - continue_blks_.clear(); - - blk->copy(stmt->ctx); - blk->copy(stmt->ctx_post); - - // calculate stmt variables & add missing array access as first stmt - process_expr(stmt->value_expr, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - continue_blks_.push_back(stmt->ctx.get()); - - for (auto i = 0u; i < continue_blks_.size(); i++) - blk->append({ continue_blks_.at(i) }); - - process_expr(stmt->key_expr, stmt->ctx_post); - - blk->append({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx_post.get() }); - blk->merge({ stmt->ctx.get() }); - - break_blks_ = old_breaks; - continue_blks_ = old_continues; -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - // calculate variables - stmt->ctx = std::make_unique(); - std::vector childs; - auto abort = abort_t::abort_return; - bool has_default = false; - block* default_ctx = nullptr; - auto old_breaks = break_blks_; - break_blks_.clear(); - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->copy(entry.as_case->blk); - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort != abort_t::abort_none) - { - if (entry.as_case->blk->abort == abort_t::abort_break ) - { - entry.as_case->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_case->blk.get()); - } - else if (entry.as_case->blk->abort <= abort ) - { - abort = entry.as_case->blk->abort; - } - } - } - else if (entry == ast::kind::stmt_default) - { - entry.as_default->blk = std::make_unique(); - blk->copy(entry.as_default->blk); - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - has_default = true; - default_ctx = entry.as_default->blk.get(); - - if (entry.as_default->blk->abort != abort_t::abort_none) - { - if (entry.as_default->blk->abort == abort_t::abort_break ) - { - entry.as_default->blk->abort = abort_t::abort_none; - abort = abort_t::abort_none; - childs.push_back(entry.as_default->blk.get()); - } - else if (entry.as_default->blk->abort <= abort ) - { - abort = entry.as_default->blk->abort; - } - } - } - } - - stmt->stmt =std::move(stmt_list); - - if (has_default) - { - if (default_ctx->abort == abort_t::abort_none) - { - break_blks_.push_back(default_ctx); - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - } - - blk->append(break_blks_); - blk->merge(childs); - } - - break_blks_ = old_breaks; -} - -void compiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - break_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_break; - } -} - -void compiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - continue_blks_.push_back(blk.get()); - blk->abort = abort_t::abort_continue; - } -} - -void compiler::process_stmt_return(const ast::stmt_return::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } -} - -void compiler::process_expr(const ast::expr& expr, const block::ptr& blk) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value, blk); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj, blk); - } - else if (expr == ast::kind::expr_tuple) - { - process_expr_tuple(expr.as_tuple, blk); - } -} - -void compiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - auto array = utils::string::va("_temp_%d", ++label_idx_); - expr->temp = ast::expr(std::make_unique(expr->loc(), array)); - - process_expr(expr->temp, blk); - - for (const auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk) -{ - for (const auto& entry : decl->list) - { - variable_register(entry->value, blk); - } -} - -void compiler::variable_register(const std::string& name, const block::ptr& blk) -{ - auto it = std::find_if (blk->local_vars.begin(), blk->local_vars.end(), - [&](const gsc::local_var& v) { return v.name == name; }); - - if (it == blk->local_vars.end()) - { - auto found = false; - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - blk->local_vars.push_back({ name, static_cast(i), false }); - found = true; - break; - } - } - - if (!found) - { - blk->local_vars.push_back({ name, stack_idx_, false }); - local_stack_.push_back(name); - stack_idx_++; - } - } -} - -void compiler::variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::uint32_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (!blk->local_vars[i].init) - { - for (std::uint32_t j = 0; j < i; j++) - { - if (!blk->local_vars[j].init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", blk->local_vars[j].create)); - blk->local_vars[j].init = true; - } - } - blk->local_vars[i].init = true; - blk->local_vars_create_count = i + 1; - return; - } - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -void compiler::variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk) -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - auto& var = blk->local_vars.at(i); - if (var.name == name->value) - { - if (!var.init) - { - emit_opcode(opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); - var.init = true; - blk->local_vars_create_count++; - } - return; - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return static_cast(blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - return utils::string::va("%d", blk->local_vars[i].create); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - if (blk->local_vars.at(i).init) - { - return utils::string::va("%d", blk->local_vars_create_count - 1 - i); - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool -{ - for (std::size_t i = 0; i < blk->local_vars.size(); i++) - { - if (blk->local_vars[i].name == name->value) - { - return blk->local_vars.at(i).init; - } - } - - 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_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_jump: - case opcode::OP_jumpback: - case opcode::OP_switch: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_endswitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - -auto compiler::map_known_includes(const std::string&) -> bool -{ - return false; -} - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/compiler.hpp b/src/s4/xsk/compiler.hpp deleted file mode 100644 index 194ffcb4..00000000 --- a/src/s4/xsk/compiler.hpp +++ /dev/null @@ -1,162 +0,0 @@ -// 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::gsc::s4 -{ - -enum class opcode : std::uint8_t; - -class compiler : public gsc::compiler -{ - build mode_; - std::string filename_; - std::vector assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector break_blks_; - std::vector continue_blks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - -public: - auto output() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_constant(const ast::decl_constant::ptr& constant); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt, const block::ptr& blk, bool last); - void emit_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void emit_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt, const block::ptr& blk); - void emit_stmt_waitframe(const ast::stmt_waitframe::ptr& stmt, const block::ptr& blk); - void emit_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk, bool last); - void emit_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void emit_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void emit_stmt_case(const ast::stmt_case::ptr& stmt, const block::ptr& blk); - void emit_stmt_default(const ast::stmt_default::ptr& stmt, const block::ptr& blk); - void emit_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void emit_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt, const block::ptr& blk); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt, const block::ptr& blk); - void emit_expr(const ast::expr& expr, const block::ptr& blk); - void emit_expr_assign(const ast::expr_assign::ptr& expr, const block::ptr& blk); - void emit_expr_clear(const ast::expr& expr, const block::ptr& blk); - void emit_expr_clear_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void emit_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk); - void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, const block::ptr& blk, bool is_stmt); - void emit_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void emit_expr_isdefined(const ast::expr_isdefined::ptr& expr, const block::ptr& blk); - void emit_expr_istrue(const ast::expr_istrue::ptr& expr, const block::ptr& blk); - void emit_expr_reference(const ast::expr_reference::ptr& expr, const block::ptr& blk); - void emit_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void emit_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void emit_expr_variable_ref(const ast::expr& expr, const block::ptr& blk, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, const block::ptr& blk, bool set); - void emit_expr_variable(const ast::expr& expr, const block::ptr& blk); - void emit_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void emit_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void emit_expr_local(const ast::expr_identifier::ptr& expr, const block::ptr& blk); - void emit_expr_object(const ast::expr& expr, const block::ptr& blk); - void emit_expr_vector(const ast::expr_vector::ptr& expr, const block::ptr& blk); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_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_create_local_vars(const block::ptr& blk); - void emit_remove_local_vars(const block::ptr& blk); - 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, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(const ast::expr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_parameters(const ast::expr_parameters::ptr& decl, const block::ptr& blk); - void variable_register(const std::string& name, const block::ptr& blk); - void variable_initialize(const ast::expr_identifier::ptr& name, const block::ptr& blk); - void variable_create(const ast::expr_identifier::ptr& name, const block::ptr& blk); - auto variable_stack_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::uint8_t; - auto variable_create_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_access_index(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> std::string; - auto variable_initialized(const ast::expr_identifier::ptr& name, const block::ptr& blk) -> bool; - 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; -}; - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/context.cpp b/src/s4/xsk/context.cpp deleted file mode 100644 index 4d98066b..00000000 --- a/src/s4/xsk/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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 "s4.hpp" - -namespace xsk::gsc::s4 -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/context.hpp b/src/s4/xsk/context.hpp deleted file mode 100644 index e14d7c55..00000000 --- a/src/s4/xsk/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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::gsc::s4 -{ - -class context : public gsc::context -{ - s4::assembler assembler_; - s4::disassembler disassembler_; - s4::compiler compiler_; - s4::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> gsc::assembler& { return assembler_; } - auto disassembler() -> gsc::disassembler& { return disassembler_; } - auto compiler() -> gsc::compiler& { return compiler_; } - auto decompiler() -> gsc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/decompiler.cpp b/src/s4/xsk/decompiler.cpp deleted file mode 100644 index e779919e..00000000 --- a/src/s4/xsk/decompiler.cpp +++ /dev/null @@ -1,3479 +0,0 @@ -// 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 "s4.hpp" - -namespace xsk::gsc::s4 -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(0x100000); - data->write_string("// S4 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, std::vector& funcs) -{ - filename_ = file; - program_ = std::make_unique(); - - for (const auto& func : funcs) - { - 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(); - blocks_.clear(); - - decompile_function(func); - - process_stack(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end"); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line); - - // remove last return - stmt->list.pop_back(); - - blocks_.push_back(blk); - - decompile_statements(stmt); - - blocks_.pop_back(); -} - -void decompiler::decompile_instruction(const instruction::ptr& inst) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - 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: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_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_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_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_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - 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_GetAnimTree: - { - 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); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetThisthread: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetBuiltinMethod: - { - 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)); - break; - } - case opcode::OP_GetLocalFunction: - { - 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)); - break; - } - case opcode::OP_GetFarFunction: - { - 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: - { - if (in_waittill_) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_RemoveLocalVariables: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached1: - { - auto node = std::make_unique(loc, "1"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached2: - { - auto node = std::make_unique(loc, "2"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached3: - { - auto node = std::make_unique(loc, "3"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached4: - { - auto node = std::make_unique(loc, "4"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached5: - { - auto node = std::make_unique(loc, "5"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_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_EvalNewLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, 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_EvalLocalArrayRefCached0: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, "0")); - 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, 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_AddArray: - { - auto value = ast::expr(std::move(stack_.top())); stack_.pop(); - auto array = std::move(stack_.top()); stack_.pop(); - - if (array->kind() == ast::kind::expr_empty_array) - { - auto args = std::make_unique(loc); - args->list.push_back(std::move(value)); - auto node = std::make_unique(array->loc(), std::move(args)); - stack_.push(std::move(node)); - } - else if (array->kind() == ast::kind::expr_add_array) - { - (*(ast::expr_add_array::ptr*)&array)->args->list.push_back(std::move(value)); - stack_.push(std::move(array)); - } - else - { - throw decomp_error("unknown add array type (could be an array variable name?)"); - } - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalFunctionCall2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - 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_ScriptLocalFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalMethodCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - 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_ScriptLocalThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptLocalMethodChildThreadCall: - { - 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); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarFunctionCall2: - { - 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 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_ScriptFarFunctionCall: - { - 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_ScriptFarMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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_ScriptFarThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarChildThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFarMethodChildThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->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]); - - for (auto i = std::stoul(inst->data[2]); i > 0; i--) - { - 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::childthread)); - auto node = std::make_unique(loc, std::move(obj), 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(); - 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_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(); - 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_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptChildThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(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_ScriptMethodChildThreadCallPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::childthread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethodPointer: - { - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - 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(func), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin1: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin2: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin3: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin4: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin5: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod0: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod1: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 1u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod2: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 2u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod3: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 3u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod4: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 4u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod5: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - - for (auto i = 5u; i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, inst->data[0]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - for (auto i = std::stoul(inst->data[1]); i > 0; i--) - { - 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::builtin)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - break; - } - case opcode::OP_dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), false); - stack_.push(std::move(node)); - 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_ex_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_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_equality: - { - 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_inequality: - { - 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_less: - { - 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_greater: - { - 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_less_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_greater_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_shift_left: - { - 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_shift_right: - { - 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_mod: - { - 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_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_waitframe: - { - auto stmt = ast::stmt(std::make_unique(loc)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_waittill: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto args = std::make_unique(loc); - auto node = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(node)); - in_waittill_ = true; - break; - } - case opcode::OP_waittillmatch: - { - auto args = std::make_unique(loc); - 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(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_clearparams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto node = std::move(stack_.top()); stack_.pop(); - - while (node->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - } - - if (node->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&node)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(node))); - } - 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 node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - - while (node->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(node)); - node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endon: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_voidCodepos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_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_size: - { - 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_EvalLevelFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariable: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLevelFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalAnimFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalSelfFieldVariableRef: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeCreateVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - if (stack_.top()->kind() != ast::kind::asm_create) - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_SafeSetVariableFieldCached0: - { - auto expr = std::make_unique(loc, "var_0"); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_SafeSetVariableFieldCached: - { - auto expr = std::make_unique(loc, "var_" + inst->data[0]); - func_->params->list.push_back(std::move(expr)); - break; - } - case opcode::OP_EvalLocalVariableRefCached0: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetLevelFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (lvalue.as_node->kind() == ast::kind::expr_increment) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else if (lvalue.as_node->kind() == ast::kind::expr_decrement) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue))); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_SetAnimFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetSelfFieldVariableField: - { - auto obj = ast::expr(std::make_unique(loc)); - auto field = std::make_unique(loc, inst->data[0]); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, "0")); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SetNewLocalVariableFieldCached0: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - - if (func_->stmt->list.size() > 0) - { - std::vector vars; - - while (func_->stmt->list.back().as_node->kind() == ast::kind::asm_create) - { - auto& entry = func_->stmt->list.back(); - if (loc.begin.line < entry.as_node->loc().begin.line) - { - vars.push_back(entry.as_asm_create->index); - func_->stmt->list.pop_back(); - continue; - } - break; - } - - std::reverse(vars.begin(), vars.end()); - lvalue.as_asm_create->vars = vars; - } - - 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_SetLocalVariableFieldCached: - { - auto lvalue = ast::expr(std::make_unique(loc, inst->data[0])); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_ClearLocalVariableFieldCached0: - { - auto stmt = ast::stmt(std::make_unique(loc, "0")); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EvalLocalVariableObjectCached: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNot: - { - 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_BoolComplement: - { - 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_switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_endswitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_jumpback: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - 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 node = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(node)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_FormalParams: - { - auto count = std::stoi(inst->data[0]); - - for (auto i = 1; i <= count; i++) - { - func_->params->list.push_back(std::make_unique(loc, "var_" + inst->data[i])); - } - break; - } - case opcode::OP_IsDefined: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto node = std::make_unique(expr.loc(), std::move(expr)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_IsTrue: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto node = std::make_unique(expr.loc(), std::move(expr)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_BoolNotAfterAnd: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto node = std::make_unique(expr.loc(), std::move(expr)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_waittillmatch2: - case opcode::OP_checkclearparams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - break; - // case opcode::OP_ClearVariableField - // case opcode::OP_EvalNewLocalVariableRefCached0 - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_tuples(stmt); -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) - return; - - for (auto i = static_cast(stmt->list.size() - 1); i >= 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump_back) - { - 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_back->value); - - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond) - { - if (i - 1 == static_cast(start)) // condition belongs to empty loop - { - decompile_while(stmt, start, i); - i = static_cast(stmt->list.size()); - continue; - } - else if (static_cast(i) < find_location_index(stmt, stmt->list.at(i - 1).as_cond->value)) - { - decompile_dowhile(stmt, i - 1, i); - i = static_cast(stmt->list.size()); - continue; - } - } - - if (i == static_cast(start)) // empty inf loop - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) // no condition - { - decompile_inf(stmt, start, i); - } - else if (stmt->list.at(start).as_cond->value != break_loc) // condition belong to other stmt - { - decompile_inf(stmt, start, i); - } - else // condition belong to loop - { - decompile_loop(stmt, start, i); - } - - i = static_cast(stmt->list.size()); - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - // check for if/else or if/continue - if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // if { break/return } else { continue } at loop block end - if (j - i > 2 && (stmt->list.at(j - 2) == ast::kind::asm_jump || stmt->list.at(j - 2) == ast::kind::stmt_return)) - { - decompile_if(stmt, i, j); - } - else - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { // last if/else inside a loop still trigger this :( - 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 == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - { - // if block, have a empty else inside at end - decompile_if(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); // if block with empty else - } - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else if (stmt->list.at(j) == ast::kind::stmt_return && stmt->list.at(j).as_return->expr == ast::kind::null) - { - if(entry.as_cond->value != blocks_.back().loc_end) - { - auto ref = stmt->list.at(j + 1).loc().label(); - - if (find_location_reference(stmt, i + 1, j, ref)) - { - // after return is referenced inside the block - decompile_if(stmt, i, j); - continue; - } - } - - if (blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") - { - decompile_if(stmt, i, j); // inside a loop cant be last - } - else if (j - i == 1) - { - decompile_if(stmt, i, j); // only one explicit return - } - else if (stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // block end is not a last return - } - else if (blocks_.back().is_last && stmt->list.back().as_node->kind() != ast::kind::stmt_return) - { - decompile_if(stmt, i, j); // inside a last block but is not and inner last - } - else if (find_location_reference(stmt, j, stmt->list.size(), last_loc)) - { - decompile_if(stmt, i, j); // reference to func end after the if - } - else if (blocks_.size() > 1 && !blocks_.back().is_last) - { - decompile_if(stmt, i, j); // fake last ifelse - } - else - { - decompile_ifelse_end(stmt, i, j); // special case - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) -{ - for (auto i = 0u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_jump) - { - auto loc = block->list.at(i).loc(); - auto jump_loc = block->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_continue) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else if (jump_loc == blocks_.back().loc_break) - { - block->list.erase(block->list.begin() + i); - auto stmt = ast::stmt(std::make_unique(loc)); - block->list.insert(block->list.begin() + i, std::move(stmt)); - } - else - { - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_tuples(const ast::stmt_list::ptr& block) -{ - for (auto i = 1u; i < block->list.size(); i++) - { - if (block->list.at(i) == ast::kind::asm_clear) - { - auto j = i - 1; - auto found = false, done = false; - - while (j >= 0 && block->list.at(j) == ast::kind::stmt_assign) - { - const auto& expr = block->list.at(j).as_assign->expr; - - if (expr != ast::kind::expr_assign_equal) - break; - - if (!done) - { - if (expr.as_assign_equal->rvalue != ast::kind::expr_array) - break; - - if (expr.as_assign_equal->rvalue.as_array->key != ast::kind::expr_integer) - break; - - if (expr.as_assign_equal->rvalue.as_array->key.as_integer->value == "0") - done = true; - - j--; - } - else - { - if (expr.as_assign_equal->lvalue == ast::kind::asm_create || expr.as_assign_equal->lvalue == ast::kind::asm_access) - found = true; - - break; - } - } - - if (found) - { - auto& stmt = block->list.at(j); // temp = expr; - auto new_expr = std::make_unique(stmt.loc()); - new_expr->temp = std::move(stmt.as_assign->expr.as_assign_equal->lvalue); - j++; - - while (j < i) - { - new_expr->list.push_back(std::move(block->list.at(j).as_assign->expr.as_assign_equal->lvalue)); - block->list.erase(block->list.begin() + j); - i--; - } - - block->list.erase(block->list.begin() + j); // clear temp array - i--; - - stmt.as_assign->expr.as_assign_equal->lvalue = ast::expr(std::move(new_expr)); - } - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.is_last = true; - - auto if_end = find_location_index(stmt, stmt->list.at(begin).as_cond->value) - 1; - if_blk.loc_end = stmt->list.at(if_end).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() + 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); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - if (begin == stmt->list.size()) - { - 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)); - } - else - { - block else_blk; - else_blk.is_last = true; - - end = stmt->list.size() - 1; - else_blk.loc_end = stmt->list.at(end).loc().label(); - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - stmt->list.erase(stmt->list.begin() + begin); // remove 'return' - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); - } -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove '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 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& block, std::size_t start, std::size_t end) -{ - const auto& last = block->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 = block->list.at(start).loc().label(); - - if (!find_location_reference(block, 0, start, ref)) - { - decompile_foreach(block, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - auto index = 1; - while (block->list.at(start - index) == ast::kind::asm_create) - { - if (start - index > 0) - index++; - else - break; - } - - if (block->list.at(start - index) == ast::kind::stmt_assign) - { - auto ref = block->list.at(end).loc().label(); - auto ref2 = block->list.at(start - index + 1).loc().label(); - - if (find_location_reference(block, start, end, ref)) - { - // continue is at jumpback, not post-expr - decompile_while(block, start, end); - return; - } - else if (find_location_reference(block, 0, start, ref2)) - { - // begin is at condition or localVarCreate, not pre-expr - decompile_while(block, start, end); - return; - } - else - { - decompile_for(block, start, end); - return; - } - } - } - } - - decompile_while(block, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = 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_back->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::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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)))); - new_stmt.as_for->vars = vars; - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - // collect local vars - std::vector vars; - while (stmt->list.at(begin - 1) == ast::kind::asm_create) - { - vars.push_back(stmt->list.at(begin - 1).as_asm_create->index); - stmt->list.erase(stmt->list.begin() + begin - 1); - begin--; - end--; - } - - std::reverse(vars.begin(), vars.end()); - - 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 - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'array' - } - - auto use_key = true; - - if (stmt->list.size() > end && stmt->list.at(end) == ast::kind::asm_clear) - { - stmt->list.erase(stmt->list.begin() + end); // remove temp var 'key' - use_key = false; - } - - 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)), use_key)); - new_stmt.as_foreach->vars = vars; - new_stmt.as_foreach->pre_expr = std::move(init); - new_stmt.as_foreach->stmt0 = std::move(stmt0); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto 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); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -void decompiler::process_stack(const ast::decl_thread::ptr& thread) -{ - auto blk = std::make_unique(); - - process_parameters(thread->params, blk); - process_stmt_list(thread->stmt, blk); -} - -void decompiler::process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk) -{ - for (const auto& entry : params->list) - { - blk->local_vars.push_back({ entry->value, static_cast(std::stoi(entry->value.substr(4))), true }); - blk->local_vars_create_count++; - } -} - -void decompiler::process_stmt(const ast::stmt& stmt, const block::ptr& blk) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list, blk); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr, blk); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call, blk); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign, blk); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon, blk); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify, blk); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait, blk); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill, blk); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch, blk); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if, blk); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse, blk); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while, blk); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile, blk); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for, blk); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach, blk); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch, blk); - break; - case ast::kind::stmt_break: - process_stmt_break(stmt.as_break, blk); - break; - case ast::kind::stmt_continue: - process_stmt_continue(stmt.as_continue, blk); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return, blk); - break; - case ast::kind::asm_remove: - process_var_remove(stmt.as_asm_remove, blk); - break; - case ast::kind::asm_create: - { - auto expr = ast::expr(std::make_unique(stmt.as_asm_create->index)); - process_var_create(expr, blk, true); - break; - } - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry, blk); - } - - auto i = 0u; - - while (i < stmt->list.size()) - { - auto type = stmt->list.at(i).kind(); - - if (type == ast::kind::asm_create || type == ast::kind::asm_remove) - { - stmt->list.erase(stmt->list.begin() + i); - continue; - } - - i++; - } -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment, blk); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement, blk); - 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, blk); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->time, blk); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->event ,blk); - process_expr(stmt->obj, blk); - - for (auto& entry : stmt->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk) -{ - process_expr_arguments(stmt->args, blk); - process_expr(stmt->event, blk); - process_expr(stmt->obj, blk); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - auto abort = abort_t::abort_return; - - process_expr(stmt->test, blk); - - stmt->blk_if = std::make_unique(); - blk->transfer_decompiler(stmt->blk_if); - - process_stmt(stmt->stmt_if, stmt->blk_if); - - if (stmt->blk_if->abort <= abort_t::abort_return) - { - abort = stmt->blk_if->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_if.get()); - } - - stmt->blk_else = std::make_unique(); - blk->transfer_decompiler(stmt->blk_else); - - process_stmt(stmt->stmt_else, stmt->blk_else); - - if (stmt->blk_else->abort <= abort) - { - abort = stmt->blk_else->abort; - - if (abort == abort_t::abort_none) - childs.push_back(stmt->blk_else.get()); - } - - if (blk->abort == abort_t::abort_none) - blk->abort = abort; - - blk->append(childs); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list.at(0).as_node->is_special_stmt()) - { - 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.at(0).as_node->is_special_stmt_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_stmt(stmt->stmt, stmt->blk); - - std::vector childs({ stmt->blk.get() }); - - if (stmt->test.as_node->kind() == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->init, blk); - - for (const auto& index : stmt->vars) - { - auto var = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->blk = std::make_unique(); - blk->transfer_decompiler(stmt->blk); - - process_expr(stmt->test, blk); - - process_stmt(stmt->stmt, stmt->blk); - - process_stmt(stmt->iter, blk); - - if (stmt->test == ast::kind::null) - blk->append_decompiler(stmt->blk); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk) -{ - process_stmt(stmt->pre_expr, blk); - - for (const auto& index : stmt->vars) - { - auto var1 = utils::string::va("var_%d", std::stoi(index)); - blk->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); - blk->local_vars_create_count++; - } - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt(stmt->stmt0, stmt->ctx); - process_stmt(stmt->stmt, stmt->ctx); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } - - stmt->array_expr = std::move(stmt->pre_expr.as_list->list[0].as_assign->expr.as_assign->rvalue); - stmt->value_expr = std::move(stmt->stmt0.as_assign->expr.as_assign->lvalue); - stmt->key_expr = std::move(stmt->pre_expr.as_list->list[1].as_assign->expr.as_assign->lvalue); -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk) -{ - process_expr(stmt->test, blk); - - stmt->ctx = std::make_unique(); - blk->transfer_decompiler(stmt->ctx); - - process_stmt_cases(stmt->stmt, stmt->ctx); - - blk->append_decompiler(stmt->ctx, true); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk) -{ - std::vector childs; - bool has_default = false; - - for (const auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - entry.as_case->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_case->blk); - - process_stmt_list(entry.as_case->stmt, entry.as_case->blk); - - if (entry.as_case->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_case->blk.get()); - } - } - else if (entry == ast::kind::stmt_default) - { - has_default = true; - entry.as_default->blk = std::make_unique(); - blk->transfer_decompiler(entry.as_default->blk); - - process_stmt_list(entry.as_default->stmt, entry.as_default->blk); - - if (entry.as_default->blk->abort == abort_t::abort_break) - { - childs.push_back(entry.as_default->blk.get()); - } - } - } - - if (has_default) - { - blk->append(childs); - } -} - -void decompiler::process_stmt_break(const ast::stmt_break::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_break; - } -} - -void decompiler::process_stmt_continue(const ast::stmt_continue::ptr&, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_continue; - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk) -{ - if (blk->abort == abort_t::abort_none) - { - blk->abort = abort_t::abort_return; - } - - if (stmt->expr != ast::kind::null) - { - process_expr(stmt->expr, blk); - } -} - -void decompiler::process_expr(ast::expr& expr, const block::ptr& blk) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary, blk); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and, blk); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or, blk); - 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, blk); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement, blk); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not, blk); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call, blk); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method, blk); - break; - case ast::kind::expr_isdefined: - process_expr(expr.as_isdefined->expr, blk); - break; - case ast::kind::expr_istrue: - process_expr(expr.as_istrue->expr, blk); - break; - case ast::kind::expr_add_array: - process_expr_add_array(expr.as_add_array, blk); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size, blk); - break; - case ast::kind::expr_tuple: - process_expr_tuple(expr.as_tuple, blk); - break; - case ast::kind::expr_array: - process_expr_array(expr.as_array, blk); - break; - case ast::kind::expr_field: - process_expr_field(expr.as_field, blk); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector, blk); - break; - case ast::kind::asm_create: - process_var_create(expr, blk); - break; - case ast::kind::asm_access: - process_var_access(expr, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - process_expr(expr->lvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->test, blk); - process_expr(expr->true_expr, blk); - process_expr(expr->false_expr, blk); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->lvalue, blk); - process_expr(expr->rvalue, blk); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - process_expr(expr->rvalue, blk); - - 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, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer, blk); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj, blk); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj, blk); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); - process_expr(expr->func, blk); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk) -{ - process_expr_arguments(expr->args, blk); - process_expr(obj, blk); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1), blk); - } -} - -void decompiler::process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk) -{ - for (auto& entry : expr->args->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->temp, blk); - - for (auto& entry : expr->list) - { - process_expr(entry, blk); - } -} - -void decompiler::process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->key, blk); - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk) -{ - process_expr(expr->obj, blk); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk) -{ - process_expr(vec->z, blk); - process_expr(vec->y, blk); - process_expr(vec->x, blk); -} - -void decompiler::process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt) -{ - if (fromstmt) - { - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - } - else - { - for (const auto& entry : expr.as_asm_create->vars) - { - blk->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); - blk->local_vars_create_count++; - } - - auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); - blk->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); - blk->local_vars_create_count++; - - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) -{ - if (blk->local_vars.size() <= std::stoul(expr.as_asm_access->index)) - { - std::cout << "WARNING: bad local var access\n"; - } - else - { - auto var = blk->local_vars.at(blk->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; - expr = ast::expr(std::make_unique(var)); - } -} - -void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) -{ - blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); -} - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/decompiler.hpp b/src/s4/xsk/decompiler.hpp deleted file mode 100644 index 566c60b4..00000000 --- a/src/s4/xsk/decompiler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// 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::gsc::s4 -{ - -class decompiler : public gsc::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 blocks_; - bool in_waittill_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, std::vector& funcs); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(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_tuples(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse_end(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - void process_stack(const ast::decl_thread::ptr& thread); - void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); - void process_stmt(const ast::stmt& stmt, const block::ptr& blk); - void process_stmt_list(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt, const block::ptr& blk); - void process_stmt_call(const ast::stmt_call::ptr& stmt, const block::ptr& blk); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt, const block::ptr& blk); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt, const block::ptr& blk); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt, const block::ptr& blk); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt, const block::ptr& blk); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt, const block::ptr& blk); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt, const block::ptr& blk); - void process_stmt_if(const ast::stmt_if::ptr& stmt, const block::ptr& blk); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt, const block::ptr& blk); - void process_stmt_while(const ast::stmt_while::ptr& stmt, const block::ptr& blk); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt, const block::ptr& blk); - void process_stmt_for(const ast::stmt_for::ptr& stmt, const block::ptr& blk); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt, const block::ptr& blk); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt, const block::ptr& blk); - void process_stmt_cases(const ast::stmt_list::ptr& stmt, const block::ptr& blk); - void process_stmt_break(const ast::stmt_break::ptr& stmt, const block::ptr& blk); - void process_stmt_continue(const ast::stmt_continue::ptr& stmt, const block::ptr& blk); - void process_stmt_return(const ast::stmt_return::ptr& stmt, const block::ptr& blk); - void process_expr(ast::expr& expr, const block::ptr& blk); - void process_expr_assign(ast::expr_assign::ptr& expr, const block::ptr& blk); - void process_expr_increment(const ast::expr_increment::ptr& expr, const block::ptr& blk); - void process_expr_decrement(const ast::expr_decrement::ptr& expr, const block::ptr& blk); - void process_expr_ternary(const ast::expr_ternary::ptr& expr, const block::ptr& blk); - void process_expr_binary(const ast::expr_binary::ptr& expr, const block::ptr& blk); - void process_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk); - void process_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk); - void process_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk); - void process_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk); - void process_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk); - void process_expr_method(const ast::expr_method::ptr& expr, const block::ptr& blk); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk); - void process_expr_call_function(const ast::expr_function::ptr& expr, const block::ptr& blk); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj, const block::ptr& blk); - void process_expr_arguments(const ast::expr_arguments::ptr& expr, const block::ptr& blk); - void process_expr_add_array(const ast::expr_add_array::ptr& expr, const block::ptr& blk); - void process_expr_size(const ast::expr_size::ptr& expr, const block::ptr& blk); - void process_expr_tuple(const ast::expr_tuple::ptr& expr, const block::ptr& blk); - void process_expr_array(const ast::expr_array::ptr& expr, const block::ptr& blk); - void process_expr_field(const ast::expr_field::ptr& expr, const block::ptr& blk); - void process_expr_vector(const ast::expr_vector::ptr& vec, const block::ptr& blk); - void process_var_create(ast::expr& expr, const block::ptr& blk, bool fromstmt = false); - void process_var_access(ast::expr& expr, const block::ptr& blk); - void process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk); -}; - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/disassembler.cpp b/src/s4/xsk/disassembler.cpp deleted file mode 100644 index 456a4ffb..00000000 --- a/src/s4/xsk/disassembler.cpp +++ /dev/null @@ -1,640 +0,0 @@ -// 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 "s4.hpp" - -namespace xsk::gsc::s4 -{ - -auto disassembler::output() -> std::vector -{ - return std::move(functions_); -} - -auto disassembler::output_data() -> std::vector -{ - output_ = std::make_unique(0x100000); - - output_->write_string("// S4 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : functions_) - { - print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) -{ - filename_ = file; - script_ = std::make_unique(script); - stack_ = std::make_unique(stack); - functions_.clear(); - - script_->seek(1); - - while (stack_->is_avail() && script_->is_avail()) - { - functions_.push_back(std::make_unique()); - const auto& func = functions_.back(); - - func->index = static_cast(script_->pos()); - func->size = stack_->read(); - func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id); - - dissasemble_function(func); - - func->labels = labels_; - labels_.clear(); - } - - resolve_local_functions(); -} - -void disassembler::dissasemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - - const auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read(); - inst->size = opcode_size(inst->opcode); - - dissasemble_instruction(inst); - - size -= inst->size; - } -} - -void disassembler::dissasemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_CastFieldObject: - case opcode::OP_plus: - case opcode::OP_GetGameRef: - case opcode::OP_GetThisthread: - case opcode::OP_greater: - case opcode::OP_shift_right: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_equality: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_notify: - case opcode::OP_PreScriptCall: - case opcode::OP_GetUndefined: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_size: - case opcode::OP_AddArray: - case opcode::OP_endon: - case opcode::OP_shift_left: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_Return: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetSelfObject: - case opcode::OP_GetGame: - case opcode::OP_EvalArray: - case opcode::OP_GetSelf: - case opcode::OP_End: - case opcode::OP_less_equal: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_checkclearparams: - case opcode::OP_waittillmatch2: - case opcode::OP_minus: - case opcode::OP_greater_equal: - case opcode::OP_vector: - case opcode::OP_ClearArray: - case opcode::OP_DecTop: - case opcode::OP_CastBool: - case opcode::OP_EvalArrayRef: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_waittill: - case opcode::OP_GetAnimObject: - case opcode::OP_mod: - case opcode::OP_clearparams: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_EmptyArray: - case opcode::OP_ClearVariableField: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_BoolComplement: - case opcode::OP_less: - case opcode::OP_BoolNot: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitframe: - case opcode::OP_GetLevelObject: - case opcode::OP_inc: - case opcode::OP_GetAnim: - case opcode::OP_SetVariableField: - case opcode::OP_divide: - case opcode::OP_multiply: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_bit_and: - case opcode::OP_voidCodepos: - case opcode::OP_inequality: - case opcode::OP_bit_ex_or: -// case opcode::OP_NOP: -// case opcode::OP_abort: -// case opcode::OP_object: -// case opcode::OP_thread_object: - case opcode::OP_EvalLocalVariable: - case opcode::OP_EvalLocalVariableRef: -// case opcode::OP_breakpoint: -// case opcode::OP_assignmentBreakpoint: -// case opcode::OP_manualAndAssignmentBreakpoint: - case opcode::OP_BoolNotAfterAnd: - case opcode::OP_IsDefined: - case opcode::OP_IsTrue: - 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->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetInteger: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFloat: - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetVector: - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->seek(4); - inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); - break; - case opcode::OP_GetAnimation: - script_->seek(8); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_GetAnimTree: - script_->seek(1); - inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); - break; - case opcode::OP_waittillmatch: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_EvalLocalArrayCached: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalSelfFieldVariableRef: - disassemble_field_variable(inst); - break; - case opcode::OP_CallBuiltinPointer: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_ScriptMethodChildThreadCallPointer: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_ScriptFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break; - case opcode::OP_CallBuiltin: - disassemble_builtin_call(inst, false, true); - break; - case opcode::OP_CallBuiltinMethod: - disassemble_builtin_call(inst, true, true); - break; - case opcode::OP_GetBuiltinFunction: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - disassemble_builtin_call(inst, false, false); - break; - case opcode::OP_GetBuiltinMethod: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - disassemble_builtin_call(inst, true, false); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - disassemble_jump(inst, true, false); - break; - case opcode::OP_jumpback: - disassemble_jump(inst, false, true); - break; - case opcode::OP_jump: - disassemble_jump(inst, false, false); - break; - case opcode::OP_switch: - disassemble_switch(inst); - break; - case opcode::OP_endswitch: - disassemble_end_switch(inst); - break; -/* case opcode::OP_prof_begin: - script_->seek(5); // TODO: skipped data - break; - case opcode::OP_prof_end: - script_->seek(1); // TODO: skipped data - break; - case opcode::OP_EvalNewLocalArrayRefCached0_Precompiled: - case opcode::OP_SetNewLocalVariableFieldCached0_Precompiled: - case opcode::OP_CreateLocalVariable_Precompiled: - case opcode::OP_SafeCreateVariableFieldCached_Precompiled: - inst->data.push_back(utils::string::va("%i", script_->read())); - break;*/ - case opcode::OP_FormalParams: - case opcode::OP_FormalParams_Precompiled: - disassemble_formal_params(inst); - break; -/* case opcode::OP_NativeGetLocalFunction: - case opcode::OP_NativeLocalFunctionCall: - case opcode::OP_NativeLocalFunctionCall2: - case opcode::OP_NativeLocalMethodCall: - disassemble_local_call(inst, false); - break; - case opcode::OP_NativeGetFarFunction: - case opcode::OP_NativeFarFunctionCall: - case opcode::OP_NativeFarFunctionCall2: - case opcode::OP_NativeFarMethodCall: - disassemble_far_call(inst, false); - break; - case opcode::OP_NativeLocalFunctionThreadCall: - case opcode::OP_NativeLocalMethodThreadCall: - case opcode::OP_NativeLocalFunctionChildThreadCall: - case opcode::OP_NativeLocalMethodChildThreadCall: - disassemble_local_call(inst, true); - break; - case opcode::OP_NativeFarFunctionThreadCall: - case opcode::OP_NativeFarMethodThreadCall: - case opcode::OP_NativeFarFunctionChildThreadCall: - case opcode::OP_NativeFarMethodChildThreadCall: - disassemble_far_call(inst, true); - break;*/ - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args) -{ - if (args) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto id = script_->read(); - const auto name = method ? resolver::method_name(id) : resolver::function_name(id); - inst->data.emplace(inst->data.begin(), name); -} - -void disassembler::disassemble_local_call(const instruction::ptr& inst, bool thread) -{ - const auto offset = disassemble_offset(); - - inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } -} - -void disassembler::disassemble_far_call(const instruction::ptr& inst, bool thread) -{ - script_->seek(3); - - if (thread) - { - inst->data.push_back(utils::string::va("%i", script_->read())); - } - - const auto file_id = stack_->read(); - const auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::token_name(file_id); - const auto func_id = stack_->read(); - const auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); - - inst->data.emplace(inst->data.begin(), func_name); - inst->data.emplace(inst->data.begin(), file_name); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - const auto addr = inst->index + 4 + script_->read(); - 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) -{ - const auto count = script_->read(); - inst->data.push_back(utils::string::va("%i", count)); - - std::uint32_t index = inst->index + 3; - - if (count) - { - for (auto i = count; i > 0; i--) - { - const auto value = script_->read(); - - if (value < 0x80000) - { - const auto data = stack_->read_c_string(); - - if (data.data()[0] != 0x01) - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::quote(data, false)); - } - else - inst->data.push_back("default"); - } - else - { - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - index += 4; - - const auto addr = disassemble_offset() + index; - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - index += 3; - inst->size += 7; - } - } -} - -void disassembler::disassemble_field_variable(const instruction::ptr& inst) -{ - const auto id = script_->read(); - std::string name; - - if (id > max_string_id) - { - auto temp = stack_->read(); - name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); - } - else - { - name = resolver::token_name(id); - } - - inst->data.push_back(name); -} - -void disassembler::disassemble_formal_params(const instruction::ptr& inst) -{ - const auto count = script_->read(); - - inst->size += count; - inst->data.push_back(utils::string::va("%i", count)); - - for (auto i = 0u; i < count; i++) - { - inst->data.push_back(utils::string::va("%d", script_->read())); - } -} - -void disassembler::disassemble_jump(const instruction::ptr& inst, bool expr, bool back) -{ - std::int32_t addr; - - if (expr) - { - addr = inst->index + 3 + script_->read(); - } - else if (back) - { - addr = inst->index + 3 - script_->read(); - } - else - { - addr = inst->index + 5 + script_->read(); - } - - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -auto disassembler::disassemble_offset() -> std::int32_t -{ - std::array bytes = {}; - - for (auto i = 0; i < 3; i++) - { - bytes[i] = script_->read(); - } - - auto offset = *reinterpret_cast(bytes.data()); - - offset = (offset << 8) >> 8; - - return offset; -} - -void disassembler::resolve_local_functions() -{ - for (const auto& func : functions_) - { - for (const auto& inst : func->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - inst->data[0] = resolve_function(inst->data[0]); - break; - default: - break; - } - } - } -} - -auto disassembler::resolve_function(const std::string& index) -> std::string -{ - if (utils::string::is_hex_number(index)) - { - std::uint32_t idx = std::stoul(index, nullptr, 16); - - for (const auto& func : functions_) - { - if (func->index == idx) - { - return func->name; - } - } - - throw disasm_error(utils::string::va("couldn't resolve function name at index '0x%04X'!", idx)); - } - - throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s\n", func->name.data())); - - 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())); - } - - print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetLocalFunction: - case opcode::OP_ScriptLocalFunctionCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptLocalMethodCall: - output_->write_string(utils::string::va(" sub_%s", inst->data[0].data())); - break; - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_ScriptLocalMethodChildThreadCall: - output_->write_string(utils::string::va(" sub_%s %s\n", inst->data[0].data(), inst->data[1].data())); - break; - 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; - } - if (casenum != totalcase - 1) - { - output_->write_string("\n"); - } - } - } - break; - default: - for (auto& data : inst->data) - { - output_->write_string(utils::string::va(" %s", data.data())); - } - break; - } - - output_->write_string("\n"); -} - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/disassembler.hpp b/src/s4/xsk/disassembler.hpp deleted file mode 100644 index 736ccdf4..00000000 --- a/src/s4/xsk/disassembler.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// 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::gsc::s4 -{ - -class disassembler : public gsc::disassembler -{ - std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr stack_; - utils::byte_buffer::ptr output_; - std::vector functions_; - std::unordered_map labels_; - -public: - auto output() -> std::vector; - auto output_data() -> std::vector; - void disassemble(const std::string& file, std::vector& script, std::vector& stack); - -private: - void dissasemble_function(const function::ptr& func); - void dissasemble_instruction(const instruction::ptr& inst); - void disassemble_builtin_call(const instruction::ptr& inst, bool method, bool args); - void disassemble_local_call(const instruction::ptr& inst, bool thread); - void disassemble_far_call(const instruction::ptr& inst, bool thread); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void disassemble_field_variable(const instruction::ptr& inst); - void disassemble_formal_params(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst, bool expr, bool back); - auto disassemble_offset() -> std::int32_t; - void resolve_local_functions(); - auto resolve_function(const std::string& index) -> std::string; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/lexer.hpp b/src/s4/xsk/lexer.hpp deleted file mode 100644 index 53d77a07..00000000 --- a/src/s4/xsk/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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::gsc::s4 -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/parser.cpp b/src/s4/xsk/parser.cpp deleted file mode 100644 index 32ff7eb5..00000000 --- a/src/s4/xsk/parser.cpp +++ /dev/null @@ -1,4815 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "stdafx.hpp" -#include "parser.hpp" -#include "lexer.hpp" -using namespace xsk::gsc; -xsk::gsc::s4::parser::symbol_type S4lex(xsk::gsc::s4::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex S4lex - - - -#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 S4DEBUG - -// 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 // !S4DEBUG - -# 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 // !S4DEBUG - -#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 gsc { namespace s4 { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::gsc::s4::lexer& lexer_yyarg, xsk::gsc::ast::program::ptr& ast_yyarg) -#if S4DEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - 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_add_array: // expr_add_array - value.YY_MOVE_OR_COPY< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - value.YY_MOVE_OR_COPY< ast::expr_isdefined::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istrue: // expr_istrue - value.YY_MOVE_OR_COPY< ast::expr_istrue::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.YY_MOVE_OR_COPY< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.YY_MOVE_OR_COPY< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.YY_MOVE_OR_COPY< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.YY_MOVE_OR_COPY< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.YY_MOVE_OR_COPY< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.YY_MOVE_OR_COPY< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.YY_MOVE_OR_COPY< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - value.move< ast::expr_isdefined::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istrue: // expr_istrue - value.move< ast::expr_istrue::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.copy< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - value.copy< ast::expr_isdefined::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_istrue: // expr_istrue - value.copy< ast::expr_istrue::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.copy< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.copy< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.copy< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.copy< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.copy< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.copy< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.copy< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - value.move< ast::expr_add_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - value.move< ast::expr_isdefined::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_istrue: // expr_istrue - value.move< ast::expr_istrue::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - value.move< ast::expr_thisthread::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_tuple_arguments: // expr_tuple_arguments - value.move< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - value.move< ast::stmt_waitframe::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 S4DEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if S4DEBUG - 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 // S4DEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_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_tuple: // expr_tuple - case symbol_kind::S_expr_tuple_types: // expr_tuple_types - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_add_array: // expr_add_array - yylhs.value.emplace< ast::expr_add_array::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - yylhs.value.emplace< ast::expr_isdefined::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_istrue: // expr_istrue - yylhs.value.emplace< ast::expr_istrue::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_thisthread: // expr_thisthread - yylhs.value.emplace< ast::expr_thisthread::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_tuple_arguments: // expr_tuple_arguments - yylhs.value.emplace< ast::expr_tuple::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_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_waitframe: // stmt_waitframe - yylhs.value.emplace< ast::stmt_waitframe::ptr > (); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - yylhs.value.emplace< ast::stmt_waittill::ptr > (); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - yylhs.value.emplace< ast::stmt_waittillframeend::ptr > (); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - yylhs.value.emplace< ast::stmt_waittillmatch::ptr > (); - break; - - case symbol_kind::S_stmt_while: // stmt_while - yylhs.value.emplace< ast::stmt_while::ptr > (); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_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 267 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2080 "parser.cpp" - break; - - case 3: // root: %empty -#line 268 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2086 "parser.cpp" - break; - - case 4: // program: program inline -#line 273 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2092 "parser.cpp" - break; - - case 5: // program: program include -#line 275 "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 2098 "parser.cpp" - break; - - case 6: // program: program declaration -#line 277 "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 2104 "parser.cpp" - break; - - case 7: // program: inline -#line 279 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2110 "parser.cpp" - break; - - case 8: // program: include -#line 281 "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 2116 "parser.cpp" - break; - - case 9: // program: declaration -#line 283 "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 2122 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 287 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2128 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 292 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2134 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 296 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2140 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 297 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2146 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 298 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2152 "parser.cpp" - break; - - case 15: // declaration: decl_constant -#line 299 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } -#line 2158 "parser.cpp" - break; - - case 16: // declaration: decl_thread -#line 300 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2164 "parser.cpp" - break; - - case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 305 "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 2170 "parser.cpp" - break; - - case 18: // decl_constant: expr_identifier "=" expr ";" -#line 310 "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 2176 "parser.cpp" - break; - - case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 315 "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 2182 "parser.cpp" - break; - - case 20: // stmt: stmt_block -#line 319 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2188 "parser.cpp" - break; - - case 21: // stmt: stmt_call -#line 320 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2194 "parser.cpp" - break; - - case 22: // stmt: stmt_assign -#line 321 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2200 "parser.cpp" - break; - - case 23: // stmt: stmt_endon -#line 322 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2206 "parser.cpp" - break; - - case 24: // stmt: stmt_notify -#line 323 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2212 "parser.cpp" - break; - - case 25: // stmt: stmt_wait -#line 324 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2218 "parser.cpp" - break; - - case 26: // stmt: stmt_waittill -#line 325 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2224 "parser.cpp" - break; - - case 27: // stmt: stmt_waittillmatch -#line 326 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2230 "parser.cpp" - break; - - case 28: // stmt: stmt_waittillframeend -#line 327 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2236 "parser.cpp" - break; - - case 29: // stmt: stmt_waitframe -#line 328 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } -#line 2242 "parser.cpp" - break; - - case 30: // stmt: stmt_if -#line 329 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2248 "parser.cpp" - break; - - case 31: // stmt: stmt_ifelse -#line 330 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2254 "parser.cpp" - break; - - case 32: // stmt: stmt_while -#line 331 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2260 "parser.cpp" - break; - - case 33: // stmt: stmt_dowhile -#line 332 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2266 "parser.cpp" - break; - - case 34: // stmt: stmt_for -#line 333 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2272 "parser.cpp" - break; - - case 35: // stmt: stmt_foreach -#line 334 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2278 "parser.cpp" - break; - - case 36: // stmt: stmt_switch -#line 335 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2284 "parser.cpp" - break; - - case 37: // stmt: stmt_case -#line 336 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2290 "parser.cpp" - break; - - case 38: // stmt: stmt_default -#line 337 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2296 "parser.cpp" - break; - - case 39: // stmt: stmt_break -#line 338 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2302 "parser.cpp" - break; - - case 40: // stmt: stmt_continue -#line 339 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2308 "parser.cpp" - break; - - case 41: // stmt: stmt_return -#line 340 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2314 "parser.cpp" - break; - - case 42: // stmt: stmt_breakpoint -#line 341 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } -#line 2320 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_begin -#line 342 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2326 "parser.cpp" - break; - - case 44: // stmt: stmt_prof_end -#line 343 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2332 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt -#line 347 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2338 "parser.cpp" - break; - - case 46: // stmt_or_dev: stmt_dev -#line 348 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2344 "parser.cpp" - break; - - case 47: // stmt_list: stmt_list stmt -#line 353 "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 2350 "parser.cpp" - break; - - case 48: // stmt_list: stmt -#line 355 "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 2356 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 360 "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 2362 "parser.cpp" - break; - - case 50: // stmt_or_dev_list: stmt_or_dev -#line 362 "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 2368 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" stmt_list "#/" -#line 366 "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 2374 "parser.cpp" - break; - - case 52: // stmt_dev: "/#" "#/" -#line 367 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2380 "parser.cpp" - break; - - case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 371 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2386 "parser.cpp" - break; - - case 54: // stmt_block: "{" "}" -#line 372 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2392 "parser.cpp" - break; - - case 55: // stmt_expr: expr_assign -#line 377 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2398 "parser.cpp" - break; - - case 56: // stmt_expr: expr_increment -#line 379 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2404 "parser.cpp" - break; - - case 57: // stmt_expr: expr_decrement -#line 381 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2410 "parser.cpp" - break; - - case 58: // stmt_expr: %empty -#line 383 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2416 "parser.cpp" - break; - - case 59: // stmt_call: expr_call ";" -#line 388 "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 2422 "parser.cpp" - break; - - case 60: // stmt_call: expr_method ";" -#line 390 "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 2428 "parser.cpp" - break; - - case 61: // stmt_assign: expr_assign ";" -#line 395 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2434 "parser.cpp" - break; - - case 62: // stmt_assign: expr_increment ";" -#line 397 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2440 "parser.cpp" - break; - - case 63: // stmt_assign: expr_decrement ";" -#line 399 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2446 "parser.cpp" - break; - - case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 404 "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 2452 "parser.cpp" - break; - - case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 409 "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 2458 "parser.cpp" - break; - - case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 411 "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 2464 "parser.cpp" - break; - - case 67: // stmt_wait: "wait" expr ";" -#line 416 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2470 "parser.cpp" - break; - - case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 421 "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 2476 "parser.cpp" - break; - - case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 423 "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 2482 "parser.cpp" - break; - - case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 428 "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 2488 "parser.cpp" - break; - - case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 430 "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 2494 "parser.cpp" - break; - - case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 435 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2500 "parser.cpp" - break; - - case 73: // stmt_waitframe: "waitframe" ";" -#line 440 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2506 "parser.cpp" - break; - - case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 442 "parser.ypp" - { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } -#line 2512 "parser.cpp" - break; - - case 75: // stmt_if: "if" "(" expr ")" stmt -#line 447 "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 2518 "parser.cpp" - break; - - case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 452 "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 2524 "parser.cpp" - break; - - case 77: // stmt_while: "while" "(" expr ")" stmt -#line 457 "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 2530 "parser.cpp" - break; - - case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 462 "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 2536 "parser.cpp" - break; - - case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 467 "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 2542 "parser.cpp" - break; - - case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 472 "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 2548 "parser.cpp" - break; - - case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 474 "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 2554 "parser.cpp" - break; - - case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 479 "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 2560 "parser.cpp" - break; - - case 83: // stmt_case: "case" expr_integer ":" -#line 484 "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 2566 "parser.cpp" - break; - - case 84: // stmt_case: "case" expr_string ":" -#line 486 "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 2572 "parser.cpp" - break; - - case 85: // stmt_default: "default" ":" -#line 491 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2578 "parser.cpp" - break; - - case 86: // stmt_break: "break" ";" -#line 496 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2584 "parser.cpp" - break; - - case 87: // stmt_continue: "continue" ";" -#line 501 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2590 "parser.cpp" - break; - - case 88: // stmt_return: "return" expr ";" -#line 506 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2596 "parser.cpp" - break; - - case 89: // stmt_return: "return" ";" -#line 508 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2602 "parser.cpp" - break; - - case 90: // stmt_breakpoint: "breakpoint" ";" -#line 513 "parser.ypp" - { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } -#line 2608 "parser.cpp" - break; - - case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 518 "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 2614 "parser.cpp" - break; - - case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 523 "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 2620 "parser.cpp" - break; - - case 93: // expr: expr_ternary -#line 527 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2626 "parser.cpp" - break; - - case 94: // expr: expr_binary -#line 528 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2632 "parser.cpp" - break; - - case 95: // expr: expr_primitive -#line 529 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2638 "parser.cpp" - break; - - case 96: // expr_or_empty: expr -#line 533 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2644 "parser.cpp" - break; - - case 97: // expr_or_empty: %empty -#line 534 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2650 "parser.cpp" - break; - - case 98: // expr_assign: expr_tuple "=" expr -#line 539 "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 2656 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "=" expr -#line 541 "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 2662 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "|=" expr -#line 543 "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 2668 "parser.cpp" - break; - - case 101: // expr_assign: expr_object "&=" expr -#line 545 "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 2674 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "^=" expr -#line 547 "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 2680 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "<<=" expr -#line 549 "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 2686 "parser.cpp" - break; - - case 104: // expr_assign: expr_object ">>=" expr -#line 551 "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 2692 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "+=" expr -#line 553 "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 2698 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "-=" expr -#line 555 "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 2704 "parser.cpp" - break; - - case 107: // expr_assign: expr_object "*=" expr -#line 557 "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 2710 "parser.cpp" - break; - - case 108: // expr_assign: expr_object "/=" expr -#line 559 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2716 "parser.cpp" - break; - - case 109: // expr_assign: expr_object "%=" expr -#line 561 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2722 "parser.cpp" - break; - - case 110: // expr_increment: "++" expr_object -#line 566 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2728 "parser.cpp" - break; - - case 111: // expr_increment: expr_object "++" -#line 568 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2734 "parser.cpp" - break; - - case 112: // expr_decrement: "--" 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 2740 "parser.cpp" - break; - - case 113: // expr_decrement: 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 2746 "parser.cpp" - break; - - case 114: // expr_ternary: expr "?" expr ":" expr -#line 580 "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 2752 "parser.cpp" - break; - - case 115: // expr_binary: expr "||" expr -#line 585 "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 2758 "parser.cpp" - break; - - case 116: // expr_binary: expr "&&" expr -#line 587 "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 2764 "parser.cpp" - break; - - case 117: // expr_binary: expr "==" expr -#line 589 "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 2770 "parser.cpp" - break; - - case 118: // expr_binary: expr "!=" expr -#line 591 "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 2776 "parser.cpp" - break; - - case 119: // expr_binary: expr "<=" expr -#line 593 "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 2782 "parser.cpp" - break; - - case 120: // expr_binary: expr ">=" expr -#line 595 "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 2788 "parser.cpp" - break; - - case 121: // expr_binary: expr "<" expr -#line 597 "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 2794 "parser.cpp" - break; - - case 122: // expr_binary: expr ">" expr -#line 599 "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 2800 "parser.cpp" - break; - - case 123: // expr_binary: expr "|" expr -#line 601 "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 2806 "parser.cpp" - break; - - case 124: // expr_binary: expr "&" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2812 "parser.cpp" - break; - - case 125: // expr_binary: expr "^" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2818 "parser.cpp" - break; - - case 126: // expr_binary: expr "<<" expr -#line 607 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2824 "parser.cpp" - break; - - case 127: // expr_binary: expr ">>" expr -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2830 "parser.cpp" - break; - - case 128: // expr_binary: expr "+" expr -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2836 "parser.cpp" - break; - - case 129: // expr_binary: expr "-" expr -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2842 "parser.cpp" - break; - - case 130: // expr_binary: expr "*" expr -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2848 "parser.cpp" - break; - - case 131: // expr_binary: expr "/" expr -#line 617 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2854 "parser.cpp" - break; - - case 132: // expr_binary: expr "%" expr -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2860 "parser.cpp" - break; - - case 133: // expr_primitive: expr_complement -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 2866 "parser.cpp" - break; - - case 134: // expr_primitive: expr_negate -#line 624 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 2872 "parser.cpp" - break; - - case 135: // expr_primitive: expr_not -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 2878 "parser.cpp" - break; - - case 136: // expr_primitive: expr_call -#line 626 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 2884 "parser.cpp" - break; - - case 137: // expr_primitive: expr_method -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 2890 "parser.cpp" - break; - - case 138: // expr_primitive: expr_add_array -#line 628 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } -#line 2896 "parser.cpp" - break; - - case 139: // expr_primitive: expr_isdefined -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_isdefined::ptr > ()); } -#line 2902 "parser.cpp" - break; - - case 140: // expr_primitive: expr_istrue -#line 630 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istrue::ptr > ()); } -#line 2908 "parser.cpp" - break; - - case 141: // expr_primitive: expr_reference -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 2914 "parser.cpp" - break; - - case 142: // expr_primitive: expr_array -#line 632 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 2920 "parser.cpp" - break; - - case 143: // expr_primitive: expr_field -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 2926 "parser.cpp" - break; - - case 144: // expr_primitive: expr_size -#line 634 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 2932 "parser.cpp" - break; - - case 145: // expr_primitive: expr_paren -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 2938 "parser.cpp" - break; - - case 146: // expr_primitive: expr_thisthread -#line 636 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } -#line 2944 "parser.cpp" - break; - - case 147: // expr_primitive: expr_empty_array -#line 637 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 2950 "parser.cpp" - break; - - case 148: // expr_primitive: expr_undefined -#line 638 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 2956 "parser.cpp" - break; - - case 149: // expr_primitive: expr_game -#line 639 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 2962 "parser.cpp" - break; - - case 150: // expr_primitive: expr_self -#line 640 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 2968 "parser.cpp" - break; - - case 151: // expr_primitive: expr_anim -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 2974 "parser.cpp" - break; - - case 152: // expr_primitive: expr_level -#line 642 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 2980 "parser.cpp" - break; - - case 153: // expr_primitive: expr_animation -#line 643 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 2986 "parser.cpp" - break; - - case 154: // expr_primitive: expr_animtree -#line 644 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 2992 "parser.cpp" - break; - - case 155: // expr_primitive: expr_identifier -#line 645 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 2998 "parser.cpp" - break; - - case 156: // expr_primitive: expr_istring -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 3004 "parser.cpp" - break; - - case 157: // expr_primitive: expr_string -#line 647 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 3010 "parser.cpp" - break; - - case 158: // expr_primitive: expr_vector -#line 648 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 3016 "parser.cpp" - break; - - case 159: // expr_primitive: expr_float -#line 649 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 3022 "parser.cpp" - break; - - case 160: // expr_primitive: expr_integer -#line 650 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 3028 "parser.cpp" - break; - - case 161: // expr_primitive: expr_false -#line 651 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 3034 "parser.cpp" - break; - - case 162: // expr_primitive: expr_true -#line 652 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 3040 "parser.cpp" - break; - - case 163: // expr_complement: "~" expr -#line 657 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3046 "parser.cpp" - break; - - case 164: // expr_negate: "-" expr_identifier -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 3052 "parser.cpp" - break; - - case 165: // expr_negate: "-" expr_paren -#line 664 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 3058 "parser.cpp" - break; - - case 166: // expr_negate: "-" expr_array -#line 666 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 3064 "parser.cpp" - break; - - case 167: // expr_negate: "-" expr_field -#line 668 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 3070 "parser.cpp" - break; - - case 168: // expr_not: "!" expr -#line 673 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3076 "parser.cpp" - break; - - case 169: // expr_call: expr_function -#line 677 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3082 "parser.cpp" - break; - - case 170: // expr_call: expr_pointer -#line 678 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3088 "parser.cpp" - break; - - case 171: // expr_method: expr_object expr_function -#line 681 "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 3094 "parser.cpp" - break; - - case 172: // expr_method: expr_object expr_pointer -#line 682 "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 3100 "parser.cpp" - break; - - case 173: // expr_function: expr_identifier "(" expr_arguments ")" -#line 687 "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 3106 "parser.cpp" - break; - - case 174: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 689 "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 3112 "parser.cpp" - break; - - case 175: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 691 "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 3118 "parser.cpp" - break; - - case 176: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 693 "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 3124 "parser.cpp" - break; - - case 177: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 695 "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::childthread); } -#line 3130 "parser.cpp" - break; - - case 178: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 697 "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::childthread); } -#line 3136 "parser.cpp" - break; - - case 179: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 702 "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 3142 "parser.cpp" - break; - - case 180: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 704 "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 3148 "parser.cpp" - break; - - case 181: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 706 "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::childthread); } -#line 3154 "parser.cpp" - break; - - case 182: // expr_pointer: "call" "[" "[" 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::builtin); } -#line 3160 "parser.cpp" - break; - - case 183: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 713 "parser.ypp" - { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } -#line 3166 "parser.cpp" - break; - - case 184: // expr_parameters: expr_parameters "," expr_identifier -#line 718 "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 3172 "parser.cpp" - break; - - case 185: // expr_parameters: expr_identifier -#line 720 "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 3178 "parser.cpp" - break; - - case 186: // expr_parameters: %empty -#line 722 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3184 "parser.cpp" - break; - - case 187: // expr_arguments: expr_arguments_no_empty -#line 727 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3190 "parser.cpp" - break; - - case 188: // expr_arguments: %empty -#line 729 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3196 "parser.cpp" - break; - - case 189: // expr_arguments_no_empty: expr_arguments "," expr -#line 734 "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 3202 "parser.cpp" - break; - - case 190: // expr_arguments_no_empty: expr -#line 736 "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 3208 "parser.cpp" - break; - - case 191: // expr_isdefined: "isdefined" "(" expr ")" -#line 741 "parser.ypp" - { yylhs.value.as < ast::expr_isdefined::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3214 "parser.cpp" - break; - - case 192: // expr_istrue: "istrue" "(" expr ")" -#line 746 "parser.ypp" - { yylhs.value.as < ast::expr_istrue::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3220 "parser.cpp" - break; - - case 193: // expr_reference: "::" expr_identifier -#line 751 "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 3226 "parser.cpp" - break; - - case 194: // expr_reference: expr_path "::" expr_identifier -#line 753 "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 3232 "parser.cpp" - break; - - case 195: // expr_tuple: "[" expr_tuple_arguments "]" -#line 758 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[1].value.as < ast::expr_tuple::ptr > ()); } -#line 3238 "parser.cpp" - break; - - case 196: // expr_tuple_arguments: expr_tuple_arguments "," expr_tuple_types -#line 763 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::move(yystack_[2].value.as < ast::expr_tuple::ptr > ()); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3244 "parser.cpp" - break; - - case 197: // expr_tuple_arguments: expr_tuple_types -#line 765 "parser.ypp" - { yylhs.value.as < ast::expr_tuple::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_tuple::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3250 "parser.cpp" - break; - - case 198: // expr_tuple_types: expr_array -#line 769 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3256 "parser.cpp" - break; - - case 199: // expr_tuple_types: expr_field -#line 770 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3262 "parser.cpp" - break; - - case 200: // expr_tuple_types: expr_identifier -#line 771 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3268 "parser.cpp" - break; - - case 201: // expr_array: expr_object "[" expr "]" -#line 776 "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 3274 "parser.cpp" - break; - - case 202: // expr_field: expr_object "." expr_identifier_nosize -#line 781 "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 3280 "parser.cpp" - break; - - case 203: // expr_size: expr_object "." "size" -#line 786 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3286 "parser.cpp" - break; - - case 204: // expr_paren: "(" expr ")" -#line 791 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3292 "parser.cpp" - break; - - case 205: // expr_object: expr_call -#line 795 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3298 "parser.cpp" - break; - - case 206: // expr_object: expr_method -#line 796 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3304 "parser.cpp" - break; - - case 207: // expr_object: expr_array -#line 797 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3310 "parser.cpp" - break; - - case 208: // expr_object: expr_field -#line 798 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3316 "parser.cpp" - break; - - case 209: // expr_object: expr_game -#line 799 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3322 "parser.cpp" - break; - - case 210: // expr_object: expr_self -#line 800 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3328 "parser.cpp" - break; - - case 211: // expr_object: expr_anim -#line 801 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3334 "parser.cpp" - break; - - case 212: // expr_object: expr_level -#line 802 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3340 "parser.cpp" - break; - - case 213: // expr_object: expr_identifier -#line 803 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3346 "parser.cpp" - break; - - case 214: // expr_thisthread: "thisthread" -#line 808 "parser.ypp" - { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } -#line 3352 "parser.cpp" - break; - - case 215: // expr_empty_array: "[" "]" -#line 813 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3358 "parser.cpp" - break; - - case 216: // expr_undefined: "undefined" -#line 818 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3364 "parser.cpp" - break; - - case 217: // expr_game: "game" -#line 823 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3370 "parser.cpp" - break; - - case 218: // expr_self: "self" -#line 828 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3376 "parser.cpp" - break; - - case 219: // expr_anim: "anim" -#line 833 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3382 "parser.cpp" - break; - - case 220: // expr_level: "level" -#line 838 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3388 "parser.cpp" - break; - - case 221: // expr_animation: "%" "identifier" -#line 843 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3394 "parser.cpp" - break; - - case 222: // expr_animtree: "#animtree" -#line 848 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3400 "parser.cpp" - break; - - case 223: // expr_identifier_nosize: "identifier" -#line 853 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3406 "parser.cpp" - break; - - case 224: // expr_identifier: "identifier" -#line 858 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3412 "parser.cpp" - break; - - case 225: // expr_identifier: "size" -#line 860 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3418 "parser.cpp" - break; - - case 226: // expr_path: "identifier" -#line 865 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3424 "parser.cpp" - break; - - case 227: // expr_path: "path" -#line 867 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3430 "parser.cpp" - break; - - case 228: // expr_istring: "localized string" -#line 872 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3436 "parser.cpp" - break; - - case 229: // expr_string: "string literal" -#line 877 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3442 "parser.cpp" - break; - - case 230: // expr_vector: "(" expr "," expr "," expr ")" -#line 882 "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 3448 "parser.cpp" - break; - - case 231: // expr_float: "-" "float" -#line 887 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3454 "parser.cpp" - break; - - case 232: // expr_float: "float" -#line 889 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3460 "parser.cpp" - break; - - case 233: // expr_integer: "-" "integer" -#line 894 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3466 "parser.cpp" - break; - - case 234: // expr_integer: "integer" -#line 896 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3472 "parser.cpp" - break; - - case 235: // expr_false: "false" -#line 901 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3478 "parser.cpp" - break; - - case 236: // expr_true: "true" -#line 906 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3484 "parser.cpp" - break; - - -#line 3488 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "endon", "notify", "wait", - "waittill", "waittillmatch", "waittillframeend", "waitframe", "if", - "else", "do", "while", "for", "foreach", "in", "switch", "case", - "default", "break", "continue", "return", "breakpoint", "prof_begin", - "prof_end", "thread", "childthread", "thisthread", "call", "true", - "false", "undefined", "size", "game", "self", "anim", "level", - "isdefined", "istrue", "(", ")", "{", "}", "[", "]", ",", ".", "::", ":", - ";", "?", "++", "--", "<<", ">>", "||", "&&", "==", "!=", "<=", ">=", - "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", "%=", "|=", "&=", "^=", - ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", "%", "path", - "identifier", "string literal", "localized string", "float", "integer", - "SIZEOF", "ADD_ARRAY", "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_waitframe", - "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_negate", "expr_not", - "expr_call", "expr_method", "expr_function", "expr_pointer", - "expr_add_array", "expr_parameters", "expr_arguments", - "expr_arguments_no_empty", "expr_isdefined", "expr_istrue", - "expr_reference", "expr_tuple", "expr_tuple_arguments", - "expr_tuple_types", "expr_array", "expr_field", "expr_size", - "expr_paren", "expr_object", "expr_thisthread", "expr_empty_array", - "expr_undefined", "expr_game", "expr_self", "expr_anim", "expr_level", - "expr_animation", "expr_animtree", "expr_identifier_nosize", - "expr_identifier", "expr_path", "expr_istring", "expr_string", - "expr_vector", "expr_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 S4DEBUG - // 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 S4DEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if S4DEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -296; - - const short parser::yytable_ninf_ = -227; - - const short - parser::yypact_[] = - { - 2, -296, -296, -24, -24, -29, -296, -296, 27, 2, - -296, -296, -296, -296, -296, -296, -35, -296, -296, -30, - -7, -49, -296, -296, -296, -296, -41, 1265, -296, -296, - -296, 45, -31, -296, -296, -27, -19, -296, 66, -296, - -296, -296, -296, -296, -296, -296, 72, 74, 1265, 1135, - -41, 1265, 1265, 817, 37, 73, -296, -296, -296, 2289, - -296, -296, -296, -296, -296, -296, 119, 430, -296, -296, - -296, -296, -296, -296, 604, 647, -296, -296, 750, -296, - -296, -296, 904, 981, 1060, 1161, -296, -296, -3, 84, - -296, -296, -296, -296, -296, -296, -296, 89, 102, -41, - 109, 115, 114, 120, 125, 122, 134, 1265, 1265, 1513, - 1135, -296, 2372, 135, 146, -296, -296, -296, 1265, 136, - -296, -296, -296, -296, 604, 647, -296, 1225, -296, -296, - -296, -296, -3, 144, -296, -296, 1265, 1265, 1265, 1265, - 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, - 1265, 1265, 1265, 1265, 1265, 1330, -26, -296, -296, 153, - 1265, -41, -296, 82, -296, -296, 1265, 1265, -41, 1265, - 1265, -41, 1265, 1679, 1713, -296, 1265, 1261, 1265, -296, - 1747, 1265, 112, -41, 2254, 91, 91, 2403, 2413, 758, - 758, 176, 176, 176, 176, 2444, 680, 543, 46, 46, - -296, -296, -296, 2059, -296, -296, -296, -14, -296, 159, - 1028, 1265, 152, -32, 166, 1456, 167, 172, 178, 179, - -39, 177, 171, 175, 1200, 191, 188, 189, -296, 150, - 382, 382, -296, -296, 949, -296, -296, -296, -296, -296, - -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, - -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, - -296, 192, 193, 194, 196, 198, 185, -296, -296, 1377, - 153, 2099, 22, 212, 2139, 24, 213, 2179, -296, -296, - 2218, 209, 2372, 1261, 159, 1265, -296, -296, 1265, -296, - -296, 1107, 2324, -296, 220, -296, 1265, 250, 1265, 833, - -41, 1265, 174, 216, 218, -296, -296, -296, -296, 2359, - -296, 1265, 1265, 1330, 8, -296, 105, 113, 10, 1225, - 1225, -296, -296, -296, -296, -296, -296, -296, 1265, 229, - 232, 233, 234, -296, -296, 1265, 1265, 1265, 1265, 1265, - 1265, 1265, 1265, 1265, 1265, 1265, 230, -296, 1265, 231, - -296, 1265, 235, 1265, 238, 2372, 28, -296, -296, -296, - 239, 1781, 242, 1815, 241, -296, -296, -296, 1477, -12, - 1849, -296, -296, -296, 31, 32, -296, 382, 2372, 1265, - 1265, 1265, 1265, 2372, 2372, 2372, 2372, 2372, 2372, 2372, - 2372, 2372, 2372, 2372, 243, 34, 255, 35, 259, 1883, - 1265, -296, -296, 1456, 1265, 1456, 1265, 1265, -41, 102, - 251, 253, -296, 1917, 1557, 1601, 1645, 1265, -296, 1265, - -296, 1265, -296, 43, 289, 1951, -296, 2372, 257, 1985, - 292, -296, -296, -296, 264, 265, 1265, 269, 1265, 270, - 1265, 52, 81, 90, -296, 1456, 293, 833, 1456, 1265, - -296, -296, 268, -296, 301, -296, 303, -296, -296, -296, - -296, -296, 304, -296, 2019, 296, 297, 298, 1456, 1456, - -296, -296, -296, -296, -296 - }; - - const unsigned char - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 225, 224, 0, 2, - 7, 8, 9, 14, 15, 16, 0, 227, 226, 0, - 0, 0, 1, 4, 5, 6, 186, 0, 10, 11, - 229, 0, 0, 185, 222, 0, 0, 214, 0, 236, - 235, 216, 217, 218, 219, 220, 0, 0, 0, 188, - 0, 0, 0, 0, 0, 224, 228, 232, 234, 0, - 93, 94, 95, 133, 134, 135, 136, 137, 169, 170, - 138, 139, 140, 141, 142, 143, 144, 145, 0, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 0, - 156, 157, 158, 159, 160, 161, 162, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 188, 215, 190, 0, 187, 193, 168, 163, 0, 0, - 231, 233, 205, 206, 166, 167, 165, 0, 209, 210, - 211, 212, 164, 0, 221, 18, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 171, 172, 0, - 188, 0, 17, 0, 19, 184, 0, 188, 0, 0, - 188, 0, 0, 0, 0, 204, 0, 190, 0, 183, - 0, 0, 0, 0, 0, 126, 127, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 128, 129, - 130, 131, 132, 0, 203, 223, 202, 0, 187, 194, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, - 0, 0, 45, 50, 0, 46, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 0, 0, 0, 205, 206, 0, 207, 208, 0, - 213, 0, 0, 0, 0, 0, 0, 0, 191, 192, - 0, 0, 189, 0, 0, 0, 201, 173, 188, 52, - 48, 0, 0, 72, 0, 73, 0, 0, 0, 58, - 0, 0, 0, 0, 0, 85, 86, 87, 89, 0, - 90, 188, 188, 0, 0, 197, 207, 208, 213, 110, - 112, 53, 49, 61, 62, 63, 59, 60, 0, 0, - 0, 0, 0, 111, 113, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 175, 188, 0, - 177, 188, 0, 0, 0, 114, 0, 51, 47, 67, - 0, 0, 0, 0, 0, 55, 56, 57, 0, 0, - 0, 84, 83, 88, 0, 0, 195, 0, 98, 0, - 0, 0, 0, 99, 105, 106, 107, 108, 109, 100, - 101, 102, 104, 103, 0, 0, 0, 0, 0, 0, - 188, 174, 74, 0, 0, 0, 97, 0, 0, 0, - 0, 0, 196, 0, 0, 0, 0, 188, 176, 188, - 178, 188, 230, 0, 75, 0, 77, 96, 0, 0, - 0, 82, 91, 92, 0, 0, 188, 0, 188, 0, - 188, 0, 0, 0, 179, 0, 0, 58, 0, 0, - 64, 66, 187, 69, 187, 71, 187, 180, 181, 182, - 76, 78, 0, 80, 0, 0, 0, 0, 0, 0, - 65, 68, 70, 79, 81 - }; - - const short - parser::yypgoto_[] = - { - -296, -296, -296, 354, 355, 356, -296, -296, -296, -144, - 133, -296, -296, -296, -97, -77, -296, -296, -296, -296, - -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, - -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, - 200, -296, -295, -292, -291, -296, -296, -296, -296, -296, - -296, -6, 101, -73, -66, -296, -296, -137, -47, -296, - -296, -296, -296, -296, -4, 337, 362, -296, 321, 368, - -296, -296, -296, 393, 442, 467, 501, -296, -296, -296, - 0, 7, -296, -18, -296, -296, 160, -296, -296 - }; - - const short - parser::yydefgoto_[] = - { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 232, - 233, 291, 234, 235, 236, 364, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 112, 428, 261, 262, 263, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 32, 113, 208, 71, - 72, 73, 266, 314, 315, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 206, - 88, 89, 90, 91, 92, 93, 94, 95, 96 - }; - - const short - parser::yytable_[] = - { - 16, 164, 114, 31, 365, 157, 6, 366, 367, 16, - 19, 20, 158, 1, 2, 3, 4, 5, 407, 26, - 6, 204, 294, 207, 98, 21, 33, 22, 6, 99, - 272, 100, 295, 275, 28, 101, 104, -213, -213, 103, - -213, 287, 102, 105, -213, 27, 178, 122, 408, 6, - 115, 160, 30, 132, 157, -213, 302, 29, -213, 7, - 133, 158, 30, 114, 160, 58, 290, 376, 377, -200, - -200, 297, 17, 55, 205, 17, 18, 347, 159, 350, - 17, 55, 178, 401, 178, 133, 410, 411, 178, 418, - 420, 178, 178, 210, 178, 178, -213, -213, 444, 165, - 97, 211, 7, 178, 212, 213, 214, 457, 215, 216, - 217, 218, 178, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 35, 36, 106, 38, 107, 159, 108, 6, - 42, 43, 44, 45, 133, -226, 458, 134, 163, 228, - 229, 178, 152, 153, 154, 459, 161, 358, 230, 231, - 178, 356, 365, 162, 123, 366, 367, 264, 163, -205, - -205, 209, -205, 270, -198, -198, -205, 166, 273, 167, - 133, 276, -199, -199, 374, 375, 168, -205, 169, 170, - -205, 17, 55, 284, 171, 150, 151, 152, 153, 154, - 35, 36, 172, 38, 181, 178, 157, 6, 42, 43, - 44, 45, 303, 158, 264, 179, 183, 160, 313, 264, - 270, 395, 205, 288, 397, 270, 293, 133, -205, -205, - 296, 298, 133, 122, 122, 122, 299, 59, 264, 318, - 270, 270, 300, 301, 270, 306, 133, 133, 133, 307, - 305, 133, 311, 312, 137, 138, 157, 157, 109, 17, - 55, 116, 117, 158, 158, 310, 323, 324, 325, 424, - 326, 426, 327, 423, 265, 328, 348, 351, 354, 159, - 150, 151, 152, 153, 154, 360, 133, 362, 121, 371, - 441, 372, 442, 379, 443, 264, 380, 381, 382, 394, - 396, 270, 400, 122, 398, 157, 404, 417, 133, 270, - 369, 460, 158, 402, 463, 406, 133, 173, 174, 419, - 177, 265, 431, 421, 445, 432, 265, 433, 180, 159, - 159, 447, 449, 465, 473, 474, 133, 133, 450, 451, - 123, 123, 123, 453, 455, 265, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 466, 461, 467, 468, - 470, 471, 472, 23, 24, 25, 271, 322, 159, 274, - 462, 122, 277, 412, 126, 133, 280, 318, 282, 0, - 304, 283, 0, 0, 133, 0, 0, 0, 0, 452, - 124, 454, 265, 456, 0, 0, 0, 264, 0, 264, - 123, 0, 0, 270, 0, 270, 0, 0, 430, 0, - 133, 292, 133, 0, 0, 125, 0, 0, 0, 0, - 0, 127, 35, 36, 309, 38, 0, 0, 0, 6, - 42, 43, 44, 45, 0, 0, 0, 0, 0, 264, - 119, 122, 264, 0, 0, 270, 128, 270, 270, 0, - 0, 0, 133, 0, 133, 133, 0, 0, 0, 0, - 0, 0, 264, 264, 0, 0, 0, 0, 270, 270, - -206, -206, 0, -206, 0, 133, 133, -206, 123, 0, - 0, 17, 55, 0, 0, 355, 0, 0, -206, 0, - 0, -206, 0, 0, 0, 129, 361, 0, 363, 0, - 267, 370, 0, 0, 265, 0, 265, 0, 0, 0, - 0, 0, 0, 283, 0, 0, 0, 0, 0, 0, - 130, 0, 0, 0, 0, 268, 0, 0, 378, -206, - -206, 269, 0, 0, 0, 383, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 265, 267, 123, 265, - 0, 0, 267, 399, 131, 0, 128, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 316, 267, 267, 265, - 265, 267, 268, 0, 0, 0, 0, 268, 269, 413, - 414, 415, 416, 269, 0, 0, 0, 0, 0, 0, - 0, 317, 268, 268, 0, 0, 268, 127, 319, 320, - 0, 0, 269, 128, 425, 129, 427, 429, 128, 0, - 0, 137, 138, 0, 0, 141, 142, 143, 144, 145, - 146, 0, 128, 128, 128, 0, 0, 128, 267, 0, - 130, 0, 0, 0, 0, 148, 267, 150, 151, 152, - 153, 154, 0, 0, -207, -207, 0, -207, 0, 464, - 0, -207, 129, 268, 0, 0, 0, 129, 0, 269, - 0, 268, -207, 0, 131, -207, 0, 368, 0, 0, - 0, 129, 129, 129, 0, 0, 129, 130, 0, 0, - 0, 0, 130, 0, 128, 0, 0, -208, -208, 0, - -208, 0, 128, 0, -208, 0, 130, 130, 130, 0, - 0, 130, 0, -207, -207, -208, 0, 0, -208, 0, - 0, 131, 0, 0, 316, 0, 131, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 131, 131, 131, 129, 0, 131, 0, 0, 0, 317, - 267, 129, 267, 0, 0, 127, -208, -208, 137, 138, - 0, 0, 141, 142, 143, 144, 145, 146, 130, 0, - 0, 0, 0, 0, 0, 268, 130, 268, 0, 0, - 128, 269, 0, 269, 150, 151, 152, 153, 154, 0, - 0, 0, 267, 0, 267, 267, 0, 0, 0, 0, - 35, 36, 131, 38, 0, 0, 128, 6, 128, 0, - 131, 0, 0, 0, 0, 267, 267, 268, 155, 268, - 268, 156, 0, 269, 0, 368, 269, 0, 0, 129, - 0, 0, 0, 0, 0, 0, 137, 138, 0, 0, - 268, 268, 143, 144, 145, 146, 269, 269, 128, 0, - 128, 128, 0, 0, 130, 129, 0, 129, 0, 17, - 55, 0, 150, 151, 152, 153, 154, 35, 36, 0, - 38, 128, 128, 0, 6, 42, 43, 44, 45, 0, - 130, 118, 130, 35, 36, 119, 38, 0, 131, 0, - 6, 42, 43, 44, 45, 0, 0, 129, 0, 129, - 129, 229, 0, 0, 0, 0, 0, 0, 0, 230, - 231, 0, 0, 0, 131, 0, 131, 0, 0, 0, - 129, 129, 130, 0, 130, 130, 17, 55, 0, 0, - 120, 121, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 55, 0, 130, 130, 0, 0, 0, - 0, 0, 0, 0, -209, -209, 131, -209, 131, 131, - 0, -209, 0, 0, 0, 0, 0, 0, 0, 0, - 210, 0, -209, 0, 0, -209, 0, 0, 211, 131, - 131, 212, 213, 214, 0, 215, 216, 217, 218, 0, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 35, - 36, 0, 38, 0, 0, 0, 6, 42, 43, 44, - 45, 0, 0, -209, -209, 163, 321, 229, 0, 0, - 0, 0, 0, 0, 0, 230, 231, 0, 0, 0, - 0, -210, -210, 0, -210, 0, 0, 0, -210, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -210, - 289, 0, -210, 0, 0, 0, 0, 211, 17, 55, - 212, 213, 214, 0, 215, 216, 217, 218, 0, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 35, 36, - 0, 38, 0, 0, 0, 6, 42, 43, 44, 45, - -210, -210, 0, 0, 163, 0, 229, 0, 0, 0, - 0, 0, 0, 0, 230, 231, 0, 0, 0, 0, - -211, -211, 0, -211, 0, 0, 0, -211, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -211, 357, - 0, -211, 0, 0, 0, 0, 211, 17, 55, 212, - 213, 214, 0, 215, 216, 217, 218, 0, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 35, 36, 0, - 38, 34, 0, 0, 6, 42, 43, 44, 45, -211, - -211, 0, 0, 163, 0, 229, 0, 0, 0, 0, - 0, 0, 0, 230, 231, 35, 36, 37, 38, 39, - 40, 41, 6, 42, 43, 44, 45, 46, 47, 48, - 0, 0, 0, 110, 111, 0, 0, 50, 0, 0, - 0, -212, -212, 0, -212, 0, 17, 55, -212, 0, - 0, 0, 0, 51, 52, 0, 34, 0, 0, -212, - 0, 0, -212, 0, 0, 0, 0, 0, 0, 0, - 53, 0, 0, 54, 17, 55, 30, 56, 57, 58, - 35, 36, 37, 38, 39, 40, 41, 6, 42, 43, - 44, 45, 46, 47, 48, 0, 0, 0, 49, 0, - -212, -212, 50, 0, 308, 35, 36, 0, 38, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 51, 52, - 0, 34, 0, 155, 0, 0, 182, 0, 0, 0, - 0, 0, 0, 0, 0, 53, 0, 0, 54, 17, - 55, 30, 56, 57, 58, 35, 36, 37, 38, 39, - 40, 41, 6, 42, 43, 44, 45, 46, 47, 48, - 281, 0, 0, 49, 17, 55, 136, 50, 0, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, - 0, 0, 0, 51, 52, 0, 34, 0, 0, 0, - 0, 0, 147, 148, 149, 150, 151, 152, 153, 154, - 53, 0, 0, 54, 17, 55, 30, 56, 57, 58, - 35, 36, 37, 38, 39, 40, 41, 6, 42, 43, - 44, 45, 46, 47, 48, 0, 0, 0, 110, 0, - 0, 0, 50, 0, 329, 330, 0, 331, 332, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 51, 52, - 0, 0, 0, 0, 0, 0, 0, 35, 36, 0, - 38, 0, 0, 0, 6, 53, 0, 0, 54, 17, - 55, 30, 56, 57, 58, 155, 0, 0, 182, 0, - 0, 0, 0, 333, 334, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 0, 0, - 0, 0, 0, 0, 0, 211, 17, 55, 212, 213, - 214, 0, 215, 216, 217, 218, 0, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 35, 36, 0, 38, - 0, 0, 0, 6, 42, 43, 44, 45, 0, 0, - 0, 0, 163, 0, 229, 0, 0, 35, 36, 0, - 38, 0, 230, 231, 6, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 155, 0, 0, 182, 0, - 0, 0, 0, 333, 334, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 17, 55, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 175, 0, - 0, 0, 0, 176, 0, 0, 17, 55, 136, 0, - 0, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 147, 148, 149, 150, 151, 152, - 153, 154, 435, 0, 0, 0, 0, 436, 0, 0, - 0, 0, 136, 0, 0, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 147, 148, - 149, 150, 151, 152, 153, 154, 437, 0, 0, 0, - 0, 438, 0, 0, 0, 0, 136, 0, 0, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 147, 148, 149, 150, 151, 152, 153, 154, - 439, 0, 0, 0, 0, 440, 0, 0, 0, 0, - 136, 0, 0, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 278, 0, 147, 148, 149, 150, - 151, 152, 153, 154, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 279, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 136, 0, - 0, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 175, 0, 147, 148, 149, 150, 151, 152, - 153, 154, 136, 0, 0, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 403, 0, 147, 148, - 149, 150, 151, 152, 153, 154, 136, 0, 0, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 405, 0, 147, 148, 149, 150, 151, 152, 153, 154, - 136, 0, 0, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 409, 0, 147, 148, 149, 150, - 151, 152, 153, 154, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 422, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 136, 0, - 0, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 434, 0, 147, 148, 149, 150, 151, 152, - 153, 154, 136, 0, 0, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 446, 0, 147, 148, - 149, 150, 151, 152, 153, 154, 136, 0, 0, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 448, 0, 147, 148, 149, 150, 151, 152, 153, 154, - 136, 0, 0, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 469, 0, 147, 148, 149, 150, - 151, 152, 153, 154, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 286, 0, - 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 346, 0, - 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 349, 0, - 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 352, 0, - 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 353, 0, - 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 147, - 148, 149, 150, 151, 152, 153, 154, 285, 0, 136, - 0, 0, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 147, 148, 149, 150, 151, - 152, 153, 154, 135, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 147, 148, 149, 150, 151, 152, 153, 154, 359, 136, - 0, 0, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 147, 148, 149, 150, 151, - 152, 153, 154, 373, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 136, 0, 0, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 0, 0, - 0, 0, 0, 147, 148, 149, 150, 151, 152, 153, - 154, 137, 138, 0, 140, 141, 142, 143, 144, 145, - 146, 137, 138, 0, 0, 141, 142, 143, 144, 145, - 146, 0, 0, 0, 147, 148, 149, 150, 151, 152, - 153, 154, 0, 0, 147, 148, 149, 150, 151, 152, - 153, 154, 137, 138, 0, 0, 141, 142, 143, 144, - 145, 146, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 148, 149, 150, 151, - 152, 153, 154 - }; - - const short - parser::yycheck_[] = - { - 0, 98, 49, 21, 299, 78, 47, 299, 299, 9, - 3, 4, 78, 11, 12, 13, 14, 15, 30, 54, - 47, 47, 54, 160, 55, 54, 26, 0, 47, 60, - 167, 58, 64, 170, 64, 35, 36, 40, 41, 58, - 43, 55, 35, 36, 47, 80, 60, 53, 60, 47, - 50, 54, 101, 53, 127, 58, 95, 64, 61, 100, - 53, 127, 101, 110, 54, 104, 210, 59, 60, 59, - 60, 215, 99, 100, 100, 99, 100, 55, 78, 55, - 99, 100, 60, 55, 60, 78, 55, 55, 60, 55, - 55, 60, 60, 11, 60, 60, 99, 100, 55, 99, - 55, 19, 100, 60, 22, 23, 24, 55, 26, 27, - 28, 29, 60, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 58, 43, 54, 127, 54, 47, - 48, 49, 50, 51, 127, 62, 55, 100, 56, 57, - 58, 60, 96, 97, 98, 55, 62, 291, 66, 67, - 60, 288, 447, 64, 53, 447, 447, 163, 56, 40, - 41, 161, 43, 163, 59, 60, 47, 58, 168, 54, - 163, 171, 59, 60, 311, 312, 62, 58, 58, 54, - 61, 99, 100, 183, 62, 94, 95, 96, 97, 98, - 40, 41, 58, 43, 58, 60, 269, 47, 48, 49, - 50, 51, 220, 269, 210, 59, 62, 54, 58, 215, - 210, 348, 100, 54, 351, 215, 64, 210, 99, 100, - 54, 54, 215, 229, 230, 231, 54, 27, 234, 229, - 230, 231, 54, 54, 234, 64, 229, 230, 231, 64, - 63, 234, 54, 54, 68, 69, 319, 320, 48, 99, - 100, 51, 52, 319, 320, 64, 64, 64, 64, 403, - 64, 405, 64, 400, 163, 80, 54, 54, 59, 269, - 94, 95, 96, 97, 98, 55, 269, 27, 104, 63, - 417, 63, 419, 54, 421, 291, 54, 54, 54, 59, - 59, 291, 54, 299, 59, 368, 54, 54, 291, 299, - 300, 445, 368, 64, 448, 64, 299, 107, 108, 54, - 110, 210, 409, 54, 25, 64, 215, 64, 118, 319, - 320, 64, 30, 55, 468, 469, 319, 320, 64, 64, - 229, 230, 231, 64, 64, 234, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 55, 64, 55, 55, - 64, 64, 64, 9, 9, 9, 166, 234, 368, 169, - 447, 377, 172, 377, 53, 368, 176, 377, 178, -1, - 220, 181, -1, -1, 377, -1, -1, -1, -1, 436, - 53, 438, 291, 440, -1, -1, -1, 403, -1, 405, - 299, -1, -1, 403, -1, 405, -1, -1, 408, -1, - 403, 211, 405, -1, -1, 53, -1, -1, -1, -1, - -1, 53, 40, 41, 224, 43, -1, -1, -1, 47, - 48, 49, 50, 51, -1, -1, -1, -1, -1, 445, - 58, 447, 448, -1, -1, 445, 53, 447, 448, -1, - -1, -1, 445, -1, 447, 448, -1, -1, -1, -1, - -1, -1, 468, 469, -1, -1, -1, -1, 468, 469, - 40, 41, -1, 43, -1, 468, 469, 47, 377, -1, - -1, 99, 100, -1, -1, 285, -1, -1, 58, -1, - -1, 61, -1, -1, -1, 53, 296, -1, 298, -1, - 163, 301, -1, -1, 403, -1, 405, -1, -1, -1, - -1, -1, -1, 313, -1, -1, -1, -1, -1, -1, - 53, -1, -1, -1, -1, 163, -1, -1, 328, 99, - 100, 163, -1, -1, -1, 335, 336, 337, 338, 339, - 340, 341, 342, 343, 344, 345, 445, 210, 447, 448, - -1, -1, 215, 353, 53, -1, 163, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 229, 230, 231, 468, - 469, 234, 210, -1, -1, -1, -1, 215, 210, 379, - 380, 381, 382, 215, -1, -1, -1, -1, -1, -1, - -1, 229, 230, 231, -1, -1, 234, 229, 230, 231, - -1, -1, 234, 210, 404, 163, 406, 407, 215, -1, - -1, 68, 69, -1, -1, 72, 73, 74, 75, 76, - 77, -1, 229, 230, 231, -1, -1, 234, 291, -1, - 163, -1, -1, -1, -1, 92, 299, 94, 95, 96, - 97, 98, -1, -1, 40, 41, -1, 43, -1, 449, - -1, 47, 210, 291, -1, -1, -1, 215, -1, 291, - -1, 299, 58, -1, 163, 61, -1, 299, -1, -1, - -1, 229, 230, 231, -1, -1, 234, 210, -1, -1, - -1, -1, 215, -1, 291, -1, -1, 40, 41, -1, - 43, -1, 299, -1, 47, -1, 229, 230, 231, -1, - -1, 234, -1, 99, 100, 58, -1, -1, 61, -1, - -1, 210, -1, -1, 377, -1, 215, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 229, 230, 231, 291, -1, 234, -1, -1, -1, 377, - 403, 299, 405, -1, -1, 377, 99, 100, 68, 69, - -1, -1, 72, 73, 74, 75, 76, 77, 291, -1, - -1, -1, -1, -1, -1, 403, 299, 405, -1, -1, - 377, 403, -1, 405, 94, 95, 96, 97, 98, -1, - -1, -1, 445, -1, 447, 448, -1, -1, -1, -1, - 40, 41, 291, 43, -1, -1, 403, 47, 405, -1, - 299, -1, -1, -1, -1, 468, 469, 445, 58, 447, - 448, 61, -1, 445, -1, 447, 448, -1, -1, 377, - -1, -1, -1, -1, -1, -1, 68, 69, -1, -1, - 468, 469, 74, 75, 76, 77, 468, 469, 445, -1, - 447, 448, -1, -1, 377, 403, -1, 405, -1, 99, - 100, -1, 94, 95, 96, 97, 98, 40, 41, -1, - 43, 468, 469, -1, 47, 48, 49, 50, 51, -1, - 403, 54, 405, 40, 41, 58, 43, -1, 377, -1, - 47, 48, 49, 50, 51, -1, -1, 445, -1, 447, - 448, 58, -1, -1, -1, -1, -1, -1, -1, 66, - 67, -1, -1, -1, 403, -1, 405, -1, -1, -1, - 468, 469, 445, -1, 447, 448, 99, 100, -1, -1, - 103, 104, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 99, 100, -1, 468, 469, -1, -1, -1, - -1, -1, -1, -1, 40, 41, 445, 43, 447, 448, - -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, - 11, -1, 58, -1, -1, 61, -1, -1, 19, 468, - 469, 22, 23, 24, -1, 26, 27, 28, 29, -1, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, -1, 43, -1, -1, -1, 47, 48, 49, 50, - 51, -1, -1, 99, 100, 56, 57, 58, -1, -1, - -1, -1, -1, -1, -1, 66, 67, -1, -1, -1, - -1, 40, 41, -1, 43, -1, -1, -1, 47, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, - 12, -1, 61, -1, -1, -1, -1, 19, 99, 100, - 22, 23, 24, -1, 26, 27, 28, 29, -1, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - -1, 43, -1, -1, -1, 47, 48, 49, 50, 51, - 99, 100, -1, -1, 56, -1, 58, -1, -1, -1, - -1, -1, -1, -1, 66, 67, -1, -1, -1, -1, - 40, 41, -1, 43, -1, -1, -1, 47, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 58, 12, - -1, 61, -1, -1, -1, -1, 19, 99, 100, 22, - 23, 24, -1, 26, 27, 28, 29, -1, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, -1, - 43, 16, -1, -1, 47, 48, 49, 50, 51, 99, - 100, -1, -1, 56, -1, 58, -1, -1, -1, -1, - -1, -1, -1, 66, 67, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - -1, -1, -1, 58, 59, -1, -1, 62, -1, -1, - -1, 40, 41, -1, 43, -1, 99, 100, 47, -1, - -1, -1, -1, 78, 79, -1, 16, -1, -1, 58, - -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, - 95, -1, -1, 98, 99, 100, 101, 102, 103, 104, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, -1, -1, -1, 58, -1, - 99, 100, 62, -1, 64, 40, 41, -1, 43, -1, - -1, -1, 47, -1, -1, -1, -1, -1, 78, 79, - -1, 16, -1, 58, -1, -1, 61, -1, -1, -1, - -1, -1, -1, -1, -1, 95, -1, -1, 98, 99, - 100, 101, 102, 103, 104, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 59, -1, -1, 58, 99, 100, 65, 62, -1, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, - -1, -1, -1, 78, 79, -1, 16, -1, -1, -1, - -1, -1, 91, 92, 93, 94, 95, 96, 97, 98, - 95, -1, -1, 98, 99, 100, 101, 102, 103, 104, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, -1, -1, -1, 58, -1, - -1, -1, 62, -1, 17, 18, -1, 20, 21, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 78, 79, - -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, - 43, -1, -1, -1, 47, 95, -1, -1, 98, 99, - 100, 101, 102, 103, 104, 58, -1, -1, 61, -1, - -1, -1, -1, 66, 67, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, - -1, -1, -1, -1, -1, 19, 99, 100, 22, 23, - 24, -1, 26, 27, 28, 29, -1, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, -1, 43, - -1, -1, -1, 47, 48, 49, 50, 51, -1, -1, - -1, -1, 56, -1, 58, -1, -1, 40, 41, -1, - 43, -1, 66, 67, 47, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 58, -1, -1, 61, -1, - -1, -1, -1, 66, 67, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 99, 100, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 55, -1, - -1, -1, -1, 60, -1, -1, 99, 100, 65, -1, - -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 91, 92, 93, 94, 95, 96, - 97, 98, 55, -1, -1, -1, -1, 60, -1, -1, - -1, -1, 65, -1, -1, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 91, 92, - 93, 94, 95, 96, 97, 98, 55, -1, -1, -1, - -1, 60, -1, -1, -1, -1, 65, -1, -1, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 91, 92, 93, 94, 95, 96, 97, 98, - 55, -1, -1, -1, -1, 60, -1, -1, -1, -1, - 65, -1, -1, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 55, -1, 91, 92, 93, 94, - 95, 96, 97, 98, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 65, -1, - -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 55, -1, 91, 92, 93, 94, 95, 96, - 97, 98, 65, -1, -1, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 55, -1, 91, 92, - 93, 94, 95, 96, 97, 98, 65, -1, -1, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 55, -1, 91, 92, 93, 94, 95, 96, 97, 98, - 65, -1, -1, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 55, -1, 91, 92, 93, 94, - 95, 96, 97, 98, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 65, -1, - -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 55, -1, 91, 92, 93, 94, 95, 96, - 97, 98, 65, -1, -1, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 55, -1, 91, 92, - 93, 94, 95, 96, 97, 98, 65, -1, -1, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 55, -1, 91, 92, 93, 94, 95, 96, 97, 98, - 65, -1, -1, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 55, -1, 91, 92, 93, 94, - 95, 96, 97, 98, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 59, -1, - -1, -1, -1, -1, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 59, -1, - -1, -1, -1, -1, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 59, -1, - -1, -1, -1, -1, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 59, -1, - -1, -1, -1, -1, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 60, -1, - -1, -1, -1, 65, -1, -1, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, - 92, 93, 94, 95, 96, 97, 98, 63, -1, 65, - -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 91, 92, 93, 94, 95, - 96, 97, 98, 64, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 91, 92, 93, 94, 95, 96, 97, 98, 64, 65, - -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 91, 92, 93, 94, 95, - 96, 97, 98, 64, 65, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 65, -1, -1, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 91, 92, 93, 94, 95, 96, 97, 98, -1, -1, - -1, -1, -1, 91, 92, 93, 94, 95, 96, 97, - 98, 68, 69, -1, 71, 72, 73, 74, 75, 76, - 77, 68, 69, -1, -1, 72, 73, 74, 75, 76, - 77, -1, -1, -1, 91, 92, 93, 94, 95, 96, - 97, 98, -1, -1, 91, 92, 93, 94, 95, 96, - 97, 98, 68, 69, -1, -1, 72, 73, 74, 75, - 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, - 96, 97, 98 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 47, 100, 116, 117, - 118, 119, 120, 121, 122, 123, 195, 99, 100, 196, - 196, 54, 0, 118, 119, 120, 54, 80, 64, 64, - 101, 198, 171, 195, 16, 40, 41, 42, 43, 44, - 45, 46, 48, 49, 50, 51, 52, 53, 54, 58, - 62, 78, 79, 95, 98, 100, 102, 103, 104, 155, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 174, 175, 176, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 55, 55, 60, - 58, 195, 196, 58, 195, 196, 58, 54, 54, 155, - 58, 59, 155, 172, 173, 195, 155, 155, 54, 58, - 103, 104, 166, 167, 180, 181, 183, 184, 188, 189, - 190, 191, 195, 196, 100, 64, 65, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 91, 92, 93, - 94, 95, 96, 97, 98, 58, 61, 168, 169, 195, - 54, 62, 64, 56, 129, 195, 58, 54, 62, 58, - 54, 62, 58, 155, 155, 55, 60, 155, 60, 59, - 155, 58, 61, 62, 155, 155, 155, 155, 155, 155, - 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, - 155, 155, 155, 155, 47, 100, 194, 172, 173, 195, - 11, 19, 22, 23, 24, 26, 27, 28, 29, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 57, 58, - 66, 67, 124, 125, 127, 128, 129, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 157, 158, 159, 166, 167, 177, 180, 181, 184, - 195, 155, 172, 195, 155, 172, 195, 155, 55, 55, - 155, 59, 155, 155, 195, 63, 59, 55, 54, 12, - 124, 126, 155, 64, 54, 64, 54, 124, 54, 54, - 54, 54, 95, 198, 201, 63, 64, 64, 64, 155, - 64, 54, 54, 58, 178, 179, 180, 181, 195, 184, - 184, 57, 125, 64, 64, 64, 64, 64, 80, 17, - 18, 20, 21, 66, 67, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 59, 55, 54, 59, - 55, 54, 59, 60, 59, 155, 172, 12, 124, 64, - 55, 155, 27, 155, 130, 157, 158, 159, 184, 195, - 155, 63, 63, 64, 172, 172, 59, 60, 155, 54, - 54, 54, 54, 155, 155, 155, 155, 155, 155, 155, - 155, 155, 155, 155, 59, 172, 59, 172, 59, 155, - 54, 55, 64, 55, 54, 55, 64, 30, 60, 55, - 55, 55, 179, 155, 155, 155, 155, 54, 55, 54, - 55, 54, 55, 172, 124, 155, 124, 155, 156, 155, - 195, 129, 64, 64, 55, 55, 60, 55, 60, 55, - 60, 172, 172, 172, 55, 25, 55, 64, 55, 30, - 64, 64, 173, 64, 173, 64, 173, 55, 55, 55, - 124, 64, 130, 124, 155, 55, 55, 55, 55, 55, - 64, 64, 64, 124, 124 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 115, 116, 116, 117, 117, 117, 117, 117, 117, - 118, 119, 120, 120, 120, 120, 120, 121, 122, 123, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 125, 125, 126, 126, 127, - 127, 128, 128, 129, 129, 130, 130, 130, 130, 131, - 131, 132, 132, 132, 133, 134, 134, 135, 136, 136, - 137, 137, 138, 139, 139, 140, 141, 142, 143, 144, - 145, 145, 146, 147, 147, 148, 149, 150, 151, 151, - 152, 153, 154, 155, 155, 155, 156, 156, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 158, 158, 159, 159, 160, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 163, 164, 164, 164, 164, 165, 166, - 166, 167, 167, 168, 168, 168, 168, 168, 168, 169, - 169, 169, 169, 170, 171, 171, 171, 172, 172, 173, - 173, 174, 175, 176, 176, 177, 178, 178, 179, 179, - 179, 180, 181, 182, 183, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 195, 196, 196, 197, 198, - 199, 200, 200, 201, 201, 202, 203 - }; - - 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, 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, 2, 4, 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, 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, 2, 2, 2, 2, 2, 2, 1, - 1, 2, 2, 4, 6, 5, 7, 5, 7, 8, - 9, 9, 9, 3, 3, 1, 0, 1, 0, 3, - 1, 4, 4, 2, 3, 3, 3, 1, 1, 1, - 1, 4, 3, 3, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 7, 2, 1, 2, 1, 1, 1 - }; - - - - -#if S4DEBUG - const short - parser::yyrline_[] = - { - 0, 267, 267, 268, 272, 274, 276, 278, 280, 282, - 287, 291, 296, 297, 298, 299, 300, 304, 309, 314, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 347, 348, 352, 354, 359, - 361, 366, 367, 371, 372, 376, 378, 380, 383, 387, - 389, 394, 396, 398, 403, 408, 410, 415, 420, 422, - 427, 429, 434, 439, 441, 446, 451, 456, 461, 466, - 471, 473, 478, 483, 485, 490, 495, 500, 505, 507, - 512, 517, 522, 527, 528, 529, 533, 534, 538, 540, - 542, 544, 546, 548, 550, 552, 554, 556, 558, 560, - 565, 567, 572, 574, 579, 584, 586, 588, 590, 592, - 594, 596, 598, 600, 602, 604, 606, 608, 610, 612, - 614, 616, 618, 623, 624, 625, 626, 627, 628, 629, - 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, - 650, 651, 652, 656, 661, 663, 665, 667, 672, 677, - 678, 681, 682, 686, 688, 690, 692, 694, 696, 701, - 703, 705, 707, 712, 717, 719, 722, 726, 729, 733, - 735, 740, 745, 750, 752, 757, 762, 764, 769, 770, - 771, 775, 780, 785, 790, 795, 796, 797, 798, 799, - 800, 801, 802, 803, 807, 812, 817, 822, 827, 832, - 837, 842, 847, 852, 857, 859, 864, 866, 871, 876, - 881, 886, 888, 893, 895, 900, 905 - }; - - 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 // S4DEBUG - - -#line 13 "parser.ypp" -} } } // xsk::gsc::s4 -#line 4808 "parser.cpp" - -#line 909 "parser.ypp" - - -void xsk::gsc::s4::parser::error(const xsk::gsc::location& loc, const std::string& msg) -{ - throw xsk::gsc::comp_error(loc, msg); -} diff --git a/src/s4/xsk/resolver.cpp b/src/s4/xsk/resolver.cpp deleted file mode 100644 index 2052cf8c..00000000 --- a/src/s4/xsk/resolver.cpp +++ /dev/null @@ -1,562 +0,0 @@ -// 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 "s4.hpp" - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - -namespace xsk::gsc::s4 -{ - -std::unordered_map opcode_map; -std::unordered_map function_map; -std::unordered_map method_map; -std::unordered_map token_map; -std::unordered_map opcode_map_rev; -std::unordered_map function_map_rev; -std::unordered_map method_map_rev; -std::unordered_map token_map_rev; -std::unordered_map> files; -read_cb_type read_callback = nullptr; -std::set string_map; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::function_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_func_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin function id for name '%s'!", name.data())); -} - -auto resolver::function_name(std::uint16_t id) -> std::string -{ - const auto itr = function_map.find(id); - - if (itr != function_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_func_%04X", id); -} - -auto resolver::method_id(const std::string& name) -> std::uint16_t -{ - if (name.starts_with("_meth_")) - { - return static_cast(std::stoul(name.substr(6), nullptr, 16)); - } - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve builtin method id for name '%s'!", name.data())); -} - -auto resolver::method_name(std::uint16_t id) -> std::string -{ - const auto itr = method_map.find(id); - - if (itr != method_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_meth_%04X", id); -} - -auto resolver::token_id(const std::string& name) -> std::uint32_t -{ - if (name.starts_with("_id_")) - { - return static_cast(std::stoul(name.substr(4), nullptr, 16)); - } - - const auto itr = token_map_rev.find(name); - - if (itr != token_map_rev.end()) - { - return itr->second; - } - - return 0; -} - -auto resolver::token_name(std::uint32_t id) -> std::string -{ - const auto itr = token_map.find(id); - - if (itr != token_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_id_%04X", id); -} - -auto resolver::find_function(const std::string& name) -> bool -{ - if (name.starts_with("_func_")) return true; - - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - return true; - } - - return false; -} - -auto resolver::find_method(const std::string& name) -> bool -{ - if (name.starts_with("_meth_")) return true; - - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - return true; - } - - return false; -} - -void resolver::add_function(const std::string& name, std::uint16_t id) -{ - const auto itr = function_map_rev.find(name); - - if (itr != function_map_rev.end()) - { - throw error(utils::string::va("builtin function '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - function_map.insert({ id, *str }); - function_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - function_map.insert({ id, *ins.first }); - function_map_rev.insert({ *ins.first, id }); - } - } -} - -void resolver::add_method(const std::string& name, std::uint16_t id) -{ - const auto itr = method_map_rev.find(name); - - if (itr != method_map_rev.end()) - { - throw error(utils::string::va("builtin method '%s' already defined.", name.data())); - } - - const auto str = string_map.find(name); - - if (str != string_map.end()) - { - method_map.insert({ id, *str }); - method_map_rev.insert({ *str, id }); - } - else - { - auto ins = string_map.insert(name); - - if (ins.second) - { - method_map.insert({ id, *ins.first }); - method_map_rev.insert({ *ins.first, 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] = static_cast(std::tolower(static_cast(str[i]))); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data)}); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path(); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result /= entry; - } - } - - return result.empty() ? file : result; -} - -const std::array, 190> opcode_list -{{ - { 0x0, "OP_CastFieldObject" }, - { 0x1, "OP_SetLocalVariableFieldCached" }, - { 0x2, "OP_plus" }, - { 0x3, "OP_RemoveLocalVariables" }, - { 0x4, "OP_EvalSelfFieldVariableRef" }, - { 0x5, "OP_ScriptFarMethodChildThreadCall" }, - { 0x6, "OP_GetGameRef" }, - { 0x7, "OP_EvalAnimFieldVariable" }, - { 0x8, "OP_EvalLevelFieldVariableRef" }, - { 0x9, "OP_GetThisthread" }, - { 0xA, "OP_greater" }, - { 0xB, "OP_waittillmatch" }, - { 0xC, "OP_shift_right" }, - { 0xD, "OP_dec" }, - { 0xE, "OP_JumpOnTrue" }, - { 0xF, "OP_bit_or" }, - { 0x10, "OP_equality" }, - { 0x11, "OP_ClearLocalVariableFieldCached0" }, - { 0x12, "OP_notify" }, - { 0x13, "OP_GetVector" }, - { 0x14, "OP_ScriptMethodChildThreadCallPointer" }, - { 0x15, "OP_PreScriptCall" }, - { 0x16, "OP_GetByte" }, - { 0x17, "OP_ScriptFarThreadCall" }, - { 0x18, "OP_SetSelfFieldVariableField" }, - { 0x19, "OP_JumpOnFalseExpr" }, - { 0x1A, "OP_GetUndefined" }, - { 0x1B, "OP_jumpback" }, - { 0x1C, "OP_JumpOnTrueExpr" }, - { 0x1D, "OP_CallBuiltin0" }, - { 0x1E, "OP_CallBuiltin1" }, - { 0x1F, "OP_CallBuiltin2" }, - { 0x20, "OP_CallBuiltin3" }, - { 0x21, "OP_CallBuiltin4" }, - { 0x22, "OP_CallBuiltin5" }, - { 0x23, "OP_CallBuiltin" }, - { 0x24, "OP_SetLocalVariableFieldCached0" }, - { 0x25, "OP_ClearFieldVariable" }, - { 0x26, "OP_GetLevel" }, - { 0x27, "OP_size" }, - { 0x28, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x29, "OP_ScriptLocalMethodThreadCall" }, - { 0x2A, "OP_AddArray" }, - { 0x2B, "OP_endon" }, - { 0x2C, "OP_EvalFieldVariable" }, - { 0x2D, "OP_shift_left" }, - { 0x2E, "OP_EvalLocalArrayRefCached0" }, - { 0x2F, "OP_Return" }, - { 0x30, "OP_CreateLocalVariable" }, - { 0x31, "OP_SafeSetVariableFieldCached0" }, - { 0x32, "OP_GetBuiltinFunction" }, - { 0x33, "OP_ScriptLocalMethodCall" }, - { 0x34, "OP_CallBuiltinMethodPointer" }, - { 0x35, "OP_ScriptLocalChildThreadCall" }, - { 0x36, "OP_GetSelfObject" }, - { 0x37, "OP_GetGame" }, - { 0x38, "OP_SetLevelFieldVariableField" }, - { 0x39, "OP_EvalArray" }, - { 0x3A, "OP_GetSelf" }, - { 0x3B, "OP_End" }, - { 0x3C, "OP_EvalSelfFieldVariable" }, - { 0x3D, "OP_less_equal" }, - { 0x3E, "OP_EvalLocalVariableCached0" }, - { 0x3F, "OP_EvalLocalVariableCached1" }, - { 0x40, "OP_EvalLocalVariableCached2" }, - { 0x41, "OP_EvalLocalVariableCached3" }, - { 0x42, "OP_EvalLocalVariableCached4" }, - { 0x43, "OP_EvalLocalVariableCached5" }, - { 0x44, "OP_EvalLocalVariableCached" }, - { 0x45, "OP_EvalNewLocalArrayRefCached0" }, - { 0x46, "OP_ScriptChildThreadCallPointer" }, - { 0x47, "OP_EvalLocalVariableObjectCached" }, - { 0x48, "OP_ScriptLocalThreadCall" }, - { 0x49, "OP_GetInteger" }, - { 0x4A, "OP_ScriptMethodCallPointer" }, - { 0x4B, "OP_checkclearparams" }, - { 0x4C, "OP_SetAnimFieldVariableField" }, - { 0x4D, "OP_waittillmatch2" }, - { 0x4E, "OP_minus" }, - { 0x4F, "OP_ScriptLocalFunctionCall2" }, - { 0x50, "OP_GetNegUnsignedShort" }, - { 0x51, "OP_GetNegByte" }, - { 0x52, "OP_SafeCreateVariableFieldCached" }, - { 0x53, "OP_greater_equal" }, - { 0x54, "OP_vector" }, - { 0x55, "OP_GetBuiltinMethod" }, - { 0x56, "OP_endswitch" }, - { 0x57, "OP_ClearArray" }, - { 0x58, "OP_DecTop" }, - { 0x59, "OP_CastBool" }, - { 0x5A, "OP_EvalArrayRef" }, - { 0x5B, "OP_SetNewLocalVariableFieldCached0" }, - { 0x5C, "OP_GetZero" }, - { 0x5D, "OP_wait" }, - { 0x5E, "OP_waittill" }, - { 0x5F, "OP_GetIString" }, - { 0x60, "OP_ScriptFarFunctionCall" }, - { 0x61, "OP_GetAnimObject" }, - { 0x62, "OP_GetAnimTree" }, - { 0x63, "OP_EvalLocalArrayCached" }, - { 0x64, "OP_mod" }, - { 0x65, "OP_ScriptFarMethodThreadCall" }, - { 0x66, "OP_GetUnsignedShort" }, - { 0x67, "OP_clearparams" }, - { 0x68, "OP_ScriptMethodThreadCallPointer" }, - { 0x69, "OP_ScriptFunctionCallPointer" }, - { 0x6A, "OP_EmptyArray" }, - { 0x6B, "OP_SafeSetVariableFieldCached" }, - { 0x6C, "OP_ClearVariableField" }, - { 0x6D, "OP_EvalFieldVariableRef" }, - { 0x6E, "OP_ScriptLocalMethodChildThreadCall" }, - { 0x6F, "OP_EvalNewLocalVariableRefCached0" }, - { 0x70, "OP_GetFloat" }, - { 0x71, "OP_EvalLocalVariableRefCached" }, - { 0x72, "OP_JumpOnFalse" }, - { 0x73, "OP_BoolComplement" }, - { 0x74, "OP_ScriptThreadCallPointer" }, - { 0x75, "OP_ScriptFarFunctionCall2" }, - { 0x76, "OP_less" }, - { 0x77, "OP_BoolNot" }, - { 0x78, "OP_waittillFrameEnd" }, - { 0x79, "OP_waitframe" }, - { 0x7A, "OP_GetString" }, - { 0x7B, "OP_EvalLevelFieldVariable" }, - { 0x7C, "OP_GetLevelObject" }, - { 0x7D, "OP_inc" }, - { 0x7E, "OP_CallBuiltinMethod0" }, - { 0x7F, "OP_CallBuiltinMethod1" }, - { 0x80, "OP_CallBuiltinMethod2" }, - { 0x81, "OP_CallBuiltinMethod3" }, - { 0x82, "OP_CallBuiltinMethod4" }, - { 0x83, "OP_CallBuiltinMethod5" }, - { 0x84, "OP_CallBuiltinMethod" }, - { 0x85, "OP_GetAnim" }, - { 0x86, "OP_switch" }, - { 0x87, "OP_SetVariableField" }, - { 0x88, "OP_divide" }, - { 0x89, "OP_GetLocalFunction" }, - { 0x8A, "OP_ScriptFarChildThreadCall" }, - { 0x8B, "OP_multiply" }, - { 0x8C, "OP_ClearLocalVariableFieldCached" }, - { 0x8D, "OP_EvalAnimFieldVariableRef" }, - { 0x8E, "OP_EvalLocalArrayRefCached" }, - { 0x8F, "OP_EvalLocalVariableRefCached0" }, - { 0x90, "OP_bit_and" }, - { 0x91, "OP_GetAnimation" }, - { 0x92, "OP_GetFarFunction" }, - { 0x93, "OP_CallBuiltinPointer" }, - { 0x94, "OP_jump" }, - { 0x95, "OP_voidCodepos" }, - { 0x96, "OP_ScriptFarMethodCall" }, - { 0x97, "OP_inequality" }, - { 0x98, "OP_ScriptLocalFunctionCall" }, - { 0x99, "OP_bit_ex_or" }, - { 0x9A, "OP_NOP" }, - { 0x9B, "OP_abort" }, - { 0x9C, "OP_object" }, - { 0x9D, "OP_thread_object" }, - { 0x9E, "OP_EvalLocalVariable" }, - { 0x9F, "OP_EvalLocalVariableRef" }, - { 0xA0, "OP_prof_begin" }, - { 0xA1, "OP_prof_end" }, - { 0xA2, "OP_breakpoint" }, - { 0xA3, "OP_assignmentBreakpoint" }, - { 0xA4, "OP_manualAndAssignmentBreakpoint" }, - { 0xA5, "OP_BoolNotAfterAnd" }, - { 0xA6, "OP_FormalParams" }, - { 0xA7, "OP_IsDefined" }, - { 0xA8, "OP_IsTrue" }, - { 0xA9, "OP_NativeGetLocalFunction" }, - { 0xAA, "OP_NativeLocalFunctionCall" }, - { 0xAB, "OP_NativeLocalFunctionCall2" }, - { 0xAC, "OP_NativeLocalMethodCall" }, - { 0xAD, "OP_NativeLocalFunctionThreadCall" }, - { 0xAE, "OP_NativeLocalMethodThreadCall" }, - { 0xAF, "OP_NativeLocalFunctionChildThreadCall" }, - { 0xB0, "OP_NativeLocalMethodChildThreadCall" }, - { 0xB1, "OP_NativeGetFarFunction" }, - { 0xB2, "OP_NativeFarFunctionCall" }, - { 0xB3, "OP_NativeFarFunctionCall2" }, - { 0xB4, "OP_NativeFarMethodCall" }, - { 0xB5, "OP_NativeFarFunctionThreadCall" }, - { 0xB6, "OP_NativeFarMethodThreadCall" }, - { 0xB7, "OP_NativeFarFunctionChildThreadCall" }, - { 0xB8, "OP_NativeFarMethodChildThreadCall" }, - { 0xB9, "OP_EvalNewLocalArrayRefCached0_Precompiled" }, - { 0xBA, "OP_SetNewLocalVariableFieldCached0_Precompiled" }, - { 0xBB, "OP_CreateLocalVariable_Precompiled" }, - { 0xBC, "OP_SafeCreateVariableFieldCached_Precompiled" }, - { 0xBD, "OP_FormalParams_Precompiled" }, -}}; - -const std::array, 4> function_list -{{ - { 0x08F, "getdvar" }, - { 0x09B, "getfirstarraykey" }, - { 0x0B1, "getnextarraykey" }, - { 0x126, "isusingmatchrulesdata" }, -}}; -const std::array, 1> method_list -{{ - { 0x0, "null" }, -}}; - -const std::array, 5> token_list -{{ - { 0x00, "" }, - { 0x01, "pl#" }, - { 0x02, "-" }, - { 0x03, "radius`" }, - { 0x04, "note:" }, -}}; - -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()); - function_map.reserve(function_list.size()); - function_map_rev.reserve(function_list.size()); - method_map.reserve(method_list.size()); - method_map_rev.reserve(method_list.size()); - token_map.reserve(token_list.size()); - token_map_rev.reserve(token_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 : function_list) - { - function_map.insert({ entry.first, entry.second }); - function_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : method_list) - { - method_map.insert({ entry.first, entry.second }); - method_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : token_list) - { - token_map.insert({ entry.first, entry.second }); - token_map_rev.insert({ entry.second, entry.first }); - } - } -}; - -__init__ _; - -} // namespace xsk::gsc::s4 - -#ifdef _MSC_VER -#pragma warning(pop) -#endif diff --git a/src/s4/xsk/resolver.hpp b/src/s4/xsk/resolver.hpp deleted file mode 100644 index a5bf4315..00000000 --- a/src/s4/xsk/resolver.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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::gsc::s4 -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - - static auto function_id(const std::string& name) -> std::uint16_t; - static auto function_name(std::uint16_t id) -> std::string; - - static auto method_id(const std::string& name) -> std::uint16_t; - static auto method_name(std::uint16_t id) -> std::string; - - static auto token_id(const std::string& name) -> std::uint32_t; - static auto token_name(std::uint32_t id) -> std::string; - - static auto find_function(const std::string& name) -> bool; - static auto find_method(const std::string& name) -> bool; - - static void add_function(const std::string& name, std::uint16_t id); - static void add_method(const std::string& name, std::uint16_t id); - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/s4.cpp b/src/s4/xsk/s4.cpp deleted file mode 100644 index d9169b0b..00000000 --- a/src/s4/xsk/s4.cpp +++ /dev/null @@ -1,219 +0,0 @@ -// 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 "s4.hpp" - -namespace xsk::gsc::s4 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_CastFieldObject: - case opcode::OP_plus: - case opcode::OP_GetGameRef: - case opcode::OP_GetThisthread: - case opcode::OP_greater: - case opcode::OP_shift_right: - case opcode::OP_dec: - case opcode::OP_bit_or: - case opcode::OP_equality: - case opcode::OP_ClearLocalVariableFieldCached0: - case opcode::OP_notify: - case opcode::OP_PreScriptCall: - case opcode::OP_GetUndefined: - case opcode::OP_SetLocalVariableFieldCached0: - case opcode::OP_GetLevel: - case opcode::OP_size: - case opcode::OP_AddArray: - case opcode::OP_endon: - case opcode::OP_shift_left: - case opcode::OP_EvalLocalArrayRefCached0: - case opcode::OP_Return: - case opcode::OP_SafeSetVariableFieldCached0: - case opcode::OP_GetSelfObject: - case opcode::OP_GetGame: - case opcode::OP_EvalArray: - case opcode::OP_GetSelf: - case opcode::OP_End: - case opcode::OP_less_equal: - case opcode::OP_EvalLocalVariableCached0: - case opcode::OP_EvalLocalVariableCached1: - case opcode::OP_EvalLocalVariableCached2: - case opcode::OP_EvalLocalVariableCached3: - case opcode::OP_EvalLocalVariableCached4: - case opcode::OP_EvalLocalVariableCached5: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_checkclearparams: - case opcode::OP_waittillmatch2: - case opcode::OP_minus: - case opcode::OP_greater_equal: - case opcode::OP_vector: - case opcode::OP_ClearArray: - case opcode::OP_DecTop: - case opcode::OP_CastBool: - case opcode::OP_EvalArrayRef: - case opcode::OP_GetZero: - case opcode::OP_wait: - case opcode::OP_waittill: - case opcode::OP_GetAnimObject: - case opcode::OP_mod: - case opcode::OP_clearparams: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_EmptyArray: - case opcode::OP_ClearVariableField: - case opcode::OP_EvalNewLocalVariableRefCached0: - case opcode::OP_BoolComplement: - case opcode::OP_less: - case opcode::OP_BoolNot: - case opcode::OP_waittillFrameEnd: - case opcode::OP_waitframe: - case opcode::OP_GetLevelObject: - case opcode::OP_inc: - case opcode::OP_GetAnim: - case opcode::OP_SetVariableField: - case opcode::OP_divide: - case opcode::OP_multiply: - case opcode::OP_EvalLocalVariableRefCached0: - case opcode::OP_bit_and: - case opcode::OP_voidCodepos: - case opcode::OP_inequality: - case opcode::OP_bit_ex_or: -/* case opcode::OP_NOP: - case opcode::OP_abort: - case opcode::OP_object: - case opcode::OP_thread_object: - case opcode::OP_EvalLocalVariable: - case opcode::OP_EvalLocalVariableRef: - case opcode::OP_breakpoint: - case opcode::OP_assignmentBreakpoint: - case opcode::OP_manualAndAssignmentBreakpoint:*/ - case opcode::OP_BoolNotAfterAnd: - case opcode::OP_IsDefined: - case opcode::OP_IsTrue: - return 1; - case opcode::OP_SetLocalVariableFieldCached: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_waittillmatch: - case opcode::OP_ScriptMethodChildThreadCallPointer: - case opcode::OP_GetByte: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_CreateLocalVariable: - case opcode::OP_CallBuiltinMethodPointer: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalNewLocalArrayRefCached0: - case opcode::OP_ScriptChildThreadCallPointer: - case opcode::OP_EvalLocalVariableObjectCached: - case opcode::OP_GetNegByte: - case opcode::OP_SafeCreateVariableFieldCached: - case opcode::OP_SetNewLocalVariableFieldCached0: - case opcode::OP_GetAnimTree: - case opcode::OP_EvalLocalArrayCached: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ClearLocalVariableFieldCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_CallBuiltinPointer: -// case opcode::OP_prof_end: - case opcode::OP_FormalParams: -/* case opcode::OP_EvalNewLocalArrayRefCached0_Precompiled: - case opcode::OP_SetNewLocalVariableFieldCached0_Precompiled: - case opcode::OP_CreateLocalVariable_Precompiled: - case opcode::OP_SafeCreateVariableFieldCached_Precompiled: - case opcode::OP_FormalParams_Precompiled:*/ - return 2; - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_jumpback: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_CallBuiltin0: - case opcode::OP_CallBuiltin1: - case opcode::OP_CallBuiltin2: - case opcode::OP_CallBuiltin3: - case opcode::OP_CallBuiltin4: - case opcode::OP_CallBuiltin5: - case opcode::OP_GetBuiltinFunction: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_GetBuiltinMethod: - case opcode::OP_endswitch: - case opcode::OP_GetUnsignedShort: - case opcode::OP_JumpOnFalse: - case opcode::OP_CallBuiltinMethod0: - case opcode::OP_CallBuiltinMethod1: - case opcode::OP_CallBuiltinMethod2: - case opcode::OP_CallBuiltinMethod3: - case opcode::OP_CallBuiltinMethod4: - case opcode::OP_CallBuiltinMethod5: - return 3; - case opcode::OP_CallBuiltin: - case opcode::OP_ScriptLocalMethodCall: - case opcode::OP_ScriptLocalFunctionCall2: - case opcode::OP_ScriptFarFunctionCall: - case opcode::OP_ScriptFarFunctionCall2: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_GetLocalFunction: - case opcode::OP_GetFarFunction: - case opcode::OP_ScriptFarMethodCall: - case opcode::OP_ScriptLocalFunctionCall: -/* case opcode::OP_NativeGetLocalFunction: - case opcode::OP_NativeLocalFunctionCall: - case opcode::OP_NativeLocalFunctionCall2: - case opcode::OP_NativeLocalMethodCall: - case opcode::OP_NativeGetFarFunction: - case opcode::OP_NativeFarFunctionCall: - case opcode::OP_NativeFarFunctionCall2: - case opcode::OP_NativeFarMethodCall:*/ - return 4; - case opcode::OP_EvalSelfFieldVariableRef: - case opcode::OP_ScriptFarMethodChildThreadCall: - case opcode::OP_EvalAnimFieldVariable: - case opcode::OP_EvalLevelFieldVariableRef: - case opcode::OP_ScriptFarThreadCall: - case opcode::OP_SetSelfFieldVariableField: - case opcode::OP_ClearFieldVariable: - case opcode::OP_ScriptLocalMethodThreadCall: - case opcode::OP_EvalFieldVariable: - case opcode::OP_ScriptLocalChildThreadCall: - case opcode::OP_SetLevelFieldVariableField: - case opcode::OP_EvalSelfFieldVariable: - case opcode::OP_ScriptLocalThreadCall: - case opcode::OP_GetInteger: - case opcode::OP_SetAnimFieldVariableField: - case opcode::OP_GetIString: - case opcode::OP_ScriptFarMethodThreadCall: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ScriptLocalMethodChildThreadCall: - case opcode::OP_GetFloat: - case opcode::OP_GetString: - case opcode::OP_EvalLevelFieldVariable: - case opcode::OP_switch: - case opcode::OP_ScriptFarChildThreadCall: - case opcode::OP_EvalAnimFieldVariableRef: - case opcode::OP_jump: -/* case opcode::OP_NativeLocalFunctionThreadCall: - case opcode::OP_NativeLocalMethodThreadCall: - case opcode::OP_NativeLocalFunctionChildThreadCall: - case opcode::OP_NativeLocalMethodChildThreadCall: - case opcode::OP_NativeFarFunctionThreadCall: - case opcode::OP_NativeFarMethodThreadCall: - case opcode::OP_NativeFarFunctionChildThreadCall: - case opcode::OP_NativeFarMethodChildThreadCall:*/ - return 5; -/* case opcode::OP_prof_begin: - return 6;*/ - case opcode::OP_GetAnimation: - return 9; - case opcode::OP_GetVector: - return 13; - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/s4.hpp b/src/s4/xsk/s4.hpp deleted file mode 100644 index b35565af..00000000 --- a/src/s4/xsk/s4.hpp +++ /dev/null @@ -1,219 +0,0 @@ -// 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 "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::gsc::s4 -{ - -constexpr std::uint32_t max_string_id = 0x110F3; - -enum class opcode : std::uint8_t -{ - OP_CastFieldObject = 0x0, - OP_SetLocalVariableFieldCached = 0x1, - OP_plus = 0x2, - OP_RemoveLocalVariables = 0x3, - OP_EvalSelfFieldVariableRef = 0x4, - OP_ScriptFarMethodChildThreadCall = 0x5, - OP_GetGameRef = 0x6, - OP_EvalAnimFieldVariable = 0x7, - OP_EvalLevelFieldVariableRef = 0x8, - OP_GetThisthread = 0x9, - OP_greater = 0xA, - OP_waittillmatch = 0xB, - OP_shift_right = 0xC, - OP_dec = 0xD, - OP_JumpOnTrue = 0xE, - OP_bit_or = 0xF, - OP_equality = 0x10, - OP_ClearLocalVariableFieldCached0 = 0x11, - OP_notify = 0x12, - OP_GetVector = 0x13, - OP_ScriptMethodChildThreadCallPointer = 0x14, - OP_PreScriptCall = 0x15, - OP_GetByte = 0x16, - OP_ScriptFarThreadCall = 0x17, - OP_SetSelfFieldVariableField = 0x18, - OP_JumpOnFalseExpr = 0x19, - OP_GetUndefined = 0x1A, - OP_jumpback = 0x1B, - OP_JumpOnTrueExpr = 0x1C, - OP_CallBuiltin0 = 0x1D, - OP_CallBuiltin1 = 0x1E, - OP_CallBuiltin2 = 0x1F, - OP_CallBuiltin3 = 0x20, - OP_CallBuiltin4 = 0x21, - OP_CallBuiltin5 = 0x22, - OP_CallBuiltin = 0x23, - OP_SetLocalVariableFieldCached0 = 0x24, - OP_ClearFieldVariable = 0x25, - OP_GetLevel = 0x26, - OP_size = 0x27, - OP_SafeSetWaittillVariableFieldCached = 0x28, - OP_ScriptLocalMethodThreadCall = 0x29, - OP_AddArray = 0x2A, - OP_endon = 0x2B, - OP_EvalFieldVariable = 0x2C, - OP_shift_left = 0x2D, - OP_EvalLocalArrayRefCached0 = 0x2E, - OP_Return = 0x2F, - OP_CreateLocalVariable = 0x30, - OP_SafeSetVariableFieldCached0 = 0x31, - OP_GetBuiltinFunction = 0x32, - OP_ScriptLocalMethodCall = 0x33, - OP_CallBuiltinMethodPointer = 0x34, - OP_ScriptLocalChildThreadCall = 0x35, - OP_GetSelfObject = 0x36, - OP_GetGame = 0x37, - OP_SetLevelFieldVariableField = 0x38, - OP_EvalArray = 0x39, - OP_GetSelf = 0x3A, - OP_End = 0x3B, - OP_EvalSelfFieldVariable = 0x3C, - OP_less_equal = 0x3D, - OP_EvalLocalVariableCached0 = 0x3E, - OP_EvalLocalVariableCached1 = 0x3F, - OP_EvalLocalVariableCached2 = 0x40, - OP_EvalLocalVariableCached3 = 0x41, - OP_EvalLocalVariableCached4 = 0x42, - OP_EvalLocalVariableCached5 = 0x43, - OP_EvalLocalVariableCached = 0x44, - OP_EvalNewLocalArrayRefCached0 = 0x45, - OP_ScriptChildThreadCallPointer = 0x46, - OP_EvalLocalVariableObjectCached = 0x47, - OP_ScriptLocalThreadCall = 0x48, - OP_GetInteger = 0x49, - OP_ScriptMethodCallPointer = 0x4A, - OP_checkclearparams = 0x4B, - OP_SetAnimFieldVariableField = 0x4C, - OP_waittillmatch2 = 0x4D, - OP_minus = 0x4E, - OP_ScriptLocalFunctionCall2 = 0x4F, - OP_GetNegUnsignedShort = 0x50, - OP_GetNegByte = 0x51, - OP_SafeCreateVariableFieldCached = 0x52, - OP_greater_equal = 0x53, - OP_vector = 0x54, - OP_GetBuiltinMethod = 0x55, - OP_endswitch = 0x56, - OP_ClearArray = 0x57, - OP_DecTop = 0x58, - OP_CastBool = 0x59, - OP_EvalArrayRef = 0x5A, - OP_SetNewLocalVariableFieldCached0 = 0x5B, - OP_GetZero = 0x5C, - OP_wait = 0x5D, - OP_waittill = 0x5E, - OP_GetIString = 0x5F, - OP_ScriptFarFunctionCall = 0x60, - OP_GetAnimObject = 0x61, - OP_GetAnimTree = 0x62, - OP_EvalLocalArrayCached = 0x63, - OP_mod = 0x64, - OP_ScriptFarMethodThreadCall = 0x65, - OP_GetUnsignedShort = 0x66, - OP_clearparams = 0x67, - OP_ScriptMethodThreadCallPointer = 0x68, - OP_ScriptFunctionCallPointer = 0x69, - OP_EmptyArray = 0x6A, - OP_SafeSetVariableFieldCached = 0x6B, - OP_ClearVariableField = 0x6C, - OP_EvalFieldVariableRef = 0x6D, - OP_ScriptLocalMethodChildThreadCall = 0x6E, - OP_EvalNewLocalVariableRefCached0 = 0x6F, - OP_GetFloat = 0x70, - OP_EvalLocalVariableRefCached = 0x71, - OP_JumpOnFalse = 0x72, - OP_BoolComplement = 0x73, - OP_ScriptThreadCallPointer = 0x74, - OP_ScriptFarFunctionCall2 = 0x75, - OP_less = 0x76, - OP_BoolNot = 0x77, - OP_waittillFrameEnd = 0x78, - OP_waitframe = 0x79, - OP_GetString = 0x7A, - OP_EvalLevelFieldVariable = 0x7B, - OP_GetLevelObject = 0x7C, - OP_inc = 0x7D, - OP_CallBuiltinMethod0 = 0x7E, - OP_CallBuiltinMethod1 = 0x7F, - OP_CallBuiltinMethod2 = 0x80, - OP_CallBuiltinMethod3 = 0x81, - OP_CallBuiltinMethod4 = 0x82, - OP_CallBuiltinMethod5 = 0x83, - OP_CallBuiltinMethod = 0x84, - OP_GetAnim = 0x85, - OP_switch = 0x86, - OP_SetVariableField = 0x87, - OP_divide = 0x88, - OP_GetLocalFunction = 0x89, - OP_ScriptFarChildThreadCall = 0x8A, - OP_multiply = 0x8B, - OP_ClearLocalVariableFieldCached = 0x8C, - OP_EvalAnimFieldVariableRef = 0x8D, - OP_EvalLocalArrayRefCached = 0x8E, - OP_EvalLocalVariableRefCached0 = 0x8F, - OP_bit_and = 0x90, - OP_GetAnimation = 0x91, - OP_GetFarFunction = 0x92, - OP_CallBuiltinPointer = 0x93, - OP_jump = 0x94, - OP_voidCodepos = 0x95, - OP_ScriptFarMethodCall = 0x96, - OP_inequality = 0x97, - OP_ScriptLocalFunctionCall = 0x98, - OP_bit_ex_or = 0x99, - OP_NOP = 0x9A, - OP_abort = 0x9B, - OP_object = 0x9C, - OP_thread_object = 0x9D, - OP_EvalLocalVariable = 0x9E, - OP_EvalLocalVariableRef = 0x9F, - OP_prof_begin = 0xA0, - OP_prof_end = 0xA1, - OP_breakpoint = 0xA2, - OP_assignmentBreakpoint = 0xA3, - OP_manualAndAssignmentBreakpoint = 0xA4, - OP_BoolNotAfterAnd = 0xA5, - OP_FormalParams = 0xA6, - OP_IsDefined = 0xA7, - OP_IsTrue = 0xA8, - OP_NativeGetLocalFunction = 0xA9, - OP_NativeLocalFunctionCall = 0xAA, - OP_NativeLocalFunctionCall2 = 0xAB, - OP_NativeLocalMethodCall = 0xAC, - OP_NativeLocalFunctionThreadCall = 0xAD, - OP_NativeLocalMethodThreadCall = 0xAE, - OP_NativeLocalFunctionChildThreadCall = 0xAF, - OP_NativeLocalMethodChildThreadCall = 0xB0, - OP_NativeGetFarFunction = 0xB1, - OP_NativeFarFunctionCall = 0xB2, - OP_NativeFarFunctionCall2 = 0xB3, - OP_NativeFarMethodCall = 0xB4, - OP_NativeFarFunctionThreadCall = 0xB5, - OP_NativeFarMethodThreadCall = 0xB6, - OP_NativeFarFunctionChildThreadCall = 0xB7, - OP_NativeFarMethodChildThreadCall = 0xB8, - OP_EvalNewLocalArrayRefCached0_Precompiled = 0xB9, - OP_SetNewLocalVariableFieldCached0_Precompiled = 0xBA, - OP_CreateLocalVariable_Precompiled = 0xBB, - OP_SafeCreateVariableFieldCached_Precompiled = 0xBC, - OP_FormalParams_Precompiled = 0xBD, - OP_count = 0xBE, -}; - -auto opcode_size(std::uint8_t op) -> std::uint32_t; - -} // namespace xsk::gsc::s4 diff --git a/src/experimental/iw5c/stdafx.cpp b/src/stdinc.cpp similarity index 61% rename from src/experimental/iw5c/stdafx.cpp rename to src/stdinc.cpp index 1f373bf1..197142fa 100644 --- a/src/experimental/iw5c/stdafx.cpp +++ b/src/stdinc.cpp @@ -1,6 +1,6 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "stdinc.hpp" diff --git a/src/iw7/stdafx.hpp b/src/stdinc.hpp similarity index 56% rename from src/iw7/stdafx.hpp rename to src/stdinc.hpp index 337ac3c1..c29b5aa7 100644 --- a/src/iw7/stdafx.hpp +++ b/src/stdinc.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. @@ -25,4 +25,21 @@ using namespace std::literals; -#include "xsk/iw7.hpp" +#include "fmt/core.h" + +namespace xsk +{ + +using usize = std::size_t; +using u8 = std::uint8_t; +using u16 = std::uint16_t; +using u32 = std::uint32_t; +using u64 = std::uint64_t; +using i8 = std::int8_t; +using i16 = std::int16_t; +using i32 = std::int32_t; +using i64 = std::int64_t; +using f32 = float; +using f64 = double; + +}; diff --git a/src/experimental/iw6c/stdafx.cpp b/src/t4/t4.cpp similarity index 61% rename from src/experimental/iw6c/stdafx.cpp rename to src/t4/t4.cpp index 1f373bf1..a056e87d 100644 --- a/src/experimental/iw6c/stdafx.cpp +++ b/src/t4/t4.cpp @@ -1,6 +1,6 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "t4.hpp" diff --git a/src/experimental/t4/xsk/t4.hpp b/src/t4/t4.hpp similarity index 97% rename from src/experimental/t4/xsk/t4.hpp rename to src/t4/t4.hpp index 420842db..c5e4c755 100644 --- a/src/experimental/t4/xsk/t4.hpp +++ b/src/t4/t4.hpp @@ -1,11 +1,12 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. #pragma once -#include "utils/xsk/utils.hpp" +#include "stdinc.hpp" +#include "gsc/context.hpp" namespace xsk::gsc::t4 { @@ -153,6 +154,4 @@ enum class opcode : std::uint8_t OP_count = 0x8A, }; -auto opcode_size(std::uint8_t id) -> std::uint32_t; - } // namespace xsk::gsc::t4 diff --git a/src/experimental/s1c/stdafx.cpp b/src/t5/t5.cpp similarity index 61% rename from src/experimental/s1c/stdafx.cpp rename to src/t5/t5.cpp index 1f373bf1..b3f27816 100644 --- a/src/experimental/s1c/stdafx.cpp +++ b/src/t5/t5.cpp @@ -1,6 +1,6 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "t5.hpp" diff --git a/src/experimental/t5/xsk/t5.hpp b/src/t5/t5.hpp similarity index 97% rename from src/experimental/t5/xsk/t5.hpp rename to src/t5/t5.hpp index 3d2cf1e2..b2e34030 100644 --- a/src/experimental/t5/xsk/t5.hpp +++ b/src/t5/t5.hpp @@ -1,11 +1,12 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. #pragma once -#include "utils/xsk/utils.hpp" +#include "stdinc.hpp" +#include "gsc/context.hpp" namespace xsk::gsc::t5 { @@ -153,6 +154,4 @@ enum class opcode : std::uint8_t OP_count = 0x8A, }; -auto opcode_size(std::uint8_t id) -> std::uint32_t; - } // namespace xsk::gsc::t5 diff --git a/src/t6/xsk/assembler.cpp b/src/t6/assembler.cpp similarity index 99% rename from src/t6/xsk/assembler.cpp rename to src/t6/assembler.cpp index db748c1b..912cdc46 100644 --- a/src/t6/xsk/assembler.cpp +++ b/src/t6/assembler.cpp @@ -1,9 +1,9 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "stdinc.hpp" #include "t6.hpp" namespace xsk::arc::t6 @@ -16,7 +16,7 @@ auto assembler::output() -> std::vector if (script_ == nullptr) return output; output.resize(script_->pos()); - std::memcpy(output.data(), script_->buffer().data(), output.size()); + std::memcpy(output.data(), script_->data(), output.size()); return output; } @@ -28,7 +28,7 @@ void assembler::assemble(const std::string&, std::vector&) void assembler::assemble(const std::string& file, assembly::ptr& data) { - script_ = std::make_unique(0x100000); + script_ = std::make_unique(); filename_ = file; assembly_ = std::move(data); stringlist_.clear(); @@ -709,7 +709,7 @@ void assembler::process_string(const std::string& data) if (!stringlist_.contains(data)) { auto pos = static_cast(script_->pos()); - script_->write_c_string(data); + script_->write_cstr(data); stringlist_.insert({ data, pos }); } } diff --git a/src/t6/xsk/assembler.hpp b/src/t6/assembler.hpp similarity index 95% rename from src/t6/xsk/assembler.hpp rename to src/t6/assembler.hpp index e4b3dc78..d7ed3c3c 100644 --- a/src/t6/xsk/assembler.hpp +++ b/src/t6/assembler.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. @@ -11,7 +11,7 @@ namespace xsk::arc::t6 class assembler : public arc::assembler { std::string filename_; - utils::byte_buffer::ptr script_; + utils::writer::ptr script_; assembly::ptr assembly_; std::unordered_map labels_; std::unordered_map stringlist_; diff --git a/src/t6/xsk/compiler.cpp b/src/t6/compiler.cpp similarity index 99% rename from src/t6/xsk/compiler.cpp rename to src/t6/compiler.cpp index 07a16d57..d9c8134d 100644 --- a/src/t6/xsk/compiler.cpp +++ b/src/t6/compiler.cpp @@ -1,9 +1,9 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "stdinc.hpp" #include "t6.hpp" #include "parser.hpp" #include "lexer.hpp" @@ -18,7 +18,7 @@ auto compiler::output() -> assembly::ptr auto compiler::output_raw() -> std::vector { - output_ = std::make_unique(0x100000); + output_ = std::make_unique(); output_->write_string("// T6 GSC ASSEMBLY\n"); output_->write_string("// Compiled by https://github.com/xensik/gsc-tool\n"); @@ -31,7 +31,7 @@ auto compiler::output_raw() -> std::vector std::vector output; output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); + std::memcpy(output.data(), output_->data(), output.size()); return output; } diff --git a/src/t6/xsk/compiler.hpp b/src/t6/compiler.hpp similarity index 99% rename from src/t6/xsk/compiler.hpp rename to src/t6/compiler.hpp index 976134a0..0a34f6c3 100644 --- a/src/t6/xsk/compiler.hpp +++ b/src/t6/compiler.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. @@ -28,7 +28,7 @@ class compiler : public arc::compiler bool can_continue_; bool developer_thread_; build mode_; - utils::byte_buffer::ptr output_; + utils::writer::ptr output_; public: auto output() -> assembly::ptr; diff --git a/src/t6/xsk/context.cpp b/src/t6/context.cpp similarity index 83% rename from src/t6/xsk/context.cpp rename to src/t6/context.cpp index ec35fc2c..be3f90a2 100644 --- a/src/t6/xsk/context.cpp +++ b/src/t6/context.cpp @@ -1,9 +1,9 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "stdinc.hpp" #include "t6.hpp" namespace xsk::arc::t6 diff --git a/src/t6/xsk/context.hpp b/src/t6/context.hpp similarity index 93% rename from src/t6/xsk/context.hpp rename to src/t6/context.hpp index e951c758..1e2671ab 100644 --- a/src/t6/xsk/context.hpp +++ b/src/t6/context.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/t6/xsk/decompiler.cpp b/src/t6/decompiler.cpp similarity index 99% rename from src/t6/xsk/decompiler.cpp rename to src/t6/decompiler.cpp index 432579fe..db40a6f2 100644 --- a/src/t6/xsk/decompiler.cpp +++ b/src/t6/decompiler.cpp @@ -1,9 +1,9 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "stdinc.hpp" #include "t6.hpp" namespace xsk::arc::t6 @@ -13,13 +13,13 @@ auto decompiler::output() -> std::vector { std::vector output; - auto data = std::make_unique(0x100000); + auto data = std::make_unique(); data->write_string("// T6 GSC SOURCE\n"); data->write_string("// Decompiled by https://github.com/xensik/gsc-tool\n"); data->write_string(program_->print()); output.resize(data->pos()); - std::memcpy(output.data(), data->buffer().data(), output.size()); + std::memcpy(output.data(), data->data(), output.size()); return output; } diff --git a/src/t6/xsk/decompiler.hpp b/src/t6/decompiler.hpp similarity index 99% rename from src/t6/xsk/decompiler.hpp rename to src/t6/decompiler.hpp index f5fc1531..8624fe17 100644 --- a/src/t6/xsk/decompiler.hpp +++ b/src/t6/decompiler.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/t6/xsk/disassembler.cpp b/src/t6/disassembler.cpp similarity index 98% rename from src/t6/xsk/disassembler.cpp rename to src/t6/disassembler.cpp index bfa92591..c94bf69b 100644 --- a/src/t6/xsk/disassembler.cpp +++ b/src/t6/disassembler.cpp @@ -1,9 +1,9 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "stdinc.hpp" #include "t6.hpp" namespace xsk::arc::t6 @@ -16,7 +16,7 @@ auto disassembler::output() -> assembly::ptr auto disassembler::output_raw() -> std::vector { - output_ = std::make_unique(0x100000); + output_ = std::make_unique(); output_->write_string("// T6 GSC ASSEMBLY\n"); output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); @@ -29,7 +29,7 @@ auto disassembler::output_raw() -> std::vector std::vector output; output.resize(output_->pos()); - std::memcpy(output.data(), output_->buffer().data(), output.size()); + std::memcpy(output.data(), output_->data(), output.size()); return output; } @@ -37,7 +37,7 @@ auto disassembler::output_raw() -> std::vector void disassembler::disassemble(const std::string& file, std::vector& data) { filename_ = file; - script_ = std::make_unique(data); + script_ = std::make_unique(data); assembly_ = std::make_unique(); exports_.clear(); imports_.clear(); @@ -84,7 +84,7 @@ void disassembler::disassemble(const std::string& file, std::vectorpos() < header_.include_offset) { auto pos = script_->pos(); - stringlist_.insert({ pos, script_->read_c_string() }); + stringlist_.insert({ pos, script_->read_cstr() }); } // include list diff --git a/src/t6/xsk/disassembler.hpp b/src/t6/disassembler.hpp similarity index 93% rename from src/t6/xsk/disassembler.hpp rename to src/t6/disassembler.hpp index 06af722f..a1d41078 100644 --- a/src/t6/xsk/disassembler.hpp +++ b/src/t6/disassembler.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. @@ -11,8 +11,8 @@ namespace xsk::arc::t6 class disassembler : public arc::disassembler { std::string filename_; - utils::byte_buffer::ptr script_; - utils::byte_buffer::ptr output_; + utils::reader::ptr script_; + utils::writer::ptr output_; assembly::ptr assembly_; std::vector exports_; std::vector imports_; diff --git a/src/t6/xsk/lexer.cpp b/src/t6/lexer.cpp similarity index 99% rename from src/t6/xsk/lexer.cpp rename to src/t6/lexer.cpp index 7967aa0d..5a115a5c 100644 --- a/src/t6/xsk/lexer.cpp +++ b/src/t6/lexer.cpp @@ -1,9 +1,9 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "stdinc.hpp" #include "t6.hpp" #include "parser.hpp" #include "lexer.hpp" diff --git a/src/t6/xsk/lexer.hpp b/src/t6/lexer.hpp similarity index 96% rename from src/t6/xsk/lexer.hpp rename to src/t6/lexer.hpp index 4bf8a1c1..9e91634b 100644 --- a/src/t6/xsk/lexer.hpp +++ b/src/t6/lexer.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/t6/misc/arc.hpp b/src/t6/misc/arc.hpp new file mode 100644 index 00000000..8d0a3d59 --- /dev/null +++ b/src/t6/misc/arc.hpp @@ -0,0 +1,18 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "location.hpp" +#include "types.hpp" +#include "block.hpp" +#include "nodetree.hpp" + +#include "interfaces/exception.hpp" +#include "interfaces/assembler.hpp" +#include "interfaces/disassembler.hpp" +#include "interfaces/compiler.hpp" +#include "interfaces/decompiler.hpp" +#include "interfaces/context.hpp" diff --git a/src/utils/xsk/arc/block.hpp b/src/t6/misc/block.hpp similarity index 92% rename from src/utils/xsk/arc/block.hpp rename to src/t6/misc/block.hpp index ceae3da6..2143f7eb 100644 --- a/src/utils/xsk/arc/block.hpp +++ b/src/t6/misc/block.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/utils/xsk/arc/interfaces/assembler.hpp b/src/t6/misc/interfaces/assembler.hpp similarity index 91% rename from src/utils/xsk/arc/interfaces/assembler.hpp rename to src/t6/misc/interfaces/assembler.hpp index f4dabf31..a16f7b93 100644 --- a/src/utils/xsk/arc/interfaces/assembler.hpp +++ b/src/t6/misc/interfaces/assembler.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/utils/xsk/arc/interfaces/compiler.hpp b/src/t6/misc/interfaces/compiler.hpp similarity index 91% rename from src/utils/xsk/arc/interfaces/compiler.hpp rename to src/t6/misc/interfaces/compiler.hpp index fe5e0c14..8360bcc4 100644 --- a/src/utils/xsk/arc/interfaces/compiler.hpp +++ b/src/t6/misc/interfaces/compiler.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/utils/xsk/arc/interfaces/context.hpp b/src/t6/misc/interfaces/context.hpp similarity index 92% rename from src/utils/xsk/arc/interfaces/context.hpp rename to src/t6/misc/interfaces/context.hpp index 4abb3ea5..3981ca13 100644 --- a/src/utils/xsk/arc/interfaces/context.hpp +++ b/src/t6/misc/interfaces/context.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/utils/xsk/arc/interfaces/decompiler.hpp b/src/t6/misc/interfaces/decompiler.hpp similarity index 90% rename from src/utils/xsk/arc/interfaces/decompiler.hpp rename to src/t6/misc/interfaces/decompiler.hpp index c616b62f..777884b0 100644 --- a/src/utils/xsk/arc/interfaces/decompiler.hpp +++ b/src/t6/misc/interfaces/decompiler.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/utils/xsk/arc/interfaces/disassembler.hpp b/src/t6/misc/interfaces/disassembler.hpp similarity index 91% rename from src/utils/xsk/arc/interfaces/disassembler.hpp rename to src/t6/misc/interfaces/disassembler.hpp index 2f444fde..d8b8ccc1 100644 --- a/src/utils/xsk/arc/interfaces/disassembler.hpp +++ b/src/t6/misc/interfaces/disassembler.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/utils/xsk/arc/interfaces/exception.hpp b/src/t6/misc/interfaces/exception.hpp similarity index 95% rename from src/utils/xsk/arc/interfaces/exception.hpp rename to src/t6/misc/interfaces/exception.hpp index 75e67e83..4329d3b9 100644 --- a/src/utils/xsk/arc/interfaces/exception.hpp +++ b/src/t6/misc/interfaces/exception.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/utils/xsk/arc/location.hpp b/src/t6/misc/location.hpp similarity index 98% rename from src/utils/xsk/arc/location.hpp rename to src/t6/misc/location.hpp index 1a65b816..d16ba4ea 100644 --- a/src/utils/xsk/arc/location.hpp +++ b/src/t6/misc/location.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. @@ -158,7 +158,7 @@ public: auto label() const -> std::string { - return utils::string::va("loc_%X", begin.line); + return fmt::format("loc_{:X}", begin.line); } public: diff --git a/src/utils/xsk/arc/nodetree.cpp b/src/t6/misc/nodetree.cpp similarity index 99% rename from src/utils/xsk/arc/nodetree.cpp rename to src/t6/misc/nodetree.cpp index 04c02390..a5aef13d 100644 --- a/src/utils/xsk/arc/nodetree.cpp +++ b/src/t6/misc/nodetree.cpp @@ -1,9 +1,11 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "stdinc.hpp" +#include "arc.hpp" +#include "utils/string.hpp" namespace xsk::arc::ast { diff --git a/src/utils/xsk/arc/nodetree.hpp b/src/t6/misc/nodetree.hpp similarity index 99% rename from src/utils/xsk/arc/nodetree.hpp rename to src/t6/misc/nodetree.hpp index 285cd59b..50b56e2f 100644 --- a/src/utils/xsk/arc/nodetree.hpp +++ b/src/t6/misc/nodetree.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/utils/xsk/arc/types.hpp b/src/t6/misc/types.hpp similarity index 94% rename from src/utils/xsk/arc/types.hpp rename to src/t6/misc/types.hpp index f5b75606..d17a9ef2 100644 --- a/src/utils/xsk/arc/types.hpp +++ b/src/t6/misc/types.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/t6/xsk/parser.cpp b/src/t6/parser.cpp similarity index 97% rename from src/t6/xsk/parser.cpp rename to src/t6/parser.cpp index e3976898..d58e6c9b 100644 --- a/src/t6/xsk/parser.cpp +++ b/src/t6/parser.cpp @@ -36,12 +36,12 @@ // "%code top" blocks. #line 38 "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); + +#include "stdinc.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" @@ -2334,1585 +2334,1585 @@ namespace xsk { namespace arc { namespace t6 { switch (yyn) { case 2: // root: program -#line 296 "parser.ypp" +#line 295 "parser.ypp" { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } #line 2340 "parser.cpp" break; case 3: // root: %empty -#line 297 "parser.ypp" +#line 296 "parser.ypp" { ast = std::make_unique(yylhs.location); } #line 2346 "parser.cpp" break; case 4: // program: program inline -#line 302 "parser.ypp" +#line 301 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } #line 2352 "parser.cpp" break; case 5: // program: program include -#line 304 "parser.ypp" +#line 303 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2358 "parser.cpp" break; case 6: // program: program declaration -#line 306 "parser.ypp" +#line 305 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2364 "parser.cpp" break; case 7: // program: inline -#line 308 "parser.ypp" +#line 307 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } #line 2370 "parser.cpp" break; case 8: // program: include -#line 310 "parser.ypp" +#line 309 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2376 "parser.cpp" break; case 9: // program: declaration -#line 312 "parser.ypp" +#line 311 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2382 "parser.cpp" break; case 10: // inline: "#inline" expr_path ";" -#line 316 "parser.ypp" +#line 315 "parser.ypp" { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } #line 2388 "parser.cpp" break; case 11: // include: "#include" expr_path ";" -#line 321 "parser.ypp" +#line 320 "parser.ypp" { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } #line 2394 "parser.cpp" break; case 12: // declaration: "/#" -#line 325 "parser.ypp" +#line 324 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } #line 2400 "parser.cpp" break; case 13: // declaration: "#/" -#line 326 "parser.ypp" +#line 325 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } #line 2406 "parser.cpp" break; case 14: // declaration: decl_usingtree -#line 327 "parser.ypp" +#line 326 "parser.ypp" { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } #line 2412 "parser.cpp" break; case 15: // declaration: decl_thread -#line 328 "parser.ypp" +#line 327 "parser.ypp" { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } #line 2418 "parser.cpp" break; case 16: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 333 "parser.ypp" +#line 332 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_usingtree::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_string::ptr > ())); } #line 2424 "parser.cpp" break; case 17: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 338 "parser.ypp" +#line 337 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()), export_flags::export_none); } #line 2430 "parser.cpp" break; case 18: // decl_thread: "autoexec" expr_identifier "(" expr_parameters ")" stmt_block -#line 340 "parser.ypp" +#line 339 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()), export_flags::export_autoexec); } #line 2436 "parser.cpp" break; case 19: // decl_thread: "codecall" expr_identifier "(" expr_parameters ")" stmt_block -#line 342 "parser.ypp" +#line 341 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()), export_flags::export_codecall); } #line 2442 "parser.cpp" break; case 20: // decl_thread: "private" expr_identifier "(" expr_parameters ")" stmt_block -#line 344 "parser.ypp" +#line 343 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()), export_flags::export_private2); } #line 2448 "parser.cpp" break; case 21: // stmt: stmt_block -#line 348 "parser.ypp" +#line 347 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } #line 2454 "parser.cpp" break; case 22: // stmt: stmt_call -#line 349 "parser.ypp" +#line 348 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } #line 2460 "parser.cpp" break; case 23: // stmt: stmt_const -#line 350 "parser.ypp" +#line 349 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_const = std::move(yystack_[0].value.as < ast::stmt_const::ptr > ()); } #line 2466 "parser.cpp" break; case 24: // stmt: stmt_assign -#line 351 "parser.ypp" +#line 350 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } #line 2472 "parser.cpp" break; case 25: // stmt: stmt_endon -#line 352 "parser.ypp" +#line 351 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } #line 2478 "parser.cpp" break; case 26: // stmt: stmt_notify -#line 353 "parser.ypp" +#line 352 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } #line 2484 "parser.cpp" break; case 27: // stmt: stmt_wait -#line 354 "parser.ypp" +#line 353 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } #line 2490 "parser.cpp" break; case 28: // stmt: stmt_waittill -#line 355 "parser.ypp" +#line 354 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } #line 2496 "parser.cpp" break; case 29: // stmt: stmt_waittillmatch -#line 356 "parser.ypp" +#line 355 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } #line 2502 "parser.cpp" break; case 30: // stmt: stmt_waittillframeend -#line 357 "parser.ypp" +#line 356 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } #line 2508 "parser.cpp" break; case 31: // stmt: stmt_if -#line 358 "parser.ypp" +#line 357 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } #line 2514 "parser.cpp" break; case 32: // stmt: stmt_ifelse -#line 359 "parser.ypp" +#line 358 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } #line 2520 "parser.cpp" break; case 33: // stmt: stmt_while -#line 360 "parser.ypp" +#line 359 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } #line 2526 "parser.cpp" break; case 34: // stmt: stmt_dowhile -#line 361 "parser.ypp" +#line 360 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } #line 2532 "parser.cpp" break; case 35: // stmt: stmt_for -#line 362 "parser.ypp" +#line 361 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } #line 2538 "parser.cpp" break; case 36: // stmt: stmt_foreach -#line 363 "parser.ypp" +#line 362 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } #line 2544 "parser.cpp" break; case 37: // stmt: stmt_switch -#line 364 "parser.ypp" +#line 363 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } #line 2550 "parser.cpp" break; case 38: // stmt: stmt_case -#line 365 "parser.ypp" +#line 364 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } #line 2556 "parser.cpp" break; case 39: // stmt: stmt_default -#line 366 "parser.ypp" +#line 365 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } #line 2562 "parser.cpp" break; case 40: // stmt: stmt_break -#line 367 "parser.ypp" +#line 366 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } #line 2568 "parser.cpp" break; case 41: // stmt: stmt_continue -#line 368 "parser.ypp" +#line 367 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } #line 2574 "parser.cpp" break; case 42: // stmt: stmt_return -#line 369 "parser.ypp" +#line 368 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } #line 2580 "parser.cpp" break; case 43: // stmt: stmt_prof_begin -#line 370 "parser.ypp" +#line 369 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } #line 2586 "parser.cpp" break; case 44: // stmt: stmt_prof_end -#line 371 "parser.ypp" +#line 370 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } #line 2592 "parser.cpp" break; case 45: // stmt_or_dev: stmt -#line 375 "parser.ypp" +#line 374 "parser.ypp" { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } #line 2598 "parser.cpp" break; case 46: // stmt_or_dev: stmt_dev -#line 376 "parser.ypp" +#line 375 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } #line 2604 "parser.cpp" break; case 47: // stmt_list: stmt_list stmt -#line 381 "parser.ypp" +#line 380 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2610 "parser.cpp" break; case 48: // stmt_list: stmt -#line 383 "parser.ypp" +#line 382 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2616 "parser.cpp" break; case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 388 "parser.ypp" +#line 387 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2622 "parser.cpp" break; case 50: // stmt_or_dev_list: stmt_or_dev -#line 390 "parser.ypp" +#line 389 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2628 "parser.cpp" break; case 51: // stmt_dev: "/#" stmt_list "#/" -#line 394 "parser.ypp" +#line 393 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::stmt_list::ptr > ())); } #line 2634 "parser.cpp" break; case 52: // stmt_dev: "/#" "#/" -#line 395 "parser.ypp" +#line 394 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2640 "parser.cpp" break; case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 399 "parser.ypp" +#line 398 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } #line 2646 "parser.cpp" break; case 54: // stmt_block: "{" "}" -#line 400 "parser.ypp" +#line 399 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } #line 2652 "parser.cpp" break; case 55: // stmt_expr: expr_assign -#line 405 "parser.ypp" +#line 404 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2658 "parser.cpp" break; case 56: // stmt_expr: expr_increment -#line 407 "parser.ypp" +#line 406 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2664 "parser.cpp" break; case 57: // stmt_expr: expr_decrement -#line 409 "parser.ypp" +#line 408 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2670 "parser.cpp" break; case 58: // stmt_expr: %empty -#line 411 "parser.ypp" +#line 410 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2676 "parser.cpp" break; case 59: // stmt_call: expr_call ";" -#line 416 "parser.ypp" +#line 415 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_call::ptr > ()))); } #line 2682 "parser.cpp" break; case 60: // stmt_call: expr_method ";" -#line 418 "parser.ypp" +#line 417 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_method::ptr > ()))); } #line 2688 "parser.cpp" break; case 61: // stmt_const: "const" expr_identifier "=" expr ";" -#line 423 "parser.ypp" +#line 422 "parser.ypp" { yylhs.value.as < ast::stmt_const::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 2694 "parser.cpp" break; case 62: // stmt_assign: expr_assign ";" -#line 428 "parser.ypp" +#line 427 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2700 "parser.cpp" break; case 63: // stmt_assign: expr_increment ";" -#line 430 "parser.ypp" +#line 429 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2706 "parser.cpp" break; case 64: // stmt_assign: expr_decrement ";" -#line 432 "parser.ypp" +#line 431 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2712 "parser.cpp" break; case 65: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 437 "parser.ypp" +#line 436 "parser.ypp" { yylhs.value.as < ast::stmt_endon::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ())); } #line 2718 "parser.cpp" break; case 66: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 442 "parser.ypp" +#line 441 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2724 "parser.cpp" break; case 67: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 444 "parser.ypp" +#line 443 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2730 "parser.cpp" break; case 68: // stmt_wait: "wait" expr ";" -#line 449 "parser.ypp" +#line 448 "parser.ypp" { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2736 "parser.cpp" break; case 69: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 454 "parser.ypp" +#line 453 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2742 "parser.cpp" break; case 70: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 456 "parser.ypp" +#line 455 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2748 "parser.cpp" break; case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 461 "parser.ypp" +#line 460 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2754 "parser.cpp" break; case 72: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 463 "parser.ypp" +#line 462 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2760 "parser.cpp" break; case 73: // stmt_waittillframeend: "waittillframeend" ";" -#line 468 "parser.ypp" +#line 467 "parser.ypp" { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } #line 2766 "parser.cpp" break; case 74: // stmt_if: "if" "(" expr ")" stmt -#line 473 "parser.ypp" +#line 472 "parser.ypp" { yylhs.value.as < ast::stmt_if::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2772 "parser.cpp" break; case 75: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 478 "parser.ypp" +#line 477 "parser.ypp" { yylhs.value.as < ast::stmt_ifelse::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::stmt > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2778 "parser.cpp" break; case 76: // stmt_while: "while" "(" expr ")" stmt -#line 483 "parser.ypp" +#line 482 "parser.ypp" { yylhs.value.as < ast::stmt_while::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2784 "parser.cpp" break; case 77: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 488 "parser.ypp" +#line 487 "parser.ypp" { yylhs.value.as < ast::stmt_dowhile::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[5].value.as < ast::stmt > ())); } #line 2790 "parser.cpp" break; case 78: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 493 "parser.ypp" +#line 492 "parser.ypp" { yylhs.value.as < ast::stmt_for::ptr > () = std::make_unique(yylhs.location, ast::stmt(std::move(yystack_[6].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[4].value.as < ast::expr > ()), ast::stmt(std::move(yystack_[2].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2796 "parser.cpp" break; case 79: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 498 "parser.ypp" +#line 497 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2802 "parser.cpp" break; case 80: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 500 "parser.ypp" +#line 499 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[6].value.as < ast::expr_identifier::ptr > ())), ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2808 "parser.cpp" break; case 81: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 505 "parser.ypp" +#line 504 "parser.ypp" { yylhs.value.as < ast::stmt_switch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2814 "parser.cpp" break; case 82: // stmt_case: "case" expr_integer ":" -#line 510 "parser.ypp" +#line 509 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_integer::ptr > ())), std::make_unique(yylhs.location)); } #line 2820 "parser.cpp" break; case 83: // stmt_case: "case" expr_string ":" -#line 512 "parser.ypp" +#line 511 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_string::ptr > ())), std::make_unique(yylhs.location)); } #line 2826 "parser.cpp" break; case 84: // stmt_default: "default" ":" -#line 517 "parser.ypp" +#line 516 "parser.ypp" { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2832 "parser.cpp" break; case 85: // stmt_break: "break" ";" -#line 522 "parser.ypp" +#line 521 "parser.ypp" { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } #line 2838 "parser.cpp" break; case 86: // stmt_continue: "continue" ";" -#line 527 "parser.ypp" +#line 526 "parser.ypp" { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } #line 2844 "parser.cpp" break; case 87: // stmt_return: "return" expr ";" -#line 532 "parser.ypp" +#line 531 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2850 "parser.cpp" break; case 88: // stmt_return: "return" ";" -#line 534 "parser.ypp" +#line 533 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2856 "parser.cpp" break; case 89: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 539 "parser.ypp" +#line 538 "parser.ypp" { yylhs.value.as < ast::stmt_prof_begin::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2862 "parser.cpp" break; case 90: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 544 "parser.ypp" +#line 543 "parser.ypp" { yylhs.value.as < ast::stmt_prof_end::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2868 "parser.cpp" break; case 91: // expr: expr_ternary -#line 548 "parser.ypp" +#line 547 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2874 "parser.cpp" break; case 92: // expr: expr_binary -#line 549 "parser.ypp" +#line 548 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2880 "parser.cpp" break; case 93: // expr: expr_primitive -#line 550 "parser.ypp" +#line 549 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2886 "parser.cpp" break; case 94: // expr_or_empty: expr -#line 554 "parser.ypp" +#line 553 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2892 "parser.cpp" break; case 95: // expr_or_empty: %empty -#line 555 "parser.ypp" +#line 554 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } #line 2898 "parser.cpp" break; case 96: // expr_assign: expr_object "=" expr -#line 560 "parser.ypp" +#line 559 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2904 "parser.cpp" break; case 97: // expr_assign: expr_object "|=" expr -#line 562 "parser.ypp" +#line 561 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2910 "parser.cpp" break; case 98: // expr_assign: expr_object "&=" expr -#line 564 "parser.ypp" +#line 563 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2916 "parser.cpp" break; case 99: // expr_assign: expr_object "^=" expr -#line 566 "parser.ypp" +#line 565 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2922 "parser.cpp" break; case 100: // expr_assign: expr_object "<<=" expr -#line 568 "parser.ypp" +#line 567 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()),std::move( yystack_[0].value.as < ast::expr > ())); } #line 2928 "parser.cpp" break; case 101: // expr_assign: expr_object ">>=" expr -#line 570 "parser.ypp" +#line 569 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2934 "parser.cpp" break; case 102: // expr_assign: expr_object "+=" expr -#line 572 "parser.ypp" +#line 571 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2940 "parser.cpp" break; case 103: // expr_assign: expr_object "-=" expr -#line 574 "parser.ypp" +#line 573 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2946 "parser.cpp" break; case 104: // expr_assign: expr_object "*=" expr -#line 576 "parser.ypp" +#line 575 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2952 "parser.cpp" break; case 105: // expr_assign: expr_object "/=" expr -#line 578 "parser.ypp" +#line 577 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2958 "parser.cpp" break; case 106: // expr_assign: expr_object "%=" expr -#line 580 "parser.ypp" +#line 579 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2964 "parser.cpp" break; case 107: // expr_increment: "++" expr_object -#line 585 "parser.ypp" +#line 584 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2970 "parser.cpp" break; case 108: // expr_increment: expr_object "++" -#line 587 "parser.ypp" +#line 586 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2976 "parser.cpp" break; case 109: // expr_decrement: "--" expr_object -#line 592 "parser.ypp" +#line 591 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2982 "parser.cpp" break; case 110: // expr_decrement: expr_object "--" -#line 594 "parser.ypp" +#line 593 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2988 "parser.cpp" break; case 111: // expr_ternary: expr "?" expr ":" expr -#line 599 "parser.ypp" +#line 598 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2994 "parser.cpp" break; case 112: // expr_binary: expr "||" expr -#line 604 "parser.ypp" +#line 603 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3000 "parser.cpp" break; case 113: // expr_binary: expr "&&" expr -#line 606 "parser.ypp" +#line 605 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3006 "parser.cpp" break; case 114: // expr_binary: expr "==" expr -#line 608 "parser.ypp" +#line 607 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3012 "parser.cpp" break; case 115: // expr_binary: expr "!=" expr -#line 610 "parser.ypp" +#line 609 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3018 "parser.cpp" break; case 116: // expr_binary: expr "<=" expr -#line 612 "parser.ypp" +#line 611 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3024 "parser.cpp" break; case 117: // expr_binary: expr ">=" expr -#line 614 "parser.ypp" +#line 613 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3030 "parser.cpp" break; case 118: // expr_binary: expr "<" expr -#line 616 "parser.ypp" +#line 615 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3036 "parser.cpp" break; case 119: // expr_binary: expr ">" expr -#line 618 "parser.ypp" +#line 617 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3042 "parser.cpp" break; case 120: // expr_binary: expr "|" expr -#line 620 "parser.ypp" +#line 619 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3048 "parser.cpp" break; case 121: // expr_binary: expr "&" expr -#line 622 "parser.ypp" +#line 621 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3054 "parser.cpp" break; case 122: // expr_binary: expr "^" expr -#line 624 "parser.ypp" +#line 623 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3060 "parser.cpp" break; case 123: // expr_binary: expr "<<" expr -#line 626 "parser.ypp" +#line 625 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3066 "parser.cpp" break; case 124: // expr_binary: expr ">>" expr -#line 628 "parser.ypp" +#line 627 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3072 "parser.cpp" break; case 125: // expr_binary: expr "+" expr -#line 630 "parser.ypp" +#line 629 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3078 "parser.cpp" break; case 126: // expr_binary: expr "-" expr -#line 632 "parser.ypp" +#line 631 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3084 "parser.cpp" break; case 127: // expr_binary: expr "*" expr -#line 634 "parser.ypp" +#line 633 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3090 "parser.cpp" break; case 128: // expr_binary: expr "/" expr -#line 636 "parser.ypp" +#line 635 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3096 "parser.cpp" break; case 129: // expr_binary: expr "%" expr -#line 638 "parser.ypp" +#line 637 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3102 "parser.cpp" break; case 130: // expr_primitive: expr_complement -#line 642 "parser.ypp" +#line 641 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } #line 3108 "parser.cpp" break; case 131: // expr_primitive: expr_negate -#line 643 "parser.ypp" +#line 642 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } #line 3114 "parser.cpp" break; case 132: // expr_primitive: expr_not -#line 644 "parser.ypp" +#line 643 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } #line 3120 "parser.cpp" break; case 133: // expr_primitive: expr_call -#line 645 "parser.ypp" +#line 644 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3126 "parser.cpp" break; case 134: // expr_primitive: expr_method -#line 646 "parser.ypp" +#line 645 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3132 "parser.cpp" break; case 135: // expr_primitive: expr_getnextarraykey -#line 647 "parser.ypp" +#line 646 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getnextarraykey::ptr > ()); } #line 3138 "parser.cpp" break; case 136: // expr_primitive: expr_getfirstarraykey -#line 648 "parser.ypp" +#line 647 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getfirstarraykey::ptr > ()); } #line 3144 "parser.cpp" break; case 137: // expr_primitive: expr_getdvarcoloralpha -#line 649 "parser.ypp" +#line 648 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcoloralpha::ptr > ()); } #line 3150 "parser.cpp" break; case 138: // expr_primitive: expr_getdvarcolorblue -#line 650 "parser.ypp" +#line 649 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcolorblue::ptr > ()); } #line 3156 "parser.cpp" break; case 139: // expr_primitive: expr_getdvarcolorgreen -#line 651 "parser.ypp" +#line 650 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcolorgreen::ptr > ()); } #line 3162 "parser.cpp" break; case 140: // expr_primitive: expr_getdvarcolorred -#line 652 "parser.ypp" +#line 651 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcolorred::ptr > ()); } #line 3168 "parser.cpp" break; case 141: // expr_primitive: expr_getdvarvector -#line 653 "parser.ypp" +#line 652 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarvector::ptr > ()); } #line 3174 "parser.cpp" break; case 142: // expr_primitive: expr_getdvarfloat -#line 654 "parser.ypp" +#line 653 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarfloat::ptr > ()); } #line 3180 "parser.cpp" break; case 143: // expr_primitive: expr_getdvarint -#line 655 "parser.ypp" +#line 654 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarint::ptr > ()); } #line 3186 "parser.cpp" break; case 144: // expr_primitive: expr_getdvar -#line 656 "parser.ypp" +#line 655 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvar::ptr > ()); } #line 3192 "parser.cpp" break; case 145: // expr_primitive: expr_gettime -#line 657 "parser.ypp" +#line 656 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_gettime::ptr > ()); } #line 3198 "parser.cpp" break; case 146: // expr_primitive: expr_abs -#line 658 "parser.ypp" +#line 657 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_abs::ptr > ()); } #line 3204 "parser.cpp" break; case 147: // expr_primitive: expr_vectortoangles -#line 659 "parser.ypp" +#line 658 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vectortoangles::ptr > ()); } #line 3210 "parser.cpp" break; case 148: // expr_primitive: expr_angleclamp180 -#line 660 "parser.ypp" +#line 659 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_angleclamp180::ptr > ()); } #line 3216 "parser.cpp" break; case 149: // expr_primitive: expr_anglestoforward -#line 661 "parser.ypp" +#line 660 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anglestoforward::ptr > ()); } #line 3222 "parser.cpp" break; case 150: // expr_primitive: expr_anglestoright -#line 662 "parser.ypp" +#line 661 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anglestoright::ptr > ()); } #line 3228 "parser.cpp" break; case 151: // expr_primitive: expr_anglestoup -#line 663 "parser.ypp" +#line 662 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anglestoup::ptr > ()); } #line 3234 "parser.cpp" break; case 152: // expr_primitive: expr_vectorscale -#line 664 "parser.ypp" +#line 663 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vectorscale::ptr > ()); } #line 3240 "parser.cpp" break; case 153: // expr_primitive: expr_isdefined -#line 665 "parser.ypp" +#line 664 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_isdefined::ptr > ()); } #line 3246 "parser.cpp" break; case 154: // expr_primitive: expr_reference -#line 666 "parser.ypp" +#line 665 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } #line 3252 "parser.cpp" break; case 155: // expr_primitive: expr_array -#line 667 "parser.ypp" +#line 666 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3258 "parser.cpp" break; case 156: // expr_primitive: expr_field -#line 668 "parser.ypp" +#line 667 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3264 "parser.cpp" break; case 157: // expr_primitive: expr_size -#line 669 "parser.ypp" +#line 668 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } #line 3270 "parser.cpp" break; case 158: // expr_primitive: expr_paren -#line 670 "parser.ypp" +#line 669 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } #line 3276 "parser.cpp" break; case 159: // expr_primitive: expr_empty_array -#line 671 "parser.ypp" +#line 670 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } #line 3282 "parser.cpp" break; case 160: // expr_primitive: expr_undefined -#line 672 "parser.ypp" +#line 671 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } #line 3288 "parser.cpp" break; case 161: // expr_primitive: expr_game -#line 673 "parser.ypp" +#line 672 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3294 "parser.cpp" break; case 162: // expr_primitive: expr_self -#line 674 "parser.ypp" +#line 673 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3300 "parser.cpp" break; case 163: // expr_primitive: expr_anim -#line 675 "parser.ypp" +#line 674 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3306 "parser.cpp" break; case 164: // expr_primitive: expr_level -#line 676 "parser.ypp" +#line 675 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3312 "parser.cpp" break; case 165: // expr_primitive: expr_animation -#line 677 "parser.ypp" +#line 676 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } #line 3318 "parser.cpp" break; case 166: // expr_primitive: expr_animtree -#line 678 "parser.ypp" +#line 677 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } #line 3324 "parser.cpp" break; case 167: // expr_primitive: expr_identifier -#line 679 "parser.ypp" +#line 678 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3330 "parser.cpp" break; case 168: // expr_primitive: expr_istring -#line 680 "parser.ypp" +#line 679 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } #line 3336 "parser.cpp" break; case 169: // expr_primitive: expr_string -#line 681 "parser.ypp" +#line 680 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } #line 3342 "parser.cpp" break; case 170: // expr_primitive: expr_vector -#line 682 "parser.ypp" +#line 681 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } #line 3348 "parser.cpp" break; case 171: // expr_primitive: expr_hash -#line 683 "parser.ypp" +#line 682 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_hash::ptr > ()); } #line 3354 "parser.cpp" break; case 172: // expr_primitive: expr_float -#line 684 "parser.ypp" +#line 683 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } #line 3360 "parser.cpp" break; case 173: // expr_primitive: expr_integer -#line 685 "parser.ypp" +#line 684 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } #line 3366 "parser.cpp" break; case 174: // expr_primitive: expr_false -#line 686 "parser.ypp" +#line 685 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } #line 3372 "parser.cpp" break; case 175: // expr_primitive: expr_true -#line 687 "parser.ypp" +#line 686 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } #line 3378 "parser.cpp" break; case 176: // expr_complement: "~" expr -#line 692 "parser.ypp" +#line 691 "parser.ypp" { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 3384 "parser.cpp" break; case 177: // expr_negate: "-" expr_identifier -#line 697 "parser.ypp" +#line 696 "parser.ypp" { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } #line 3390 "parser.cpp" break; case 178: // expr_negate: "-" expr_paren -#line 699 "parser.ypp" +#line 698 "parser.ypp" { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } #line 3396 "parser.cpp" break; case 179: // expr_negate: "-" expr_array -#line 701 "parser.ypp" +#line 700 "parser.ypp" { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } #line 3402 "parser.cpp" break; case 180: // expr_negate: "-" expr_field -#line 703 "parser.ypp" +#line 702 "parser.ypp" { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } #line 3408 "parser.cpp" break; case 181: // expr_not: "!" expr -#line 708 "parser.ypp" +#line 707 "parser.ypp" { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 3414 "parser.cpp" break; case 182: // expr_call: expr_function -#line 712 "parser.ypp" +#line 711 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 3420 "parser.cpp" break; case 183: // expr_call: expr_pointer -#line 713 "parser.ypp" +#line 712 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 3426 "parser.cpp" break; case 184: // expr_method: expr_object expr_function -#line 716 "parser.ypp" +#line 715 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 3432 "parser.cpp" break; case 185: // expr_method: expr_object expr_pointer -#line 717 "parser.ypp" +#line 716 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 3438 "parser.cpp" break; case 186: // expr_function: expr_identifier "(" expr_arguments ")" -#line 722 "parser.ypp" +#line 721 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3444 "parser.cpp" break; case 187: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 724 "parser.ypp" +#line 723 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3450 "parser.cpp" break; case 188: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 726 "parser.ypp" +#line 725 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3456 "parser.cpp" break; case 189: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 728 "parser.ypp" +#line 727 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3462 "parser.cpp" break; case 190: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 733 "parser.ypp" +#line 732 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3468 "parser.cpp" break; case 191: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 735 "parser.ypp" +#line 734 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3474 "parser.cpp" break; case 192: // expr_parameters: expr_parameters "," expr_parameters_default -#line 740 "parser.ypp" +#line 739 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3480 "parser.cpp" break; case 193: // expr_parameters: expr_parameters "," expr_identifier -#line 742 "parser.ypp" +#line 741 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } #line 3486 "parser.cpp" break; case 194: // expr_parameters: expr_parameters_default -#line 744 "parser.ypp" +#line 743 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3492 "parser.cpp" break; case 195: // expr_parameters: expr_identifier -#line 746 "parser.ypp" +#line 745 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } #line 3498 "parser.cpp" break; case 196: // expr_parameters: %empty -#line 748 "parser.ypp" +#line 747 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } #line 3504 "parser.cpp" break; case 197: // expr_parameters_default: expr_identifier "=" expr -#line 753 "parser.ypp" +#line 752 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[2].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3510 "parser.cpp" break; case 198: // expr_arguments: expr_arguments_no_empty -#line 767 "parser.ypp" +#line 757 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } #line 3516 "parser.cpp" break; case 199: // expr_arguments: %empty -#line 769 "parser.ypp" +#line 759 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } #line 3522 "parser.cpp" break; case 200: // expr_arguments_no_empty: expr_arguments "," expr -#line 774 "parser.ypp" +#line 764 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ()); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3528 "parser.cpp" break; case 201: // expr_arguments_no_empty: expr -#line 776 "parser.ypp" +#line 766 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3534 "parser.cpp" break; case 202: // expr_getnextarraykey: "getnextarraykey" "(" expr "," expr ")" -#line 781 "parser.ypp" +#line 771 "parser.ypp" { yylhs.value.as < ast::expr_getnextarraykey::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3540 "parser.cpp" break; case 203: // expr_getfirstarraykey: "getfirstarraykey" "(" expr ")" -#line 786 "parser.ypp" +#line 776 "parser.ypp" { yylhs.value.as < ast::expr_getfirstarraykey::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3546 "parser.cpp" break; case 204: // expr_getdvarcoloralpha: "getdvarcoloralpha" "(" expr ")" -#line 791 "parser.ypp" +#line 781 "parser.ypp" { yylhs.value.as < ast::expr_getdvarcoloralpha::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3552 "parser.cpp" break; case 205: // expr_getdvarcolorblue: "getdvarcolorblue" "(" expr ")" -#line 796 "parser.ypp" +#line 786 "parser.ypp" { yylhs.value.as < ast::expr_getdvarcolorblue::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3558 "parser.cpp" break; case 206: // expr_getdvarcolorgreen: "getdvarcolorgreen" "(" expr ")" -#line 801 "parser.ypp" +#line 791 "parser.ypp" { yylhs.value.as < ast::expr_getdvarcolorgreen::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3564 "parser.cpp" break; case 207: // expr_getdvarcolorred: "getdvarcolorred" "(" expr ")" -#line 806 "parser.ypp" +#line 796 "parser.ypp" { yylhs.value.as < ast::expr_getdvarcolorred::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3570 "parser.cpp" break; case 208: // expr_getdvarvector: "getdvarvector" "(" expr ")" -#line 811 "parser.ypp" +#line 801 "parser.ypp" { yylhs.value.as < ast::expr_getdvarvector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3576 "parser.cpp" break; case 209: // expr_getdvarfloat: "getdvarfloat" "(" expr ")" -#line 816 "parser.ypp" +#line 806 "parser.ypp" { yylhs.value.as < ast::expr_getdvarfloat::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3582 "parser.cpp" break; case 210: // expr_getdvarint: "getdvarint" "(" expr ")" -#line 821 "parser.ypp" +#line 811 "parser.ypp" { yylhs.value.as < ast::expr_getdvarint::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3588 "parser.cpp" break; case 211: // expr_getdvar: "getdvar" "(" expr ")" -#line 826 "parser.ypp" +#line 816 "parser.ypp" { yylhs.value.as < ast::expr_getdvar::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3594 "parser.cpp" break; case 212: // expr_gettime: "gettime" "(" ")" -#line 831 "parser.ypp" +#line 821 "parser.ypp" { yylhs.value.as < ast::expr_gettime::ptr > () = std::make_unique(yylhs.location); } #line 3600 "parser.cpp" break; case 213: // expr_abs: "abs" "(" expr ")" -#line 836 "parser.ypp" +#line 826 "parser.ypp" { yylhs.value.as < ast::expr_abs::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3606 "parser.cpp" break; case 214: // expr_vectortoangles: "vectortoangles" "(" expr ")" -#line 841 "parser.ypp" +#line 831 "parser.ypp" { yylhs.value.as < ast::expr_vectortoangles::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3612 "parser.cpp" break; case 215: // expr_angleclamp180: "angleclamp180" "(" expr ")" -#line 846 "parser.ypp" +#line 836 "parser.ypp" { yylhs.value.as < ast::expr_angleclamp180::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3618 "parser.cpp" break; case 216: // expr_anglestoforward: "anglestoforward" "(" expr ")" -#line 851 "parser.ypp" +#line 841 "parser.ypp" { yylhs.value.as < ast::expr_anglestoforward::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3624 "parser.cpp" break; case 217: // expr_anglestoright: "anglestoright" "(" expr ")" -#line 856 "parser.ypp" +#line 846 "parser.ypp" { yylhs.value.as < ast::expr_anglestoright::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3630 "parser.cpp" break; case 218: // expr_anglestoup: "anglestoup" "(" expr ")" -#line 861 "parser.ypp" +#line 851 "parser.ypp" { yylhs.value.as < ast::expr_anglestoup::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3636 "parser.cpp" break; case 219: // expr_vectorscale: "vectorscale" "(" expr "," expr ")" -#line 866 "parser.ypp" +#line 856 "parser.ypp" { yylhs.value.as < ast::expr_vectorscale::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3642 "parser.cpp" break; case 220: // expr_isdefined: "isdefined" "(" expr ")" -#line 871 "parser.ypp" +#line 861 "parser.ypp" { yylhs.value.as < ast::expr_isdefined::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3648 "parser.cpp" break; case 221: // expr_reference: "::" expr_identifier -#line 876 "parser.ypp" +#line 866 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3654 "parser.cpp" break; case 222: // expr_reference: expr_path "::" expr_identifier -#line 878 "parser.ypp" +#line 868 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_path::ptr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3660 "parser.cpp" break; case 223: // expr_array: expr_object "[" expr "]" -#line 883 "parser.ypp" +#line 873 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3666 "parser.cpp" break; case 224: // expr_array: expr_getdvarvector "[" expr "]" -#line 885 "parser.ypp" +#line 875 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_getdvarvector::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3672 "parser.cpp" break; case 225: // expr_array: expr_vectortoangles "[" expr "]" -#line 887 "parser.ypp" +#line 877 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_vectortoangles::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3678 "parser.cpp" break; case 226: // expr_array: expr_angleclamp180 "[" expr "]" -#line 889 "parser.ypp" +#line 879 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_angleclamp180::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3684 "parser.cpp" break; case 227: // expr_array: expr_anglestoforward "[" expr "]" -#line 891 "parser.ypp" +#line 881 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_anglestoforward::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3690 "parser.cpp" break; case 228: // expr_array: expr_anglestoright "[" expr "]" -#line 893 "parser.ypp" +#line 883 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_anglestoright::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3696 "parser.cpp" break; case 229: // expr_array: expr_anglestoup "[" expr "]" -#line 895 "parser.ypp" +#line 885 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_anglestoup::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3702 "parser.cpp" break; case 230: // expr_array: expr_vectorscale "[" expr "]" -#line 897 "parser.ypp" +#line 887 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_vectorscale::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3708 "parser.cpp" break; case 231: // expr_field: expr_object "." expr_identifier_nosize -#line 902 "parser.ypp" +#line 892 "parser.ypp" { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3714 "parser.cpp" break; case 232: // expr_size: expr_object "." "size" -#line 907 "parser.ypp" +#line 897 "parser.ypp" { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } #line 3720 "parser.cpp" break; case 233: // expr_paren: "(" expr ")" -#line 912 "parser.ypp" +#line 902 "parser.ypp" { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3726 "parser.cpp" break; case 234: // expr_object: expr_call -#line 916 "parser.ypp" +#line 906 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3732 "parser.cpp" break; case 235: // expr_object: expr_method -#line 917 "parser.ypp" +#line 907 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3738 "parser.cpp" break; case 236: // expr_object: expr_array -#line 918 "parser.ypp" +#line 908 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3744 "parser.cpp" break; case 237: // expr_object: expr_field -#line 919 "parser.ypp" +#line 909 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3750 "parser.cpp" break; case 238: // expr_object: expr_game -#line 920 "parser.ypp" +#line 910 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3756 "parser.cpp" break; case 239: // expr_object: expr_self -#line 921 "parser.ypp" +#line 911 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3762 "parser.cpp" break; case 240: // expr_object: expr_anim -#line 922 "parser.ypp" +#line 912 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3768 "parser.cpp" break; case 241: // expr_object: expr_level -#line 923 "parser.ypp" +#line 913 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3774 "parser.cpp" break; case 242: // expr_object: expr_identifier -#line 924 "parser.ypp" +#line 914 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3780 "parser.cpp" break; case 243: // expr_empty_array: "[" "]" -#line 929 "parser.ypp" +#line 919 "parser.ypp" { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } #line 3786 "parser.cpp" break; case 244: // expr_undefined: "undefined" -#line 934 "parser.ypp" +#line 924 "parser.ypp" { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } #line 3792 "parser.cpp" break; case 245: // expr_game: "game" -#line 939 "parser.ypp" +#line 929 "parser.ypp" { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } #line 3798 "parser.cpp" break; case 246: // expr_self: "self" -#line 944 "parser.ypp" +#line 934 "parser.ypp" { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } #line 3804 "parser.cpp" break; case 247: // expr_anim: "anim" -#line 949 "parser.ypp" +#line 939 "parser.ypp" { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } #line 3810 "parser.cpp" break; case 248: // expr_level: "level" -#line 954 "parser.ypp" +#line 944 "parser.ypp" { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } #line 3816 "parser.cpp" break; case 249: // expr_animation: "%" "identifier" -#line 959 "parser.ypp" +#line 949 "parser.ypp" { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3822 "parser.cpp" break; case 250: // expr_animtree: "#animtree" -#line 964 "parser.ypp" +#line 954 "parser.ypp" { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } #line 3828 "parser.cpp" break; case 251: // expr_identifier_nosize: "identifier" -#line 969 "parser.ypp" +#line 959 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3834 "parser.cpp" break; case 252: // expr_identifier: "identifier" -#line 974 "parser.ypp" +#line 964 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3840 "parser.cpp" break; case 253: // expr_identifier: "size" -#line 976 "parser.ypp" +#line 966 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } #line 3846 "parser.cpp" break; case 254: // expr_path: "identifier" -#line 981 "parser.ypp" +#line 971 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3852 "parser.cpp" break; case 255: // expr_path: "path" -#line 983 "parser.ypp" +#line 973 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3858 "parser.cpp" break; case 256: // expr_istring: "localized string" -#line 988 "parser.ypp" +#line 978 "parser.ypp" { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3864 "parser.cpp" break; case 257: // expr_string: "string literal" -#line 993 "parser.ypp" +#line 983 "parser.ypp" { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3870 "parser.cpp" break; case 258: // expr_vector: "(" expr "," expr "," expr ")" -#line 998 "parser.ypp" +#line 988 "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 3876 "parser.cpp" break; case 259: // expr_hash: "hash" -#line 1003 "parser.ypp" +#line 993 "parser.ypp" { yylhs.value.as < ast::expr_hash::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3882 "parser.cpp" break; case 260: // expr_float: "-" "float" -#line 1008 "parser.ypp" +#line 998 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3888 "parser.cpp" break; case 261: // expr_float: "float" -#line 1010 "parser.ypp" +#line 1000 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3894 "parser.cpp" break; case 262: // expr_integer: "-" "integer" -#line 1015 "parser.ypp" +#line 1005 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3900 "parser.cpp" break; case 263: // expr_integer: "integer" -#line 1017 "parser.ypp" +#line 1007 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3906 "parser.cpp" break; case 264: // expr_false: "false" -#line 1022 "parser.ypp" +#line 1012 "parser.ypp" { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } #line 3912 "parser.cpp" break; case 265: // expr_true: "true" -#line 1027 "parser.ypp" +#line 1017 "parser.ypp" { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } #line 3918 "parser.cpp" break; @@ -5432,33 +5432,33 @@ namespace xsk { namespace arc { namespace t6 { const short parser::yyrline_[] = { - 0, 296, 296, 297, 301, 303, 305, 307, 309, 311, - 316, 320, 325, 326, 327, 328, 332, 337, 339, 341, - 343, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 375, 376, 380, 382, 387, - 389, 394, 395, 399, 400, 404, 406, 408, 411, 415, - 417, 422, 427, 429, 431, 436, 441, 443, 448, 453, - 455, 460, 462, 467, 472, 477, 482, 487, 492, 497, - 499, 504, 509, 511, 516, 521, 526, 531, 533, 538, - 543, 548, 549, 550, 554, 555, 559, 561, 563, 565, - 567, 569, 571, 573, 575, 577, 579, 584, 586, 591, - 593, 598, 603, 605, 607, 609, 611, 613, 615, 617, - 619, 621, 623, 625, 627, 629, 631, 633, 635, 637, - 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, - 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, - 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, - 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, - 682, 683, 684, 685, 686, 687, 691, 696, 698, 700, - 702, 707, 712, 713, 716, 717, 721, 723, 725, 727, - 732, 734, 739, 741, 743, 745, 748, 752, 766, 769, - 773, 775, 780, 785, 790, 795, 800, 805, 810, 815, - 820, 825, 830, 835, 840, 845, 850, 855, 860, 865, - 870, 875, 877, 882, 884, 886, 888, 890, 892, 894, - 896, 901, 906, 911, 916, 917, 918, 919, 920, 921, - 922, 923, 924, 928, 933, 938, 943, 948, 953, 958, - 963, 968, 973, 975, 980, 982, 987, 992, 997, 1002, - 1007, 1009, 1014, 1016, 1021, 1026 + 0, 295, 295, 296, 300, 302, 304, 306, 308, 310, + 315, 319, 324, 325, 326, 327, 331, 336, 338, 340, + 342, 347, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 374, 375, 379, 381, 386, + 388, 393, 394, 398, 399, 403, 405, 407, 410, 414, + 416, 421, 426, 428, 430, 435, 440, 442, 447, 452, + 454, 459, 461, 466, 471, 476, 481, 486, 491, 496, + 498, 503, 508, 510, 515, 520, 525, 530, 532, 537, + 542, 547, 548, 549, 553, 554, 558, 560, 562, 564, + 566, 568, 570, 572, 574, 576, 578, 583, 585, 590, + 592, 597, 602, 604, 606, 608, 610, 612, 614, 616, + 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, + 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, + 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, + 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 690, 695, 697, 699, + 701, 706, 711, 712, 715, 716, 720, 722, 724, 726, + 731, 733, 738, 740, 742, 744, 747, 751, 756, 759, + 763, 765, 770, 775, 780, 785, 790, 795, 800, 805, + 810, 815, 820, 825, 830, 835, 840, 845, 850, 855, + 860, 865, 867, 872, 874, 876, 878, 880, 882, 884, + 886, 891, 896, 901, 906, 907, 908, 909, 910, 911, + 912, 913, 914, 918, 923, 928, 933, 938, 943, 948, + 953, 958, 963, 965, 970, 972, 977, 982, 987, 992, + 997, 999, 1004, 1006, 1011, 1016 }; void @@ -5493,10 +5493,10 @@ namespace xsk { namespace arc { namespace t6 { } } } // xsk::arc::t6 #line 5495 "parser.cpp" -#line 1030 "parser.ypp" - - -void xsk::arc::t6::parser::error(const xsk::arc::location& loc, const std::string& msg) -{ - throw xsk::arc::comp_error(loc, msg); -} +#line 1020 "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/parser.hpp similarity index 100% rename from src/t6/xsk/parser.hpp rename to src/t6/parser.hpp diff --git a/src/t6/xsk/resolver.cpp b/src/t6/resolver.cpp similarity index 99% rename from src/t6/xsk/resolver.cpp rename to src/t6/resolver.cpp index 8f01cffe..4247bd56 100644 --- a/src/t6/xsk/resolver.cpp +++ b/src/t6/resolver.cpp @@ -1,9 +1,9 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "stdinc.hpp" #include "t6.hpp" #ifdef _MSC_VER diff --git a/src/t6/xsk/resolver.hpp b/src/t6/resolver.hpp similarity index 93% rename from src/t6/xsk/resolver.hpp rename to src/t6/resolver.hpp index 3bb44bcf..70d8e9e9 100644 --- a/src/t6/xsk/resolver.hpp +++ b/src/t6/resolver.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. diff --git a/src/t6/stdafx.cpp b/src/t6/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/t6/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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 deleted file mode 100644 index 19f22f43..00000000 --- a/src/t6/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/t6/xsk/t6.cpp b/src/t6/t6.cpp similarity index 98% rename from src/t6/xsk/t6.cpp rename to src/t6/t6.cpp index 738d4d16..3272518e 100644 --- a/src/t6/xsk/t6.cpp +++ b/src/t6/t6.cpp @@ -1,9 +1,9 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "stdinc.hpp" #include "t6.hpp" namespace xsk::arc::t6 diff --git a/src/t6/xsk/t6.hpp b/src/t6/t6.hpp similarity index 96% rename from src/t6/xsk/t6.hpp rename to src/t6/t6.hpp index 938f30a2..1739836b 100644 --- a/src/t6/xsk/t6.hpp +++ b/src/t6/t6.hpp @@ -1,12 +1,14 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. #pragma once -#include "utils/xsk/utils.hpp" - +#include "utils/string.hpp" +#include "utils/reader.hpp" +#include "utils/writer.hpp" +#include "misc/arc.hpp" #include "assembler.hpp" #include "disassembler.hpp" #include "compiler.hpp" diff --git a/src/tool/main.cpp b/src/tool/main.cpp new file mode 100644 index 00000000..28acf358 --- /dev/null +++ b/src/tool/main.cpp @@ -0,0 +1,809 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "utils/zlib.hpp" +#include "utils/file.hpp" +#include "utils/string.hpp" +#include "iw5/iw5_pc.hpp" +#include "iw5/iw5_ps.hpp" +#include "iw5/iw5_xb.hpp" +#include "iw6/iw6_pc.hpp" +#include "iw6/iw6_ps.hpp" +#include "iw6/iw6_xb.hpp" +#include "iw7/iw7.hpp" +#include "iw8/iw8.hpp" +#include "iw9/iw9.hpp" +#include "s1/s1_pc.hpp" +#include "s1/s1_ps.hpp" +#include "s1/s1_xb.hpp" +#include "s2/s2.hpp" +#include "s4/s4.hpp" +#include "h1/h1.hpp" +#include "h2/h2.hpp" +#include "t6/t6.hpp" + +namespace fs = std::filesystem; + +namespace xsk +{ + +enum class encd { _, source, assembly, binary }; +enum class mode { _, assemble, disassemble, compile, decompile }; +enum class game { _, iw5ps, iw5xb, iw6ps, iw6xb, s1ps, s1xb, iw5, iw6, iw7, iw8, iw9, s1, s2, s4, h1, h2, t6 }; + +std::unordered_map const exts = +{ + { ".gsc", encd::source }, + { ".cgsc", encd::binary }, + { ".gscbin", encd::binary }, + { ".gscasm", encd::assembly }, +}; + +std::unordered_map const modes = +{ + { "asm", mode::assemble }, + { "disasm", mode::disassemble }, + { "comp", mode::compile }, + { "decomp", mode::decompile }, +}; + +std::unordered_map const games = +{ + { "iw5ps", game::iw5ps }, + { "iw5xb", game::iw5xb }, + { "iw6ps", game::iw6ps }, + { "iw6xb", game::iw6xb }, + { "s1ps", game::s1ps }, + { "s1xb", game::s1xb }, + { "iw5", game::iw5 }, + { "iw6", game::iw6 }, + { "iw7", game::iw7 }, + { "iw8", game::iw8 }, + { "iw9", game::iw9 }, + { "s1", game::s1 }, + { "s2", game::s2 }, + { "s4", game::s4 }, + { "h1", game::h1 }, + { "h2", game::h2 }, + { "t6", game::t6 }, +}; + +std::map const games_rev = +{ + { game::iw5ps, "iw5ps", }, + { game::iw5xb, "iw5xb" }, + { game::iw6ps, "iw6ps" }, + { game::iw6xb, "iw6xb" }, + { game::s1ps, "s1ps" }, + { game::s1xb, "s1xb" }, + { game::iw5, "iw5" }, + { game::iw6, "iw6" }, + { game::iw7, "iw7" }, + { game::iw8, "iw8" }, + { game::iw9, "iw9" }, + { game::s1, "s1" }, + { game::s2, "s2" }, + { game::s4, "s4" }, + { game::h1, "h1" }, + { game::h2, "h2" }, + { game::t6, "t6" }, +}; + +std::map const encds = +{ + { mode::assemble , encd::assembly }, + { mode::disassemble, encd::binary }, + { mode::compile, encd::source }, + { mode::decompile, encd::binary }, +}; + +auto overwrite_prompt(std::string const& file) -> bool +{ + auto overwrite = true; + + if (utils::file::exists(file)) + { + do + { + std::cout << "File \"" << file << "\" already exists, overwrite? [Y/n]: "; + auto result = std::getchar(); + + if (result == '\n' || result == 'Y' || result == 'y') + { + break; + } + else if (result == 'N' || result == 'n') + { + overwrite = false; + break; + } + } while (true); + } + + return overwrite; +} + +namespace gsc +{ + +std::map> contexts; +std::map> funcs; +bool zonetool = false; + +/*auto choose_resolver_file_name(uint32_t id, game& game) -> std::string +{ + switch (game) + { + // case game::iw5c: + // return iw5c::resolver::token_name(static_cast(id)); + // case game::iw6c: + // return iw6c::resolver::token_name(static_cast(id)); + // case game::s1c: + // return s1c::resolver::token_name(static_cast(id)); + // case game::iw5: + // return iw5::resolver::token_name(static_cast(id)); + // case game::iw6: + // return iw6::resolver::token_name(static_cast(id)); + // case game::iw7: + // return iw7::resolver::token_name(id); + // case game::iw8: + // return iw8::resolver::token_name(id); + // case game::s1: + // return s1::resolver::token_name(static_cast(id)); + // case game::s2: + // return s2::resolver::token_name(static_cast(id)); + // case game::s4: + // return s4::resolver::token_name(id); + // case game::h1: + // return h1::resolver::token_name(static_cast(id)); + // case game::h2: + // return h2::resolver::token_name(static_cast(id)); + default: + return ""; + } +}*/ + +auto assemble_file(game game, fs::path file, fs::path rel) -> void +{ + try + { + if (file.extension() != ".gscasm") + throw std::runtime_error("expected .gscasm file"); + + rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension((zonetool ? ".cgsc" : ".gscbin")); + + auto data = utils::file::read(file); + auto outasm = contexts[game]->source().parse_assembly(data); + auto outbin = contexts[game]->assembler().assemble(*outasm); + + if (true/*overwrite_prompt(file + (zonetool ? ".cgsc" : ".gscbin"))*/) + { + if (zonetool) + { + auto path = fs::path{ "compiled" } / rel; + utils::file::save(path, outbin.first.data, outbin.first.size); + utils::file::save(path.replace_extension(".cgsc.stack"), outbin.second.data, outbin.second.size); + fmt::print("compiled {}\n", rel.generic_string()); + } + else + { + asset script; + script.name = "GSC"s; + + script.bytecode.resize(outbin.first.size); + std::memcpy(script.bytecode.data(), outbin.first.data, script.bytecode.size()); + + script.buffer.resize(outbin.second.size); + std::memcpy(script.buffer.data(), outbin.second.data, script.buffer.size()); + script.buffer = utils::zlib::compress(script.buffer); + + script.len = static_cast(outbin.second.size); + script.compressedLen = static_cast(script.buffer.size()); + script.bytecodeLen = static_cast(script.bytecode.size()); + + auto result = script.serialize(); + utils::file::save(fs::path{ "compiled" } / rel, result); + fmt::print("compiled {}\n", rel.generic_string()); + } + } + } + catch (std::exception const& e) + { + std::cerr << fmt::format("{} at {}\n", e.what(), file.generic_string()); + } +} + +auto disassemble_file(game game, fs::path file, fs::path rel) -> void +{ + try + { + auto script = std::vector{}; + auto stack = std::vector{}; + + if (zonetool) + { + if (file.extension() != ".cgsc") + throw std::runtime_error("expected .cgsc file"); + + auto fbuf = file; + rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension(".gsc"); + + script = utils::file::read(file); + stack = utils::file::read(fbuf.replace_extension(".cgsc.stack")); + } + else + { + if (file.extension() != ".gscbin") + throw std::runtime_error("expected .gscbin file"); + + rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension(".gscasm"); + + auto data = utils::file::read(file); + + asset asset; + asset.deserialize(data); + + script = std::move(asset.bytecode); + stack = utils::zlib::decompress(asset.buffer, asset.len); + } + + auto outasm = contexts[game]->disassembler().disassemble(script, stack); + auto outsrc = contexts[game]->source().dump(*outasm); + + utils::file::save(fs::path{ "disassembled" } / rel, outsrc); + fmt::print("disassembled {}\n", rel.generic_string()); + } + catch (std::exception const& e) + { + std::cerr << fmt::format("{} at {}\n", e.what(), file.generic_string()); + } +} + +auto compile_file(game game, fs::path file, fs::path rel) -> void +{ + try + { + if (file.extension() != ".gsc") + throw std::runtime_error("expected .gsc file"); + + rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension((zonetool ? ".cgsc" : ".gscbin")); + + auto data = utils::file::read(file); + auto outasm = contexts[game]->compiler().compile(file.string(), data); + auto outbin = contexts[game]->assembler().assemble(*outasm); + + if (true/*overwrite_prompt(file + (zonetool ? ".cgsc" : ".gscbin"))*/) + { + if (zonetool) + { + auto path = fs::path{ "compiled" } / rel; + utils::file::save(path, outbin.first.data, outbin.first.size); + utils::file::save(path.replace_extension(".cgsc.stack"), outbin.second.data, outbin.second.size); + fmt::print("compiled {}\n", rel.generic_string()); + } + else + { + asset script; + script.name = "GSC"s; + + script.bytecode.resize(outbin.first.size); + std::memcpy(script.bytecode.data(), outbin.first.data, script.bytecode.size()); + + script.buffer.resize(outbin.second.size); + std::memcpy(script.buffer.data(), outbin.second.data, script.buffer.size()); + script.buffer = utils::zlib::compress(script.buffer); + + script.len = static_cast(outbin.second.size); + script.compressedLen = static_cast(script.buffer.size()); + script.bytecodeLen = static_cast(script.bytecode.size()); + + auto result = script.serialize(); + utils::file::save(fs::path{ "compiled" } / rel, result); + fmt::print("compiled {}\n", rel.generic_string()); + } + } + } + catch (std::exception const& e) + { + std::cerr << fmt::format("{} at {}\n", e.what(), file.generic_string()); + } +} + +auto decompile_file(game game, fs::path file, fs::path rel) -> void +{ + try + { + auto script = std::vector{}; + auto stack = std::vector{}; + + if (zonetool) + { + if (file.extension() != ".cgsc") + throw std::runtime_error("expected .cgsc file"); + + auto fbuf = file; + rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension(".gsc"); + + script = utils::file::read(file); + stack = utils::file::read(fbuf.replace_extension(".cgsc.stack")); + } + else + { + if (file.extension() != ".gscbin") + throw std::runtime_error("expected .gscbin file"); + + rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension(".gsc"); + + auto data = utils::file::read(file); + + asset asset; + asset.deserialize(data); + + script = std::move(asset.bytecode); + stack = utils::zlib::decompress(asset.buffer, asset.len); + } + + auto outasm = contexts[game]->disassembler().disassemble(script, stack); + auto outast = contexts[game]->decompiler().decompile(*outasm); + auto outsrc = contexts[game]->source().dump(*outast); + + utils::file::save(fs::path{ "decompiled" } / rel, outsrc); + fmt::print("decompiled {}\n", rel.generic_string()); + } + catch (std::exception const& e) + { + std::cerr << fmt::format("{} at {}\n", e.what(), file.generic_string()); + } +} + +std::unordered_map> files; + +auto read_file_cb(std::string const& name) -> std::pair +{ + auto data = utils::file::read(fs::path{ name }); + + if(name.ends_with(".gscbin") || (!name.ends_with(".gsh") && !name.ends_with(".gsc"))) + { + asset s; + s.deserialize(data); + auto stk = utils::zlib::decompress(s.buffer, s.len); + auto res1 = files.insert({ name + "1", std::move(s.bytecode) }); + auto res2 = files.insert({ name + "2", std::move(stk) }); + + if(res1.second && res2.second) + { + return { {res1.first->second.data(), res1.first->second.size() }, {res2.first->second.data(), res2.first->second.size() } }; + } + } + else + { + auto res = files.insert({ name, std::move(data) }); + + if(res.second) + { + return { {res.first->second.data(), res.first->second.size() }, {} }; + } + } + + throw std::runtime_error("file read error"); +} + +auto init_iw5() -> void +{ + if (!contexts.contains(game::iw5)) + { + contexts[game::iw5] = std::make_unique(); + contexts[game::iw5]->init(build::prod, read_file_cb); + } +} + +auto init_iw5_ps() -> void +{ + if (!contexts.contains(game::iw5ps)) + { + contexts[game::iw5ps] = std::make_unique(); + contexts[game::iw5ps]->init(build::prod, read_file_cb); + } +} + +auto init_iw5_xb() -> void +{ + if (!contexts.contains(game::iw5xb)) + { + contexts[game::iw5xb] = std::make_unique(); + contexts[game::iw5xb]->init(build::prod, read_file_cb); + } +} + +auto init_iw6() -> void +{ + if (!contexts.contains(game::iw6)) + { + contexts[game::iw6] = std::make_unique(); + contexts[game::iw6]->init(build::prod, read_file_cb); + } +} + +auto init_iw6_ps() -> void +{ + if (!contexts.contains(game::iw6ps)) + { + contexts[game::iw6ps] = std::make_unique(); + contexts[game::iw6ps]->init(build::prod, read_file_cb); + } +} + +auto init_iw6_xb() -> void +{ + if (!contexts.contains(game::iw6xb)) + { + contexts[game::iw6xb] = std::make_unique(); + contexts[game::iw6xb]->init(build::prod, read_file_cb); + } +} + +auto init_iw7() -> void +{ + if (!contexts.contains(game::iw7)) + { + contexts[game::iw7] = std::make_unique(); + contexts[game::iw7]->init(build::prod, read_file_cb); + } +} + +auto init_iw8() -> void +{ + if (!contexts.contains(game::iw8)) + { + contexts[game::iw8] = std::make_unique(); + contexts[game::iw8]->init(build::prod, read_file_cb); + } +} + +auto init_iw9() -> void +{ + if (!contexts.contains(game::iw9)) + { + contexts[game::iw9] = std::make_unique(); + contexts[game::iw9]->init(build::prod, read_file_cb); + } +} + +auto init_s1() -> void +{ + if (!contexts.contains(game::s1)) + { + contexts[game::s1] = std::make_unique(); + contexts[game::s1]->init(build::prod, read_file_cb); + } +} + +auto init_s1_ps() -> void +{ + if (!contexts.contains(game::s1ps)) + { + contexts[game::s1ps] = std::make_unique(); + contexts[game::s1ps]->init(build::prod, read_file_cb); + } +} + +auto init_s1_xb() -> void +{ + if (!contexts.contains(game::s1xb)) + { + contexts[game::s1xb] = std::make_unique(); + contexts[game::s1xb]->init(build::prod, read_file_cb); + } +} + +auto init_s2() -> void +{ + if (!contexts.contains(game::s2)) + { + contexts[game::s2] = std::make_unique(); + contexts[game::s2]->init(build::prod, read_file_cb); + } +} + +auto init_s4() -> void +{ + if (!contexts.contains(game::s4)) + { + contexts[game::s4] = std::make_unique(); + contexts[game::s4]->init(build::prod, read_file_cb); + } +} + +auto init_h1() -> void +{ + if (!contexts.contains(game::h1)) + { + contexts[game::h1] = std::make_unique(); + contexts[game::h1]->init(build::prod, read_file_cb); + } +} + +auto init_h2() -> void +{ + if (!contexts.contains(game::h2)) + { + contexts[game::h2] = std::make_unique(); + contexts[game::h2]->init(build::prod, read_file_cb); + } +} + +auto init(game game) -> void +{ + funcs[mode::assemble] = assemble_file; + funcs[mode::disassemble] = disassemble_file; + funcs[mode::compile] = compile_file; + funcs[mode::decompile] = decompile_file; + + switch (game) + { + case game::iw5: init_iw5(); break; + case game::iw5ps: init_iw5_ps(); break; + case game::iw5xb: init_iw5_xb(); break; + case game::iw6: init_iw6(); break; + case game::iw6ps: init_iw6_ps(); break; + case game::iw6xb: init_iw6_xb(); break; + case game::iw7: init_iw7(); break; + case game::iw8: init_iw8(); break; + case game::iw9: init_iw9(); break; + case game::s1: init_s1(); break; + case game::s1ps: init_s1_ps(); break; + case game::s1xb: init_s1_xb(); break; + case game::s2: init_s2(); break; + case game::s4: init_s4(); break; + case game::h1: init_h1(); break; + case game::h2: init_h2(); break; + default: break; + } +} + +} // namespace xsk::gsc + +namespace arc +{ + +std::map contexts; +std::map> funcs; + +void assemble_file(game game, fs::path const& file, fs::path rel) +{ + try + { + if (file.extension() != ".gscasm" && file.extension() != ".cscasm") + throw std::runtime_error("expected .gscasm or .cscasm file"); + + rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension((file.extension() == ".gscasm" ? ".gsc" : ".csc")); + + auto& assembler = contexts[game]->assembler(); + + auto data = utils::file::read(file); + assembler.assemble(file.string(), data); + + utils::file::save(fs::path{ "assembled" } / rel, assembler.output()); + fmt::print("assembled {}\n", rel.generic_string()); + } + catch (std::exception const& e) + { + std::cerr << fmt::format("{} at {}\n", e.what(), file.generic_string()); + } +} + +void disassemble_file(game game, fs::path const& file, fs::path rel) +{ + try + { + if (file.extension() != ".gsc" && file.extension() != ".csc") + throw std::runtime_error("expected .gsc or .csc file"); + + rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension((file.extension() == ".gsc" ? ".gscasm" : ".cscasm")); + + auto& disassembler = contexts[game]->disassembler(); + + auto data = utils::file::read(file.string()); + disassembler.disassemble(file.string(), data); + + utils::file::save(fs::path{ "disassembled" } / rel, disassembler.output_raw()); + fmt::print("disassembled {}\n", rel.generic_string()); + } + catch (std::exception const& e) + { + std::cerr << fmt::format("{} at {}\n", e.what(), file.generic_string()); + } +} + +void compile_file(game game, fs::path const& file, fs::path rel) +{ + try + { + if (file.extension() != ".gsc" && file.extension() != ".csc") + throw std::runtime_error("expected .gsc or .csc file"); + + rel = fs::path{ games_rev.at(game) } / rel / file.filename(); + + auto& assembler = contexts[game]->assembler(); + auto& compiler = contexts[game]->compiler(); + + auto data = utils::file::read(file); + + compiler.compile(file.string(), data); + + auto assembly = compiler.output(); + + assembler.assemble(file.string(), assembly); + + utils::file::save(fs::path{ "compiled" } / rel, assembler.output()); + fmt::print("compiled {}\n", rel.generic_string()); + } + catch (std::exception const& e) + { + std::cerr << fmt::format("{} at {}\n", e.what(), file.generic_string()); + } +} + +void decompile_file(game game, fs::path const& file, fs::path rel) +{ + try + { + if (file.extension() != ".gsc" && file.extension() != ".csc") + throw std::runtime_error("expected .gsc or .csc file"); + + rel = fs::path{ games_rev.at(game) } / rel / file.filename(); + + auto& disassembler = contexts[game]->disassembler(); + auto& decompiler = contexts[game]->decompiler(); + + auto data = utils::file::read(file); + + disassembler.disassemble(file.string(), data); + + auto output = disassembler.output(); + + decompiler.decompile(file.string(), output); + + utils::file::save(fs::path{ "decompiled" } / rel, decompiler.output()); + fmt::print("decompiled {}\n", rel.generic_string()); + } + catch (std::exception const& e) + { + std::cerr << fmt::format("{} at {}\n", e.what(), file.generic_string()); + } +} + +auto init_t6() -> void +{ + if (!contexts.contains(game::t6)) + { + contexts[game::t6] = std::make_unique(); + contexts[game::t6]->init(build::prod, utils::file::read); + } +} + +auto init(game game) -> void +{ + funcs[mode::assemble] = assemble_file; + funcs[mode::disassemble] = disassemble_file; + funcs[mode::compile] = compile_file; + funcs[mode::decompile] = decompile_file; + + switch (game) + { + case game::t6: init_t6(); break; + default: break; + } +} + +} // namespace xsk::arc + +auto execute(mode mode, game game, fs::path const& path) -> void +{ + gsc::init(game); + arc::init(game); + + if (fs::is_directory(path)) + { + for (auto const& entry : fs::recursive_directory_iterator(path)) + { + if (entry.is_regular_file()) + { + auto rel = fs::relative(entry, path).remove_filename(); + + if (game < game::t6) + gsc::funcs[mode](game, entry.path().generic_string(), rel); + else + arc::funcs[mode](game, fs::path{ entry.path().generic_string(), fs::path::format::generic_format }, rel); + } + } + } + else if (fs::is_regular_file(path)) + { + if (game < game::t6) + gsc::funcs[mode](game, path, fs::path{}); + else + arc::funcs[mode](game, fs::path(path, fs::path::format::generic_format), fs::path{}); + } + else + { + std::cerr << fmt::format("bad path '{}'\n", path.generic_string()); + } +} + +auto parse_flags(u32 argc, char** argv, game& game, mode& mode, fs::path& path) -> bool +{ + if (argc != 4) return false; + + auto arg = utils::string::to_lower(argv[1]); + + if (arg.at(0) == 'z') + { + arg.erase(arg.begin()); + gsc::zonetool = true; + } + + auto const it = modes.find(arg); + + if (it != modes.end()) + { + mode = it->second; + } + else + { + std::cout << "[ERROR] unknown mode '" << argv[1] << "'.\n\n"; + return false; + } + + arg = utils::string::to_lower(argv[2]); + + auto const itr = games.find(arg); + + if (itr != games.end()) + { + game = itr->second; + } + else + { + std::cout << "[ERROR] unknown game '" << argv[2] << "'.\n\n"; + return false; + } + + path = fs::path{ utils::string::fordslash(argv[3]), fs::path::format::generic_format }; + + return true; +} + +auto print_usage() -> void +{ + std::cout << "usage: gsc-tool \n"; + std::cout << "\t* modes: asm, disasm, comp, decomp\n"; + std::cout << "\t* games: iw5ps, iw5xb, iw6ps, iw6xb, s1ps, s1xb, iw5, iw6, iw7, iw8, iw9, s1, s2, s4, h1, h2, t6\n"; + std::cout << "\t* paths: file or directory (recursive)\n"; + std::cin.get(); +} + +auto main(u32 argc, char** argv) -> void +{ + auto path = fs::path{}; + auto mode = mode::_; + auto game = game::_; + + if (!parse_flags(argc, argv, game, mode, path)) + { + return print_usage(); + } + + execute(mode, game, path); +} + +} // namespace xsk + +int main(int argc, char** argv) +{ + xsk::main(argc, argv); + return 0; +} diff --git a/src/tool/stdafx.cpp b/src/tool/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/tool/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/tool/stdafx.hpp b/src/tool/stdafx.hpp deleted file mode 100644 index 19f22f43..00000000 --- a/src/tool/stdafx.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; diff --git a/src/tool/xsk/main.cpp b/src/tool/xsk/main.cpp deleted file mode 100644 index deea8a11..00000000 --- a/src/tool/xsk/main.cpp +++ /dev/null @@ -1,760 +0,0 @@ -// 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 "utils/xsk/utils.hpp" -#include "experimental/iw5c/xsk/iw5c.hpp" -#include "experimental/iw6c/xsk/iw6c.hpp" -#include "experimental/s1c/xsk/s1c.hpp" -#include "iw5/xsk/iw5.hpp" -#include "iw6/xsk/iw6.hpp" -#include "iw7/xsk/iw7.hpp" -#include "iw8/xsk/iw8.hpp" -#include "iw9/xsk/iw9.hpp" -#include "s1/xsk/s1.hpp" -#include "s2/xsk/s2.hpp" -#include "s4/xsk/s4.hpp" -#include "h1/xsk/h1.hpp" -#include "h2/xsk/h2.hpp" -#include "t6/xsk/t6.hpp" - -namespace xsk -{ - -enum class encd { _, source, assembly, binary }; -enum class mode { _, assemble, disassemble, compile, decompile }; -enum class game { _, iw5c, iw6c, s1c, iw5, iw6, iw7, iw8, iw9, s1, s2, s4, h1, h2, t6 }; - -const std::map exts = -{ - { ".gsc", encd::source }, - { ".cgsc", encd::binary }, - { ".gscbin", encd::binary }, - { ".gscasm", encd::assembly }, -}; - -const std::map modes = -{ - { "asm", mode::assemble }, - { "disasm", mode::disassemble }, - { "comp", mode::compile }, - { "decomp", mode::decompile }, -}; - -const std::map games = -{ - { "iw5c", game::iw5c }, - { "iw6c", game::iw6c }, - { "s1c", game::s1c }, - { "iw5", game::iw5 }, - { "iw6", game::iw6 }, - { "iw7", game::iw7 }, - { "iw8", game::iw8 }, - { "iw9", game::iw9 }, - { "s1", game::s1 }, - { "s2", game::s2 }, - { "s4", game::s4 }, - { "h1", game::h1 }, - { "h2", game::h2 }, - { "t6", game::t6 }, -}; - -const std::map encds = -{ - { mode::assemble , encd::assembly }, - { mode::disassemble, encd::binary }, - { mode::compile, encd::source }, - { mode::decompile, encd::binary }, -}; - -auto overwrite_prompt(const std::string& file) -> bool -{ - auto overwrite = true; - - if (utils::file::exists(file)) - { - do - { - std::cout << "File \"" << file << "\" already exists, overwrite? [Y/n]: "; - auto result = std::getchar(); - - if (result == '\n' || result == 'Y' || result == 'y') - { - break; - } - else if (result == 'N' || result == 'n') - { - overwrite = false; - break; - } - } while (true); - } - - return overwrite; -} - -namespace gsc -{ - -std::map contexts; -std::map> funcs; -bool zonetool = false; - -auto choose_resolver_file_name(uint32_t id, game& game) -> std::string -{ - switch (game) - { - case game::iw5c: - return iw5c::resolver::token_name(static_cast(id)); - case game::iw6c: - return iw6c::resolver::token_name(static_cast(id)); - case game::s1c: - return s1c::resolver::token_name(static_cast(id)); - case game::iw5: - return iw5::resolver::token_name(static_cast(id)); - case game::iw6: - return iw6::resolver::token_name(static_cast(id)); - case game::iw7: - return iw7::resolver::token_name(id); - case game::iw8: - return iw8::resolver::token_name(id); - case game::iw9: - return iw9::resolver::token_name(id); - case game::s1: - return s1::resolver::token_name(static_cast(id)); - case game::s2: - return s2::resolver::token_name(static_cast(id)); - case game::s4: - return s4::resolver::token_name(id); - case game::h1: - return h1::resolver::token_name(static_cast(id)); - case game::h2: - return h2::resolver::token_name(static_cast(id)); - default: - return ""; - } -} - -void assemble_file(game game, std::string file) -{ - try - { - auto& assembler = contexts[game]->assembler(); - const auto ext = std::string(".gscasm"); - const auto extpos = file.find(ext); - - if (extpos != std::string::npos) - { - file.replace(extpos, ext.length(), ""); - } - - auto data = utils::file::read(file + ext); - - assembler.assemble(file, data); - - if (overwrite_prompt(file + (zonetool ? ".cgsc" : ".gscbin"))) - { - if (zonetool) - { - utils::file::save("assembled/" + file + ".cgsc", assembler.output_script()); - utils::file::save("assembled/" + file + ".cgsc.stack", assembler.output_stack()); - std::cout << "assembled " << file << ".cgsc\n"; - } - else - { - asset script; - - auto uncompressed = assembler.output_stack(); - auto compressed = utils::zlib::compress(uncompressed); - - script.name = file; - script.bytecode = assembler.output_script(); - script.buffer = std::move(compressed); - script.len = static_cast(uncompressed.size()); - script.compressedLen = static_cast(script.buffer.size()); - script.bytecodeLen = static_cast(script.bytecode.size()); - - auto output = script.serialize(); - utils::file::save("assembled/" + file + ".gscbin", output); - std::cout << "assembled " << file << ".gscbin\n"; - } - } - } - catch (const std::exception& e) - { - std::cerr << e.what() << '\n'; - } -} - -void disassemble_file(game game, std::string file) -{ - try - { - auto& disassembler = contexts[game]->disassembler(); - - if (zonetool) - { - if (file.find(".gscbin") != std::string::npos) return; - - if (file.find(".stack") != std::string::npos) - { - std::cerr << "Cannot disassemble stack files\n"; - return; - } - - const auto ext = std::string(".cgsc"); - const auto extpos = file.find(ext); - - if (extpos != std::string::npos) - { - file.replace(extpos, ext.length(), ""); - } - - auto script = utils::file::read(file + ".cgsc"); - auto stack = utils::file::read(file + ".cgsc.stack"); - - disassembler.disassemble(file, script, stack); - } - else - { - if (file.find(".cgsc") != std::string::npos) return; - - const auto ext = std::string(".gscbin"); - const auto extpos = file.find(ext); - - if (extpos != std::string::npos) - { - file.replace(extpos, ext.length(), ""); - } - - auto data = utils::file::read(file + ext); - - asset script; - - script.deserialize(data); - - auto stack = utils::zlib::decompress(script.buffer, script.len); - - disassembler.disassemble(file, script.bytecode, stack); - } - - auto scriptid = std::filesystem::path(file).filename().string(); - - if (!isdigit(scriptid.data()[0])) - { - utils::file::save("disassembled/" + file + ".gscasm", disassembler.output_data()); - std::cout << "disassembled " << file << ".gscasm\n"; - } - else - { - auto filename = choose_resolver_file_name(std::atoi(scriptid.data()), game); - auto count = file.find(scriptid); - - if (count != std::string::npos) - { - if (!filename.empty()) - { - file.erase(count, scriptid.length()); - } - } - - utils::file::save("disassembled/" + file + filename + ".gscasm", disassembler.output_data()); - std::cout << "disassembled " << file << filename << ".gscasm\n"; - } - } - catch (const std::exception& e) - { - std::cerr << e.what() << " at " << file << '\n'; - } -} - -void compile_file(game game, std::string file) -{ - try - { - auto& assembler = contexts[game]->assembler(); - auto& compiler = contexts[game]->compiler(); - const auto ext = std::string(".gsc"); - const auto extpos = file.find(ext); - - if (extpos != std::string::npos) - { - file.replace(extpos, ext.length(), ""); - } - - auto data = utils::file::read(file + ext); - - compiler.compile(file, data); - - auto assembly = compiler.output(); - - assembler.assemble(file, assembly); - - if (overwrite_prompt(file + (zonetool ? ".cgsc" : ".gscbin"))) - { - if (zonetool) - { - utils::file::save("compiled/" + file + ".cgsc", assembler.output_script()); - utils::file::save("compiled/" + file + ".cgsc.stack", assembler.output_stack()); - std::cout << "compiled " << file << ".cgsc\n"; - } - else - { - asset script; - - auto uncompressed = assembler.output_stack(); - auto compressed = utils::zlib::compress(uncompressed); - - script.name = file; - script.bytecode = assembler.output_script(); - script.buffer = std::move(compressed); - script.len = static_cast(uncompressed.size()); - script.compressedLen = static_cast(script.buffer.size()); - script.bytecodeLen = static_cast(script.bytecode.size()); - - auto output = script.serialize(); - utils::file::save("compiled/" + file + ".gscbin", output); - std::cout << "compiled " << file << ".gscbin\n"; - } - } - } - catch (const std::exception& e) - { - std::cerr << e.what() << '\n'; - } -} - -void decompile_file(game game, std::string file) -{ - try - { - auto& disassembler = contexts[game]->disassembler(); - - if (zonetool) - { - if (file.find(".gscbin") != std::string::npos) return; - - if (file.find(".stack") != std::string::npos) - { - std::cerr << "Cannot disassemble stack files\n"; - return; - } - - const auto ext = std::string(".cgsc"); - const auto extpos = file.find(ext); - - if (extpos != std::string::npos) - { - file.replace(extpos, ext.length(), ""); - } - - auto script = utils::file::read(file + ".cgsc"); - auto stack = utils::file::read(file + ".cgsc.stack"); - - disassembler.disassemble(file, script, stack); - } - else - { - if (file.find(".cgsc") != std::string::npos) return; - - const auto ext = std::string(".gscbin"); - const auto extpos = file.find(ext); - - if (extpos != std::string::npos) - { - file.replace(extpos, ext.length(), ""); - } - - auto data = utils::file::read(file + ext); - - asset script; - - script.deserialize(data); - - auto stack = utils::zlib::decompress(script.buffer, script.len); - - disassembler.disassemble(file, script.bytecode, stack); - } - - auto& decompiler = contexts[game]->decompiler(); - - auto output = disassembler.output(); - - decompiler.decompile(file, output); - - auto scriptid = std::filesystem::path(file).filename().string(); - - if (!isdigit(scriptid.data()[0])) - { - utils::file::save("decompiled/" + file + ".gsc", decompiler.output()); - std::cout << "decompiled " << file << ".gsc\n"; - } - else - { - auto filename = choose_resolver_file_name(std::atoi(scriptid.data()), game);/*xsk::utils::string::va("%s_%04X", scriptid.data(), std::atoi(scriptid.data()));*/ - auto count = file.find(scriptid); - - if (count != std::string::npos) - { - if (!filename.empty()) - { - file.erase(count, scriptid.length()); - } - } - - utils::file::save("decompiled/" + file + filename + ".gsc", decompiler.output()); - std::cout << "decompiled " << file << filename << ".gsc\n"; - } - } - catch (const std::exception& e) - { - std::cerr << e.what() << " at " << file << '\n'; - } -} - -void init() -{ - contexts[game::iw5c] = std::make_unique(); - contexts[game::iw5c]->init(build::prod, utils::file::read); - contexts[game::iw6c] = std::make_unique(); - contexts[game::iw6c]->init(build::prod, utils::file::read); - contexts[game::s1c] = std::make_unique(); - contexts[game::s1c]->init(build::prod, utils::file::read); - contexts[game::iw5] = std::make_unique(); - contexts[game::iw5]->init(build::prod, utils::file::read); - contexts[game::iw6] = std::make_unique(); - contexts[game::iw6]->init(build::prod, utils::file::read); - contexts[game::iw7] = std::make_unique(); - contexts[game::iw7]->init(build::prod, utils::file::read); - contexts[game::iw8] = std::make_unique(); - contexts[game::iw8]->init(build::prod, utils::file::read); - contexts[game::iw9] = std::make_unique(); - contexts[game::iw9]->init(build::prod, utils::file::read); - contexts[game::s1] = std::make_unique(); - contexts[game::s1]->init(build::prod, utils::file::read); - contexts[game::s2] = std::make_unique(); - contexts[game::s2]->init(build::prod, utils::file::read); - contexts[game::s4] = std::make_unique(); - contexts[game::s4]->init(build::prod, utils::file::read); - contexts[game::h1] = std::make_unique(); - contexts[game::h1]->init(build::prod, utils::file::read); - contexts[game::h2] = std::make_unique(); - contexts[game::h2]->init(build::prod, utils::file::read); - - funcs[mode::assemble] = assemble_file; - funcs[mode::disassemble] = disassemble_file; - funcs[mode::compile] = compile_file; - funcs[mode::decompile] = decompile_file; -} - -} // namespace xsk::gsc - -namespace arc -{ - -std::map contexts; -std::map> funcs; - -void assemble_file(game game, const std::filesystem::path& file) -{ - try - { - auto& assembler = contexts[game]->assembler(); - - auto data = utils::file::read(file.string()); - auto path = t6::resolver::fs_to_game_path(file); - auto next = path.extension() == ".gscasm" ? path.replace_extension(".gsc") : path.replace_extension(".csc"); - - assembler.assemble(next.string(), data); - - utils::file::save((std::filesystem::path("assembled/t6") / next).generic_string(), assembler.output()); - std::cout << "assembled " << path.replace_extension() << "\n"; - } - catch (const std::exception& e) - { - std::cerr << e.what() << '\n'; - } -} - -void disassemble_file(game game, const std::filesystem::path& file) -{ - try - { - auto& disassembler = contexts[game]->disassembler(); - - auto data = utils::file::read(file.string()); - auto path = t6::resolver::fs_to_game_path(file); - auto next = path.extension() == ".gsc" ? path.replace_extension(".gscasm") : path.replace_extension(".cscasm"); - - disassembler.disassemble(file.string(), data); - - utils::file::save((std::filesystem::path("disassembled/t6") / next).generic_string(), disassembler.output_raw()); - std::cout << "disassembled " << path.replace_extension() << "\n"; - } - catch (const std::exception& e) - { - std::cerr << e.what() << " at " << file.string() << '\n'; - } -} - -void compile_file(game game, const std::filesystem::path& file) -{ - try - { - auto& assembler = contexts[game]->assembler(); - auto& compiler = contexts[game]->compiler(); - - auto data = utils::file::read(file.string()); - auto path = t6::resolver::fs_to_game_path(file); - - compiler.compile(file.string(), data); - - auto assembly = compiler.output(); - - assembler.assemble(path.string(), assembly); - - utils::file::save((std::filesystem::path("compiled/t6") / path).generic_string(), assembler.output()); - std::cout << "compiled " << path.replace_extension() << "\n"; - } - catch (const std::exception& e) - { - std::cerr << e.what() << '\n'; - } -} - -void decompile_file(game game, const std::filesystem::path& file) -{ - try - { - auto& disassembler = contexts[game]->disassembler(); - auto& decompiler = contexts[game]->decompiler(); - - auto data = utils::file::read(file.string()); - auto path = t6::resolver::fs_to_game_path(file); - - disassembler.disassemble(file.string(), data); - - auto output = disassembler.output(); - - decompiler.decompile(file.string(), output); - - utils::file::save((std::filesystem::path("decompiled/t6") / path).generic_string(), decompiler.output()); - std::cout << "decompiled " << path.replace_extension() << "\n"; - } - catch (const std::exception& e) - { - std::cerr << e.what() << " at " << file.string() << '\n'; - } -} - -void init() -{ - contexts[game::t6] = std::make_unique(); - contexts[game::t6]->init(build::prod, utils::file::read); - - funcs[mode::assemble] = assemble_file; - funcs[mode::disassemble] = disassemble_file; - funcs[mode::compile] = compile_file; - funcs[mode::decompile] = decompile_file; -} - -} // namespace xsk::arc - -void execute(mode mode, game game, const std::string& path) -{ - if (std::filesystem::is_directory(path)) - { - for (const auto& entry : std::filesystem::recursive_directory_iterator(path)) - { - if (entry.is_regular_file()) - { - if (game < game::t6) - gsc::funcs[mode](game, entry.path().generic_string()); - else - arc::funcs[mode](game, std::filesystem::path(entry.path().generic_string(), std::filesystem::path::format::generic_format)); - } - } - } - else if (std::filesystem::is_regular_file(path)) - { - if (game < game::t6) - gsc::funcs[mode](game, path); - else - arc::funcs[mode](game, std::filesystem::path(path, std::filesystem::path::format::generic_format)); - } -} - -auto parse_flags(int argc, char** argv, game& game, mode& mode, std::string& path) -> bool -{ - if (argc != 4) return false; - - auto arg = utils::string::to_lower(argv[1]); - - if (arg.at(0) == 'z') - { - arg.erase(arg.begin()); - gsc::zonetool = true; - } - - const auto& it = modes.find(arg); - - if (it != modes.end()) - { - mode = it->second; - } - else - { - std::cout << "[ERROR] unknown mode '" << argv[1] << "'.\n\n"; - return false; - } - - arg = utils::string::to_lower(argv[2]); - - const auto& itr = games.find(arg); - - if (itr != games.end()) - { - game = itr->second; - } - else - { - std::cout << "[ERROR] unknown game '" << argv[2] << "'.\n\n"; - return false; - } - - path = utils::string::fordslash(argv[3]); - - return true; -} - -void print_usage() -{ - std::cout << "usage: gsc-tool.exe \n"; - std::cout << "\t* modes: asm, disasm, comp, decomp\n"; - std::cout << "\t* games: iw5c, iw6c, s1c, iw5, iw6, iw7, iw8, s1, s2, s4, h1, h2, t6\n"; - std::cout << "\t* paths: file or directory (recursive)\n"; -} -/* -auto shell_parse(const std::vector& data, game& game, mode& mode, std::string& path) -> bool -{ - if (data.size() != 3) return false; - - auto arg = utils::string::to_lower(data[0]); - - if (arg.at(0) == 'z') - { - arg.erase(arg.begin()); - gsc::zonetool = true; - } - - const auto& it = modes.find(arg); - - if (it != modes.end()) - { - mode = it->second; - } - else - { - std::cout << "[ERROR] unknown mode '" << data[0] << "'.\n"; - return false; - } - - arg = utils::string::to_lower(data[1]); - - const auto& itr = games.find(arg); - - if (itr != games.end()) - { - game = itr->second; - } - else - { - std::cout << "[ERROR] unknown game '" << data[1] << "'.\n"; - return false; - } - - path = utils::string::fordslash(data[2]); - - return true; -} - -void shell_usage() -{ - std::cout << "\nusage: \n"; - std::cout << "\t* modes: asm, disasm, comp, decomp\n"; - std::cout << "\t* games: iw5, iw6, iw7, iw8, s1, s2, s4, h1, h2, t6\n"; - std::cout << "\t* paths: file or directory (recursive)\n"; - std::cout << "type 'exit' to close\n"; - std::cout << "------------------------------------------------------\n"; -} - -void shell() -{ - std::string cmd; - cmd.resize(1024); - std::vector data; - std::regex exp(R"(([A-Za-z0-9.\/\\]+|\"(?:\\.|[^\"])*?\"|\'(?:\\.|[^\'])*?\'))"); - - std::cout << "GSC Tool - https://github.com/xensik/gsc-tool\n"; - shell_usage(); - - while (true) - { - std::cout << "> "; - std::memset(cmd.data(), 0, 1024); - std::cin.getline(cmd.data(), 1024, '\n'); - data.clear(); - - for (auto i = std::sregex_iterator(cmd.begin(), cmd.end(), exp); i != std::sregex_iterator(); ++i) - { - data.push_back(i->str()); - } - - if (data.size() == 0) - continue; - - if (data.size() == 1 && data[0] == "exit") - break; - - auto path = ""s; - mode mode = mode::__; - game game = game::__; - - if (shell_parse(data, game, mode, path)) - execute(mode, game, path); - else - shell_usage(); - } -} -*/ -void main(std::uint32_t argc, char** argv) -{ - auto path = ""s; - mode mode = mode::_; - game game = game::_; - - gsc::init(); - arc::init(); -/* - if (argc <= 1) - { - return shell(); - } -*/ - if (!parse_flags(argc, argv, game, mode, path)) - { - return print_usage(); - } - - execute(mode, game, path); -} - -} // namespace xsk - -int main(int argc, char** argv) -{ - xsk::main(argc, argv); - return 0; -} diff --git a/src/utils/file.cpp b/src/utils/file.cpp new file mode 100644 index 00000000..0add6a81 --- /dev/null +++ b/src/utils/file.cpp @@ -0,0 +1,76 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "file.hpp" + +namespace xsk::utils +{ + +auto file::read(std::filesystem::path const& file) -> std::vector +{ + auto data = std::vector{}; + + auto stream = std::ifstream{ file, std::ios::binary }; + + if (!stream.good() && !stream.is_open()) + { + throw std::runtime_error(fmt::format("couldn't open file {}", file.string())); + } + + stream.seekg(0, std::ios::end); + std::streamsize size = stream.tellg(); + stream.seekg(0, std::ios::beg); + + if (size > -1) + { + data.resize(static_cast(size)); + stream.read(reinterpret_cast(data.data()), size); + } + + stream.close(); + + return data; +} + +auto file::save(std::filesystem::path const& file, std::vector const& data) -> void +{ + return save(file, data.data(), data.size()); +} + +auto file::save(std::filesystem::path const& file, u8 const* data, usize size) -> void +{ + auto path = file; + + std::filesystem::create_directories(path.remove_filename()); + + auto stream = std::ofstream{ file, std::ios::binary | std::ofstream::out }; + + if (stream.is_open()) + { + stream.write(reinterpret_cast(data), size); + stream.close(); + } +} + +auto file::length(std::filesystem::path const& file) -> usize +{ + auto stream = std::ifstream{ file, std::ios::binary }; + + if (stream.good()) + { + stream.seekg(0, std::ios::end); + return static_cast(stream.tellg()); + } + + return 0; +} + +auto file::exists(std::filesystem::path const& file) -> bool +{ + return std::filesystem::exists(file); +} + +} // namespace xsk::utils diff --git a/src/utils/file.hpp b/src/utils/file.hpp new file mode 100644 index 00000000..1b758262 --- /dev/null +++ b/src/utils/file.hpp @@ -0,0 +1,21 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::utils +{ + +class file +{ +public: + static auto read(std::filesystem::path const& file) -> std::vector; + static auto save(std::filesystem::path const& file, std::vector const& data) -> void; + static auto save(std::filesystem::path const& file, u8 const* data, usize size) -> void; + static auto length(std::filesystem::path const& file) -> usize; + static auto exists(std::filesystem::path const& file) -> bool; +}; + +} // namespace xsk::utils diff --git a/src/utils/reader.cpp b/src/utils/reader.cpp new file mode 100644 index 00000000..be5758ac --- /dev/null +++ b/src/utils/reader.cpp @@ -0,0 +1,256 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "reader.hpp" + +namespace xsk::utils +{ + +reader::reader(bool swap) : data_{ nullptr }, size_ { 0 }, pos_{ 0 }, swap_{ swap } +{ +} + +reader::reader(std::vector const& data, bool swap) : data_{ data.data() }, size_{ static_cast(data.size()) }, pos_{ 0 }, swap_{ swap } +{ +} + +reader::reader(u8 const* data, u32 size, bool swap) : data_{ data }, size_{ size }, pos_{ 0 }, swap_{ swap } +{ +} + +template<> auto reader::read() -> i8 +{ + if (pos_ + 1 > size_) return i8{}; + + auto value = *reinterpret_cast(data_ + pos_); + pos_ += 1; + return value; +} + +template<> auto reader::read() -> u8 +{ + if (pos_ + 1 > size_) return u8{}; + + auto value = *reinterpret_cast(data_ + pos_); + pos_ += 1; + return value; +} + +template<> auto reader::read() -> i16 +{ + if (pos_ + 2 > size_) return i16{}; + + if (!swap_) + { + auto value = *reinterpret_cast(data_ + pos_); + pos_ += 2; + return value; + } + + auto bytes = std::array{}; + bytes[0] = (data_ + pos_)[1]; + bytes[1] = (data_ + pos_)[0]; + pos_ += 2; + return *reinterpret_cast(bytes.data()); +} + +template<> auto reader::read() -> u16 +{ + if (pos_ + 2 > size_) return u16{}; + + if (!swap_) + { + auto value = *reinterpret_cast(data_ + pos_); + pos_ += 2; + return value; + } + + auto bytes = std::array{}; + bytes[0] = (data_ + pos_)[1]; + bytes[1] = (data_ + pos_)[0]; + pos_ += 2; + return *reinterpret_cast(bytes.data()); +} + +template<> auto reader::read() -> i32 +{ + if (pos_ + 4 > size_) return i32{}; + + if (!swap_) + { + auto value = *reinterpret_cast(data_ + pos_); + pos_ += 4; + return value; + } + + auto bytes = std::array{}; + bytes[0] = (data_ + pos_)[3]; + bytes[1] = (data_ + pos_)[2]; + bytes[2] = (data_ + pos_)[1]; + bytes[3] = (data_ + pos_)[0]; + pos_ += 4; + return *reinterpret_cast(bytes.data()); +} + +template<> auto reader::read() -> u32 +{ + if (pos_ + 4 > size_) return u32{}; + + if (!swap_) + { + auto value = *reinterpret_cast(data_ + pos_); + pos_ += 4; + return value; + } + + auto bytes = std::array{}; + bytes[0] = (data_ + pos_)[3]; + bytes[1] = (data_ + pos_)[2]; + bytes[2] = (data_ + pos_)[1]; + bytes[3] = (data_ + pos_)[0]; + pos_ += 4; + return *reinterpret_cast(bytes.data()); +} + +template<> auto reader::read() -> i64 +{ + if (pos_ + 8 > size_) return i64{}; + + if (!swap_) + { + auto value = *reinterpret_cast(data_ + pos_); + pos_ += 8; + return value; + } + + auto bytes = std::array{}; + bytes[0] = (data_ + pos_)[7]; + bytes[1] = (data_ + pos_)[6]; + bytes[2] = (data_ + pos_)[5]; + bytes[3] = (data_ + pos_)[4]; + bytes[4] = (data_ + pos_)[3]; + bytes[5] = (data_ + pos_)[2]; + bytes[6] = (data_ + pos_)[1]; + bytes[7] = (data_ + pos_)[0]; + pos_ += 8; + return *reinterpret_cast(bytes.data()); +} + +template<> auto reader::read() -> u64 +{ + if (pos_ + 8 > size_) return u64{}; + + if (!swap_) + { + auto value = *reinterpret_cast(data_ + pos_); + pos_ += 8; + return value; + } + + auto bytes = std::array{}; + bytes[0] = (data_ + pos_)[7]; + bytes[1] = (data_ + pos_)[6]; + bytes[2] = (data_ + pos_)[5]; + bytes[3] = (data_ + pos_)[4]; + bytes[4] = (data_ + pos_)[3]; + bytes[5] = (data_ + pos_)[2]; + bytes[6] = (data_ + pos_)[1]; + bytes[7] = (data_ + pos_)[0]; + pos_ += 8; + return *reinterpret_cast(bytes.data()); +} + +template<> auto reader::read() -> f32 +{ + if (pos_ + 4 > size_) return f32{}; + + if (!swap_) + { + auto value = *reinterpret_cast(data_ + pos_); + pos_ += 4; + return value; + } + + auto bytes = std::array{}; + bytes[0] = (data_ + pos_)[3]; + bytes[1] = (data_ + pos_)[2]; + bytes[2] = (data_ + pos_)[1]; + bytes[3] = (data_ + pos_)[0]; + pos_ += 4; + return *reinterpret_cast(bytes.data()); +} + +auto reader::read_cstr() -> std::string +{ + auto ret = std::string{ reinterpret_cast(data_ + pos_) }; + pos_ += static_cast(ret.size() + 1); + return ret; +} + +auto reader::read_bytes(u32 pos, u32 count) -> std::string +{ + auto data = std::string{}; + + data.reserve(count * 3); + + for (auto i = pos; i < pos + count; i++) + { + data += fmt::format("{:02X} ", *reinterpret_cast(data_ + i)); + } + + data.pop_back(); + + return data; +} + +auto reader::is_avail() -> bool +{ + return (pos_ < size_) ? true : false; +} + +auto reader::seek(u32 size) -> void +{ + if (pos_ + size <= size_) pos_ += size; +} + +auto reader::seek_neg(u32 size) -> void +{ + if (pos_ - size >= 0) pos_ -= size; +} + +auto reader::align(u32 size) -> u32 +{ + auto pos = pos_; + + pos_ = (pos_ + (size - 1)) & ~(size - 1); + + return pos_ - pos; +} + +auto reader::data() -> u8 const* +{ + return data_; +} + +auto reader::size() -> u32 +{ + return size_; +} + +auto reader::pos() -> u32 +{ + return pos_; +} + +auto reader::pos(u32 pos) -> void +{ + if (pos >= 0 && pos <= size_) + { + pos_ = pos; + } +} + +} // namespace xsk::utils diff --git a/src/utils/reader.hpp b/src/utils/reader.hpp new file mode 100644 index 00000000..ac4a4acd --- /dev/null +++ b/src/utils/reader.hpp @@ -0,0 +1,40 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::utils +{ + +class reader +{ +public: + using ptr = std::unique_ptr; + +private: + u8 const* data_; + u32 size_; + u32 pos_; + bool swap_; + +public: + reader(bool swap = false); + reader(std::vector const& data, bool swap = false); + reader(u8 const* data, u32 size, bool swap = false); + template + auto read() -> T; + auto read_cstr() -> std::string; + auto read_bytes(u32 pos, u32 count) -> std::string; + auto is_avail() -> bool; + auto seek(u32 size) -> void; + auto seek_neg(u32 size) -> void; + auto align(u32 size) -> u32; + auto data() -> u8 const*; + auto size() -> u32; + auto pos() -> u32; + auto pos(u32 pos) -> void; +}; + +} // namespace xsk::utils diff --git a/src/utils/stdafx.cpp b/src/utils/stdafx.cpp deleted file mode 100644 index 1f373bf1..00000000 --- a/src/utils/stdafx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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/utils/stdafx.hpp b/src/utils/stdafx.hpp deleted file mode 100644 index 291c730d..00000000 --- a/src/utils/stdafx.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std::literals; - -#include "xsk/utils.hpp" diff --git a/src/utils/xsk/utils/string.cpp b/src/utils/string.cpp similarity index 69% rename from src/utils/xsk/utils/string.cpp rename to src/utils/string.cpp index 8196de79..44008fbf 100644 --- a/src/utils/xsk/utils/string.cpp +++ b/src/utils/string.cpp @@ -1,29 +1,30 @@ -// Copyright 2022 xensik. All rights reserved. +// Copyright 2023 xensik. All rights reserved. // // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "stdafx.hpp" +#include "stdinc.hpp" +#include "string.hpp" namespace xsk::utils { -auto string::oct_to_dec(const char* str) -> std::string +auto string::oct_to_dec(char const* str) -> std::string { return std::to_string(std::stoi(str, nullptr, 8)); } -auto string::bin_to_dec(const char* str) -> std::string +auto string::bin_to_dec(char const* str) -> std::string { return std::to_string(std::stoi(&str[2], nullptr, 2)); // str must prefix 0[bB] } -auto string::hex_to_dec(const char* str) -> std::string +auto string::hex_to_dec(char const* str) -> std::string { return std::to_string(std::stoi(&str[2], nullptr, 16)); // str must prefix 0[xX] } -auto string::iequals(const std::string& a, const std::string& b) -> bool +auto string::iequals(std::string const& a, std::string const& b) -> bool { return (a.size() == b.size()) && std::equal(a.begin(), a.end(), b.begin(), b.end(), [](char a, char b) @@ -32,21 +33,21 @@ auto string::iequals(const std::string& a, const std::string& b) -> bool }); } -auto string::is_number(const std::string& s) -> bool +auto string::is_number(std::string const& s) -> bool { return !s.empty() && std::all_of(s.begin(), s.end(), isdigit); } -auto string::is_hex_number(const std::string& s) -> bool +auto string::is_hex_number(std::string const& s) -> bool { return !s.empty() && std::all_of(s.begin(), s.end(), isxdigit); } -auto string::to_lower(const std::string& input) -> std::string +auto string::to_lower(std::string const& input) -> std::string { - std::string data(input.begin(), input.end()); + auto data = std::string{ input.begin(), input.end() }; - for (std::size_t i = 0; i < data.size(); i++) + for (auto i = 0u; i < data.size(); i++) { data[i] = static_cast(std::tolower(static_cast(input[i]))); } @@ -54,10 +55,10 @@ auto string::to_lower(const std::string& input) -> std::string return data; } -auto string::to_code(const std::string& input) -> std::string +auto string::to_code(std::string const& input) -> std::string { - std::string data = input.substr(1, input.size() - 2); - std::size_t pos; + auto data = input.substr(1, input.size() - 2); + auto pos = usize{ 0 }; while ((pos = data.find("\\n")) != std::string::npos) { @@ -90,10 +91,10 @@ auto string::to_code(const std::string& input) -> std::string return data; } -auto string::to_literal(const std::string& input) -> std::string +auto string::to_literal(std::string const& input) -> std::string { - std::string data(input.begin(), input.end()); - std::size_t pos; + auto data = std::string{ input.begin(), input.end() }; + auto pos = usize{ 0 }; while ((pos = data.find('\n')) != std::string::npos) { @@ -133,11 +134,11 @@ auto string::to_literal(const std::string& input) -> std::string return data; } -auto string::fordslash(const std::string& s) -> std::string +auto string::fordslash(std::string const& s) -> std::string { - std::string data(s.begin(), s.end()); + auto data = std::string{ s.begin(), s.end() }; - for (std::size_t i = 0; i < data.size(); i++) + for (auto i = 0u; i < data.size(); i++) { if (data[i] == '\\') data[i] = '/'; } @@ -145,11 +146,11 @@ auto string::fordslash(const std::string& s) -> std::string return data; } -auto string::backslash(const std::string& s) -> std::string +auto string::backslash(std::string const& s) -> std::string { - std::string data(s.begin(), s.end()); + auto data = std::string{ s.begin(), s.end() }; - for (std::size_t i = 0; i < data.size(); i++) + for (auto i = 0u; i < data.size(); i++) { if (data[i] == '/') data[i] = '\\'; } @@ -157,9 +158,9 @@ auto string::backslash(const std::string& s) -> std::string return data; } -auto string::quote(const std::string& s, bool single) -> std::string +auto string::quote(std::string const& s, bool single) -> std::string { - std::string data(s.begin(), s.end()); + auto data = std::string{ s.begin(), s.end() }; if (single) { @@ -175,7 +176,7 @@ auto string::quote(const std::string& s, bool single) -> std::string return data; } -auto string::unquote(const std::string& s) -> std::string +auto string::unquote(std::string const& s) -> std::string { if (s.at(0) == '\'' || s.at(0) == '\"') return s.substr(1, s.size() - 2); @@ -185,9 +186,9 @@ auto string::unquote(const std::string& s) -> std::string auto string::split(std::string& str, char delimiter) -> std::vector { - std::vector tokens; - std::stringstream ss(str); - std::string tok; + auto tokens = std::vector{}; + auto ss = std::stringstream{ str }; + auto tok = std::string{}; while (std::getline(ss, tok, delimiter)) { @@ -197,10 +198,10 @@ auto string::split(std::string& str, char delimiter) -> std::vector return tokens; } -auto string::clean_buffer_lines(std::vector& buffer) -> std::vector +auto string::clean_buffer_lines(std::vector& buffer) -> std::vector { - std::string data = std::string(reinterpret_cast(buffer.data()), buffer.size()); - std::size_t pos; + auto data = std::string{ reinterpret_cast(buffer.data()), buffer.size() }; + auto pos = usize{ 0 }; while ((pos = data.find("\t")) != std::string::npos) { @@ -212,9 +213,9 @@ auto string::clean_buffer_lines(std::vector& buffer) -> std::vecto data = data.replace(pos, 1, ""); } - std::vector lines; - std::stringstream ss(data); - std::string tok; + auto lines = std::vector{}; + auto ss = std::stringstream{ data }; + auto tok = std::string{}; while (std::getline(ss, tok, '\n')) { @@ -226,10 +227,10 @@ auto string::clean_buffer_lines(std::vector& buffer) -> std::vecto auto string::parse_code(std::string& line) -> std::vector { - std::vector data; - std::regex exp(R"(([_A-Za-z0-9\-]+|\"(?:\\.|[^\"])*?\"|\'(?:\\.|[^\'])*?\')(?:\s+|$))"); + auto data = std::vector{}; + auto exp = std::regex{ R"(([_A-Za-z0-9\-]+|\"(?:\\.|[^\"])*?\"|\'(?:\\.|[^\'])*?\')(?:\s+|$))" }; - for (auto i = std::sregex_iterator(line.begin(), line.end(), exp); i != std::sregex_iterator(); ++i) + for (auto i = std::sregex_iterator{ line.begin(), line.end(), exp }; i != std::sregex_iterator{}; ++i) { data.push_back(i->format("$1")); } @@ -237,9 +238,9 @@ auto string::parse_code(std::string& line) -> std::vector return data; } -auto string::float_string(float value) -> std::string +auto string::float_string(float value, bool toint) -> std::string { - enum flags_t : std::uint8_t { none = 0, negative = 1, integer = 2, has_exp = 4, exp_neg = 8 }; + enum flags_t : u8 { none = 0, negative = 1, integer = 2, has_exp = 4, exp_neg = 8 }; auto str = utils::string::va("%g", value); @@ -253,7 +254,7 @@ auto string::float_string(float value) -> std::string } if (!(flags & has_exp)) - return str += (flags & integer) ? ".0" : ""; + return str += ((flags & integer) && !toint) ? ".0" : ""; std::string p_int; std::string p_dec; @@ -271,7 +272,7 @@ auto string::float_string(float value) -> std::string while (i < str.size()) p_exp.push_back(str[i++]); - std::size_t offset = std::stoi(p_exp); + auto offset = usize{ std::stoul(p_exp) }; if ((flags & exp_neg)) offset -= p_int.size(); @@ -303,7 +304,7 @@ auto string::float_string(float value) -> std::string while (i < str.size()) p_exp.push_back(str[i++]); - std::size_t offset = std::stoi(p_exp); + auto offset = usize{ std::stoul(p_exp) }; offset -= (flags & exp_neg) ? p_int.size() : p_dec.size(); diff --git a/src/utils/string.hpp b/src/utils/string.hpp new file mode 100644 index 00000000..7539365f --- /dev/null +++ b/src/utils/string.hpp @@ -0,0 +1,43 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::utils +{ + +class string +{ +public: + template + static auto va(std::string const& format, Args ... args) -> std::string + { + usize size = snprintf(nullptr, 0, format.data(), args ...) + 1; + std::vector buf; + buf.resize(size); + snprintf(buf.data(), size, format.data(), args ...); + return std::string(buf.data(), buf.data() + size - 1); + } + + static auto oct_to_dec(char const* str) -> std::string; + static auto bin_to_dec(char const* str) -> std::string; + static auto hex_to_dec(char const* str) -> std::string; + static auto iequals(std::string const& a, std::string const& b) -> bool; + static auto is_number(std::string const& s) -> bool; + static auto is_hex_number(std::string const& s) -> bool; + static auto to_lower(std::string const& input) -> std::string; + static auto to_code(std::string const& input) -> std::string; + static auto to_literal(std::string const& input) -> std::string; + static auto fordslash(std::string const& s) -> std::string; + static auto backslash(std::string const& s) -> std::string; + static auto quote(std::string const& s, bool single = true) -> std::string; + static auto unquote(std::string const& s) -> std::string; + static auto split(std::string& str, char delimiter) -> std::vector; + static auto clean_buffer_lines(std::vector& buffer) -> std::vector; + static auto parse_code(std::string& line) -> std::vector; + static auto float_string(float value, bool toint = false) -> std::string; +}; + +} // namespace xsk::utils diff --git a/src/utils/writer.cpp b/src/utils/writer.cpp new file mode 100644 index 00000000..e7931e64 --- /dev/null +++ b/src/utils/writer.cpp @@ -0,0 +1,266 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "writer.hpp" + +namespace xsk::utils +{ + +writer::writer(bool swap) : size_{ 0x100000 }, pos_{ 0 }, swap_{ swap } +{ + data_ = reinterpret_cast(std::malloc(size_)); + std::memset(data_, 0, size_); +} + +writer::writer(u32 size, bool swap) : size_{ size }, pos_{ 0 }, swap_{ swap } +{ + data_ = reinterpret_cast(std::malloc(size_)); + std::memset(data_, 0, size_); +} + +writer::~writer() +{ + std::free(reinterpret_cast(data_)); +} + +auto writer::clear() -> void +{ + std::memset(data_, 0, size_); +} + +template<> auto writer::write(i8 data) -> void +{ + if (pos_ + 1 > size_) return; + + *reinterpret_cast(data_ + pos_) = data; + pos_ += 1; +} + +template<> auto writer::write(u8 data) -> void +{ + if (pos_ + 1 > size_) return; + + *reinterpret_cast(data_ + pos_) = data; + pos_ += 1; +} + +template<> auto writer::write(i16 data) -> void +{ + if (pos_ + 2 > size_) return; + + if (!swap_) + { + *reinterpret_cast(data_ + pos_) = data; + } + else + { + (data_ + pos_)[0] = reinterpret_cast(&data)[1]; + (data_ + pos_)[1] = reinterpret_cast(&data)[0]; + } + + pos_ += 2; +} + +template<> auto writer::write(u16 data) -> void +{ + if (pos_ + 2 > size_) return; + + if (!swap_) + { + *reinterpret_cast(data_ + pos_) = data; + } + else + { + (data_ + pos_)[0] = reinterpret_cast(&data)[1]; + (data_ + pos_)[1] = reinterpret_cast(&data)[0]; + } + + pos_ += 2; +} + +template<> auto writer::write(i32 data) -> void +{ + if (pos_ + 4 > size_) return; + + if (!swap_) + { + *reinterpret_cast(data_ + pos_) = data; + } + else + { + (data_ + pos_)[0] = reinterpret_cast(&data)[3]; + (data_ + pos_)[1] = reinterpret_cast(&data)[2]; + (data_ + pos_)[2] = reinterpret_cast(&data)[1]; + (data_ + pos_)[3] = reinterpret_cast(&data)[0]; + } + + pos_ += 4; +} + +template<> auto writer::write(u32 data) -> void +{ + if (pos_ + 4 > size_) return; + + if (!swap_) + { + *reinterpret_cast(data_ + pos_) = data; + } + else + { + (data_ + pos_)[0] = reinterpret_cast(&data)[3]; + (data_ + pos_)[1] = reinterpret_cast(&data)[2]; + (data_ + pos_)[2] = reinterpret_cast(&data)[1]; + (data_ + pos_)[3] = reinterpret_cast(&data)[0]; + } + + pos_ += 4; +} + +template<> auto writer::write(i64 data) -> void +{ + if (pos_ + 8 > size_) return; + + if (!swap_) + { + *reinterpret_cast(data_ + pos_) = data; + } + else + { + (data_ + pos_)[0] = reinterpret_cast(&data)[7]; + (data_ + pos_)[1] = reinterpret_cast(&data)[6]; + (data_ + pos_)[2] = reinterpret_cast(&data)[5]; + (data_ + pos_)[3] = reinterpret_cast(&data)[4]; + (data_ + pos_)[4] = reinterpret_cast(&data)[3]; + (data_ + pos_)[5] = reinterpret_cast(&data)[2]; + (data_ + pos_)[6] = reinterpret_cast(&data)[1]; + (data_ + pos_)[7] = reinterpret_cast(&data)[0]; + } + + pos_ += 8; +} + +template<> auto writer::write(u64 data) -> void +{ + if (pos_ + 8 > size_) return; + + if (!swap_) + { + *reinterpret_cast(data_ + pos_) = data; + } + else + { + (data_ + pos_)[0] = reinterpret_cast(&data)[7]; + (data_ + pos_)[1] = reinterpret_cast(&data)[6]; + (data_ + pos_)[2] = reinterpret_cast(&data)[5]; + (data_ + pos_)[3] = reinterpret_cast(&data)[4]; + (data_ + pos_)[4] = reinterpret_cast(&data)[3]; + (data_ + pos_)[5] = reinterpret_cast(&data)[2]; + (data_ + pos_)[6] = reinterpret_cast(&data)[1]; + (data_ + pos_)[7] = reinterpret_cast(&data)[0]; + } + + pos_ += 8; +} + +template<> auto writer::write(f32 data) -> void +{ + if (pos_ + 4 > size_) return; + + if (!swap_) + { + *reinterpret_cast(data_ + pos_) = data; + } + else + { + (data_ + pos_)[0] = reinterpret_cast(&data)[3]; + (data_ + pos_)[1] = reinterpret_cast(&data)[2]; + (data_ + pos_)[2] = reinterpret_cast(&data)[1]; + (data_ + pos_)[3] = reinterpret_cast(&data)[0]; + } + + pos_ += 4; +} + +auto writer::write_string(std::string const& data) -> void +{ + if (pos_ + data.size() > size_) return; + + std::memcpy(reinterpret_cast(data_ + pos_), data.data(), data.size()); + pos_ += static_cast(data.size()); +} + +auto writer::write_cstr(std::string const& data) -> void +{ + if (pos_ + data.size() >= size_) return; + + std::memcpy(reinterpret_cast(data_ + pos_), data.data(), data.size()); + pos_ += static_cast(data.size() + 1); +} + +auto writer::read_bytes(u32 pos, u32 count) -> std::string +{ + auto data = std::string{}; + + data.reserve(count * 3); + + for (auto i = pos; i < pos + count; i++) + { + data += fmt::format("{:02X} ", *reinterpret_cast(data_ + i)); + } + + data.pop_back(); + + return data; +} + +auto writer::is_avail() -> bool +{ + return (pos_ < size_) ? true : false; +} + +auto writer::seek(u32 size) -> void +{ + if (pos_ + size <= size_) pos_ += size; +} + +auto writer::seek_neg(u32 size) -> void +{ + if (pos_ - size >= 0) pos_ -= size; +} + +auto writer::align(u32 size) -> u32 +{ + auto pos = pos_; + + pos_ = (pos_ + (size - 1)) & ~(size - 1); + + return pos_ - pos; +} + +auto writer::data() -> const u8* +{ + return data_; +} + +auto writer::size() -> u32 +{ + return size_; +} + +auto writer::pos() -> u32 +{ + return pos_; +} + +auto writer::pos(u32 pos) -> void +{ + if (pos >= 0 && pos <= size_) + { + pos_ = pos; + } +} + +} // namespace xsk::utils diff --git a/src/utils/writer.hpp b/src/utils/writer.hpp new file mode 100644 index 00000000..d2ab0299 --- /dev/null +++ b/src/utils/writer.hpp @@ -0,0 +1,42 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::utils +{ + +class writer +{ +public: + using ptr = std::unique_ptr; + +private: + u8* data_; + u32 size_; + u32 pos_; + bool swap_; + +public: + writer(bool swap = false); + writer(u32 size, bool swap = false); + ~writer(); + auto clear() -> void; + template + auto write(T data) -> void; + auto write_string(std::string const& data) -> void; + auto write_cstr(std::string const& data) -> void; + auto read_bytes(u32 pos, u32 count) -> std::string; + auto is_avail() -> bool; + auto seek(u32 size) -> void; + auto seek_neg(u32 size) -> void; + auto align(u32 size) -> u32; + auto data() -> u8 const*; + auto size() -> u32; + auto pos() -> u32; + auto pos(u32 pos) -> void; +}; + +} // namespace xsk::utils diff --git a/src/utils/xsk/gsc/asset.cpp b/src/utils/xsk/gsc/asset.cpp deleted file mode 100644 index e16ebf85..00000000 --- a/src/utils/xsk/gsc/asset.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// 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::gsc -{ - -auto asset::serialize() -> std::vector -{ - std::vector data; - - data.resize(name.size() + compressedLen + bytecodeLen + 13); - std::memset(data.data(), 0, data.size()); - - std::size_t pos = 0; - - std::memcpy(&data[pos], name.data(), name.size() + 1); - pos += name.size() + 1; - - *reinterpret_cast(&data[pos]) = compressedLen; - pos += 4; - - *reinterpret_cast(&data[pos]) = len; - pos += 4; - - *reinterpret_cast(&data[pos]) = bytecodeLen; - pos += 4; - - std::memcpy(&data[pos], buffer.data(), buffer.size()); - pos += buffer.size(); - - std::memcpy(&data[pos], bytecode.data(), bytecode.size()); - - return data; -} - -void asset::deserialize(std::vector data) -{ - std::size_t pos = 0; - - name = std::string(reinterpret_cast(data.data())); - pos += name.size() + 1; - - compressedLen = *reinterpret_cast(data.data() + pos); - pos += 4; - - len = *reinterpret_cast(data.data() + pos); - pos += 4; - - bytecodeLen = *reinterpret_cast(data.data() + pos); - pos += 4; - - buffer.resize(compressedLen); - std::memcpy(buffer.data(), data.data() + pos, compressedLen); - pos += buffer.size(); - - bytecode.resize(bytecodeLen); - std::memcpy(bytecode.data(), data.data() + pos, bytecodeLen); -} - -} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/asset.hpp b/src/utils/xsk/gsc/asset.hpp deleted file mode 100644 index f21bd259..00000000 --- a/src/utils/xsk/gsc/asset.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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::gsc -{ - -struct asset -{ - using ptr = std::unique_ptr; - - std::string name; - std::uint32_t compressedLen; - std::uint32_t len; - std::uint32_t bytecodeLen; - std::vector buffer; - std::vector bytecode; - - auto serialize() -> std::vector; - void deserialize(std::vector data); -}; - -} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/block.cpp b/src/utils/xsk/gsc/block.cpp deleted file mode 100644 index 3b4ab369..00000000 --- a/src/utils/xsk/gsc/block.cpp +++ /dev/null @@ -1,175 +0,0 @@ -// 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::gsc -{ - -block::block() : local_vars_create_count(0), local_vars_public_count(0), - abort(abort_t::abort_none), is_last(false) { } - -void block::transfer(const block::ptr& child) -{ - child->loc_break = this->loc_break; - child->loc_continue = this->loc_continue; - - for (std::uint32_t i = 0; i < child->local_vars_public_count || i < this->local_vars_create_count; i++ ) - { - auto pos = child->find_variable(i, this->local_vars.at(i).name); - - if (pos < 0) - { - child->local_vars_public_count++; - child->local_vars.insert(child->local_vars.begin() + i, this->local_vars.at(i)); - } - else - { - auto& v = child->local_vars; - if (pos > std::int32_t(i)) - std::rotate(v.rend() - pos - 1, v.rend() - pos, v.rend() - i); - else - std::rotate(v.begin() + pos, v.begin() + pos + 1, v.begin() + i + 1); - child->local_vars.at(i).init = this->local_vars.at(i).init; - - if (child->local_vars_public_count <= i) - child->local_vars_public_count++; - } - } - - child->local_vars_create_count = this->local_vars_create_count; - child->abort = abort_t::abort_none; -} - -void block::copy(const block::ptr& child) -{ - child->local_vars = this->local_vars; - child->local_vars_create_count = this->local_vars_create_count; - child->local_vars_public_count = 0; -} - -void block::append(const std::vector& childs) -{ - bool glob = true; - - if (childs.size() == 0) return; - - for (std::size_t i = 0; i < childs.at(0)->local_vars.size(); i++ ) - { - glob = true; - auto& var = childs.at(0)->local_vars.at(i); - - if (this->find_variable(0, var.name) < 0) - { - for (std::size_t j = 1; j < childs.size(); j++ ) - { - if (childs.at(j)->find_variable(0, var.name) < 0) - { - glob = false; - } - } - - if (glob) - { - this->local_vars.push_back(var); - } - } - } -} - -void block::merge(const std::vector& childs) -{ - if (childs.size() == 0) return; - - for (std::size_t childidx = 0; childidx < childs.size(); childidx++) - { - auto child = childs[childidx]; - - child->local_vars_public_count = static_cast(this->local_vars.size()); - for (std::size_t i = 0; i < this->local_vars.size(); i++ ) - { - auto& name = this->local_vars.at(i).name; - - auto pos = child->find_variable(i, name); - - if (pos < 0) - { - child->local_vars.insert(child->local_vars.begin() + i, this->local_vars.at(i)); - } - else if (pos > static_cast(i)) - { - auto& v = child->local_vars; - std::rotate(v.rend() - pos - 1, v.rend() - pos, v.rend() - i); - } - } - } -} - -void block::init_from_child(const std::vector& childs) -{ - if (childs.size() == 0) return; - - auto create_count = childs[0]->local_vars_public_count; - - for (std::size_t i = 1; i < childs.size(); ++i ) - { - auto child = childs[i]; - if ( child->local_vars_public_count < create_count ) - create_count = child->local_vars_public_count; - } - - this->local_vars_create_count = create_count; - - bool init = true; - for (std::uint32_t i = 0; i < create_count; i++ ) - { - init = true; - if (!this->local_vars.at(i).init) - { - for (std::size_t j = 0; j < childs.size(); j++ ) - { - auto child = childs[j]; - - if (!child->local_vars.at(i).init) - { - init = false; - } - } - if (init) this->local_vars.at(i).init = true; - } - } -} - -auto block::find_variable(std::size_t start, const std::string& name) -> std::int32_t -{ - for (std::size_t i = start; i < local_vars.size(); ++i ) - { - if (local_vars.at(i).name == name) - return static_cast(i); - } - return -1; -} - -void block::transfer_decompiler(const block::ptr& child) -{ - for (std::uint32_t i = 0; i < this->local_vars.size(); i++ ) - { - child->local_vars.push_back(this->local_vars.at(i)); - } - - child->local_vars_public_count = static_cast(this->local_vars.size()); -} - -void block::append_decompiler(const block::ptr& child, bool all) -{ - auto total = all ? child->local_vars.size() : child->local_vars_public_count; - - for (auto i = this->local_vars.size(); i < total; i++ ) - { - this->local_vars.push_back(child->local_vars.at(i)); - } -} - -} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/block.hpp b/src/utils/xsk/gsc/block.hpp deleted file mode 100644 index 7ff984f8..00000000 --- a/src/utils/xsk/gsc/block.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// 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::gsc -{ - -struct local_var -{ - std::string name; - std::uint8_t create; - bool init; -}; - -struct block -{ - using ptr = std::unique_ptr; - - std::string loc_end; - std::string loc_break; - std::string loc_continue; - std::vector local_vars; - std::uint32_t local_vars_create_count; - std::uint32_t local_vars_public_count; - abort_t abort; - bool is_last; - - block(); - void transfer(const block::ptr& child); - void copy(const block::ptr& child); - void append(const std::vector& childs); - void merge(const std::vector& childs); - void init_from_child(const std::vector& childs); - auto find_variable(std::size_t start, const std::string& name) -> std::int32_t; - void transfer_decompiler(const block::ptr& child); - void append_decompiler(const block::ptr& child, bool all = false); -}; - -} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/interfaces/assembler.hpp b/src/utils/xsk/gsc/interfaces/assembler.hpp deleted file mode 100644 index ce50ee2c..00000000 --- a/src/utils/xsk/gsc/interfaces/assembler.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// 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::gsc -{ - -class assembler -{ -public: - using ptr = std::unique_ptr; - - virtual ~assembler() = default; - virtual auto output_script() -> std::vector = 0; - virtual auto output_stack() -> std::vector = 0; - virtual void assemble(const std::string& file, std::vector& data) = 0; - virtual void assemble(const std::string& file, std::vector& funcs) = 0; -}; - -} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/interfaces/compiler.hpp b/src/utils/xsk/gsc/interfaces/compiler.hpp deleted file mode 100644 index 7363f45b..00000000 --- a/src/utils/xsk/gsc/interfaces/compiler.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// 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::gsc -{ - -class compiler -{ -public: - using ptr = std::unique_ptr; - - virtual ~compiler() = default; - virtual auto output() -> std::vector = 0; - virtual void compile(const std::string& file, std::vector& data) = 0; -}; - -} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/interfaces/context.hpp b/src/utils/xsk/gsc/interfaces/context.hpp deleted file mode 100644 index 3600cdbb..00000000 --- a/src/utils/xsk/gsc/interfaces/context.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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::gsc -{ - -class context -{ -public: - using ptr = std::unique_ptr; - - virtual ~context() = default; - virtual void init(build mode, read_cb_type callback) = 0; - virtual void cleanup() = 0; - - virtual auto assembler() -> assembler& = 0; - virtual auto disassembler() -> disassembler& = 0; - virtual auto compiler() -> compiler& = 0; - virtual auto decompiler() -> decompiler& = 0; -}; - -} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/interfaces/decompiler.hpp b/src/utils/xsk/gsc/interfaces/decompiler.hpp deleted file mode 100644 index 523f4a96..00000000 --- a/src/utils/xsk/gsc/interfaces/decompiler.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// 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::gsc -{ - -class decompiler -{ -public: - using ptr = std::unique_ptr; - - virtual ~decompiler() = default; - virtual auto output() -> std::vector = 0; - virtual void decompile(const std::string& file, std::vector& funcs) = 0; -}; - -} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/interfaces/disassembler.hpp b/src/utils/xsk/gsc/interfaces/disassembler.hpp deleted file mode 100644 index 7c030aaf..00000000 --- a/src/utils/xsk/gsc/interfaces/disassembler.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// 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::gsc -{ - -class disassembler -{ -public: - using ptr = std::unique_ptr; - - virtual ~disassembler() = default; - virtual auto output() -> std::vector = 0; - virtual auto output_data() -> std::vector = 0; - virtual void disassemble(const std::string& file, std::vector& script, std::vector& stack) = 0; -}; - -} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/interfaces/exception.hpp b/src/utils/xsk/gsc/interfaces/exception.hpp deleted file mode 100644 index b84a61db..00000000 --- a/src/utils/xsk/gsc/interfaces/exception.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// 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::gsc -{ - -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 gsc::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::gsc diff --git a/src/utils/xsk/gsc/nodetree.cpp b/src/utils/xsk/gsc/nodetree.cpp deleted file mode 100644 index 8586630a..00000000 --- a/src/utils/xsk/gsc/nodetree.cpp +++ /dev/null @@ -1,1831 +0,0 @@ -// 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::gsc::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_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_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_string::expr_string(const std::string& value) : node(kind::expr_string), value(value) {} -expr_string::expr_string(const location& loc, const std::string& value) : node(kind::expr_string, loc), value(value) {} - -expr_istring::expr_istring(const std::string& value) : node(kind::expr_istring), value(std::move(value)) {} -expr_istring::expr_istring(const location& loc, const std::string& value) : node(kind::expr_istring, loc), value(std::move(value)) {} - -expr_path::expr_path() : node(kind::expr_path) {} -expr_path::expr_path(const std::string& value) : node(kind::expr_path), value(value) {} -expr_path::expr_path(const location& loc) : node(kind::expr_path, loc) {} -expr_path::expr_path(const location& loc, const std::string& value) : node(kind::expr_path, loc), value(value) {} - -expr_identifier::expr_identifier(const std::string& value) : node(kind::expr_identifier), value(value) {} -expr_identifier::expr_identifier(const location& loc, const std::string& value) : node(kind::expr_identifier, loc), value(value) {} - -expr_animtree::expr_animtree() : node(kind::expr_animtree) {} -expr_animtree::expr_animtree(const location& loc) : node(kind::expr_animtree, loc) {} - -expr_animation::expr_animation(const std::string& value) : node(kind::expr_animation), value(value) {} -expr_animation::expr_animation(const location& loc, const std::string& value) : node(kind::expr_animation, loc), value(value) {} - -expr_level::expr_level() : node(kind::expr_level) {} -expr_level::expr_level(const location& loc) : node(kind::expr_level, loc) {} - -expr_anim::expr_anim() : node(kind::expr_anim) {} -expr_anim::expr_anim(const location& loc) : node(kind::expr_anim, loc) {} - -expr_self::expr_self() : node(kind::expr_self) {} -expr_self::expr_self(const location& loc) : node(kind::expr_self, loc) {} - -expr_game::expr_game() : node(kind::expr_game) {} -expr_game::expr_game(const location& loc) : node(kind::expr_game, loc) {} - -expr_undefined::expr_undefined() : node(kind::expr_undefined) {} -expr_undefined::expr_undefined(const location& loc) : node(kind::expr_undefined, loc) {} - -expr_empty_array::expr_empty_array() : node(kind::expr_empty_array) {} -expr_empty_array::expr_empty_array(const location& loc) : node(kind::expr_empty_array, loc) {} - -expr_thisthread::expr_thisthread() : node(kind::expr_thisthread) {} -expr_thisthread::expr_thisthread(const location& loc) : node(kind::expr_thisthread, 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_tuple::expr_tuple() : node(kind::expr_tuple) {} -expr_tuple::expr_tuple(const location& loc) : node(kind::expr_tuple, loc) {} - -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_istrue::expr_istrue(ast::expr expr) : node(kind::expr_istrue), expr(std::move(expr)) {} -expr_istrue::expr_istrue(const location& loc, ast::expr expr) : node(kind::expr_istrue, loc), expr(std::move(expr)) {} - -expr_isdefined::expr_isdefined(ast::expr expr) : node(kind::expr_isdefined), expr(std::move(expr)) {} -expr_isdefined::expr_isdefined(const location& loc, ast::expr expr) : node(kind::expr_isdefined, loc), expr(std::move(expr)) {} - -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_add_array::expr_add_array(expr_arguments::ptr args) : node(kind::expr_add_array), args(std::move(args)) {} -expr_add_array::expr_add_array(const location& loc, expr_arguments::ptr args) : node(kind::expr_add_array, loc), args(std::move(args)) {} - -expr_pointer::expr_pointer(expr func, expr_arguments::ptr args, call::mode mode) : node(kind::expr_pointer), func(std::move(func)), args(std::move(args)), mode(mode) {} -expr_pointer::expr_pointer(const location& loc, expr func, expr_arguments::ptr args, call::mode mode) : node(kind::expr_pointer, loc), func(std::move(func)), args(std::move(args)), mode(mode) {} - -expr_function::expr_function(expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode) : node(kind::expr_function), path(std::move(path)), name(std::move(name)), args(std::move(args)), mode(mode) {} -expr_function::expr_function(const location& loc, expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode) : node(kind::expr_function, loc), path(std::move(path)), name(std::move(name)), args(std::move(args)), mode(mode) {} - -expr_method::expr_method(expr obj, ast::call call) : node(kind::expr_method), obj(std::move(obj)), call(std::move(call)) {} -expr_method::expr_method(const location& loc, expr obj, ast::call call) : node(kind::expr_method, loc), obj(std::move(obj)), call(std::move(call)) {} - -expr_call::expr_call(ast::call call) : node(kind::expr_call), call(std::move(call)) {} -expr_call::expr_call(const location& loc, ast::call call) : node(kind::expr_call, loc), call(std::move(call)) {} - -expr_complement::expr_complement(expr rvalue) : node(kind::expr_complement), rvalue(std::move(rvalue)) {} -expr_complement::expr_complement(const location& loc, expr rvalue) : node(kind::expr_complement, loc), rvalue(std::move(rvalue)) {} - -expr_negate::expr_negate(expr rvalue) : node(kind::expr_negate), rvalue(std::move(rvalue)) {} -expr_negate::expr_negate(const location& loc, expr rvalue) : node(kind::expr_negate, loc), rvalue(std::move(rvalue)) {} - -expr_not::expr_not(expr rvalue) : node(kind::expr_not), rvalue(std::move(rvalue)) {} -expr_not::expr_not(const location& loc, expr rvalue) : node(kind::expr_not, loc), rvalue(std::move(rvalue)) {} - -expr_binary::expr_binary(ast::kind kind, expr lvalue, expr rvalue) : node(kind), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} -expr_binary::expr_binary(ast::kind kind, const location& loc, expr lvalue, expr rvalue) : node(kind, loc), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} - -expr_add::expr_add(expr lvalue, expr rvalue) : expr_binary(kind::expr_add, std::move(lvalue), std::move(rvalue)) {} -expr_add::expr_add(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_add, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_sub::expr_sub(expr lvalue, expr rvalue) : expr_binary(kind::expr_sub, std::move(lvalue), std::move(rvalue)) {} -expr_sub::expr_sub(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_sub, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_mul::expr_mul( expr lvalue, expr rvalue) : expr_binary(kind::expr_mul, std::move(lvalue), std::move(rvalue)) {} -expr_mul::expr_mul(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_mul, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_div::expr_div(expr lvalue, expr rvalue) : expr_binary(kind::expr_div, std::move(lvalue), std::move(rvalue)) {} -expr_div::expr_div(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_div, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_mod::expr_mod(expr lvalue, expr rvalue) : expr_binary(kind::expr_mod, std::move(lvalue), std::move(rvalue)) {} -expr_mod::expr_mod(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_mod, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_shift_left::expr_shift_left(expr lvalue, expr rvalue) : expr_binary(kind::expr_shift_left, std::move(lvalue), std::move(rvalue)) {} -expr_shift_left::expr_shift_left(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_shift_left, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_shift_right::expr_shift_right(expr lvalue, expr rvalue) : expr_binary(kind::expr_shift_right, std::move(lvalue), std::move(rvalue)) {} -expr_shift_right::expr_shift_right(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_shift_right, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_bitwise_or::expr_bitwise_or(expr lvalue, expr rvalue) : expr_binary(kind::expr_bitwise_or, std::move(lvalue), std::move(rvalue)) {} -expr_bitwise_or::expr_bitwise_or(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_bitwise_or, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_bitwise_and::expr_bitwise_and(expr lvalue, expr rvalue) : expr_binary(kind::expr_bitwise_and, std::move(lvalue), std::move(rvalue)) {} -expr_bitwise_and::expr_bitwise_and(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_bitwise_and, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_bitwise_exor::expr_bitwise_exor(expr lvalue, expr rvalue) : expr_binary(kind::expr_bitwise_exor, std::move(lvalue), std::move(rvalue)) {} -expr_bitwise_exor::expr_bitwise_exor(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_bitwise_exor, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_equality::expr_equality(expr lvalue, expr rvalue) : expr_binary(kind::expr_equality, std::move(lvalue), std::move(rvalue)) {} -expr_equality::expr_equality(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_equality, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_inequality::expr_inequality(expr lvalue, expr rvalue) : expr_binary(kind::expr_inequality, std::move(lvalue), std::move(rvalue)) {} -expr_inequality::expr_inequality(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_inequality, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_less_equal::expr_less_equal(expr lvalue, expr rvalue) : expr_binary(kind::expr_less_equal, std::move(lvalue), std::move(rvalue)) {} -expr_less_equal::expr_less_equal(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_less_equal, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_greater_equal::expr_greater_equal(expr lvalue, expr rvalue) : expr_binary(kind::expr_greater_equal, std::move(lvalue), std::move(rvalue)) {} -expr_greater_equal::expr_greater_equal(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_greater_equal, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_less::expr_less(expr lvalue, expr rvalue) : expr_binary(kind::expr_less, std::move(lvalue), std::move(rvalue)) {} -expr_less::expr_less(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_less, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_greater::expr_greater(expr lvalue, expr rvalue) : expr_binary(kind::expr_greater, std::move(lvalue), std::move(rvalue)) {} -expr_greater::expr_greater(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_greater, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_or::expr_or(expr lvalue, expr rvalue) : expr_binary(kind::expr_or, std::move(lvalue), std::move(rvalue)) {} -expr_or::expr_or(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_or, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_and::expr_and(expr lvalue, expr rvalue) : expr_binary(kind::expr_and, std::move(lvalue), std::move(rvalue)) {} -expr_and::expr_and(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_and, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_ternary::expr_ternary(expr test, expr true_expr, expr false_expr) : node(kind::expr_ternary), test(std::move(test)), true_expr(std::move(true_expr)), false_expr(std::move(false_expr)) {} -expr_ternary::expr_ternary(const location& loc, expr test, expr true_expr, expr false_expr) : node(kind::expr_ternary, loc), test(std::move(test)), true_expr(std::move(true_expr)), false_expr(std::move(false_expr)) {} - -expr_increment::expr_increment(expr lvalue, bool prefix) : node(kind::expr_increment), lvalue(std::move(lvalue)), prefix(prefix) {} -expr_increment::expr_increment(const location& loc, expr lvalue, bool prefix) : node(kind::expr_increment, loc), lvalue(std::move(lvalue)), prefix(prefix) {} - -expr_decrement::expr_decrement(expr lvalue, bool prefix) : node(kind::expr_decrement), lvalue(std::move(lvalue)), prefix(prefix) {} -expr_decrement::expr_decrement(const location& loc, expr lvalue, bool prefix) : node(kind::expr_decrement, loc), lvalue(std::move(lvalue)), prefix(prefix) {} - -expr_assign::expr_assign(ast::kind kind, expr lvalue, expr rvalue) : node(kind), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} -expr_assign::expr_assign(ast::kind kind, const location& loc, expr lvalue, expr rvalue) : node(kind, loc), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} - -expr_assign_equal::expr_assign_equal(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_equal, std::move(lvalue), std::move(rvalue)) {} -expr_assign_equal::expr_assign_equal(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_equal, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_add::expr_assign_add(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_add, std::move(lvalue), std::move(rvalue)) {} -expr_assign_add::expr_assign_add(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_add, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_sub::expr_assign_sub(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_sub, std::move(lvalue), std::move(rvalue)) {} -expr_assign_sub::expr_assign_sub(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_sub, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_mul::expr_assign_mul(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_mul, std::move(lvalue), std::move(rvalue)) {} -expr_assign_mul::expr_assign_mul(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_mul, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_div::expr_assign_div(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_div, std::move(lvalue), std::move(rvalue)) {} -expr_assign_div::expr_assign_div(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_div, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_mod::expr_assign_mod(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_mod, std::move(lvalue), std::move(rvalue)) {} -expr_assign_mod::expr_assign_mod(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_mod, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_shift_left::expr_assign_shift_left(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_shift_left, std::move(lvalue), std::move(rvalue)) {} -expr_assign_shift_left::expr_assign_shift_left(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_shift_left, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_shift_right::expr_assign_shift_right(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_shift_right, std::move(lvalue), std::move(rvalue)) {} -expr_assign_shift_right::expr_assign_shift_right(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_shift_right, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_bitwise_or::expr_assign_bitwise_or(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_bitwise_or, std::move(lvalue), std::move(rvalue)) {} -expr_assign_bitwise_or::expr_assign_bitwise_or(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_bitwise_or, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_bitwise_and::expr_assign_bitwise_and(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_bitwise_and, std::move(lvalue), std::move(rvalue)) {} -expr_assign_bitwise_and::expr_assign_bitwise_and(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_bitwise_and, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_bitwise_exor::expr_assign_bitwise_exor(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_bitwise_exor, std::move(lvalue), std::move(rvalue)) {} -expr_assign_bitwise_exor::expr_assign_bitwise_exor(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_bitwise_exor, loc, std::move(lvalue), std::move(rvalue)) {} - -stmt_list::stmt_list() : node(kind::stmt_list) {} -stmt_list::stmt_list(const location& loc) : node(kind::stmt_list, loc) {} - -stmt_dev::stmt_dev(ast::stmt_list::ptr list) : node(kind::stmt_dev), list(std::move(list)) {} -stmt_dev::stmt_dev(const location& loc, ast::stmt_list::ptr list) : node(kind::stmt_dev, loc), list(std::move(list)) {} - -stmt_expr::stmt_expr(ast::expr expr) : node(kind::stmt_expr), expr(std::move(expr)) {} -stmt_expr::stmt_expr(const location& loc, ast::expr expr) : node(kind::stmt_expr, loc), expr(std::move(expr)) {} - -stmt_call::stmt_call(ast::expr expr) : node(kind::stmt_call), expr(std::move(expr)) {} -stmt_call::stmt_call(const location& loc, ast::expr expr) : node(kind::stmt_call, loc), expr(std::move(expr)) {} - -stmt_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_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_waitframe::stmt_waitframe() : node(kind::stmt_waitframe) {} -stmt_waitframe::stmt_waitframe(const location& loc) : node(kind::stmt_waitframe, loc) {} - -stmt_if::stmt_if(expr test, ast::stmt stmt) : node(kind::stmt_if), test(std::move(test)), stmt(std::move(stmt)), blk(nullptr) {} -stmt_if::stmt_if(const location& loc, expr test, ast::stmt stmt) : node(kind::stmt_if, loc), test(std::move(test)), stmt(std::move(stmt)), blk(nullptr) {} - -stmt_ifelse::stmt_ifelse(expr test, stmt stmt_if, stmt stmt_else) : node(kind::stmt_ifelse), test(std::move(test)), stmt_if(std::move(stmt_if)), stmt_else(std::move(stmt_else)), blk_if(nullptr), blk_else(nullptr) {} -stmt_ifelse::stmt_ifelse(const location& loc, expr test, stmt stmt_if, stmt stmt_else) : node(kind::stmt_ifelse, loc), test(std::move(test)), stmt_if(std::move(stmt_if)), stmt_else(std::move(stmt_else)), blk_if(nullptr), blk_else(nullptr) {} - -stmt_while::stmt_while(expr test, ast::stmt stmt) : node(kind::stmt_while), test(std::move(test)), stmt(std::move(stmt)), blk(nullptr) {} -stmt_while::stmt_while(const location& loc, expr test, ast::stmt stmt) : node(kind::stmt_while, loc), test(std::move(test)), stmt(std::move(stmt)), blk(nullptr) {} - -stmt_dowhile::stmt_dowhile(expr test, ast::stmt stmt) : node(kind::stmt_dowhile), test(std::move(test)), stmt(std::move(stmt)), blk(nullptr) {} -stmt_dowhile::stmt_dowhile(const location& loc, expr test, ast::stmt stmt) : node(kind::stmt_dowhile, loc), test(std::move(test)), stmt(std::move(stmt)), blk(nullptr) {} - -stmt_for::stmt_for(ast::stmt init, expr test, ast::stmt iter, ast::stmt stmt) : node(kind::stmt_for), init(std::move(init)), test(std::move(test)), iter(std::move(iter)), stmt(std::move(stmt)), blk(nullptr), blk_iter(nullptr) {} -stmt_for::stmt_for(const location& loc, ast::stmt init, expr test, ast::stmt iter, ast::stmt stmt) : node(kind::stmt_for, loc), init(std::move(init)), test(std::move(test)), iter(std::move(iter)), stmt(std::move(stmt)), blk(nullptr), blk_iter(nullptr) {} - -stmt_foreach::stmt_foreach(const location& loc, ast::stmt stmt, bool use_key) : node(kind::stmt_foreach, loc), array_expr(nullptr), value_expr(nullptr), key_expr(nullptr), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), stmt(std::move(stmt)), ctx(nullptr), ctx_post(nullptr), use_key(use_key) {} -stmt_foreach::stmt_foreach(ast::expr element, ast::expr container, ast::stmt stmt) : node(kind::stmt_foreach), array_expr(std::move(container)), value_expr(std::move(element)), key_expr(nullptr), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), stmt(std::move(stmt)), ctx(nullptr), ctx_post(nullptr), use_key(false) {} -stmt_foreach::stmt_foreach(ast::expr key, ast::expr element, ast::expr container, ast::stmt stmt) : node(kind::stmt_foreach), array_expr(std::move(container)), value_expr(std::move(element)), key_expr(std::move(key)), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), stmt(std::move(stmt)), ctx(nullptr), ctx_post(nullptr), use_key(true) {} -stmt_foreach::stmt_foreach(const location& loc, ast::expr element, ast::expr container, ast::stmt stmt) : node(kind::stmt_foreach, loc), array_expr(std::move(container)), value_expr(std::move(element)), key_expr(nullptr), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), stmt(std::move(stmt)), ctx(nullptr), ctx_post(nullptr), use_key(false) {} -stmt_foreach::stmt_foreach(const location& loc, ast::expr key, ast::expr element, ast::expr container, ast::stmt stmt) : node(kind::stmt_foreach, loc), array_expr(std::move(container)), value_expr(std::move(element)), key_expr(std::move(key)), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), stmt(std::move(stmt)), ctx(nullptr), ctx_post(nullptr), use_key(true) {} - -stmt_switch::stmt_switch(expr test, stmt_list::ptr stmt) : node(kind::stmt_switch), test(std::move(test)), stmt(std::move(stmt)), ctx(nullptr) {} -stmt_switch::stmt_switch(const location& loc, expr test, stmt_list::ptr stmt) : node(kind::stmt_switch, loc), test(std::move(test)), stmt(std::move(stmt)), ctx(nullptr) {} - -stmt_case::stmt_case(expr label) : node(kind::stmt_case), label(std::move(label)), stmt(nullptr), blk(nullptr) {} -stmt_case::stmt_case(const location& loc, expr label) : node(kind::stmt_case, loc), label(std::move(label)), stmt(nullptr), blk(nullptr) {} -stmt_case::stmt_case(const location& loc, expr label, stmt_list::ptr stmt) : node(kind::stmt_case, loc), label(std::move(label)), stmt(std::move(stmt)), blk(nullptr) {} - -stmt_default::stmt_default() : node(kind::stmt_default), stmt(nullptr), blk(nullptr) {} -stmt_default::stmt_default(const location& loc) : node(kind::stmt_default, loc), stmt(nullptr), blk(nullptr) {} -stmt_default::stmt_default(const location& loc, stmt_list::ptr stmt) : node(kind::stmt_default, loc), stmt(std::move(stmt)), blk(nullptr) {} - -stmt_break::stmt_break() : node(kind::stmt_break) {} -stmt_break::stmt_break(const location& loc) : node(kind::stmt_break, loc) {} - -stmt_continue::stmt_continue() : node(kind::stmt_continue) {} -stmt_continue::stmt_continue(const location& loc) : node(kind::stmt_continue, loc) {} - -stmt_return::stmt_return(ast::expr expr) : node(kind::stmt_return), expr(std::move(expr)) {} -stmt_return::stmt_return(const location& loc, ast::expr expr) : node(kind::stmt_return, loc), expr(std::move(expr)) {} - -stmt_breakpoint::stmt_breakpoint() : node(kind::stmt_breakpoint) {} -stmt_breakpoint::stmt_breakpoint(const location& loc) : node(kind::stmt_breakpoint, loc) {} - -stmt_prof_begin::stmt_prof_begin(expr_arguments::ptr args) : node(kind::stmt_prof_begin), args(std::move(args)) {} -stmt_prof_begin::stmt_prof_begin(const location& loc, expr_arguments::ptr args) : node(kind::stmt_prof_begin, loc), args(std::move(args)) {} - -stmt_prof_end::stmt_prof_end(expr_arguments::ptr args) : node(kind::stmt_prof_end), args(std::move(args)) {} -stmt_prof_end::stmt_prof_end(const location& loc, expr_arguments::ptr args) : node(kind::stmt_prof_end, loc), args(std::move(args)) {} - -decl_thread::decl_thread(expr_identifier::ptr name, expr_parameters::ptr params, stmt_list::ptr stmt) : 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_create::asm_create(const std::string& index) : node(kind::asm_create), index(index) {} -asm_create::asm_create(const location& loc, const std::string& index) : node(kind::asm_create, loc), index(index) {} - -asm_access::asm_access(const std::string& index) : node(kind::asm_access), index(index) {} -asm_access::asm_access(const location& loc, const std::string& index) : node(kind::asm_access, loc), index(index) {} - -asm_remove::asm_remove(const std::string& index) : node(kind::asm_remove), index(index) {} -asm_remove::asm_remove(const location& loc, const std::string& index) : node(kind::asm_remove, loc), index(index) {} - -asm_clear::asm_clear(const std::string& index) : node(kind::asm_clear), index(index) {} -asm_clear::asm_clear(const location& loc, const std::string& index) : node(kind::asm_clear, loc), index(index) {} - -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_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_animtree::print() const -> std::string -{ - return "#animtree"; -} - -auto expr_animation::print() const -> std::string -{ - return "%"s += value; -} - -auto expr_level::print() const -> std::string -{ - return "level"; -} - -auto expr_anim::print() const -> std::string -{ - return "anim"; -} - -auto expr_self::print() const -> std::string -{ - return "self"; -} - -auto expr_game::print() const -> std::string -{ - return "game"; -} - -auto expr_undefined::print() const -> std::string -{ - return "undefined"; -} - -auto expr_empty_array::print() const -> std::string -{ - return "[]"; -} - -auto expr_thisthread::print() const -> std::string -{ - return "thisthread"; -} - -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_tuple::print() const -> std::string -{ - std::string data = "["; - - for (const auto& entry : list) - { - data += " " + entry.print(); - data += (&entry != &list.back()) ? "," : " "; - } - - return data += "]"; -} - -auto expr_reference::print() const -> std::string -{ - return path->print() + "::" + name->print(); -} - -auto expr_istrue::print() const -> std::string -{ - return "istrue( " + expr.print() + " )"; -} - -auto expr_isdefined::print() const -> std::string -{ - return "isdefined( " + expr.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_add_array::print() const -> std::string -{ - return "[" + args->print() + "]"; -} - -auto expr_pointer::print() const -> std::string -{ - std::string data; - - if (mode == call::mode::builtin) - data += "call "; - else if (mode == call::mode::thread) - data += "thread "; - else if (mode == call::mode::childthread) - data += "childthread "; - - return data += "[[ "s + func.print() + " ]](" + args->print() + ")"; -} - -auto expr_function::print() const -> std::string -{ - std::string data; - - if (mode == call::mode::thread) - data += "thread "; - else if (mode == call::mode::childthread) - data += "childthread "; - - if (path->value != "") - data += path->print() + "::"; - - return data += name->print() + "(" + args->print() + ")"; -} - -auto expr_method::print() const -> std::string -{ - return obj.print() + " " + call.print(); -} - -auto expr_call::print() const -> std::string -{ - return call.print(); -} - -auto expr_complement::print() const -> std::string -{ - return "~" + rvalue.print(); -} - -auto expr_negate::print() const -> std::string -{ - return "-" + rvalue.print(); -} - -auto expr_not::print() const -> std::string -{ - return "!" + rvalue.print(); -} - -auto expr_add::print() const -> std::string -{ - return lvalue.print() + " + " + rvalue.print(); -} - -auto expr_sub::print() const -> std::string -{ - return lvalue.print() + " - " + rvalue.print(); -} - -auto expr_mul::print() const -> std::string -{ - return lvalue.print() + " * " + rvalue.print(); -} - -auto expr_div::print() const -> std::string -{ - return lvalue.print() + " / " + rvalue.print(); -} - -auto expr_mod::print() const -> std::string -{ - return lvalue.print() + " % " + rvalue.print(); -} - -auto expr_shift_left::print() const -> std::string -{ - return lvalue.print() + " << " + rvalue.print(); -} - -auto expr_shift_right::print() const -> std::string -{ - return lvalue.print() + " >> " + rvalue.print(); -} - -auto expr_bitwise_or::print() const -> std::string -{ - return lvalue.print() + " | " + rvalue.print(); -} - -auto expr_bitwise_and::print() const -> std::string -{ - return lvalue.print() + " & " + rvalue.print(); -} - -auto expr_bitwise_exor::print() const -> std::string -{ - return lvalue.print() + " ^ " + rvalue.print(); -} - -auto expr_equality::print() const -> std::string -{ - return lvalue.print() + " == " + rvalue.print(); -} - -auto expr_inequality::print() const -> std::string -{ - return lvalue.print() + " != " + rvalue.print(); -} - -auto expr_less_equal::print() const -> std::string -{ - return lvalue.print() + " <= " + rvalue.print(); -} - -auto expr_greater_equal::print() const -> std::string -{ - return lvalue.print() + " >= " + rvalue.print(); -} - -auto expr_less::print() const -> std::string -{ - return lvalue.print() + " < " + rvalue.print(); -} - -auto expr_greater::print() const -> std::string -{ - return lvalue.print() + " > " + rvalue.print(); -} - -auto expr_or::print() const -> std::string -{ - return lvalue.print() + " || " + rvalue.print(); -} - -auto expr_and::print() const -> std::string -{ - return lvalue.print() + " && " + rvalue.print(); -} - -auto expr_ternary::print() const -> std::string -{ - return test.print() + " ? " + true_expr.print() + " : " + false_expr.print(); -} - -auto expr_increment::print() const -> std::string -{ - if (prefix) return "++" + lvalue.print(); - return lvalue.print() + "++"; -} - -auto expr_decrement::print() const -> std::string -{ - if (prefix) return "--" + lvalue.print(); - return lvalue.print() + "--"; -} - -auto expr_assign_equal::print() const -> std::string -{ - return lvalue.print() + " = " + rvalue.print(); -}; - -auto expr_assign_add::print() const -> std::string -{ - return lvalue.print() + " += " + rvalue.print() ; -}; - -auto expr_assign_sub::print() const -> std::string -{ - return lvalue.print() + " -= " + rvalue.print() ; -}; - -auto expr_assign_mul::print() const -> std::string -{ - return lvalue.print() + " *= " + rvalue.print() ; -}; - -auto expr_assign_div::print() const -> std::string -{ - return lvalue.print() + " /= " + rvalue.print() ; -}; - -auto expr_assign_mod::print() const -> std::string -{ - return lvalue.print() + " %= " + rvalue.print() ; -}; - -auto expr_assign_shift_left::print() const -> std::string -{ - return lvalue.print() + " <<= " + rvalue.print() ; -}; - -auto expr_assign_shift_right::print() const -> std::string -{ - return lvalue.print() + " >>= " + rvalue.print() ; -}; - -auto expr_assign_bitwise_or::print() const -> std::string -{ - return lvalue.print() + " |= " + rvalue.print(); -} - -auto expr_assign_bitwise_and::print() const -> std::string -{ - return lvalue.print() + " &= " + rvalue.print(); -} - -auto expr_assign_bitwise_exor::print() const -> std::string -{ - return lvalue.print() + " ^= " + rvalue.print(); -} - -auto stmt_list::print() const -> std::string -{ - if (is_expr) - { - if (list.size() > 0) - { - auto s = list[0].print(); - s.pop_back(); - return s; - } - else return ""; - } - - std::string data; - bool last_special = false; - 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_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_waitframe::print() const -> std::string -{ - return "waitframe();"; -}; - -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) - { - data += "\n" + 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_jump_cond( " + expr.print() + ", " + value + " );"; -} - -auto asm_jump_true_expr::print() const -> std::string -{ - return "__asm_jump_expr_true( " + value + " );"; -} - -auto asm_jump_false_expr::print() const -> std::string -{ - return "__asm_jump_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_create::print() const -> std::string -{ - return "__asm_var_create( " + index + " );"; -} - -auto asm_access::print() const -> std::string -{ - return "__asm_var_access( " + index + " );"; -} - -auto asm_remove::print() const -> std::string -{ - return "__asm_var_remove( " + index + " );"; -} - -auto asm_clear::print() const -> std::string -{ - return "__asm_var_clear( " + index + " );"; -} - -// 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_string& lhs, const expr_string& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_istring& lhs, const expr_istring& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_path& lhs, const expr_path& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_identifier& lhs, const expr_identifier& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_animtree&, const expr_animtree&) -{ - return true; -} - -bool operator==(const expr_animation& lhs, const expr_animation& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_level&, const expr_level&) -{ - return true; -} - -bool operator==(const expr_anim&, const expr_anim&) -{ - return true; -} - -bool operator==(const expr_self&, const expr_self&) -{ - return true; -} - -bool operator==(const expr_game&, const expr_game&) -{ - return true; -} - -bool operator==(const expr_undefined&, const expr_undefined&) -{ - return true; -} - -bool operator==(const expr_empty_array&, const expr_empty_array&) -{ - return true; -} - -bool operator==(const expr_thisthread&, const expr_thisthread&) -{ - 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_string: as_string.~unique_ptr(); return; - case kind::expr_istring: as_istring.~unique_ptr(); return; - case kind::expr_path: as_path.~unique_ptr(); return; - case kind::expr_identifier: as_identifier.~unique_ptr(); return; - case kind::expr_animtree: as_animtree.~unique_ptr(); return; - case kind::expr_animation: as_animation.~unique_ptr(); return; - case kind::expr_level: as_level.~unique_ptr(); return; - case kind::expr_anim: as_anim.~unique_ptr(); return; - case kind::expr_self: as_self.~unique_ptr(); return; - case kind::expr_game: as_game.~unique_ptr(); return; - case kind::expr_undefined: as_undefined.~unique_ptr(); return; - case kind::expr_empty_array: as_empty_array.~unique_ptr(); return; - case kind::expr_thisthread: as_thisthread.~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_tuple: as_tuple.~unique_ptr(); return; - case kind::expr_reference: as_reference.~unique_ptr(); return; - case kind::expr_arguments: as_arguments.~unique_ptr(); return; - case kind::expr_parameters: as_parameters.~unique_ptr(); return; - case kind::expr_add_array: as_add_array.~unique_ptr(); return; - case kind::expr_pointer: as_pointer.~unique_ptr(); return; - case kind::expr_function: as_function.~unique_ptr(); return; - case kind::expr_method: as_method.~unique_ptr(); return; - case kind::expr_call: as_call.~unique_ptr(); return; - case kind::expr_complement: as_complement.~unique_ptr(); return; - case kind::expr_negate: as_negate.~unique_ptr(); return; - case kind::expr_not: as_not.~unique_ptr(); return; - case kind::expr_add: as_add.~unique_ptr(); return; - case kind::expr_sub: as_sub.~unique_ptr(); return; - case kind::expr_mul: as_mul.~unique_ptr(); return; - case kind::expr_div: as_div.~unique_ptr(); return; - case kind::expr_mod: as_mod.~unique_ptr(); return; - case kind::expr_shift_left: as_shift_left.~unique_ptr(); return; - case kind::expr_shift_right: as_shift_right.~unique_ptr(); return; - case kind::expr_bitwise_or: as_bitwise_or.~unique_ptr(); return; - case kind::expr_bitwise_and: as_bitwise_and.~unique_ptr(); return; - case kind::expr_bitwise_exor: as_bitwise_exor.~unique_ptr(); return; - case kind::expr_equality: as_equality.~unique_ptr(); return; - case kind::expr_inequality: as_inequality.~unique_ptr(); return; - case kind::expr_less_equal: as_less_equal.~unique_ptr(); return; - case kind::expr_greater_equal: as_greater_equal.~unique_ptr(); return; - case kind::expr_less: as_less.~unique_ptr(); return; - case kind::expr_greater: as_greater.~unique_ptr(); return; - case kind::expr_or: as_or.~unique_ptr(); return; - case kind::expr_and: as_and.~unique_ptr(); return; - case kind::expr_ternary: as_ternary.~unique_ptr(); return; - case kind::expr_increment: as_increment.~unique_ptr(); return; - case kind::expr_decrement: as_decrement.~unique_ptr(); return; - case kind::expr_assign_equal: as_assign_equal.~unique_ptr(); return; - case kind::expr_assign_add: as_assign_add.~unique_ptr(); return; - case kind::expr_assign_sub: as_assign_sub.~unique_ptr(); return; - case kind::expr_assign_mul: as_assign_mul.~unique_ptr(); return; - case kind::expr_assign_div: as_assign_div.~unique_ptr(); return; - case kind::expr_assign_mod: as_assign_mod.~unique_ptr(); return; - case kind::expr_assign_shift_left: as_assign_shift_left.~unique_ptr(); return; - case kind::expr_assign_shift_right: as_assign_shift_right.~unique_ptr(); return; - case kind::expr_assign_bitwise_or: as_assign_bw_or.~unique_ptr(); return; - case kind::expr_assign_bitwise_and: as_assign_bw_and.~unique_ptr(); return; - case kind::expr_assign_bitwise_exor: as_assign_bw_exor.~unique_ptr(); return; - case kind::asm_create: as_asm_create.~unique_ptr(); return; - case kind::asm_access: as_asm_access.~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_string: return *lhs.as_string == *rhs.as_string; - case kind::expr_istring: return *lhs.as_istring == *rhs.as_istring; - case kind::expr_path: return *lhs.as_path == *rhs.as_path; - case kind::expr_identifier: return *lhs.as_identifier == *rhs.as_identifier; - case kind::expr_animtree: return *lhs.as_animtree == *rhs.as_animtree; - case kind::expr_animation: return *lhs.as_animation == *rhs.as_animation; - case kind::expr_level: return *lhs.as_level == *rhs.as_level; - case kind::expr_anim: return *lhs.as_anim == *rhs.as_anim; - case kind::expr_self: return *lhs.as_self == *rhs.as_self; - case kind::expr_game: return *lhs.as_game == *rhs.as_game; - case kind::expr_undefined: return *lhs.as_undefined == *rhs.as_undefined; - case kind::expr_empty_array: return *lhs.as_empty_array == *rhs.as_empty_array; - case kind::expr_thisthread: return *lhs.as_thisthread == *rhs.as_thisthread; - 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_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_waitframe: as_waitframe.~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_switch: as_asm_switch.~unique_ptr(); return; - case kind::asm_endswitch: as_asm_endswitch.~unique_ptr(); return; - case kind::asm_create: as_asm_create.~unique_ptr(); return; - case kind::asm_access: as_asm_access.~unique_ptr(); return; - case kind::asm_remove: as_asm_remove.~unique_ptr(); return; - case kind::asm_clear: as_asm_clear.~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::gsc::ast diff --git a/src/utils/xsk/gsc/nodetree.hpp b/src/utils/xsk/gsc/nodetree.hpp deleted file mode 100644 index 5ed2fae6..00000000 --- a/src/utils/xsk/gsc/nodetree.hpp +++ /dev/null @@ -1,1777 +0,0 @@ -// 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::gsc::ast -{ - -enum class kind -{ - null, - expr_true, - expr_false, - expr_integer, - expr_float, - expr_vector, - expr_string, - expr_istring, - expr_path, - expr_identifier, - expr_animtree, - expr_animation, - expr_level, - expr_anim, - expr_self, - expr_game, - expr_undefined, - expr_empty_array, - expr_thisthread, - expr_paren, - expr_size, - expr_field, - expr_array, - expr_tuple, - expr_reference, - expr_istrue, - expr_isdefined, - expr_arguments, - expr_parameters, - expr_add_array, - expr_pointer, - expr_function, - expr_method, - expr_call, - expr_complement, - expr_negate, - expr_not, - expr_add, - expr_sub, - expr_mul, - expr_div, - expr_mod, - expr_shift_left, - expr_shift_right, - expr_bitwise_or, - expr_bitwise_and, - expr_bitwise_exor, - expr_equality, - expr_inequality, - expr_less_equal, - expr_greater_equal, - expr_less, - expr_greater, - expr_or, - expr_and, - expr_ternary, - expr_increment, - expr_decrement, - expr_assign_equal, - expr_assign_add, - expr_assign_sub, - expr_assign_mul, - expr_assign_div, - expr_assign_mod, - expr_assign_shift_left, - expr_assign_shift_right, - expr_assign_bitwise_or, - expr_assign_bitwise_and, - expr_assign_bitwise_exor, - stmt_list, - stmt_dev, - stmt_expr, - stmt_call, - stmt_assign, - stmt_endon, - stmt_notify, - stmt_wait, - stmt_waittill, - stmt_waittillmatch, - stmt_waittillframeend, - stmt_waitframe, - 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_create, - asm_access, - asm_remove, - asm_clear, -}; - -struct node; -struct expr_true; -struct expr_false; -struct expr_integer; -struct expr_float; -struct expr_vector; -struct expr_string; -struct expr_istring; -struct expr_path; -struct expr_identifier; -struct expr_animtree; -struct expr_animation; -struct expr_level; -struct expr_anim; -struct expr_self; -struct expr_game; -struct expr_undefined; -struct expr_empty_array; -struct expr_thisthread; -struct expr_paren; -struct expr_size; -struct expr_field; -struct expr_array; -struct expr_tuple; -struct expr_reference; -struct expr_istrue; -struct expr_isdefined; -struct expr_arguments; -struct expr_parameters; -struct expr_add_array; -struct expr_pointer; -struct expr_function; -struct expr_method; -struct expr_call; -struct expr_complement; -struct expr_negate; -struct expr_not; -struct expr_binary; -struct expr_add; -struct expr_sub; -struct expr_mul; -struct expr_div; -struct expr_mod; -struct expr_shift_left; -struct expr_shift_right; -struct expr_bitwise_or; -struct expr_bitwise_and; -struct expr_bitwise_exor; -struct expr_equality; -struct expr_inequality; -struct expr_less_equal; -struct expr_greater_equal; -struct expr_less; -struct expr_greater; -struct expr_or; -struct expr_and; -struct expr_ternary; -struct expr_increment; -struct expr_decrement; -struct expr_assign; -struct expr_assign_equal; -struct expr_assign_add; -struct expr_assign_sub; -struct expr_assign_mul; -struct expr_assign_div; -struct expr_assign_mod; -struct expr_assign_shift_left; -struct expr_assign_shift_right; -struct expr_assign_bitwise_or; -struct expr_assign_bitwise_and; -struct expr_assign_bitwise_exor; -struct stmt_list; -struct stmt_dev; -struct stmt_expr; -struct stmt_call; -struct stmt_assign; -struct stmt_endon; -struct stmt_notify; -struct stmt_wait; -struct stmt_waittill; -struct stmt_waittillmatch; -struct stmt_waittillframeend; -struct stmt_waitframe; -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_create; -struct asm_access; -struct asm_remove; -struct asm_clear; - -union call -{ - enum class type { local, far, builtin }; - enum class mode { normal, thread, childthread, builtin }; - - 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_string; - std::unique_ptr as_istring; - std::unique_ptr as_path; - std::unique_ptr as_identifier; - std::unique_ptr as_animtree; - std::unique_ptr as_animation; - std::unique_ptr as_level; - std::unique_ptr as_anim; - std::unique_ptr as_self; - std::unique_ptr as_game; - std::unique_ptr as_undefined; - std::unique_ptr as_empty_array; - std::unique_ptr as_thisthread; - std::unique_ptr as_paren; - std::unique_ptr as_size; - std::unique_ptr as_field; - std::unique_ptr as_array; - std::unique_ptr as_tuple; - std::unique_ptr as_reference; - std::unique_ptr as_istrue; - std::unique_ptr as_isdefined; - std::unique_ptr as_arguments; - std::unique_ptr as_parameters; - std::unique_ptr as_add_array; - std::unique_ptr as_pointer; - std::unique_ptr as_function; - std::unique_ptr as_method; - std::unique_ptr as_call; - std::unique_ptr as_complement; - std::unique_ptr as_negate; - std::unique_ptr as_not; - std::unique_ptr as_binary; - std::unique_ptr as_add; - std::unique_ptr as_sub; - std::unique_ptr as_mul; - std::unique_ptr as_div; - std::unique_ptr as_mod; - std::unique_ptr as_shift_left; - std::unique_ptr as_shift_right; - std::unique_ptr as_bitwise_or; - std::unique_ptr as_bitwise_and; - std::unique_ptr as_bitwise_exor; - std::unique_ptr as_equality; - std::unique_ptr as_inequality; - std::unique_ptr as_less_equal; - std::unique_ptr as_greater_equal; - std::unique_ptr as_less; - std::unique_ptr as_greater; - std::unique_ptr as_or; - std::unique_ptr as_and; - std::unique_ptr as_ternary; - std::unique_ptr as_increment; - std::unique_ptr as_decrement; - std::unique_ptr as_assign; - std::unique_ptr as_assign_equal; - std::unique_ptr as_assign_add; - std::unique_ptr as_assign_sub; - std::unique_ptr as_assign_mul; - std::unique_ptr as_assign_div; - std::unique_ptr as_assign_mod; - std::unique_ptr as_assign_shift_left; - std::unique_ptr as_assign_shift_right; - std::unique_ptr as_assign_bw_or; - std::unique_ptr as_assign_bw_and; - std::unique_ptr as_assign_bw_exor; - std::unique_ptr as_asm_create; - std::unique_ptr as_asm_access; - - 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_wait; - std::unique_ptr as_waittill; - std::unique_ptr as_waittillmatch; - std::unique_ptr as_waittillframeend; - std::unique_ptr as_waitframe; - 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_cond; - std::unique_ptr as_jump; - std::unique_ptr as_jump_back; - std::unique_ptr as_asm_switch; - std::unique_ptr as_asm_endswitch; - std::unique_ptr as_asm_create; - std::unique_ptr as_asm_access; - std::unique_ptr as_asm_remove; - std::unique_ptr as_asm_clear; - - 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_string : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_string(const std::string& value); - expr_string(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_string& lhs, const expr_string& rhs); -}; - -struct expr_istring : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_istring(const std::string& value); - expr_istring(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_istring& lhs, const expr_istring& rhs); -}; - -struct expr_path : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_path(); - expr_path(const std::string& value); - expr_path(const location& loc); - expr_path(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_path& lhs, const expr_path& rhs); -}; - -struct expr_identifier : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_identifier(const std::string& value); - expr_identifier(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_identifier& lhs, const expr_identifier& rhs); -}; - -struct expr_animtree : public node -{ - using ptr = std::unique_ptr; - - expr_animtree(); - expr_animtree(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_animtree& lhs, const expr_animtree& rhs); -}; - -struct expr_animation : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_animation(const std::string& value); - expr_animation(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_animation& lhs, const expr_animation& rhs); -}; - -struct expr_level : public node -{ - using ptr = std::unique_ptr; - - expr_level(); - expr_level(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_level& lhs, const expr_level& rhs); -}; - -struct expr_anim : public node -{ - using ptr = std::unique_ptr; - - expr_anim(); - expr_anim(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_anim& lhs, const expr_anim& rhs); -}; - -struct expr_self : public node -{ - using ptr = std::unique_ptr; - - expr_self(); - expr_self(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_self& lhs, const expr_self& rhs); -}; - -struct expr_game : public node -{ - using ptr = std::unique_ptr; - - expr_game(); - expr_game(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_game& lhs, const expr_game& rhs); -}; - -struct expr_undefined : public node -{ - using ptr = std::unique_ptr; - - expr_undefined(); - expr_undefined(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_undefined& lhs, const expr_undefined& rhs); -}; - -struct expr_empty_array : public node -{ - using ptr = std::unique_ptr; - - expr_empty_array(); - expr_empty_array(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_empty_array& lhs, const expr_empty_array& rhs); -}; - -struct expr_thisthread : public node -{ - using ptr = std::unique_ptr; - - expr_thisthread(); - expr_thisthread(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_thisthread& lhs, const expr_thisthread& 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_tuple : public node -{ - using ptr = std::unique_ptr; - - std::vector list; - expr temp; - - expr_tuple(); - expr_tuple(const location& loc); - auto print() const -> std::string override; -}; - -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_istrue : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - - expr_istrue(ast::expr expr); - expr_istrue(const location& loc, ast::expr expr); - auto print() const -> std::string override; -}; - -struct expr_isdefined : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - - expr_isdefined(ast::expr expr); - expr_isdefined(const location& loc, ast::expr expr); - 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_add_array : public node -{ - using ptr = std::unique_ptr; - - expr_arguments::ptr args; - - expr_add_array(expr_arguments::ptr args); - expr_add_array(const location& loc, expr_arguments::ptr args); - auto print() const -> std::string override; -}; - -struct expr_pointer : public node -{ - using ptr = std::unique_ptr; - - expr func; - expr_arguments::ptr args; - call::mode mode; - - expr_pointer(expr func, expr_arguments::ptr args, call::mode mode); - expr_pointer(const location& loc, expr func, expr_arguments::ptr args, call::mode mode); - auto print() const -> std::string override; -}; - -struct expr_function : public node -{ - using ptr = std::unique_ptr; - - expr_path::ptr path; - expr_identifier::ptr name; - expr_arguments::ptr args; - call::mode mode; - - expr_function(expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode); - expr_function(const location& loc, expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode); - auto print() const -> std::string override; -}; - -struct expr_method : public node -{ - using ptr = std::unique_ptr; - - expr obj; - ast::call call; - - expr_method(expr obj, ast::call call); - expr_method(const location& loc, expr obj, ast::call call); - auto print() const -> std::string override; -}; - -struct expr_call : public node -{ - using ptr = std::unique_ptr; - - ast::call call; - - expr_call(ast::call call); - expr_call(const location& loc, ast::call call); - auto print() const -> std::string override; -}; - -struct expr_complement : public node -{ - using ptr = std::unique_ptr; - - expr rvalue; - - expr_complement(expr rvalue); - expr_complement(const location& loc, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_negate : public node -{ - using ptr = std::unique_ptr; - - expr rvalue; - - expr_negate(expr rvalue); - expr_negate(const location& loc, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_not : public node -{ - using ptr = std::unique_ptr; - - expr rvalue; - - expr_not(expr rvalue); - expr_not(const location& loc, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_binary : public node -{ - using ptr = std::unique_ptr; - - expr lvalue; - expr rvalue; - - expr_binary(ast::kind kind, expr lvalue, expr rvalue); - expr_binary(ast::kind kind, const location& loc, expr lvalue, expr rvalue); - virtual auto print() const -> std::string = 0; -}; - -struct expr_add : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_add(expr lvalue, expr rvalue); - expr_add(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_sub : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_sub(expr lvalue, expr rvalue); - expr_sub(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_mul : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_mul(expr lvalue, expr rvalue); - expr_mul(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_div : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_div(expr lvalue, expr rvalue); - expr_div(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_mod : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_mod(expr lvalue, expr rvalue); - expr_mod(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_shift_left : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_shift_left(expr lvalue, expr rvalue); - expr_shift_left(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_shift_right : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_shift_right(expr lvalue, expr rvalue); - expr_shift_right(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_bitwise_or : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_bitwise_or(expr lvalue, expr rvalue); - expr_bitwise_or(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_bitwise_and : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_bitwise_and(expr lvalue, expr rvalue); - expr_bitwise_and(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_bitwise_exor : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_bitwise_exor(expr lvalue, expr rvalue); - expr_bitwise_exor(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_equality : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_equality(expr lvalue, expr rvalue); - expr_equality(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_inequality : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_inequality(expr lvalue, expr rvalue); - expr_inequality(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_less_equal : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_less_equal(expr lvalue, expr rvalue); - expr_less_equal(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_greater_equal : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_greater_equal(expr lvalue, expr rvalue); - expr_greater_equal(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_less : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_less(expr lvalue, expr rvalue); - expr_less(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_greater : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_greater(expr lvalue, expr rvalue); - expr_greater(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_or : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_or(expr lvalue, expr rvalue); - expr_or(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_and : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_and(expr lvalue, expr rvalue); - expr_and(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_ternary : public node -{ - using ptr = std::unique_ptr; - - expr test; - expr true_expr; - expr false_expr; - - expr_ternary(expr test, expr true_expr, expr false_expr); - expr_ternary(const location& loc, expr test, expr true_expr, expr false_expr); - auto print() const -> std::string override; -}; - -struct expr_increment : node -{ - using ptr = std::unique_ptr; - - expr lvalue; - bool prefix; - - expr_increment(expr lvalue, bool prefix); - expr_increment(const location& loc, expr lvalue, bool prefix); - auto print() const -> std::string override; -}; - -struct expr_decrement : node -{ - using ptr = std::unique_ptr; - - expr lvalue; - bool prefix; - - expr_decrement(expr lvalue, bool prefix); - expr_decrement(const location& loc, expr lvalue, bool prefix); - auto print() const -> std::string override; -}; - -struct expr_assign : public node -{ - using ptr = std::unique_ptr; - - expr lvalue; - expr rvalue; - - expr_assign(ast::kind kind, expr lvalue, expr rvalue); - expr_assign(ast::kind kind, const location& loc, expr lvalue, expr rvalue); - virtual auto print() const -> std::string = 0; -}; - -struct expr_assign_equal : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_equal(expr lvalue, expr rvalue); - expr_assign_equal(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_add : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_add(expr lvalue, expr rvalue); - expr_assign_add(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_sub : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_sub(expr lvalue, expr rvalue); - expr_assign_sub(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_mul : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_mul(expr lvalue, expr rvalue); - expr_assign_mul(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_div : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_div(expr lvalue, expr rvalue); - expr_assign_div(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_mod : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_mod(expr lvalue, expr rvalue); - expr_assign_mod(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_shift_left : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_shift_left(expr lvalue, expr rvalue); - expr_assign_shift_left(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_shift_right : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_shift_right(expr lvalue, expr rvalue); - expr_assign_shift_right(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_bitwise_or : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_bitwise_or(expr lvalue, expr rvalue); - expr_assign_bitwise_or(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_bitwise_and : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_bitwise_and(expr lvalue, expr rvalue); - expr_assign_bitwise_and(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_bitwise_exor : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_bitwise_exor(expr lvalue, expr rvalue); - expr_assign_bitwise_exor(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct stmt_list : public node -{ - using ptr = std::unique_ptr; - - std::vector list; - bool is_case = false; - bool is_expr = false; - - stmt_list(); - stmt_list(const location& loc); - auto print() const -> std::string override; -}; - -struct stmt_dev : public node -{ - using ptr = std::unique_ptr; - - stmt_list::ptr list; - - stmt_dev(stmt_list::ptr list); - stmt_dev(const location& loc, stmt_list::ptr list); - auto print() const -> std::string override; -}; - -struct stmt_expr : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - - stmt_expr(ast::expr expr); - stmt_expr(const location& loc, ast::expr expr); - auto print() const -> std::string override; -}; - -struct stmt_call : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - - stmt_call(ast::expr expr); - stmt_call(const location& loc, ast::expr expr); - auto print() const -> std::string override; -}; - -struct stmt_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_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_waitframe : public node -{ - using ptr = std::unique_ptr; - - stmt_waitframe(); - stmt_waitframe(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; - - ast::expr expr; - std::string value; - - asm_jump_cond(ast::expr expr, const std::string& value); - asm_jump_cond(const location& loc, ast::expr expr, const std::string& value); - auto print() const -> std::string override; -}; - -struct asm_jump_true_expr : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - std::string value; - - asm_jump_true_expr(ast::expr expr, const std::string& value); - asm_jump_true_expr(const location& loc, ast::expr expr, const std::string& value); - auto print() const -> std::string override; -}; - -struct asm_jump_false_expr : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - std::string value; - - asm_jump_false_expr(ast::expr expr, const std::string& value); - asm_jump_false_expr(const location& loc, ast::expr expr, const std::string& value); - auto print() const -> std::string override; -}; - -struct asm_switch : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - std::string value; - - asm_switch(ast::expr expr, const std::string& value); - asm_switch(const location& loc, ast::expr expr, const std::string& value); - auto print() const -> std::string override; -}; - -struct asm_endswitch : public node -{ - using ptr = std::unique_ptr; - - std::vector data; - std::string count; - - asm_endswitch(std::vector data, const std::string& count); - asm_endswitch(const location& loc, std::vector data, const std::string& count); - auto print() const -> std::string override; -}; - -struct asm_prescriptcall : public node -{ - using ptr = std::unique_ptr; - - asm_prescriptcall(); - asm_prescriptcall(const location& loc); - auto print() const -> std::string override; -}; - -struct asm_voidcodepos : public node -{ - using ptr = std::unique_ptr; - - asm_voidcodepos(); - asm_voidcodepos(const location& loc); - auto print() const -> std::string override; -}; - -struct asm_create : public node -{ - using ptr = std::unique_ptr; - - std::string index; - std::vector vars; - - asm_create(const std::string& index); - asm_create(const location& loc, const std::string& index); - auto print() const -> std::string override; -}; - -struct asm_access : public node -{ - using ptr = std::unique_ptr; - - std::string index; - - asm_access(const std::string& index); - asm_access(const location& loc, const std::string& index); - auto print() const -> std::string override; -}; - -struct asm_remove : public node -{ - using ptr = std::unique_ptr; - - std::string index; - - asm_remove(const std::string& index); - asm_remove(const location& loc, const std::string& index); - auto print() const -> std::string override; -}; - -struct asm_clear : public node -{ - using ptr = std::unique_ptr; - - std::string index; - - asm_clear(const std::string& index); - asm_clear(const location& loc, const std::string& index); - auto print() const -> std::string override; -}; - -} // namespace xsk::gsc::ast diff --git a/src/utils/xsk/gsc/types.hpp b/src/utils/xsk/gsc/types.hpp deleted file mode 100644 index 21361663..00000000 --- a/src/utils/xsk/gsc/types.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// 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::gsc -{ - -using read_cb_type = std::function(const std::string&)>; - -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::uint32_t id; - std::string name; - std::vector instructions; - std::unordered_map labels; - - function() : index(0), size(0), id(0) {} -}; - -} // namespace xsk::gsc diff --git a/src/utils/xsk/utils.hpp b/src/utils/xsk/utils.hpp deleted file mode 100644 index 4770a504..00000000 --- a/src/utils/xsk/utils.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// 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/file.hpp" -#include "utils/string.hpp" -#include "utils/byte_buffer.hpp" -#include "utils/compression.hpp" - -#include "gsc/location.hpp" -#include "gsc/types.hpp" -#include "gsc/asset.hpp" -#include "gsc/block.hpp" -#include "gsc/nodetree.hpp" - -#include "gsc/interfaces/exception.hpp" -#include "gsc/interfaces/assembler.hpp" -#include "gsc/interfaces/disassembler.hpp" -#include "gsc/interfaces/compiler.hpp" -#include "gsc/interfaces/decompiler.hpp" -#include "gsc/interfaces/context.hpp" - -#include "arc/location.hpp" -#include "arc/types.hpp" -#include "arc/block.hpp" -#include "arc/nodetree.hpp" - -#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" -#include "arc/interfaces/context.hpp" diff --git a/src/utils/xsk/utils/byte_buffer.cpp b/src/utils/xsk/utils/byte_buffer.cpp deleted file mode 100644 index b58a72e1..00000000 --- a/src/utils/xsk/utils/byte_buffer.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// 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::utils -{ - -byte_buffer::byte_buffer() -{ - data_.resize(0x100000); - std::fill(data_.begin(), data_.end(), '\0'); - size_ = static_cast(data_.size()); - pos_ = 0; -} - -byte_buffer::byte_buffer(std::uint32_t size) -{ - data_.resize(size); - std::fill(data_.begin(), data_.end(), '\0'); - size_ = size; - pos_ = 0; -} - -byte_buffer::byte_buffer(const std::vector& data) -{ - data_ = data; - size_ = static_cast(data_.size()); - pos_ = 0; -} - -byte_buffer::~byte_buffer() -{ - data_.clear(); - size_ = 0; - pos_ = 0; -} - -void byte_buffer::clear() -{ - std::fill(data_.begin(), data_.end(), '\0'); -} - -auto byte_buffer::is_avail() -> bool -{ - return (pos_ < size_) ? true : false; -} - -void byte_buffer::seek(std::uint32_t count) -{ - pos_ += count; -} - -void byte_buffer::seek_neg(std::uint32_t count) -{ - pos_ -= count; -} - -void byte_buffer::write_string(const std::string& data) -{ - if (pos_ + data.size() > size_) return; - - std::memcpy(reinterpret_cast(data_.data() + pos_), data.data(), data.size()); - pos_ += static_cast(data.size()); -} - -void byte_buffer::write_c_string(const std::string& data) -{ - if (pos_ + data.size() >= size_) return; - - std::memcpy(reinterpret_cast(data_.data() + pos_), data.data(), data.size()); - pos_ += static_cast(data.size() + 1); -} - -auto byte_buffer::read_c_string() -> std::string -{ - auto ret = std::string(reinterpret_cast(data_.data() + pos_)); - pos_ += static_cast(ret.size() + 1); - return ret; -} - -auto byte_buffer::print_bytes(std::uint32_t pos, std::uint32_t count) -> std::string -{ - std::string data {}; - - for (auto i = pos; i < pos + count; i++) - { - data = utils::string::va("%s %02X", data.data(), (*reinterpret_cast(data_.data() + i))); - } - - return data; -} - -auto byte_buffer::pos() -> std::uint32_t -{ - return pos_; -} - -void byte_buffer::pos(std::uint32_t pos) -{ - if (pos >= 0 && pos <= size_) - { - pos_ = pos; - } -} - -auto byte_buffer::align(std::uint32_t size) -> std::uint32_t -{ - auto pos = pos_; - - pos_ = (pos_ + (size - 1)) & ~(size - 1); - - return pos_ - pos; -} - -auto byte_buffer::buffer() -> std::vector& -{ - return data_; -} - -} // namespace xsk::utils diff --git a/src/utils/xsk/utils/byte_buffer.hpp b/src/utils/xsk/utils/byte_buffer.hpp deleted file mode 100644 index 2415fe72..00000000 --- a/src/utils/xsk/utils/byte_buffer.hpp +++ /dev/null @@ -1,93 +0,0 @@ -// 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::utils -{ - -class byte_buffer -{ -public: - using ptr = std::unique_ptr; - -private: - std::vector data_; - std::uint32_t size_; - std::uint32_t pos_; - -public: - byte_buffer(); - byte_buffer(std::uint32_t size); - byte_buffer(const std::vector& data); - ~byte_buffer(); - - template - auto read() -> T - { - if (pos_ + sizeof(T) > size_) return T{}; - - auto ret = *reinterpret_cast(data_.data() + pos_); - pos_ += sizeof(T); - return ret; - } - - template - void write(T data) - { - if (pos_ + sizeof(T) > size_) return; - - T* mem = reinterpret_cast(data_.data() + pos_); - std::memcpy(mem, &data, sizeof(T)); - pos_ += sizeof(T); - } - - template - auto read_endian() -> T - { - if (pos_ + sizeof(T) > size_) return T{}; - - std::array mem; - - for (auto i = 0u; i < sizeof(T); i++) - { - mem[i] = reinterpret_cast(data_.data() + pos_)[sizeof(T) - 1 - i]; - } - - pos_ += sizeof(T); - - return *reinterpret_cast(mem.data()); - } - - template - void write_endian(T data) - { - if (pos_ + sizeof(T) > size_) return; - - auto* mem = data_.data() + pos_; - - for (auto i = 0u; i < sizeof(T); i++) - { - mem[i] = reinterpret_cast(&data)[sizeof(T) - 1 - i]; - } - - pos_ += sizeof(T); - } - - void clear(); - auto is_avail() -> bool; - void seek(std::uint32_t count); - void seek_neg(std::uint32_t count); - void write_string(const std::string& data); - void write_c_string(const std::string& data); - auto read_c_string() -> std::string; - auto print_bytes(std::uint32_t pos, std::uint32_t count) -> std::string; - auto pos() -> std::uint32_t; - void pos(std::uint32_t pos); - auto align(std::uint32_t size) -> std::uint32_t; - auto buffer() -> std::vector&; -}; - -} // namespace xsk::utils diff --git a/src/utils/xsk/utils/compression.cpp b/src/utils/xsk/utils/compression.cpp deleted file mode 100644 index e66dd2ed..00000000 --- a/src/utils/xsk/utils/compression.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// 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 "zlib.h" - -namespace xsk::utils -{ - -auto zlib::compress(const std::vector& data) -> std::vector -{ - auto length = compressBound(static_cast(data.size())); - - std::vector output; - output.resize(length); - - auto result = compress2(reinterpret_cast(output.data()), &length, reinterpret_cast(data.data()), static_cast(data.size()), Z_BEST_COMPRESSION); - - if (result != Z_OK) return {}; - - output.resize(length); - - return output; -} - -auto zlib::decompress(const std::vector& data, std::uint32_t length) -> std::vector -{ - std::vector output; - output.resize(length); - - auto result = uncompress(reinterpret_cast(output.data()), reinterpret_cast(&length), reinterpret_cast(data.data()), static_cast(data.size())); - - if (result != Z_OK) return {}; - - return output; -} - -} // namespace xsk::uitls diff --git a/src/utils/xsk/utils/compression.hpp b/src/utils/xsk/utils/compression.hpp deleted file mode 100644 index f2dfbc26..00000000 --- a/src/utils/xsk/utils/compression.hpp +++ /dev/null @@ -1,18 +0,0 @@ -// 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::utils -{ - -class zlib -{ -public: - static auto compress(const std::vector& data) -> std::vector; - static auto decompress(const std::vector& data, std::uint32_t length) -> std::vector; -}; - -} // namespace xsk::utils diff --git a/src/utils/xsk/utils/file.cpp b/src/utils/xsk/utils/file.cpp deleted file mode 100644 index fd78978f..00000000 --- a/src/utils/xsk/utils/file.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// 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::utils -{ - -auto file::read(const std::string& file) -> std::vector -{ - std::vector data; - - std::ifstream stream(file, std::ios::binary); - - if (!stream.good() && !stream.is_open()) - { - throw std::runtime_error("Couldn't open file " + file); - } - - stream.seekg(0, std::ios::end); - std::streamsize size = stream.tellg(); - stream.seekg(0, std::ios::beg); - - if (size > -1) - { - data.resize(static_cast(size)); - stream.read(reinterpret_cast(data.data()), size); - } - - stream.close(); - - return data; -} - -void file::save(const std::string& file, const std::vector& data) -{ - const auto pos = file.find_last_of("/\\"); - - if (pos != std::string::npos) - { - std::filesystem::create_directories(file.substr(0, pos)); - } - - std::ofstream stream(file, std::ios::binary | std::ofstream::out); - - if (stream.is_open()) - { - stream.write(reinterpret_cast(data.data()), data.size()); - stream.close(); - } -} - -auto file::length(const std::string& file) -> size_t -{ - auto stream = std::ifstream(file, std::ios::binary); - - if (stream.good()) - { - stream.seekg(0, std::ios::end); - return static_cast(stream.tellg()); - } - - return 0; -} - -auto file::exists(const std::string& file) -> bool -{ - return std::filesystem::exists(file); -} - -} // namespace xsk::utils diff --git a/src/utils/xsk/utils/file.hpp b/src/utils/xsk/utils/file.hpp deleted file mode 100644 index ace37c04..00000000 --- a/src/utils/xsk/utils/file.hpp +++ /dev/null @@ -1,20 +0,0 @@ -// 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::utils -{ - -class file -{ -public: - static auto read(const std::string& file) -> std::vector; - static void save(const std::string& file, const std::vector& data); - static auto length(const std::string& file) -> size_t; - static auto exists(const std::string& file) -> bool; -}; - -} // namespace xsk::utils diff --git a/src/utils/xsk/utils/string.hpp b/src/utils/xsk/utils/string.hpp deleted file mode 100644 index 8ef6cedc..00000000 --- a/src/utils/xsk/utils/string.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// 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::utils -{ - -class string -{ -public: - template - static auto va(const std::string& format, Args ... args) -> std::string - { - size_t size = snprintf(nullptr, 0, format.data(), args ...) + 1; - std::vector buf; - buf.resize(size); - snprintf(buf.data(), size, format.data(), args ...); - return std::string(buf.data(), buf.data() + size - 1); - } - - static auto oct_to_dec(const char* str) -> std::string; - static auto bin_to_dec(const char* str) -> std::string; - static auto hex_to_dec(const char* str) -> std::string; - static auto iequals(const std::string& a, const std::string& b) -> bool; - static auto is_number(const std::string& s) -> bool; - static auto is_hex_number(const std::string& s) -> bool; - static auto to_lower(const std::string& input) -> std::string; - static auto to_code(const std::string& input) -> std::string; - static auto to_literal(const std::string& input) -> std::string; - static auto fordslash(const std::string& s) -> std::string; - static auto backslash(const std::string& s) -> std::string; - static auto quote(const std::string& s, bool single = true) -> std::string; - static auto unquote(const std::string& s) -> std::string; - static auto split(std::string& str, char delimiter) -> std::vector; - static auto clean_buffer_lines(std::vector& buffer) -> std::vector; - static auto parse_code(std::string& line) -> std::vector; - static auto float_string(float value) -> std::string; -}; - -} // namespace xsk::utils diff --git a/src/utils/zlib.cpp b/src/utils/zlib.cpp new file mode 100644 index 00000000..efd07d17 --- /dev/null +++ b/src/utils/zlib.cpp @@ -0,0 +1,44 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdinc.hpp" +#include "zlib.hpp" +#include "zlib.h" + +namespace xsk::utils +{ + +auto zlib::compress(std::vector const& data) -> std::vector +{ + auto length = compressBound(static_cast(data.size())); + + auto output = std::vector{}; + output.resize(length); + + auto result = compress2(reinterpret_cast(output.data()), &length, reinterpret_cast(data.data()), static_cast(data.size()), Z_BEST_COMPRESSION); + + if (result == Z_OK) + { + output.resize(length); + return output; + } + + throw std::runtime_error(fmt::format("zlib compress error {}", result)); +} + +auto zlib::decompress(std::vector const& data, u32 length) -> std::vector +{ + auto output = std::vector{}; + output.resize(length); + + auto result = uncompress(reinterpret_cast(output.data()), reinterpret_cast(&length), reinterpret_cast(data.data()), static_cast(data.size())); + + if (result == Z_OK) + return output; + + throw std::runtime_error(fmt::format("zlib decompress error {}", result)); +} + +} // namespace xsk::uitls diff --git a/src/utils/zlib.hpp b/src/utils/zlib.hpp new file mode 100644 index 00000000..a07496de --- /dev/null +++ b/src/utils/zlib.hpp @@ -0,0 +1,18 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::utils +{ + +class zlib +{ +public: + static auto compress(std::vector const& data) -> std::vector; + static auto decompress(std::vector const& data, u32 length) -> std::vector; +}; + +} // namespace xsk::utils